Ignore:
Timestamp:
Dec 4, 2018 8:40:18 AM (5 years ago)
Author:
maronga
Message:

revised calculation of near surface air potential temperature

File:
1 edited

Legend:

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

    r3524 r3597  
    2828! -----------------
    2929! $Id$
     30! Fixed calculation method of near surface air potential temperature at 10 cm
     31! and moved to surface_layer_fluxes. Removed unnecessary _eb strings.
     32!
     33! 3524 2018-11-14 13:36:44Z raasch
    3034! bugfix concerning allocation of t_surf_wall_v
    3135!
     
    240244! - Move first call of usm_radiatin from usm_init to init_3d_model
    241245! - fixed problem with near surface temperature
    242 ! - added near surface temperature t_surf_10cm_h(m), t_surf_10cm_v(l)%t(m)
     246! - added near surface temperature pt_10cm_h(m), pt_10cm_v(l)%t(m)
    243247! - does not work with temp profile including stability, ol
    244 !   t_surf_10cm = pt1 now
     248!   pt_10cm = pt1 now
    245249! - merged with 2357 bugfix, error message for nopointer version
    246250! - added indoor model coupling with wall heat flux
     
    986990    REAL(wp), DIMENSION(:,:), ALLOCATABLE          ::  t_window_av      !< Average of t_window
    987991    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  qsws_eb_av       !< average of qsws_eb
    988     REAL(wp), DIMENSION(:), ALLOCATABLE            ::  qsws_veg_eb_av   !< average of qsws_veg_eb
    989     REAL(wp), DIMENSION(:), ALLOCATABLE            ::  qsws_liq_eb_av   !< average of qsws_liq_eb
     992    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  qsws_veg_av   !< average of qsws_veg
     993    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  qsws_liq_av   !< average of qsws_liq
    990994    REAL(wp), DIMENSION(:,:), ALLOCATABLE          ::  swc_av        !< Average of swc
    991995   
     
    10411045    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_green_h     !< green surface temperature (K) at horizontal walls
    10421046    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_green_h_p   !< progn. green surface temperature (K) at horizontal walls
    1043     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_10cm_h      !< near surface temperature (10cm) (K) at horizontal walls
    1044     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_10cm_h_p    !< progn. near surface temperature (10cm) (K) at horizontal walls
    10451047    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_wall_v
    10461048    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_wall_v_p
     
    10491051    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_green_v
    10501052    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_green_v_p
    1051     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_10cm_v
    1052     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_10cm_v_p
    10531053#else
    10541054    REAL(wp), DIMENSION(:), POINTER                :: t_surf_wall_h
     
    10581058    REAL(wp), DIMENSION(:), POINTER                :: t_surf_green_h
    10591059    REAL(wp), DIMENSION(:), POINTER                :: t_surf_green_h_p
    1060     REAL(wp), DIMENSION(:), POINTER                :: t_surf_10cm_h
    1061     REAL(wp), DIMENSION(:), POINTER                :: t_surf_10cm_h_p
    10621060
    10631061    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_wall_h_1
     
    10671065    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_green_h_1
    10681066    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_green_h_2
    1069     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_10cm_h_1
    1070     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_10cm_h_2
    10711067
    10721068    TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_wall_v
     
    10761072    TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_green_v
    10771073    TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_green_v_p
    1078     TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_10cm_v
    1079     TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_10cm_v_p
    10801074
    10811075    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_wall_v_1
     
    10851079    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_green_v_1
    10861080    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_green_v_2
    1087     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_10cm_v_1
    1088     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_10cm_v_2
    10891081   
    10901082#endif
     
    10921084    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_window_av   !< average of window surface temperature (K)
    10931085    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_green_av    !< average of green wall surface temperature (K)
    1094     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_10cm_av    !< average of whole wall surface temperature (K)
    10951086
    10961087!-- Temporal tendencies for time stepping           
     
    12181209       MODULE PROCEDURE usm_parin
    12191210    END INTERFACE usm_parin
    1220    
    1221     INTERFACE usm_temperature_near_surface
    1222        MODULE PROCEDURE usm_temperature_near_surface
    1223     END INTERFACE usm_temperature_near_surface
    12241211
    12251212    INTERFACE usm_rrd_local
     
    12621249!-- Public parameters, constants and initial values
    12631250    PUBLIC usm_anthropogenic_heat, usm_material_model, usm_wall_mod,           &
    1264            usm_green_heat_model, usm_temperature_near_surface, building_pars,  &
    1265            nzt_wall, t_surf_10cm_h, t_surf_10cm_v, t_wall_h, t_wall_v,         &
     1251           usm_green_heat_model, building_pars,  &
     1252           nzt_wall, t_wall_h, t_wall_v,         &
    12661253           t_window_h, t_window_v, building_type
    12671254
     
    13631350        ALLOCATE ( surf_usm_h%green_type_roof(1:surf_usm_h%ns)    )
    13641351        ALLOCATE ( surf_usm_h%r_s(1:surf_usm_h%ns)                )
     1352       
    13651353!
    13661354!--     For vertical surfaces.
     
    13771365           ALLOCATE ( surf_usm_v(l)%r_a(1:surf_usm_v(l)%ns)             )
    13781366           ALLOCATE ( surf_usm_v(l)%r_a_green(1:surf_usm_v(l)%ns)       )
    1379            ALLOCATE ( surf_usm_v(l)%r_a_window(1:surf_usm_v(l)%ns)      )
    1380            
    1381           ALLOCATE ( surf_usm_v(l)%r_s(1:surf_usm_v(l)%ns)                 )
     1367           ALLOCATE ( surf_usm_v(l)%r_a_window(1:surf_usm_v(l)%ns)      )           
     1368           ALLOCATE ( surf_usm_v(l)%r_s(1:surf_usm_v(l)%ns)                )
    13821369        ENDDO
    13831370
     
    14211408        ALLOCATE ( surf_usm_h%g_d(1:surf_usm_h%ns)              )
    14221409        ALLOCATE ( surf_usm_h%c_liq(1:surf_usm_h%ns)            )
    1423         ALLOCATE ( surf_usm_h%qsws_liq_eb(1:surf_usm_h%ns)         )
    1424         ALLOCATE ( surf_usm_h%qsws_veg_eb(1:surf_usm_h%ns)         )
     1410        ALLOCATE ( surf_usm_h%qsws_liq(1:surf_usm_h%ns)         )
     1411        ALLOCATE ( surf_usm_h%qsws_veg(1:surf_usm_h%ns)         )
    14251412        ALLOCATE ( surf_usm_h%r_canopy(1:surf_usm_h%ns)         )
    14261413        ALLOCATE ( surf_usm_h%r_canopy_min(1:surf_usm_h%ns)     )
    1427         ALLOCATE ( surf_usm_h%qsws_eb(1:surf_usm_h%ns)         )
     1414        ALLOCATE ( surf_usm_h%qsws_eb(1:surf_usm_h%ns)          )
     1415        ALLOCATE ( surf_usm_h%pt_10cm(1:surf_usm_h%ns)          )
     1416        ALLOCATE ( surf_usm_h%pt_2m(1:surf_usm_h%ns)            )
    14281417
    14291418!
     
    14321421          ALLOCATE ( surf_usm_v(l)%g_d(1:surf_usm_v(l)%ns)              )
    14331422          ALLOCATE ( surf_usm_v(l)%c_liq(1:surf_usm_v(l)%ns)            )
    1434           ALLOCATE ( surf_usm_v(l)%qsws_liq_eb(1:surf_usm_v(l)%ns)         )
    1435           ALLOCATE ( surf_usm_v(l)%qsws_veg_eb(1:surf_usm_v(l)%ns)         )
     1423          ALLOCATE ( surf_usm_v(l)%qsws_liq(1:surf_usm_v(l)%ns)         )
     1424          ALLOCATE ( surf_usm_v(l)%qsws_veg(1:surf_usm_v(l)%ns)         )
    14361425          ALLOCATE ( surf_usm_v(l)%qsws_eb(1:surf_usm_v(l)%ns)          )
    14371426          ALLOCATE ( surf_usm_v(l)%r_canopy(1:surf_usm_v(l)%ns)         )
    14381427          ALLOCATE ( surf_usm_v(l)%r_canopy_min(1:surf_usm_v(l)%ns)     )
     1428          ALLOCATE ( surf_usm_v(l)%pt_10cm(1:surf_usm_v(l)%ns)     )
    14391429        ENDDO
    14401430       
     
    15041494        IF ( .NOT. ALLOCATED( t_green_h_p ) )                                  &           
    15051495           ALLOCATE ( t_green_h_p(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) 
    1506         IF ( .NOT. ALLOCATED( t_surf_10cm_h ) )                                &
    1507            ALLOCATE ( t_surf_10cm_h(1:surf_usm_h%ns) )
    1508         IF ( .NOT. ALLOCATED( t_surf_10cm_h_p ) )                              &
    1509            ALLOCATE ( t_surf_10cm_h_p(1:surf_usm_h%ns) )
    15101496        IF ( .NOT. ALLOCATED( swc_h ) )                                    &           
    15111497           ALLOCATE ( swc_h(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) )
     
    15601546        IF ( .NOT. ALLOCATED( t_green_h_2 ) )                                  &           
    15611547           ALLOCATE ( t_green_h_2(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) )         
    1562         IF ( .NOT. ALLOCATED( t_surf_10cm_h_1 ) )                              &
    1563            ALLOCATE ( t_surf_10cm_h_1(1:surf_usm_h%ns) )
    1564         IF ( .NOT. ALLOCATED( t_surf_10cm_h_2 ) )                              &
    1565            ALLOCATE ( t_surf_10cm_h_2(1:surf_usm_h%ns) )
    15661548        IF ( .NOT. ALLOCATED( swc_h_1 ) )                                  &           
    15671549           ALLOCATE ( swc_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) )
     
    15921574        t_surf_window_h => t_surf_window_h_1; t_surf_window_h_p => t_surf_window_h_2 
    15931575        t_surf_green_h => t_surf_green_h_1; t_surf_green_h_p => t_surf_green_h_2           
    1594         t_surf_10cm_h => t_surf_10cm_h_1; t_surf_10cm_h_p => t_surf_10cm_h_2 
    15951576        m_liq_usm_h     => m_liq_usm_h_1;     m_liq_usm_h_p     => m_liq_usm_h_2
    15961577        swc_h       => swc_h_1; swc_h_p     => swc_h_2
     
    16301611           IF ( .NOT. ALLOCATED( t_surf_green_v_p(l)%t ) )                     &
    16311612              ALLOCATE ( t_surf_green_v_p(l)%t(1:surf_usm_v(l)%ns) )
    1632            IF ( .NOT. ALLOCATED( t_surf_10cm_v(l)%t ) )                        &
    1633               ALLOCATE ( t_surf_10cm_v(l)%t(1:surf_usm_v(l)%ns) )
    1634            IF ( .NOT. ALLOCATED( t_surf_10cm_v_p(l)%t ) )                        &
    1635               ALLOCATE ( t_surf_10cm_v_p(l)%t(1:surf_usm_v(l)%ns) )
    16361613           IF ( .NOT. ALLOCATED( m_liq_usm_v(l)%var_usm_1d ) )                 &
    16371614             ALLOCATE ( m_liq_usm_v(l)%var_usm_1d(1:surf_usm_v(l)%ns) )
     
    16701647           IF ( .NOT. ALLOCATED( t_green_v_2(l)%t ) )                          &           
    16711648              ALLOCATE ( t_green_v_2(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) 
    1672            IF ( .NOT. ALLOCATED( t_surf_10cm_v_1(l)%t ) )                     &
    1673               ALLOCATE ( t_surf_10cm_v_1(l)%t(1:surf_usm_v(l)%ns) )
    1674            IF ( .NOT. ALLOCATED( t_surf_10cm_v_2(l)%t ) )                     &
    1675               ALLOCATE ( t_surf_10cm_v_2(l)%t(1:surf_usm_v(l)%ns) )
    16761649           IF ( .NOT. ALLOCATED( m_liq_usm_v_1(l)%var_usm_1d ) )              &
    16771650              ALLOCATE ( m_liq_usm_v_1(l)%var_usm_1d(1:surf_usm_v(l)%ns) )
     
    16911664        t_surf_window_v => t_surf_window_v_1; t_surf_window_v_p => t_surf_window_v_2
    16921665        t_surf_green_v => t_surf_green_v_1; t_surf_green_v_p => t_surf_green_v_2
    1693         t_surf_10cm_v => t_surf_10cm_v_1; t_surf_10cm_v_p => t_surf_10cm_v_2
    16941666        m_liq_usm_v     => m_liq_usm_v_1;     m_liq_usm_v_p     => m_liq_usm_v_2
    16951667        swc_v    => swc_v_1;    swc_v_p    => swc_v_2
     
    20322004!--                 array of latent heat flux from vegetation surfaces
    20332005!--                 land surfaces
    2034                     IF ( l == -1 .AND. .NOT.  ALLOCATED(surf_usm_h%qsws_veg_eb_av) )  THEN
    2035                         ALLOCATE( surf_usm_h%qsws_veg_eb_av(1:surf_usm_h%ns) )
    2036                         surf_usm_h%qsws_veg_eb_av = 0.0_wp
     2006                    IF ( l == -1 .AND. .NOT.  ALLOCATED(surf_usm_h%qsws_veg_av) )  THEN
     2007                        ALLOCATE( surf_usm_h%qsws_veg_av(1:surf_usm_h%ns) )
     2008                        surf_usm_h%qsws_veg_av = 0.0_wp
    20372009                    ELSE
    2038                        IF ( .NOT.  ALLOCATED(surf_usm_v(l)%qsws_veg_eb_av) )  THEN
    2039                            ALLOCATE( surf_usm_v(l)%qsws_veg_eb_av(1:surf_usm_v(l)%ns) )
    2040                            surf_usm_v(l)%qsws_veg_eb_av = 0.0_wp
     2010                       IF ( .NOT.  ALLOCATED(surf_usm_v(l)%qsws_veg_av) )  THEN
     2011                           ALLOCATE( surf_usm_v(l)%qsws_veg_av(1:surf_usm_v(l)%ns) )
     2012                           surf_usm_v(l)%qsws_veg_av = 0.0_wp
    20412013                       ENDIF
    20422014                    ENDIF
     
    20452017!--                 array of latent heat flux from surfaces with liquid
    20462018!--                 land surfaces
    2047                     IF ( l == -1 .AND. .NOT.  ALLOCATED(surf_usm_h%qsws_liq_eb_av) )  THEN
    2048                         ALLOCATE( surf_usm_h%qsws_liq_eb_av(1:surf_usm_h%ns) )
    2049                         surf_usm_h%qsws_liq_eb_av = 0.0_wp
     2019                    IF ( l == -1 .AND. .NOT.  ALLOCATED(surf_usm_h%qsws_liq_av) )  THEN
     2020                        ALLOCATE( surf_usm_h%qsws_liq_av(1:surf_usm_h%ns) )
     2021                        surf_usm_h%qsws_liq_av = 0.0_wp
    20502022                    ELSE
    2051                        IF ( .NOT.  ALLOCATED(surf_usm_v(l)%qsws_liq_eb_av) )  THEN
    2052                            ALLOCATE( surf_usm_v(l)%qsws_liq_eb_av(1:surf_usm_v(l)%ns) )
    2053                            surf_usm_v(l)%qsws_liq_eb_av = 0.0_wp
     2023                       IF ( .NOT.  ALLOCATED(surf_usm_v(l)%qsws_liq_av) )  THEN
     2024                           ALLOCATE( surf_usm_v(l)%qsws_liq_av(1:surf_usm_v(l)%ns) )
     2025                           surf_usm_v(l)%qsws_liq_av = 0.0_wp
    20542026                       ENDIF
    20552027                    ENDIF
     
    21712143                    ENDIF
    21722144               
    2173                 CASE ( 'usm_t_surf_10cm' )
    2174 !--                 near surface temperature for whole surfaces
     2145                CASE ( 'usm_theta_10cm' )
     2146!--                 near surface (10cm) temperature for whole surfaces
    21752147                    IF ( l == -1 ) THEN
    2176                        IF ( .NOT.  ALLOCATED(surf_usm_h%t_surf_10cm_av) )  THEN
    2177                            ALLOCATE( surf_usm_h%t_surf_10cm_av(1:surf_usm_h%ns) )
    2178                            surf_usm_h%t_surf_10cm_av = 0.0_wp
     2148                       IF ( .NOT.  ALLOCATED(surf_usm_h%pt_10cm_av) )  THEN
     2149                           ALLOCATE( surf_usm_h%pt_10cm_av(1:surf_usm_h%ns) )
     2150                           surf_usm_h%pt_10cm_av = 0.0_wp
    21792151                       ENDIF
    21802152                    ELSE
    2181                        IF ( .NOT.  ALLOCATED(surf_usm_v(l)%t_surf_10cm_av) )  THEN
    2182                            ALLOCATE( surf_usm_v(l)%t_surf_10cm_av(1:surf_usm_v(l)%ns) )
    2183                            surf_usm_v(l)%t_surf_10cm_av = 0.0_wp
     2153                       IF ( .NOT.  ALLOCATED(surf_usm_v(l)%pt_10cm_av) )  THEN
     2154                           ALLOCATE( surf_usm_v(l)%pt_10cm_av(1:surf_usm_v(l)%ns) )
     2155                           surf_usm_v(l)%pt_10cm_av = 0.0_wp
    21842156                       ENDIF
    21852157                    ENDIF
    2186 
     2158                 
    21872159                CASE ( 'usm_t_wall' )
    21882160!--                 wall temperature for iwl layer of walls and land
     
    24232395                    IF ( l == -1 ) THEN
    24242396                    DO  m = 1, surf_usm_h%ns
    2425                        surf_usm_h%qsws_veg_eb_av(m) =                              &
    2426                                           surf_usm_h%qsws_veg_eb_av(m) +           &
    2427                                           surf_usm_h%qsws_veg_eb(m)
     2397                       surf_usm_h%qsws_veg_av(m) =                              &
     2398                                          surf_usm_h%qsws_veg_av(m) +           &
     2399                                          surf_usm_h%qsws_veg(m)
    24282400                    ENDDO
    24292401                    ELSE
    24302402                       DO  m = 1, surf_usm_v(l)%ns
    2431                           surf_usm_v(l)%qsws_veg_eb_av(m) =                        &
    2432                                           surf_usm_v(l)%qsws_veg_eb_av(m) +        &
    2433                                           surf_usm_v(l)%qsws_veg_eb(m)
     2403                          surf_usm_v(l)%qsws_veg_av(m) =                        &
     2404                                          surf_usm_v(l)%qsws_veg_av(m) +        &
     2405                                          surf_usm_v(l)%qsws_veg(m)
    24342406                       ENDDO
    24352407                    ENDIF
     
    24392411                    IF ( l == -1 ) THEN
    24402412                    DO  m = 1, surf_usm_h%ns
    2441                        surf_usm_h%qsws_liq_eb_av(m) =                              &
    2442                                           surf_usm_h%qsws_liq_eb_av(m) +           &
    2443                                           surf_usm_h%qsws_liq_eb(m)
     2413                       surf_usm_h%qsws_liq_av(m) =                              &
     2414                                          surf_usm_h%qsws_liq_av(m) +           &
     2415                                          surf_usm_h%qsws_liq(m)
    24442416                    ENDDO
    24452417                    ELSE
    24462418                       DO  m = 1, surf_usm_v(l)%ns
    2447                           surf_usm_v(l)%qsws_liq_eb_av(m) =                        &
    2448                                           surf_usm_v(l)%qsws_liq_eb_av(m) +        &
    2449                                           surf_usm_v(l)%qsws_liq_eb(m)
     2419                          surf_usm_v(l)%qsws_liq_av(m) =                        &
     2420                                          surf_usm_v(l)%qsws_liq_av(m) +        &
     2421                                          surf_usm_v(l)%qsws_liq(m)
    24502422                       ENDDO
    24512423                    ENDIF
     
    25792551                    ENDIF
    25802552               
    2581                 CASE ( 'usm_t_surf_10cm' )
     2553                CASE ( 'usm_theta_10cm' )
    25822554!--                 near surface temperature for whole surfaces
    25832555                    IF ( l == -1 ) THEN
    25842556                       DO  m = 1, surf_usm_h%ns
    2585                           surf_usm_h%t_surf_10cm_av(m) =                               &
    2586                                              surf_usm_h%t_surf_10cm_av(m) +            &
    2587                                              t_surf_10cm_h(m)
     2557                          surf_usm_h%pt_10cm_av(m) =                               &
     2558                                             surf_usm_h%pt_10cm_av(m) +            &
     2559                                             surf_usm_h%pt_10cm(m)
    25882560                       ENDDO
    25892561                    ELSE
    25902562                       DO  m = 1, surf_usm_v(l)%ns
    2591                           surf_usm_v(l)%t_surf_10cm_av(m) =                         &
    2592                                           surf_usm_v(l)%t_surf_10cm_av(m) +         &
    2593                                           t_surf_10cm_v(l)%t(m)
     2563                          surf_usm_v(l)%pt_10cm_av(m) =                         &
     2564                                          surf_usm_v(l)%pt_10cm_av(m) +         &
     2565                                          surf_usm_v(l)%pt_10cm(m)
    25942566                       ENDDO
    25952567                    ENDIF
    2596 
    25972568                   
    25982569                CASE ( 'usm_t_wall' )
     
    28402811                    IF ( l == -1 ) THEN
    28412812                    DO  m = 1, surf_usm_h%ns
    2842                        surf_usm_h%qsws_veg_eb_av(m) =                              &
    2843                                           surf_usm_h%qsws_veg_eb_av(m) /           &
     2813                       surf_usm_h%qsws_veg_av(m) =                              &
     2814                                          surf_usm_h%qsws_veg_av(m) /           &
    28442815                                          REAL( average_count_3d, kind=wp )
    28452816                    ENDDO
    28462817                    ELSE
    28472818                       DO  m = 1, surf_usm_v(l)%ns
    2848                           surf_usm_v(l)%qsws_veg_eb_av(m) =                        &
    2849                                           surf_usm_v(l)%qsws_veg_eb_av(m) /        &
     2819                          surf_usm_v(l)%qsws_veg_av(m) =                        &
     2820                                          surf_usm_v(l)%qsws_veg_av(m) /        &
    28502821                                          REAL( average_count_3d, kind=wp )
    28512822                       ENDDO
     
    28562827                    IF ( l == -1 ) THEN
    28572828                    DO  m = 1, surf_usm_h%ns
    2858                        surf_usm_h%qsws_liq_eb_av(m) =                              &
    2859                                           surf_usm_h%qsws_liq_eb_av(m) /           &
     2829                       surf_usm_h%qsws_liq_av(m) =                              &
     2830                                          surf_usm_h%qsws_liq_av(m) /           &
    28602831                                          REAL( average_count_3d, kind=wp )
    28612832                    ENDDO
    28622833                    ELSE
    28632834                       DO  m = 1, surf_usm_v(l)%ns
    2864                           surf_usm_v(l)%qsws_liq_eb_av(m) =                        &
    2865                                           surf_usm_v(l)%qsws_liq_eb_av(m) /        &
     2835                          surf_usm_v(l)%qsws_liq_av(m) =                        &
     2836                                          surf_usm_v(l)%qsws_liq_av(m) /        &
    28662837                                          REAL( average_count_3d, kind=wp )
    28672838                       ENDDO
     
    29962967                    ENDIF
    29972968                   
    2998                 CASE ( 'usm_t_surf_10cm' )
     2969                CASE ( 'usm_theta_10cm' )
    29992970!--                 near surface temperature for whole surfaces
    30002971                    IF ( l == -1 ) THEN
    30012972                       DO  m = 1, surf_usm_h%ns
    3002                           surf_usm_h%t_surf_10cm_av(m) =                               &
    3003                                              surf_usm_h%t_surf_10cm_av(m) /            &
     2973                          surf_usm_h%pt_10cm_av(m) =                               &
     2974                                             surf_usm_h%pt_10cm_av(m) /            &
    30042975                                             REAL( average_count_3d, kind=wp )
    30052976                       ENDDO
    30062977                    ELSE
    30072978                       DO  m = 1, surf_usm_v(l)%ns
    3008                           surf_usm_v(l)%t_surf_10cm_av(m) =                         &
    3009                                           surf_usm_v(l)%t_surf_10cm_av(m) /         &
     2979                          surf_usm_v(l)%pt_10cm_av(m) =                         &
     2980                                          surf_usm_v(l)%pt_10cm_av(m) /         &
    30102981                                          REAL( average_count_3d, kind=wp )
    30112982                       ENDDO
    30122983                    ENDIF
     2984
    30132985                   
    30142986                CASE ( 'usm_t_wall' )
     
    31733145                    'usm_t_surf_green              ', &
    31743146                    'usm_t_green                   ', &
    3175                     'usm_t_surf_10cm               ', &
     3147                    'usm_theta_10cm                ', &
    31763148                    'usm_skyvf                     ', &
    31773149                    'usm_skyvft                    '/)
     
    32603232                  var(1:16) == 'usm_t_surf_green'  .OR.                                   &
    32613233                  var(1:11) == 'usm_t_green' .OR.  var(1:7) == 'usm_swc' .OR.             &
    3262                   var(1:15) == 'usm_t_surf_10cm' )  THEN
     3234                  var(1:14) == 'usm_theta_10cm' )  THEN
    32633235            unit = 'K'
    32643236        ELSE IF ( var == 'usm_rad_pc_inlw'  .OR.  var == 'usm_rad_pc_insw'  .OR.          &
     
    39353907                       j = surf_usm_h%j(m)
    39363908                       k = surf_usm_h%k(m)
    3937                        temp_pf(k,j,i) = surf_usm_h%qsws_veg_eb(m)
     3909                       temp_pf(k,j,i) = surf_usm_h%qsws_veg(m)
    39383910                    ENDDO
    39393911                 ELSE
     
    39433915                       j = surf_usm_v(l)%j(m)
    39443916                       k = surf_usm_v(l)%k(m)
    3945                        temp_pf(k,j,i) = surf_usm_v(l)%qsws_veg_eb(m)
     3917                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_veg(m)
    39463918                    ENDDO
    39473919                 ENDIF
     
    39523924                       j = surf_usm_h%j(m)
    39533925                       k = surf_usm_h%k(m)
    3954                        temp_pf(k,j,i) = surf_usm_h%qsws_veg_eb_av(m)
     3926                       temp_pf(k,j,i) = surf_usm_h%qsws_veg_av(m)
    39553927                    ENDDO
    39563928                 ELSE
     
    39603932                       j = surf_usm_v(l)%j(m)
    39613933                       k = surf_usm_v(l)%k(m)
    3962                        temp_pf(k,j,i) = surf_usm_v(l)%qsws_veg_eb_av(m)
     3934                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_veg_av(m)
    39633935                    ENDDO
    39643936                 ENDIF
     
    39733945                       j = surf_usm_h%j(m)
    39743946                       k = surf_usm_h%k(m)
    3975                        temp_pf(k,j,i) = surf_usm_h%qsws_liq_eb(m)
     3947                       temp_pf(k,j,i) = surf_usm_h%qsws_liq(m)
    39763948                    ENDDO
    39773949                 ELSE
     
    39813953                       j = surf_usm_v(l)%j(m)
    39823954                       k = surf_usm_v(l)%k(m)
    3983                        temp_pf(k,j,i) = surf_usm_v(l)%qsws_liq_eb(m)
     3955                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_liq(m)
    39843956                    ENDDO
    39853957                 ENDIF
     
    39903962                       j = surf_usm_h%j(m)
    39913963                       k = surf_usm_h%k(m)
    3992                        temp_pf(k,j,i) = surf_usm_h%qsws_liq_eb_av(m)
     3964                       temp_pf(k,j,i) = surf_usm_h%qsws_liq_av(m)
    39933965                    ENDDO
    39943966                 ELSE
     
    39983970                       j = surf_usm_v(l)%j(m)
    39993971                       k = surf_usm_v(l)%k(m)
    4000                        temp_pf(k,j,i) = surf_usm_v(l)%qsws_liq_eb_av(m)
     3972                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_liq_av(m)
    40013973                    ENDDO
    40023974                 ENDIF
     
    43214293              ENDIF
    43224294
    4323           CASE ( 'usm_t_surf_10cm' )
     4295          CASE ( 'usm_theta_10cm' )
    43244296!--           near surface temperature for whole surfaces
    43254297
     
    43304302                       j = surf_usm_h%j(m)
    43314303                       k = surf_usm_h%k(m)
    4332                        temp_pf(k,j,i) = t_surf_10cm_h(m)
     4304                       temp_pf(k,j,i) = surf_usm_h%pt_10cm(m)
    43334305                    ENDDO
    43344306                 ELSE
     
    43384310                       j = surf_usm_v(l)%j(m)
    43394311                       k = surf_usm_v(l)%k(m)
    4340                        temp_pf(k,j,i) = t_surf_10cm_v(l)%t(m)
     4312                       temp_pf(k,j,i) = surf_usm_v(l)%pt_10cm(m)
    43414313                    ENDDO
    43424314                 ENDIF
    4343 
     4315             
     4316             
    43444317              ELSE
    43454318                 IF ( idsint == iup_u )  THEN
     
    43484321                       j = surf_usm_h%j(m)
    43494322                       k = surf_usm_h%k(m)
    4350                        temp_pf(k,j,i) = surf_usm_h%t_surf_10cm_av(m)
     4323                       temp_pf(k,j,i) = surf_usm_h%pt_10cm_av(m)
    43514324                    ENDDO
    43524325                 ELSE
     
    43564329                       j = surf_usm_v(l)%j(m)
    43574330                       k = surf_usm_v(l)%k(m)
    4358                        temp_pf(k,j,i) = surf_usm_v(l)%t_surf_10cm_av(m)
    4359                     ENDDO
    4360 
    4361                  ENDIF
    4362 
     4331                       temp_pf(k,j,i) = surf_usm_v(l)%pt_10cm_av(m)
     4332                    ENDDO
     4333
     4334                  ENDIF
    43634335              ENDIF
    4364 
    4365              
     4336             
    43664337          CASE ( 'usm_t_wall' )
    43674338!--           wall temperature for  iwl layer of walls and land
     
    45734544             var(1:17) == 'usm_t_surf_window'  .OR.  var(1:12) == 'usm_t_window'  .OR.      &
    45744545             var(1:16) == 'usm_t_surf_green'  .OR. var(1:11) == 'usm_t_green' .OR.          &
    4575              var(1:15) == 'usm_t_surf_10cm' .OR.                                            &
     4546             var(1:15) == 'usm_theta_10cm' .OR.                                             &
    45764547             var(1:9) == 'usm_surfz'  .OR.  var(1:7) == 'usm_svf'  .OR.                     &
    45774548             var(1:7) == 'usm_dif'  .OR.  var(1:11) == 'usm_surfcat'  .OR.                  &
     
    61566127        t_surf_green_h_p = t_surf_green_h
    61576128        t_surf_green_v_p = t_surf_green_v
    6158         t_surf_10cm_h_p = t_surf_10cm_h
    6159         t_surf_10cm_v_p = t_surf_10cm_v
    61606129
    61616130        t_wall_h_p = t_wall_h
     
    61806149       surf_usm_h%c_liq = 0.0_wp
    61816150
    6182        surf_usm_h%qsws_liq_eb  = 0.0_wp
    6183        surf_usm_h%qsws_veg_eb  = 0.0_wp
     6151       surf_usm_h%qsws_liq  = 0.0_wp
     6152       surf_usm_h%qsws_veg  = 0.0_wp
    61846153
    61856154!
     
    61896158          surf_usm_v(l)%c_liq = 0.0_wp
    61906159
    6191           surf_usm_v(l)%qsws_liq_eb  = 0.0_wp
    6192           surf_usm_v(l)%qsws_veg_eb  = 0.0_wp
     6160          surf_usm_v(l)%qsws_liq  = 0.0_wp
     6161          surf_usm_v(l)%qsws_veg  = 0.0_wp
    61936162       ENDDO
    61946163
     
    67796748                   ENDIF     
    67806749
    6781 !--                The root extraction (= root_extr * qsws_veg_eb / (rho_l     
     6750!--                The root extraction (= root_extr * qsws_veg / (rho_l     
    67826751!--                * l_v)) ensures the mass conservation for water. The         
    67836752!--                transpiration of plants equals the cumulative withdrawals by
     
    68186787                            swc_h(nzb_wall+1,m) - swc_h(nzb_wall,m) )    &
    68196788                            * surf_usm_h%ddz_green(nzb_wall+1,m) - surf_usm_h%gamma_w_green(nzb_wall,m) - ( &
    6820                                root_extr_green(nzb_wall) * surf_usm_h%qsws_veg_eb(m)          &
    6821 !                                + surf_usm_h%qsws_soil_eb_green(m)
     6789                               root_extr_green(nzb_wall) * surf_usm_h%qsws_veg(m)          &
     6790!                                + surf_usm_h%qsws_soil_green(m)
    68226791                                  ) * drho_l_lv )             &
    68236792                                 * surf_usm_h%ddz_green_stag(nzb_wall,m)
     
    68306799                                swc_h(kw-1,m)) * surf_usm_h%ddz_green(kw,m)                 &
    68316800                                + surf_usm_h%gamma_w_green(kw-1,m) - (root_extr_green(kw)             &
    6832                                 * surf_usm_h%qsws_veg_eb(m) * drho_l_lv)                &
     6801                                * surf_usm_h%qsws_veg(m) * drho_l_lv)                &
    68336802                                ) * surf_usm_h%ddz_green_stag(kw,m)
    68346803
     
    68416810                                           + surf_usm_h%gamma_w_green(nzt_wall-1,m) - (       &
    68426811                                             root_extr_green(nzt_wall)               &
    6843                                            * surf_usm_h%qsws_veg_eb(m) * drho_l_lv  )   &
     6812                                           * surf_usm_h%qsws_veg(m) * drho_l_lv  )   &
    68446813                                     ) * surf_usm_h%ddz_green_stag(nzt_wall,m)             
    68456814
     
    70537022    END SUBROUTINE usm_parin
    70547023
    7055 !------------------------------------------------------------------------------!
    7056 ! Description:
    7057 ! ------------
    7058 !> Calculates temperature near surface (10 cm) for indoor model
    7059 !------------------------------------------------------------------------------!
    7060     SUBROUTINE usm_temperature_near_surface
    7061 
    7062        IMPLICIT NONE
    7063 
    7064        INTEGER(iwp)                          :: i, j, k, l, m   !< running indices
    7065 
    7066 !       
    7067 !--    First, treat horizontal surface elements
    7068        DO  m = 1, surf_usm_h%ns
    7069 
    7070 !--       Get indices of respective grid point
    7071           i = surf_usm_h%i(m)
    7072           j = surf_usm_h%j(m)
    7073           k = surf_usm_h%k(m)
    7074 
    7075           t_surf_10cm_h(m) = surf_usm_h%pt_surface(m) + surf_usm_h%ts(m) / kappa        &
    7076                              * ( log( 0.1_wp /  surf_usm_h%z0h(m) )              &
    7077                                - psi_h( 0.1_wp / surf_usm_h%ol(m) )              &
    7078                                + psi_h( surf_usm_h%z0h(m) / surf_usm_h%ol(m) ) )
    7079 
    7080        ENDDO
    7081 !
    7082 !--    Now, treat vertical surface elements
    7083        DO  l = 0, 3
    7084           DO  m = 1, surf_usm_v(l)%ns
    7085 
    7086 !--          Get indices of respective grid point
    7087              i = surf_usm_v(l)%i(m)
    7088              j = surf_usm_v(l)%j(m)
    7089              k = surf_usm_v(l)%k(m)
    7090 
    7091              t_surf_10cm_v(l)%t(m) =surf_usm_v(l)%pt_surface(m) + surf_usm_v(l)%ts(m) / kappa &
    7092                                      * ( log( 0.1_wp / surf_usm_v(l)%z0h(m) )             &
    7093                                        - psi_h( 0.1_wp / surf_usm_v(l)%ol(m) )            &
    7094                                        + psi_h( surf_usm_v(l)%z0h(m) / surf_usm_v(l)%ol(m) ) )
    7095 
    7096           ENDDO
    7097 
    7098        ENDDO
    7099 
    7100 
    7101     END SUBROUTINE usm_temperature_near_surface
    7102 
    7103    
    71047024 
    71057025!------------------------------------------------------------------------------!
     
    94429362          surf_usm_h%qsws(m) = surf_usm_h%qsws_eb(m) / rho_lv
    94439363
    9444           surf_usm_h%qsws_veg_eb(m)  = - f_qsws_veg  * ( qv1 - q_s                      &
     9364          surf_usm_h%qsws_veg(m)  = - f_qsws_veg  * ( qv1 - q_s                      &
    94459365                              + dq_s_dt * t_surf_green_h(m) - dq_s_dt   &
    94469366                              * t_surf_green_h_p(m) )
    94479367
    9448           surf_usm_h%qsws_liq_eb(m)  = - f_qsws_liq  * ( qv1 - q_s                      &
     9368          surf_usm_h%qsws_liq(m)  = - f_qsws_liq  * ( qv1 - q_s                      &
    94499369                              + dq_s_dt * t_surf_green_h(m) - dq_s_dt   &
    94509370                              * t_surf_green_h_p(m) )
     
    94789398!--          as runoff as qsws_soil is then not used in the soil model
    94799399             IF ( m_liq_usm_h%var_usm_1d(m) /= m_liq_max )  THEN
    9480                 surf_usm_h%qsws_liq_eb(m) = surf_usm_h%qsws_liq_eb(m)                            &
     9400                surf_usm_h%qsws_liq(m) = surf_usm_h%qsws_liq(m)                            &
    94819401                                 + surf_usm_h%frac(ind_pav_green,m) * prr(k+k_off,j+j_off,i+i_off)&
    94829402                                 * hyrho(k+k_off)                              &
     
    94979417!                 surf_usm_h%qsws_soil(m) = surf_usm_h%qsws_soil(m) + surf_usm_h%qsws_liq(m)
    94989418
    9499                 surf_usm_h%qsws_liq_eb(m)  = 0.0_wp
     9419                surf_usm_h%qsws_liq(m)  = 0.0_wp
    95009420             ENDIF
    95019421
     
    95049424!--          let the water enter the liquid water reservoir as dew on the
    95059425!--          plant
    9506              IF ( surf_usm_h%qsws_veg_eb(m) < 0.0_wp )  THEN
    9507                 surf_usm_h%qsws_liq_eb(m) = surf_usm_h%qsws_liq_eb(m) + surf_usm_h%qsws_veg_eb(m)
    9508                 surf_usm_h%qsws_veg_eb(m) = 0.0_wp
     9426             IF ( surf_usm_h%qsws_veg(m) < 0.0_wp )  THEN
     9427                surf_usm_h%qsws_liq(m) = surf_usm_h%qsws_liq(m) + surf_usm_h%qsws_veg(m)
     9428                surf_usm_h%qsws_veg(m) = 0.0_wp
    95099429             ENDIF
    95109430          ENDIF                   
     
    95129432          surf_usm_h%qsws(m) = surf_usm_h%qsws(m) / l_v
    95139433 
    9514           tend = - surf_usm_h%qsws_liq_eb(m) * drho_l_lv
     9434          tend = - surf_usm_h%qsws_liq(m) * drho_l_lv
    95159435          m_liq_usm_h_p%var_usm_1d(m) = m_liq_usm_h%var_usm_1d(m) + dt_3d *    &
    95169436                                        ( tsc(2) * tend +                      &
     
    98959815          surf_usm_v(l)%qsws(m) = surf_usm_v(l)%qsws_eb(m) / rho_lv
    98969816
    9897           surf_usm_v(l)%qsws_veg_eb(m)  = - f_qsws_veg  * ( qv1 - q_s                      &
     9817          surf_usm_v(l)%qsws_veg(m)  = - f_qsws_veg  * ( qv1 - q_s                      &
    98989818                              + dq_s_dt * t_surf_green_v(l)%t(m) - dq_s_dt   &
    98999819                              * t_surf_green_v_p(l)%t(m) )
    99009820
    9901 !           surf_usm_h%qsws_liq_eb(m)  = - f_qsws_liq  * ( qv1 - q_s                      &
     9821!           surf_usm_h%qsws_liq(m)  = - f_qsws_liq  * ( qv1 - q_s                      &
    99029822!                               + dq_s_dt * t_surf_green_h(m) - dq_s_dt   &
    99039823!                               * t_surf_green_h_p(m) )
     
    99289848!--          let the water enter the liquid water reservoir as dew on the
    99299849!--          plant
    9930              IF ( surf_usm_v(l)%qsws_veg_eb(m) < 0.0_wp )  THEN
    9931 !                 surf_usm_h%qsws_liq_eb(m) = surf_usm_h%qsws_liq_eb(m) + surf_usm_h%qsws_veg_eb(m)
    9932                 surf_usm_v(l)%qsws_veg_eb(m) = 0.0_wp
     9850             IF ( surf_usm_v(l)%qsws_veg(m) < 0.0_wp )  THEN
     9851!                 surf_usm_h%qsws_liq(m) = surf_usm_h%qsws_liq(m) + surf_usm_h%qsws_veg(m)
     9852                surf_usm_v(l)%qsws_veg(m) = 0.0_wp
    99339853             ENDIF
    99349854          ENDIF   
     
    1025610176          CALL wrd_write_string( 't_green_v(' // dum // ')' )
    1025710177          WRITE ( 14 )  t_green_v(l)%t
    10258        
     10178!        
    1025910179       ENDDO
    1026010180
     
    1026210182    END SUBROUTINE usm_wrd_local
    1026310183
    10264 !
    10265 !-- Integrated stability function for heat and moisture
    10266     FUNCTION psi_h( zeta )
    10267 
    10268            USE kinds
    10269 
    10270        IMPLICIT NONE
    10271 
    10272        REAL(wp)            :: psi_h !< Integrated similarity function result
    10273        REAL(wp)            :: zeta  !< Stability parameter z/L
    10274        REAL(wp)            :: x     !< dummy variable
    10275 
    10276        REAL(wp), PARAMETER :: a = 1.0_wp            !< constant
    10277        REAL(wp), PARAMETER :: b = 0.66666666666_wp  !< constant
    10278        REAL(wp), PARAMETER :: c = 5.0_wp            !< constant
    10279        REAL(wp), PARAMETER :: d = 0.35_wp           !< constant
    10280        REAL(wp), PARAMETER :: c_d_d = c / d         !< constant
    10281        REAL(wp), PARAMETER :: bc_d_d = b * c / d    !< constant
    10282 
    10283 
    10284       IF ( zeta < 0.0_wp )  THEN
    10285          x = SQRT( 1.0_wp  - 16.0_wp * zeta )
    10286          psi_h = 2.0_wp * LOG( (1.0_wp + x ) / 2.0_wp )
    10287       ELSE
    10288          psi_h = - b * ( zeta - c_d_d ) * EXP( -d * zeta ) - (1.0_wp          &
    10289                  + 0.66666666666_wp * a * zeta )**1.5_wp - bc_d_d             &
    10290                  + 1.0_wp
    10291 !
    10292 !--       Old version for stable conditions (only valid for z/L < 0.5)
    10293 !--       psi_h = - 5.0_wp * zeta
    10294        ENDIF
    10295 
    10296    END FUNCTION psi_h
    10297    
     10184 
    1029810185 END MODULE urban_surface_mod
Note: See TracChangeset for help on using the changeset viewer.