Index: palm/trunk/SOURCE/average_3d_data.f90
===================================================================
--- palm/trunk/SOURCE/average_3d_data.f90	(revision 3596)
+++ palm/trunk/SOURCE/average_3d_data.f90	(revision 3597)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Added theta_2m
+! 
+! 3589 2018-11-30 15:09:51Z suehring
 ! Move the control parameter "salsa" from salsa_mod to control_parameters 
 ! (M. Kurppa)
@@ -518,4 +521,14 @@
              ENDIF
 
+          CASE ( 'theta_2m' )
+             IF ( ALLOCATED( pt_2m_av ) ) THEN
+                DO  i = nxlg, nxrg
+                   DO  j = nysg, nyng
+                      pt_2m_av(j,i) = pt_2m_av(j,i) / REAL( average_count_3d, KIND=wp )
+                   ENDDO
+                ENDDO
+                CALL exchange_horiz_2d( pt_2m_av, nbgp )
+             ENDIF
+             
           CASE ( 'w' )
              IF ( ALLOCATED( w_av ) ) THEN
Index: palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- palm/trunk/SOURCE/check_parameters.f90	(revision 3596)
+++ palm/trunk/SOURCE/check_parameters.f90	(revision 3597)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Added checks for theta_2m
+! 
+! 3589 2018-11-30 15:09:51Z suehring
 ! Move the control parameter "salsa" from salsa_mod to control_parameters 
 ! (M. Kurppa)
@@ -3147,5 +3150,5 @@
              CONTINUE
 
-          CASE ( 'ghf*', 'lwp*', 'ol*', 'qsws*', 'r_a*',                       &
+          CASE ( 'ghf*', 'lwp*', 'ol*', 'qsws*', 'r_a*', 'theta_2m*',          &
                  'shf*', 'ssws*', 't*', 'tsurf*', 'us*', 'z0*', 'z0h*', 'z0q*' )
              IF ( k == 0  .OR.  data_output(i)(ilen-2:ilen) /= '_xy' )  THEN
@@ -3181,4 +3184,5 @@
                 CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 )
              ENDIF
+             
              IF ( TRIM( var ) == 'ssws*'  .AND.  .NOT.  passive_scalar )  THEN
                 message_string = 'output of "' // TRIM( var ) // '" requi' //  &
@@ -3187,7 +3191,16 @@
              ENDIF
 
+            
+!
+!--          Activate calculation of 2m temperature if output is requested
+             IF ( TRIM( var ) == 'theta_2m*' )  THEN
+                do_output_at_2m = .TRUE.
+             ENDIF             
+
+
              IF ( TRIM( var ) == 'ghf*'   )  unit = 'W/m2'
              IF ( TRIM( var ) == 'lwp*'   )  unit = 'kg/m2'
              IF ( TRIM( var ) == 'ol*'    )  unit = 'm'
+             IF ( TRIM( var ) == 'theta_2m*' )  unit = 'K'            
              IF ( TRIM( var ) == 'qsws*'  )  unit = 'kgm/kgs'
              IF ( TRIM( var ) == 'r_a*'   )  unit = 's/m'     
Index: palm/trunk/SOURCE/data_output_2d.f90
===================================================================
--- palm/trunk/SOURCE/data_output_2d.f90	(revision 3596)
+++ palm/trunk/SOURCE/data_output_2d.f90	(revision 3597)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Added theta_2m
+! 
+! 3589 2018-11-30 15:09:51Z suehring
 ! Move the control parameter "salsa" from salsa_mod to control_parameters 
 ! (M. Kurppa)
@@ -1212,4 +1215,38 @@
                 IF ( mode == 'xy' )  level_z = zu
 
+             CASE ( 'theta_2m*_xy' )        ! 2d-array
+                IF ( av == 0 )  THEN
+                   DO  m = 1, surf_def_h(0)%ns
+                      i = surf_def_h(0)%i(m)
+                      j = surf_def_h(0)%j(m)
+                      local_pf(i,j,nzb+1) = surf_def_h(0)%pt_2m(m)
+                   ENDDO
+                   DO  m = 1, surf_lsm_h%ns
+                      i = surf_lsm_h%i(m)
+                      j = surf_lsm_h%j(m)
+                      local_pf(i,j,nzb+1) = surf_lsm_h%pt_2m(m)
+                   ENDDO
+                   DO  m = 1, surf_usm_h%ns
+                      i = surf_usm_h%i(m)
+                      j = surf_usm_h%j(m)
+                      local_pf(i,j,nzb+1) = surf_usm_h%pt_2m(m)
+                   ENDDO
+                ELSE
+                   IF ( .NOT. ALLOCATED( pt_2m_av ) ) THEN
+                      ALLOCATE( pt_2m_av(nysg:nyng,nxlg:nxrg) )
+                      pt_2m_av = REAL( fill_value, KIND = wp )
+                   ENDIF
+                   DO  i = nxl, nxr
+                      DO  j = nys, nyn
+                         local_pf(i,j,nzb+1) = pt_2m_av(j,i)
+                      ENDDO
+                   ENDDO
+                ENDIF
+                resorted = .TRUE.
+                two_d = .TRUE.
+                level_z(nzb+1) = zu(nzb+1)
+                
+                
+                
              CASE ( 'w_xy', 'w_xz', 'w_yz' )
                 flag_nr = 3
Index: palm/trunk/SOURCE/indoor_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/indoor_model_mod.f90	(revision 3596)
+++ palm/trunk/SOURCE/indoor_model_mod.f90	(revision 3597)
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! Renamed t_surf_10cm to pt_10cm
+! 
+! 3593 2018-12-03 13:51:13Z kanani
 ! Replace degree symbol by degree_C
 !
@@ -318,6 +321,6 @@
 !     i_global             -->  net_sw_in                         !global radiation [W/m2]
 !     theta_e              -->  pt(k,j,i)                         !undisturbed outside temperature, 1. PALM volume, for windows
-!     theta_sup = theta_f  -->  surf_usm_h%t_surf_10cm(m)
-!                               surf_usm_v(l)%t_surf_10cm(m)   !Air temperature, facade near (10cm) air temperature from 1. Palm volume
+!     theta_sup = theta_f  -->  surf_usm_h%pt_10cm(m)
+!                               surf_usm_v(l)%pt_10cm(m)   !Air temperature, facade near (10cm) air temperature from 1. Palm volume
 !     theta_node           -->  t_wall_h(nzt_wall,m)
 !                               t_wall_v(l)%t(nzt_wall,m)         !Temperature of innermost wall layer, for opaque wall
@@ -844,6 +847,6 @@
 
     USE urban_surface_mod,                                                     &
-        ONLY:  nzt_wall, t_surf_10cm_h, t_surf_10cm_v, t_wall_h, t_wall_v,     &
-               t_window_h, t_window_v, building_type
+        ONLY:  nzt_wall, t_wall_h, t_wall_v, t_window_h, t_window_v,           &
+               building_type
 
 
@@ -1000,5 +1003,5 @@
              j = surf_usm_h%j(m)
              k = surf_usm_h%k(m)
-             near_facade_temperature = t_surf_10cm_h(m)
+             near_facade_temperature = surf_usm_h%pt_10cm(m)
              indoor_wall_window_temperature =                                  &
                   surf_usm_h%frac(ind_veg_wall,m) * t_wall_h(nzt_wall,m)       &
@@ -1192,5 +1195,5 @@
              j = surf_usm_v(l)%j(m)
              k = surf_usm_v(l)%k(m)
-             near_facade_temperature = t_surf_10cm_v(l)%t(m)
+             near_facade_temperature = surf_usm_v(l)%pt_10cm(m)
              indoor_wall_window_temperature =                                    &
                   surf_usm_v(l)%frac(ind_veg_wall,m) * t_wall_v(l)%t(nzt_wall,m) &
Index: palm/trunk/SOURCE/land_surface_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 3596)
+++ palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 3597)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Added pt_2m / theta_2m. Removed unncessary _eb strings.
+! 
+! 3486 2018-11-05 06:20:18Z maronga
 ! Bugfix for liquid water treatment on pavements
 ! 
@@ -490,5 +493,5 @@
 
     USE basic_constants_and_equations_mod,                                     &
-        ONLY:  c_p, g, lv_d_cp, l_v, magnus, rho_l, r_d, r_v, rd_d_rv
+        ONLY:  c_p, g, lv_d_cp, l_v, kappa, magnus, rho_l, r_d, r_v, rd_d_rv
 
     USE calc_mean_profile_mod,                                                 &
@@ -530,6 +533,6 @@
 
     USE surface_mod,                                                           &
-        ONLY :  ind_pav_green, ind_veg_wall, ind_wat_win, surf_lsm_h,          &
-                surf_lsm_v, surf_type, surface_restore_elements
+        ONLY :  ind_pav_green, ind_veg_wall, ind_wat_win,                      &
+                surf_lsm_h, surf_lsm_v, surf_type, surface_restore_elements
 
     IMPLICIT NONE
