Changeset 132 for palm/trunk/SOURCE/flow_statistics.f90
 Timestamp:
 Nov 20, 2007 9:46:11 AM (16 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

palm/trunk/SOURCE/flow_statistics.f90
r110 r132 4 4 ! Actual revisions: 5 5 !  6 ! Vertical profiles now based on nzb_s_inner; they are divided by 7 ! ngp_2dh_s_inner (scalars, procucts of scalars and velocity components) and 8 ! ngp_2dh (staggered velocity components and their products), respectively. 6 9 ! 7 10 ! … … 49 52 ! userdefined (sub)regions. The region indexed 0 is the total model domain. 50 53 ! 51 ! NOTE: For simplicity, nzb_s_outer and nzb_diff_s_outer are being used as a 52 !  lower vertical index for kloops for all variables so that regardless 53 ! of the variable and its respective staggered grid always the same number of 54 ! grid points is used for 2D averages. The disadvantage: depending on the 55 ! variable, up to one grid layer adjacent to the (vertical walls of the) 56 ! topography is missed out by this simplification. 54 ! NOTE: For simplicity, nzb_s_inner and nzb_diff_s_inner are being used as a 55 !  lower vertical index for kloops for all variables, although strictly 56 ! speaking the kloops would have to be split up according to the staggered 57 ! grid. However, this implies no error since staggered velocity components are 58 ! zero at the walls and inside buildings. 57 59 !! 58 60 … … 124 126 DO i = nxl, nxr 125 127 DO j = nys, nyn 126 DO k = nzb_s_ outer(j,i), nzt+1128 DO k = nzb_s_inner(j,i), nzt+1 127 129 sums_l(k,1,tn) = sums_l(k,1,tn) + u(k,j,i) * rmask(j,i,sr) 128 130 sums_l(k,2,tn) = sums_l(k,2,tn) + v(k,j,i) * rmask(j,i,sr) … … 138 140 DO i = nxl, nxr 139 141 DO j = nys, nyn 140 DO k = nzb_s_ outer(j,i), nzt+1142 DO k = nzb_s_inner(j,i), nzt+1 141 143 sums_l(k,23,tn) = sums_l(k,23,tn) + & 142 144 sa(k,j,i) * rmask(j,i,sr) … … 154 156 DO i = nxl, nxr 155 157 DO j = nys, nyn 156 DO k = nzb_s_ outer(j,i), nzt+1158 DO k = nzb_s_inner(j,i), nzt+1 157 159 sums_l(k,44,tn) = sums_l(k,44,tn) + & 158 160 vpt(k,j,i) * rmask(j,i,sr) … … 166 168 DO i = nxl, nxr 167 169 DO j = nys, nyn 168 DO k = nzb_s_ outer(j,i), nzt+1170 DO k = nzb_s_inner(j,i), nzt+1 169 171 sums_l(k,42,tn) = sums_l(k,42,tn) + & 170 172 ( q(k,j,i)  ql(k,j,i) ) * rmask(j,i,sr) … … 184 186 DO i = nxl, nxr 185 187 DO j = nys, nyn 186 DO k = nzb_s_ outer(j,i), nzt+1188 DO k = nzb_s_inner(j,i), nzt+1 187 189 sums_l(k,41,tn) = sums_l(k,41,tn) + q(k,j,i) * rmask(j,i,sr) 188 190 ENDDO … … 265 267 ! Final values are obtained by division by the total number of grid points 266 268 ! used for summation. After that store profiles. 267 sums(:,1) = sums(:,1) / ngp_2dh _outer(:,sr)268 sums(:,2) = sums(:,2) / ngp_2dh _outer(:,sr)269 sums(:,4) = sums(:,4) / ngp_2dh_ outer(:,sr)269 sums(:,1) = sums(:,1) / ngp_2dh(sr) 270 sums(:,2) = sums(:,2) / ngp_2dh(sr) 271 sums(:,4) = sums(:,4) / ngp_2dh_s_inner(:,sr) 270 272 hom(:,1,1,sr) = sums(:,1) ! u 271 273 hom(:,1,2,sr) = sums(:,2) ! v … … 275 277 ! Salinity 276 278 IF ( ocean ) THEN 277 sums(:,23) = sums(:,23) / ngp_2dh_ outer(:,sr)279 sums(:,23) = sums(:,23) / ngp_2dh_s_inner(:,sr) 278 280 hom(:,1,23,sr) = sums(:,23) ! sa 279 281 ENDIF … … 282 284 ! Humidity and cloud parameters 283 285 IF ( humidity ) THEN 284 sums(:,44) = sums(:,44) / ngp_2dh_ outer(:,sr)285 sums(:,41) = sums(:,41) / ngp_2dh_ outer(:,sr)286 sums(:,44) = sums(:,44) / ngp_2dh_s_inner(:,sr) 287 sums(:,41) = sums(:,41) / ngp_2dh_s_inner(:,sr) 286 288 hom(:,1,44,sr) = sums(:,44) ! vpt 287 289 hom(:,1,41,sr) = sums(:,41) ! qv (q) 288 290 IF ( cloud_physics ) THEN 289 sums(:,42) = sums(:,42) / ngp_2dh_ outer(:,sr)290 sums(:,43) = sums(:,43) / ngp_2dh_ outer(:,sr)291 sums(:,42) = sums(:,42) / ngp_2dh_s_inner(:,sr) 292 sums(:,43) = sums(:,43) / ngp_2dh_s_inner(:,sr) 291 293 hom(:,1,42,sr) = sums(:,42) ! qv 292 294 hom(:,1,43,sr) = sums(:,43) ! pt … … 296 298 ! 297 299 ! Passive scalar 298 IF ( passive_scalar ) hom(:,1,41,sr) = sums(:,41) / ngp_2dh_outer(:,sr) 300 IF ( passive_scalar ) hom(:,1,41,sr) = sums(:,41) / & 301 ngp_2dh_s_inner(:,sr) ! s (q) 299 302 300 303 ! … … 302 305 ! variances, the total and the perturbation energy (single values in last 303 306 ! column of sums_l) and some diagnostic quantities. 304 ! NOTE: for simplicity, nzb_s_ outer is used below, although strictly307 ! NOTE: for simplicity, nzb_s_inner is used below, although strictly 305 308 !  speaking the following kloop would have to be split up and 306 309 ! rearranged according to the staggered grid. 310 ! However, this implies no error since staggered velocity components 311 ! are zero at the walls and inside buildings. 307 312 tn = 0 308 313 #if defined( __intel_openmp_bug ) … … 319 324 sums_l_etot = 0.0 320 325 sums_l_eper = 0.0 321 DO k = nzb_s_ outer(j,i), nzt+1326 DO k = nzb_s_inner(j,i), nzt+1 322 327 u2 = u(k,j,i)**2 323 328 v2 = v(k,j,i)**2 … … 382 387 ! Subgridscale fluxes (without Prandtl layer from k=nzb, 383 388 ! oterwise from k=nzb+1) 384 ! NOTE: for simplicity, nzb_diff_s_ outer is used below, although389 ! NOTE: for simplicity, nzb_diff_s_inner is used below, although 385 390 !  strictly speaking the following kloop would have to be 386 391 ! split up according to the staggered grid. 387 DO k = nzb_diff_s_outer(j,i)1, nzt_diff 392 ! However, this implies no error since staggered velocity 393 ! components are zero at the walls and inside buildings. 394 395 DO k = nzb_diff_s_inner(j,i)1, nzt_diff 388 396 ! 389 397 ! Momentum flux w"u" … … 528 536 ! 529 537 ! Resolved fluxes (can be computed for all horizontal points) 530 ! NOTE: for simplicity, nzb_s_ outer is used below, although strictly538 ! NOTE: for simplicity, nzb_s_inner is used below, although strictly 531 539 !  speaking the following kloop would have to be split up and 532 540 ! rearranged according to the staggered grid. 533 DO k = nzb_s_ outer(j,i), nzt541 DO k = nzb_s_inner(j,i), nzt 534 542 ust = 0.5 * ( u(k,j,i)  hom(k,1,1,sr) + & 535 543 u(k+1,j,i)  hom(k+1,1,1,sr) ) … … 634 642 DO i = nxl, nxr 635 643 DO j = nys, nyn 636 DO k = nzb_s_ outer(j,i)+1, nzt644 DO k = nzb_s_inner(j,i)+1, nzt 637 645 638 646 sums_ll(k,1) = sums_ll(k,1) + 0.5 * w(k,j,i) * ( & … … 656 664 sums_ll(nzt+1,2) = 0.0 657 665 658 DO k = nzb_s_ outer(j,i)+1, nzt666 DO k = nzb_s_inner(j,i)+1, nzt 659 667 sums_l(k,55,tn) = ( sums_ll(k,1)  sums_ll(k1,1) ) * ddzw(k) 660 668 sums_l(k,56,tn) = ( sums_ll(k,2)  sums_ll(k1,2) ) * ddzw(k) … … 674 682 DO i = nxl, nxr 675 683 DO j = nys, nyn 676 DO k = nzb_s_ outer(j,i)+1, nzt684 DO k = nzb_s_inner(j,i)+1, nzt 677 685 678 686 sums_l(k,57,tn) = sums_l(k,57,tn)  0.5 * ( & … … 701 709 DO i = nxl, nxr 702 710 DO j = nys, nyn 703 DO k = nzb_s_ outer(j,i)+1, nzt711 DO k = nzb_s_inner(j,i)+1, nzt 704 712 ! 705 713 ! Subgrid horizontal heat fluxes u"pt", v"pt" … … 773 781 ! Profiles: 774 782 DO k = nzb, nzt+1 775 sums(k,:pr_palm2) = sums(k,:pr_palm2) / ngp_2dh_outer(k,sr) 783 sums(k,3) = sums(k,3) / ngp_2dh(sr) 784 sums(k,9:11) = sums(k,9:11) / ngp_2dh_s_inner(k,sr) 785 sums(k,12:22) = sums(k,12:22) / ngp_2dh(sr) 786 sums(k,23:29) = sums(k,23:29) / ngp_2dh_s_inner(k,sr) 787 sums(k,30:32) = sums(k,30:32) / ngp_2dh(sr) 788 sums(k,33) = sums(k,33) / ngp_2dh_s_inner(k,sr) 789 sums(k,34:39) = sums(k,34:39) / ngp_2dh(sr) 790 sums(k,40) = sums(k,40) / ngp_2dh_s_inner(k,sr) 791 sums(k,45:53) = sums(k,45:53) / ngp_2dh(sr) 792 sums(k,54) = sums(k,54) / ngp_2dh_s_inner(k,sr) 793 sums(k,55:63) = sums(k,55:63) / ngp_2dh(sr) 794 sums(k,64) = sums(k,64) / ngp_2dh_s_inner(k,sr) 795 sums(k,65:69) = sums(k,65:69) / ngp_2dh(sr) 796 sums(k,70:pr_palm2) = sums(k,70:pr_palm2)/ ngp_2dh_s_inner(k,sr) 776 797 ENDDO 777 798 ! Upstreamparts … … 785 806 ! eges, e* 786 807 sums(nzb+4:nzb+5,pr_palm) = sums(nzb+4:nzb+5,pr_palm) / & 787 ngp_3d _inner(sr)808 ngp_3d(sr) 788 809 ! Old and new divergence 789 810 sums(nzb+9:nzb+10,pr_palm) = sums(nzb+9:nzb+10,pr_palm) / & … … 795 816 sums(k,pr_palm+1:pr_palm+max_pr_user) = & 796 817 sums(k,pr_palm+1:pr_palm+max_pr_user) / & 797 ngp_2dh_ outer(k,sr)818 ngp_2dh_s_inner(k,sr) 798 819 ENDDO 799 820 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.