Ignore:
Timestamp:
Jun 12, 2018 7:03:02 AM (6 years ago)
Author:
Giersch
Message:

New vertical stretching procedure has been introduced

File:
1 edited

Legend:

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

    r3049 r3065  
    2828! -----------------
    2929! $Id$
     30! dz was replaced by dz(1), error message concerning vertical stretching was
     31! added 
     32!
     33! 3049 2018-05-29 13:52:36Z Giersch
    3034! Error messages revised
    3135!
     
    330334! ------------
    331335!> Radiation models and interfaces
     336!> @todo Replace dz(1) appropriatly to account for grid stretching
    332337!> @todo move variable definitions used in radiation_init only to the subroutine
    333338!>       as they are no longer required after initialization.
     
    43714376     IF ( plant_canopy )  THEN
    43724377         pchf_prep(:) = r_d * (hyp(nzub:nzut) / 100000.0_wp)**0.286_wp &
    4373                      / (cp * hyp(nzub:nzut) * dx*dy*dz) !< equals to 1 / (rho * c_p * Vbox * T)
     4378                     / (cp * hyp(nzub:nzut) * dx*dy*dz(1)) !< equals to 1 / (rho * c_p * Vbox * T)
    43744379         pctf_prep(:) = r_d * (hyp(nzub:nzut) / 100000.0_wp)**0.286_wp &
    43754380                     / (l_v * hyp(nzub:nzut) * dx*dy*dz)
     
    43964401!--         each dimension, so that this new direction vector will allow us
    43974402!--         to traverse the ray path within grid coordinates directly
    4398          sunorig_grid = (/ sunorig(1)/dz, sunorig(2)/dy, sunorig(3)/dx /)
     4403         sunorig_grid = (/ sunorig(1)/dz(1), sunorig(2)/dy, sunorig(3)/dx /)
    43994404!--         sunorig_grid = sunorig_grid / norm2(sunorig_grid)
    44004405         sunorig_grid = sunorig_grid / SQRT(SUM(sunorig_grid**2))
     
    44034408!--            precompute effective box depth with prototype Leaf Area Density
    44044409            pc_box_dimshift = MAXLOC(ABS(sunorig), 1) - 1
    4405             CALL box_absorb(CSHIFT((/dz,dy,dx/), pc_box_dimshift),      &
     4410            CALL box_absorb(CSHIFT((/dz(1),dy,dx/), pc_box_dimshift),      &
    44064411                                60, prototype_lad,                          &
    44074412                                CSHIFT(ABS(sunorig), pc_box_dimshift),      &
     
    48014806        IF ( idir(d) == 0 ) facearea(d) = facearea(d) * dx
    48024807        IF ( jdir(d) == 0 ) facearea(d) = facearea(d) * dy
    4803         IF ( kdir(d) == 0 ) facearea(d) = facearea(d) * dz
     4808        IF ( kdir(d) == 0 ) facearea(d) = facearea(d) * dz(1)
    48044809     ENDDO
    48054810!
     
    50145019    SUBROUTINE radiation_interaction_init
    50155020
     5021       USE control_parameters,                                                 &
     5022           ONLY:  dz_stretch_level_start
     5023           
    50165024       USE netcdf_data_input_mod,                                              &
    50175025           ONLY:  leaf_area_density_f
     
    50955103       nzpt = nzptl
    50965104#endif
     5105!
     5106!--    Stretching (non-uniform grid spacing) is not considered in the radiation
     5107!--    model. Therefore, vertical stretching has to be applied above the area
     5108!--    where the parts of the radiation model which assume constant grid spacing
     5109!--    are active. ABS (...) is required because the default value of
     5110!--    dz_stretch_level_start is -9999999.9_wp (negative).
     5111       IF ( ABS( dz_stretch_level_start(1) ) <= zw(nzut) ) THEN
     5112          WRITE( message_string, * ) 'The lowest level where vertical ',       &
     5113                                     'stretching is applied have to be ',      &
     5114                                     'greater than ', zw(nzut)
     5115          CALL message( 'init_grid', 'PA0496', 1, 2, 0, 6, 0 )
     5116       ENDIF
    50975117!
    50985118!--    global number of urban and plant layers
     
    53905410            IF ( idir(d) == 0 ) facearea(d) = facearea(d) * dx
    53915411            IF ( jdir(d) == 0 ) facearea(d) = facearea(d) * dy
    5392             IF ( kdir(d) == 0 ) facearea(d) = facearea(d) * dz
     5412            IF ( kdir(d) == 0 ) facearea(d) = facearea(d) * dz(1)
    53935413        ENDDO
    53945414
     
    55125532
    55135533!--                 unit vector source -> target
    5514                     uv = (/ (ta(1)-sa(1))*dz, (ta(2)-sa(2))*dy, (ta(3)-sa(3))*dx /)
     5534                    uv = (/ (ta(1)-sa(1))*dz(1), (ta(2)-sa(2))*dy, (ta(3)-sa(3))*dx /)
    55155535                    sqdist = SUM(uv(:)**2)
    55165536                    uv = uv / SQRT(sqdist)
     
    56775697
    56785698!--               unit vector source -> target
    5679                   uv = (/ (ta(1)-sa(1))*dz, (ta(2)-sa(2))*dy, (ta(3)-sa(3))*dx /)
     5699                  uv = (/ (ta(1)-sa(1))*dz(1), (ta(2)-sa(2))*dy, (ta(3)-sa(3))*dx /)
    56805700                  sqdist = SUM(uv(:)**2)
    56815701                  uv = uv / SQRT(sqdist)
     
    61276147        ENDIF
    61286148        uvect(:) = delta(:) / distance
    6129         realdist = SQRT(SUM( (uvect(:)*(/dz,dy,dx/))**2 ))
     6149        realdist = SQRT(SUM( (uvect(:)*(/dz(1),dy,dx/))**2 ))
    61306150
    61316151        lastdist = 0._wp
     
    65096529                     zb1 = CEILING(zexit * zsgn - .5_wp) - 1  ! because it must be smaller than exit
    65106530                     nz = MAX(zb1 - zb0 + 3, 2)
    6511                      rt2_dist(nz) = SQRT(((zexit-zorig)*dz)**2 + dxxyy)
     6531                     rt2_dist(nz) = SQRT(((zexit-zorig)*dz(1))**2 + dxxyy)
    65126532                     qdist = rt2_dist(nz) / (zexit-zorig)
    65136533                     rt2_dist(2:nz-1) = (/( ((REAL(l, wp) + .5_wp) * zsgn - zorig) * qdist , l = zb0, zb1 )/)
     
    65676587                  zb1 = CEILING(zexit * zsgn - .5_wp) - 1  ! because it must be smaller than exit
    65686588                  nz = MAX(zb1 - zb0 + 3, 2)
    6569                   rt2_dist(nz) = SQRT(((zexit-zorig)*dz)**2 + dxxyy)
     6589                  rt2_dist(nz) = SQRT(((zexit-zorig)*dz(1))**2 + dxxyy)
    65706590                  qdist = rt2_dist(nz) / (zexit-zorig)
    65716591                  rt2_dist(2:nz-1) = (/( ((REAL(l, wp) + .5_wp) * zsgn - zorig) * qdist , l = zb0, zb1 )/)
Note: See TracChangeset for help on using the changeset viewer.