@@ -750,11 +753,10 @@
               c_soil_av,        & !< average of c_soil
               c_veg_av,         & !< average of c_veg
-              lai_av,           & !< average of lai
+              lai_av,           & !< average of lai       
               qsws_liq_av,      & !< average of qsws_liq
               qsws_soil_av,     & !< average of qsws_soil
               qsws_veg_av,      & !< average of qsws_veg
               r_s_av              !< average of r_s
-                   
-
+  
 !
 !-- Predefined Land surface classes (vegetation_type)
@@ -1000,5 +1002,5 @@
 !-- Public functions
     PUBLIC lsm_boundary_condition, lsm_check_data_output,                      &
-           lsm_check_data_output_pr,                                           &
+           lsm_check_data_output_pr, lsm_calc_pt_near_surface,                 &
            lsm_check_parameters, lsm_define_netcdf_grid, lsm_3d_data_averaging,& 
            lsm_data_output_2d, lsm_data_output_3d, lsm_energy_balance,         &
@@ -1021,4 +1023,8 @@
     END INTERFACE lsm_boundary_condition
 
+    INTERFACE lsm_calc_pt_near_surface
+       MODULE PROCEDURE lsm_calc_pt_near_surface
+    END INTERFACE lsm_calc_pt_near_surface
+    
     INTERFACE lsm_check_data_output
        MODULE PROCEDURE lsm_check_data_output
@@ -2340,4 +2346,5 @@
     IF ( horizontal  .AND.  .NOT. constant_roughness )  CALL calc_z0_water_surface
     
+    
     CONTAINS
 !------------------------------------------------------------------------------!
@@ -2391,11 +2398,10 @@
                      
        ENDDO
-
+  
     END SUBROUTINE calc_q_surface
-
-
-
+       
  END SUBROUTINE lsm_energy_balance
-
+    
+   
 
 !------------------------------------------------------------------------------!
@@ -4923,4 +4929,5 @@
        ALLOCATE ( surf_lsm_h%r_s(1:surf_lsm_h%ns)                 )
        ALLOCATE ( surf_lsm_h%r_canopy_min(1:surf_lsm_h%ns)        )
+       ALLOCATE ( surf_lsm_h%pt_2m(1:surf_lsm_h%ns)               )
        ALLOCATE ( surf_lsm_h%vegetation_surface(1:surf_lsm_h%ns)  )
        ALLOCATE ( surf_lsm_h%water_surface(1:surf_lsm_h%ns)       )
@@ -5742,5 +5749,5 @@
                 ENDDO
              ENDIF
-
+             
           CASE DEFAULT
              CONTINUE
@@ -6090,5 +6097,5 @@
 
           IF ( mode == 'xy' ) grid = 'zs'
-
+         
        CASE ( 'qsws_liq*_xy' )        ! 2d-array
           IF ( av == 0 ) THEN
@@ -6208,4 +6215,5 @@
           IF ( mode == 'xy' )  grid = 'zs'
 
+
        CASE DEFAULT
           found = .FALSE.
@@ -6377,5 +6385,5 @@
        WRITE ( 14 )  qsws_veg_av
     ENDIF
-
+    
     IF ( ALLOCATED( t_soil_av ) )  THEN
        CALL wrd_write_string( 't_soil_av' )
@@ -6676,5 +6684,5 @@
               t_soil_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =           &
                  tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
+                 
            CASE ( 'lsm_start_index_h', 'lsm_start_index_v'  )   
                 IF ( k == 1 )  THEN
@@ -7196,5 +7204,67 @@
     END SUBROUTINE calc_z0_water_surface
 
-
-
+    
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Calculates 2m temperature for data output at coarse resolution
+!------------------------------------------------------------------------------!
+    SUBROUTINE lsm_calc_pt_near_surface
+
+       IMPLICIT NONE
+
+       INTEGER(iwp)                          :: i, j, k, l, m   !< running indices
+
+
+       DO  m = 1, surf_lsm_h%ns
+
+          i = surf_lsm_h%i(m)
+          j = surf_lsm_h%j(m)
+          k = surf_lsm_h%k(m)
+
+          surf_lsm_h%pt_2m(m) = surf_lsm_h%pt_surface(m) + surf_lsm_h%ts(m) / kappa &
+                             * ( log( 2.0_wp /  surf_lsm_h%z0h(m) )                 &
+                               - psi_h( 2.0_wp / surf_lsm_h%ol(m) )                 &
+                               + psi_h( surf_lsm_h%z0h(m) / surf_lsm_h%ol(m) ) )
+
+       ENDDO
+
+    END SUBROUTINE lsm_calc_pt_near_surface
+
+    
+    
+!
+!-- Integrated stability function for heat and moisture
+    FUNCTION psi_h( zeta )
+
+           USE kinds
+
+       IMPLICIT NONE
+
+       REAL(wp)            :: psi_h !< Integrated similarity function result
+       REAL(wp)            :: zeta  !< Stability parameter z/L
+       REAL(wp)            :: x     !< dummy variable
+
+       REAL(wp), PARAMETER :: a = 1.0_wp            !< constant
+       REAL(wp), PARAMETER :: b = 0.66666666666_wp  !< constant
+       REAL(wp), PARAMETER :: c = 5.0_wp            !< constant
+       REAL(wp), PARAMETER :: d = 0.35_wp           !< constant
+       REAL(wp), PARAMETER :: c_d_d = c / d         !< constant
+       REAL(wp), PARAMETER :: bc_d_d = b * c / d    !< constant
+
+
+      IF ( zeta < 0.0_wp )  THEN
+         x = SQRT( 1.0_wp  - 16.0_wp * zeta )
+         psi_h = 2.0_wp * LOG( (1.0_wp + x ) / 2.0_wp )
+      ELSE
+         psi_h = - b * ( zeta - c_d_d ) * EXP( -d * zeta ) - (1.0_wp          &
+                 + 0.66666666666_wp * a * zeta )**1.5_wp - bc_d_d             &
+                 + 1.0_wp
+!
+!--       Old version for stable conditions (only valid for z/L < 0.5)
+!--       psi_h = - 5.0_wp * zeta
+       ENDIF
+
+   END FUNCTION psi_h
+    
  END MODULE land_surface_model_mod
Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 3596)
+++ palm/trunk/SOURCE/modules.f90	(revision 3597)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Added flag parameter do_output_at_2m for automatic output of 2m-temperature
+! 
+! 3589 2018-11-30 15:09:51Z suehring
 ! Move the control parameter "salsa" from salsa_mod to control_parameters 
 ! (M. Kurppa)
@@ -1063,4 +1066,5 @@
     REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  lwp_av                 !< avg. liquid water path
     REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  ol_av                  !< avg. Obukhov length
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  pt_2m_av               !< avg. 2m- air potential temperature 
     REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  qsws_av                !< avg. surface moisture flux
     REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  r_a_av                 !< avg. resistance
@@ -1354,4 +1358,5 @@
     LOGICAL ::  do2d_at_begin = .FALSE.                          !< namelist parameter
     LOGICAL ::  do3d_at_begin = .FALSE.                          !< namelist parameter
+    LOGICAL ::  do_output_at_2m = .FALSE.                        !< flag for activating calculation of potential temperature at z = 2 m
     LOGICAL ::  do_sum = .FALSE.                                 !< contribute to time average of profile data?
     LOGICAL ::  dp_external = .FALSE.                            !< namelist parameter
Index: palm/trunk/SOURCE/sum_up_3d_data.f90
===================================================================
--- palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 3596)
+++ palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 3597)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Added output of theta_2m
+! 
+! 3589 2018-11-30 15:09:51Z suehring
 ! Move the control parameter "salsa" from salsa_mod to control_parameters 
 ! (M. Kurppa)
@@ -249,7 +252,7 @@
     USE averaging,                                                             &
         ONLY:  e_av, ghf_av, lpt_av, lwp_av, ol_av, p_av, pc_av, pr_av, pt_av, &
-               q_av, ql_av, ql_c_av, ql_v_av, ql_vp_av, qsws_av, qv_av,        &
-               r_a_av, s_av, shf_av, ssws_av, ts_av, tsurf_av, u_av, us_av,    &
-               v_av, vpt_av, w_av, z0_av, z0h_av, z0q_av
+               pt_2m_av, q_av, ql_av, ql_c_av, ql_v_av, ql_vp_av, qsws_av,     &
+               qv_av, r_a_av, s_av, shf_av, ssws_av, ts_av, tsurf_av, u_av,    &
+               us_av, v_av, vpt_av, w_av, z0_av, z0h_av, z0q_av
 
     USE basic_constants_and_equations_mod,                                     &
@@ -497,4 +500,10 @@
                 ENDIF
                 vpt_av = 0.0_wp
