Ignore:
Timestamp:
Nov 20, 2007 9:46:11 AM (14 years ago)
Author:
letzel
Message:

Vertical profiles now based on nzb_s_inner; they are divided by
ngp_2dh_s_inner (scalars, procucts of scalars and velocity components) and
ngp_2dh (staggered velocity components and their products), respectively.

Allow new case bc_uv_t = 'dirichlet_0' for channel flow.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/flow_statistics.f90

    r110 r132  
    44! Actual revisions:
    55! -----------------
     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.
    69!
    710!
     
    4952! user-defined (sub-)regions. The region indexed 0 is the total model domain.
    5053!
    51 ! NOTE: For simplicity, nzb_s_outer and nzb_diff_s_outer are being used as a
    52 ! ----  lower vertical index for k-loops 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 k-loops for all variables, although strictly
     56! speaking the k-loops 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.
    5759!------------------------------------------------------------------------------!
    5860
     
    124126       DO  i = nxl, nxr
    125127          DO  j =  nys, nyn
    126              DO  k = nzb_s_outer(j,i), nzt+1
     128             DO  k = nzb_s_inner(j,i), nzt+1
    127129                sums_l(k,1,tn)  = sums_l(k,1,tn)  + u(k,j,i)  * rmask(j,i,sr)
    128130                sums_l(k,2,tn)  = sums_l(k,2,tn)  + v(k,j,i)  * rmask(j,i,sr)
     
    138140          DO  i = nxl, nxr
    139141             DO  j =  nys, nyn
    140                 DO  k = nzb_s_outer(j,i), nzt+1
     142                DO  k = nzb_s_inner(j,i), nzt+1
    141143                   sums_l(k,23,tn)  = sums_l(k,23,tn) + &
    142144                                      sa(k,j,i) * rmask(j,i,sr)
     
    154156          DO  i = nxl, nxr
    155157             DO  j =  nys, nyn
    156                 DO  k = nzb_s_outer(j,i), nzt+1
     158                DO  k = nzb_s_inner(j,i), nzt+1
    157159                   sums_l(k,44,tn)  = sums_l(k,44,tn) + &
    158160                                      vpt(k,j,i) * rmask(j,i,sr)
     
    166168             DO  i = nxl, nxr
    167169                DO  j =  nys, nyn
    168                    DO  k = nzb_s_outer(j,i), nzt+1
     170                   DO  k = nzb_s_inner(j,i), nzt+1
    169171                      sums_l(k,42,tn) = sums_l(k,42,tn) + &
    170172                                      ( q(k,j,i) - ql(k,j,i) ) * rmask(j,i,sr)
     
    184186          DO  i = nxl, nxr
    185187             DO  j =  nys, nyn
    186                 DO  k = nzb_s_outer(j,i), nzt+1
     188                DO  k = nzb_s_inner(j,i), nzt+1
    187189                   sums_l(k,41,tn)  = sums_l(k,41,tn) + q(k,j,i) * rmask(j,i,sr)
    188190                ENDDO
     
    265267!--    Final values are obtained by division by the total number of grid points
    266268!--    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)
    270272       hom(:,1,1,sr) = sums(:,1)             ! u
    271273       hom(:,1,2,sr) = sums(:,2)             ! v
     
    275277!--    Salinity
    276278       IF ( ocean )  THEN
    277           sums(:,23) = sums(:,23) / ngp_2dh_outer(:,sr)
     279          sums(:,23) = sums(:,23) / ngp_2dh_s_inner(:,sr)
    278280          hom(:,1,23,sr) = sums(:,23)             ! sa
    279281       ENDIF
     
    282284!--    Humidity and cloud parameters
    283285       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)
    286288          hom(:,1,44,sr) = sums(:,44)             ! vpt
    287289          hom(:,1,41,sr) = sums(:,41)             ! qv (q)
    288290          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)
    291293             hom(:,1,42,sr) = sums(:,42)             ! qv
    292294             hom(:,1,43,sr) = sums(:,43)             ! pt
     
    296298!
    297299!--    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)
    299302
    300303!
     
    302305!--    variances, the total and the perturbation energy (single values in last
    303306!--    column of sums_l) and some diagnostic quantities.
    304 !--    NOTE: for simplicity, nzb_s_outer is used below, although strictly
     307!--    NOTE: for simplicity, nzb_s_inner is used below, although strictly
    305308!--    ----  speaking the following k-loop would have to be split up and
    306309!--          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.
    307312       tn = 0
    308313#if defined( __intel_openmp_bug )
     
    319324             sums_l_etot = 0.0
    320325             sums_l_eper = 0.0
    321              DO  k = nzb_s_outer(j,i), nzt+1
     326             DO  k = nzb_s_inner(j,i), nzt+1
    322327                u2   = u(k,j,i)**2
    323328                v2   = v(k,j,i)**2
     
    382387!--          Subgridscale fluxes (without Prandtl layer from k=nzb,
    383388!--          oterwise from k=nzb+1)
    384 !--          NOTE: for simplicity, nzb_diff_s_outer is used below, although
     389!--          NOTE: for simplicity, nzb_diff_s_inner is used below, although
    385390!--          ----  strictly speaking the following k-loop would have to be
    386391!--                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
    388396!
    389397!--             Momentum flux w"u"
     
    528536!
    529537!--          Resolved fluxes (can be computed for all horizontal points)
    530 !--          NOTE: for simplicity, nzb_s_outer is used below, although strictly
     538!--          NOTE: for simplicity, nzb_s_inner is used below, although strictly
    531539!--          ----  speaking the following k-loop would have to be split up and
    532540!--                rearranged according to the staggered grid.
    533              DO  k = nzb_s_outer(j,i), nzt
     541             DO  k = nzb_s_inner(j,i), nzt
    534542                ust = 0.5 * ( u(k,j,i)   - hom(k,1,1,sr) + &
    535543                              u(k+1,j,i) - hom(k+1,1,1,sr) )
     
    634642          DO  i = nxl, nxr
    635643             DO  j = nys, nyn
    636                 DO  k = nzb_s_outer(j,i)+1, nzt
     644                DO  k = nzb_s_inner(j,i)+1, nzt
    637645
    638646                   sums_ll(k,1) = sums_ll(k,1) + 0.5 * w(k,j,i) * (        &
     
    656664          sums_ll(nzt+1,2) = 0.0
    657665
    658           DO  k = nzb_s_outer(j,i)+1, nzt
     666          DO  k = nzb_s_inner(j,i)+1, nzt
    659667             sums_l(k,55,tn) = ( sums_ll(k,1) - sums_ll(k-1,1) ) * ddzw(k)
    660668             sums_l(k,56,tn) = ( sums_ll(k,2) - sums_ll(k-1,2) ) * ddzw(k)
     
    674682          DO  i = nxl, nxr
    675683             DO  j = nys, nyn
    676                 DO  k = nzb_s_outer(j,i)+1, nzt
     684                DO  k = nzb_s_inner(j,i)+1, nzt
    677685
    678686                   sums_l(k,57,tn) = sums_l(k,57,tn) - 0.5 * (                 &
     
    701709          DO  i = nxl, nxr
    702710             DO  j = nys, nyn
    703                 DO  k = nzb_s_outer(j,i)+1, nzt
     711                DO  k = nzb_s_inner(j,i)+1, nzt
    704712!
    705713!--                Subgrid horizontal heat fluxes u"pt", v"pt"
     
    773781!--    Profiles:
    774782       DO  k = nzb, nzt+1
    775           sums(k,:pr_palm-2)      = sums(k,:pr_palm-2) / 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_palm-2)    = sums(k,70:pr_palm-2)/ ngp_2dh_s_inner(k,sr)
    776797       ENDDO
    777798!--    Upstream-parts
     
    785806!--    eges, e*
    786807       sums(nzb+4:nzb+5,pr_palm)  = sums(nzb+4:nzb+5,pr_palm)  / &
    787                                     ngp_3d_inner(sr)
     808                                    ngp_3d(sr)
    788809!--    Old and new divergence
    789810       sums(nzb+9:nzb+10,pr_palm) = sums(nzb+9:nzb+10,pr_palm) / &
     
    795816             sums(k,pr_palm+1:pr_palm+max_pr_user) = &
    796817                                    sums(k,pr_palm+1:pr_palm+max_pr_user) / &
    797                                     ngp_2dh_outer(k,sr)
     818                                    ngp_2dh_s_inner(k,sr)
    798819          ENDDO
    799820       ENDIF
Note: See TracChangeset for help on using the changeset viewer.