Ignore:
Timestamp:
Sep 9, 2020 8:27:58 PM (4 years ago)
Author:
pavelkrc
Message:

Radiative transfer model RTM version 4.1

File:
1 edited

Legend:

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

    r4583 r4671  
    1919! Current revisions:
    2020! ------------------
    21 ! 
    22 ! 
     21!
     22!
    2323! Former revisions:
    2424! -----------------
    2525! $Id$
     26! Implementation of downward facing USM and LSM surfaces
     27!
     28! 4583 2020-06-29 12:36:47Z raasch
    2629! file re-formatted to follow the PALM coding standard
    2730!
     
    7477    SUBROUTINE diffusion_s( s, s_flux_def_h_up,    s_flux_def_h_down,                              &
    7578                               s_flux_t,                                                           &
    76                                s_flux_lsm_h_up,    s_flux_usm_h_up,                                &
     79                               s_flux_lsm_h_up,    s_flux_lsm_h_down,                              &
     80                               s_flux_usm_h_up,    s_flux_usm_h_down,                              &
    7781                               s_flux_def_v_north, s_flux_def_v_south,                             &
    7882                               s_flux_def_v_east,  s_flux_def_v_west,                              &
     
    116120       REAL(wp) ::  mask_west         !< flag to mask vertical surface west of the grid point
    117121
     122       REAL(wp), DIMENSION(1:surf_def_h(0)%ns) ::  s_flux_def_h_up    !< flux at horizontal upward-facing default-type surfaces
    118123       REAL(wp), DIMENSION(1:surf_def_h(1)%ns) ::  s_flux_def_h_down  !< flux at horizontal donwward-facing default-type surfaces
    119        REAL(wp), DIMENSION(1:surf_def_h(0)%ns) ::  s_flux_def_h_up    !< flux at horizontal upward-facing default-type surfaces
    120124       REAL(wp), DIMENSION(1:surf_def_v(2)%ns) ::  s_flux_def_v_east  !< flux at east-facing vertical default-type surfaces
    121125       REAL(wp), DIMENSION(1:surf_def_v(0)%ns) ::  s_flux_def_v_north !< flux at north-facing vertical default-type surfaces
    122126       REAL(wp), DIMENSION(1:surf_def_v(1)%ns) ::  s_flux_def_v_south !< flux at south-facing vertical default-type surfaces
    123127       REAL(wp), DIMENSION(1:surf_def_v(3)%ns) ::  s_flux_def_v_west  !< flux at west-facing vertical default-type surfaces
    124        REAL(wp), DIMENSION(1:surf_lsm_h%ns)    ::  s_flux_lsm_h_up    !< flux at horizontal upward-facing natural-type surfaces
     128       REAL(wp), DIMENSION(1:surf_lsm_h(0)%ns) ::  s_flux_lsm_h_up    !< flux at horizontal upward-facing natural-type surfaces
     129       REAL(wp), DIMENSION(1:surf_lsm_h(1)%ns) ::  s_flux_lsm_h_down  !< flux at horizontal downward-facing natural-type surfaces
    125130       REAL(wp), DIMENSION(1:surf_lsm_v(2)%ns) ::  s_flux_lsm_v_east  !< flux at east-facing vertical natural-type surfaces
    126131       REAL(wp), DIMENSION(1:surf_lsm_v(0)%ns) ::  s_flux_lsm_v_north !< flux at north-facing vertical natural-type surfaces
    127132       REAL(wp), DIMENSION(1:surf_lsm_v(1)%ns) ::  s_flux_lsm_v_south !< flux at south-facing vertical natural-type surfaces
    128133       REAL(wp), DIMENSION(1:surf_lsm_v(3)%ns) ::  s_flux_lsm_v_west  !< flux at west-facing vertical natural-type surfaces
    129        REAL(wp), DIMENSION(1:surf_usm_h%ns)    ::  s_flux_usm_h_up    !< flux at horizontal upward-facing urban-type surfaces
     134       REAL(wp), DIMENSION(1:surf_usm_h(0)%ns) ::  s_flux_usm_h_up    !< flux at horizontal upward-facing urban-type surfaces
     135       REAL(wp), DIMENSION(1:surf_usm_h(1)%ns) ::  s_flux_usm_h_down  !< flux at horizontal downward-facing urban-type surfaces
    130136       REAL(wp), DIMENSION(1:surf_usm_v(2)%ns) ::  s_flux_usm_v_east  !< flux at east-facing vertical urban-type surfaces
    131137       REAL(wp), DIMENSION(1:surf_usm_v(0)%ns) ::  s_flux_usm_v_north !< flux at north-facing vertical urban-type surfaces
     
    144150       !$ACC PRESENT(ddzu, ddzw, drho_air, rho_air_zw) &
    145151       !$ACC PRESENT(surf_def_h(0:2), surf_def_v(0:3)) &
    146        !$ACC PRESENT(surf_lsm_h, surf_lsm_v(0:3)) &
    147        !$ACC PRESENT(surf_usm_h, surf_usm_v(0:3)) &
     152       !$ACC PRESENT(surf_lsm_h(0:1), surf_lsm_v(0:3)) &
     153       !$ACC PRESENT(surf_usm_h(0:1), surf_usm_v(0:3)) &
    148154       !$ACC PRESENT(s_flux_def_h_up, s_flux_def_h_down) &
    149155       !$ACC PRESENT(s_flux_t) &
    150156       !$ACC PRESENT(s_flux_def_v_north, s_flux_def_v_south) &
    151157       !$ACC PRESENT(s_flux_def_v_east, s_flux_def_v_west) &
    152        !$ACC PRESENT(s_flux_lsm_h_up) &
     158       !$ACC PRESENT(s_flux_lsm_h_up, s_flux_lsm_h_down) &
    153159       !$ACC PRESENT(s_flux_lsm_v_north, s_flux_lsm_v_south) &
    154160       !$ACC PRESENT(s_flux_lsm_v_east, s_flux_lsm_v_west) &
    155        !$ACC PRESENT(s_flux_usm_h_up) &
     161       !$ACC PRESENT(s_flux_usm_h_up, s_flux_usm_h_down) &
    156162       !$ACC PRESENT(s_flux_usm_v_north, s_flux_usm_v_south) &
    157163       !$ACC PRESENT(s_flux_usm_v_east, s_flux_usm_v_west) &
     
    328334                surf_e = surf_def_h(0)%end_index(j,i)
    329335                DO  m = surf_s, surf_e
    330 
    331336                   k   = surf_def_h(0)%k(m)
    332337                   tend(k,j,i) = tend(k,j,i) + s_flux_def_h_up(m) * ddzw(k) * drho_air(k)
    333 
    334338                ENDDO
    335339!
     
    338342                surf_e = surf_def_h(1)%end_index(j,i)
    339343                DO  m = surf_s, surf_e
    340 
    341344                   k   = surf_def_h(1)%k(m)
    342345                   tend(k,j,i) = tend(k,j,i) + s_flux_def_h_down(m) * ddzw(k) * drho_air(k)
    343 
    344346                ENDDO
    345347!
    346348!--             Natural-type surfaces, upward-facing
    347                 surf_s = surf_lsm_h%start_index(j,i)
    348                 surf_e = surf_lsm_h%end_index(j,i)
     349                surf_s = surf_lsm_h(0)%start_index(j,i)
     350                surf_e = surf_lsm_h(0)%end_index(j,i)
    349351                DO  m = surf_s, surf_e
    350 
    351                    k   = surf_lsm_h%k(m)
     352                   k   = surf_lsm_h(0)%k(m)
    352353                   tend(k,j,i) = tend(k,j,i) + s_flux_lsm_h_up(m) * ddzw(k) * drho_air(k)
    353 
    354354                ENDDO
    355355!
     356!--             Natural-type surfaces, downward-facing
     357                surf_s = surf_lsm_h(1)%start_index(j,i)
     358                surf_e = surf_lsm_h(1)%end_index(j,i)
     359                DO  m = surf_s, surf_e
     360                   k   = surf_lsm_h(1)%k(m)
     361                   tend(k,j,i) = tend(k,j,i) + s_flux_lsm_h_down(m) * ddzw(k) * drho_air(k)
     362                ENDDO
     363!
    356364!--             Urban-type surfaces, upward-facing
    357                 surf_s = surf_usm_h%start_index(j,i)
    358                 surf_e = surf_usm_h%end_index(j,i)
     365                surf_s = surf_usm_h(0)%start_index(j,i)
     366                surf_e = surf_usm_h(0)%end_index(j,i)
    359367                DO  m = surf_s, surf_e
    360 
    361                    k   = surf_usm_h%k(m)
     368                   k   = surf_usm_h(0)%k(m)
    362369                   tend(k,j,i) = tend(k,j,i) + s_flux_usm_h_up(m) * ddzw(k) * drho_air(k)
    363 
     370                ENDDO
     371!
     372!--             Urban-type surfaces, downward-facing
     373                surf_s = surf_usm_h(1)%start_index(j,i)
     374                surf_e = surf_usm_h(1)%end_index(j,i)
     375                DO  m = surf_s, surf_e
     376                   k   = surf_usm_h(1)%k(m)
     377                   tend(k,j,i) = tend(k,j,i) + s_flux_usm_h_down(m) * ddzw(k) * drho_air(k)
    364378                ENDDO
    365379
     
    390404                               s_flux_def_h_up,    s_flux_def_h_down,                              &
    391405                               s_flux_t,                                                           &
    392                                s_flux_lsm_h_up,    s_flux_usm_h_up,                                &
     406                               s_flux_lsm_h_up,    s_flux_lsm_h_down,                              &
     407                               s_flux_usm_h_up,    s_flux_usm_h_down,                              &
    393408                               s_flux_def_v_north, s_flux_def_v_south,                             &
    394409                               s_flux_def_v_east,  s_flux_def_v_west,                              &
     
    438453       REAL(wp), DIMENSION(1:surf_def_v(1)%ns) ::  s_flux_def_v_south !< flux at south-facing vertical default-type surfaces
    439454       REAL(wp), DIMENSION(1:surf_def_v(3)%ns) ::  s_flux_def_v_west  !< flux at west-facing vertical default-type surfaces
    440        REAL(wp), DIMENSION(1:surf_lsm_h%ns)    ::  s_flux_lsm_h_up    !< flux at horizontal upward-facing natural-type surfaces
     455       REAL(wp), DIMENSION(1:surf_lsm_h(0)%ns) ::  s_flux_lsm_h_up    !< flux at horizontal upward-facing natural-type surfaces
     456       REAL(wp), DIMENSION(1:surf_lsm_h(1)%ns) ::  s_flux_lsm_h_down    !< flux at horizontal downward-facing natural-type surfaces
    441457       REAL(wp), DIMENSION(1:surf_lsm_v(2)%ns) ::  s_flux_lsm_v_east  !< flux at east-facing vertical urban-type surfaces
    442458       REAL(wp), DIMENSION(1:surf_lsm_v(0)%ns) ::  s_flux_lsm_v_north !< flux at north-facing vertical urban-type surfaces
    443459       REAL(wp), DIMENSION(1:surf_lsm_v(1)%ns) ::  s_flux_lsm_v_south !< flux at south-facing vertical urban-type surfaces
    444460       REAL(wp), DIMENSION(1:surf_lsm_v(3)%ns) ::  s_flux_lsm_v_west  !< flux at west-facing vertical urban-type surfaces
    445        REAL(wp), DIMENSION(1:surf_usm_h%ns)    ::  s_flux_usm_h_up    !< flux at horizontal upward-facing urban-type surfaces
     461       REAL(wp), DIMENSION(1:surf_usm_h(0)%ns) ::  s_flux_usm_h_up    !< flux at horizontal upward-facing urban-type surfaces
     462       REAL(wp), DIMENSION(1:surf_usm_h(1)%ns) ::  s_flux_usm_h_down  !< flux at horizontal downward-facing urban-type surfaces
    446463       REAL(wp), DIMENSION(1:surf_usm_v(2)%ns) ::  s_flux_usm_v_east  !< flux at east-facing vertical urban-type surfaces
    447464       REAL(wp), DIMENSION(1:surf_usm_v(0)%ns) ::  s_flux_usm_v_north !< flux at north-facing vertical urban-type surfaces
     
    625642          surf_e = surf_def_h(0)%end_index(j,i)
    626643          DO  m = surf_s, surf_e
    627 
    628644             k   = surf_def_h(0)%k(m)
    629 
    630645             tend(k,j,i) = tend(k,j,i) + s_flux_def_h_up(m) * ddzw(k) * drho_air(k)
    631646          ENDDO
     
    635650          surf_e = surf_def_h(1)%end_index(j,i)
    636651          DO  m = surf_s, surf_e
    637 
    638652             k   = surf_def_h(1)%k(m)
    639 
    640653             tend(k,j,i) = tend(k,j,i) + s_flux_def_h_down(m) * ddzw(k) * drho_air(k)
    641654          ENDDO
    642655!
    643656!--       Natural-type surfaces, upward-facing
    644           surf_s = surf_lsm_h%start_index(j,i)
    645           surf_e = surf_lsm_h%end_index(j,i)
     657          surf_s = surf_lsm_h(0)%start_index(j,i)
     658          surf_e = surf_lsm_h(0)%end_index(j,i)
    646659          DO  m = surf_s, surf_e
    647              k   = surf_lsm_h%k(m)
    648 
     660             k   = surf_lsm_h(0)%k(m)
    649661             tend(k,j,i) = tend(k,j,i) + s_flux_lsm_h_up(m) * ddzw(k) * drho_air(k)
    650662          ENDDO
    651663!
     664!--       Natural-type surfaces, downward-facing
     665          surf_s = surf_lsm_h(1)%start_index(j,i)
     666          surf_e = surf_lsm_h(1)%end_index(j,i)
     667          DO  m = surf_s, surf_e
     668             k   = surf_lsm_h(1)%k(m)
     669             tend(k,j,i) = tend(k,j,i) + s_flux_lsm_h_down(m) * ddzw(k) * drho_air(k)
     670          ENDDO
     671!
    652672!--       Urban-type surfaces, upward-facing
    653           surf_s = surf_usm_h%start_index(j,i)
    654           surf_e = surf_usm_h%end_index(j,i)
     673          surf_s = surf_usm_h(0)%start_index(j,i)
     674          surf_e = surf_usm_h(0)%end_index(j,i)
    655675          DO  m = surf_s, surf_e
    656              k   = surf_usm_h%k(m)
    657 
     676             k   = surf_usm_h(0)%k(m)
    658677             tend(k,j,i) = tend(k,j,i) + s_flux_usm_h_up(m) * ddzw(k) * drho_air(k)
     678          ENDDO
     679!
     680!--       Urban-type surfaces, upward-facing
     681          surf_s = surf_usm_h(1)%start_index(j,i)
     682          surf_e = surf_usm_h(1)%end_index(j,i)
     683          DO  m = surf_s, surf_e
     684             k   = surf_usm_h(1)%k(m)
     685             tend(k,j,i) = tend(k,j,i) + s_flux_usm_h_down(m) * ddzw(k) * drho_air(k)
    659686          ENDDO
    660687       ENDIF
     
    665692          surf_e = surf_def_h(2)%end_index(j,i)
    666693          DO  m = surf_s, surf_e
    667 
    668694             k   = surf_def_h(2)%k(m)
    669695             tend(k,j,i) = tend(k,j,i) + ( - s_flux_t(m) ) * ddzw(k) * drho_air(k)
Note: See TracChangeset for help on using the changeset viewer.