+
+             CASE ( 'theta_2m*' )
+                IF ( .NOT. ALLOCATED( pt_2m_av ) )  THEN
+                   ALLOCATE( pt_2m_av(nysg:nyng,nxlg:nxrg) )
+                ENDIF
+                pt_2m_av = 0.0_wp
 
              CASE ( 'w' )
Index: palm/trunk/SOURCE/surface_layer_fluxes_mod.f90
===================================================================
--- palm/trunk/SOURCE/surface_layer_fluxes_mod.f90	(revision 3596)
+++ palm/trunk/SOURCE/surface_layer_fluxes_mod.f90	(revision 3597)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! Added routine for calculating near surface air potential temperature (moved
+! from urban_surface_mod)
+! 
+! 3547 2018-11-21 13:21:24Z suehring
 ! variables documented
 ! 
@@ -250,6 +254,6 @@
         ONLY:  air_chemistry, cloud_droplets,                                  &
                constant_heatflux, constant_scalarflux,                         &
-               constant_waterflux, coupling_mode, humidity, ibc_e_b,           &
-               ibc_pt_b, initializing_actions,                                 &
+               constant_waterflux, coupling_mode, do_output_at_2m, humidity,   &
+               ibc_e_b, ibc_pt_b, indoor_model, initializing_actions,          &
                intermediate_timestep_count, intermediate_timestep_count_max,   &
                land_surface, large_scale_forcing, lsf_surf, message_string,    &
@@ -413,4 +417,8 @@
              CALL calc_us
              CALL calc_surface_fluxes
+             
+             IF ( do_output_at_2m )  THEN
+                CALL calc_pt_near_surface ( '2m' )
+             ENDIF
           ENDIF
 !
@@ -423,4 +431,7 @@
              CALL calc_us
              CALL calc_surface_fluxes
+             IF ( do_output_at_2m )  THEN
+                CALL calc_pt_near_surface ( '2m' )
+             ENDIF
           ENDIF
 !
@@ -433,4 +444,10 @@
              CALL calc_us
              CALL calc_surface_fluxes
+             IF ( do_output_at_2m )  THEN
+                CALL calc_pt_near_surface ( '2m' )
+             ENDIF
+             IF ( indoor_model )  THEN
+                CALL calc_pt_near_surface ( '10cm' )
+             ENDIF
           ENDIF
 !
@@ -447,4 +464,7 @@
              CALL calc_scaling_parameters
              CALL calc_surface_fluxes
+             IF ( do_output_at_2m )  THEN
+                CALL calc_pt_near_surface ( '2m' )
+             ENDIF
           ENDIF
 !
@@ -457,4 +477,7 @@
              CALL calc_scaling_parameters
              CALL calc_surface_fluxes
+             IF ( do_output_at_2m )  THEN
+                CALL calc_pt_near_surface ( '2m' )
+             ENDIF
           ENDIF
 !
@@ -467,4 +490,10 @@
              CALL calc_scaling_parameters
              CALL calc_surface_fluxes
+             IF ( do_output_at_2m )  THEN
+                CALL calc_pt_near_surface ( '2m' )
+             ENDIF
+             IF ( indoor_model )  THEN
+                CALL calc_pt_near_surface ( '10cm' )
+             ENDIF
           ENDIF
 
@@ -2305,4 +2334,58 @@
     END SUBROUTINE calc_surface_fluxes
 
+    
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Calculates temperature near surface (10 cm) for indoor model or 2 m 
+!> temperature for output
+!------------------------------------------------------------------------------!
+    SUBROUTINE calc_pt_near_surface ( z_char )
+
+       IMPLICIT NONE
+
+       CHARACTER (LEN = *), INTENT(IN)       :: z_char          !< string identifier to identify z level
+       INTEGER(iwp)                          :: i, j, k, l, m   !< running indices
+
+       
+       SELECT CASE ( z_char)
+            
+       
+          CASE ( '10cm' )
+
+             DO  m = 1, surf%ns
+
+                i = surf%i(m)
+                j = surf%j(m)
+                k = surf%k(m)
+
+                surf%pt_10cm(m) = surf%pt_surface(m) + surf%ts(m) / kappa  &
+                                   * ( log( 0.1_wp /  surf%z0h(m) )                    &
+                                  - psi_h( 0.1_wp / surf%ol(m) )                    &
+                                     + psi_h( surf%z0h(m) / surf%ol(m) ) )
+
+             ENDDO
+
+
+          CASE ( '2m' )
+      
+             DO  m = 1, surf%ns
+
+                i = surf%i(m)
+                j = surf%j(m)
+                k = surf%k(m)
+
+                surf%pt_2m(m) = surf%pt_surface(m) + surf%ts(m) / kappa  &
+                                   * ( log( 2.0_wp /  surf%z0h(m) )                    &
+                                     - psi_h( 2.0_wp / surf%ol(m) )                    &
+                                     + psi_h( surf%z0h(m) / surf%ol(m) ) )
+
+             ENDDO
+          
+       
+       END SELECT
+
+    END SUBROUTINE calc_pt_near_surface
+    
 
 !
Index: palm/trunk/SOURCE/surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/surface_mod.f90	(revision 3596)
+++ palm/trunk/SOURCE/surface_mod.f90	(revision 3597)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! Added pt_2m and renamed t_surf_10cm to pt_10cm. Removed some _eb variables as
+! they are no longer used.
+! 
+! 3593 2018-12-03 13:51:13Z kanani
 ! Replace degree symbol by 'degrees'
 ! 
@@ -409,6 +413,4 @@
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  rad_sw_ref          !< incoming shortwave radiation from reflection
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  rad_sw_res          !< resedual shortwave radiation in surface after last reflection step
-       
-
 
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  c_liq               !< liquid water coverage (of vegetated area)
@@ -422,9 +424,6 @@
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_eb             !<
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_liq            !< surface flux of latent heat (liquid water portion)
-       REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_liq_eb         !< surface flux of latent heat (liquid water portion)
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_soil           !< surface flux of latent heat (soil portion)
-       REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_soil_eb        !< surface flux of latent heat (soil portion)
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_veg            !< surface flux of latent heat (vegetation portion)
-       REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_veg_eb         !< surface flux of latent heat (vegetation portion)
 
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  r_a                 !< aerodynamic resistance 
@@ -436,5 +435,8 @@
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  r_s                 !< total surface resistance (combination of r_soil and r_canopy)
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  r_canopy_min        !< minimum canopy (stomatal) resistance
-
+       
+       REAL(wp), DIMENSION(:), ALLOCATABLE ::  pt_10cm             !< near surface air potential temperature at distance 10 cm from the surface (K)
+       REAL(wp), DIMENSION(:), ALLOCATABLE ::  pt_2m               !< near surface air potential temperature at distance 2 m from the surface (K)     
+       
        REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  alpha_vg          !< coef. of Van Genuchten
        REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  lambda_w          !< hydraulic diffusivity of soil (?)
@@ -550,12 +552,13 @@
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  wshf_eb_av       !< average of wshf_eb
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_eb_av       !< average of qsws_eb
-       REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_veg_eb_av       !< average of qsws_veg_eb
-       REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_liq_eb_av       !< average of qsws_liq_eb
+       REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_veg_av       !< average of qsws_veg_eb
+       REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_liq_av       !< average of qsws_liq_eb
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  t_surf_wall_av        !< average of wall surface temperature (K)
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  t_surf_av        !< average of wall surface temperature (K)
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  t_surf_window_av !< average of window surface temperature (K)
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  t_surf_green_av  !< average of green wall surface temperature (K)
-       REAL(wp), DIMENSION(:), ALLOCATABLE ::  t_surf_10cm_av   !< average of the near surface temperature (K)
-
+
+       REAL(wp), DIMENSION(:), ALLOCATABLE ::  pt_10cm_av       !< average of theta_10cm (K)
+       
        REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  t_wall_av      !< Average of t_wall
        REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  t_window_av    !< Average of t_window
@@ -1270,5 +1273,5 @@
        ALLOCATE ( surfaces%shf(1:surfaces%ns) )    
 !
-!--    surface temperature
+!--    Surface temperature
        ALLOCATE ( surfaces%pt_surface(1:surfaces%ns) ) 
 !
@@ -1280,4 +1283,5 @@
           ALLOCATE ( surfaces%vpt_surface(1:surfaces%ns) ) 
        ENDIF 
+
 !
 !--    Characteristic scalar and surface flux of scalar
Index: palm/trunk/SOURCE/time_integration.f90
===================================================================
--- palm/trunk/SOURCE/time_integration.f90	(revision 3596)
+++ palm/trunk/SOURCE/time_integration.f90	(revision 3597)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Removed call to calculation of near air (10 cm) potential temperature (now in
+! surface layer fluxes)
+! 
+! 3589 2018-11-30 15:09:51Z suehring
 ! Move the control parameter "salsa" from salsa_mod to control_parameters 
 ! (M. Kurppa)
