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/surface_layer_fluxes_mod.f90

    r4594 r4671  
    2525! -----------------
    2626! $Id$
     27! Implementation of downward facing USM and LSM surfaces
     28!
     29! 4594 2020-07-09 15:01:00Z suehring
    2730! Include k index in OMP PRIVATE statements
    2831!
     
    285288          CALL calc_ln
    286289       ENDIF
     290       IF ( surf_lsm_h(l)%ns >= 1 )  THEN
     291          surf => surf_lsm_h(l)
     292          CALL calc_ln
     293       ENDIF
     294       IF ( surf_usm_h(l)%ns >= 1 )  THEN
     295          surf => surf_usm_h(l)
     296          CALL calc_ln
     297       ENDIF
    287298    ENDDO
    288     IF ( surf_lsm_h%ns >= 1 )  THEN
    289        surf => surf_lsm_h
    290        CALL calc_ln
    291     ENDIF
    292     IF ( surf_usm_h%ns >= 1 )  THEN
    293        surf => surf_usm_h
    294        CALL calc_ln
    295     ENDIF
    296299
    297300    DO  l = 0, 3
     
    311314!
    312315!-- Derive potential temperature and specific humidity at first grid level from the fields pt and q
    313 !-- First call for horizontal default-type surfaces (l=0 - upward facing, l=1 - downward facing)
    314316    DO  l = 0, 1
     317!--    First call for horizontal default-type surfaces (l=0 - upward facing, l=1 - downward facing)
    315318       IF ( surf_def_h(l)%ns >= 1  )  THEN
    316319          surf => surf_def_h(l)
     
    324327          ENDIF
    325328       ENDIF
     329!
     330!--    Call for natural-type horizontal surfaces
     331       IF ( surf_lsm_h(l)%ns >= 1  )  THEN
     332          surf => surf_lsm_h(l)
     333          CALL calc_pt_q
     334       ENDIF
     335!
     336!--    Call for urban-type horizontal surfaces
     337       IF ( surf_usm_h(l)%ns >= 1  )  THEN
     338          surf => surf_usm_h(l)
     339          CALL calc_pt_q
     340       ENDIF
    326341    ENDDO
    327 !
    328 !-- Call for natural-type horizontal surfaces
    329     IF ( surf_lsm_h%ns >= 1  )  THEN
    330        surf => surf_lsm_h
    331        CALL calc_pt_q
    332     ENDIF
    333 
    334 !
    335 !-- Call for urban-type horizontal surfaces
    336     IF ( surf_usm_h%ns >= 1  )  THEN
    337        surf => surf_usm_h
    338        CALL calc_pt_q
    339     ENDIF
    340 
    341342!
    342343!-- Call for natural-type vertical surfaces
     
    373374!
    374375!-- Natural-type horizontal surfaces
    375     IF ( surf_lsm_h%ns >= 1 )  THEN
    376        surf => surf_lsm_h
     376    IF ( surf_lsm_h(0)%ns >= 1 )  THEN
     377       surf => surf_lsm_h(0)
    377378       CALL calc_uvw_abs
    378379       IF ( .NOT. neutral )  CALL calc_ol
     
    383384!
    384385!-- Urban-type horizontal surfaces
    385     IF ( surf_usm_h%ns >= 1 )  THEN
    386        surf => surf_usm_h
     386    IF ( surf_usm_h(0)%ns >= 1 )  THEN
     387       surf => surf_usm_h(0)
    387388       CALL calc_uvw_abs
    388389       IF ( .NOT. neutral )  CALL calc_ol
     
    396397
    397398!
    398 !-- Treat downward-facing horizontal surfaces. Note, so far, these are always default type.
     399!-- Treat downward-facing horizontal surfaces.
    399400!-- Stratification is not considered in this case, hence, no further distinction between different
    400401!-- most_method is required.
     402    downward = .TRUE.
     403!-- Default type.
    401404    IF ( surf_def_h(1)%ns >= 1 )  THEN
    402        downward = .TRUE.
    403405       surf => surf_def_h(1)
    404406       CALL calc_uvw_abs
    405407       CALL calc_us
    406408       CALL calc_surface_fluxes
    407        downward = .FALSE.
    408     ENDIF
     409    ENDIF
     410!-- Natural surface type.
     411    IF ( surf_lsm_h(1)%ns >= 1 )  THEN
     412       surf => surf_lsm_h(1)
     413       CALL calc_uvw_abs
     414       CALL calc_us
     415       CALL calc_surface_fluxes
     416    ENDIF
     417!-- Urban surface type.
     418    IF ( surf_usm_h(1)%ns >= 1 )  THEN
     419       surf => surf_usm_h(1)
     420       CALL calc_uvw_abs
     421       CALL calc_us
     422       CALL calc_surface_fluxes
     423    ENDIF
     424    downward = .FALSE.
    409425!
    410426!-- Calculate surfaces fluxes at vertical surfaces for momentum and subgrid-scale TKE. No stability
     
    664680!-- In case of runs with neutral statification, set Obukhov length to a large value
    665681    IF ( neutral )  THEN
    666        IF ( surf_def_h(0)%ns >= 1 )  surf_def_h(0)%ol = 1.0E10_wp
    667        IF ( surf_lsm_h%ns    >= 1 )  surf_lsm_h%ol    = 1.0E10_wp
    668        IF ( surf_usm_h%ns    >= 1 )  surf_usm_h%ol    = 1.0E10_wp
    669 
     682       DO  l = 0, 1
     683          IF ( surf_def_h(l)%ns >= 1  .AND.                                                        &
     684               ALLOCATED( surf_def_h(l)%ol ) )  surf_def_h(l)%ol = 1.0E10_wp
     685          IF ( surf_lsm_h(l)%ns    >= 1  .AND.                                                     &
     686               ALLOCATED( surf_lsm_h(l)%ol ) )  surf_lsm_h(l)%ol = 1.0E10_wp
     687          IF ( surf_usm_h(l)%ns    >= 1  .AND.                                                     &
     688               ALLOCATED( surf_usm_h(l)%ol ) )  surf_usm_h(l)%ol = 1.0E10_wp
     689       ENDDO
    670690       DO  l = 0, 3
    671691          IF ( surf_def_v(l)%ns >= 1  .AND.                                                        &
Note: See TracChangeset for help on using the changeset viewer.