@@ -578,6 +582,5 @@
         ONLY:  usm_boundary_condition, usm_material_heat_model,                &
                usm_material_model,                                             &
-               usm_surface_energy_balance, usm_green_heat_model,               &
-               usm_temperature_near_surface
+               usm_surface_energy_balance, usm_green_heat_model
 
     USE synthetic_turbulence_generator_mod,                                    &
@@ -1154,4 +1157,5 @@
                 CALL lsm_energy_balance( .FALSE., 3 )
                 CALL lsm_soil_model( .FALSE., 3, .TRUE. )
+                
 !
 !--             At the end, set boundary conditons for potential temperature
@@ -1160,4 +1164,5 @@
                 CALL lsm_boundary_condition
 
+                
                 CALL cpu_log( log_point(54), 'land_surface', 'stop' )
              ENDIF
@@ -1174,5 +1179,4 @@
                 ENDIF
 
-                CALL usm_temperature_near_surface
 !
 !--             At the end, set boundary conditons for potential temperature
Index: palm/trunk/SOURCE/time_integration_spinup.f90
===================================================================
--- palm/trunk/SOURCE/time_integration_spinup.f90	(revision 3596)
+++ palm/trunk/SOURCE/time_integration_spinup.f90	(revision 3597)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Removed call to calculation of near air (10 cm) potential temperature (now in
+! surface layer fluxes)
+! 
+! 3467 2018-10-30 19:05:21Z suehring
 ! call to material_heat_model now with check if spinup runs (rvtils)
 ! 
@@ -129,5 +133,4 @@
     USE land_surface_model_mod,                                                &
         ONLY:  lsm_energy_balance, lsm_soil_model, lsm_swap_timelevel
-
     USE pegrid
 
@@ -154,5 +157,5 @@
         ONLY:  usm_material_heat_model, usm_material_model,                    &
                usm_surface_energy_balance, usm_swap_timelevel,                 &
-               usm_green_heat_model, usm_temperature_near_surface
+               usm_green_heat_model
 
 
@@ -389,5 +392,5 @@
                 CALL lsm_energy_balance( .FALSE., 3 )
                 CALL lsm_soil_model( .FALSE., 3, calc_soil_moisture_during_spinup )
-
+                
                 CALL cpu_log( log_point(54), 'land_surface', 'stop' )
              ENDIF
@@ -403,7 +406,5 @@
                    CALL usm_material_heat_model( .TRUE. )
                 ENDIF
-                IF ( urban_surface ) THEN
-                   CALL usm_temperature_near_surface
-                ENDIF
+                
                 CALL cpu_log( log_point(74), 'urban_surface', 'stop' )
              ENDIF
Index: palm/trunk/SOURCE/urban_surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/urban_surface_mod.f90	(revision 3596)
+++ palm/trunk/SOURCE/urban_surface_mod.f90	(revision 3597)
@@ -28,4 +28,8 @@
 ! -----------------
 ! $Id$
+! Fixed calculation method of near surface air potential temperature at 10 cm
+! and moved to surface_layer_fluxes. Removed unnecessary _eb strings.
+! 
+! 3524 2018-11-14 13:36:44Z raasch
 ! bugfix concerning allocation of t_surf_wall_v
 ! 
@@ -240,7 +244,7 @@
 ! - Move first call of usm_radiatin from usm_init to init_3d_model
 ! - fixed problem with near surface temperature
-! - added near surface temperature t_surf_10cm_h(m), t_surf_10cm_v(l)%t(m)
+! - added near surface temperature pt_10cm_h(m), pt_10cm_v(l)%t(m)
 ! - does not work with temp profile including stability, ol
-!   t_surf_10cm = pt1 now
+!   pt_10cm = pt1 now
 ! - merged with 2357 bugfix, error message for nopointer version
 ! - added indoor model coupling with wall heat flux
@@ -986,6 +990,6 @@
     REAL(wp), DIMENSION(:,:), ALLOCATABLE          ::  t_window_av      !< Average of t_window
     REAL(wp), DIMENSION(:), ALLOCATABLE            ::  qsws_eb_av       !< average of qsws_eb
-    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  qsws_veg_eb_av   !< average of qsws_veg_eb
-    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  qsws_liq_eb_av   !< average of qsws_liq_eb
+    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  qsws_veg_av   !< average of qsws_veg
+    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  qsws_liq_av   !< average of qsws_liq
     REAL(wp), DIMENSION(:,:), ALLOCATABLE          ::  swc_av        !< Average of swc
     
@@ -1041,6 +1045,4 @@
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_green_h     !< green surface temperature (K) at horizontal walls
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_green_h_p   !< progn. green surface temperature (K) at horizontal walls
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_10cm_h      !< near surface temperature (10cm) (K) at horizontal walls
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_10cm_h_p    !< progn. near surface temperature (10cm) (K) at horizontal walls
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_wall_v
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_wall_v_p
@@ -1049,6 +1051,4 @@
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_green_v
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_green_v_p
-    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_10cm_v
-    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_10cm_v_p
 #else
     REAL(wp), DIMENSION(:), POINTER                :: t_surf_wall_h
@@ -1058,6 +1058,4 @@
     REAL(wp), DIMENSION(:), POINTER                :: t_surf_green_h
     REAL(wp), DIMENSION(:), POINTER                :: t_surf_green_h_p 
-    REAL(wp), DIMENSION(:), POINTER                :: t_surf_10cm_h
-    REAL(wp), DIMENSION(:), POINTER                :: t_surf_10cm_h_p
 
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_wall_h_1
@@ -1067,6 +1065,4 @@
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_green_h_1
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_green_h_2
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_10cm_h_1
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_10cm_h_2
 
     TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_wall_v
@@ -1076,6 +1072,4 @@
     TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_green_v
     TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_green_v_p
-    TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_10cm_v
-    TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_10cm_v_p
 
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_wall_v_1
@@ -1085,6 +1079,4 @@
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_green_v_1
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_green_v_2
-    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_10cm_v_1
-    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_10cm_v_2
     
 #endif
@@ -1092,5 +1084,4 @@
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_window_av   !< average of window surface temperature (K)
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_green_av    !< average of green wall surface temperature (K)
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_10cm_av    !< average of whole wall surface temperature (K)
 
 !-- Temporal tendencies for time stepping            
@@ -1218,8 +1209,4 @@
        MODULE PROCEDURE usm_parin
     END INTERFACE usm_parin
-    
-    INTERFACE usm_temperature_near_surface
-       MODULE PROCEDURE usm_temperature_near_surface
-    END INTERFACE usm_temperature_near_surface
 
     INTERFACE usm_rrd_local 
@@ -1262,6 +1249,6 @@
 !-- Public parameters, constants and initial values
     PUBLIC usm_anthropogenic_heat, usm_material_model, usm_wall_mod,           &
-           usm_green_heat_model, usm_temperature_near_surface, building_pars,  &
-           nzt_wall, t_surf_10cm_h, t_surf_10cm_v, t_wall_h, t_wall_v,         &
+           usm_green_heat_model, building_pars,  &
+           nzt_wall, t_wall_h, t_wall_v,         &
            t_window_h, t_window_v, building_type
 
@@ -1363,4 +1350,5 @@
         ALLOCATE ( surf_usm_h%green_type_roof(1:surf_usm_h%ns)    )
         ALLOCATE ( surf_usm_h%r_s(1:surf_usm_h%ns)                )
+        
 !
 !--     For vertical surfaces.
@@ -1377,7 +1365,6 @@
            ALLOCATE ( surf_usm_v(l)%r_a(1:surf_usm_v(l)%ns)             )
            ALLOCATE ( surf_usm_v(l)%r_a_green(1:surf_usm_v(l)%ns)       )
-           ALLOCATE ( surf_usm_v(l)%r_a_window(1:surf_usm_v(l)%ns)      )
-           
-          ALLOCATE ( surf_usm_v(l)%r_s(1:surf_usm_v(l)%ns)                 )
+           ALLOCATE ( surf_usm_v(l)%r_a_window(1:surf_usm_v(l)%ns)      )           
+           ALLOCATE ( surf_usm_v(l)%r_s(1:surf_usm_v(l)%ns)                )
         ENDDO
 
@@ -1421,9 +1408,11 @@
         ALLOCATE ( surf_usm_h%g_d(1:surf_usm_h%ns)              )
         ALLOCATE ( surf_usm_h%c_liq(1:surf_usm_h%ns)            )
-        ALLOCATE ( surf_usm_h%qsws_liq_eb(1:surf_usm_h%ns)         )
-        ALLOCATE ( surf_usm_h%qsws_veg_eb(1:surf_usm_h%ns)         )
+        ALLOCATE ( surf_usm_h%qsws_liq(1:surf_usm_h%ns)         )
+        ALLOCATE ( surf_usm_h%qsws_veg(1:surf_usm_h%ns)         )
         ALLOCATE ( surf_usm_h%r_canopy(1:surf_usm_h%ns)         )
         ALLOCATE ( surf_usm_h%r_canopy_min(1:surf_usm_h%ns)     )
-        ALLOCATE ( surf_usm_h%qsws_eb(1:surf_usm_h%ns)         )
+        ALLOCATE ( surf_usm_h%qsws_eb(1:surf_usm_h%ns)          )
+        ALLOCATE ( surf_usm_h%pt_10cm(1:surf_usm_h%ns)          ) 
+        ALLOCATE ( surf_usm_h%pt_2m(1:surf_usm_h%ns)            ) 
 
 !
@@ -1432,9 +1421,10 @@
           ALLOCATE ( surf_usm_v(l)%g_d(1:surf_usm_v(l)%ns)              )
           ALLOCATE ( surf_usm_v(l)%c_liq(1:surf_usm_v(l)%ns)            )
-          ALLOCATE ( surf_usm_v(l)%qsws_liq_eb(1:surf_usm_v(l)%ns)         )
-          ALLOCATE ( surf_usm_v(l)%qsws_veg_eb(1:surf_usm_v(l)%ns)         )
+          ALLOCATE ( surf_usm_v(l)%qsws_liq(1:surf_usm_v(l)%ns)         )
+          ALLOCATE ( surf_usm_v(l)%qsws_veg(1:surf_usm_v(l)%ns)         )
           ALLOCATE ( surf_usm_v(l)%qsws_eb(1:surf_usm_v(l)%ns)          )
           ALLOCATE ( surf_usm_v(l)%r_canopy(1:surf_usm_v(l)%ns)         )
           ALLOCATE ( surf_usm_v(l)%r_canopy_min(1:surf_usm_v(l)%ns)     )
+          ALLOCATE ( surf_usm_v(l)%pt_10cm(1:surf_usm_v(l)%ns)     )
         ENDDO
         
@@ -1504,8 +1494,4 @@
         IF ( .NOT. ALLOCATED( t_green_h_p ) )                                  &           
            ALLOCATE ( t_green_h_p(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) )  
-        IF ( .NOT. ALLOCATED( t_surf_10cm_h ) )                                &
-           ALLOCATE ( t_surf_10cm_h(1:surf_usm_h%ns) )
-        IF ( .NOT. ALLOCATED( t_surf_10cm_h_p ) )                              &
-           ALLOCATE ( t_surf_10cm_h_p(1:surf_usm_h%ns) )
         IF ( .NOT. ALLOCATED( swc_h ) )                                    &           
            ALLOCATE ( swc_h(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) )
@@ -1560,8 +1546,4 @@
         IF ( .NOT. ALLOCATED( t_green_h_2 ) )                                  &           
            ALLOCATE ( t_green_h_2(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) )          
-        IF ( .NOT. ALLOCATED( t_surf_10cm_h_1 ) )                              &
-           ALLOCATE ( t_surf_10cm_h_1(1:surf_usm_h%ns) )
-        IF ( .NOT. ALLOCATED( t_surf_10cm_h_2 ) )                              &
-           ALLOCATE ( t_surf_10cm_h_2(1:surf_usm_h%ns) )
         IF ( .NOT. ALLOCATED( swc_h_1 ) )                                  &           
            ALLOCATE ( swc_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) 
@@ -1592,5 +1574,4 @@
         t_surf_window_h => t_surf_window_h_1; t_surf_window_h_p => t_surf_window_h_2  
         t_surf_green_h => t_surf_green_h_1; t_surf_green_h_p => t_surf_green_h_2           
-        t_surf_10cm_h => t_surf_10cm_h_1; t_surf_10cm_h_p => t_surf_10cm_h_2  
         m_liq_usm_h     => m_liq_usm_h_1;     m_liq_usm_h_p     => m_liq_usm_h_2
         swc_h       => swc_h_1; swc_h_p     => swc_h_2
@@ -1630,8 +1611,4 @@
            IF ( .NOT. ALLOCATED( t_surf_green_v_p(l)%t ) )                     &
               ALLOCATE ( t_surf_green_v_p(l)%t(1:surf_usm_v(l)%ns) )
-           IF ( .NOT. ALLOCATED( t_surf_10cm_v(l)%t ) )                        &
-              ALLOCATE ( t_surf_10cm_v(l)%t(1:surf_usm_v(l)%ns) )
-           IF ( .NOT. ALLOCATED( t_surf_10cm_v_p(l)%t ) )                        &
-              ALLOCATE ( t_surf_10cm_v_p(l)%t(1:surf_usm_v(l)%ns) )
            IF ( .NOT. ALLOCATED( m_liq_usm_v(l)%var_usm_1d ) )                 &
              ALLOCATE ( m_liq_usm_v(l)%var_usm_1d(1:surf_usm_v(l)%ns) )
@@ -1670,8 +1647,4 @@
            IF ( .NOT. ALLOCATED( t_green_v_2(l)%t ) )                          &           
               ALLOCATE ( t_green_v_2(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) )  
-           IF ( .NOT. ALLOCATED( t_surf_10cm_v_1(l)%t ) )                     &
-              ALLOCATE ( t_surf_10cm_v_1(l)%t(1:surf_usm_v(l)%ns) )
-           IF ( .NOT. ALLOCATED( t_surf_10cm_v_2(l)%t ) )                     &
-              ALLOCATE ( t_surf_10cm_v_2(l)%t(1:surf_usm_v(l)%ns) )
            IF ( .NOT. ALLOCATED( m_liq_usm_v_1(l)%var_usm_1d ) )              &
               ALLOCATE ( m_liq_usm_v_1(l)%var_usm_1d(1:surf_usm_v(l)%ns) )
@@ -1691,5 +1664,4 @@
         t_surf_window_v => t_surf_window_v_1; t_surf_window_v_p => t_surf_window_v_2
         t_surf_green_v => t_surf_green_v_1; t_surf_green_v_p => t_surf_green_v_2
-        t_surf_10cm_v => t_surf_10cm_v_1; t_surf_10cm_v_p => t_surf_10cm_v_2
         m_liq_usm_v     => m_liq_usm_v_1;     m_liq_usm_v_p     => m_liq_usm_v_2
         swc_v    => swc_v_1;    swc_v_p    => swc_v_2
@@ -2032,11 +2004,11 @@
 !--                 array of latent heat flux from vegetation surfaces
 !--                 land surfaces
-                    IF ( l == -1 .AND. .NOT.  ALLOCATED(surf_usm_h%qsws_veg_eb_av) )  THEN
-                        ALLOCATE( surf_usm_h%qsws_veg_eb_av(1:surf_usm_h%ns) )
-                        surf_usm_h%qsws_veg_eb_av = 0.0_wp
+                    IF ( l == -1 .AND. .NOT.  ALLOCATED(surf_usm_h%qsws_veg_av) )  THEN
+                        ALLOCATE( surf_usm_h%qsws_veg_av(1:surf_usm_h%ns) )
+                        surf_usm_h%qsws_veg_av = 0.0_wp
                     ELSE
-                       IF ( .NOT.  ALLOCATED(surf_usm_v(l)%qsws_veg_eb_av) )  THEN
-                           ALLOCATE( surf_usm_v(l)%qsws_veg_eb_av(1:surf_usm_v(l)%ns) )
-                           surf_usm_v(l)%qsws_veg_eb_av = 0.0_wp
+                       IF ( .NOT.  ALLOCATED(surf_usm_v(l)%qsws_veg_av) )  THEN
+                           ALLOCATE( surf_usm_v(l)%qsws_veg_av(1:surf_usm_v(l)%ns) )
+                           surf_usm_v(l)%qsws_veg_av = 0.0_wp
                        ENDIF
                     ENDIF
@@ -2045,11 +2017,11 @@
 !--                 array of latent heat flux from surfaces with liquid
 !--                 land surfaces
-                    IF ( l == -1 .AND. .NOT.  ALLOCATED(surf_usm_h%qsws_liq_eb_av) )  THEN
-                        ALLOCATE( surf_usm_h%qsws_liq_eb_av(1:surf_usm_h%ns) )
-                        surf_usm_h%qsws_liq_eb_av = 0.0_wp
+                    IF ( l == -1 .AND. .NOT.  ALLOCATED(surf_usm_h%qsws_liq_av) )  THEN
+                        ALLOCATE( surf_usm_h%qsws_liq_av(1:surf_usm_h%ns) )
+                        surf_usm_h%qsws_liq_av = 0.0_wp
                     ELSE
-                       IF ( .NOT.  ALLOCATED(surf_usm_v(l)%qsws_liq_eb_av) )  THEN
-                           ALLOCATE( surf_usm_v(l)%qsws_liq_eb_av(1:surf_usm_v(l)%ns) )
-                           surf_usm_v(l)%qsws_liq_eb_av = 0.0_wp
+                       IF ( .NOT.  ALLOCATED(surf_usm_v(l)%qsws_liq_av) )  THEN
+                           ALLOCATE( surf_usm_v(l)%qsws_liq_av(1:surf_usm_v(l)%ns) )
+                           surf_usm_v(l)%qsws_liq_av = 0.0_wp
                        ENDIF
                     ENDIF
@@ -2171,18 +2143,18 @@
                     ENDIF
                 
-                CASE ( 'usm_t_surf_10cm' )
-!--                 near surface temperature for whole surfaces
+                CASE ( 'usm_theta_10cm' )
+!--                 near surface (10cm) temperature for whole surfaces
                     IF ( l == -1 ) THEN
-                       IF ( .NOT.  ALLOCATED(surf_usm_h%t_surf_10cm_av) )  THEN
-                           ALLOCATE( surf_usm_h%t_surf_10cm_av(1:surf_usm_h%ns) )
-                           surf_usm_h%t_surf_10cm_av = 0.0_wp
+                       IF ( .NOT.  ALLOCATED(surf_usm_h%pt_10cm_av) )  THEN
+                           ALLOCATE( surf_usm_h%pt_10cm_av(1:surf_usm_h%ns) )
+                           surf_usm_h%pt_10cm_av = 0.0_wp
                        ENDIF
                     ELSE
-                       IF ( .NOT.  ALLOCATED(surf_usm_v(l)%t_surf_10cm_av) )  THEN
-                           ALLOCATE( surf_usm_v(l)%t_surf_10cm_av(1:surf_usm_v(l)%ns) )
-                           surf_usm_v(l)%t_surf_10cm_av = 0.0_wp
+                       IF ( .NOT.  ALLOCATED(surf_usm_v(l)%pt_10cm_av) )  THEN
+                           ALLOCATE( surf_usm_v(l)%pt_10cm_av(1:surf_usm_v(l)%ns) )
+                           surf_usm_v(l)%pt_10cm_av = 0.0_wp
                        ENDIF
                     ENDIF
-
+                 
                 CASE ( 'usm_t_wall' )
 !--                 wall temperature for iwl layer of walls and land
@@ -2423,13 +2395,13 @@
                     IF ( l == -1 ) THEN
                     DO  m = 1, surf_usm_h%ns
-                       surf_usm_h%qsws_veg_eb_av(m) =                              &
-                                          surf_usm_h%qsws_veg_eb_av(m) +           &
-                                          surf_usm_h%qsws_veg_eb(m)
+                       surf_usm_h%qsws_veg_av(m) =                              &
+                                          surf_usm_h%qsws_veg_av(m) +           &
+                                          surf_usm_h%qsws_veg(m)
                     ENDDO
                     ELSE
                        DO  m = 1, surf_usm_v(l)%ns
-                          surf_usm_v(l)%qsws_veg_eb_av(m) =                        &
-                                          surf_usm_v(l)%qsws_veg_eb_av(m) +        &
-                                          surf_usm_v(l)%qsws_veg_eb(m)
+                          surf_usm_v(l)%qsws_veg_av(m) =                        &
+                                          surf_usm_v(l)%qsws_veg_av(m) +        &
+                                          surf_usm_v(l)%qsws_veg(m)
                        ENDDO
                     ENDIF
@@ -2439,13 +2411,13 @@
                     IF ( l == -1 ) THEN
                     DO  m = 1, surf_usm_h%ns
-                       surf_usm_h%qsws_liq_eb_av(m) =                              &
-                                          surf_usm_h%qsws_liq_eb_av(m) +           &
-                                          surf_usm_h%qsws_liq_eb(m)
+                       surf_usm_h%qsws_liq_av(m) =                              &
+                                          surf_usm_h%qsws_liq_av(m) +           &
+                                          surf_usm_h%qsws_liq(m)
                     ENDDO
                     ELSE
                        DO  m = 1, surf_usm_v(l)%ns
-                          surf_usm_v(l)%qsws_liq_eb_av(m) =                        &
-                                          surf_usm_v(l)%qsws_liq_eb_av(m) +        &
-                                          surf_usm_v(l)%qsws_liq_eb(m)
+                          surf_usm_v(l)%qsws_liq_av(m) =                        &
+                                          surf_usm_v(l)%qsws_liq_av(m) +        &
+                                          surf_usm_v(l)%qsws_liq(m)
                        ENDDO
                     ENDIF
@@ -2579,20 +2551,19 @@
                     ENDIF
                 
-                CASE ( 'usm_t_surf_10cm' )
+                CASE ( 'usm_theta_10cm' )
 !--                 near surface temperature for whole surfaces
                     IF ( l == -1 ) THEN
                        DO  m = 1, surf_usm_h%ns
-                          surf_usm_h%t_surf_10cm_av(m) =                               &
-                                             surf_usm_h%t_surf_10cm_av(m) +            &
-                                             t_surf_10cm_h(m)
+                          surf_usm_h%pt_10cm_av(m) =                               &
+                                             surf_usm_h%pt_10cm_av(m) +            &
+                                             surf_usm_h%pt_10cm(m)
                        ENDDO
                     ELSE
                        DO  m = 1, surf_usm_v(l)%ns
-                          surf_usm_v(l)%t_surf_10cm_av(m) =                         &
-                                          surf_usm_v(l)%t_surf_10cm_av(m) +         &
-                                          t_surf_10cm_v(l)%t(m)
+                          surf_usm_v(l)%pt_10cm_av(m) =                         &
+                                          surf_usm_v(l)%pt_10cm_av(m) +         &
+                                          surf_usm_v(l)%pt_10cm(m)
                        ENDDO
                     ENDIF
-
                     
                 CASE ( 'usm_t_wall' )
@@ -2840,12 +2811,12 @@
                     IF ( l == -1 ) THEN
                     DO  m = 1, surf_usm_h%ns
-                       surf_usm_h%qsws_veg_eb_av(m) =                              &
-                                          surf_usm_h%qsws_veg_eb_av(m) /           &
+                       surf_usm_h%qsws_veg_av(m) =                              &
+                                          surf_usm_h%qsws_veg_av(m) /           &
                                           REAL( average_count_3d, kind=wp )
                     ENDDO
                     ELSE
                        DO  m = 1, surf_usm_v(l)%ns
-                          surf_usm_v(l)%qsws_veg_eb_av(m) =                        &
-                                          surf_usm_v(l)%qsws_veg_eb_av(m) /        &
+                          surf_usm_v(l)%qsws_veg_av(m) =                        &
+                                          surf_usm_v(l)%qsws_veg_av(m) /        &
                                           REAL( average_count_3d, kind=wp )
                        ENDDO
@@ -2856,12 +2827,12 @@
                     IF ( l == -1 ) THEN
                     DO  m = 1, surf_usm_h%ns
-                       surf_usm_h%qsws_liq_eb_av(m) =                              &
-                                          surf_usm_h%qsws_liq_eb_av(m) /           &
+                       surf_usm_h%qsws_liq_av(m) =                              &
+                                          surf_usm_h%qsws_liq_av(m) /           &
                                           REAL( average_count_3d, kind=wp )
                     ENDDO
                     ELSE
                        DO  m = 1, surf_usm_v(l)%ns
-                          surf_usm_v(l)%qsws_liq_eb_av(m) =                        &
-                                          surf_usm_v(l)%qsws_liq_eb_av(m) /        &
+                          surf_usm_v(l)%qsws_liq_av(m) =                        &
+                                          surf_usm_v(l)%qsws_liq_av(m) /        &
                                           REAL( average_count_3d, kind=wp )
                        ENDDO
@@ -2996,19 +2967,20 @@
                     ENDIF
                     
-                CASE ( 'usm_t_surf_10cm' )
+                CASE ( 'usm_theta_10cm' )
 !--                 near surface temperature for whole surfaces
                     IF ( l == -1 ) THEN
                        DO  m = 1, surf_usm_h%ns
-                          surf_usm_h%t_surf_10cm_av(m) =                               &
-                                             surf_usm_h%t_surf_10cm_av(m) /            &
+                          surf_usm_h%pt_10cm_av(m) =                               &
+                                             surf_usm_h%pt_10cm_av(m) /            &
                                              REAL( average_count_3d, kind=wp )
                        ENDDO
                     ELSE
                        DO  m = 1, surf_usm_v(l)%ns
-                          surf_usm_v(l)%t_surf_10cm_av(m) =                         &
-                                          surf_usm_v(l)%t_surf_10cm_av(m) /         &
+                          surf_usm_v(l)%pt_10cm_av(m) =                         &
+                                          surf_usm_v(l)%pt_10cm_av(m) /         &
                                           REAL( average_count_3d, kind=wp )
                        ENDDO
                     ENDIF
+
                     
                 CASE ( 'usm_t_wall' )
@@ -3173,5 +3145,5 @@
                     'usm_t_surf_green              ', &
                     'usm_t_green                   ', &
-                    'usm_t_surf_10cm               ', &
+                    'usm_theta_10cm                ', &
                     'usm_skyvf                     ', &
                     'usm_skyvft                    '/)
@@ -3260,5 +3232,5 @@
                   var(1:16) == 'usm_t_surf_green'  .OR.                                   &
                   var(1:11) == 'usm_t_green' .OR.  var(1:7) == 'usm_swc' .OR.             &
-                  var(1:15) == 'usm_t_surf_10cm' )  THEN
+                  var(1:14) == 'usm_theta_10cm' )  THEN
             unit = 'K'
         ELSE IF ( var == 'usm_rad_pc_inlw'  .OR.  var == 'usm_rad_pc_insw'  .OR.          &
@@ -3935,5 +3907,5 @@
                        j = surf_usm_h%j(m)
                        k = surf_usm_h%k(m)
-                       temp_pf(k,j,i) = surf_usm_h%qsws_veg_eb(m)
+                       temp_pf(k,j,i) = surf_usm_h%qsws_veg(m)
                     ENDDO
                  ELSE
@@ -3943,5 +3915,5 @@
                        j = surf_usm_v(l)%j(m)
                        k = surf_usm_v(l)%k(m)
-                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_veg_eb(m)
+                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_veg(m)
                     ENDDO
                  ENDIF
@@ -3952,5 +3924,5 @@
                        j = surf_usm_h%j(m)
                        k = surf_usm_h%k(m)
-                       temp_pf(k,j,i) = surf_usm_h%qsws_veg_eb_av(m)
+                       temp_pf(k,j,i) = surf_usm_h%qsws_veg_av(m)
                     ENDDO
                  ELSE
@@ -3960,5 +3932,5 @@
                        j = surf_usm_v(l)%j(m)
                        k = surf_usm_v(l)%k(m)
-                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_veg_eb_av(m)
+                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_veg_av(m)
                     ENDDO
                  ENDIF
@@ -3973,5 +3945,5 @@
                        j = surf_usm_h%j(m)
                        k = surf_usm_h%k(m)
-                       temp_pf(k,j,i) = surf_usm_h%qsws_liq_eb(m)
+                       temp_pf(k,j,i) = surf_usm_h%qsws_liq(m)
                     ENDDO
                  ELSE
@@ -3981,5 +3953,5 @@
                        j = surf_usm_v(l)%j(m)
                        k = surf_usm_v(l)%k(m)
-                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_liq_eb(m)
+                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_liq(m)
                     ENDDO
                  ENDIF
@@ -3990,5 +3962,5 @@
                        j = surf_usm_h%j(m)
                        k = surf_usm_h%k(m)
-                       temp_pf(k,j,i) = surf_usm_h%qsws_liq_eb_av(m)
+                       temp_pf(k,j,i) = surf_usm_h%qsws_liq_av(m)
                     ENDDO
                  ELSE
@@ -3998,5 +3970,5 @@
                        j = surf_usm_v(l)%j(m)
                        k = surf_usm_v(l)%k(m)
-                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_liq_eb_av(m)
+                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_liq_av(m)
                     ENDDO
                  ENDIF
@@ -4321,5 +4293,5 @@
               ENDIF
 
-          CASE ( 'usm_t_surf_10cm' )
+          CASE ( 'usm_theta_10cm' )
 !--           near surface temperature for whole surfaces
 
@@ -4330,5 +4302,5 @@
                        j = surf_usm_h%j(m)
                        k = surf_usm_h%k(m)
-                       temp_pf(k,j,i) = t_surf_10cm_h(m)
+                       temp_pf(k,j,i) = surf_usm_h%pt_10cm(m)
                     ENDDO
                  ELSE
@@ -4338,8 +4310,9 @@
                        j = surf_usm_v(l)%j(m)
                        k = surf_usm_v(l)%k(m)
-                       temp_pf(k,j,i) = t_surf_10cm_v(l)%t(m)
+                       temp_pf(k,j,i) = surf_usm_v(l)%pt_10cm(m)
                     ENDDO
                  ENDIF
-
+              
+              
               ELSE
                  IF ( idsint == iup_u )  THEN
@@ -4348,5 +4321,5 @@
                        j = surf_usm_h%j(m)
                        k = surf_usm_h%k(m)
-                       temp_pf(k,j,i) = surf_usm_h%t_surf_10cm_av(m)
+                       temp_pf(k,j,i) = surf_usm_h%pt_10cm_av(m)
                     ENDDO
                  ELSE
@@ -4356,12 +4329,10 @@
                        j = surf_usm_v(l)%j(m)
                        k = surf_usm_v(l)%k(m)
-                       temp_pf(k,j,i) = surf_usm_v(l)%t_surf_10cm_av(m)
-                    ENDDO
-
-                 ENDIF
-
+                       temp_pf(k,j,i) = surf_usm_v(l)%pt_10cm_av(m)
+                    ENDDO
+
+                  ENDIF
               ENDIF
-
-              
+             
           CASE ( 'usm_t_wall' )
 !--           wall temperature for  iwl layer of walls and land
@@ -4573,5 +4544,5 @@
              var(1:17) == 'usm_t_surf_window'  .OR.  var(1:12) == 'usm_t_window'  .OR.      &
              var(1:16) == 'usm_t_surf_green'  .OR. var(1:11) == 'usm_t_green' .OR.          &
-             var(1:15) == 'usm_t_surf_10cm' .OR.                                            &
+             var(1:15) == 'usm_theta_10cm' .OR.                                             &
              var(1:9) == 'usm_surfz'  .OR.  var(1:7) == 'usm_svf'  .OR.                     & 
              var(1:7) == 'usm_dif'  .OR.  var(1:11) == 'usm_surfcat'  .OR.                  &
@@ -6156,6 +6127,4 @@
         t_surf_green_h_p = t_surf_green_h
         t_surf_green_v_p = t_surf_green_v
-        t_surf_10cm_h_p = t_surf_10cm_h
-        t_surf_10cm_v_p = t_surf_10cm_v
 
         t_wall_h_p = t_wall_h
@@ -6180,6 +6149,6 @@
        surf_usm_h%c_liq = 0.0_wp
 
-       surf_usm_h%qsws_liq_eb  = 0.0_wp
-       surf_usm_h%qsws_veg_eb  = 0.0_wp
+       surf_usm_h%qsws_liq  = 0.0_wp
+       surf_usm_h%qsws_veg  = 0.0_wp
 
 !
@@ -6189,6 +6158,6 @@
           surf_usm_v(l)%c_liq = 0.0_wp
 
-          surf_usm_v(l)%qsws_liq_eb  = 0.0_wp
-          surf_usm_v(l)%qsws_veg_eb  = 0.0_wp
+          surf_usm_v(l)%qsws_liq  = 0.0_wp
+          surf_usm_v(l)%qsws_veg  = 0.0_wp
        ENDDO
 
@@ -6779,5 +6748,5 @@
                    ENDIF     
 
-!--                The root extraction (= root_extr * qsws_veg_eb / (rho_l     
+!--                The root extraction (= root_extr * qsws_veg / (rho_l     
 !--                * l_v)) ensures the mass conservation for water. The         
 !--                transpiration of plants equals the cumulative withdrawals by 
@@ -6818,6 +6787,6 @@
                             swc_h(nzb_wall+1,m) - swc_h(nzb_wall,m) )    &
                             * surf_usm_h%ddz_green(nzb_wall+1,m) - surf_usm_h%gamma_w_green(nzb_wall,m) - ( &
-                               root_extr_green(nzb_wall) * surf_usm_h%qsws_veg_eb(m)          &
-!                                + surf_usm_h%qsws_soil_eb_green(m)
+                               root_extr_green(nzb_wall) * surf_usm_h%qsws_veg(m)          &
+!                                + surf_usm_h%qsws_soil_green(m)
                                   ) * drho_l_lv )             &
                                  * surf_usm_h%ddz_green_stag(nzb_wall,m)
@@ -6830,5 +6799,5 @@
                                 swc_h(kw-1,m)) * surf_usm_h%ddz_green(kw,m)                 &
                                 + surf_usm_h%gamma_w_green(kw-1,m) - (root_extr_green(kw)             &
-                                * surf_usm_h%qsws_veg_eb(m) * drho_l_lv)                &
+                                * surf_usm_h%qsws_veg(m) * drho_l_lv)                &
                                 ) * surf_usm_h%ddz_green_stag(kw,m)
 
@@ -6841,5 +6810,5 @@
                                            + surf_usm_h%gamma_w_green(nzt_wall-1,m) - (       &
                                              root_extr_green(nzt_wall)               &
-                                           * surf_usm_h%qsws_veg_eb(m) * drho_l_lv  )   &
+                                           * surf_usm_h%qsws_veg(m) * drho_l_lv  )   &
                                      ) * surf_usm_h%ddz_green_stag(nzt_wall,m)             
 
@@ -7053,53 +7022,4 @@
     END SUBROUTINE usm_parin
 
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-!> Calculates temperature near surface (10 cm) for indoor model
-!------------------------------------------------------------------------------!
-    SUBROUTINE usm_temperature_near_surface
-
-       IMPLICIT NONE
-
-       INTEGER(iwp)                          :: i, j, k, l, m   !< running indices
-
-!        
-!--    First, treat horizontal surface elements
-       DO  m = 1, surf_usm_h%ns
-
-!--       Get indices of respective grid point
-          i = surf_usm_h%i(m)
-          j = surf_usm_h%j(m)
-          k = surf_usm_h%k(m)
-
-          t_surf_10cm_h(m) = surf_usm_h%pt_surface(m) + surf_usm_h%ts(m) / kappa        &
-                             * ( log( 0.1_wp /  surf_usm_h%z0h(m) )              &
-                               - psi_h( 0.1_wp / surf_usm_h%ol(m) )              &
-                               + psi_h( surf_usm_h%z0h(m) / surf_usm_h%ol(m) ) )
-
-       ENDDO
-!
-!--    Now, treat vertical surface elements
-       DO  l = 0, 3
-          DO  m = 1, surf_usm_v(l)%ns
-
-!--          Get indices of respective grid point
-             i = surf_usm_v(l)%i(m)
-             j = surf_usm_v(l)%j(m)
-             k = surf_usm_v(l)%k(m)
-
-             t_surf_10cm_v(l)%t(m) =surf_usm_v(l)%pt_surface(m) + surf_usm_v(l)%ts(m) / kappa &
-                                     * ( log( 0.1_wp / surf_usm_v(l)%z0h(m) )             &
-                                       - psi_h( 0.1_wp / surf_usm_v(l)%ol(m) )            &
-                                       + psi_h( surf_usm_v(l)%z0h(m) / surf_usm_v(l)%ol(m) ) )
-
-          ENDDO
-
-       ENDDO
-
-
-    END SUBROUTINE usm_temperature_near_surface
-
-    
  
 !------------------------------------------------------------------------------!
@@ -9442,9 +9362,9 @@
           surf_usm_h%qsws(m) = surf_usm_h%qsws_eb(m) / rho_lv
 
-          surf_usm_h%qsws_veg_eb(m)  = - f_qsws_veg  * ( qv1 - q_s                      &
+          surf_usm_h%qsws_veg(m)  = - f_qsws_veg  * ( qv1 - q_s                      &
                               + dq_s_dt * t_surf_green_h(m) - dq_s_dt   &
                               * t_surf_green_h_p(m) )
 
-          surf_usm_h%qsws_liq_eb(m)  = - f_qsws_liq  * ( qv1 - q_s                      &
+          surf_usm_h%qsws_liq(m)  = - f_qsws_liq  * ( qv1 - q_s                      &
                               + dq_s_dt * t_surf_green_h(m) - dq_s_dt   &
                               * t_surf_green_h_p(m) )
@@ -9478,5 +9398,5 @@
 !--          as runoff as qsws_soil is then not used in the soil model
              IF ( m_liq_usm_h%var_usm_1d(m) /= m_liq_max )  THEN
-                surf_usm_h%qsws_liq_eb(m) = surf_usm_h%qsws_liq_eb(m)                            &
+                surf_usm_h%qsws_liq(m) = surf_usm_h%qsws_liq(m)                            &
                                  + surf_usm_h%frac(ind_pav_green,m) * prr(k+k_off,j+j_off,i+i_off)&
                                  * hyrho(k+k_off)                              &
@@ -9497,5 +9417,5 @@
 !                 surf_usm_h%qsws_soil(m) = surf_usm_h%qsws_soil(m) + surf_usm_h%qsws_liq(m)
 
-                surf_usm_h%qsws_liq_eb(m)  = 0.0_wp
+                surf_usm_h%qsws_liq(m)  = 0.0_wp
              ENDIF
 
@@ -9504,7 +9424,7 @@
 !--          let the water enter the liquid water reservoir as dew on the
 !--          plant
-             IF ( surf_usm_h%qsws_veg_eb(m) < 0.0_wp )  THEN
-                surf_usm_h%qsws_liq_eb(m) = surf_usm_h%qsws_liq_eb(m) + surf_usm_h%qsws_veg_eb(m)
-                surf_usm_h%qsws_veg_eb(m) = 0.0_wp
+             IF ( surf_usm_h%qsws_veg(m) < 0.0_wp )  THEN
+                surf_usm_h%qsws_liq(m) = surf_usm_h%qsws_liq(m) + surf_usm_h%qsws_veg(m)
+                surf_usm_h%qsws_veg(m) = 0.0_wp
              ENDIF
           ENDIF                    
@@ -9512,5 +9432,5 @@
           surf_usm_h%qsws(m) = surf_usm_h%qsws(m) / l_v
  
-          tend = - surf_usm_h%qsws_liq_eb(m) * drho_l_lv
+          tend = - surf_usm_h%qsws_liq(m) * drho_l_lv
           m_liq_usm_h_p%var_usm_1d(m) = m_liq_usm_h%var_usm_1d(m) + dt_3d *    &
                                         ( tsc(2) * tend +                      &
@@ -9895,9 +9815,9 @@
           surf_usm_v(l)%qsws(m) = surf_usm_v(l)%qsws_eb(m) / rho_lv
 
-          surf_usm_v(l)%qsws_veg_eb(m)  = - f_qsws_veg  * ( qv1 - q_s                      &
+          surf_usm_v(l)%qsws_veg(m)  = - f_qsws_veg  * ( qv1 - q_s                      &
                               + dq_s_dt * t_surf_green_v(l)%t(m) - dq_s_dt   &
                               * t_surf_green_v_p(l)%t(m) )
 
-!           surf_usm_h%qsws_liq_eb(m)  = - f_qsws_liq  * ( qv1 - q_s                      &
+!           surf_usm_h%qsws_liq(m)  = - f_qsws_liq  * ( qv1 - q_s                      &
 !                               + dq_s_dt * t_surf_green_h(m) - dq_s_dt   &
 !                               * t_surf_green_h_p(m) )
@@ -9928,7 +9848,7 @@
 !--          let the water enter the liquid water reservoir as dew on the
 !--          plant
-             IF ( surf_usm_v(l)%qsws_veg_eb(m) < 0.0_wp )  THEN
-!                 surf_usm_h%qsws_liq_eb(m) = surf_usm_h%qsws_liq_eb(m) + surf_usm_h%qsws_veg_eb(m)
-                surf_usm_v(l)%qsws_veg_eb(m) = 0.0_wp
+             IF ( surf_usm_v(l)%qsws_veg(m) < 0.0_wp )  THEN
+!                 surf_usm_h%qsws_liq(m) = surf_usm_h%qsws_liq(m) + surf_usm_h%qsws_veg(m)
+                surf_usm_v(l)%qsws_veg(m) = 0.0_wp
              ENDIF
           ENDIF   
@@ -10256,5 +10176,5 @@
           CALL wrd_write_string( 't_green_v(' // dum // ')' )
           WRITE ( 14 )  t_green_v(l)%t
-       
+!        
        ENDDO
 
@@ -10262,37 +10182,4 @@
     END SUBROUTINE usm_wrd_local
 
-!
-!-- Integrated stability function for heat and moisture
-    FUNCTION psi_h( zeta )
-
-           USE kinds
-
-       IMPLICIT NONE
-
-       REAL(wp)            :: psi_h !< Integrated similarity function result
-       REAL(wp)            :: zeta  !< Stability parameter z/L
-       REAL(wp)            :: x     !< dummy variable
-
-       REAL(wp), PARAMETER :: a = 1.0_wp            !< constant
-       REAL(wp), PARAMETER :: b = 0.66666666666_wp  !< constant
-       REAL(wp), PARAMETER :: c = 5.0_wp            !< constant
-       REAL(wp), PARAMETER :: d = 0.35_wp           !< constant
-       REAL(wp), PARAMETER :: c_d_d = c / d         !< constant
-       REAL(wp), PARAMETER :: bc_d_d = b * c / d    !< constant
-
-
-      IF ( zeta < 0.0_wp )  THEN
-         x = SQRT( 1.0_wp  - 16.0_wp * zeta )
-         psi_h = 2.0_wp * LOG( (1.0_wp + x ) / 2.0_wp )
-      ELSE
-         psi_h = - b * ( zeta - c_d_d ) * EXP( -d * zeta ) - (1.0_wp          &
-                 + 0.66666666666_wp * a * zeta )**1.5_wp - bc_d_d             &
-                 + 1.0_wp
-!
-!--       Old version for stable conditions (only valid for z/L < 0.5)
-!--       psi_h = - 5.0_wp * zeta
-       ENDIF
-
-   END FUNCTION psi_h
-    
+  
  END MODULE urban_surface_mod
