Index: palm/trunk/SOURCE/urban_surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/urban_surface_mod.f90	(revision 3382)
+++ palm/trunk/SOURCE/urban_surface_mod.f90	(revision 3418)
@@ -28,4 +28,14 @@
 ! -----------------
 ! $Id$
+! (rvtils, srissman)
+! -Updated building databse, two green roof types (ind_green_type_roof)
+! -Latent heat flux for green walls and roofs, new output of latent heatflux
+!  and soil water content of green roof substrate
+! -t_surf changed to t_surf_wall
+! -Added namelist parameter usm_wall_mod for lower wall tendency
+!  of first two wall layers during spinup
+! -Window calculations deactivated during spinup
+! 
+! 3382 2018-10-19 13:10:32Z knoop
 ! Bugix: made array declaration Fortran Standard conform
 ! 
@@ -354,11 +364,13 @@
     USE arrays_3d,                                                             &
 #if ! defined( __nopointer )
-        ONLY:  hyp, zu, pt, p, u, v, w, tend, exner
+        ONLY:  hyp, zu, pt, p, u, v, w, tend, exner, hyrho, prr, q, ql, vpt
 #else
-        ONLY:  hyp,     pt,    u, v, w, tend, exner
+        ONLY:  hyp,     pt,    u, v, w, tend, exner, hyrho, prr, q, ql, vpt
 #endif
+    USE calc_mean_profile_mod,                                                 &
+        ONLY:  calc_mean_profile
 
     USE basic_constants_and_equations_mod,                                     &
-        ONLY:  c_p, g, kappa, pi, r_d
+        ONLY:  c_p, g, kappa, pi, r_d, rho_l, l_v
 
     USE control_parameters,                                                    &
@@ -373,4 +385,7 @@
                plant_canopy, dz
 
+    USE bulk_cloud_model_mod,                                                  &
+        ONLY: bulk_cloud_model, precipitation
+               
     USE cpulog,                                                                &
         ONLY:  cpu_log, log_point, log_point_s
@@ -422,4 +437,53 @@
     IMPLICIT NONE
 
+    !
+!-- USM model constants
+
+    REAL(wp), PARAMETER ::                     &
+              b_ch               = 6.04_wp,    & ! Clapp & Hornberger exponent
+              lambda_h_green_dry       = 0.19_wp,    & ! heat conductivity for dry soil   
+              lambda_h_green_sm        = 3.44_wp,    & ! heat conductivity of the soil matrix
+              lambda_h_water     = 0.57_wp,    & ! heat conductivity of water
+              psi_sat            = -0.388_wp,  & ! soil matrix potential at saturation
+              rho_c_soil         = 2.19E6_wp,  & ! volumetric heat capacity of soil
+              rho_c_water        = 4.20E6_wp !,  & ! volumetric heat capacity of water
+!               m_max_depth        = 0.0002_wp     ! Maximum capacity of the water reservoir (m)
+
+!
+!-- Soil parameters I           alpha_vg,      l_vg_green,    n_vg, gamma_w_green_sat
+    REAL(wp), DIMENSION(0:3,1:7), PARAMETER :: soil_pars = RESHAPE( (/     &
+                                 3.83_wp,  1.250_wp, 1.38_wp,  6.94E-6_wp, & ! 1
+                                 3.14_wp, -2.342_wp, 1.28_wp,  1.16E-6_wp, & ! 2
+                                 0.83_wp, -0.588_wp, 1.25_wp,  0.26E-6_wp, & ! 3
+                                 3.67_wp, -1.977_wp, 1.10_wp,  2.87E-6_wp, & ! 4
+                                 2.65_wp,  2.500_wp, 1.10_wp,  1.74E-6_wp, & ! 5
+                                 1.30_wp,  0.400_wp, 1.20_wp,  0.93E-6_wp, & ! 6
+                                 0.00_wp,  0.00_wp,  0.00_wp,  0.57E-6_wp  & ! 7
+                                 /), (/ 4, 7 /) )
+
+!
+!-- Soil parameters II              swc_sat,     fc,   wilt,    swc_res  
+    REAL(wp), DIMENSION(0:3,1:7), PARAMETER :: m_soil_pars = RESHAPE( (/ &
+                                 0.403_wp, 0.244_wp, 0.059_wp, 0.025_wp, & ! 1
+                                 0.439_wp, 0.347_wp, 0.151_wp, 0.010_wp, & ! 2
+                                 0.430_wp, 0.383_wp, 0.133_wp, 0.010_wp, & ! 3
+                                 0.520_wp, 0.448_wp, 0.279_wp, 0.010_wp, & ! 4
+                                 0.614_wp, 0.541_wp, 0.335_wp, 0.010_wp, & ! 5
+                                 0.766_wp, 0.663_wp, 0.267_wp, 0.010_wp, & ! 6
+                                 0.472_wp, 0.323_wp, 0.171_wp, 0.000_wp  & ! 7
+                                 /), (/ 4, 7 /) )
+                                
+    !   value 9999999.9_wp -> generic available or user-defined value must be set
+!   otherwise -> no generic variable and user setting is optional
+    REAL(wp) :: alpha_vangenuchten = 9999999.9_wp,      & !< NAMELIST alpha_vg
+                field_capacity = 9999999.9_wp,          & !< NAMELIST fc
+                hydraulic_conductivity = 9999999.9_wp,  & !< NAMELIST gamma_w_green_sat
+                lambda_h_green_sat = 0.0_wp,            & !< heat conductivity for saturated soil
+                l_vangenuchten = 9999999.9_wp,          & !< NAMELIST l_vg
+                n_vangenuchten = 9999999.9_wp,          & !< NAMELIST n_vg
+                residual_moisture = 9999999.9_wp,       & !< NAMELIST m_res
+                saturation_moisture = 9999999.9_wp,     & !< NAMELIST m_sat
+                wilting_point = 9999999.9_wp!,           & !< NAMELIST m_wilt
+    
 
 !-- configuration parameters (they can be setup in PALM config)
@@ -429,4 +493,5 @@
     LOGICAL ::  indoor_model = .FALSE.             !< whether to use the indoor model
     LOGICAL ::  read_wall_temp_3d = .FALSE.
+    LOGICAL ::  usm_wall_mod = .FALSE.             !< reduces conductivity of the first 2 wall layers by factor 0.1
 
 
@@ -439,51 +504,108 @@
 !
 !-- Indices of input attributes for (above) ground floor level 
-    INTEGER(iwp) ::  ind_alb_wall          = 38 !< index in input list for albedo_type of wall fraction
-    INTEGER(iwp) ::  ind_alb_green         = 39 !< index in input list for albedo_type of green fraction
-    INTEGER(iwp) ::  ind_alb_win           = 40 !< index in input list for albedo_type of window fraction
-    INTEGER(iwp) ::  ind_emis_wall_agfl    = 14 !< index in input list for wall emissivity, above ground floor level
-    INTEGER(iwp) ::  ind_emis_wall_gfl     = 32 !< index in input list for wall emissivity, ground floor level
-    INTEGER(iwp) ::  ind_emis_green_agfl   = 15 !< index in input list for green emissivity, above ground floor level
-    INTEGER(iwp) ::  ind_emis_green_gfl    = 33 !< index in input list for green emissivity, ground floor level
-    INTEGER(iwp) ::  ind_emis_win_agfl     = 16 !< index in input list for window emissivity, above ground floor level
-    INTEGER(iwp) ::  ind_emis_win_gfl      = 34 !< index in input list for window emissivity, ground floor level
-    INTEGER(iwp) ::  ind_green_frac_w_agfl = 2  !< index in input list for green fraction on wall, above ground floor level
-    INTEGER(iwp) ::  ind_green_frac_w_gfl  = 23 !< index in input list for green fraction on wall, ground floor level
-    INTEGER(iwp) ::  ind_green_frac_r_agfl = 3  !< index in input list for green fraction on roof, above ground floor level
-    INTEGER(iwp) ::  ind_green_frac_r_gfl  = 24 !< index in input list for green fraction on roof, ground floor level
-    INTEGER(iwp) ::  ind_hc1_agfl          =  6 !< index in input list for heat capacity at first wall layer, above ground floor level
-    INTEGER(iwp) ::  ind_hc1_gfl           = 26 !< index in input list for heat capacity at first wall layer, ground floor level
-    INTEGER(iwp) ::  ind_hc2_agfl          = 7  !< index in input list for heat capacity at second wall layer, above ground floor level
-    INTEGER(iwp) ::  ind_hc2_gfl           = 27 !< index in input list for heat capacity at second wall layer, ground floor level
-    INTEGER(iwp) ::  ind_hc3_agfl          = 8  !< index in input list for heat capacity at third wall layer, above ground floor level
-    INTEGER(iwp) ::  ind_hc3_gfl           = 28 !< index in input list for heat capacity at third wall layer, ground floor level
-    INTEGER(iwp) ::  ind_gflh              = 20 !< index in input list for ground floor level height
-    INTEGER(iwp) ::  ind_lai_r_agfl        = 4  !< index in input list for LAI on roof, above ground floor level
-    INTEGER(iwp) ::  ind_lai_r_gfl         = 4  !< index in input list for LAI on roof, ground floor level
-    INTEGER(iwp) ::  ind_lai_w_agfl        = 5  !< index in input list for LAI on wall, above ground floor level
-    INTEGER(iwp) ::  ind_lai_w_gfl         = 25 !< index in input list for LAI on wall, ground floor level
-    INTEGER(iwp) ::  ind_tc1_agfl          = 9  !< index in input list for thermal conductivity at first wall layer, above ground floor level
-    INTEGER(iwp) ::  ind_tc1_gfl           = 29 !< index in input list for thermal conductivity at first wall layer, ground floor level
-    INTEGER(iwp) ::  ind_tc2_agfl          = 10 !< index in input list for thermal conductivity at second wall layer, above ground floor level
-    INTEGER(iwp) ::  ind_tc2_gfl           = 30 !< index in input list for thermal conductivity at second wall layer, ground floor level
-    INTEGER(iwp) ::  ind_tc3_agfl          = 11 !< index in input list for thermal conductivity at third wall layer, above ground floor level
-    INTEGER(iwp) ::  ind_tc3_gfl           = 31 !< index in input list for thermal conductivity at third wall layer, ground floor level
-    INTEGER(iwp) ::  ind_thick_1           = 41 !< index for wall layer thickness - 1st layer
-    INTEGER(iwp) ::  ind_thick_2           = 42 !< index for wall layer thickness - 2nd layer
-    INTEGER(iwp) ::  ind_thick_3           = 43 !< index for wall layer thickness - 3rd layer
-    INTEGER(iwp) ::  ind_thick_4           = 44 !< index for wall layer thickness - 4th layer
-    INTEGER(iwp) ::  ind_trans_agfl        = 17 !< index in input list for window transmissivity, above ground floor level
-    INTEGER(iwp) ::  ind_trans_gfl         = 35 !< index in input list for window transmissivity, ground floor level
-    INTEGER(iwp) ::  ind_wall_frac_agfl    = 0  !< index in input list for wall fraction, above ground floor level
-    INTEGER(iwp) ::  ind_wall_frac_gfl     = 21 !< index in input list for wall fraction, ground floor level
-    INTEGER(iwp) ::  ind_win_frac_agfl     = 1  !< index in input list for window fraction, above ground floor level
-    INTEGER(iwp) ::  ind_win_frac_gfl      = 22 !< index in input list for window fraction, ground floor level
-    INTEGER(iwp) ::  ind_z0_agfl           = 18 !< index in input list for z0, above ground floor level
-    INTEGER(iwp) ::  ind_z0_gfl            = 36 !< index in input list for z0, ground floor level
-    INTEGER(iwp) ::  ind_z0qh_agfl         = 19 !< index in input list for z0h / z0q, above ground floor level
-    INTEGER(iwp) ::  ind_z0qh_gfl          = 37 !< index in input list for z0h / z0q, ground floor level
-
-
-    REAL(wp)  ::  roof_height_limit = 4._wp          !< height for distinguish between land surfaces and roofs
+    INTEGER(iwp) ::  ind_alb_wall_agfl     = 65  !< index in input list for albedo_type of wall above ground floor level
+    INTEGER(iwp) ::  ind_alb_wall_gfl      = 32  !< index in input list for albedo_type of wall ground floor level
+    INTEGER(iwp) ::  ind_alb_wall_r        = 96  !< index in input list for albedo_type of wall roof
+    INTEGER(iwp) ::  ind_alb_green_agfl    = 83  !< index in input list for albedo_type of green above ground floor level
+    INTEGER(iwp) ::  ind_alb_green_gfl     = 50  !< index in input list for albedo_type of green ground floor level
+    INTEGER(iwp) ::  ind_alb_green_r       = 115 !< index in input list for albedo_type of green roof
+    INTEGER(iwp) ::  ind_alb_win_agfl      = 79  !< index in input list for albedo_type of window fraction above ground floor level
+    INTEGER(iwp) ::  ind_alb_win_gfl       = 46  !< index in input list for albedo_type of window fraction ground floor level 
+    INTEGER(iwp) ::  ind_alb_win_r         = 110 !< index in input list for albedo_type of window fraction roof
+    INTEGER(iwp) ::  ind_emis_wall_agfl    = 64  !< index in input list for wall emissivity, above ground floor level
+    INTEGER(iwp) ::  ind_emis_wall_gfl     = 31  !< index in input list for wall emissivity, ground floor level
+    INTEGER(iwp) ::  ind_emis_wall_r       = 95  !< index in input list for wall emissivity, roof
+    INTEGER(iwp) ::  ind_emis_green_agfl   = 82  !< index in input list for green emissivity, above ground floor level
+    INTEGER(iwp) ::  ind_emis_green_gfl    = 49  !< index in input list for green emissivity, ground floor level
+    INTEGER(iwp) ::  ind_emis_green_r      = 114 !< index in input list for green emissivity, roof
+    INTEGER(iwp) ::  ind_emis_win_agfl     = 77  !< index in input list for window emissivity, above ground floor level
+    INTEGER(iwp) ::  ind_emis_win_gfl      = 44  !< index in input list for window emissivity, ground floor level
+    INTEGER(iwp) ::  ind_emis_win_r        = 108 !< index in input list for window emissivity, roof
+    INTEGER(iwp) ::  ind_green_frac_w_agfl = 80  !< index in input list for green fraction on wall, above ground floor level
+    INTEGER(iwp) ::  ind_green_frac_w_gfl  = 47  !< index in input list for green fraction on wall, ground floor level
+    INTEGER(iwp) ::  ind_green_frac_r_agfl = 112 !< index in input list for green fraction on roof, above ground floor level
+    INTEGER(iwp) ::  ind_green_frac_r_gfl  = 111 !< index in input list for green fraction on roof, ground floor level
+    INTEGER(iwp) ::  ind_hc1_agfl          = 58  !< index in input list for heat capacity at first wall layer, above ground floor level
+    INTEGER(iwp) ::  ind_hc1_gfl           = 25  !< index in input list for heat capacity at first wall layer, ground floor level
+    INTEGER(iwp) ::  ind_hc1_wall_r        = 89  !< index in input list for heat capacity at first wall layer, roof
+    INTEGER(iwp) ::  ind_hc1_win_agfl      = 71  !< index in input list for heat capacity at first window layer, above ground floor level
+    INTEGER(iwp) ::  ind_hc1_win_gfl       = 38  !< index in input list for heat capacity at first window layer, ground floor level
+    INTEGER(iwp) ::  ind_hc1_win_r         = 102 !< index in input list for heat capacity at first window layer, roof
+    INTEGER(iwp) ::  ind_hc2_agfl          = 59  !< index in input list for heat capacity at second wall layer, above ground floor level
+    INTEGER(iwp) ::  ind_hc2_gfl           = 26  !< index in input list for heat capacity at second wall layer, ground floor level
+    INTEGER(iwp) ::  ind_hc2_wall_r        = 90  !< index in input list for heat capacity at second wall layer, roof
+    INTEGER(iwp) ::  ind_hc2_win_agfl      = 72  !< index in input list for heat capacity at second window layer, above ground floor level
+    INTEGER(iwp) ::  ind_hc2_win_gfl       = 39  !< index in input list for heat capacity at second window layer, ground floor level
+    INTEGER(iwp) ::  ind_hc2_win_r         = 103 !< index in input list for heat capacity at second window layer, roof
+    INTEGER(iwp) ::  ind_hc3_agfl          = 60  !< index in input list for heat capacity at third wall layer, above ground floor level
+    INTEGER(iwp) ::  ind_hc3_gfl           = 27  !< index in input list for heat capacity at third wall layer, ground floor level
+    INTEGER(iwp) ::  ind_hc3_wall_r        = 91  !< index in input list for heat capacity at third wall layer, roof
+    INTEGER(iwp) ::  ind_hc3_win_agfl      = 73  !< index in input list for heat capacity at third window layer, above ground floor level
+    INTEGER(iwp) ::  ind_hc3_win_gfl       = 40  !< index in input list for heat capacity at third window layer, ground floor level
+    INTEGER(iwp) ::  ind_hc3_win_r         = 104 !< index in input list for heat capacity at third window layer, roof
+    INTEGER(iwp) ::  ind_gflh              = 17  !< index in input list for ground floor level height
+    INTEGER(iwp) ::  ind_lai_r_agfl        = 113 !< index in input list for LAI on roof, above ground floor level
+    INTEGER(iwp) ::  ind_lai_r_gfl         = 113  !< index in input list for LAI on roof, ground floor level
+    INTEGER(iwp) ::  ind_lai_w_agfl        = 81  !< index in input list for LAI on wall, above ground floor level
+    INTEGER(iwp) ::  ind_lai_w_gfl         = 48  !< index in input list for LAI on wall, ground floor level
+    INTEGER(iwp) ::  ind_tc1_agfl          = 61  !< index in input list for thermal conductivity at first wall layer, above ground floor level
+    INTEGER(iwp) ::  ind_tc1_gfl           = 28  !< index in input list for thermal conductivity at first wall layer, ground floor level
+    INTEGER(iwp) ::  ind_tc1_wall_r        = 92  !< index in input list for thermal conductivity at first wall layer, roof
+    INTEGER(iwp) ::  ind_tc1_win_agfl      = 74  !< index in input list for thermal conductivity at first window layer, above ground floor level
+    INTEGER(iwp) ::  ind_tc1_win_gfl       = 41  !< index in input list for thermal conductivity at first window layer, ground floor level
+    INTEGER(iwp) ::  ind_tc1_win_r         = 105 !< index in input list for thermal conductivity at first window layer, roof
+    INTEGER(iwp) ::  ind_tc2_agfl          = 62  !< index in input list for thermal conductivity at second wall layer, above ground floor level
+    INTEGER(iwp) ::  ind_tc2_gfl           = 29  !< index in input list for thermal conductivity at second wall layer, ground floor level
+    INTEGER(iwp) ::  ind_tc2_wall_r        = 93  !< index in input list for thermal conductivity at second wall layer, roof
+    INTEGER(iwp) ::  ind_tc2_win_agfl      = 75  !< index in input list for thermal conductivity at second window layer, above ground floor level
+    INTEGER(iwp) ::  ind_tc2_win_gfl       = 42  !< index in input list for thermal conductivity at second window layer, ground floor level
+    INTEGER(iwp) ::  ind_tc2_win_r         = 106 !< index in input list for thermal conductivity at second window layer, ground floor level
+    INTEGER(iwp) ::  ind_tc3_agfl          = 63  !< index in input list for thermal conductivity at third wall layer, above ground floor level
+    INTEGER(iwp) ::  ind_tc3_gfl           = 30  !< index in input list for thermal conductivity at third wall layer, ground floor level
+    INTEGER(iwp) ::  ind_tc3_wall_r        = 94  !< index in input list for thermal conductivity at third wall layer, roof
+    INTEGER(iwp) ::  ind_tc3_win_agfl      = 76  !< index in input list for thermal conductivity at third window layer, above ground floor level
+    INTEGER(iwp) ::  ind_tc3_win_gfl       = 43  !< index in input list for thermal conductivity at third window layer, ground floor level
+    INTEGER(iwp) ::  ind_tc3_win_r         = 107 !< index in input list for thermal conductivity at third window layer, roof
+    INTEGER(iwp) ::  ind_thick_1_agfl      = 54  !< index for wall layer thickness - 1st layer above ground floor level
+    INTEGER(iwp) ::  ind_thick_1_gfl       = 21  !< index for wall layer thickness - 1st layer ground floor level
+    INTEGER(iwp) ::  ind_thick_1_wall_r    = 85  !< index for wall layer thickness - 1st layer roof
+    INTEGER(iwp) ::  ind_thick_1_win_agfl  = 67  !< index for window layer thickness - 1st layer above ground floor level
+    INTEGER(iwp) ::  ind_thick_1_win_gfl   = 34  !< index for window layer thickness - 1st layer ground floor level
+    INTEGER(iwp) ::  ind_thick_1_win_r     = 98  !< index for window layer thickness - 1st layer roof
+    INTEGER(iwp) ::  ind_thick_2_agfl      = 55  !< index for wall layer thickness - 2nd layer above ground floor level
+    INTEGER(iwp) ::  ind_thick_2_gfl       = 22  !< index for wall layer thickness - 2nd layer ground floor level
+    INTEGER(iwp) ::  ind_thick_2_wall_r    = 86  !< index for wall layer thickness - 2nd layer roof
+    INTEGER(iwp) ::  ind_thick_2_win_agfl  = 68  !< index for window layer thickness - 2nd layer above ground floor level
+    INTEGER(iwp) ::  ind_thick_2_win_gfl   = 35  !< index for window layer thickness - 2nd layer ground floor level
+    INTEGER(iwp) ::  ind_thick_2_win_r     = 99  !< index for window layer thickness - 2nd layer roof
+    INTEGER(iwp) ::  ind_thick_3_agfl      = 56  !< index for wall layer thickness - 3rd layer above ground floor level
+    INTEGER(iwp) ::  ind_thick_3_gfl       = 23  !< index for wall layer thickness - 3rd layer ground floor level
+    INTEGER(iwp) ::  ind_thick_3_wall_r    = 87  !< index for wall layer thickness - 3rd layer roof
+    INTEGER(iwp) ::  ind_thick_3_win_agfl  = 69  !< index for window layer thickness - 3rd layer above ground floor level
+    INTEGER(iwp) ::  ind_thick_3_win_gfl   = 36  !< index for window layer thickness - 3rd layer ground floor level  
+    INTEGER(iwp) ::  ind_thick_3_win_r     = 100 !< index for window layer thickness - 3rd layer roof
+    INTEGER(iwp) ::  ind_thick_4_agfl      = 57  !< index for wall layer thickness - 4th layer above ground floor level
+    INTEGER(iwp) ::  ind_thick_4_gfl       = 24  !< index for wall layer thickness - 4th layer ground floor level
+    INTEGER(iwp) ::  ind_thick_4_wall_r    = 88  !< index for wall layer thickness - 4st layer roof
+    INTEGER(iwp) ::  ind_thick_4_win_agfl  = 70  !< index for window layer thickness - 4th layer above ground floor level
+    INTEGER(iwp) ::  ind_thick_4_win_gfl   = 37  !< index for window layer thickness - 4th layer ground floor level
+    INTEGER(iwp) ::  ind_thick_4_win_r     = 101 !< index for window layer thickness - 4th layer roof
+    INTEGER(iwp) ::  ind_trans_agfl        = 78  !< index in input list for window transmissivity, above ground floor level
+    INTEGER(iwp) ::  ind_trans_gfl         = 45  !< index in input list for window transmissivity, ground floor level
+    INTEGER(iwp) ::  ind_trans_r           = 109 !< index in input list for window transmissivity, roof
+    INTEGER(iwp) ::  ind_wall_frac_agfl    = 53  !< index in input list for wall fraction, above ground floor level
+    INTEGER(iwp) ::  ind_wall_frac_gfl     = 20  !< index in input list for wall fraction, ground floor level
+    INTEGER(iwp) ::  ind_wall_frac_r       = 84  !< index in input list for wall fraction, roof
+    INTEGER(iwp) ::  ind_win_frac_agfl     = 66  !< index in input list for window fraction, above ground floor level
+    INTEGER(iwp) ::  ind_win_frac_gfl      = 33  !< index in input list for window fraction, ground floor level
+    INTEGER(iwp) ::  ind_win_frac_r        = 97  !< index in input list for window fraction, roof
+    INTEGER(iwp) ::  ind_z0_agfl           = 51  !< index in input list for z0, above ground floor level
+    INTEGER(iwp) ::  ind_z0_gfl            = 18  !< index in input list for z0, ground floor level
+    INTEGER(iwp) ::  ind_z0qh_agfl         = 52  !< index in input list for z0h / z0q, above ground floor level
+    INTEGER(iwp) ::  ind_z0qh_gfl          = 19  !< index in input list for z0h / z0q, ground floor level
+    INTEGER(iwp) ::  ind_green_type_roof   = 116 !< index in input list for type of green roof
+
+
+    REAL(wp)  ::  roof_height_limit = 4.0_wp          !< height for distinguish between land surfaces and roofs
     REAL(wp)  ::  ground_floor_level = 4.0_wp        !< default ground floor level
 
@@ -500,106 +622,277 @@
                                                                      /)
 !
-!-- building parameters, 4 different types
-!-- 0 - wall fraction, 1- window fraction, 2 - green fraction on wall, 3- green fraction 
-!-- at roof, 4 - lai of green fraction at roof,  5 - lai of green fraction at wall, 
-!-- 6 - heat capacity of wall layer 1, 7 - heat capacity of wall layer 2, 
-!-- 8 - heat capacity of wall layer 3, 9 - thermal conductivity of wall layer 1, 
-!-- 10 - thermal conductivity of wall layer 2, 11 - thermal conductivity of wall layer 3,  
-!-- 12 - indoor target summer temperature ( K ), 13 - indoor target winter temperature (K),
-!-- 14 - emissivity of wall fraction, 15 - emissivity of green fraction, 16 - emissivity of window fraction,
-!-- 17 - transmissivity of window fraction, 18 - z0, 19 - z0h/z0q, 20 - ground floor height, 
-!-- 21 - ground floor wall fraction, 22 - ground floor window fraction, 23 ground floor green fraction,
-!-- 24 - ground floor green fraction on roof, 25 - ground floor lai of green fraction, 
-!-- 26 - ground floor heat capacity of wall layer 1, 27 - ground floor heat capacity of wall layer 1,
-!-- 28 - ground floor heat capacity of wall layer 3, 29 - ground floor thermal conductivity of wall layer 1,
-!-- 30 - ground floor thermal conductivity of wall layer 2, 31 - ground floor thermal conductivity of wall layer 3,
-!-- 32 - ground floor emissivity of wall fraction, 33 - ground floor emissivity of green fraction,
-!-- 34 - ground floor emissivity of window fraction, 35 - ground floor transmissivity of window fraction, 
-!-- 36 - ground floor z0, 37 - ground floor z0h/z0q, 38 - albedo type wall fraction
-!-- 39 - albedo type green fraction, 40 - albedo type window fraction
-!-- 41 - wall layer thickness - 1st layer, 42 - wall layer thickness - 2nd layer,
-!-- 43 - wall layer thickness - 3rd layer, 44 - wall layer thickness - 4th layer,
-!-- 45 - heat capacity of the wall surface, 46 - heat conductivity
-!-- Please note, only preleminary dummy values so far!
-    REAL(wp), DIMENSION(0:46,1:7), PARAMETER :: building_pars = RESHAPE( (/    &
-        1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 1.0_wp,                        & !parameter 0-5
-        1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp,      & !parameter 6-11
-        296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp,                & !parameter 12-17
-        0.001_wp, 0.0001_wp, 4.0_wp,                                           & !parameter 18-20
-        1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp,                                & !parameter 21-25
-        1000000.0_wp, 1000000.0_wp, 1000000.0_wp,                              & !parameter 26-28                     
-        0.3_wp, 0.3_wp, 0.3_wp,                                                & !parameter 29-31       
-        0.9_wp, 0.4_wp, 0.4_wp, 0.4_wp, 0.01_wp, 0.001_wp,                     & !parameter 32-37
-        24.0_wp, 24.0_wp, 24.0_wp,                                             & !parameter 38-40
-        0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp,                                & !parameter 41-44
-        20000.0_wp, 10.0_wp,                                                   & !parameter 45-46 - end of type 1
-        1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 1.0_wp,                        & !parameter 0-5
-        1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp,      & !parameter 6-11
-        296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp,                & !parameter 12-17
-        0.001_wp, 0.0001_wp, 4.0_wp,                                           & !parameter 18-20
-        1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp,                                & !parameter 21-25
-        1000000.0_wp, 1000000.0_wp, 1000000.0_wp,                              & !parameter 26-28                     
-        0.3_wp, 0.3_wp, 0.3_wp,                                                & !parameter 29-31       
-        0.9_wp, 0.4_wp, 0.4_wp, 0.4_wp, 0.01_wp, 0.001_wp,                     & !parameter 32-37
-        24.0_wp, 24.0_wp, 24.0_wp,                                             & !parameter 38-40
-        0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp,                                & !parameter 41-44
-        20000.0_wp, 10.0_wp,                                                   & !parameter 45-46 - end of type 2
-        1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 1.0_wp,                        & !parameter 0-5
-        1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp,      & !parameter 6-11
-        296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp,                & !parameter 12-17
-        0.001_wp, 0.0001_wp, 4.0_wp,                                           & !parameter 18-20
-        1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp,                                & !parameter 21-25
-        1000000.0_wp, 1000000.0_wp, 1000000.0_wp,                              & !parameter 26-28                     
-        0.3_wp, 0.3_wp, 0.3_wp,                                                & !parameter 29-31       
-        0.9_wp, 0.4_wp, 0.4_wp, 0.4_wp, 0.01_wp, 0.001_wp,                     & !parameter 32-37
-        24.0_wp, 24.0_wp, 24.0_wp,                                             & !parameter 38-40
-        0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp,                                & !parameter 41-44
-        20000.0_wp, 10.0_wp,                                                   & !parameter 45-46 - end of type 3
-        1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 1.0_wp,                        & !parameter 0-5
-        1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp,      & !parameter 6-11
-        296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp,                & !parameter 12-17
-        0.01_wp, 0.001_wp, 4.0_wp,                                             & !parameter 18-20
-        1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp,                                & !parameter 21-25
-        1000000.0_wp, 1000000.0_wp, 1000000.0_wp,                              & !parameter 26-28                     
-        0.3_wp, 0.3_wp, 0.3_wp,                                                & !parameter 29-31       
-        0.9_wp, 0.4_wp, 0.4_wp, 0.4_wp, 0.01_wp, 0.001_wp,                     & !parameter 32-37
-        24.0_wp, 24.0_wp, 24.0_wp,                                             & !parameter 38-40
-        0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp,                                & !parameter 41-44
-        20000.0_wp, 10.0_wp,                                                   & !parameter 45-46 - end of type 4
-        1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 1.0_wp,                        & !parameter 0-5
-        1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp,      & !parameter 6-11
-        296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp,                & !parameter 12-17
-        0.001_wp, 0.0001_wp, 4.0_wp,                                           & !parameter 18-20
-        1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp,                                & !parameter 21-25
-        1000000.0_wp, 1000000.0_wp, 1000000.0_wp,                              & !parameter 26-28                     
-        0.3_wp, 0.3_wp, 0.3_wp,                                                & !parameter 29-31       
-        0.9_wp, 0.4_wp, 0.4_wp, 0.4_wp, 0.01_wp, 0.001_wp,                     & !parameter 32-37
-        24.0_wp, 24.0_wp, 24.0_wp,                                             & !parameter 38-40
-        0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp,                                & !parameter 41-44
-        20000.0_wp, 10.0_wp,                                                   & !parameter 45-46 - end of type 5
-        1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 1.0_wp,                        & !parameter 0-5
-        1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp,      & !parameter 6-11
-        296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp,                & !parameter 12-17
-        0.001_wp, 0.0001_wp, 4.0_wp,                                           & !parameter 18-20
-        1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp,                                & !parameter 21-25
-        1000000.0_wp, 1000000.0_wp, 1000000.0_wp,                              & !parameter 26-28                     
-        0.3_wp, 0.3_wp, 0.3_wp,                                                & !parameter 29-31       
-        0.9_wp, 0.4_wp, 0.4_wp, 0.4_wp, 0.01_wp, 0.001_wp,                     & !parameter 32-37
-        24.0_wp, 24.0_wp, 24.0_wp,                                             & !parameter 38-40
-        0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp,                                & !parameter 41-44
-        20000.0_wp, 10.0_wp,                                                   & !parameter 45-46 - end of type 6
-        1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 1.0_wp,                        & !parameter 0-5
-        1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp,      & !parameter 6-11
-        296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp,                & !parameter 12-17
-        0.001_wp, 0.0001_wp, 0.0_wp,                                           & !parameter 18-20
-        1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp,                                & !parameter 21-25
-        1000000.0_wp, 1000000.0_wp, 1000000.0_wp,                              & !parameter 26-28                     
-        0.3_wp, 0.3_wp, 0.3_wp,                                                & !parameter 29-31       
-        0.9_wp, 0.4_wp, 0.4_wp, 0.4_wp, 0.01_wp, 0.001_wp,                     & !parameter 32-37
-        24.0_wp, 24.0_wp, 24.0_wp,                                             & !parameter 38-40
-        0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp,                                & !parameter 41-44
-        20000.0_wp, 10.0_wp                                                    & !parameter 45-46 - end of type 7 (bridges)
-                                                                          /),  &
-                                                               (/47, 7/) )
+!-- building parameters, 6 different types
+!-- Parameter for urban surface model
+!-- 0 - heat capacity wall surface, 1 - heat capacity of window surface, 2 - heat capacity of green surface
+!-- 3 - thermal conductivity of wall surface, 4 - thermal conductivity of window surface, 
+!-- 5 - thermal conductivty of green surface, 6 - wall fraction ground plate, 
+!-- 7 - 1st wall layer thickness ground plate, 8 - 2nd wall layer thickness ground plate
+!-- 9 - 3rd wall layer thickness ground plate, 10 - 4th wall layer thickness ground plate,
+!-- 11 - heat capacity 1st/2nd wall layer ground plate, 12 - heat capacity 3rd wall layer ground plate
+!-- 13 - heat capacity 4th wall layer ground plate, 14 - thermal conductivity 1st/2nd wall layer ground plate,
+!-- 15 - thermal conductivity 3rd wall layer ground plate, 16 - thermal conductivity 4th wall layer ground plate
+!-- 17 - ground floor level height, 18 - z0 roughness ground floor level, 19 - z0h/z0g roughness heaat/humidity,
+!-- 20 - wall fraction ground floor level, 21 - 1st wall layer thickness ground floor level, 
+!-- 22 - 2nd wall layer thickness ground floor level, 23 - 3rd wall layer thickness ground floor level,
+!-- 24 - 4th wall layer thickness ground floor level, 25 - heat capacity 1st/2nd wall layer ground floor level,
+!-- 26 - heat capacity 3rd wall layer ground floor level, 27 - heat capacity 4th wall layer ground floor level,
+!-- 28 - thermal conductivity 1st/2nd wall layer ground floor level, 
+!-- 29 - thermal conductivity 3rd wall layer ground floor level, 30 - thermal conductivity 4th wall layer ground floor level
+!-- 31 - wall emissivity ground floor level, 32 - wall albedo ground floor level, 33 - window fraction ground floor level,
+!-- 34 - 1st window layer thickness ground floor level, 35 - 2nd window layer thickness ground floor level,
+!-- 36 - 3rd window layer thickness ground floor level, 37 - 4th window layer thickness ground floor level,
+!-- 38 - heat capacity 1st/2nd window layer ground floor level, 39 - heat capacity 3rd window layer ground floor level,
+!-- 40 - heat capacity 4th window layer ground floor level, 
+!-- 41 - thermal conductivity 1st/2nd window layer ground floor level, 
+!-- 42 - thermal conductivity 3rd window layer ground floor level, 
+!-- 43 - thermal conductivity 4th window layer ground floor level, 44 - window emissivity ground floor level,
+!-- 45 - window transmissivity ground floor level, 46 - window albedo ground floor level,
+!-- 47 - green fraction ground floor level, 48 - LAI on wall ground floor level, 49 - green emissivity ground floor level,
+!-- 50 - green albedo ground floor level, 51 - z0 roughness above ground floor level, 
+!-- 52 - z0h/z0g roughness heat/humidity above ground floor level, 53 - wall fraction above ground floor level
+!-- 54 - 1st wall layer thickness above ground floor level, 55 - 2nd wall layer thickness above ground floor level
+!-- 56 - 3rd wall layer thickness above ground floor level, 57 - 4th wall layer thickness above ground floor level 
+!-- 58 - heat capacity 1st/2nd wall layer above ground floor level,
+!-- 59 - heat capacity 3rd wall layer above ground floor level, 
+!-- 60 - heat capacity 4th wall layer above ground floor level,
+!-- 61 - thermal conductivity 1st/2nd wall layer above ground floor level,
+!-- 62 - thermal conductivity 3rd wall layer above ground floor level,
+!-- 63 - thermal conductivity 4th wall layer above ground floor level,
+!-- 64 - wall emissivity above ground floor level, 65 - wall albedo above ground floor level,
+!-- 66 - window fraction above ground floor level, 67 - 1st window layer thickness above ground floor level,
+!-- 68 - 2nd thickness window layer above ground floor level, 69 - 3rd window layer thickness above ground floor level,
+!-- 70 - 4th window layer thickness above ground floor level, 
+!-- 71 - heat capacity 1st/2nd window layer above ground floor level,
+!-- 72 - heat capacity 3rd window layer above ground floor level,
+!-- 73 - heat capacity 4th window layer above ground floor level, 
+!-- 74 - conductivity 1st/2nd window layer above ground floor level,
+!-- 75 - thermal conductivity 3rd window layer above ground floor level, 
+!-- 76 - thermal conductivity 4th window layer above ground floor level, 77 - window emissivity above ground floor level,
+!-- 78 - window transmissivity above ground floor level, 79 - window albedo above ground floor level,
+!-- 80 - green fraction above ground floor level, 81 - LAI on wall above ground floor level,
+!-- 82 - green emissivity above ground floor level, 83 - green albedo above ground floor level,
+!-- 84 - wall fraction roof, 85 - 1st wall layer thickness roof, 86 - 2nd wall layer thickness roof,
+!-- 87 - 3rd wall layer thickness roof, 88 - 4th wall layer thickness roof,
+!-- 89 - heat capacity 1st/2nd wall layer roof, 90 - heat capacity 3rd wall layer roof,
+!-- 91 - heat capacity 4th wall layer roof, 92 - thermal conductivity 1st/2nd wall layer roof,
+!-- 93 - thermal conductivity 3rd wall layer roof, 94 - thermal conductivity 4th wall layer roof,
+!-- 95 - wall emissivity roof, 96 - wall albedo roof, 97 - window fraction roof,
+!-- 98 - window 1st layer thickness roof, 99 - window 2nd layer thickness roof, 100 - window 3rd layer thickness roof,
+!-- 101 - window 4th layer thickness, 102 - heat capacity 1st/2nd window layer roof, 
+!-- 103 - heat capacity 3rd window layer roof, 104 - heat capacity 4th window layer roof,
+!-- 105 - thermal conductivity 1st/2nd window layer roof, 106 - thermal conductivity 3rd window layer roof,
+!-- 107 - thermal conductivity 4th window layer roof, 108 - window emissivity roof, 109 - window transmissivity roof,
+!-- 110 - window albedo roof, 111 - green fraction roof ground floor level, 
+!-- 112 - green fraction roof above ground floor level, 113 - LAI roof, 114 - green emissivity roof,
+!-- 115 - green albedo roof, 116 - green type roof,
+!-- Parameter for indoor model
+!-- 117 - indoor target summer temperature, 118 - indoor target winter temperature, 
+!-- 119 - shading factor, 120 - g-value windows, 121 - u-value windows, 122 - basical airflow without occupancy of the room,
+!-- 123 - additional airflow depend of occupancy of the room, 124 - heat recovery efficiency,
+!-- 125 - dynamic parameter specific effective surface, 126 - dynamic parameter innner heatstorage,
+!-- 127 - ratio internal surface/floor area, 128 - maximal heating capacity, 129 - maximal cooling capacity,
+!-- 130 - additional internal heat gains dependent on occupancy of the room, 
+!-- 131 - basic internal heat gains without occupancy of the room, 132 - storey height, 133 - ceiling construction height
+
+
+    REAL(wp), DIMENSION(0:133,1:7), PARAMETER :: building_pars = RESHAPE( (/   &
+        10.0_wp, 10.0_wp, 20000.0_wp, 23.0_wp, 23.0_wp, 10.0_wp,               & !parameter 0-5
+        1.0_wp, 0.005_wp, 0.01_wp, 0.39_wp, 0.63_wp, 2200000.0_wp,             & !parameter 6-11
+        1400000.0_wp, 1300000.0_wp, 0.35_wp, 0.8_wp, 2.1_wp, 4.0_wp,           & !parameter 12-17
+        0.01_wp, 0.001_wp, 0.75_wp,                                            & !parameter 18-20
+        0.005_wp, 0.01_wp, 0.39_wp, 0.63_wp, 2200000.0_wp,                     & !parameter 21-25
+        1400000.0_wp, 1300000.0_wp, 0.35_wp,                                   & !parameter 26-28                     
+        0.8_wp, 2.1_wp, 0.93_wp,                                               & !parameter 29-31       
+        27.0_wp, 0.25_wp, 0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp,              & !parameter 32-37
+        1736000.0_wp, 1736000.0_wp, 1736000.0_wp,                              & !parameter 38-40
+        0.57_wp, 0.57_wp, 0.57_wp, 0.91_wp,                                    & !parameter 41-44
+        0.75_wp, 27.0_wp, 0.0_wp, 1.5_wp, 0.86_wp,                             & !parameter 45-49
+        5.0_wp, 0.001_wp, 0.0001_wp, 0.7_wp, 0.005_wp,                        & !parameter 50-54
+        0.01_wp, 0.39_wp, 0.63_wp, 2200000.0_wp,                               & !parameter 55-58
+        1400000.0_wp, 1300000.0_wp, 0.35_wp, 0.8_wp,                           & !parameter 59-62
+        2.1_wp, 0.93_wp, 27.0_wp, 0.3_wp,                                      & !parameter 63-66
+        0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp,                                & !parameter 67-70
+        1736000.0_wp, 1736000.0_wp, 1736000.0_wp,                              & !parameter 71-73
+        0.57_wp, 0.57_wp, 0.57_wp, 0.91_wp, 0.75_wp,                           & !parameter 74-78
+        27.0_wp, 0.0_wp, 1.5_wp, 0.86_wp, 5.0_wp, 1.0_wp,                      & !parameter 79-84
+        0.005_wp, 0.01_wp, 0.31_wp, 0.63_wp, 2200000.0_wp, 1400000.0_wp,       & !parameter 85-90
+        1300000.0_wp, 0.35_wp, 0.8_wp, 2.1_wp, 0.93_wp, 27.0_wp, 0.0_wp,       & !parameter 91-97
+        0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp, 1736000.0_wp,                  & !parameter 98-102 
+        1736000.0_wp, 1736000.0_wp, 0.57_wp, 0.57_wp, 0.57_wp,                 & !parameter 103-107
+        0.91_wp, 0.75_wp, 27.0_wp, 0.0_wp, 0.0_wp, 1.5_wp,                     & !parameter 108-113
+        0.86_wp, 5.0_wp, 0.0_wp,                                              & !parameter 114-116
+        299.15_wp, 293.15_wp, 0.8_wp, 0.76_wp, 5.0_wp,                         & !parameter 117-121
+        0.1_wp, 0.5_wp, 0.0_wp, 3.5_wp, 370000.0_wp, 4.5_wp,                   & !parameter 122-127
+        100000.0_wp, 0.0_wp, 3.0_wp, 10.0_wp, 3.0_wp, 0.2_wp,                  & !parameter 128-133- end of type 1
+        10.0_wp, 10.0_wp, 20000.0_wp, 23.0_wp, 23.0_wp, 10.0_wp,               & !parameter 0-5
+        1.0_wp, 0.005_wp, 0.01_wp, 0.31_wp, 0.42_wp, 2000000.0_wp,             & !parameter 6-11
+        103000.0_wp, 900000.0_wp, 0.35_wp, 0.38_wp, 0.04_wp, 4.0_wp,           & !parameter 12-17
+        0.01_wp, 0.001_wp, 0.78_wp,                                            & !parameter 18-20
+        0.005_wp, 0.01_wp, 0.31_wp, 0.43_wp, 2000000.0_wp,                     & !parameter 21-25
+        103000.0_wp, 900000.0_wp, 0.35_wp,                                     & !parameter 26-28                     
+        0.38_wp, 0.04_wp, 0.92_wp,                                             & !parameter 29-31       
+        27.0_wp, 0.22_wp, 0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp,              & !parameter 32-37
+        1736000.0_wp, 1736000.0_wp, 1736000.0_wp,                              & !parameter 38-40
+        0.11_wp, 0.11_wp, 0.11_wp, 0.11_wp,                                    & !parameter 41-44
+        0.7_wp, 27.0_wp, 0.0_wp, 1.5_wp, 0.86_wp,                              & !parameter 45-49
+        5.0_wp, 0.001_wp, 0.0001_wp, 0.73_wp, 0.005_wp,                       & !parameter 50-54
+        0.01_wp, 0.31_wp, 0.43_wp, 2000000.0_wp,                               & !parameter 55-58
+        103000.0_wp, 900000.0_wp, 0.35_wp, 0.38_wp,                            & !parameter 59-62
+        0.04_wp, 0.92_wp, 27.0_wp, 0.27_wp,                                    & !parameter 63-66
+        0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp,                                & !parameter 67-70
+        1736000.0_wp, 1736000.0_wp, 1736000.0_wp,                              & !parameter 71-73
+        0.11_wp, 0.11_wp, 0.11_wp, 0.87_wp, 0.7_wp,                            & !parameter 74-78
+        27.0_wp, 0.0_wp, 1.5_wp, 0.86_wp, 5.0_wp, 1.0_wp,                      & !parameter 79-84
+        0.005_wp, 0.01_wp, 0.5_wp, 0.79_wp, 2000000.0_wp, 103000.0_wp,         & !parameter 85-90
+        900000.0_wp, 0.35_wp, 0.38_wp, 0.04_wp, 0.93_wp, 27.0_wp, 0.0_wp,      & !parameter 91-97
+        0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp, 1736000.0_wp,                  & !parameter 98-102 
+        1736000.0_wp, 1736000.0_wp, 0.11_wp, 0.11_wp, 0.11_wp,                 & !parameter 103-107
+        0.87_wp, 0.7_wp, 27.0_wp, 0.0_wp, 0.0_wp, 1.5_wp,                      & !parameter 108-113
+        0.86_wp, 5.0_wp, 0.0_wp,                                              & !parameter 114-116
+        299.15_wp, 293.15_wp, 0.8_wp, 0.6_wp, 3.0_wp,                          & !parameter 117-121
+        0.1_wp, 0.5_wp, 0.0_wp, 2.5_wp, 165000.0_wp, 4.5_wp,                   & !parameter 122-127
+        100000.0_wp, 0.0_wp, 4.0_wp, 8.0_wp, 3.0_wp, 0.2_wp,                   & !parameter 128-133- end of type 2
+        10.0_wp, 10.0_wp, 20000.0_wp, 23.0_wp, 23.0_wp, 10.0_wp,               & !parameter 0-5
+        1.0_wp, 0.005_wp, 0.01_wp, 0.41_wp, 0.7_wp, 2000000.0_wp,              & !parameter 6-11
+        103000.0_wp, 900000.0_wp, 0.35_wp, 0.14_wp, 0.035_wp, 4.0_wp,          & !parameter 12-17
+        0.01_wp, 0.001_wp, 0.75_wp,                                            & !parameter 18-20
+        0.005_wp, 0.01_wp, 0.41_wp, 0.7_wp, 2000000.0_wp,                      & !parameter 21-25
+        103000.0_wp, 900000.0_wp, 0.35_wp,                                     & !parameter 26-28                     
+        0.14_wp, 0.035_wp, 0.92_wp,                                            & !parameter 29-31       
+        27.0_wp, 0.25_wp, 0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp,              & !parameter 32-37
+        1736000.0_wp, 1736000.0_wp, 1736000.0_wp,                              & !parameter 38-40
+        0.037_wp, 0.037_wp, 0.037_wp, 0.8_wp,                                     & !parameter 41-44
+        0.6_wp, 27.0_wp, 0.0_wp, 1.5_wp, 0.86_wp,                              & !parameter 45-49
+        5.0_wp, 0.001_wp, 0.0001_wp, 0.7_wp, 0.005_wp,                        & !parameter 50-54
+        0.01_wp, 0.41_wp, 0.7_wp, 2000000.0_wp,                                & !parameter 55-58
+        103000.0_wp, 900000.0_wp, 0.35_wp, 0.14_wp,                            & !parameter 59-62
+        0.035_wp, 0.92_wp, 27.0_wp, 0.3_wp,                                    & !parameter 63-66
+        0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp,                                & !parameter 67-70
+        1736000.0_wp, 1736000.0_wp, 1736000.0_wp,                              & !parameter 71-73
+        0.037_wp, 0.037_wp, 0.037_wp, 0.8_wp, 0.6_wp,                             & !parameter 74-78
+        27.0_wp, 0.0_wp, 1.5_wp, 0.86_wp, 5.0_wp, 1.0_wp,                      & !parameter 79-84
+        0.005_wp, 0.01_wp, 0.41_wp, 0.7_wp, 2000000.0_wp, 103000.0_wp,         & !parameter 85-90
+        900000.0_wp, 0.35_wp, 0.14_wp, 0.035_wp, 0.93_wp, 27.0_wp, 0.0_wp,     & !parameter 91-97
+        0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp, 1736000.0_wp,                  & !parameter 98-102 
+        1736000.0_wp, 1736000.0_wp, 0.037_wp, 0.037_wp, 0.037_wp,                 & !parameter 103-107
+        0.8_wp, 0.6_wp, 27.0_wp, 0.0_wp, 0.0_wp, 1.5_wp,                       & !parameter 108-113
+        0.86_wp, 5.0_wp, 0.0_wp,                                              & !parameter 114-116
+        299.15_wp, 293.15_wp, 0.8_wp, 0.5_wp, 0.6_wp,                          & !parameter 117-121
+        0.1_wp, 0.5_wp, 0.8_wp, 2.5_wp, 80000.0_wp, 4.5_wp,                    & !parameter 122-127
+        100000.0_wp, 0.0_wp, 3.0_wp, 8.0_wp, 3.0_wp, 0.2_wp,                   & !parameter 128-133- end of type 3
+        10.0_wp, 10.0_wp, 20000.0_wp, 23.0_wp, 23.0_wp, 10.0_wp,               & !parameter 0-5
+        1.0_wp, 0.005_wp, 0.01_wp, 0.39_wp, 0.63_wp, 2200000.0_wp,             & !parameter 6-11
+        1400000.0_wp, 1300000.0_wp, 0.35_wp, 0.8_wp, 2.1_wp, 4.0_wp,           & !parameter 12-17
+        0.01_wp, 0.001_wp, 0.55_wp,                                            & !parameter 18-20
+        0.005_wp, 0.01_wp, 0.39_wp, 0.63_wp, 2200000.0_wp,                     & !parameter 21-25
+        1400000.0_wp, 1300000.0_wp, 0.35_wp,                                   & !parameter 26-28                     
+        0.8_wp, 2.1_wp, 0.93_wp,                                               & !parameter 29-31       
+        27.0_wp, 0.45_wp, 0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp,              & !parameter 32-37
+        1736000.0_wp, 1736000.0_wp, 1736000.0_wp,                              & !parameter 38-40
+        0.57_wp, 0.57_wp, 0.57_wp, 0.91_wp,                                    & !parameter 41-44
+        0.75_wp, 27.0_wp, 0.0_wp, 1.5_wp, 0.86_wp,                             & !parameter 45-49
+        5.0_wp, 0.001_wp, 0.0001_wp, 0.5_wp, 0.005_wp,                        & !parameter 50-54
+        0.01_wp, 0.39_wp, 0.63_wp, 2200000.0_wp,                               & !parameter 55-58
+        1400000.0_wp, 1300000.0_wp, 0.35_wp, 0.8_wp,                           & !parameter 59-62
+        2.1_wp, 0.93_wp, 27.0_wp, 0.5_wp,                                      & !parameter 63-66
+        0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp,                                & !parameter 67-70
+        1736000.0_wp, 1736000.0_wp, 1736000.0_wp,                              & !parameter 71-73
+        0.57_wp, 0.57_wp, 0.57_wp, 0.91_wp, 0.75_wp,                           & !parameter 74-78
+        27.0_wp, 0.0_wp, 1.5_wp, 0.86_wp, 5.0_wp, 1.0_wp,                      & !parameter 79-84
+        0.005_wp, 0.01_wp, 0.39_wp, 0.63_wp, 2200000.0_wp, 1400000.0_wp,       & !parameter 85-90
+        1300000.0_wp, 0.35_wp, 0.8_wp, 2.1_wp, 0.93_wp, 27.0_wp, 0.0_wp,       & !parameter 91-97
+        0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp, 1736000.0_wp,                  & !parameter 98-102 
+        1736000.0_wp, 1736000.0_wp, 0.57_wp, 0.57_wp, 0.57_wp,                 & !parameter 103-107
+        0.91_wp, 0.75_wp, 27.0_wp, 0.0_wp, 0.0_wp, 1.5_wp,                     & !parameter 108-113
+        0.86_wp, 5.0_wp, 0.0_wp,                                              & !parameter 114-116
+        299.15_wp, 293.15_wp, 0.8_wp, 0.76_wp, 5.0_wp,                         & !parameter 117-121
+        0.1_wp, 1.5_wp, 0.0_wp, 3.5_wp, 370000.0_wp, 4.5_wp,                   & !parameter 122-127
+        100000.0_wp, 0.0_wp, 3.0_wp, 10.0_wp, 3.0_wp, 0.2_wp,                  & !parameter 128-133- end of type 4
+        10.0_wp, 10.0_wp, 20000.0_wp, 23.0_wp, 23.0_wp, 10.0_wp,               & !parameter 0-5
+        1.0_wp, 0.005_wp, 0.01_wp, 0.31_wp, 0.43_wp, 2000000.0_wp,             & !parameter 6-11
+        103000.0_wp, 900000.0_wp, 0.35_wp, 0.38_wp, 0.04_wp, 4.0_wp,           & !parameter 12-17
+        0.01_wp, 0.001_wp, 0.55_wp,                                            & !parameter 18-20
+        0.005_wp, 0.01_wp, 0.31_wp, 0.43_wp, 2000000.0_wp,                     & !parameter 21-25
+        103000.0_wp, 900000.0_wp, 0.35_wp,                                     & !parameter 26-28                     
+        0.38_wp, 0.04_wp, 0.92_wp,                                             & !parameter 29-31       
+        27.0_wp, 0.45_wp, 0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp,              & !parameter 32-37
+        1736000.0_wp, 1736000.0_wp, 1736000.0_wp,                              & !parameter 38-40
+        0.11_wp, 0.11_wp, 0.11_wp, 0.87_wp,                                    & !parameter 41-44
+        0.7_wp, 27.0_wp, 0.0_wp, 1.5_wp, 0.86_wp,                              & !parameter 45-49
+        5.0_wp, 0.001_wp, 0.0001_wp, 0.5_wp, 0.005_wp,                        & !parameter 50-54
+        0.01_wp, 0.31_wp, 0.43_wp, 2000000.0_wp,                               & !parameter 55-58
+        103000.0_wp, 900000.0_wp, 0.35_wp, 0.38_wp,                            & !parameter 59-62
+        0.04_wp, 0.92_wp, 27.0_wp, 0.5_wp,                                     & !parameter 63-66
+        0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp,                                & !parameter 67-70
+        1736000.0_wp, 1736000.0_wp, 1736000.0_wp,                              & !parameter 71-73
+        0.11_wp, 0.11_wp, 0.11_wp, 0.87_wp, 0.7_wp,                            & !parameter 74-78
+        27.0_wp, 0.0_wp, 1.5_wp, 0.86_wp, 5.0_wp, 1.0_wp,                      & !parameter 79-84
+        0.005_wp, 0.01_wp, 0.31_wp, 0.43_wp, 2000000.0_wp, 103000.0_wp,        & !parameter 85-90
+        900000.0_wp, 0.35_wp, 0.38_wp, 0.04_wp, 0.91_wp, 27.0_wp, 0.0_wp,      & !parameter 91-97
+        0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp, 1736000.0_wp,                  & !parameter 98-102 
+        1736000.0_wp, 1736000.0_wp, 0.11_wp, 0.11_wp, 0.11_wp,                 & !parameter 103-107
+        0.87_wp, 0.7_wp, 27.0_wp, 0.0_wp, 0.0_wp, 1.5_wp,                      & !parameter 108-113
+        0.86_wp, 5.0_wp, 0.0_wp,                                              & !parameter 114-116
+        299.15_wp, 293.15_wp, 0.8_wp, 0.6_wp, 3.0_wp,                          & !parameter 117-121
+        0.1_wp, 1.5_wp, 0.65_wp, 2.5_wp, 165000.0_wp, 4.5_wp,                  & !parameter 122-127
+        100000.0_wp, 0.0_wp, 7.0_wp, 20.0_wp, 3.0_wp, 0.2_wp,                  & !parameter 128-133- end of type 5
+        10.0_wp, 10.0_wp, 20000.0_wp, 23.0_wp, 23.0_wp, 10.0_wp,               & !parameter 0-5
+        1.0_wp, 0.005_wp, 0.01_wp, 0.41_wp, 0.7_wp, 2000000.0_wp,              & !parameter 6-11
+        103000.0_wp, 900000.0_wp, 0.35_wp, 0.14_wp, 0.035_wp, 4.0_wp,          & !parameter 12-17
+        0.01_wp, 0.001_wp, 0.475_wp,                                           & !parameter 18-20
+        0.005_wp, 0.01_wp, 0.41_wp, 0.7_wp, 2000000.0_wp,                      & !parameter 21-25
+        103000.0_wp, 900000.0_wp, 0.35_wp,                                     & !parameter 26-28                     
+        0.14_wp, 0.035_wp, 0.92_wp,                                            & !parameter 29-31       
+        27.0_wp, 0.525_wp, 0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp,             & !parameter 32-37
+        1736000.0_wp, 1736000.0_wp, 1736000.0_wp,                              & !parameter 38-40
+        0.037_wp, 0.037_wp, 0.037_wp, 0.8_wp,                                     & !parameter 41-44
+        0.6_wp, 27.0_wp, 0.0_wp, 1.5_wp, 0.86_wp,                              & !parameter 45-49
+        5.0_wp, 0.001_wp, 0.0001_wp, 0.425_wp, 0.005_wp,                      & !parameter 50-54
+        0.01_wp, 0.41_wp, 0.7_wp, 2000000.0_wp,                                & !parameter 55-58
+        103000.0_wp, 900000.0_wp, 0.35_wp, 0.14_wp,                            & !parameter 59-62
+        0.035_wp, 0.92_wp, 27.0_wp, 0.575_wp,                                  & !parameter 63-66
+        0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp,                                & !parameter 67-70
+        1736000.0_wp, 1736000.0_wp, 1736000.0_wp,                              & !parameter 71-73
+        0.037_wp, 0.037_wp, 0.037_wp, 0.8_wp, 0.6_wp,                             & !parameter 74-78
+        27.0_wp, 0.0_wp, 1.5_wp, 0.86_wp, 5.0_wp, 1.0_wp,                      & !parameter 79-84
+        0.005_wp, 0.01_wp, 0.41_wp, 0.7_wp, 2000000.0_wp, 103000.0_wp,         & !parameter 85-90
+        900000.0_wp, 0.35_wp, 0.14_wp, 0.035_wp, 0.91_wp, 27.0_wp, 0.0_wp,     & !parameter 91-97
+        0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp, 1736000.0_wp,                  & !parameter 98-102 
+        1736000.0_wp, 1736000.0_wp, 0.037_wp, 0.037_wp, 0.037_wp,                 & !parameter 103-107
+        0.8_wp, 0.6_wp, 27.0_wp, 0.0_wp, 0.0_wp, 1.5_wp,                       & !parameter 108-113
+        0.86_wp, 5.0_wp, 0.0_wp,                                              & !parameter 114-116
+        299.15_wp, 293.15_wp, 0.8_wp, 0.5_wp, 0.6_wp,                          & !parameter 117-121
+        0.1_wp, 1.5_wp, 0.9_wp, 2.5_wp, 80000.0_wp, 4.5_wp,                    & !parameter 122-127
+        100000.0_wp, 0.0_wp, 5.0_wp, 15.0_wp, 3.0_wp, 0.2_wp,                  & !parameter 128-133- end of type 6    
+        10.0_wp, 10.0_wp, 20000.0_wp, 23.0_wp, 23.0_wp, 10.0_wp,               & !parameter 0-5
+        1.0_wp, 0.29_wp, 0.295_wp, 0.695_wp, 0.985_wp, 1950400.0_wp,           & !parameter 6-11
+        1848000.0_wp, 1848000.0_wp, 0.7_wp, 1.0_wp, 1.0_wp, 4.0_wp,            & !parameter 12-17
+        0.01_wp, 0.001_wp, 1.0_wp,                                             & !parameter 18-20
+        0.29_wp, 0.295_wp, 0.695_wp, 0.985_wp, 1950400.0_wp,                   & !parameter 21-25
+        1848000.0_wp, 1848000.0_wp, 0.7_wp,                                    & !parameter 26-28                     
+        1.0_wp, 1.0_wp, 0.9_wp,                                                & !parameter 29-31       
+        27.0_wp, 0.0_wp, 0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp,               & !parameter 32-37
+        1736000.0_wp, 1736000.0_wp, 1736000.0_wp,                              & !parameter 38-40
+        0.57_wp, 0.57_wp, 0.57_wp, 0.8_wp,                                     & !parameter 41-44
+        0.6_wp, 27.0_wp, 0.0_wp, 1.5_wp, 0.86_wp,                              & !parameter 45-49
+        5.0_wp, 0.001_wp, 0.0001_wp, 1.0_wp, 0.29_wp,                         & !parameter 50-54
+        0.295_wp, 0.695_wp, 0.985_wp, 1950400.0_wp,                            & !parameter 55-58
+        1848000.0_wp, 1848000.0_wp, 0.7_wp, 1.0_wp,                            & !parameter 59-62
+        1.0_wp, 0.9_wp, 27.0_wp, 0.0_wp,                                       & !parameter 63-66
+        0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp,                                & !parameter 67-70
+        1736000.0_wp, 1736000.0_wp, 1736000.0_wp,                              & !parameter 71-73
+        0.57_wp, 0.57_wp, 0.57_wp, 0.8_wp, 0.6_wp,                             & !parameter 74-78
+        27.0_wp, 0.0_wp, 1.5_wp, 0.86_wp, 5.0_wp, 1.0_wp,                      & !parameter 79-84
+        0.29_wp, 0.295_wp, 0.695_wp, 0.985_wp, 1950400.0_wp, 1848000.0_wp,     & !parameter 85-90
+        1848000.0_wp, 0.7_wp, 1.0_wp, 1.0_wp, 0.9_wp, 27.0_wp, 0.0_wp,         & !parameter 91-97
+        0.003_wp, 0.006_wp, 0.012_wp, 0.018_wp, 1736000.0_wp,                  & !parameter 98-102 
+        1736000.0_wp, 1736000.0_wp, 0.57_wp, 0.57_wp, 0.57_wp,                 & !parameter 103-107
+        0.8_wp, 0.6_wp, 27.0_wp, 0.0_wp, 0.0_wp, 1.5_wp,                       & !parameter 108-113
+        0.86_wp, 5.0_wp, 0.0_wp,                                              & !parameter 114-116
+        299.15_wp, 293.15_wp, 0.8_wp, 100.0_wp, 100.0_wp,                      & !parameter 117-121
+        20.0_wp, 20.0_wp, 0.0_wp, 1.0_wp, 1.0_wp, 4.5_wp,                      & !parameter 122-127
+        100000.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp, 0.2_wp                    & !parameter 128-133- end of type 7 (bridge)
+                                                                       /),     &
+                                                               (/134, 7/) )
 
 !
@@ -613,4 +906,35 @@
        REAL(wp), DIMENSION(:,:), ALLOCATABLE       :: t
     END TYPE t_wall_vertical
+
+    TYPE surf_type_usm
+       REAL(wp), DIMENSION(:),   ALLOCATABLE ::  var_usm_1d !< 1D prognostic variable
+       REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  var_usm_2d !< 2D prognostic variable
+    END TYPE surf_type_usm
+    
+#if defined( __nopointer )
+    TYPE(surf_type_usm), TARGET   ::  m_liq_usm_h,        & !< liquid water reservoir (m), horizontal surface elements 
+                                      m_liq_usm_h_p         !< progn. liquid water reservoir (m), horizontal surface elements 
+
+    TYPE(surf_type_usm), DIMENSION(0:3), TARGET   ::  &
+                                      m_liq_usm_v,        & !< liquid water reservoir (m), vertical surface elements 
+                                      m_liq_usm_v_p         !< progn. liquid water reservoir (m), vertical surface elements 
+#else
+    TYPE(surf_type_usm), POINTER  ::  m_liq_usm_h,        & !< liquid water reservoir (m), horizontal surface elements 
+                                      m_liq_usm_h_p         !< progn. liquid water reservoir (m), horizontal surface elements 
+
+    TYPE(surf_type_usm), TARGET   ::  m_liq_usm_h_1,      & !<
+                                      m_liq_usm_h_2         !<
+
+    TYPE(surf_type_usm), DIMENSION(:), POINTER  ::    &
+                                      m_liq_usm_v,        & !< liquid water reservoir (m), vertical surface elements 
+                                      m_liq_usm_v_p         !< progn. liquid water reservoir (m), vertical surface elements 
+
+    TYPE(surf_type_usm), DIMENSION(0:3), TARGET   ::  &
+                                      m_liq_usm_v_1,      & !<
+                                      m_liq_usm_v_2         !<
+#endif
+
+    TYPE(surf_type_usm), TARGET ::  tm_liq_usm_h_m      !< liquid water reservoir tendency (m), horizontal surface elements 
+    TYPE(surf_type_usm), DIMENSION(0:3), TARGET ::  tm_liq_usm_v_m      !< liquid water reservoir tendency (m), vertical surface elements 
 
 
@@ -633,4 +957,16 @@
     REAL(wp), DIMENSION(:), ALLOCATABLE            ::  pcbinswdif_av    !< Average of pcbinswdif
     REAL(wp), DIMENSION(:), ALLOCATABLE            ::  pcbinswref_av    !< Average of pcbinswref
+    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  surfhf_av        !< average of total radiation flux incoming to minus outgoing from local surface  
+    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  wghf_eb_av       !< average of wghf_eb
+    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  wshf_eb_av       !< average of wshf_eb
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE          ::  t_wall_av        !< Average of t_wall
+    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  wghf_eb_green_av !< average of wghf_eb_green
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE          ::  t_green_av       !< Average of t_green
+    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  wghf_eb_window_av !< average of wghf_eb_window
+    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          ::  swc_av        !< Average of swc
     
 
@@ -668,4 +1004,7 @@
     REAL(wp)                                       :: window_inner_temperature = 295.0_wp  !< temperature of the inner window surface (~22 degrees C) (K)
 
+        REAL(wp)                                       ::   m_total = 0.0_wp !< weighted total water content of the soil (m3/m3)
+    INTEGER(iwp)                                   ::   soil_type
+    
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !-- surface and material model variables for walls, ground, roofs
@@ -676,6 +1015,6 @@
 
 #if defined( __nopointer )
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_h           !< wall surface temperature (K) at horizontal walls
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_h_p         !< progn. wall surface temperature (K) at horizontal walls
+    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_wall_h           !< wall surface temperature (K) at horizontal walls
+    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_wall_h_p         !< progn. wall surface temperature (K) at horizontal walls
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_window_h    !< window surface temperature (K) at horizontal walls
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_window_h_p  !< progn. window surface temperature (K) at horizontal walls
@@ -684,6 +1023,6 @@
     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_v
-    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_v_p
+    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
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_window_v
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_window_v_p
@@ -693,6 +1032,6 @@
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_10cm_v_p
 #else
-    REAL(wp), DIMENSION(:), POINTER                :: t_surf_h
-    REAL(wp), DIMENSION(:), POINTER                :: t_surf_h_p 
+    REAL(wp), DIMENSION(:), POINTER                :: t_surf_wall_h
+    REAL(wp), DIMENSION(:), POINTER                :: t_surf_wall_h_p 
     REAL(wp), DIMENSION(:), POINTER                :: t_surf_window_h
     REAL(wp), DIMENSION(:), POINTER                :: t_surf_window_h_p 
@@ -702,6 +1041,6 @@
     REAL(wp), DIMENSION(:), POINTER                :: t_surf_10cm_h_p
 
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_h_1
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_h_2
+    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_wall_h_1
+    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_wall_h_2
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_window_h_1
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_window_h_2
@@ -711,6 +1050,6 @@
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_10cm_h_2
 
-    TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_v
-    TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_v_p
+    TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_wall_v
+    TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_wall_v_p
     TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_window_v
     TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_window_v_p
@@ -720,6 +1059,6 @@
     TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_10cm_v_p
 
-    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_v_1
-    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_v_2
+    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_wall_v_1
+    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_wall_v_2
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_window_v_1
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_window_v_2
@@ -730,4 +1069,13 @@
     
 #endif
+    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_wall_av          !< average of wall surface temperature (K)
+    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            
+    REAL(wp), DIMENSION(:), ALLOCATABLE            :: tt_surface_wall_m       !< surface temperature tendency of wall (K)
+    REAL(wp), DIMENSION(:), ALLOCATABLE            :: tt_surface_window_m !< surface temperature tendency of window (K)
+    REAL(wp), DIMENSION(:), ALLOCATABLE            :: tt_surface_green_m !< surface temperature tendency of green wall (K)
 
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -738,33 +1086,62 @@
 #if defined( __nopointer )
     REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_wall_h             !< Wall temperature (K)
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_wall_h_av          !< Average of t_wall
     REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_wall_h_p           !< Prog. wall temperature (K)
     REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_window_h           !< Window temperature (K)
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_window_h_av        !< Average of t_window
     REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_window_h_p         !< Prog. window temperature (K)
     REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_green_h            !< Green temperature (K)
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_green_h_av         !< Average of t_green
     REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_green_h_p          !< Prog. green temperature (K)
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: swc_h              !< soil water content green building layer
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: swc_h_av              !< avg of soil water content green building layer
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: swc_h_p              !< Prog. soil water content green building layer
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: swc_sat_h          !< soil water content green building layer at saturation
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: swc_res_h          !< soil water content green building layer residual
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: rootfr_h           !< root fraction green green building layer
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: wilt_h             !< wilting point green building layer
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: fc_h               !< field capacity green building layer
+
 
     TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_wall_v             !< Wall temperature (K)
+    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_wall_v_av          !< Average of t_wall
     TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_wall_v_p           !< Prog. wall temperature (K)
     TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_window_v           !< Window temperature (K)
+    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_window_v_av        !< Average of t_window
     TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_window_v_p         !< Prog. window temperature (K)
     TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_green_v            !< Green temperature (K)
+    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_green_v_av         !< Average of t_green
     TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_green_v_p          !< Prog. green temperature (K)
+    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: swc_v             !< Wall swc
+    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: swc_v_av          !< Average of swc
+    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: swc_v_p           !< Prog. swc
+    
 #else
     REAL(wp), DIMENSION(:,:), POINTER                :: t_wall_h, t_wall_h_p
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_wall_h_1, t_wall_h_2
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_wall_h_av, t_wall_h_1, t_wall_h_2
     REAL(wp), DIMENSION(:,:), POINTER                :: t_window_h, t_window_h_p
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_window_h_1, t_window_h_2
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_window_h_av, t_window_h_1, t_window_h_2
     REAL(wp), DIMENSION(:,:), POINTER                :: t_green_h, t_green_h_p
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_green_h_1, t_green_h_2
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_green_h_av, t_green_h_1, t_green_h_2
+    REAL(wp), DIMENSION(:,:), POINTER                :: swc_h, rootfr_h, wilt_h, fc_h, swc_sat_h, swc_h_p, swc_res_h
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: swc_h_1, rootfr_h_1, &
+                                                        wilt_h_1, fc_h_1, swc_sat_h_1, swc_h_2, swc_res_h_1
+    
 
     TYPE(t_wall_vertical), DIMENSION(:), POINTER   :: t_wall_v, t_wall_v_p
-    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_wall_v_1, t_wall_v_2
+    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_wall_v_av, t_wall_v_1, t_wall_v_2
     TYPE(t_wall_vertical), DIMENSION(:), POINTER   :: t_window_v, t_window_v_p
-    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_window_v_1, t_window_v_2
+    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_window_v_av, t_window_v_1, t_window_v_2
     TYPE(t_wall_vertical), DIMENSION(:), POINTER   :: t_green_v, t_green_v_p
-    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_green_v_1, t_green_v_2
+    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_green_v_av, t_green_v_1, t_green_v_2
+    TYPE(t_wall_vertical), DIMENSION(:), POINTER   :: swc_v, swc_v_p
+    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: swc_v_av, swc_v_1, swc_v_2
 #endif
 
-!
+!-- Wall temporal tendencies for time stepping
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE          :: tt_wall_m          !< t_wall prognostic array 
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE          :: tt_window_m        !< t_window prognostic array 
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE          :: tt_green_m         !< t_green prognostic array 
+
 !-- Surface and material parameters classes (surface_type)
 !-- albedo, emissivity, lambda_surf, roughness, thickness, volumetric heat capacity, thermal conductivity
@@ -864,6 +1241,6 @@
 
 !-- Public parameters, constants and initial values
-    PUBLIC usm_anthropogenic_heat, usm_material_model,                          &
-           usm_green_heat_model, usm_temperature_near_surface
+    PUBLIC usm_anthropogenic_heat, usm_material_model, usm_wall_mod,           &
+           usm_green_heat_model, usm_temperature_near_surface, building_pars
 
 
@@ -949,18 +1326,19 @@
        
 !--     wall and roof surface parameters. First for horizontal surfaces
-        ALLOCATE ( surf_usm_h%isroof_surf(1:surf_usm_h%ns)     )
-        ALLOCATE ( surf_usm_h%lambda_surf(1:surf_usm_h%ns)     )
+        ALLOCATE ( surf_usm_h%isroof_surf(1:surf_usm_h%ns)        )
+        ALLOCATE ( surf_usm_h%lambda_surf(1:surf_usm_h%ns)        )
         ALLOCATE ( surf_usm_h%lambda_surf_window(1:surf_usm_h%ns) )
         ALLOCATE ( surf_usm_h%lambda_surf_green(1:surf_usm_h%ns)  )
-        ALLOCATE ( surf_usm_h%c_surface(1:surf_usm_h%ns)       )
+        ALLOCATE ( surf_usm_h%c_surface(1:surf_usm_h%ns)          )
         ALLOCATE ( surf_usm_h%c_surface_window(1:surf_usm_h%ns)   )
         ALLOCATE ( surf_usm_h%c_surface_green(1:surf_usm_h%ns)    )
-        ALLOCATE ( surf_usm_h%transmissivity(1:surf_usm_h%ns)  )
-        ALLOCATE ( surf_usm_h%lai(1:surf_usm_h%ns)             )
-        ALLOCATE ( surf_usm_h%emissivity(0:2,1:surf_usm_h%ns)  )
-        ALLOCATE ( surf_usm_h%r_a(1:surf_usm_h%ns)             )
-        ALLOCATE ( surf_usm_h%r_a_green(1:surf_usm_h%ns)       )
-        ALLOCATE ( surf_usm_h%r_a_window(1:surf_usm_h%ns)      )
-
+        ALLOCATE ( surf_usm_h%transmissivity(1:surf_usm_h%ns)     )
+        ALLOCATE ( surf_usm_h%lai(1:surf_usm_h%ns)                )
+        ALLOCATE ( surf_usm_h%emissivity(0:2,1:surf_usm_h%ns)     )
+        ALLOCATE ( surf_usm_h%r_a(1:surf_usm_h%ns)                )
+        ALLOCATE ( surf_usm_h%r_a_green(1:surf_usm_h%ns)          )
+        ALLOCATE ( surf_usm_h%r_a_window(1:surf_usm_h%ns)         )
+        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.
@@ -978,4 +1356,6 @@
            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)                 )
         ENDDO
 
@@ -991,4 +1371,13 @@
         ALLOCATE ( surf_usm_h%lambda_h_green(nzb_wall:nzt_wall,1:surf_usm_h%ns)  )
         ALLOCATE ( surf_usm_h%rho_c_green(nzb_wall:nzt_wall,1:surf_usm_h%ns)     )
+
+        ALLOCATE ( surf_usm_h%rho_c_total_green(nzb_wall:nzt_wall,1:surf_usm_h%ns)     )
+        ALLOCATE ( surf_usm_h%n_vg_green(1:surf_usm_h%ns)     )
+        ALLOCATE ( surf_usm_h%alpha_vg_green(1:surf_usm_h%ns)     )
+        ALLOCATE ( surf_usm_h%l_vg_green(1:surf_usm_h%ns)     )
+        ALLOCATE ( surf_usm_h%gamma_w_green_sat(nzb_wall:nzt_wall,1:surf_usm_h%ns)     )
+        ALLOCATE ( surf_usm_h%lambda_w_green(nzb_wall:nzt_wall,1:surf_usm_h%ns)     )
+        ALLOCATE ( surf_usm_h%gamma_w_green(nzb_wall:nzt_wall,1:surf_usm_h%ns)     )
+        ALLOCATE ( surf_usm_h%tswc_h_m(nzb_wall:nzt_wall,1:surf_usm_h%ns)     )
 
 !
@@ -1006,4 +1395,26 @@
         ENDDO
 
+!
+!--     allocate green wall and roof vegetation and soil parameters. First horizontal surfaces
+        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%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)         )
+
+!
+!--     For vertical surfaces.
+        DO  l = 0, 3
+          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_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)     )
+        ENDDO
+        
 !--     allocate wall and roof layers sizes. For horizontal surfaces.
         ALLOCATE ( zwn(nzb_wall:nzt_wall) )
@@ -1047,8 +1458,8 @@
 !--     allocate wall and roof temperature arrays, for horizontal walls
 #if defined( __nopointer )
-        IF ( .NOT. ALLOCATED( t_surf_h ) )                                     &
-           ALLOCATE ( t_surf_h(1:surf_usm_h%ns) )
-        IF ( .NOT. ALLOCATED( t_surf_h_p ) )                                   &
-           ALLOCATE ( t_surf_h_p(1:surf_usm_h%ns) )
+        IF ( .NOT. ALLOCATED( t_surf_wall_h ) )                                     &
+           ALLOCATE ( t_surf_wall_h(1:surf_usm_h%ns) )
+        IF ( .NOT. ALLOCATED( t_surf_wall_h_p ) )                                   &
+           ALLOCATE ( t_surf_wall_h_p(1:surf_usm_h%ns) )
         IF ( .NOT. ALLOCATED( t_wall_h ) )                                     &           
            ALLOCATE ( t_wall_h(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) 
@@ -1075,12 +1486,36 @@
         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) )
+        IF ( .NOT. ALLOCATED( swc_sat_h ) )                                    &           
+           ALLOCATE ( swc_sat_h(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) )
+        IF ( .NOT. ALLOCATED( swc_res_h ) )                                    &           
+           ALLOCATE ( swc_res_h(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) )
+        IF ( .NOT. ALLOCATED( rootfr_h ) )                                    &           
+           ALLOCATE ( rootfr_h(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) )
+        IF ( .NOT. ALLOCATED( wilt_h ) )                                    &           
+           ALLOCATE ( wilt_h(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) )
+        IF ( .NOT. ALLOCATED( fc_h ) )                                    &           
+           ALLOCATE ( fc_h(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) 
+
+       IF ( .NOT. ALLOCATED( m_liq_usm_h%var_usm_1d ) )                            &
+          ALLOCATE ( m_liq_usm_h%var_usm_1d(1:surf_usm_h%ns) )
+
+!--    Horizontal surfaces
+       ALLOCATE ( m_liq_usm_h_p%var_usm_1d(1:surf_usm_h%ns)                      )
+!
+!--    Vertical surfaces
+       DO  l = 0, 3
+          ALLOCATE ( m_liq_usm_v_p(l)%var_usm_1d(1:surf_usm_v(l)%ns)                      )
+       ENDDO
+          
 #else
 !
 !--     Allocate if required. Note, in case of restarts, some of these arrays 
 !--     might be already allocated.
-        IF ( .NOT. ALLOCATED( t_surf_h_1 ) )                                   &
-           ALLOCATE ( t_surf_h_1(1:surf_usm_h%ns) )
-        IF ( .NOT. ALLOCATED( t_surf_h_2 ) )                                   &
-           ALLOCATE ( t_surf_h_2(1:surf_usm_h%ns) )
+        IF ( .NOT. ALLOCATED( t_surf_wall_h_1 ) )                                   &
+           ALLOCATE ( t_surf_wall_h_1(1:surf_usm_h%ns) )
+        IF ( .NOT. ALLOCATED( t_surf_wall_h_2 ) )                                   &
+           ALLOCATE ( t_surf_wall_h_2(1:surf_usm_h%ns) )
         IF ( .NOT. ALLOCATED( t_wall_h_1 ) )                                   &           
            ALLOCATE ( t_wall_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) 
@@ -1107,4 +1542,24 @@
         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) ) 
+        IF ( .NOT. ALLOCATED( swc_sat_h_1 ) )                                  &           
+           ALLOCATE ( swc_sat_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) 
+        IF ( .NOT. ALLOCATED( swc_res_h_1 ) )                                  &           
+           ALLOCATE ( swc_res_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) 
+        IF ( .NOT. ALLOCATED( swc_h_2 ) )                                  &           
+           ALLOCATE ( swc_h_2(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) )
+        IF ( .NOT. ALLOCATED( rootfr_h_1 ) )                                  &           
+           ALLOCATE ( rootfr_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) 
+        IF ( .NOT. ALLOCATED( wilt_h_1 ) )                                  &           
+           ALLOCATE ( wilt_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) 
+        IF ( .NOT. ALLOCATED( fc_h_1 ) )                                  &           
+           ALLOCATE ( fc_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) 
+
+        IF ( .NOT. ALLOCATED( m_liq_usm_h_1%var_usm_1d ) )                         &
+           ALLOCATE ( m_liq_usm_h_1%var_usm_1d(1:surf_usm_h%ns) )
+        IF ( .NOT. ALLOCATED( m_liq_usm_h_2%var_usm_1d ) )                         &
+           ALLOCATE ( m_liq_usm_h_2%var_usm_1d(1:surf_usm_h%ns) )
+           
 !           
 !--     initial assignment of the pointers
@@ -1112,8 +1567,15 @@
         t_window_h    => t_window_h_1;    t_window_h_p    => t_window_h_2
         t_green_h    => t_green_h_1;    t_green_h_p    => t_green_h_2
-        t_surf_h => t_surf_h_1; t_surf_h_p => t_surf_h_2           
+        t_surf_wall_h => t_surf_wall_h_1; t_surf_wall_h_p => t_surf_wall_h_2           
         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
+        swc_sat_h    => swc_sat_h_1
+        swc_res_h    => swc_res_h_1
+        rootfr_h       => rootfr_h_1
+        wilt_h       => wilt_h_1
+        fc_h       => fc_h_1
  
 #endif
@@ -1122,8 +1584,8 @@
 #if defined( __nopointer )
         DO  l = 0, 3
-           IF ( .NOT. ALLOCATED( t_surf_v(l)%t ) )                             &
-              ALLOCATE ( t_surf_v(l)%t(1:surf_usm_v(l)%ns) )
-           IF ( .NOT. ALLOCATED( t_surf_v_p(l)%t ) )                           &
-              ALLOCATE ( t_surf_v_p(l)%t(1:surf_usm_v(l)%ns) )
+           IF ( .NOT. ALLOCATED( t_surf_wall_v(l)%t ) )                             &
+              ALLOCATE ( t_surf_wall_v(l)%t(1:surf_usm_v(l)%ns) )
+           IF ( .NOT. ALLOCATED( t_surf_wall_v_p(l)%t ) )                           &
+              ALLOCATE ( t_surf_wall_v_p(l)%t(1:surf_usm_v(l)%ns) )
            IF ( .NOT. ALLOCATED( t_wall_v(l)%t ) )                             &
               ALLOCATE ( t_wall_v(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) )
@@ -1150,4 +1612,10 @@
            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) )
+           IF ( .NOT. ALLOCATED( swc_v(l)%t ) )                             &
+              ALLOCATE ( swc_v(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) )
+           IF ( .NOT. ALLOCATED( swc_v_p(l)%t ) )                           &                 
+              ALLOCATE ( swc_v_p(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) )
         ENDDO
 #else
@@ -1156,8 +1624,8 @@
 !--     might be already allocated.
         DO  l = 0, 3
-           IF ( .NOT. ALLOCATED( t_surf_v_1(l)%t ) )                           &
-              ALLOCATE ( t_surf_v_1(l)%t(1:surf_usm_v(l)%ns) )
-           IF ( .NOT. ALLOCATED( t_surf_v_2(l)%t ) )                           &
-              ALLOCATE ( t_surf_v_2(l)%t(1:surf_usm_v(l)%ns) )
+           IF ( .NOT. ALLOCATED( t_surf_wall_v_1(l)%t ) )                           &
+              ALLOCATE ( t_surf_wall_v_1(l)%t(1:surf_usm_v(l)%ns) )
+           IF ( .NOT. ALLOCATED( t_surf_wall_v_2(l)%t ) )                           &
+              ALLOCATE ( t_surf_wall_v_2(l)%t(1:surf_usm_v(l)%ns) )
            IF ( .NOT. ALLOCATED( t_wall_v_1(l)%t ) )                           &           
               ALLOCATE ( t_wall_v_1(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) 
@@ -1184,9 +1652,17 @@
            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) )
+           IF ( .NOT. ALLOCATED( m_liq_usm_v_2(l)%var_usm_1d ) )              &
+              ALLOCATE ( m_liq_usm_v_2(l)%var_usm_1d(1:surf_usm_v(l)%ns) )
+           IF ( .NOT. ALLOCATED( swc_v_1(l)%t ) )                           &           
+              ALLOCATE ( swc_v_1(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) 
+           IF ( .NOT. ALLOCATED( swc_v_2(l)%t ) )                           &           
+              ALLOCATE ( swc_v_2(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) )  
         ENDDO
 !
 !--     initial assignment of the pointers
         t_wall_v    => t_wall_v_1;    t_wall_v_p    => t_wall_v_2
-        t_surf_v => t_surf_v_1; t_surf_v_p => t_surf_v_2
+        t_surf_wall_v => t_surf_wall_v_1; t_surf_wall_v_p => t_surf_wall_v_2
         t_window_v    => t_window_v_1;    t_window_v_p    => t_window_v_2
         t_green_v    => t_green_v_1;    t_green_v_p    => t_green_v_2
@@ -1194,9 +1670,11 @@
         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
 
 #endif
 !
 !--     Allocate intermediate timestep arrays. For horizontal surfaces.
-        ALLOCATE ( surf_usm_h%tt_surface_m(1:surf_usm_h%ns)                  )
+        ALLOCATE ( surf_usm_h%tt_surface_wall_m(1:surf_usm_h%ns)                  )
         ALLOCATE ( surf_usm_h%tt_wall_m(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) )
         ALLOCATE ( surf_usm_h%tt_surface_window_m(1:surf_usm_h%ns)             )
@@ -1206,6 +1684,16 @@
 
 !
+!--    Allocate intermediate timestep arrays
+!--    Horizontal surfaces
+       ALLOCATE ( tm_liq_usm_h_m%var_usm_1d(1:surf_usm_h%ns)                   )
+!
+!--    Horizontal surfaces
+       DO  l = 0, 3
+          ALLOCATE ( tm_liq_usm_v_m(l)%var_usm_1d(1:surf_usm_v(l)%ns)          )
+       ENDDO 
+        
+!
 !--     Set inital values for prognostic quantities
-        IF ( ALLOCATED( surf_usm_h%tt_surface_m ) )  surf_usm_h%tt_surface_m = 0.0_wp
+        IF ( ALLOCATED( surf_usm_h%tt_surface_wall_m ) )  surf_usm_h%tt_surface_wall_m = 0.0_wp
         IF ( ALLOCATED( surf_usm_h%tt_wall_m    ) )  surf_usm_h%tt_wall_m    = 0.0_wp
         IF ( ALLOCATED( surf_usm_h%tt_surface_window_m ) )  surf_usm_h%tt_surface_window_m = 0.0_wp
@@ -1216,7 +1704,7 @@
 !--     Now, for vertical surfaces
         DO  l = 0, 3
-           ALLOCATE ( surf_usm_v(l)%tt_surface_m(1:surf_usm_v(l)%ns)                  )
+           ALLOCATE ( surf_usm_v(l)%tt_surface_wall_m(1:surf_usm_v(l)%ns)                  )
            ALLOCATE ( surf_usm_v(l)%tt_wall_m(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) )
-           IF ( ALLOCATED( surf_usm_v(l)%tt_surface_m ) )  surf_usm_v(l)%tt_surface_m = 0.0_wp
+           IF ( ALLOCATED( surf_usm_v(l)%tt_surface_wall_m ) )  surf_usm_v(l)%tt_surface_wall_m = 0.0_wp
            IF ( ALLOCATED( surf_usm_v(l)%tt_wall_m    ) )  surf_usm_v(l)%tt_wall_m    = 0.0_wp
            ALLOCATE ( surf_usm_v(l)%tt_surface_window_m(1:surf_usm_v(l)%ns)             )
@@ -1334,4 +1822,14 @@
             ELSE
 !--             wrong green layer index
+                RETURN
+            ENDIF
+        ENDIF
+        IF ( var(1:8) == 'usm_swc_'  .AND.  len(TRIM(var)) >= 9 )  THEN
+!--          swc layers
+            READ(var(9:9), '(I1)', iostat=istat ) iwl
+            IF ( istat == 0  .AND.  iwl >= nzb_wall  .AND.  iwl <= nzt_wall )  THEN
+                var = var(1:7)
+            ELSE
+!--             wrong swc layer index
                 RETURN
             ENDIF
@@ -1489,4 +1987,43 @@
                        ENDIF
                     ENDIF
+                    
+                CASE ( 'usm_qsws' )
+!--                 array of latent heat flux from surfaces
+!--                 land surfaces
+                    IF ( l == -1 .AND. .NOT.  ALLOCATED(surf_usm_h%qsws_eb_av) )  THEN
+                        ALLOCATE( surf_usm_h%qsws_eb_av(1:surf_usm_h%ns) )
+                        surf_usm_h%qsws_eb_av = 0.0_wp
+                    ELSE
+                       IF ( .NOT.  ALLOCATED(surf_usm_v(l)%qsws_eb_av) )  THEN
+                           ALLOCATE( surf_usm_v(l)%qsws_eb_av(1:surf_usm_v(l)%ns) )
+                           surf_usm_v(l)%qsws_eb_av = 0.0_wp
+                       ENDIF
+                    ENDIF
+                    
+                CASE ( 'usm_qsws_veg' )
+!--                 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
+                    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
+                       ENDIF
+                    ENDIF
+                    
+                CASE ( 'usm_qsws_liq' )
+!--                 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
+                    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
+                       ENDIF
+                    ENDIF
 !
 !--             Please note, the following output quantities belongs to the 
@@ -1554,13 +2091,13 @@
                     ENDIF
                     
-                CASE ( 'usm_t_surf' )
+                CASE ( 'usm_t_surf_wall' )
 !--                 surface temperature for surfaces
-                    IF ( l == -1 .AND. .NOT.  ALLOCATED(surf_usm_h%t_surf_av) )  THEN
-                        ALLOCATE( surf_usm_h%t_surf_av(1:surf_usm_h%ns) )
-                        surf_usm_h%t_surf_av = 0.0_wp
+                    IF ( l == -1 .AND. .NOT.  ALLOCATED(surf_usm_h%t_surf_wall_av) )  THEN
+                        ALLOCATE( surf_usm_h%t_surf_wall_av(1:surf_usm_h%ns) )
+                        surf_usm_h%t_surf_wall_av = 0.0_wp
                     ELSE
-                       IF ( .NOT.  ALLOCATED(surf_usm_v(l)%t_surf_av) )  THEN
-                           ALLOCATE( surf_usm_v(l)%t_surf_av(1:surf_usm_v(l)%ns) )
-                           surf_usm_v(l)%t_surf_av = 0.0_wp
+                       IF ( .NOT.  ALLOCATED(surf_usm_v(l)%t_surf_wall_av) )  THEN
+                           ALLOCATE( surf_usm_v(l)%t_surf_wall_av(1:surf_usm_v(l)%ns) )
+                           surf_usm_v(l)%t_surf_wall_av = 0.0_wp
                        ENDIF
                     ENDIF
@@ -1635,4 +2172,15 @@
                            ALLOCATE( surf_usm_v(l)%t_green_av(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) )
                            surf_usm_v(l)%t_green_av = 0.0_wp
+                       ENDIF
+                    ENDIF
+                CASE ( 'usm_swc' )
+!--                 soil water content for iwl layer of walls and land
+                    IF ( l == -1 .AND. .NOT.  ALLOCATED(surf_usm_h%swc_av) )  THEN
+                        ALLOCATE( surf_usm_h%swc_av(nzb_wall:nzt_wall,1:surf_usm_h%ns) )
+                        surf_usm_h%swc_av = 0.0_wp
+                    ELSE
+                       IF ( .NOT.  ALLOCATED(surf_usm_v(l)%swc_av) )  THEN
+                           ALLOCATE( surf_usm_v(l)%swc_av(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) )
+                           surf_usm_v(l)%swc_av = 0.0_wp
                        ENDIF
                     ENDIF
@@ -1803,4 +2351,52 @@
                     ENDIF
                     
+                CASE ( 'usm_qsws' )
+!--                 array of latent heat flux from surfaces (land, roof, wall)
+                    IF ( l == -1 ) THEN
+                    DO  m = 1, surf_usm_h%ns
+                       surf_usm_h%qsws_eb_av(m) =                              &
+                                          surf_usm_h%qsws_eb_av(m) +           &
+                                          surf_usm_h%qsws_eb(m)
+                    ENDDO
+                    ELSE
+                       DO  m = 1, surf_usm_v(l)%ns
+                          surf_usm_v(l)%qsws_eb_av(m) =                        &
+                                          surf_usm_v(l)%qsws_eb_av(m) +        &
+                                          surf_usm_v(l)%qsws_eb(m)
+                       ENDDO
+                    ENDIF
+                    
+                CASE ( 'usm_qsws_veg' )
+!--                 array of latent heat flux from vegetation surfaces (land, roof, wall)
+                    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)
+                    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)
+                       ENDDO
+                    ENDIF
+                    
+                CASE ( 'usm_qsws_liq' )
+!--                 array of latent heat flux from surfaces with liquid (land, roof, wall)
+                    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)
+                    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)
+                       ENDDO
+                    ENDIF
+                    
                 CASE ( 'usm_wghf' )
 !--                 array of heat flux from ground (wall, roof, land)
@@ -1883,17 +2479,17 @@
                     ENDIF
                     
-                CASE ( 'usm_t_surf' )
+                CASE ( 'usm_t_surf_wall' )
 !--                 surface temperature for surfaces
                     IF ( l == -1 ) THEN
                        DO  m = 1, surf_usm_h%ns
-                          surf_usm_h%t_surf_av(m) =                               &
-                                             surf_usm_h%t_surf_av(m) +            &
-                                             t_surf_h(m)
+                       surf_usm_h%t_surf_wall_av(m) =                               & 
+                                          surf_usm_h%t_surf_wall_av(m) +            &
+                                          t_surf_wall_h(m)
                        ENDDO
                     ELSE
                        DO  m = 1, surf_usm_v(l)%ns
-                          surf_usm_v(l)%t_surf_av(m) =                         &
-                                          surf_usm_v(l)%t_surf_av(m) +         &
-                                          t_surf_v(l)%t(m)
+                          surf_usm_v(l)%t_surf_wall_av(m) =                         &
+                                          surf_usm_v(l)%t_surf_wall_av(m) +         &
+                                          t_surf_wall_v(l)%t(m)
                        ENDDO
                     ENDIF
@@ -1996,4 +2592,20 @@
                     ENDIF
 
+                CASE ( 'usm_swc' )
+!--                 soil water content for  iwl layer of walls and land
+                    IF ( l == -1 ) THEN
+                    DO  m = 1, surf_usm_h%ns
+                       surf_usm_h%swc_av(iwl,m) =                           &
+                                          surf_usm_h%swc_av(iwl,m) +        &
+                                          swc_h(iwl,m)
+                    ENDDO
+                    ELSE
+                       DO  m = 1, surf_usm_v(l)%ns
+                          surf_usm_v(l)%swc_av(iwl,m) =                     &
+                                          surf_usm_v(l)%swc_av(iwl,m) +     &
+                                          swc_v(l)%t(iwl,m)
+                       ENDDO
+                    ENDIF
+
                 CASE DEFAULT
                     CONTINUE
@@ -2156,4 +2768,52 @@
                     ENDIF
                     
+                CASE ( 'usm_qsws' )
+!--                 array of latent heat flux from surfaces (land, roof, wall)
+                    IF ( l == -1 ) THEN
+                    DO  m = 1, surf_usm_h%ns
+                       surf_usm_h%qsws_eb_av(m) =                              &
+                                          surf_usm_h%qsws_eb_av(m) /           &
+                                          REAL( average_count_3d, kind=wp )
+                    ENDDO
+                    ELSE
+                       DO  m = 1, surf_usm_v(l)%ns
+                          surf_usm_v(l)%qsws_eb_av(m) =                        &
+                                          surf_usm_v(l)%qsws_eb_av(m) /        &
+                                          REAL( average_count_3d, kind=wp )
+                       ENDDO
+                    ENDIF
+
+                CASE ( 'usm_qsws_veg' )
+!--                 array of latent heat flux from vegetation surfaces (land, roof, wall)
+                    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) /           &
+                                          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) /        &
+                                          REAL( average_count_3d, kind=wp )
+                       ENDDO
+                    ENDIF
+                    
+                CASE ( 'usm_qsws_liq' )
+!--                 array of latent heat flux from surfaces with liquid (land, roof, wall)
+                    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) /           &
+                                          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) /        &
+                                          REAL( average_count_3d, kind=wp )
+                       ENDDO
+                    ENDIF
+                    
                 CASE ( 'usm_wghf' )
 !--                 array of heat flux from ground (wall, roof, land)
@@ -2236,16 +2896,16 @@
                     ENDIF
                     
-                CASE ( 'usm_t_surf' )
+                CASE ( 'usm_t_surf_wall' )
 !--                 surface temperature for surfaces
                     IF ( l == -1 ) THEN
                        DO  m = 1, surf_usm_h%ns
-                          surf_usm_h%t_surf_av(m) =                               &
-                                             surf_usm_h%t_surf_av(m) /            &
+                       surf_usm_h%t_surf_wall_av(m) =                               & 
+                                          surf_usm_h%t_surf_wall_av(m) /            &
                                              REAL( average_count_3d, kind=wp )
                        ENDDO
                     ELSE
                        DO  m = 1, surf_usm_v(l)%ns
-                          surf_usm_v(l)%t_surf_av(m) =                         &
-                                          surf_usm_v(l)%t_surf_av(m) /         &
+                          surf_usm_v(l)%t_surf_wall_av(m) =                         &
+                                          surf_usm_v(l)%t_surf_wall_av(m) /         &
                                           REAL( average_count_3d, kind=wp )
                        ENDDO
@@ -2347,4 +3007,20 @@
                        ENDDO
                     ENDIF
+                    
+                CASE ( 'usm_swc' )
+!--                 soil water content for  iwl layer of walls and land
+                    IF ( l == -1 ) THEN
+                    DO  m = 1, surf_usm_h%ns
+                       surf_usm_h%swc_av(iwl,m) =                           &
+                                          surf_usm_h%swc_av(iwl,m) /        &
+                                          REAL( average_count_3d, kind=wp )
+                    ENDDO
+                    ELSE
+                       DO  m = 1, surf_usm_v(l)%ns
+                          surf_usm_v(l)%swc_av(iwl,m) =                     &
+                                          surf_usm_v(l)%swc_av(iwl,m) /     &
+                                          REAL( average_count_3d, kind=wp )
+                       ENDDO
+                    ENDIF
 
 
@@ -2406,12 +3082,12 @@
 !------------------------------------------------------------------------------!
     SUBROUTINE usm_check_data_output( variable, unit )
-        
+
         IMPLICIT NONE
- 
-        CHARACTER(LEN=*),INTENT(IN)    ::  variable !:
-        CHARACTER(LEN=*),INTENT(OUT)   ::  unit     !:
+
+        CHARACTER(LEN=*),INTENT(IN)    ::  variable   !< 
+        CHARACTER(LEN=*),INTENT(OUT)   ::  unit       !<
 
         INTEGER(iwp)                                  :: i,j          !< index
-        CHARACTER(LEN=varnamelength)                  :: var
+        CHARACTER(LEN=varnamelength)                  :: var          !< TRIM(variable)
         INTEGER(iwp), PARAMETER                       :: nl1 = 32     !< number of directional usm variables
         CHARACTER(LEN=varnamelength), DIMENSION(nl1)  :: varlist1 = & !< list of directional usm variables
@@ -2468,4 +3144,5 @@
 
         lfound = .FALSE.
+
         var = TRIM(variable)
 
@@ -2495,5 +3172,4 @@
 10      CONTINUE
 
-!--     check if variable exists
         IF ( var(1:12) == 'usm_rad_net_'  .OR.  var(1:13) == 'usm_rad_insw_'  .OR.        &
              var(1:13) == 'usm_rad_inlw_'  .OR.  var(1:16) == 'usm_rad_inswdir_'  .OR.    &
@@ -2505,11 +3181,13 @@
              var(1:9)  == 'usm_wshf_'  .OR.  var(1:9) == 'usm_wghf_' .OR.                 &
              var(1:16) == 'usm_wghf_window_' .OR. var(1:15) == 'usm_wghf_green_' .OR.     &
-             var(1:10) == 'usm_iwghf_' .OR. var(1:17) == 'usm_iwghf_window_' .OR.         &
-             var(1:17) == 'usm_surfwintrans_' )  THEN
+             var(1:10) == 'usm_iwghf_' .OR. var(1:17) == 'usm_iwghf_window_'    .OR.      &
+             var(1:17) == 'usm_surfwintrans_' .OR.                                        &
+             var(1:9)  == 'usm_qsws_'  .OR.  var(1:13)  == 'usm_qsws_veg_'  .OR.          &
+             var(1:13) == 'usm_qsws_liq_' ) THEN
             unit = 'W/m2'
-        ELSE IF ( var(1:10) == 'usm_t_surf'   .OR.  var(1:10) == 'usm_t_wall' .OR.        &
+        ELSE IF ( var(1:15) == 'usm_t_surf_wall'   .OR.  var(1:10) == 'usm_t_wall' .OR.   &
                   var(1:12) == 'usm_t_window' .OR. var(1:17) == 'usm_t_surf_window' .OR.  &
                   var(1:16) == 'usm_t_surf_green'  .OR.                                   &
-                  var(1:11) == 'usm_t_green' .OR.                                         &
+                  var(1:11) == 'usm_t_green' .OR.  var(1:7) == 'usm_swc' .OR.             &
                   var(1:15) == 'usm_t_surf_10cm' )  THEN
             unit = 'K'
@@ -2662,4 +3340,11 @@
             IF ( istat == 0  .AND.  iwl >= nzb_wall  .AND.  iwl <= nzt_wall )  THEN
                 var = var(1:11)
+            ENDIF
+        ENDIF
+        IF ( var(1:8) == 'usm_swc_'  .AND.  len(TRIM(var)) >= 9 )  THEN
+!--         green layers soil water content
+            READ(var(9:9), '(I1)', iostat=istat ) iwl
+            IF ( istat == 0  .AND.  iwl >= nzb_wall  .AND.  iwl <= nzt_wall )  THEN
+                var = var(1:7)
             ENDIF
         ENDIF
@@ -3132,4 +3817,121 @@
                  ENDIF
               ENDIF
+              
+              
+          CASE ( 'usm_qsws' )
+!--           array of latent heat flux from surfaces
+              IF ( av == 0 )  THEN
+                 IF ( idsint == iup_u )  THEN
+                    DO  m = 1, surf_usm_h%ns
+                       i = surf_usm_h%i(m)
+                       j = surf_usm_h%j(m)
+                       k = surf_usm_h%k(m)
+                       temp_pf(k,j,i) = surf_usm_h%qsws_eb(m)
+                    ENDDO
+                 ELSE
+                    l = idsidx
+                    DO  m = 1, surf_usm_v(l)%ns
+                       i = surf_usm_v(l)%i(m)
+                       j = surf_usm_v(l)%j(m)
+                       k = surf_usm_v(l)%k(m)
+                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_eb(m)
+                    ENDDO
+                 ENDIF
+              ELSE
+                 IF ( idsint == iup_u )  THEN
+                    DO  m = 1, surf_usm_h%ns
+                       i = surf_usm_h%i(m)
+                       j = surf_usm_h%j(m)
+                       k = surf_usm_h%k(m)
+                       temp_pf(k,j,i) = surf_usm_h%qsws_eb_av(m)
+                    ENDDO
+                 ELSE
+                    l = idsidx
+                    DO  m = 1, surf_usm_v(l)%ns
+                       i = surf_usm_v(l)%i(m)
+                       j = surf_usm_v(l)%j(m)
+                       k = surf_usm_v(l)%k(m)
+                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_eb_av(m)
+                    ENDDO
+                 ENDIF
+              ENDIF
+              
+          CASE ( 'usm_qsws_veg' )
+!--           array of latent heat flux from vegetation surfaces
+              IF ( av == 0 )  THEN
+                 IF ( idsint == iup_u )  THEN
+                    DO  m = 1, surf_usm_h%ns
+                       i = surf_usm_h%i(m)
+                       j = surf_usm_h%j(m)
+                       k = surf_usm_h%k(m)
+                       temp_pf(k,j,i) = surf_usm_h%qsws_veg_eb(m)
+                    ENDDO
+                 ELSE
+                    l = idsidx
+                    DO  m = 1, surf_usm_v(l)%ns
+                       i = surf_usm_v(l)%i(m)
+                       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)
+                    ENDDO
+                 ENDIF
+              ELSE
+                 IF ( idsint == iup_u )  THEN
+                    DO  m = 1, surf_usm_h%ns
+                       i = surf_usm_h%i(m)
+                       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)
+                    ENDDO
+                 ELSE
+                    l = idsidx
+                    DO  m = 1, surf_usm_v(l)%ns
+                       i = surf_usm_v(l)%i(m)
+                       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)
+                    ENDDO
+                 ENDIF
+              ENDIF
+              
+          CASE ( 'usm_qsws_liq' )
+!--           array of latent heat flux from surfaces with liquid
+              IF ( av == 0 )  THEN
+                 IF ( idsint == iup_u )  THEN
+                    DO  m = 1, surf_usm_h%ns
+                       i = surf_usm_h%i(m)
+                       j = surf_usm_h%j(m)
+                       k = surf_usm_h%k(m)
+                       temp_pf(k,j,i) = surf_usm_h%qsws_liq_eb(m)
+                    ENDDO
+                 ELSE
+                    l = idsidx
+                    DO  m = 1, surf_usm_v(l)%ns
+                       i = surf_usm_v(l)%i(m)
+                       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)
+                    ENDDO
+                 ENDIF
+              ELSE
+                 IF ( idsint == iup_u )  THEN
+                    DO  m = 1, surf_usm_h%ns
+                       i = surf_usm_h%i(m)
+                       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)
+                    ENDDO
+                 ELSE
+                    l = idsidx
+                    DO  m = 1, surf_usm_v(l)%ns
+                       i = surf_usm_v(l)%i(m)
+                       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)
+                    ENDDO
+                 ENDIF
+              ENDIF
+
+
 
 
@@ -3327,5 +4129,5 @@
               ENDIF
               
-          CASE ( 'usm_t_surf' )
+          CASE ( 'usm_t_surf_wall' )
 !--           surface temperature for surfaces
               IF ( av == 0 )  THEN
@@ -3335,5 +4137,5 @@
                        j = surf_usm_h%j(m)
                        k = surf_usm_h%k(m)
-                       temp_pf(k,j,i) = t_surf_h(m)
+                       temp_pf(k,j,i) = t_surf_wall_h(m)
                     ENDDO
                  ELSE
@@ -3343,5 +4145,5 @@
                        j = surf_usm_v(l)%j(m)
                        k = surf_usm_v(l)%k(m)
-                       temp_pf(k,j,i) = t_surf_v(l)%t(m)
+                       temp_pf(k,j,i) = t_surf_wall_v(l)%t(m)
                     ENDDO
                  ENDIF
@@ -3352,5 +4154,5 @@
                        j = surf_usm_h%j(m)
                        k = surf_usm_h%k(m)
-                       temp_pf(k,j,i) = surf_usm_h%t_surf_av(m)
+                       temp_pf(k,j,i) = surf_usm_h%t_surf_wall_av(m)
                     ENDDO
                  ELSE
@@ -3360,5 +4162,5 @@
                        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_av(m)
+                       temp_pf(k,j,i) = surf_usm_v(l)%t_surf_wall_av(m)
                     ENDDO
                  ENDIF
@@ -3602,4 +4404,42 @@
                        k = surf_usm_v(l)%k(m)
                        temp_pf(k,j,i) = surf_usm_v(l)%t_green_av(iwl,m)
+                    ENDDO
+                 ENDIF
+              ENDIF
+              
+              CASE ( 'usm_swc' )
+!--           soil water content for  iwl layer of walls and land
+              IF ( av == 0 )  THEN
+                 IF ( idsint == iup_u )  THEN
+                    DO  m = 1, surf_usm_h%ns
+                       i = surf_usm_h%i(m)
+                       j = surf_usm_h%j(m)
+                       k = surf_usm_h%k(m)
+                       temp_pf(k,j,i) = swc_h(iwl,m)
+                    ENDDO
+                 ELSE
+                    l = idsidx
+                    DO  m = 1, surf_usm_v(l)%ns
+                       i = surf_usm_v(l)%i(m)
+                       j = surf_usm_v(l)%j(m)
+                       k = surf_usm_v(l)%k(m)
+                       temp_pf(k,j,i) = swc_v(l)%t(iwl,m)
+                    ENDDO
+                 ENDIF
+              ELSE
+                 IF ( idsint == iup_u )  THEN
+                    DO  m = 1, surf_usm_h%ns
+                       i = surf_usm_h%i(m)
+                       j = surf_usm_h%j(m)
+                       k = surf_usm_h%k(m)
+                       temp_pf(k,j,i) = surf_usm_h%swc_av(iwl,m)
+                    ENDDO
+                 ELSE
+                    l = idsidx
+                    DO  m = 1, surf_usm_v(l)%ns
+                       i = surf_usm_v(l)%i(m)
+                       j = surf_usm_v(l)%j(m)
+                       k = surf_usm_v(l)%k(m)
+                       temp_pf(k,j,i) = surf_usm_v(l)%swc_av(iwl,m)
                     ENDDO
                  ENDIF
@@ -3658,12 +4498,14 @@
              var(1:16) == 'usm_wghf_window_'  .OR. var(1:15) == 'usm_wghf_green_' .OR.      &
              var(1:10) == 'usm_iwghf_'  .OR. var(1:17) == 'usm_iwghf_window_' .OR.          &
-             var(1:10) == 'usm_t_surf'  .OR.  var(1:10) == 'usm_t_wall'  .OR.               &
+             var(1:9) == 'usm_qsws_'  .OR.  var(1:13) == 'usm_qsws_veg_'  .OR.              &
+             var(1:13) == 'usm_qsws_liq_' .OR.                                              &
+             var(1:10) == 'usm_t_surf_wall'  .OR.  var(1:10) == 'usm_t_wall'  .OR.          &
              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:16) == 'usm_t_surf_green'  .OR. var(1:11) == 'usm_t_green' .OR.          &
              var(1:15) == 'usm_t_surf_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.                  &
              var(1:11) == 'usm_surfalb'  .OR.  var(1:12) == 'usm_surfemis'  .OR.            &
-             var(1:16) == 'usm_surfwintrans'  .OR.                                          &
+             var(1:16) == 'usm_surfwintrans'  .OR. var(1:7) == 'usm_swc' .OR.               &
              var(1:9) == 'usm_skyvf' .OR. var(1:9) == 'usm_skyvft' ) THEN
 
@@ -3711,9 +4553,9 @@
                                          surf_usm_h%zw_window(k-1,m)
            ENDDO
-           surf_usm_h%dz_green(nzb_wall,m) = surf_usm_h%zw_green(nzb_wall,m)
-           DO k = nzb_wall+1, nzt_wall
-               surf_usm_h%dz_green(k,m) = surf_usm_h%zw_green(k,m) -           &
-                                         surf_usm_h%zw_green(k-1,m)
-           ENDDO
+!            surf_usm_h%dz_green(nzb_wall,m) = surf_usm_h%zw_green(nzb_wall,m)
+!            DO k = nzb_wall+1, nzt_wall
+!                surf_usm_h%dz_green(k,m) = surf_usm_h%zw_green(k,m) -           &
+!                                          surf_usm_h%zw_green(k-1,m)
+!            ENDDO
            
            surf_usm_h%dz_wall(nzt_wall+1,m) = surf_usm_h%dz_wall(nzt_wall,m)
@@ -3733,4 +4575,35 @@
            surf_usm_h%dz_window_stag(nzt_wall,m) = surf_usm_h%dz_window(nzt_wall,m)
 
+!            surf_usm_h%dz_green(nzt_wall+1,m) = surf_usm_h%dz_green(nzt_wall,m)
+! 
+!            DO k = nzb_wall, nzt_wall-1
+!                surf_usm_h%dz_green_stag(k,m) = 0.5 * (                         &
+!                            surf_usm_h%dz_green(k+1,m) + surf_usm_h%dz_green(k,m) )
+!            ENDDO
+!            surf_usm_h%dz_green_stag(nzt_wall,m) = surf_usm_h%dz_green(nzt_wall,m)
+!-------------           
+           IF (surf_usm_h%green_type_roof(m) == 2.0_wp ) then
+             soil_type = 3 !extensiv green roof
+             surf_usm_h%lai(m) = 2.0_wp
+             
+           surf_usm_h%zw_green(nzb_wall,m)         = 0.05_wp
+           surf_usm_h%zw_green(nzb_wall+1,m)       = 0.10_wp
+           surf_usm_h%zw_green(nzb_wall+2,m)       = 0.15_wp
+           surf_usm_h%zw_green(nzb_wall+3,m)       = 0.20_wp
+           ELSE
+             soil_type = 6 !intensiv green roof
+             surf_usm_h%lai(m) = 4.0_wp
+             
+           surf_usm_h%zw_green(nzb_wall,m)         = 0.05_wp
+           surf_usm_h%zw_green(nzb_wall+1,m)       = 0.10_wp
+           surf_usm_h%zw_green(nzb_wall+2,m)       = 0.40_wp
+           surf_usm_h%zw_green(nzb_wall+3,m)       = 0.80_wp
+           ENDIF
+           
+           surf_usm_h%dz_green(nzb_wall,m) = surf_usm_h%zw_green(nzb_wall,m)
+           DO k = nzb_wall+1, nzt_wall
+               surf_usm_h%dz_green(k,m) = surf_usm_h%zw_green(k,m) -           &
+                                         surf_usm_h%zw_green(k-1,m)
+           ENDDO
            surf_usm_h%dz_green(nzt_wall+1,m) = surf_usm_h%dz_green(nzt_wall,m)
 
@@ -3740,4 +4613,50 @@
            ENDDO
            surf_usm_h%dz_green_stag(nzt_wall,m) = surf_usm_h%dz_green(nzt_wall,m)
+           
+          IF ( alpha_vangenuchten == 9999999.9_wp )  THEN
+             alpha_vangenuchten = soil_pars(0,soil_type)
+          ENDIF
+
+          IF ( l_vangenuchten == 9999999.9_wp )  THEN
+             l_vangenuchten = soil_pars(1,soil_type)
+          ENDIF
+
+          IF ( n_vangenuchten == 9999999.9_wp )  THEN
+             n_vangenuchten = soil_pars(2,soil_type)            
+          ENDIF
+
+          IF ( hydraulic_conductivity == 9999999.9_wp )  THEN
+             hydraulic_conductivity = soil_pars(3,soil_type)            
+          ENDIF
+
+          IF ( saturation_moisture == 9999999.9_wp )  THEN
+             saturation_moisture = m_soil_pars(0,soil_type)           
+          ENDIF
+
+          IF ( field_capacity == 9999999.9_wp )  THEN
+             field_capacity = m_soil_pars(1,soil_type)           
+          ENDIF
+
+          IF ( wilting_point == 9999999.9_wp )  THEN
+             wilting_point = m_soil_pars(2,soil_type)            
+          ENDIF
+
+          IF ( residual_moisture == 9999999.9_wp )  THEN
+             residual_moisture = m_soil_pars(3,soil_type)       
+          ENDIF
+          
+          DO k = nzb_wall, nzt_wall+1
+             swc_h(k,m) = field_capacity
+             rootfr_h(k,m) = 0.5_wp
+             surf_usm_h%alpha_vg_green(m)      = alpha_vangenuchten
+             surf_usm_h%l_vg_green(m)          = l_vangenuchten
+             surf_usm_h%n_vg_green(m)          = n_vangenuchten 
+             surf_usm_h%gamma_w_green_sat(k,m)   = hydraulic_conductivity
+             swc_sat_h(k,m)                    = saturation_moisture
+             fc_h(k,m)                         = field_capacity
+             wilt_h(k,m)                       = wilting_point
+             swc_res_h(k,m)                    = residual_moisture
+          ENDDO
+!-------------------------------           
         ENDDO
         surf_usm_h%ddz_wall        = 1.0_wp / surf_usm_h%dz_wall
@@ -3807,4 +4726,72 @@
 
         
+!     soil_type = 6
+! !--    Initialize standard soil types. It is possible to overwrite each
+! !--    parameter by setting the respecticy NAMELIST variable to a 
+! !--    value /= 9999999.9. 
+!        IF ( soil_type /= 0 )  THEN  
+!  
+!           IF ( alpha_vangenuchten == 9999999.9_wp )  THEN
+!              alpha_vangenuchten = soil_pars(0,soil_type)
+!           ENDIF
+! 
+!           IF ( l_vangenuchten == 9999999.9_wp )  THEN
+!              l_vangenuchten = soil_pars(1,soil_type)
+!           ENDIF
+! 
+!           IF ( n_vangenuchten == 9999999.9_wp )  THEN
+!              n_vangenuchten = soil_pars(2,soil_type)            
+!           ENDIF
+! 
+!           IF ( hydraulic_conductivity == 9999999.9_wp )  THEN
+!              hydraulic_conductivity = soil_pars(3,soil_type)            
+!           ENDIF
+! 
+!           IF ( saturation_moisture == 9999999.9_wp )  THEN
+!              saturation_moisture = m_soil_pars(0,soil_type)           
+!           ENDIF
+! 
+!           IF ( field_capacity == 9999999.9_wp )  THEN
+!              field_capacity = m_soil_pars(1,soil_type)           
+!           ENDIF
+! 
+!           IF ( wilting_point == 9999999.9_wp )  THEN
+!              wilting_point = m_soil_pars(2,soil_type)            
+!           ENDIF
+! 
+!           IF ( residual_moisture == 9999999.9_wp )  THEN
+!              residual_moisture = m_soil_pars(3,soil_type)       
+!           ENDIF
+!           
+!             DO  m = 1, surf_usm_h%ns
+!                DO k = nzb_wall, nzt_wall+1
+!                    swc_h(k,m) = field_capacity
+!                    rootfr_h(k,m) = 0.5_wp
+!                ENDDO
+!             ENDDO
+! ! !
+! ! !--         Vertical surfaces
+! !             DO  l = 0, 3
+! !                DO  m = 1, surf_usm_v(l)%ns
+! !                   DO k = nzb_wall, nzt_wall+1
+! !                      swc_v(l)%t(k,m) = 0.5_wp
+! !                   ENDDO
+! !                ENDDO
+! !             ENDDO
+! 
+!        ENDIF
+! 
+! !
+! !--    Map values to the respective 2D arrays
+!        surf_usm_h%alpha_vg_green      = alpha_vangenuchten
+!        surf_usm_h%l_vg_green          = l_vangenuchten
+!        surf_usm_h%n_vg_green          = n_vangenuchten 
+!        surf_usm_h%gamma_w_green_sat   = hydraulic_conductivity
+!        swc_sat_h         = saturation_moisture
+!        fc_h          = field_capacity
+!        wilt_h        = wilting_point
+!        swc_res_h         = residual_moisture
+! !        r_soil_min    = min_soil_resistance
+        
         CALL location_message( '    wall structures filed out', .TRUE. )
 
@@ -3830,4 +4817,7 @@
 
         INTEGER(iwp) ::  i                   !< loop index x-dirction
+        INTEGER(iwp) ::  ind_alb_green       !< index in input list for green albedo
+        INTEGER(iwp) ::  ind_alb_wall        !< index in input list for wall albedo
+        INTEGER(iwp) ::  ind_alb_win         !< index in input list for window albedo
         INTEGER(iwp) ::  ind_emis_wall       !< index in input list for wall emissivity
         INTEGER(iwp) ::  ind_emis_green      !< index in input list for green emissivity
@@ -3836,11 +4826,25 @@
         INTEGER(iwp) ::  ind_green_frac_r    !< index in input list for green fraction on roof
         INTEGER(iwp) ::  ind_hc1             !< index in input list for heat capacity at first wall layer
+        INTEGER(iwp) ::  ind_hc1_win         !< index in input list for heat capacity at first window layer
         INTEGER(iwp) ::  ind_hc2             !< index in input list for heat capacity at second wall layer
+        INTEGER(iwp) ::  ind_hc2_win         !< index in input list for heat capacity at second window layer
         INTEGER(iwp) ::  ind_hc3             !< index in input list for heat capacity at third wall layer
+        INTEGER(iwp) ::  ind_hc3_win         !< index in input list for heat capacity at third window layer
         INTEGER(iwp) ::  ind_lai_r           !< index in input list for LAI on roof
         INTEGER(iwp) ::  ind_lai_w           !< index in input list for LAI on wall
         INTEGER(iwp) ::  ind_tc1             !< index in input list for thermal conductivity at first wall layer
+        INTEGER(iwp) ::  ind_tc1_win         !< index in input list for thermal conductivity at first window layer
         INTEGER(iwp) ::  ind_tc2             !< index in input list for thermal conductivity at second wall layer
+        INTEGER(iwp) ::  ind_tc2_win         !< index in input list for thermal conductivity at second window layer
         INTEGER(iwp) ::  ind_tc3             !< index in input list for thermal conductivity at third wall layer
+        INTEGER(iwp) ::  ind_tc3_win         !< index in input list for thermal conductivity at third window layer
+        INTEGER(iwp) ::  ind_thick_1         !< index in input list for thickness of first wall layer 
+        INTEGER(iwp) ::  ind_thick_1_win     !< index in input list for thickness of first window layer 
+        INTEGER(iwp) ::  ind_thick_2         !< index in input list for thickness of second wall layer 
+        INTEGER(iwp) ::  ind_thick_2_win     !< index in input list for thickness of second window layer
+        INTEGER(iwp) ::  ind_thick_3         !< index in input list for thickness of third wall layer
+        INTEGER(iwp) ::  ind_thick_3_win     !< index in input list for thickness of third window layer
+        INTEGER(iwp) ::  ind_thick_4         !< index in input list for thickness of fourth wall layer
+        INTEGER(iwp) ::  ind_thick_4_win     !< index in input list for thickness of fourth window layer
         INTEGER(iwp) ::  ind_trans           !< index in input list for window transmissivity
         INTEGER(iwp) ::  ind_wall_frac       !< index in input list for wall fraction
@@ -3854,5 +4858,5 @@
         INTEGER(iwp) ::  st                  !< dummy  
 
-        REAL(wp)     ::  c, tin, twin
+        REAL(wp)     ::  c, d, tin, twin
         REAL(wp)     ::  ground_floor_level_l         !< local height of ground floor level
         REAL(wp)     ::  z_agl                        !< height above ground
@@ -3949,4 +4953,23 @@
            ENDDO
         ENDDO
+        
+!---------------------------------------------------------------------------------------------
+!
+!--    Map values onto horizontal elemements
+       DO  m = 1, surf_usm_h%ns
+             surf_usm_h%r_canopy_min(m)     = 200.0_wp !min_canopy_resistance
+             surf_usm_h%g_d(m)              = 0.0_wp !canopy_resistance_coefficient
+       ENDDO
+!
+!--    Map values onto vertical elements, even though this does not make
+!--    much sense.
+       DO  l = 0, 3
+          DO  m = 1, surf_usm_v(l)%ns
+                surf_usm_v(l)%r_canopy_min(m)     = 200.0_wp !min_canopy_resistance
+                surf_usm_v(l)%g_d(m)              = 0.0_wp !canopy_resistance_coefficient
+          ENDDO
+       ENDDO
+!---------------------------------------------------------------------------------------------
+!
 !
 !--     Initialize urban-type surface attribute. According to initialization in 
@@ -3960,36 +4983,9 @@
 !
 !--        In order to distinguish between ground floor level and 
-!--        above-ground-floor level surfaces, set input indices. 
-           ind_wall_frac    = MERGE( ind_wall_frac_gfl,    ind_wall_frac_agfl,    &
-                                     surf_usm_h%ground_level(m) )
-           ind_win_frac     = MERGE( ind_win_frac_gfl,     ind_win_frac_agfl,     &
-                                     surf_usm_h%ground_level(m) )
-           ind_green_frac_w = MERGE( ind_green_frac_w_gfl, ind_green_frac_w_agfl, &
-                                     surf_usm_h%ground_level(m) )
+!--        above-ground-floor level surfaces, set input indices.
+
            ind_green_frac_r = MERGE( ind_green_frac_r_gfl, ind_green_frac_r_agfl, &
                                      surf_usm_h%ground_level(m) )
            ind_lai_r        = MERGE( ind_lai_r_gfl,        ind_lai_r_agfl,        &
-                                     surf_usm_h%ground_level(m) )
-           ind_lai_w        = MERGE( ind_lai_w_gfl,        ind_lai_w_agfl,        &
-                                     surf_usm_h%ground_level(m) )
-           ind_hc1          = MERGE( ind_hc1_gfl,          ind_hc1_agfl,          &
-                                     surf_usm_h%ground_level(m) )
-           ind_hc2          = MERGE( ind_hc2_gfl,          ind_hc2_agfl,          &
-                                     surf_usm_h%ground_level(m) )
-           ind_hc3          = MERGE( ind_hc3_gfl,          ind_hc3_agfl,          &
-                                     surf_usm_h%ground_level(m) )
-           ind_tc1          = MERGE( ind_tc1_gfl,          ind_tc1_agfl,          &
-                                     surf_usm_h%ground_level(m) )
-           ind_tc2          = MERGE( ind_tc2_gfl,          ind_tc2_agfl,          &
-                                     surf_usm_h%ground_level(m) )
-           ind_tc3          = MERGE( ind_tc3_gfl,          ind_tc3_agfl,          &
-                                     surf_usm_h%ground_level(m) )
-           ind_emis_wall    = MERGE( ind_emis_wall_gfl,    ind_emis_wall_agfl,    &
-                                     surf_usm_h%ground_level(m) )
-           ind_emis_green   = MERGE( ind_emis_green_gfl,   ind_emis_green_agfl,   &
-                                     surf_usm_h%ground_level(m) )
-           ind_emis_win     = MERGE( ind_emis_win_gfl,     ind_emis_win_agfl,     &
-                                     surf_usm_h%ground_level(m) )
-           ind_trans        = MERGE( ind_trans_gfl,        ind_trans_agfl,        &
                                      surf_usm_h%ground_level(m) )
            ind_z0           = MERGE( ind_z0_gfl,           ind_z0_agfl,           &
@@ -4003,43 +4999,43 @@
 !
 !--        Initialize relatvie wall- (0), green- (1) and window (2) fractions
-           surf_usm_h%frac(ind_veg_wall,m)  = building_pars(ind_wall_frac,building_type)   
+           surf_usm_h%frac(ind_veg_wall,m)  = building_pars(ind_wall_frac_r,building_type)   
            surf_usm_h%frac(ind_pav_green,m) = building_pars(ind_green_frac_r,building_type)  
-           surf_usm_h%frac(ind_wat_win,m)   = building_pars(ind_win_frac,building_type)  
-           surf_usm_h%lai(m)                = building_pars(ind_green_frac_r,building_type)  
-
-           surf_usm_h%rho_c_wall(nzb_wall,m)   = building_pars(ind_hc1,building_type)  
-           surf_usm_h%rho_c_wall(nzb_wall+1,m) = building_pars(ind_hc1,building_type)
-           surf_usm_h%rho_c_wall(nzb_wall+2,m) = building_pars(ind_hc2,building_type)
-           surf_usm_h%rho_c_wall(nzb_wall+3,m) = building_pars(ind_hc3,building_type)    
-           surf_usm_h%lambda_h(nzb_wall,m)   = building_pars(ind_tc1,building_type)  
-           surf_usm_h%lambda_h(nzb_wall+1,m) = building_pars(ind_tc1,building_type) 
-           surf_usm_h%lambda_h(nzb_wall+2,m) = building_pars(ind_tc2,building_type)
-           surf_usm_h%lambda_h(nzb_wall+3,m) = building_pars(ind_tc3,building_type)    
-           surf_usm_h%rho_c_green(nzb_wall,m)   = building_pars(ind_hc1,building_type)  
-           surf_usm_h%rho_c_green(nzb_wall+1,m) = building_pars(ind_hc1,building_type)
-           surf_usm_h%rho_c_green(nzb_wall+2,m) = building_pars(ind_hc2,building_type)
-           surf_usm_h%rho_c_green(nzb_wall+3,m) = building_pars(ind_hc3,building_type)    
-           surf_usm_h%lambda_h_green(nzb_wall,m)   = building_pars(ind_tc1,building_type)  
-           surf_usm_h%lambda_h_green(nzb_wall+1,m) = building_pars(ind_tc1,building_type) 
-           surf_usm_h%lambda_h_green(nzb_wall+2,m) = building_pars(ind_tc2,building_type)
-           surf_usm_h%lambda_h_green(nzb_wall+3,m) = building_pars(ind_tc3,building_type)
-           surf_usm_h%rho_c_window(nzb_wall,m)   = building_pars(ind_hc1,building_type)  
-           surf_usm_h%rho_c_window(nzb_wall+1,m) = building_pars(ind_hc1,building_type)
-           surf_usm_h%rho_c_window(nzb_wall+2,m) = building_pars(ind_hc2,building_type)
-           surf_usm_h%rho_c_window(nzb_wall+3,m) = building_pars(ind_hc3,building_type)    
-           surf_usm_h%lambda_h_window(nzb_wall,m)   = building_pars(ind_tc1,building_type)  
-           surf_usm_h%lambda_h_window(nzb_wall+1,m) = building_pars(ind_tc1,building_type) 
-           surf_usm_h%lambda_h_window(nzb_wall+2,m) = building_pars(ind_tc2,building_type)
-           surf_usm_h%lambda_h_window(nzb_wall+3,m) = building_pars(ind_tc3,building_type)    
-
-           surf_usm_h%target_temp_summer(m)  = building_pars(12,building_type)    
-           surf_usm_h%target_temp_winter(m)  = building_pars(13,building_type)    
+           surf_usm_h%frac(ind_wat_win,m)   = building_pars(ind_win_frac_r,building_type)  
+           surf_usm_h%lai(m)                = building_pars(ind_lai_r,building_type)  
+
+           surf_usm_h%rho_c_wall(nzb_wall,m)   = building_pars(ind_hc1_wall_r,building_type)  
+           surf_usm_h%rho_c_wall(nzb_wall+1,m) = building_pars(ind_hc1_wall_r,building_type)
+           surf_usm_h%rho_c_wall(nzb_wall+2,m) = building_pars(ind_hc2_wall_r,building_type)
+           surf_usm_h%rho_c_wall(nzb_wall+3,m) = building_pars(ind_hc3_wall_r,building_type)    
+           surf_usm_h%lambda_h(nzb_wall,m)   = building_pars(ind_tc1_wall_r,building_type)  
+           surf_usm_h%lambda_h(nzb_wall+1,m) = building_pars(ind_tc1_wall_r,building_type) 
+           surf_usm_h%lambda_h(nzb_wall+2,m) = building_pars(ind_tc2_wall_r,building_type)
+           surf_usm_h%lambda_h(nzb_wall+3,m) = building_pars(ind_tc3_wall_r,building_type)    
+           surf_usm_h%rho_c_green(nzb_wall,m)   = rho_c_soil !building_pars(ind_hc1_wall_r,building_type)  
+           surf_usm_h%rho_c_green(nzb_wall+1,m) = rho_c_soil !building_pars(ind_hc1_wall_r,building_type)
+           surf_usm_h%rho_c_green(nzb_wall+2,m) = rho_c_soil !building_pars(ind_hc2_wall_r,building_type)
+           surf_usm_h%rho_c_green(nzb_wall+3,m) = rho_c_soil !building_pars(ind_hc3_wall_r,building_type)    
+           surf_usm_h%lambda_h_green(nzb_wall,m)   = lambda_h_green_sm !building_pars(ind_tc1_wall_r,building_type)  
+           surf_usm_h%lambda_h_green(nzb_wall+1,m) = lambda_h_green_sm !building_pars(ind_tc1_wall_r,building_type) 
+           surf_usm_h%lambda_h_green(nzb_wall+2,m) = lambda_h_green_sm !building_pars(ind_tc2_wall_r,building_type)
+           surf_usm_h%lambda_h_green(nzb_wall+3,m) = lambda_h_green_sm !building_pars(ind_tc3_wall_r,building_type)
+           surf_usm_h%rho_c_window(nzb_wall,m)   = building_pars(ind_hc1_win_r,building_type)  
+           surf_usm_h%rho_c_window(nzb_wall+1,m) = building_pars(ind_hc1_win_r,building_type)
+           surf_usm_h%rho_c_window(nzb_wall+2,m) = building_pars(ind_hc2_win_r,building_type)
+           surf_usm_h%rho_c_window(nzb_wall+3,m) = building_pars(ind_hc3_win_r,building_type)    
+           surf_usm_h%lambda_h_window(nzb_wall,m)   = building_pars(ind_tc1_win_r,building_type)  
+           surf_usm_h%lambda_h_window(nzb_wall+1,m) = building_pars(ind_tc1_win_r,building_type) 
+           surf_usm_h%lambda_h_window(nzb_wall+2,m) = building_pars(ind_tc2_win_r,building_type)
+           surf_usm_h%lambda_h_window(nzb_wall+3,m) = building_pars(ind_tc3_win_r,building_type)    
+
+           surf_usm_h%target_temp_summer(m)  = building_pars(117,building_type)    
+           surf_usm_h%target_temp_winter(m)  = building_pars(118,building_type)    
 !
 !--        emissivity of wall-, green- and window fraction 
-           surf_usm_h%emissivity(ind_veg_wall,m)  = building_pars(ind_emis_wall,building_type)
-           surf_usm_h%emissivity(ind_pav_green,m) = building_pars(ind_emis_green,building_type)
-           surf_usm_h%emissivity(ind_wat_win,m)   = building_pars(ind_emis_win,building_type)
-
-           surf_usm_h%transmissivity(m)      = building_pars(ind_trans,building_type)
+           surf_usm_h%emissivity(ind_veg_wall,m)  = building_pars(ind_emis_wall_r,building_type)
+           surf_usm_h%emissivity(ind_pav_green,m) = building_pars(ind_emis_green_r,building_type)
+           surf_usm_h%emissivity(ind_wat_win,m)   = building_pars(ind_emis_win_r,building_type)
+
+           surf_usm_h%transmissivity(m)      = building_pars(ind_trans_r,building_type)
 
            surf_usm_h%z0(m)                  = building_pars(ind_z0,building_type)
@@ -4048,29 +5044,31 @@
 !
 !--        albedo type for wall fraction, green fraction, window fraction
-           surf_usm_h%albedo_type(ind_veg_wall,m)  = INT( building_pars(ind_alb_wall,building_type)  )
-           surf_usm_h%albedo_type(ind_pav_green,m) = INT( building_pars(ind_alb_green,building_type) )
-           surf_usm_h%albedo_type(ind_wat_win,m)   = INT( building_pars(ind_alb_win,building_type)   )
-
-           surf_usm_h%zw(nzb_wall,m)         = building_pars(ind_thick_1,building_type)
-           surf_usm_h%zw(nzb_wall+1,m)       = building_pars(ind_thick_2,building_type)
-           surf_usm_h%zw(nzb_wall+2,m)       = building_pars(ind_thick_3,building_type)
-           surf_usm_h%zw(nzb_wall+3,m)       = building_pars(ind_thick_4,building_type)
+           surf_usm_h%albedo_type(ind_veg_wall,m)  = INT( building_pars(ind_alb_wall_r,building_type)  )
+           surf_usm_h%albedo_type(ind_pav_green,m) = INT( building_pars(ind_alb_green_r,building_type) )
+           surf_usm_h%albedo_type(ind_wat_win,m)   = INT( building_pars(ind_alb_win_r,building_type)   )
+
+           surf_usm_h%zw(nzb_wall,m)         = building_pars(ind_thick_1_wall_r,building_type)
+           surf_usm_h%zw(nzb_wall+1,m)       = building_pars(ind_thick_2_wall_r,building_type)
+           surf_usm_h%zw(nzb_wall+2,m)       = building_pars(ind_thick_3_wall_r,building_type)
+           surf_usm_h%zw(nzb_wall+3,m)       = building_pars(ind_thick_4_wall_r,building_type)
            
-           surf_usm_h%zw_green(nzb_wall,m)         = building_pars(ind_thick_1,building_type)
-           surf_usm_h%zw_green(nzb_wall+1,m)       = building_pars(ind_thick_2,building_type)
-           surf_usm_h%zw_green(nzb_wall+2,m)       = building_pars(ind_thick_3,building_type)
-           surf_usm_h%zw_green(nzb_wall+3,m)       = building_pars(ind_thick_4,building_type)
+           surf_usm_h%zw_green(nzb_wall,m)         = building_pars(ind_thick_1_wall_r,building_type)
+           surf_usm_h%zw_green(nzb_wall+1,m)       = building_pars(ind_thick_2_wall_r,building_type)
+           surf_usm_h%zw_green(nzb_wall+2,m)       = building_pars(ind_thick_3_wall_r,building_type)
+           surf_usm_h%zw_green(nzb_wall+3,m)       = building_pars(ind_thick_4_wall_r,building_type)
            
-           surf_usm_h%zw_window(nzb_wall,m)         = building_pars(ind_thick_1,building_type)
-           surf_usm_h%zw_window(nzb_wall+1,m)       = building_pars(ind_thick_2,building_type)
-           surf_usm_h%zw_window(nzb_wall+2,m)       = building_pars(ind_thick_3,building_type)
-           surf_usm_h%zw_window(nzb_wall+3,m)       = building_pars(ind_thick_4,building_type)
-
-           surf_usm_h%c_surface(m)           = building_pars(45,building_type)  
-           surf_usm_h%lambda_surf(m)         = building_pars(46,building_type)  
-           surf_usm_h%c_surface_green(m)     = building_pars(45,building_type)  
-           surf_usm_h%lambda_surf_green(m)   = building_pars(46,building_type)  
-           surf_usm_h%c_surface_window(m)    = building_pars(45,building_type)  
-           surf_usm_h%lambda_surf_window(m)  = building_pars(46,building_type)  
+           surf_usm_h%zw_window(nzb_wall,m)         = building_pars(ind_thick_1_win_r,building_type)
+           surf_usm_h%zw_window(nzb_wall+1,m)       = building_pars(ind_thick_2_win_r,building_type)
+           surf_usm_h%zw_window(nzb_wall+2,m)       = building_pars(ind_thick_3_win_r,building_type)
+           surf_usm_h%zw_window(nzb_wall+3,m)       = building_pars(ind_thick_4_win_r,building_type)
+
+           surf_usm_h%c_surface(m)           = building_pars(0,building_type)  
+           surf_usm_h%lambda_surf(m)         = building_pars(3,building_type)  
+           surf_usm_h%c_surface_green(m)     = building_pars(2,building_type)  
+           surf_usm_h%lambda_surf_green(m)   = building_pars(5,building_type)  
+           surf_usm_h%c_surface_window(m)    = building_pars(1,building_type)  
+           surf_usm_h%lambda_surf_window(m)  = building_pars(4,building_type)  
+           
+           surf_usm_h%green_type_roof(m)     = building_pars(ind_green_type_roof,building_type)
 
         ENDDO
@@ -4082,5 +5080,11 @@
 !
 !--           In order to distinguish between ground floor level and 
-!--           above-ground-floor level surfaces, set input indices. 
+!--           above-ground-floor level surfaces, set input indices.
+              ind_alb_green    = MERGE( ind_alb_green_gfl,    ind_alb_green_agfl,    &
+                                        surf_usm_v(l)%ground_level(m) )
+              ind_alb_wall     = MERGE( ind_alb_wall_gfl,     ind_alb_wall_agfl,     &
+                                        surf_usm_v(l)%ground_level(m) )
+              ind_alb_win      = MERGE( ind_alb_win_gfl,      ind_alb_win_agfl,      &
+                                        surf_usm_v(l)%ground_level(m) )
               ind_wall_frac    = MERGE( ind_wall_frac_gfl,    ind_wall_frac_agfl,    &
                                         surf_usm_v(l)%ground_level(m) )
@@ -4097,13 +5101,41 @@
               ind_hc1          = MERGE( ind_hc1_gfl,          ind_hc1_agfl,          &
                                         surf_usm_v(l)%ground_level(m) )
+              ind_hc1_win      = MERGE( ind_hc1_win_gfl,      ind_hc1_win_agfl,      &
+                                        surf_usm_v(l)%ground_level(m) )
               ind_hc2          = MERGE( ind_hc2_gfl,          ind_hc2_agfl,          &
+                                        surf_usm_v(l)%ground_level(m) )
+              ind_hc2_win      = MERGE( ind_hc2_win_gfl,      ind_hc2_win_agfl,      &
                                         surf_usm_v(l)%ground_level(m) )
               ind_hc3          = MERGE( ind_hc3_gfl,          ind_hc3_agfl,          &
                                         surf_usm_v(l)%ground_level(m) )
+              ind_hc3_win      = MERGE( ind_hc3_win_gfl,      ind_hc3_win_agfl,      &
+                                        surf_usm_v(l)%ground_level(m) )
               ind_tc1          = MERGE( ind_tc1_gfl,          ind_tc1_agfl,          &
+                                        surf_usm_v(l)%ground_level(m) )
+              ind_tc1_win      = MERGE( ind_tc1_win_gfl,      ind_tc1_win_agfl,      &
                                         surf_usm_v(l)%ground_level(m) )
               ind_tc2          = MERGE( ind_tc2_gfl,          ind_tc2_agfl,          &
                                         surf_usm_v(l)%ground_level(m) )
+              ind_tc2_win      = MERGE( ind_tc2_win_gfl,      ind_tc2_win_agfl,      &
+                                        surf_usm_v(l)%ground_level(m) )
               ind_tc3          = MERGE( ind_tc3_gfl,          ind_tc3_agfl,          &
+                                        surf_usm_v(l)%ground_level(m) )
+              ind_tc3_win      = MERGE( ind_tc3_win_gfl,      ind_tc3_win_agfl,      &
+                                        surf_usm_v(l)%ground_level(m) )
+              ind_thick_1      = MERGE( ind_thick_1_gfl,      ind_thick_1_agfl,      &
+                                        surf_usm_v(l)%ground_level(m) )
+              ind_thick_1_win  = MERGE( ind_thick_1_win_gfl,  ind_thick_1_win_agfl,  &
+                                        surf_usm_v(l)%ground_level(m) )
+              ind_thick_2      = MERGE( ind_thick_2_gfl,      ind_thick_2_agfl,      &
+                                        surf_usm_v(l)%ground_level(m) )
+              ind_thick_2_win  = MERGE( ind_thick_2_win_gfl,  ind_thick_2_win_agfl,  &
+                                        surf_usm_v(l)%ground_level(m) )
+              ind_thick_3      = MERGE( ind_thick_3_gfl,      ind_thick_3_agfl,      &
+                                        surf_usm_v(l)%ground_level(m) )
+              ind_thick_3_win  = MERGE( ind_thick_3_win_gfl,  ind_thick_3_win_agfl,  &
+                                        surf_usm_v(l)%ground_level(m) )
+              ind_thick_4      = MERGE( ind_thick_4_gfl,      ind_thick_4_agfl,      &
+                                        surf_usm_v(l)%ground_level(m) )
+              ind_thick_4_win  = MERGE( ind_thick_4_win_gfl,  ind_thick_4_win_agfl,  &
                                         surf_usm_v(l)%ground_level(m) )
               ind_emis_wall    = MERGE( ind_emis_wall_gfl,    ind_emis_wall_agfl,    &
@@ -4135,13 +5167,13 @@
               surf_usm_v(l)%rho_c_wall(nzb_wall+3,m) = building_pars(ind_hc3,building_type)    
               
-              surf_usm_v(l)%rho_c_green(nzb_wall,m)   = building_pars(ind_hc1,building_type)  
-              surf_usm_v(l)%rho_c_green(nzb_wall+1,m) = building_pars(ind_hc1,building_type)
-              surf_usm_v(l)%rho_c_green(nzb_wall+2,m) = building_pars(ind_hc2,building_type)
-              surf_usm_v(l)%rho_c_green(nzb_wall+3,m) = building_pars(ind_hc3,building_type)    
+              surf_usm_v(l)%rho_c_green(nzb_wall,m)   = rho_c_soil !building_pars(ind_hc1,building_type)  
+              surf_usm_v(l)%rho_c_green(nzb_wall+1,m) = rho_c_soil !building_pars(ind_hc1,building_type)
+              surf_usm_v(l)%rho_c_green(nzb_wall+2,m) = rho_c_soil !building_pars(ind_hc2,building_type)
+              surf_usm_v(l)%rho_c_green(nzb_wall+3,m) = rho_c_soil !building_pars(ind_hc3,building_type)    
               
-              surf_usm_v(l)%rho_c_window(nzb_wall,m)   = building_pars(ind_hc1,building_type)  
-              surf_usm_v(l)%rho_c_window(nzb_wall+1,m) = building_pars(ind_hc1,building_type)
-              surf_usm_v(l)%rho_c_window(nzb_wall+2,m) = building_pars(ind_hc2,building_type)
-              surf_usm_v(l)%rho_c_window(nzb_wall+3,m) = building_pars(ind_hc3,building_type)    
+              surf_usm_v(l)%rho_c_window(nzb_wall,m)   = building_pars(ind_hc1_win,building_type)  
+              surf_usm_v(l)%rho_c_window(nzb_wall+1,m) = building_pars(ind_hc1_win,building_type)
+              surf_usm_v(l)%rho_c_window(nzb_wall+2,m) = building_pars(ind_hc2_win,building_type)
+              surf_usm_v(l)%rho_c_window(nzb_wall+3,m) = building_pars(ind_hc3_win,building_type)    
 
               surf_usm_v(l)%lambda_h(nzb_wall,m)   = building_pars(ind_tc1,building_type)  
@@ -4150,16 +5182,16 @@
               surf_usm_v(l)%lambda_h(nzb_wall+3,m) = building_pars(ind_tc3,building_type)    
               
-              surf_usm_v(l)%lambda_h_green(nzb_wall,m)   = building_pars(ind_tc1,building_type)  
-              surf_usm_v(l)%lambda_h_green(nzb_wall+1,m) = building_pars(ind_tc1,building_type) 
-              surf_usm_v(l)%lambda_h_green(nzb_wall+2,m) = building_pars(ind_tc2,building_type)
-              surf_usm_v(l)%lambda_h_green(nzb_wall+3,m) = building_pars(ind_tc3,building_type)    
-
-              surf_usm_v(l)%lambda_h_window(nzb_wall,m)   = building_pars(ind_tc1,building_type)  
-              surf_usm_v(l)%lambda_h_window(nzb_wall+1,m) = building_pars(ind_tc1,building_type) 
-              surf_usm_v(l)%lambda_h_window(nzb_wall+2,m) = building_pars(ind_tc2,building_type)
-              surf_usm_v(l)%lambda_h_window(nzb_wall+3,m) = building_pars(ind_tc3,building_type)    
-
-              surf_usm_v(l)%target_temp_summer(m)  = building_pars(12,building_type)    
-              surf_usm_v(l)%target_temp_winter(m)  = building_pars(13,building_type)    
+              surf_usm_v(l)%lambda_h_green(nzb_wall,m)   = lambda_h_green_sm !building_pars(ind_tc1,building_type)  
+              surf_usm_v(l)%lambda_h_green(nzb_wall+1,m) = lambda_h_green_sm !building_pars(ind_tc1,building_type) 
+              surf_usm_v(l)%lambda_h_green(nzb_wall+2,m) = lambda_h_green_sm !building_pars(ind_tc2,building_type)
+              surf_usm_v(l)%lambda_h_green(nzb_wall+3,m) = lambda_h_green_sm !building_pars(ind_tc3,building_type)    
+
+              surf_usm_v(l)%lambda_h_window(nzb_wall,m)   = building_pars(ind_tc1_win,building_type)  
+              surf_usm_v(l)%lambda_h_window(nzb_wall+1,m) = building_pars(ind_tc1_win,building_type) 
+              surf_usm_v(l)%lambda_h_window(nzb_wall+2,m) = building_pars(ind_tc2_win,building_type)
+              surf_usm_v(l)%lambda_h_window(nzb_wall+3,m) = building_pars(ind_tc3_win,building_type)    
+
+              surf_usm_v(l)%target_temp_summer(m)  = building_pars(117,building_type)    
+              surf_usm_v(l)%target_temp_winter(m)  = building_pars(118,building_type)    
 !
 !--           emissivity of wall-, green- and window fraction 
@@ -4188,15 +5220,15 @@
               surf_usm_v(l)%zw_green(nzb_wall+3,m)       = building_pars(ind_thick_4,building_type)
 
-              surf_usm_v(l)%zw_window(nzb_wall,m)         = building_pars(ind_thick_1,building_type)
-              surf_usm_v(l)%zw_window(nzb_wall+1,m)       = building_pars(ind_thick_2,building_type)
-              surf_usm_v(l)%zw_window(nzb_wall+2,m)       = building_pars(ind_thick_3,building_type)
-              surf_usm_v(l)%zw_window(nzb_wall+3,m)       = building_pars(ind_thick_4,building_type)
-
-              surf_usm_v(l)%c_surface(m)           = building_pars(45,building_type)  
-              surf_usm_v(l)%lambda_surf(m)         = building_pars(46,building_type)
-              surf_usm_v(l)%c_surface_green(m)     = building_pars(45,building_type)  
-              surf_usm_v(l)%lambda_surf_green(m)   = building_pars(46,building_type)
-              surf_usm_v(l)%c_surface_window(m)    = building_pars(45,building_type)  
-              surf_usm_v(l)%lambda_surf_window(m)  = building_pars(46,building_type)
+              surf_usm_v(l)%zw_window(nzb_wall,m)         = building_pars(ind_thick_1_win,building_type)
+              surf_usm_v(l)%zw_window(nzb_wall+1,m)       = building_pars(ind_thick_2_win,building_type)
+              surf_usm_v(l)%zw_window(nzb_wall+2,m)       = building_pars(ind_thick_3_win,building_type)
+              surf_usm_v(l)%zw_window(nzb_wall+3,m)       = building_pars(ind_thick_4_win,building_type)
+
+              surf_usm_v(l)%c_surface(m)           = building_pars(0,building_type)  
+              surf_usm_v(l)%lambda_surf(m)         = building_pars(3,building_type)
+              surf_usm_v(l)%c_surface_green(m)     = building_pars(2,building_type)  
+              surf_usm_v(l)%lambda_surf_green(m)   = building_pars(5,building_type)
+              surf_usm_v(l)%c_surface_window(m)    = building_pars(1,building_type)  
+              surf_usm_v(l)%lambda_surf_window(m)  = building_pars(4,building_type)
 
            ENDDO
@@ -4215,36 +5247,9 @@
 !
 !--              In order to distinguish between ground floor level and 
-!--              above-ground-floor level surfaces, set input indices. 
-                 ind_wall_frac    = MERGE( ind_wall_frac_gfl,    ind_wall_frac_agfl,    &
-                                           surf_usm_h%ground_level(m) )
-                 ind_win_frac     = MERGE( ind_win_frac_gfl,     ind_win_frac_agfl,     &
-                                           surf_usm_h%ground_level(m) )
-                 ind_green_frac_w = MERGE( ind_green_frac_w_gfl, ind_green_frac_w_agfl, &
-                                           surf_usm_h%ground_level(m) )
+!--              above-ground-floor level surfaces, set input indices.
+
                  ind_green_frac_r = MERGE( ind_green_frac_r_gfl, ind_green_frac_r_agfl, &
                                            surf_usm_h%ground_level(m) )
                  ind_lai_r        = MERGE( ind_lai_r_gfl,        ind_lai_r_agfl,        &
-                                           surf_usm_h%ground_level(m) )
-                 ind_lai_w        = MERGE( ind_lai_w_gfl,        ind_lai_w_agfl,        &
-                                           surf_usm_h%ground_level(m) )
-                 ind_hc1          = MERGE( ind_hc1_gfl,          ind_hc1_agfl,          &
-                                           surf_usm_h%ground_level(m) )
-                 ind_hc2          = MERGE( ind_hc2_gfl,          ind_hc2_agfl,          &
-                                           surf_usm_h%ground_level(m) )
-                 ind_hc3          = MERGE( ind_hc3_gfl,          ind_hc3_agfl,          &
-                                           surf_usm_h%ground_level(m) )
-                 ind_tc1          = MERGE( ind_tc1_gfl,          ind_tc1_agfl,          &
-                                           surf_usm_h%ground_level(m) )
-                 ind_tc2          = MERGE( ind_tc2_gfl,          ind_tc2_agfl,          &
-                                           surf_usm_h%ground_level(m) )
-                 ind_tc3          = MERGE( ind_tc3_gfl,          ind_tc3_agfl,          &
-                                           surf_usm_h%ground_level(m) )
-                 ind_emis_wall    = MERGE( ind_emis_wall_gfl,    ind_emis_wall_agfl,    &
-                                           surf_usm_h%ground_level(m) )
-                 ind_emis_green   = MERGE( ind_emis_green_gfl,   ind_emis_green_agfl,   &
-                                           surf_usm_h%ground_level(m) )
-                 ind_emis_win     = MERGE( ind_emis_win_gfl,     ind_emis_win_agfl,     &
-                                           surf_usm_h%ground_level(m) )
-                 ind_trans        = MERGE( ind_trans_gfl,        ind_trans_agfl,        &
                                            surf_usm_h%ground_level(m) )
                  ind_z0           = MERGE( ind_z0_gfl,           ind_z0_agfl,           &
@@ -4258,45 +5263,45 @@
 !
 !--              Initialize relatvie wall- (0), green- (1) and window (2) fractions
-                 surf_usm_h%frac(ind_veg_wall,m)  = building_pars(ind_wall_frac,st)   
+                 surf_usm_h%frac(ind_veg_wall,m)  = building_pars(ind_wall_frac_r,st)   
                  surf_usm_h%frac(ind_pav_green,m) = building_pars(ind_green_frac_r,st)  
-                 surf_usm_h%frac(ind_wat_win,m)   = building_pars(ind_win_frac,st)  
-                 surf_usm_h%lai(m)                = building_pars(ind_green_frac_r,st)  
-
-                 surf_usm_h%rho_c_wall(nzb_wall,m)   = building_pars(ind_hc1,st)  
-                 surf_usm_h%rho_c_wall(nzb_wall+1,m) = building_pars(ind_hc1,st)
-                 surf_usm_h%rho_c_wall(nzb_wall+2,m) = building_pars(ind_hc2,st)
-                 surf_usm_h%rho_c_wall(nzb_wall+3,m) = building_pars(ind_hc3,st)    
-                 surf_usm_h%lambda_h(nzb_wall,m)   = building_pars(ind_tc1,st)  
-                 surf_usm_h%lambda_h(nzb_wall+1,m) = building_pars(ind_tc1,st) 
-                 surf_usm_h%lambda_h(nzb_wall+2,m) = building_pars(ind_tc2,st)
-                 surf_usm_h%lambda_h(nzb_wall+3,m) = building_pars(ind_tc3,st)    
+                 surf_usm_h%frac(ind_wat_win,m)   = building_pars(ind_win_frac_r,st)  
+                 surf_usm_h%lai(m)                = building_pars(ind_lai_r,st)  
+
+                 surf_usm_h%rho_c_wall(nzb_wall,m)   = building_pars(ind_hc1_wall_r,st)  
+                 surf_usm_h%rho_c_wall(nzb_wall+1,m) = building_pars(ind_hc1_wall_r,st)
+                 surf_usm_h%rho_c_wall(nzb_wall+2,m) = building_pars(ind_hc2_wall_r,st)
+                 surf_usm_h%rho_c_wall(nzb_wall+3,m) = building_pars(ind_hc3_wall_r,st)    
+                 surf_usm_h%lambda_h(nzb_wall,m)   = building_pars(ind_tc1_wall_r,st)  
+                 surf_usm_h%lambda_h(nzb_wall+1,m) = building_pars(ind_tc1_wall_r,st) 
+                 surf_usm_h%lambda_h(nzb_wall+2,m) = building_pars(ind_tc2_wall_r,st)
+                 surf_usm_h%lambda_h(nzb_wall+3,m) = building_pars(ind_tc3_wall_r,st)    
                  
-                 surf_usm_h%rho_c_green(nzb_wall,m)   = building_pars(ind_hc1,st)  
-                 surf_usm_h%rho_c_green(nzb_wall+1,m) = building_pars(ind_hc1,st)
-                 surf_usm_h%rho_c_green(nzb_wall+2,m) = building_pars(ind_hc2,st)
-                 surf_usm_h%rho_c_green(nzb_wall+3,m) = building_pars(ind_hc3,st)    
-                 surf_usm_h%lambda_h_green(nzb_wall,m)   = building_pars(ind_tc1,st)  
-                 surf_usm_h%lambda_h_green(nzb_wall+1,m) = building_pars(ind_tc1,st) 
-                 surf_usm_h%lambda_h_green(nzb_wall+2,m) = building_pars(ind_tc2,st)
-                 surf_usm_h%lambda_h_green(nzb_wall+3,m) = building_pars(ind_tc3,st)    
+                 surf_usm_h%rho_c_green(nzb_wall,m)   = rho_c_soil !building_pars(ind_hc1_wall_r,st)  
+                 surf_usm_h%rho_c_green(nzb_wall+1,m) = rho_c_soil !building_pars(ind_hc1_wall_r,st)
+                 surf_usm_h%rho_c_green(nzb_wall+2,m) = rho_c_soil !building_pars(ind_hc2_wall_r,st)
+                 surf_usm_h%rho_c_green(nzb_wall+3,m) = rho_c_soil !building_pars(ind_hc3_wall_r,st)    
+                 surf_usm_h%lambda_h_green(nzb_wall,m)   = lambda_h_green_sm !building_pars(ind_tc1_wall_r,st)  
+                 surf_usm_h%lambda_h_green(nzb_wall+1,m) = lambda_h_green_sm !building_pars(ind_tc1_wall_r,st) 
+                 surf_usm_h%lambda_h_green(nzb_wall+2,m) = lambda_h_green_sm !building_pars(ind_tc2_wall_r,st)
+                 surf_usm_h%lambda_h_green(nzb_wall+3,m) = lambda_h_green_sm !building_pars(ind_tc3_wall_r,st)    
                 
-                 surf_usm_h%rho_c_window(nzb_wall,m)   = building_pars(ind_hc1,st)  
-                 surf_usm_h%rho_c_window(nzb_wall+1,m) = building_pars(ind_hc1,st)
-                 surf_usm_h%rho_c_window(nzb_wall+2,m) = building_pars(ind_hc2,st)
-                 surf_usm_h%rho_c_window(nzb_wall+3,m) = building_pars(ind_hc3,st)    
-                 surf_usm_h%lambda_h_window(nzb_wall,m)   = building_pars(ind_tc1,st)  
-                 surf_usm_h%lambda_h_window(nzb_wall+1,m) = building_pars(ind_tc1,st) 
-                 surf_usm_h%lambda_h_window(nzb_wall+2,m) = building_pars(ind_tc2,st)
-                 surf_usm_h%lambda_h_window(nzb_wall+3,m) = building_pars(ind_tc3,st)    
-
-                 surf_usm_h%target_temp_summer(m)  = building_pars(12,st)    
-                 surf_usm_h%target_temp_winter(m)  = building_pars(13,st)    
+                 surf_usm_h%rho_c_window(nzb_wall,m)   = building_pars(ind_hc1_win_r,st)  
+                 surf_usm_h%rho_c_window(nzb_wall+1,m) = building_pars(ind_hc1_win_r,st)
+                 surf_usm_h%rho_c_window(nzb_wall+2,m) = building_pars(ind_hc2_win_r,st)
+                 surf_usm_h%rho_c_window(nzb_wall+3,m) = building_pars(ind_hc3_win_r,st)    
+                 surf_usm_h%lambda_h_window(nzb_wall,m)   = building_pars(ind_tc1_win_r,st)  
+                 surf_usm_h%lambda_h_window(nzb_wall+1,m) = building_pars(ind_tc1_win_r,st) 
+                 surf_usm_h%lambda_h_window(nzb_wall+2,m) = building_pars(ind_tc2_win_r,st)
+                 surf_usm_h%lambda_h_window(nzb_wall+3,m) = building_pars(ind_tc3_win_r,st)    
+
+                 surf_usm_h%target_temp_summer(m)  = building_pars(117,st)    
+                 surf_usm_h%target_temp_winter(m)  = building_pars(118,st)    
 !
 !--              emissivity of wall-, green- and window fraction 
-                 surf_usm_h%emissivity(ind_veg_wall,m)  = building_pars(ind_emis_wall,st)
-                 surf_usm_h%emissivity(ind_pav_green,m) = building_pars(ind_emis_green,st)
-                 surf_usm_h%emissivity(ind_wat_win,m)   = building_pars(ind_emis_win,st)
-
-                 surf_usm_h%transmissivity(m)      = building_pars(ind_trans,st)
+                 surf_usm_h%emissivity(ind_veg_wall,m)  = building_pars(ind_emis_wall_r,st)
+                 surf_usm_h%emissivity(ind_pav_green,m) = building_pars(ind_emis_green_r,st)
+                 surf_usm_h%emissivity(ind_wat_win,m)   = building_pars(ind_emis_win_r,st)
+
+                 surf_usm_h%transmissivity(m)      = building_pars(ind_trans_r,st)
 
                  surf_usm_h%z0(m)                  = building_pars(ind_z0,st)
@@ -4305,29 +5310,31 @@
 !
 !--              albedo type for wall fraction, green fraction, window fraction
-                 surf_usm_h%albedo_type(ind_veg_wall,m)  = INT( building_pars(ind_alb_wall,st) )
-                 surf_usm_h%albedo_type(ind_pav_green,m) = INT( building_pars(ind_alb_green,st) )
-                 surf_usm_h%albedo_type(ind_wat_win,m)   = INT( building_pars(ind_alb_win,st) )
-
-                 surf_usm_h%zw(nzb_wall,m)         = building_pars(ind_thick_1,st)
-                 surf_usm_h%zw(nzb_wall+1,m)       = building_pars(ind_thick_2,st)
-                 surf_usm_h%zw(nzb_wall+2,m)       = building_pars(ind_thick_3,st)
-                 surf_usm_h%zw(nzb_wall+3,m)       = building_pars(ind_thick_4,st)
+                 surf_usm_h%albedo_type(ind_veg_wall,m)  = INT( building_pars(ind_alb_wall_r,st) )
+                 surf_usm_h%albedo_type(ind_pav_green,m) = INT( building_pars(ind_alb_green_r,st) )
+                 surf_usm_h%albedo_type(ind_wat_win,m)   = INT( building_pars(ind_alb_win_r,st) )
+
+                 surf_usm_h%zw(nzb_wall,m)         = building_pars(ind_thick_1_wall_r,st)
+                 surf_usm_h%zw(nzb_wall+1,m)       = building_pars(ind_thick_2_wall_r,st)
+                 surf_usm_h%zw(nzb_wall+2,m)       = building_pars(ind_thick_3_wall_r,st)
+                 surf_usm_h%zw(nzb_wall+3,m)       = building_pars(ind_thick_4_wall_r,st)
                  
-                 surf_usm_h%zw_green(nzb_wall,m)         = building_pars(ind_thick_1,st)
-                 surf_usm_h%zw_green(nzb_wall+1,m)       = building_pars(ind_thick_2,st)
-                 surf_usm_h%zw_green(nzb_wall+2,m)       = building_pars(ind_thick_3,st)
-                 surf_usm_h%zw_green(nzb_wall+3,m)       = building_pars(ind_thick_4,st)
-
-                 surf_usm_h%zw_window(nzb_wall,m)         = building_pars(ind_thick_1,st)
-                 surf_usm_h%zw_window(nzb_wall+1,m)       = building_pars(ind_thick_2,st)
-                 surf_usm_h%zw_window(nzb_wall+2,m)       = building_pars(ind_thick_3,st)
-                 surf_usm_h%zw_window(nzb_wall+3,m)       = building_pars(ind_thick_4,st)
-
-                 surf_usm_h%c_surface(m)           = building_pars(45,st)  
-                 surf_usm_h%lambda_surf(m)         = building_pars(46,st)
-                 surf_usm_h%c_surface_green(m)     = building_pars(45,st)  
-                 surf_usm_h%lambda_surf_green(m)   = building_pars(46,st)
-                 surf_usm_h%c_surface_window(m)    = building_pars(45,st)  
-                 surf_usm_h%lambda_surf_window(m)  = building_pars(46,st)
+                 surf_usm_h%zw_green(nzb_wall,m)         = building_pars(ind_thick_1_wall_r,st)
+                 surf_usm_h%zw_green(nzb_wall+1,m)       = building_pars(ind_thick_2_wall_r,st)
+                 surf_usm_h%zw_green(nzb_wall+2,m)       = building_pars(ind_thick_3_wall_r,st)
+                 surf_usm_h%zw_green(nzb_wall+3,m)       = building_pars(ind_thick_4_wall_r,st)
+
+                 surf_usm_h%zw_window(nzb_wall,m)         = building_pars(ind_thick_1_win_r,st)
+                 surf_usm_h%zw_window(nzb_wall+1,m)       = building_pars(ind_thick_2_win_r,st)
+                 surf_usm_h%zw_window(nzb_wall+2,m)       = building_pars(ind_thick_3_win_r,st)
+                 surf_usm_h%zw_window(nzb_wall+3,m)       = building_pars(ind_thick_4_win_r,st)
+
+                 surf_usm_h%c_surface(m)           = building_pars(0,st)  
+                 surf_usm_h%lambda_surf(m)         = building_pars(3,st)
+                 surf_usm_h%c_surface_green(m)     = building_pars(2,st)  
+                 surf_usm_h%lambda_surf_green(m)   = building_pars(5,st)
+                 surf_usm_h%c_surface_window(m)    = building_pars(1,st)  
+                 surf_usm_h%lambda_surf_window(m)  = building_pars(4,st)
+                 
+                 surf_usm_h%green_type_roof(m)     = building_pars(ind_green_type_roof,st)
 
               ENDIF
@@ -4346,5 +5353,11 @@
 !
 !--                 In order to distinguish between ground floor level and 
-!--                 above-ground-floor level surfaces, set input indices. 
+!--                 above-ground-floor level surfaces, set input indices.
+                    ind_alb_green    = MERGE( ind_alb_green_gfl,    ind_alb_green_agfl,    &
+                                              surf_usm_v(l)%ground_level(m) )
+                    ind_alb_wall     = MERGE( ind_alb_wall_gfl,     ind_alb_wall_agfl,     &
+                                              surf_usm_v(l)%ground_level(m) )
+                    ind_alb_win      = MERGE( ind_alb_win_gfl,      ind_alb_win_agfl,      &
+                                              surf_usm_v(l)%ground_level(m) )
                     ind_wall_frac    = MERGE( ind_wall_frac_gfl,    ind_wall_frac_agfl,    &
                                               surf_usm_v(l)%ground_level(m) )
@@ -4361,13 +5374,41 @@
                     ind_hc1          = MERGE( ind_hc1_gfl,          ind_hc1_agfl,          &
                                               surf_usm_v(l)%ground_level(m) )
+                    ind_hc1_win      = MERGE( ind_hc1_win_gfl,      ind_hc1_win_agfl,      &
+                                              surf_usm_v(l)%ground_level(m) )
                     ind_hc2          = MERGE( ind_hc2_gfl,          ind_hc2_agfl,          &
+                                              surf_usm_v(l)%ground_level(m) )
+                    ind_hc2_win      = MERGE( ind_hc2_win_gfl,      ind_hc2_win_agfl,      &
                                               surf_usm_v(l)%ground_level(m) )
                     ind_hc3          = MERGE( ind_hc3_gfl,          ind_hc3_agfl,          &
                                               surf_usm_v(l)%ground_level(m) )
+                    ind_hc3_win      = MERGE( ind_hc3_win_gfl,      ind_hc3_win_agfl,      &
+                                              surf_usm_v(l)%ground_level(m) )
                     ind_tc1          = MERGE( ind_tc1_gfl,          ind_tc1_agfl,          &
+                                              surf_usm_v(l)%ground_level(m) )
+                    ind_tc1_win      = MERGE( ind_tc1_win_gfl,      ind_tc1_win_agfl,      &
                                               surf_usm_v(l)%ground_level(m) )
                     ind_tc2          = MERGE( ind_tc2_gfl,          ind_tc2_agfl,          &
                                               surf_usm_v(l)%ground_level(m) )
+                    ind_tc2_win      = MERGE( ind_tc2_win_gfl,      ind_tc2_win_agfl,      &
+                                              surf_usm_v(l)%ground_level(m) )
                     ind_tc3          = MERGE( ind_tc3_gfl,          ind_tc3_agfl,          &
+                                              surf_usm_v(l)%ground_level(m) )
+                    ind_tc3_win      = MERGE( ind_tc3_win_gfl,      ind_tc3_win_agfl,      &
+                                              surf_usm_v(l)%ground_level(m) )
+                    ind_thick_1      = MERGE( ind_thick_1_gfl,      ind_thick_1_agfl,      &
+                                              surf_usm_v(l)%ground_level(m) )
+                    ind_thick_1_win  = MERGE( ind_thick_1_win_gfl,  ind_thick_1_win_agfl,  &
+                                              surf_usm_v(l)%ground_level(m) )
+                    ind_thick_2      = MERGE( ind_thick_2_gfl,      ind_thick_2_agfl,      &
+                                              surf_usm_v(l)%ground_level(m) )
+                    ind_thick_2_win  = MERGE( ind_thick_2_win_gfl,  ind_thick_2_win_agfl,  &
+                                              surf_usm_v(l)%ground_level(m) )
+                    ind_thick_3      = MERGE( ind_thick_3_gfl,      ind_thick_3_agfl,      &
+                                              surf_usm_v(l)%ground_level(m) )
+                    ind_thick_3_win  = MERGE( ind_thick_3_win_gfl,  ind_thick_3_win_agfl,  &
+                                              surf_usm_v(l)%ground_level(m) )
+                    ind_thick_4      = MERGE( ind_thick_4_gfl,      ind_thick_4_agfl,      &
+                                              surf_usm_v(l)%ground_level(m) )
+                    ind_thick_4_win  = MERGE( ind_thick_4_win_gfl,  ind_thick_4_win_agfl,  &
                                               surf_usm_v(l)%ground_level(m) )
                     ind_emis_wall    = MERGE( ind_emis_wall_gfl,    ind_emis_wall_agfl,    &
@@ -4378,5 +5419,5 @@
                                               surf_usm_v(l)%ground_level(m) )
                     ind_trans        = MERGE( ind_trans_gfl,       ind_trans_agfl,         &
-                                        surf_usm_v(l)%ground_level(m) )
+                                            surf_usm_v(l)%ground_level(m) )
                     ind_z0           = MERGE( ind_z0_gfl,           ind_z0_agfl,           &
                                               surf_usm_v(l)%ground_level(m) )
@@ -4399,13 +5440,13 @@
                     surf_usm_v(l)%rho_c_wall(nzb_wall+3,m) = building_pars(ind_hc3,st)
                     
-                    surf_usm_v(l)%rho_c_green(nzb_wall,m)   = building_pars(ind_hc1,st)  
-                    surf_usm_v(l)%rho_c_green(nzb_wall+1,m) = building_pars(ind_hc1,st)
-                    surf_usm_v(l)%rho_c_green(nzb_wall+2,m) = building_pars(ind_hc2,st)
-                    surf_usm_v(l)%rho_c_green(nzb_wall+3,m) = building_pars(ind_hc3,st)
+                    surf_usm_v(l)%rho_c_green(nzb_wall,m)   = rho_c_soil !building_pars(ind_hc1,st)  
+                    surf_usm_v(l)%rho_c_green(nzb_wall+1,m) = rho_c_soil !building_pars(ind_hc1,st)
+                    surf_usm_v(l)%rho_c_green(nzb_wall+2,m) = rho_c_soil !building_pars(ind_hc2,st)
+                    surf_usm_v(l)%rho_c_green(nzb_wall+3,m) = rho_c_soil !building_pars(ind_hc3,st)
                     
-                    surf_usm_v(l)%rho_c_window(nzb_wall,m)   = building_pars(ind_hc1,st)  
-                    surf_usm_v(l)%rho_c_window(nzb_wall+1,m) = building_pars(ind_hc1,st)
-                    surf_usm_v(l)%rho_c_window(nzb_wall+2,m) = building_pars(ind_hc2,st)
-                    surf_usm_v(l)%rho_c_window(nzb_wall+3,m) = building_pars(ind_hc3,st)
+                    surf_usm_v(l)%rho_c_window(nzb_wall,m)   = building_pars(ind_hc1_win,st)  
+                    surf_usm_v(l)%rho_c_window(nzb_wall+1,m) = building_pars(ind_hc1_win,st)
+                    surf_usm_v(l)%rho_c_window(nzb_wall+2,m) = building_pars(ind_hc2_win,st)
+                    surf_usm_v(l)%rho_c_window(nzb_wall+3,m) = building_pars(ind_hc3_win,st)
 
                     surf_usm_v(l)%lambda_h(nzb_wall,m)   = building_pars(ind_tc1,st)  
@@ -4414,16 +5455,16 @@
                     surf_usm_v(l)%lambda_h(nzb_wall+3,m) = building_pars(ind_tc3,st) 
                     
-                    surf_usm_v(l)%lambda_h_green(nzb_wall,m)   = building_pars(ind_tc1,st)  
-                    surf_usm_v(l)%lambda_h_green(nzb_wall+1,m) = building_pars(ind_tc1,st) 
-                    surf_usm_v(l)%lambda_h_green(nzb_wall+2,m) = building_pars(ind_tc2,st)
-                    surf_usm_v(l)%lambda_h_green(nzb_wall+3,m) = building_pars(ind_tc3,st) 
+                    surf_usm_v(l)%lambda_h_green(nzb_wall,m)   = lambda_h_green_sm !building_pars(ind_tc1,st)  
+                    surf_usm_v(l)%lambda_h_green(nzb_wall+1,m) = lambda_h_green_sm !building_pars(ind_tc1,st) 
+                    surf_usm_v(l)%lambda_h_green(nzb_wall+2,m) = lambda_h_green_sm !building_pars(ind_tc2,st)
+                    surf_usm_v(l)%lambda_h_green(nzb_wall+3,m) = lambda_h_green_sm !building_pars(ind_tc3,st) 
                     
-                    surf_usm_v(l)%lambda_h_window(nzb_wall,m)   = building_pars(ind_tc1,st)  
-                    surf_usm_v(l)%lambda_h_window(nzb_wall+1,m) = building_pars(ind_tc1,st) 
-                    surf_usm_v(l)%lambda_h_window(nzb_wall+2,m) = building_pars(ind_tc2,st)
-                    surf_usm_v(l)%lambda_h_window(nzb_wall+3,m) = building_pars(ind_tc3,st) 
-
-                    surf_usm_v(l)%target_temp_summer(m)  = building_pars(12,st)    
-                    surf_usm_v(l)%target_temp_winter(m)  = building_pars(13,st)    
+                    surf_usm_v(l)%lambda_h_window(nzb_wall,m)   = building_pars(ind_tc1_win,st)  
+                    surf_usm_v(l)%lambda_h_window(nzb_wall+1,m) = building_pars(ind_tc1_win,st) 
+                    surf_usm_v(l)%lambda_h_window(nzb_wall+2,m) = building_pars(ind_tc2_win,st)
+                    surf_usm_v(l)%lambda_h_window(nzb_wall+3,m) = building_pars(ind_tc3_win,st) 
+
+                    surf_usm_v(l)%target_temp_summer(m)  = building_pars(117,st)    
+                    surf_usm_v(l)%target_temp_winter(m)  = building_pars(118,st)    
 !
 !--                 emissivity of wall-, green- and window fraction 
@@ -4452,15 +5493,15 @@
                     surf_usm_v(l)%zw_green(nzb_wall+3,m)       = building_pars(ind_thick_4,st)
                     
-                    surf_usm_v(l)%zw_window(nzb_wall,m)         = building_pars(ind_thick_1,st)
-                    surf_usm_v(l)%zw_window(nzb_wall+1,m)       = building_pars(ind_thick_2,st)
-                    surf_usm_v(l)%zw_window(nzb_wall+2,m)       = building_pars(ind_thick_3,st)
-                    surf_usm_v(l)%zw_window(nzb_wall+3,m)       = building_pars(ind_thick_4,st)
-
-                    surf_usm_v(l)%c_surface(m)           = building_pars(45,st)  
-                    surf_usm_v(l)%lambda_surf(m)         = building_pars(46,st) 
-                    surf_usm_v(l)%c_surface_green(m)     = building_pars(45,st)  
-                    surf_usm_v(l)%lambda_surf_green(m)   = building_pars(46,st) 
-                    surf_usm_v(l)%c_surface_window(m)    = building_pars(45,st)  
-                    surf_usm_v(l)%lambda_surf_window(m)  = building_pars(46,st) 
+                    surf_usm_v(l)%zw_window(nzb_wall,m)         = building_pars(ind_thick_1_win,st)
+                    surf_usm_v(l)%zw_window(nzb_wall+1,m)       = building_pars(ind_thick_2_win,st)
+                    surf_usm_v(l)%zw_window(nzb_wall+2,m)       = building_pars(ind_thick_3_win,st)
+                    surf_usm_v(l)%zw_window(nzb_wall+3,m)       = building_pars(ind_thick_4_win,st)
+
+                    surf_usm_v(l)%c_surface(m)           = building_pars(0,st)  
+                    surf_usm_v(l)%lambda_surf(m)         = building_pars(3,st) 
+                    surf_usm_v(l)%c_surface_green(m)     = building_pars(2,st)  
+                    surf_usm_v(l)%lambda_surf_green(m)   = building_pars(5,st) 
+                    surf_usm_v(l)%c_surface_window(m)    = building_pars(1,st)  
+                    surf_usm_v(l)%lambda_surf_window(m)  = building_pars(4,st) 
 
 
@@ -4479,36 +5520,8 @@
 !
 !--           In order to distinguish between ground floor level and 
-!--           above-ground-floor level surfaces, set input indices. 
-              ind_wall_frac    = MERGE( ind_wall_frac_gfl,    ind_wall_frac_agfl,    &
-                                        surf_usm_h%ground_level(m) )
-              ind_win_frac     = MERGE( ind_win_frac_gfl,     ind_win_frac_agfl,     &
-                                        surf_usm_h%ground_level(m) )
-              ind_green_frac_w = MERGE( ind_green_frac_w_gfl, ind_green_frac_w_agfl, &
-                                        surf_usm_h%ground_level(m) )
+!--           above-ground-floor level surfaces, set input indices.
               ind_green_frac_r = MERGE( ind_green_frac_r_gfl, ind_green_frac_r_agfl, &
                                         surf_usm_h%ground_level(m) )
               ind_lai_r        = MERGE( ind_lai_r_gfl,        ind_lai_r_agfl,        &
-                                        surf_usm_h%ground_level(m) )
-              ind_lai_w        = MERGE( ind_lai_w_gfl,        ind_lai_w_agfl,        &
-                                        surf_usm_h%ground_level(m) )
-              ind_hc1          = MERGE( ind_hc1_gfl,          ind_hc1_agfl,          &
-                                        surf_usm_h%ground_level(m) )
-              ind_hc2          = MERGE( ind_hc2_gfl,          ind_hc2_agfl,          &
-                                        surf_usm_h%ground_level(m) )
-              ind_hc3          = MERGE( ind_hc3_gfl,          ind_hc3_agfl,          &
-                                        surf_usm_h%ground_level(m) )
-              ind_tc1          = MERGE( ind_tc1_gfl,          ind_tc1_agfl,          &
-                                        surf_usm_h%ground_level(m) )
-              ind_tc2          = MERGE( ind_tc2_gfl,          ind_tc2_agfl,          &
-                                        surf_usm_h%ground_level(m) )
-              ind_tc3          = MERGE( ind_tc3_gfl,          ind_tc3_agfl,          &
-                                        surf_usm_h%ground_level(m) )
-              ind_emis_wall    = MERGE( ind_emis_wall_gfl,    ind_emis_wall_agfl,    &
-                                        surf_usm_h%ground_level(m) )
-              ind_emis_green   = MERGE( ind_emis_green_gfl,   ind_emis_green_agfl,   &
-                                        surf_usm_h%ground_level(m) )
-              ind_emis_win     = MERGE( ind_emis_win_gfl,     ind_emis_win_agfl,     &
-                                        surf_usm_h%ground_level(m) )
-              ind_trans        = MERGE( ind_trans_gfl,        ind_trans_agfl,        &
                                         surf_usm_h%ground_level(m) )
               ind_z0           = MERGE( ind_z0_gfl,           ind_z0_agfl,           &
@@ -4519,10 +5532,10 @@
 !
 !--           Initialize relatvie wall- (0), green- (1) and window (2) fractions
-              IF ( building_pars_f%pars_xy(ind_wall_frac,j,i) /= building_pars_f%fill )    &
-                 surf_usm_h%frac(ind_veg_wall,m)  = building_pars_f%pars_xy(ind_wall_frac,j,i)   
+              IF ( building_pars_f%pars_xy(ind_wall_frac_r,j,i) /= building_pars_f%fill )    &
+                 surf_usm_h%frac(ind_veg_wall,m)  = building_pars_f%pars_xy(ind_wall_frac_r,j,i)   
               IF ( building_pars_f%pars_xy(ind_green_frac_r,j,i) /= building_pars_f%fill ) & 
                  surf_usm_h%frac(ind_pav_green,m) = building_pars_f%pars_xy(ind_green_frac_r,j,i) 
-              IF ( building_pars_f%pars_xy(ind_win_frac,j,i) /= building_pars_f%fill )     & 
-                 surf_usm_h%frac(ind_wat_win,m)   = building_pars_f%pars_xy(ind_win_frac,j,i)
+              IF ( building_pars_f%pars_xy(ind_win_frac_r,j,i) /= building_pars_f%fill )     & 
+                 surf_usm_h%frac(ind_wat_win,m)   = building_pars_f%pars_xy(ind_win_frac_r,j,i)
 
  
@@ -4530,68 +5543,68 @@
                  surf_usm_h%lai(m)             = building_pars_f%pars_xy(ind_lai_r,j,i)
 
-              IF ( building_pars_f%pars_xy(ind_hc1,j,i) /= building_pars_f%fill )  THEN 
-                 surf_usm_h%rho_c_wall(nzb_wall,m)   = building_pars_f%pars_xy(ind_hc1,j,i)  
-                 surf_usm_h%rho_c_wall(nzb_wall+1,m) = building_pars_f%pars_xy(ind_hc1,j,i)
+              IF ( building_pars_f%pars_xy(ind_hc1_wall_r,j,i) /= building_pars_f%fill )  THEN 
+                 surf_usm_h%rho_c_wall(nzb_wall,m)   = building_pars_f%pars_xy(ind_hc1_wall_r,j,i)  
+                 surf_usm_h%rho_c_wall(nzb_wall+1,m) = building_pars_f%pars_xy(ind_hc1_wall_r,j,i)
               ENDIF
-              IF ( building_pars_f%pars_xy(ind_hc2,j,i) /= building_pars_f%fill )    &
-                 surf_usm_h%rho_c_wall(nzb_wall+2,m) = building_pars_f%pars_xy(ind_hc2,j,i)
-              IF ( building_pars_f%pars_xy(ind_hc3,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%rho_c_wall(nzb_wall+3,m) = building_pars_f%pars_xy(ind_hc3,j,i)
-              IF ( building_pars_f%pars_xy(ind_hc1,j,i) /= building_pars_f%fill )  THEN 
-                 surf_usm_h%rho_c_green(nzb_wall,m)   = building_pars_f%pars_xy(ind_hc1,j,i)  
-                 surf_usm_h%rho_c_green(nzb_wall+1,m) = building_pars_f%pars_xy(ind_hc1,j,i)
+              IF ( building_pars_f%pars_xy(ind_hc2_wall_r,j,i) /= building_pars_f%fill )    &
+                 surf_usm_h%rho_c_wall(nzb_wall+2,m) = building_pars_f%pars_xy(ind_hc2_wall_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_hc3_wall_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%rho_c_wall(nzb_wall+3,m) = building_pars_f%pars_xy(ind_hc3_wall_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_hc1_wall_r,j,i) /= building_pars_f%fill )  THEN 
+                 surf_usm_h%rho_c_green(nzb_wall,m)   = rho_c_soil !building_pars_f%pars_xy(ind_hc1_wall_r,j,i)  
+                 surf_usm_h%rho_c_green(nzb_wall+1,m) = rho_c_soil !building_pars_f%pars_xy(ind_hc1_wall_r,j,i)
               ENDIF
-              IF ( building_pars_f%pars_xy(ind_hc2,j,i) /= building_pars_f%fill )    &
-                 surf_usm_h%rho_c_green(nzb_wall+2,m) = building_pars_f%pars_xy(ind_hc2,j,i)
-              IF ( building_pars_f%pars_xy(ind_hc3,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%rho_c_green(nzb_wall+3,m) = building_pars_f%pars_xy(ind_hc3,j,i)
-              IF ( building_pars_f%pars_xy(ind_hc1,j,i) /= building_pars_f%fill )  THEN 
-                 surf_usm_h%rho_c_window(nzb_wall,m)   = building_pars_f%pars_xy(ind_hc1,j,i)  
-                 surf_usm_h%rho_c_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_hc1,j,i)
+              IF ( building_pars_f%pars_xy(ind_hc2_wall_r,j,i) /= building_pars_f%fill )    &
+                 surf_usm_h%rho_c_green(nzb_wall+2,m) = rho_c_soil !building_pars_f%pars_xy(ind_hc2_wall_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_hc3_wall_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%rho_c_green(nzb_wall+3,m) = rho_c_soil !building_pars_f%pars_xy(ind_hc3_wall_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_hc1_win_r,j,i) /= building_pars_f%fill )  THEN 
+                 surf_usm_h%rho_c_window(nzb_wall,m)   = building_pars_f%pars_xy(ind_hc1_win_r,j,i)  
+                 surf_usm_h%rho_c_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_hc1_win_r,j,i)
               ENDIF
-              IF ( building_pars_f%pars_xy(ind_hc2,j,i) /= building_pars_f%fill )    &
-                 surf_usm_h%rho_c_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_hc2,j,i)
-              IF ( building_pars_f%pars_xy(ind_hc3,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%rho_c_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_hc3,j,i)
-
-              IF ( building_pars_f%pars_xy(ind_tc1,j,i) /= building_pars_f%fill )  THEN
-                 surf_usm_h%lambda_h(nzb_wall,m)   = building_pars_f%pars_xy(ind_tc1,j,i)         
-                 surf_usm_h%lambda_h(nzb_wall+1,m) = building_pars_f%pars_xy(ind_tc1,j,i)        
+              IF ( building_pars_f%pars_xy(ind_hc2_win_r,j,i) /= building_pars_f%fill )    &
+                 surf_usm_h%rho_c_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_hc2_win_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_hc3_win_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%rho_c_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_hc3_win_r,j,i)
+
+              IF ( building_pars_f%pars_xy(ind_tc1_wall_r,j,i) /= building_pars_f%fill )  THEN
+                 surf_usm_h%lambda_h(nzb_wall,m)   = building_pars_f%pars_xy(ind_tc1_wall_r,j,i)         
+                 surf_usm_h%lambda_h(nzb_wall+1,m) = building_pars_f%pars_xy(ind_tc1_wall_r,j,i)        
               ENDIF
-              IF ( building_pars_f%pars_xy(ind_tc2,j,i) /= building_pars_f%fill )    &
-                 surf_usm_h%lambda_h(nzb_wall+2,m) = building_pars_f%pars_xy(ind_tc2,j,i)
-              IF ( building_pars_f%pars_xy(ind_tc3,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%lambda_h(nzb_wall+3,m) = building_pars_f%pars_xy(ind_tc3,j,i)    
-              IF ( building_pars_f%pars_xy(ind_tc1,j,i) /= building_pars_f%fill )  THEN
-                 surf_usm_h%lambda_h_green(nzb_wall,m)   = building_pars_f%pars_xy(ind_tc1,j,i)         
-                 surf_usm_h%lambda_h_green(nzb_wall+1,m) = building_pars_f%pars_xy(ind_tc1,j,i)        
+              IF ( building_pars_f%pars_xy(ind_tc2_wall_r,j,i) /= building_pars_f%fill )    &
+                 surf_usm_h%lambda_h(nzb_wall+2,m) = building_pars_f%pars_xy(ind_tc2_wall_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_tc3_wall_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%lambda_h(nzb_wall+3,m) = building_pars_f%pars_xy(ind_tc3_wall_r,j,i)    
+              IF ( building_pars_f%pars_xy(ind_tc1_wall_r,j,i) /= building_pars_f%fill )  THEN
+                 surf_usm_h%lambda_h_green(nzb_wall,m)   = lambda_h_green_sm !building_pars_f%pars_xy(ind_tc1_wall_r,j,i)         
+                 surf_usm_h%lambda_h_green(nzb_wall+1,m) = lambda_h_green_sm !building_pars_f%pars_xy(ind_tc1_wall_r,j,i)        
               ENDIF
-              IF ( building_pars_f%pars_xy(ind_tc2,j,i) /= building_pars_f%fill )    &
-                 surf_usm_h%lambda_h_green(nzb_wall+2,m) = building_pars_f%pars_xy(ind_tc2,j,i)
-              IF ( building_pars_f%pars_xy(ind_tc3,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%lambda_h_green(nzb_wall+3,m) = building_pars_f%pars_xy(ind_tc3,j,i)    
-              IF ( building_pars_f%pars_xy(ind_tc1,j,i) /= building_pars_f%fill )  THEN
-                 surf_usm_h%lambda_h_window(nzb_wall,m)   = building_pars_f%pars_xy(ind_tc1,j,i)         
-                 surf_usm_h%lambda_h_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_tc1,j,i)        
+              IF ( building_pars_f%pars_xy(ind_tc2_wall_r,j,i) /= building_pars_f%fill )    &
+                 surf_usm_h%lambda_h_green(nzb_wall+2,m) = lambda_h_green_sm !building_pars_f%pars_xy(ind_tc2_wall_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_tc3_wall_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%lambda_h_green(nzb_wall+3,m) = lambda_h_green_sm !building_pars_f%pars_xy(ind_tc3_wall_r,j,i)    
+              IF ( building_pars_f%pars_xy(ind_tc1_win_r,j,i) /= building_pars_f%fill )  THEN
+                 surf_usm_h%lambda_h_window(nzb_wall,m)   = building_pars_f%pars_xy(ind_tc1_win_r,j,i)         
+                 surf_usm_h%lambda_h_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_tc1_win_r,j,i)        
               ENDIF
-              IF ( building_pars_f%pars_xy(ind_tc2,j,i) /= building_pars_f%fill )    &
-                 surf_usm_h%lambda_h_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_tc2,j,i)
-              IF ( building_pars_f%pars_xy(ind_tc3,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%lambda_h_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_tc3,j,i)    
-
-              IF ( building_pars_f%pars_xy(12,j,i) /= building_pars_f%fill )         & 
-                 surf_usm_h%target_temp_summer(m)  = building_pars_f%pars_xy(12,j,i)   
-              IF ( building_pars_f%pars_xy(13,j,i) /= building_pars_f%fill )         & 
-                 surf_usm_h%target_temp_winter(m)  = building_pars_f%pars_xy(13,j,i)   
-
-              IF ( building_pars_f%pars_xy(ind_emis_wall,j,i) /= building_pars_f%fill ) & 
-                 surf_usm_h%emissivity(ind_veg_wall,m)  = building_pars_f%pars_xy(ind_emis_wall,j,i)
-              IF ( building_pars_f%pars_xy(ind_emis_green,j,i) /= building_pars_f%fill )& 
-                 surf_usm_h%emissivity(ind_pav_green,m) = building_pars_f%pars_xy(ind_emis_green,j,i)
-              IF ( building_pars_f%pars_xy(ind_emis_win,j,i) /= building_pars_f%fill )  & 
-                 surf_usm_h%emissivity(ind_wat_win,m)   = building_pars_f%pars_xy(ind_emis_win,j,i)
-
-              IF ( building_pars_f%pars_xy(ind_trans,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%transmissivity(m)      = building_pars_f%pars_xy(ind_trans,j,i)
+              IF ( building_pars_f%pars_xy(ind_tc2_win_r,j,i) /= building_pars_f%fill )    &
+                 surf_usm_h%lambda_h_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_tc2_win_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_tc3_win_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%lambda_h_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_tc3_win_r,j,i)    
+
+              IF ( building_pars_f%pars_xy(117,j,i) /= building_pars_f%fill )         & 
+                 surf_usm_h%target_temp_summer(m)  = building_pars_f%pars_xy(117,j,i)   
+              IF ( building_pars_f%pars_xy(118,j,i) /= building_pars_f%fill )         & 
+                 surf_usm_h%target_temp_winter(m)  = building_pars_f%pars_xy(118,j,i)   
+
+              IF ( building_pars_f%pars_xy(ind_emis_wall_r,j,i) /= building_pars_f%fill ) & 
+                 surf_usm_h%emissivity(ind_veg_wall,m)  = building_pars_f%pars_xy(ind_emis_wall_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_emis_green_r,j,i) /= building_pars_f%fill )& 
+                 surf_usm_h%emissivity(ind_pav_green,m) = building_pars_f%pars_xy(ind_emis_green_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_emis_win_r,j,i) /= building_pars_f%fill )  & 
+                 surf_usm_h%emissivity(ind_wat_win,m)   = building_pars_f%pars_xy(ind_emis_win_r,j,i)
+
+              IF ( building_pars_f%pars_xy(ind_trans_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%transmissivity(m)      = building_pars_f%pars_xy(ind_trans_r,j,i)
 
               IF ( building_pars_f%pars_xy(ind_z0,j,i) /= building_pars_f%fill )    & 
@@ -4602,48 +5615,51 @@
                  surf_usm_h%z0q(m)                 = building_pars_f%pars_xy(ind_z0qh,j,i)
 
-              IF ( building_pars_f%pars_xy(ind_alb_wall,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%albedo_type(ind_veg_wall,m)  = building_pars_f%pars_xy(ind_alb_wall,j,i)
-              IF ( building_pars_f%pars_xy(ind_alb_green,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%albedo_type(ind_pav_green,m) = building_pars_f%pars_xy(ind_alb_green,j,i)
-              IF ( building_pars_f%pars_xy(ind_alb_win,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%albedo_type(ind_wat_win,m)   = building_pars_f%pars_xy(ind_alb_win,j,i)
-
-              IF ( building_pars_f%pars_xy(ind_thick_1,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%zw(nzb_wall,m) = building_pars_f%pars_xy(ind_thick_1,j,i)
-              IF ( building_pars_f%pars_xy(ind_thick_2,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%zw(nzb_wall+1,m) = building_pars_f%pars_xy(ind_thick_2,j,i)
-              IF ( building_pars_f%pars_xy(ind_thick_3,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%zw(nzb_wall+2,m) = building_pars_f%pars_xy(ind_thick_3,j,i)
-              IF ( building_pars_f%pars_xy(ind_thick_4,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%zw(nzb_wall+3,m) = building_pars_f%pars_xy(ind_thick_4,j,i)
-              IF ( building_pars_f%pars_xy(ind_thick_1,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%zw_green(nzb_wall,m) = building_pars_f%pars_xy(ind_thick_1,j,i)
-              IF ( building_pars_f%pars_xy(ind_thick_2,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%zw_green(nzb_wall+1,m) = building_pars_f%pars_xy(ind_thick_2,j,i)
-              IF ( building_pars_f%pars_xy(ind_thick_3,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%zw_green(nzb_wall+2,m) = building_pars_f%pars_xy(ind_thick_3,j,i)
-              IF ( building_pars_f%pars_xy(ind_thick_4,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%zw_green(nzb_wall+3,m) = building_pars_f%pars_xy(ind_thick_4,j,i)
-              IF ( building_pars_f%pars_xy(ind_thick_1,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%zw_window(nzb_wall,m) = building_pars_f%pars_xy(ind_thick_1,j,i)
-              IF ( building_pars_f%pars_xy(ind_thick_2,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%zw_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_thick_2,j,i)
-              IF ( building_pars_f%pars_xy(ind_thick_3,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%zw_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_thick_3,j,i)
-              IF ( building_pars_f%pars_xy(ind_thick_4,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%zw_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_thick_4,j,i)
-
-              IF ( building_pars_f%pars_xy(45,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%c_surface(m)           = building_pars_f%pars_xy(45,j,i)
-              IF ( building_pars_f%pars_xy(46,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%lambda_surf(m)         = building_pars_f%pars_xy(46,j,i)
-              IF ( building_pars_f%pars_xy(45,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%c_surface_green(m)           = building_pars_f%pars_xy(45,j,i)
-              IF ( building_pars_f%pars_xy(46,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%lambda_surf_green(m)         = building_pars_f%pars_xy(46,j,i)
-              IF ( building_pars_f%pars_xy(45,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%c_surface_window(m)           = building_pars_f%pars_xy(45,j,i)
-              IF ( building_pars_f%pars_xy(46,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%lambda_surf_window(m)         = building_pars_f%pars_xy(46,j,i)
+              IF ( building_pars_f%pars_xy(ind_alb_wall_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%albedo_type(ind_veg_wall,m)  = building_pars_f%pars_xy(ind_alb_wall_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_alb_green_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%albedo_type(ind_pav_green,m) = building_pars_f%pars_xy(ind_alb_green_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_alb_win_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%albedo_type(ind_wat_win,m)   = building_pars_f%pars_xy(ind_alb_win_r,j,i)
+
+              IF ( building_pars_f%pars_xy(ind_thick_1_wall_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%zw(nzb_wall,m) = building_pars_f%pars_xy(ind_thick_1_wall_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_thick_2_wall_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%zw(nzb_wall+1,m) = building_pars_f%pars_xy(ind_thick_2_wall_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_thick_3_wall_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%zw(nzb_wall+2,m) = building_pars_f%pars_xy(ind_thick_3_wall_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_thick_4_wall_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%zw(nzb_wall+3,m) = building_pars_f%pars_xy(ind_thick_4_wall_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_thick_1_wall_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%zw_green(nzb_wall,m) = building_pars_f%pars_xy(ind_thick_1_wall_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_thick_2_wall_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%zw_green(nzb_wall+1,m) = building_pars_f%pars_xy(ind_thick_2_wall_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_thick_3_wall_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%zw_green(nzb_wall+2,m) = building_pars_f%pars_xy(ind_thick_3_wall_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_thick_4_wall_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%zw_green(nzb_wall+3,m) = building_pars_f%pars_xy(ind_thick_4_wall_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_thick_1_win_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%zw_window(nzb_wall,m) = building_pars_f%pars_xy(ind_thick_1_win_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_thick_2_win_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%zw_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_thick_2_win_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_thick_3_win_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%zw_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_thick_3_win_r,j,i)
+              IF ( building_pars_f%pars_xy(ind_thick_4_win_r,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%zw_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_thick_4_win_r,j,i)
+
+              IF ( building_pars_f%pars_xy(0,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%c_surface(m)           = building_pars_f%pars_xy(0,j,i)
+              IF ( building_pars_f%pars_xy(3,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%lambda_surf(m)         = building_pars_f%pars_xy(3,j,i)
+              IF ( building_pars_f%pars_xy(2,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%c_surface_green(m)           = building_pars_f%pars_xy(2,j,i)
+              IF ( building_pars_f%pars_xy(5,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%lambda_surf_green(m)         = building_pars_f%pars_xy(5,j,i)
+              IF ( building_pars_f%pars_xy(1,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%c_surface_window(m)           = building_pars_f%pars_xy(1,j,i)
+              IF ( building_pars_f%pars_xy(4,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%lambda_surf_window(m)         = building_pars_f%pars_xy(4,j,i)
+
+              IF ( building_pars_f%pars_xy(ind_green_type_roof,j,i) /= building_pars_f%fill )    & 
+                 surf_usm_h%green_type_roof(m)            = building_pars_f%pars_xy(ind_green_type_roof,j,i)
            ENDDO
 
@@ -4657,5 +5673,11 @@
 !
 !--              In order to distinguish between ground floor level and 
-!--              above-ground-floor level surfaces, set input indices. 
+!--              above-ground-floor level surfaces, set input indices.
+                 ind_alb_green    = MERGE( ind_alb_green_gfl,    ind_alb_green_agfl,    &
+                                           surf_usm_v(l)%ground_level(m) )
+                 ind_alb_wall     = MERGE( ind_alb_wall_gfl,     ind_alb_wall_agfl,     &
+                                           surf_usm_v(l)%ground_level(m) )
+                 ind_alb_win      = MERGE( ind_alb_win_gfl,      ind_alb_win_agfl,      &
+                                           surf_usm_v(l)%ground_level(m) )
                  ind_wall_frac    = MERGE( ind_wall_frac_gfl,    ind_wall_frac_agfl,     &
                                            surf_usm_v(l)%ground_level(m) )
@@ -4672,13 +5694,41 @@
                  ind_hc1          = MERGE( ind_hc1_gfl,          ind_hc1_agfl,          &
                                            surf_usm_v(l)%ground_level(m) )
+                 ind_hc1_win      = MERGE( ind_hc1_win_gfl,      ind_hc1_win_agfl,      &
+                                           surf_usm_v(l)%ground_level(m) )
                  ind_hc2          = MERGE( ind_hc2_gfl,          ind_hc2_agfl,          &
+                                           surf_usm_v(l)%ground_level(m) )
+                 ind_hc2_win      = MERGE( ind_hc2_win_gfl,      ind_hc2_win_agfl,      &
                                            surf_usm_v(l)%ground_level(m) )
                  ind_hc3          = MERGE( ind_hc3_gfl,          ind_hc3_agfl,          &
                                            surf_usm_v(l)%ground_level(m) )
+                 ind_hc3_win      = MERGE( ind_hc3_win_gfl,      ind_hc3_win_agfl,      &
+                                           surf_usm_v(l)%ground_level(m) )
                  ind_tc1          = MERGE( ind_tc1_gfl,          ind_tc1_agfl,          &
+                                           surf_usm_v(l)%ground_level(m) )
+                 ind_tc1_win      = MERGE( ind_tc1_win_gfl,      ind_tc1_win_agfl,      &
                                            surf_usm_v(l)%ground_level(m) )
                  ind_tc2          = MERGE( ind_tc2_gfl,          ind_tc2_agfl,          &
                                            surf_usm_v(l)%ground_level(m) )
+                 ind_tc2_win      = MERGE( ind_tc2_win_gfl,      ind_tc2_win_agfl,      &
+                                           surf_usm_v(l)%ground_level(m) )
                  ind_tc3          = MERGE( ind_tc3_gfl,          ind_tc3_agfl,          &
+                                           surf_usm_v(l)%ground_level(m) )
+                 ind_tc3_win      = MERGE( ind_tc3_win_gfl,      ind_tc3_win_agfl,      &
+                                           surf_usm_v(l)%ground_level(m) )
+                 ind_thick_1      = MERGE( ind_thick_1_gfl,      ind_thick_1_agfl,      &
+                                           surf_usm_v(l)%ground_level(m) )
+                 ind_thick_1_win  = MERGE( ind_thick_1_win_gfl,  ind_thick_1_win_agfl,  &
+                                           surf_usm_v(l)%ground_level(m) )
+                 ind_thick_2      = MERGE( ind_thick_2_gfl,      ind_thick_2_agfl,      &
+                                           surf_usm_v(l)%ground_level(m) )
+                 ind_thick_2_win  = MERGE( ind_thick_2_win_gfl,  ind_thick_2_win_agfl,  &
+                                           surf_usm_v(l)%ground_level(m) )
+                 ind_thick_3      = MERGE( ind_thick_3_gfl,      ind_thick_3_agfl,      &
+                                           surf_usm_v(l)%ground_level(m) )
+                 ind_thick_3_win  = MERGE( ind_thick_3_win_gfl,  ind_thick_3_win_agfl,  &
+                                           surf_usm_v(l)%ground_level(m) )
+                 ind_thick_4      = MERGE( ind_thick_4_gfl,      ind_thick_4_agfl,      &
+                                           surf_usm_v(l)%ground_level(m) )
+                 ind_thick_4_win  = MERGE( ind_thick_4_win_gfl,  ind_thick_4_win_agfl,  &
                                            surf_usm_v(l)%ground_level(m) )
                  ind_emis_wall    = MERGE( ind_emis_wall_gfl,    ind_emis_wall_agfl,    &
@@ -4728,20 +5778,20 @@
                  IF ( building_pars_f%pars_xy(ind_hc1,j,i) /= building_pars_f%fill )  THEN 
                     surf_usm_v(l)%rho_c_green(nzb_wall,m)   =                           &
-                                                    building_pars_f%pars_xy(ind_hc1,j,i)  
+                                                    rho_c_soil !building_pars_f%pars_xy(ind_hc1,j,i)  
                     surf_usm_v(l)%rho_c_green(nzb_wall+1,m) =                           &
-                                                    building_pars_f%pars_xy(ind_hc1,j,i)
+                                                    rho_c_soil !building_pars_f%pars_xy(ind_hc1,j,i)
                  ENDIF
                  IF ( building_pars_f%pars_xy(ind_hc2,j,i) /= building_pars_f%fill )    &
-                    surf_usm_v(l)%rho_c_green(nzb_wall+2,m) = building_pars_f%pars_xy(ind_hc2,j,i)
+                    surf_usm_v(l)%rho_c_green(nzb_wall+2,m) = rho_c_soil !building_pars_f%pars_xy(ind_hc2,j,i)
                  IF ( building_pars_f%pars_xy(ind_hc3,j,i) /= building_pars_f%fill )    & 
-                    surf_usm_v(l)%rho_c_green(nzb_wall+3,m) = building_pars_f%pars_xy(ind_hc3,j,i)    
-                 IF ( building_pars_f%pars_xy(ind_hc1,j,i) /= building_pars_f%fill )  THEN 
-                    surf_usm_v(l)%rho_c_window(nzb_wall,m)   = building_pars_f%pars_xy(ind_hc1,j,i)  
-                    surf_usm_v(l)%rho_c_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_hc1,j,i)
+                    surf_usm_v(l)%rho_c_green(nzb_wall+3,m) = rho_c_soil !building_pars_f%pars_xy(ind_hc3,j,i)    
+                 IF ( building_pars_f%pars_xy(ind_hc1_win,j,i) /= building_pars_f%fill )  THEN 
+                    surf_usm_v(l)%rho_c_window(nzb_wall,m)   = building_pars_f%pars_xy(ind_hc1_win,j,i)  
+                    surf_usm_v(l)%rho_c_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_hc1_win,j,i)
                  ENDIF
-                 IF ( building_pars_f%pars_xy(ind_hc2,j,i) /= building_pars_f%fill )    &
-                    surf_usm_v(l)%rho_c_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_hc2,j,i)
-                 IF ( building_pars_f%pars_xy(ind_hc3,j,i) /= building_pars_f%fill )    &
-                    surf_usm_v(l)%rho_c_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_hc3,j,i)
+                 IF ( building_pars_f%pars_xy(ind_hc2_win,j,i) /= building_pars_f%fill )    &
+                    surf_usm_v(l)%rho_c_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_hc2_win,j,i)
+                 IF ( building_pars_f%pars_xy(ind_hc3_win,j,i) /= building_pars_f%fill )    &
+                    surf_usm_v(l)%rho_c_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_hc3_win,j,i)
 
                  IF ( building_pars_f%pars_xy(ind_tc1,j,i) /= building_pars_f%fill )  THEN
@@ -4754,24 +5804,24 @@
                     surf_usm_v(l)%lambda_h(nzb_wall+3,m) = building_pars_f%pars_xy(ind_tc3,j,i)    
                  IF ( building_pars_f%pars_xy(ind_tc1,j,i) /= building_pars_f%fill )  THEN
-                    surf_usm_v(l)%lambda_h_green(nzb_wall,m)   = building_pars_f%pars_xy(ind_tc1,j,i)         
-                    surf_usm_v(l)%lambda_h_green(nzb_wall+1,m) = building_pars_f%pars_xy(ind_tc1,j,i)        
+                    surf_usm_v(l)%lambda_h_green(nzb_wall,m)   = lambda_h_green_sm !building_pars_f%pars_xy(ind_tc1,j,i)         
+                    surf_usm_v(l)%lambda_h_green(nzb_wall+1,m) = lambda_h_green_sm !building_pars_f%pars_xy(ind_tc1,j,i)        
                  ENDIF
                  IF ( building_pars_f%pars_xy(ind_tc2,j,i) /= building_pars_f%fill )    &
-                    surf_usm_v(l)%lambda_h_green(nzb_wall+2,m) = building_pars_f%pars_xy(ind_tc2,j,i)
+                    surf_usm_v(l)%lambda_h_green(nzb_wall+2,m) = lambda_h_green_sm !building_pars_f%pars_xy(ind_tc2,j,i)
                  IF ( building_pars_f%pars_xy(ind_tc3,j,i) /= building_pars_f%fill )    & 
-                    surf_usm_v(l)%lambda_h_green(nzb_wall+3,m) = building_pars_f%pars_xy(ind_tc3,j,i)    
-                 IF ( building_pars_f%pars_xy(ind_tc1,j,i) /= building_pars_f%fill )  THEN
-                    surf_usm_v(l)%lambda_h_window(nzb_wall,m)   = building_pars_f%pars_xy(ind_tc1,j,i)         
-                    surf_usm_v(l)%lambda_h_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_tc1,j,i)        
+                    surf_usm_v(l)%lambda_h_green(nzb_wall+3,m) = lambda_h_green_sm !building_pars_f%pars_xy(ind_tc3,j,i)    
+                 IF ( building_pars_f%pars_xy(ind_tc1_win,j,i) /= building_pars_f%fill )  THEN
+                    surf_usm_v(l)%lambda_h_window(nzb_wall,m)   = building_pars_f%pars_xy(ind_tc1_win,j,i)         
+                    surf_usm_v(l)%lambda_h_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_tc1_win,j,i)        
                  ENDIF
-                 IF ( building_pars_f%pars_xy(ind_tc2,j,i) /= building_pars_f%fill )    &
-                    surf_usm_v(l)%lambda_h_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_tc2,j,i)
-                 IF ( building_pars_f%pars_xy(ind_tc3,j,i) /= building_pars_f%fill )    & 
-                    surf_usm_v(l)%lambda_h_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_tc3,j,i)
-
-                 IF ( building_pars_f%pars_xy(12,j,i) /= building_pars_f%fill )         & 
-                    surf_usm_v(l)%target_temp_summer(m)  = building_pars_f%pars_xy(12,j,i)   
-                 IF ( building_pars_f%pars_xy(13,j,i) /= building_pars_f%fill )         & 
-                    surf_usm_v(l)%target_temp_winter(m)  = building_pars_f%pars_xy(13,j,i)   
+                 IF ( building_pars_f%pars_xy(ind_tc2_win,j,i) /= building_pars_f%fill )    &
+                    surf_usm_v(l)%lambda_h_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_tc2_win,j,i)
+                 IF ( building_pars_f%pars_xy(ind_tc3_win,j,i) /= building_pars_f%fill )    & 
+                    surf_usm_v(l)%lambda_h_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_tc3_win,j,i)
+
+                 IF ( building_pars_f%pars_xy(117,j,i) /= building_pars_f%fill )         & 
+                    surf_usm_v(l)%target_temp_summer(m)  = building_pars_f%pars_xy(117,j,i)   
+                 IF ( building_pars_f%pars_xy(118,j,i) /= building_pars_f%fill )         & 
+                    surf_usm_v(l)%target_temp_winter(m)  = building_pars_f%pars_xy(118,j,i)   
 
                  IF ( building_pars_f%pars_xy(ind_emis_wall,j,i) /= building_pars_f%fill ) & 
@@ -4815,25 +5865,25 @@
                  IF ( building_pars_f%pars_xy(ind_thick_4,j,i) /= building_pars_f%fill )    & 
                     surf_usm_v(l)%zw_green(nzb_wall+3,m) = building_pars_f%pars_xy(ind_thick_4,j,i)
-                 IF ( building_pars_f%pars_xy(ind_thick_1,j,i) /= building_pars_f%fill )    & 
-                    surf_usm_v(l)%zw_window(nzb_wall,m) = building_pars_f%pars_xy(ind_thick_1,j,i)
-                 IF ( building_pars_f%pars_xy(ind_thick_2,j,i) /= building_pars_f%fill )    & 
-                    surf_usm_v(l)%zw_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_thick_2,j,i)
-                 IF ( building_pars_f%pars_xy(ind_thick_3,j,i) /= building_pars_f%fill )    & 
-                    surf_usm_v(l)%zw_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_thick_3,j,i)
-                 IF ( building_pars_f%pars_xy(ind_thick_4,j,i) /= building_pars_f%fill )    & 
-                    surf_usm_v(l)%zw_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_thick_4,j,i)
-
-                 IF ( building_pars_f%pars_xy(45,j,i) /= building_pars_f%fill )    & 
-                    surf_usm_v(l)%c_surface(m)           = building_pars_f%pars_xy(45,j,i)
-                 IF ( building_pars_f%pars_xy(46,j,i) /= building_pars_f%fill )    & 
-                    surf_usm_v(l)%lambda_surf(m)         = building_pars_f%pars_xy(46,j,i)
-                 IF ( building_pars_f%pars_xy(45,j,i) /= building_pars_f%fill )    & 
-                    surf_usm_v(l)%c_surface_green(m)     = building_pars_f%pars_xy(45,j,i)
-                 IF ( building_pars_f%pars_xy(46,j,i) /= building_pars_f%fill )    & 
-                    surf_usm_v(l)%lambda_surf_green(m)   = building_pars_f%pars_xy(46,j,i)
-                 IF ( building_pars_f%pars_xy(45,j,i) /= building_pars_f%fill )    & 
-                    surf_usm_v(l)%c_surface_window(m)    = building_pars_f%pars_xy(45,j,i)
-                 IF ( building_pars_f%pars_xy(46,j,i) /= building_pars_f%fill )    & 
-                    surf_usm_v(l)%lambda_surf_window(m)  = building_pars_f%pars_xy(46,j,i)
+                 IF ( building_pars_f%pars_xy(ind_thick_1_win,j,i) /= building_pars_f%fill )    & 
+                    surf_usm_v(l)%zw_window(nzb_wall,m) = building_pars_f%pars_xy(ind_thick_1_win,j,i)
+                 IF ( building_pars_f%pars_xy(ind_thick_2_win,j,i) /= building_pars_f%fill )    & 
+                    surf_usm_v(l)%zw_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_thick_2_win,j,i)
+                 IF ( building_pars_f%pars_xy(ind_thick_3_win,j,i) /= building_pars_f%fill )    & 
+                    surf_usm_v(l)%zw_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_thick_3_win,j,i)
+                 IF ( building_pars_f%pars_xy(ind_thick_4_win,j,i) /= building_pars_f%fill )    & 
+                    surf_usm_v(l)%zw_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_thick_4_win,j,i)
+
+                 IF ( building_pars_f%pars_xy(0,j,i) /= building_pars_f%fill )    & 
+                    surf_usm_v(l)%c_surface(m)           = building_pars_f%pars_xy(0,j,i)
+                 IF ( building_pars_f%pars_xy(3,j,i) /= building_pars_f%fill )    & 
+                    surf_usm_v(l)%lambda_surf(m)         = building_pars_f%pars_xy(3,j,i)
+                 IF ( building_pars_f%pars_xy(2,j,i) /= building_pars_f%fill )    & 
+                    surf_usm_v(l)%c_surface_green(m)     = building_pars_f%pars_xy(2,j,i)
+                 IF ( building_pars_f%pars_xy(5,j,i) /= building_pars_f%fill )    & 
+                    surf_usm_v(l)%lambda_surf_green(m)   = building_pars_f%pars_xy(5,j,i)
+                 IF ( building_pars_f%pars_xy(1,j,i) /= building_pars_f%fill )    & 
+                    surf_usm_v(l)%c_surface_window(m)    = building_pars_f%pars_xy(1,j,i)
+                 IF ( building_pars_f%pars_xy(4,j,i) /= building_pars_f%fill )    & 
+                    surf_usm_v(l)%lambda_surf_window(m)  = building_pars_f%pars_xy(4,j,i)
 
               ENDDO
@@ -4945,5 +5995,5 @@
 
 !
-!--         At horizontal surfaces. Please note, t_surf_h is defined on a 
+!--         At horizontal surfaces. Please note, t_surf_wall_h is defined on a 
 !--         different data type, but with the same dimension.
 #if ! defined( __nopointer )
@@ -4953,5 +6003,5 @@
                k = surf_usm_h%k(m)
 
-               t_surf_h(m) = pt(k,j,i) * exner(k)
+               t_surf_wall_h(m) = pt(k,j,i) * exner(k)
                t_surf_window_h(m) = pt(k,j,i) * exner(k)
                t_surf_green_h(m) = pt(k,j,i) * exner(k)
@@ -4966,5 +6016,5 @@
                   k = surf_usm_v(l)%k(m)
 
-                  t_surf_v(l)%t(m) = pt(k,j,i) * exner(k)
+                  t_surf_wall_v(l)%t(m) = pt(k,j,i) * exner(k)
                   t_surf_window_v(l)%t(m) = pt(k,j,i) * exner(k)
                   t_surf_green_v(l)%t(m) = pt(k,j,i) * exner(k)
@@ -5009,7 +6059,13 @@
                        REAL( nzt_wall + 1 - nzb_wall , wp )
 
-                   t_wall_h(k,m) = ( 1.0_wp - c ) * t_surf_h(m) + c * tin
+                   t_wall_h(k,m) = ( 1.0_wp - c ) * t_surf_wall_h(m) + c * tin
                    t_window_h(k,m) = ( 1.0_wp - c ) * t_surf_window_h(m) + c * twin
-                   t_green_h(k,m) = t_surf_h(m)
+                   t_green_h(k,m) = t_surf_wall_h(m)
+                   swc_h(k,m) = 0.5_wp
+                   swc_sat_h(k,m) = 0.95_wp
+                   swc_res_h(k,m) = 0.05_wp
+                   rootfr_h(k,m) = 0.1_wp
+                   wilt_h(k,m) = 0.1_wp
+                   fc_h(k,m) = 0.9_wp
                ENDDO
             ENDDO
@@ -5026,7 +6082,8 @@
                      c = REAL( k - nzb_wall, wp ) /                            &
                          REAL( nzt_wall + 1 - nzb_wall , wp )
-                     t_wall_v(l)%t(k,m) = ( 1.0_wp - c ) * t_surf_v(l)%t(m) + c * tin
+                     t_wall_v(l)%t(k,m) = ( 1.0_wp - c ) * t_surf_wall_v(l)%t(m) + c * tin
                      t_window_v(l)%t(k,m) = ( 1.0_wp - c ) * t_surf_window_v(l)%t(m) + c * twin
-                     t_green_v(l)%t(k,m) = t_surf_v(l)%t(m)
+                     t_green_v(l)%t(k,m) = t_surf_wall_v(l)%t(m)
+                     swc_v(l)%t(k,m) = 0.5_wp
                   ENDDO
                ENDDO
@@ -5043,6 +6100,6 @@
 
 !--     initialize prognostic values for the first timestep
-        t_surf_h_p = t_surf_h
-        t_surf_v_p = t_surf_v
+        t_surf_wall_h_p = t_surf_wall_h
+        t_surf_wall_v_p = t_surf_wall_v
         t_surf_window_h_p = t_surf_window_h
         t_surf_window_v_p = t_surf_window_v
@@ -5064,4 +6121,37 @@
 !--     that is not yet possible.
         
+        m_liq_usm_h_p     = m_liq_usm_h
+        m_liq_usm_v_p     = m_liq_usm_v
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+!
+!--    Set initial values for prognostic quantities
+!--    Horizontal surfaces
+       tm_liq_usm_h_m%var_usm_1d  = 0.0_wp
+       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
+
+!
+!--    Do the same for vertical surfaces
+       DO  l = 0, 3
+          tm_liq_usm_v_m(l)%var_usm_1d  = 0.0_wp
+          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
+       ENDDO
+
+!
+!--    Set initial values for prognostic soil quantities
+       IF ( TRIM( initializing_actions ) /= 'read_restart_data' )  THEN
+          m_liq_usm_h%var_usm_1d  = 0.0_wp
+
+          DO  l = 0, 3
+             m_liq_usm_v(l)%var_usm_1d  = 0.0_wp
+          ENDDO
+       ENDIF
+!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++        
+
         CALL cpu_log( log_point_s(78), 'usm_init', 'stop' )
 
@@ -5076,5 +6166,5 @@
 !> temperature.
 !------------------------------------------------------------------------------!
-    SUBROUTINE usm_material_heat_model
+    SUBROUTINE usm_material_heat_model( spinup )
 
 
@@ -5084,4 +6174,15 @@
 
         REAL(wp), DIMENSION(nzb_wall:nzt_wall) :: wtend, wintend  !< tendency
+        REAL(wp)     :: win_absorp !absorption coefficient from transmissivity
+        REAL(wp), DIMENSION(nzb_wall:nzt_wall) :: wall_mod
+
+        LOGICAL      :: spinup !if true, no calculation of window temperatures
+
+        wall_mod=1.0_wp
+        if (usm_wall_mod .AND. spinup) then
+          do kw=nzb_wall,nzb_wall+1
+            wall_mod(kw)=0.1_wp
+          enddo
+        endif
 
 !
@@ -5097,5 +6198,5 @@
            wtend(:) = 0.0_wp
            wtend(nzb_wall) = (1.0_wp / surf_usm_h%rho_c_wall(nzb_wall,m)) *        &
-                                       ( surf_usm_h%lambda_h(nzb_wall,m) *         &
+                                       ( surf_usm_h%lambda_h(nzb_wall,m) * wall_mod(nzb_wall) *        &
                                          ( t_wall_h(nzb_wall+1,m)                  &
                                          - t_wall_h(nzb_wall,m) ) *                &
@@ -5108,7 +6209,7 @@
                                           / (surf_usm_h%frac(ind_veg_wall,m)       &
                                             + surf_usm_h%frac(ind_pav_green,m) )   &
-                                         * ( surf_usm_h%lambda_h_green(nzt_wall,m) &
+                                         * ( surf_usm_h%lambda_h_green(nzt_wall,m)* wall_mod(nzt_wall) &
                                            * surf_usm_h%ddz_green(nzt_wall,m)      &
-                                           + surf_usm_h%lambda_h(nzb_wall,m)       &
+                                           + surf_usm_h%lambda_h(nzb_wall,m) * wall_mod(nzb_wall)        &
                                            * surf_usm_h%ddz_wall(nzb_wall,m) )     &
                                          / ( surf_usm_h%ddz_green(nzt_wall,m)      &
@@ -5118,14 +6219,11 @@
                                        surf_usm_h%ddz_wall_stag(nzb_wall,m)
 
-!dummy value for testing
-surf_usm_h%iwghf_eb(m) = 0.
-
            IF ( indoor_model ) then 
               DO  kw = nzb_wall+1, nzt_wall-1
                   wtend(kw) = (1.0_wp / surf_usm_h%rho_c_wall(kw,m))              &
-                                 * (   surf_usm_h%lambda_h(kw,m)                  &
+                                 * (   surf_usm_h%lambda_h(kw,m) * wall_mod(kw)                 &
                                     * ( t_wall_h(kw+1,m) - t_wall_h(kw,m) )       &
                                     * surf_usm_h%ddz_wall(kw+1,m)                 &
-                                 - surf_usm_h%lambda_h(kw-1,m)                    &
+                                 - surf_usm_h%lambda_h(kw-1,m) * wall_mod(kw-1)                     &
                                     * ( t_wall_h(kw,m) - t_wall_h(kw-1,m) )       &
                                     * surf_usm_h%ddz_wall(kw,m)                   &
@@ -5133,5 +6231,5 @@
               ENDDO
               wtend(nzt_wall) = (1.0_wp / surf_usm_h%rho_c_wall(nzt_wall,m)) *    &
-                                         ( surf_usm_h%lambda_h(nzt_wall-1,m) *    &
+                                         ( -surf_usm_h%lambda_h(nzt_wall-1,m) * wall_mod(nzt_wall-1) *     &
                                            ( t_wall_h(nzt_wall,m)                 &
                                            - t_wall_h(nzt_wall-1,m) ) *           &
@@ -5142,8 +6240,8 @@
               DO  kw = nzb_wall+1, nzt_wall
                   wtend(kw) = (1.0_wp / surf_usm_h%rho_c_wall(kw,m))              &
-                                 * (   surf_usm_h%lambda_h(kw,m)                  &
+                                 * (   surf_usm_h%lambda_h(kw,m)  * wall_mod(kw)                &
                                     * ( t_wall_h(kw+1,m) - t_wall_h(kw,m) )       &
                                     * surf_usm_h%ddz_wall(kw+1,m)                 &
-                                 - surf_usm_h%lambda_h(kw-1,m)                    &
+                                 - surf_usm_h%lambda_h(kw-1,m) * wall_mod(kw-1)                   &
                                     * ( t_wall_h(kw,m) - t_wall_h(kw-1,m) )       &
                                     * surf_usm_h%ddz_wall(kw,m)                   &
@@ -5157,4 +6255,6 @@
                                  * surf_usm_h%tt_wall_m(nzb_wall:nzt_wall,m) )   
 
+if (.NOT. spinup) then
+           win_absorp = -log(surf_usm_h%transmissivity(m)) / surf_usm_h%zw_window(nzt_wall,m)
 !--        prognostic equation for ground/roof window temperature t_window_h
            wintend(:) = 0.0_wp
@@ -5166,5 +6266,5 @@
                                       + surf_usm_h%wghf_eb_window(m)              &
                                       + surf_usm_h%rad_sw_in(m)                   &
-                                        * (1.0_wp - exp(-surf_usm_h%transmissivity(m) &
+                                        * (1.0_wp - exp(-win_absorp               &
                                         * surf_usm_h%zw_window(nzb_wall,m) ) )    &
                                       ) * surf_usm_h%ddz_window_stag(nzb_wall,m)
@@ -5180,20 +6280,22 @@
                                     * surf_usm_h%ddz_window(kw,m)                 &
                                  + surf_usm_h%rad_sw_in(m)                        &
-                                    * (exp(-surf_usm_h%transmissivity(m)       &
+                                    * (exp(-win_absorp                            &
                                         * surf_usm_h%zw_window(kw-1,m) )          &
-                                        - exp(-surf_usm_h%transmissivity(m)    &
+                                        - exp(-win_absorp                         &
                                         * surf_usm_h%zw_window(kw,m) ) )          &
                                    ) * surf_usm_h%ddz_window_stag(kw,m)
 
               ENDDO
-              wintend(nzt_wall) = (1.0_wp / surf_usm_h%rho_c_window(nzt_wall,m)) *     &
-                                         ( surf_usm_h%lambda_h_window(nzt_wall-1,m) *  &
-                                           ( t_window_h(nzt_wall,m)                    &
-                                           - t_window_h(nzt_wall-1,m) ) *              &
-                                           surf_usm_h%ddz_window(nzt_wall,m)           &
-                                         + surf_usm_h%iwghf_eb_window(m)               &
-                                         + surf_usm_h%rad_sw_in(m)                     &
-                                           * (1.0_wp - exp(-surf_usm_h%transmissivity(m) &
-                                           * surf_usm_h%zw_window(nzt_wall,m) ) )      &
+              wintend(nzt_wall) = (1.0_wp / surf_usm_h%rho_c_window(nzt_wall,m)) *       &
+                                         ( -surf_usm_h%lambda_h_window(nzt_wall-1,m) *   &
+                                           ( t_window_h(nzt_wall,m)                      &
+                                           - t_window_h(nzt_wall-1,m) ) *                &
+                                           surf_usm_h%ddz_window(nzt_wall,m)             &
+                                         + surf_usm_h%iwghf_eb_window(m)                 &
+                                         + surf_usm_h%rad_sw_in(m)                       &
+                                           * (exp(-win_absorp                            &
+                                           * surf_usm_h%zw_window(nzt_wall-1,m) )        &
+                                           - exp(-win_absorp                             &
+                                           * surf_usm_h%zw_window(nzt_wall,m) ) )        &
                                          ) * surf_usm_h%ddz_window_stag(nzt_wall,m)
            ELSE
@@ -5207,7 +6309,7 @@
                                     * surf_usm_h%ddz_window(kw,m)                 &
                                  + surf_usm_h%rad_sw_in(m)                        &
-                                    * (exp(-surf_usm_h%transmissivity(m)       &
+                                    * (exp(-win_absorp                            &
                                         * surf_usm_h%zw_window(kw-1,m) )          &
-                                        - exp(-surf_usm_h%transmissivity(m)    &
+                                        - exp(-win_absorp                         &
                                         * surf_usm_h%zw_window(kw,m) ) )          &
                                    ) * surf_usm_h%ddz_window_stag(kw,m)
@@ -5220,4 +6322,6 @@
                                  * wintend(nzb_wall:nzt_wall) + tsc(3)            &
                                  * surf_usm_h%tt_window_m(nzb_wall:nzt_wall,m) )   
+
+endif
 
 !
@@ -5237,4 +6341,5 @@
            ENDIF
 
+if (.NOT. spinup) then
 !--        calculate t_window tendencies for the next Runge-Kutta step
            IF ( timestep_scheme(1:5) == 'runge' )  THEN
@@ -5251,4 +6356,7 @@
                ENDIF
            ENDIF
+
+endif
+
         ENDDO
 
@@ -5267,5 +6375,5 @@
 
                wtend(nzb_wall) = (1.0_wp / surf_usm_v(l)%rho_c_wall(nzb_wall,m)) *    &
-                                       ( surf_usm_v(l)%lambda_h(nzb_wall,m) *         &
+                                       ( surf_usm_v(l)%lambda_h(nzb_wall,m) * wall_mod(nzb_wall)  *      &
                                          ( t_wall_v(l)%t(nzb_wall+1,m)                &
                                          - t_wall_v(l)%t(nzb_wall,m) ) *              &
@@ -5278,7 +6386,7 @@
                                          / (surf_usm_v(l)%frac(ind_veg_wall,m)        &
                                            + surf_usm_v(l)%frac(ind_pav_green,m) )    &
-                                         * ( surf_usm_v(l)%lambda_h_green(nzt_wall,m) &
+                                         * ( surf_usm_v(l)%lambda_h_green(nzt_wall,m)* wall_mod(nzt_wall) &
                                            * surf_usm_v(l)%ddz_green(nzt_wall,m)      &
-                                           + surf_usm_v(l)%lambda_h(nzb_wall,m)       &
+                                           + surf_usm_v(l)%lambda_h(nzb_wall,m)* wall_mod(nzb_wall)       &
                                            * surf_usm_v(l)%ddz_wall(nzb_wall,m) )     &
                                          / ( surf_usm_v(l)%ddz_green(nzt_wall,m)      &
@@ -5288,14 +6396,11 @@
                                          surf_usm_v(l)%ddz_wall_stag(nzb_wall,m)
 
-!dummy value for testing
-surf_usm_v(l)%iwghf_eb(m) = 0.
-
               IF ( indoor_model ) then 
                  DO  kw = nzb_wall+1, nzt_wall-1
                      wtend(kw) = (1.0_wp / surf_usm_v(l)%rho_c_wall(kw,m))        &
-                              * (   surf_usm_v(l)%lambda_h(kw,m)                  &
+                              * (   surf_usm_v(l)%lambda_h(kw,m)  * wall_mod(kw)                &
                                  * ( t_wall_v(l)%t(kw+1,m) - t_wall_v(l)%t(kw,m) )&
                                  * surf_usm_v(l)%ddz_wall(kw+1,m)                 &
-                              - surf_usm_v(l)%lambda_h(kw-1,m)                    &
+                              - surf_usm_v(l)%lambda_h(kw-1,m)  * wall_mod(kw-1)                  &
                                  * ( t_wall_v(l)%t(kw,m) - t_wall_v(l)%t(kw-1,m) )&
                                  * surf_usm_v(l)%ddz_wall(kw,m)                   &
@@ -5303,5 +6408,5 @@
                  ENDDO
                  wtend(nzt_wall) = (1.0_wp / surf_usm_v(l)%rho_c_wall(nzt_wall,m)) * &
-                                         ( surf_usm_v(l)%lambda_h(nzt_wall-1,m) *    &
+                                         ( -surf_usm_v(l)%lambda_h(nzt_wall-1,m) * wall_mod(nzt_wall-1)*    &
                                            ( t_wall_v(l)%t(nzt_wall,m)               &
                                            - t_wall_v(l)%t(nzt_wall-1,m) ) *         &
@@ -5312,8 +6417,8 @@
                  DO  kw = nzb_wall+1, nzt_wall
                      wtend(kw) = (1.0_wp / surf_usm_v(l)%rho_c_wall(kw,m))        &
-                              * (   surf_usm_v(l)%lambda_h(kw,m)                  &
+                              * (   surf_usm_v(l)%lambda_h(kw,m) * wall_mod(kw)                 &
                                  * ( t_wall_v(l)%t(kw+1,m) - t_wall_v(l)%t(kw,m) )&
                                  * surf_usm_v(l)%ddz_wall(kw+1,m)                 &
-                              - surf_usm_v(l)%lambda_h(kw-1,m)                    &
+                              - surf_usm_v(l)%lambda_h(kw-1,m)  * wall_mod(kw-1)                  &
                                  * ( t_wall_v(l)%t(kw,m) - t_wall_v(l)%t(kw-1,m) )&
                                  * surf_usm_v(l)%ddz_wall(kw,m)                   &
@@ -5328,4 +6433,6 @@
                                  * surf_usm_v(l)%tt_wall_m(nzb_wall:nzt_wall,m) )   
 
+if (.NOT. spinup) then
+              win_absorp = -log(surf_usm_v(l)%transmissivity(m)) / surf_usm_v(l)%zw_window(nzt_wall,m)
 !--           prognostic equation for window temperature t_window_v
               wintend(:) = 0.0_wp
@@ -5337,5 +6444,5 @@
                                       + surf_usm_v(l)%wghf_eb_window(m)               &
                                       + surf_usm_v(l)%rad_sw_in(m)                    &
-                                        * (1.0_wp - exp(-surf_usm_v(l)%transmissivity(m) &
+                                        * (1.0_wp - exp(-win_absorp                   &
                                         * surf_usm_v(l)%zw_window(nzb_wall,m) ) )     &
                                       ) * surf_usm_v(l)%ddz_window_stag(nzb_wall,m)
@@ -5351,19 +6458,21 @@
                                  * surf_usm_v(l)%ddz_window(kw,m)                      &
                               + surf_usm_v(l)%rad_sw_in(m)                             &
-                                 * (exp(-surf_usm_v(l)%transmissivity(m)            &
+                                 * (exp(-win_absorp                                    &
                                     * surf_usm_v(l)%zw_window(kw-1,m)       )          &
-                                        - exp(-surf_usm_v(l)%transmissivity(m)      &
+                                        - exp(-win_absorp                              &
                                         * surf_usm_v(l)%zw_window(kw,m) ) )            &
                                  ) * surf_usm_v(l)%ddz_window_stag(kw,m)
                   ENDDO
-                  wintend(nzt_wall) = (1.0_wp / surf_usm_v(l)%rho_c_window(nzt_wall,m)) * &
-                                          ( surf_usm_v(l)%lambda_h_window(nzt_wall-1,m) * &
-                                            ( t_window_v(l)%t(nzt_wall,m)                 &
-                                            - t_window_v(l)%t(nzt_wall-1,m) ) *           &
-                                            surf_usm_v(l)%ddz_window(nzt_wall,m)          &
-                                          + surf_usm_v(l)%iwghf_eb_window(m)              &
-                                          + surf_usm_v(l)%rad_sw_in(m)                    &
-                                            * (1.0_wp - exp(-surf_usm_v(l)%transmissivity(m) &
-                                            * surf_usm_v(l)%zw_window(nzt_wall,m) ) )     &
+                  wintend(nzt_wall) = (1.0_wp / surf_usm_v(l)%rho_c_window(nzt_wall,m)) *  &
+                                          ( -surf_usm_v(l)%lambda_h_window(nzt_wall-1,m) * &
+                                            ( t_window_v(l)%t(nzt_wall,m)                  &
+                                            - t_window_v(l)%t(nzt_wall-1,m) ) *            &
+                                            surf_usm_v(l)%ddz_window(nzt_wall,m)           &
+                                          + surf_usm_v(l)%iwghf_eb_window(m)               &
+                                          + surf_usm_v(l)%rad_sw_in(m)                     &
+                                            * (exp(-win_absorp                             &
+                                          * surf_usm_v(l)%zw_window(nzt_wall-1,m) )        &
+                                        - exp(-win_absorp                                  &
+                                            * surf_usm_v(l)%zw_window(nzt_wall,m) ) )      &
                                           ) * surf_usm_v(l)%ddz_window_stag(nzt_wall,m)
               ELSE
@@ -5377,7 +6486,7 @@
                                  * surf_usm_v(l)%ddz_window(kw,m)                      &
                               + surf_usm_v(l)%rad_sw_in(m)                             &
-                                 * (exp(-surf_usm_v(l)%transmissivity(m)            &
+                                 * (exp(-win_absorp                                    &
                                     * surf_usm_v(l)%zw_window(kw-1,m)       )          &
-                                        - exp(-surf_usm_v(l)%transmissivity(m)      &
+                                        - exp(-win_absorp                              &
                                         * surf_usm_v(l)%zw_window(kw,m) ) )            &
                                  ) * surf_usm_v(l)%ddz_window_stag(kw,m)
@@ -5390,4 +6499,5 @@
                                  * wintend(nzb_wall:nzt_wall) + tsc(3)           &
                                  * surf_usm_v(l)%tt_window_m(nzb_wall:nzt_wall,m) )   
+endif
 
 !
@@ -5407,4 +6517,7 @@
                   ENDIF
               ENDIF
+
+
+if (.NOT. spinup) then
 !--           calculate t_window tendencies for the next Runge-Kutta step
               IF ( timestep_scheme(1:5) == 'runge' )  THEN
@@ -5422,4 +6535,6 @@
                   ENDIF
               ENDIF
+endif
+
            ENDDO
         ENDDO
@@ -5441,9 +6556,25 @@
         INTEGER(iwp) ::  i,j,k,l,kw, m                      !< running indices
 
-        REAL(wp), DIMENSION(nzb_wall:nzt_wall) :: gtend  !< tendency
+        REAL(wp)     :: ke, lambda_h_green_sat
+        REAL(wp)     :: h_vg !< Van Genuchten coef. h
+        REAL(wp)     :: drho_l_lv
+
+        REAL(wp), DIMENSION(nzb_wall:nzt_wall) :: gtend,tend  !< tendency
+
+        REAL(wp), DIMENSION(nzb_wall:nzt_wall) :: root_extr_green
+
+        REAL(wp), DIMENSION(nzb_wall:nzt_wall+1) :: lambda_green_temp !< temp. lambda
+        REAL(wp), DIMENSION(nzb_wall:nzt_wall+1) :: gamma_green_temp !< temp. gamma
+
+        LOGICAL :: conserve_water_content = .true.
+
+
+        drho_l_lv = 1.0_wp / (rho_l * l_v)
 
 !
 !--     For horizontal surfaces                                   
         DO  m = 1, surf_usm_h%ns
+
+if (surf_usm_h%frac(ind_pav_green,m).gt.0.0_wp) then
 !
 !--        Obtain indices
@@ -5452,9 +6583,42 @@
            k = surf_usm_h%k(m)
 
+           DO  kw = nzb_wall, nzt_wall
+!
+!--           Calculate volumetric heat capacity of the soil, taking 
+!--           into account water content 
+              surf_usm_h%rho_c_total_green(kw,m) = (surf_usm_h%rho_c_green(kw,m) * (1.0_wp - swc_sat_h(kw,m)) &
+                                   + rho_c_water * swc_h(kw,m))
+   
+!
+!--           Calculate soil heat conductivity at the center of the soil
+!--           layers
+              lambda_h_green_sat = lambda_h_green_sm ** (1.0_wp - swc_sat_h(kw,m)) *    &
+                             lambda_h_water ** swc_h(kw,m)
+   
+              ke = 1.0_wp + LOG10(MAX(0.1_wp,swc_h(kw,m)             &
+                   / swc_sat_h(kw,m)))
+   
+              lambda_green_temp(kw) = ke * (lambda_h_green_sat - lambda_h_green_dry) +    &
+                               lambda_h_green_dry
+
+           ENDDO
+
+
+!
+!--        Calculate soil heat conductivity (lambda_h) at the _stag level 
+!--        using linear interpolation. For pavement surface, the
+!--        true pavement depth is considered
+           DO  kw = nzb_wall, nzt_wall
+             surf_usm_h%lambda_h_green(kw,m) = ( lambda_green_temp(kw+1) + lambda_green_temp(kw) )  &
+                                   * 0.5_wp
+           ENDDO
+!           surf_usm_h%lambda_h_green(nzt_wall+1,m) = lambda_green_temp(nzt_wall+1)           
+!--------------------------------------------------------------------------
+           
            t_green_h(nzt_wall+1,m) = t_wall_h(nzb_wall,m)
 !
 !--        prognostic equation for ground/roof temperature t_green_h
            gtend(:) = 0.0_wp
-           gtend(nzb_wall) = (1.0_wp / surf_usm_h%rho_c_green(nzb_wall,m)) *    &
+           gtend(nzb_wall) = (1.0_wp / surf_usm_h%rho_c_total_green(nzb_wall,m)) *    &
                                       ( surf_usm_h%lambda_h_green(nzb_wall,m) * &
                                         ( t_green_h(nzb_wall+1,m)               &
@@ -5465,5 +6629,5 @@
            
             DO  kw = nzb_wall+1, nzt_wall
-                gtend(kw) = (1.0_wp / surf_usm_h%rho_c_green(kw,m))             &
+                gtend(kw) = (1.0_wp / surf_usm_h%rho_c_total_green(kw,m))             &
                                * (   surf_usm_h%lambda_h_green(kw,m)            &
                                   * ( t_green_h(kw+1,m) - t_green_h(kw,m) )     &
@@ -5496,4 +6660,167 @@
                ENDIF
            ENDIF
+
+!--------------------------------------------------------------
+                DO  kw = nzb_wall, nzt_wall
+
+!
+!--                Calculate soil diffusivity at the center of the soil layers
+                   lambda_green_temp(kw) = (- b_ch * surf_usm_h%gamma_w_green_sat(kw,m) * psi_sat       &
+                                     / swc_sat_h(kw,m) ) * ( MAX( swc_h(kw,m),    &
+                                     wilt_h(kw,m) ) / swc_sat_h(kw,m) )**(           &
+                                     b_ch + 2.0_wp )
+
+!
+!--                Parametrization of Van Genuchten
+                   IF ( soil_type /= 7 )  THEN
+!
+!--                   Calculate the hydraulic conductivity after Van Genuchten 
+!--                   (1980)
+                      h_vg = ( ( (swc_res_h(kw,m) - swc_sat_h(kw,m)) / ( swc_res_h(kw,m) -    &
+                                 MAX( swc_h(kw,m), wilt_h(kw,m) ) ) )**(      &
+                                 surf_usm_h%n_vg_green(m) / (surf_usm_h%n_vg_green(m) - 1.0_wp ) ) - 1.0_wp  &
+                             )**( 1.0_wp / surf_usm_h%n_vg_green(m) ) / surf_usm_h%alpha_vg_green(m)
+
+
+                      gamma_green_temp(kw) = surf_usm_h%gamma_w_green_sat(kw,m) * ( ( (1.0_wp +         &
+                                      ( surf_usm_h%alpha_vg_green(m) * h_vg )**surf_usm_h%n_vg_green(m))**(  &
+                                      1.0_wp - 1.0_wp / surf_usm_h%n_vg_green(m) ) - (        &
+                                      surf_usm_h%alpha_vg_green(m) * h_vg )**( surf_usm_h%n_vg_green(m)      &
+                                      - 1.0_wp) )**2 )                         &
+                                      / ( ( 1.0_wp + ( surf_usm_h%alpha_vg_green(m) * h_vg    &
+                                      )**surf_usm_h%n_vg_green(m) )**( ( 1.0_wp  - 1.0_wp     &
+                                      / surf_usm_h%n_vg_green(m) ) *( surf_usm_h%l_vg_green(m) + 2.0_wp) ) )
+
+!
+!--                Parametrization of Clapp & Hornberger
+                   ELSE
+                      gamma_green_temp(kw) = surf_usm_h%gamma_w_green_sat(kw,m) * ( swc_h(kw,m)       &
+                                      / swc_sat_h(kw,m) )**(2.0_wp * b_ch + 3.0_wp)
+                   ENDIF
+
+                ENDDO
+
+!
+!--             Prognostic equation for soil moisture content. Only performed,
+!--             when humidity is enabled in the atmosphere
+                IF ( humidity )  THEN
+!
+!--                Calculate soil diffusivity (lambda_w) at the _stag level 
+!--                using linear interpolation. To do: replace this with
+!--                ECMWF-IFS Eq. 8.81
+                   DO  kw = nzb_wall, nzt_wall-1
+                     
+                      surf_usm_h%lambda_w_green(kw,m) = ( lambda_green_temp(kw+1) + lambda_green_temp(kw) )  &
+                                        * 0.5_wp
+                      surf_usm_h%gamma_w_green(kw,m)  = ( gamma_green_temp(kw+1) + gamma_green_temp(kw) )    &
+                                        * 0.5_wp
+
+                   ENDDO
+
+!
+!
+!--                In case of a closed bottom (= water content is conserved), 
+!--                set hydraulic conductivity to zero to that no water will be 
+!--                lost in the bottom layer.
+                   IF ( conserve_water_content )  THEN
+                      surf_usm_h%gamma_w_green(kw,m) = 0.0_wp
+                   ELSE
+                      surf_usm_h%gamma_w_green(kw,m) = gamma_green_temp(nzt_wall)
+                   ENDIF     
+
+!--                The root extraction (= root_extr * qsws_veg_eb / (rho_l     
+!--                * l_v)) ensures the mass conservation for water. The         
+!--                transpiration of plants equals the cumulative withdrawals by 
+!--                the roots in the soil. The scheme takes into account the 
+!--                availability of water in the soil layers as well as the root 
+!--                fraction in the respective layer. Layer with moisture below 
+!--                wilting point will not contribute, which reflects the 
+!--                preference of plants to take water from moister layers.
+
+!
+!--                Calculate the root extraction (ECMWF 7.69, the sum of 
+!--                root_extr = 1). The energy balance solver guarantees a 
+!--                positive transpiration, so that there is no need for an 
+!--                additional check.
+                   m_total = 0.0_wp
+                   DO  kw = nzb_wall, nzt_wall
+                       IF ( swc_h(kw,m) > wilt_h(kw,m) )  THEN
+                          m_total = m_total + rootfr_h(kw,m) * swc_h(kw,m)
+                       ENDIF
+                   ENDDO  
+
+                   IF ( m_total > 0.0_wp )  THEN
+                      DO  kw = nzb_wall, nzt_wall
+                         IF ( swc_h(kw,m) > wilt_h(kw,m) )  THEN
+                            root_extr_green(kw) = rootfr_h(kw,m) * swc_h(kw,m)      &
+                                                            / m_total
+                         ELSE
+                            root_extr_green(kw) = 0.0_wp
+                         ENDIF
+                      ENDDO
+                   ENDIF
+
+!
+!--                Prognostic equation for soil water content m_soil.
+                   tend(:) = 0.0_wp
+
+                   tend(nzb_wall) = ( surf_usm_h%lambda_w_green(nzb_wall,m) * (               &
+                            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)
+                                  ) * drho_l_lv )             &
+                                 * surf_usm_h%ddz_green_stag(nzb_wall,m)
+
+                   DO  kw = nzb_wall+1, nzt_wall-1
+                      tend(kw) = ( surf_usm_h%lambda_w_green(kw,m) * ( swc_h(kw+1,m)          &
+                                - swc_h(kw,m) ) * surf_usm_h%ddz_green(kw+1,m)              &
+                                - surf_usm_h%gamma_w_green(kw,m)                               &
+                                - surf_usm_h%lambda_w_green(kw-1,m) * (swc_h(kw,m) -         &
+                                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%ddz_green_stag(kw,m)
+
+                   ENDDO
+                   tend(nzt_wall) = ( - surf_usm_h%gamma_w_green(nzt_wall,m)                  &
+                                           - surf_usm_h%lambda_w_green(nzt_wall-1,m)          &
+                                           * (swc_h(nzt_wall,m)             &
+                                           - swc_h(nzt_wall-1,m))           &
+                                           * surf_usm_h%ddz_green(nzt_wall,m)                &
+                                           + 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%ddz_green_stag(nzt_wall,m)             
+
+                   swc_h_p(nzb_wall:nzt_wall,m) = swc_h(nzb_wall:nzt_wall,m)&
+                                                   + dt_3d * ( tsc(2) * tend(:)   &
+                                                   + tsc(3) * surf_usm_h%tswc_h_m(:,m) )   
+   
+!
+!--                Account for dry soils (find a better solution here!)
+                   DO  kw = nzb_wall, nzt_wall
+                      IF ( swc_h_p(kw,m) < 0.0_wp )  swc_h_p(kw,m) = 0.0_wp
+                   ENDDO
+
+!
+!--                Calculate m_soil tendencies for the next Runge-Kutta step
+                   IF ( timestep_scheme(1:5) == 'runge' )  THEN
+                      IF ( intermediate_timestep_count == 1 )  THEN
+                         DO  kw = nzb_wall, nzt_wall
+                            surf_usm_h%tswc_h_m(kw,m) = tend(kw)
+                         ENDDO
+                      ELSEIF ( intermediate_timestep_count <                   &
+                               intermediate_timestep_count_max )  THEN
+                         DO  kw = nzb_wall, nzt_wall
+                            surf_usm_h%tswc_h_m(kw,m) = -9.5625_wp * tend(kw) + 5.3125_wp&
+                                     * surf_usm_h%tswc_h_m(kw,m)
+                         ENDDO
+                      ENDIF
+                   ENDIF
+                ENDIF
+!--------------------------------------------------------------
+ENDIF
+           
         ENDDO
 
@@ -5502,4 +6829,7 @@
         DO  l = 0, 3                              
            DO  m = 1, surf_usm_v(l)%ns
+
+if (surf_usm_v(l)%frac(ind_pav_green,m).gt.0.0_wp) then
+  if (1.gt.2) then
 !
 !--           Obtain indices
@@ -5553,4 +6883,11 @@
                   ENDIF
               ENDIF
+endif
+
+DO  kw = nzb_wall, nzt_wall+1
+t_green_v(l)%t(kw,m) = t_wall_v(l)%t(nzb_wall,m)
+ENDDO
+              
+ENDIF
 
            ENDDO
@@ -5586,5 +6923,6 @@
                            roof_inner_temperature,                             &
                            soil_inner_temperature,                             &
-                           window_inner_temperature
+                           window_inner_temperature,                           &
+                           usm_wall_mod
 
        NAMELIST /urban_surface_parameters/                                     &
@@ -5604,5 +6942,6 @@
                            roof_inner_temperature,                             &
                            soil_inner_temperature,                             &
-                           window_inner_temperature
+                           window_inner_temperature,                           &
+                           usm_wall_mod
                            
                            
@@ -5842,8 +7181,8 @@
        LOGICAL, INTENT(OUT)  ::  found 
        
-       REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE   ::  tmp_surf_h, tmp_surf_window_h, tmp_surf_green_h
+       REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE   ::  tmp_surf_wall_h, tmp_surf_window_h, tmp_surf_green_h
        REAL(wp), DIMENSION(:,:), ALLOCATABLE, SAVE ::  tmp_wall_h, tmp_window_h, tmp_green_h
        
-       TYPE( t_surf_vertical ), DIMENSION(0:3), SAVE ::  tmp_surf_v, tmp_surf_window_v, tmp_surf_green_v
+       TYPE( t_surf_vertical ), DIMENSION(0:3), SAVE ::  tmp_surf_wall_v, tmp_surf_window_v, tmp_surf_green_v
        TYPE( t_wall_vertical ), DIMENSION(0:3), SAVE ::  tmp_wall_v, tmp_window_v, tmp_green_v
 
@@ -5858,5 +7197,5 @@
                    READ ( 13 ) ns_h_on_file_usm
                 
-                   IF ( ALLOCATED( tmp_surf_h ) ) DEALLOCATE( tmp_surf_h )
+                   IF ( ALLOCATED( tmp_surf_wall_h ) ) DEALLOCATE( tmp_surf_wall_h )
                    IF ( ALLOCATED( tmp_wall_h ) ) DEALLOCATE( tmp_wall_h ) 
                    IF ( ALLOCATED( tmp_surf_window_h ) )                       &
@@ -5873,5 +7212,5 @@
 !--                current processor, as the number of processors between 
 !--                restarts can change. 
-                   ALLOCATE( tmp_surf_h(1:ns_h_on_file_usm) )
+                   ALLOCATE( tmp_surf_wall_h(1:ns_h_on_file_usm) )
                    ALLOCATE( tmp_wall_h(nzb_wall:nzt_wall+1,                   &
                                         1:ns_h_on_file_usm) )
@@ -5890,6 +7229,6 @@
 
                    DO  l = 0, 3
-                      IF ( ALLOCATED( tmp_surf_v(l)%t ) )                      &
-                         DEALLOCATE( tmp_surf_v(l)%t )
+                      IF ( ALLOCATED( tmp_surf_wall_v(l)%t ) )                      &
+                         DEALLOCATE( tmp_surf_wall_v(l)%t )
                       IF ( ALLOCATED( tmp_wall_v(l)%t ) )                      &
                          DEALLOCATE( tmp_wall_v(l)%t )
@@ -5911,5 +7250,5 @@
 !--                restarts can change. 
                    DO  l = 0, 3
-                      ALLOCATE( tmp_surf_v(l)%t(1:ns_v_on_file_usm(l)) )
+                      ALLOCATE( tmp_surf_wall_v(l)%t(1:ns_v_on_file_usm(l)) )
                       ALLOCATE( tmp_wall_v(l)%t(nzb_wall:nzt_wall+1,           &
                                                 1:ns_v_on_file_usm(l) ) )
@@ -5950,13 +7289,13 @@
                 ENDIF
           
-             CASE ( 't_surf_h' )
+             CASE ( 't_surf_wall_h' )
 #if defined( __nopointer )                   
                 IF ( k == 1 )  THEN
-                   IF ( .NOT.  ALLOCATED( t_surf_h ) )                         &
-                      ALLOCATE( t_surf_h(1:surf_usm_h%ns) )
-                   READ ( 13 )  tmp_surf_h
+                   IF ( .NOT.  ALLOCATED( t_surf_wall_h ) )                         &
+                      ALLOCATE( t_surf_wall_h(1:surf_usm_h%ns) )
+                   READ ( 13 )  tmp_surf_wall_h
                 ENDIF
                 CALL surface_restore_elements(                                 &
-                                        t_surf_h, tmp_surf_h,                  &
+                                        t_surf_wall_h, tmp_surf_wall_h,                  &
                                         surf_usm_h%start_index,                &  
                                         start_index_on_file,                   &
@@ -5968,11 +7307,11 @@
 #else                  
                 IF ( k == 1 )  THEN
-                   IF ( .NOT.  ALLOCATED( t_surf_h_1 ) )                       &
-                      ALLOCATE( t_surf_h_1(1:surf_usm_h%ns) )
-                   READ ( 13 )  tmp_surf_h
+                   IF ( .NOT.  ALLOCATED( t_surf_wall_h_1 ) )                       &
+                      ALLOCATE( t_surf_wall_h_1(1:surf_usm_h%ns) )
+                   READ ( 13 )  tmp_surf_wall_h
                 ENDIF              
                 CALL surface_restore_elements(                                 &
-                                        t_surf_h_1, tmp_surf_h,                &
-                                        surf_usm_h%start_index,                & 
+                                        t_surf_wall_h_1, tmp_surf_wall_h,      &
+                                        surf_usm_h%start_index,                &
                                         start_index_on_file,                   &
                                         end_index_on_file,                     &
@@ -5983,13 +7322,13 @@
 #endif
 
-             CASE ( 't_surf_v(0)' )
+             CASE ( 't_surf_wall_v(0)' )
 #if defined( __nopointer )            
                 IF ( k == 1 )  THEN
-                   IF ( .NOT.  ALLOCATED( t_surf_v(0)%t ) )                    &
+                   IF ( .NOT.  ALLOCATED( t_surf_wall_v(0)%t ) )                    &
                       ALLOCATE( t_surf_v(0)%t(1:surf_usm_v(0)%ns) )
-                   READ ( 13 )  tmp_surf_v(0)%t
+                   READ ( 13 )  tmp_surf_wall_v(0)%t
                 ENDIF
                 CALL surface_restore_elements(                                 &
-                                        t_surf_v(0)%t, tmp_surf_v(0)%t,        &
+                                        t_surf_wall_v(0)%t, tmp_surf_wall_v(0)%t,        &
                                         surf_usm_v(0)%start_index,             &
                                         start_index_on_file,                   &
@@ -6001,10 +7340,10 @@
 #else                      
                 IF ( k == 1 )  THEN
-                   IF ( .NOT.  ALLOCATED( t_surf_v_1(0)%t ) )                  &
-                      ALLOCATE( t_surf_v_1(0)%t(1:surf_usm_v(0)%ns) )
-                   READ ( 13 )  tmp_surf_v(0)%t
+                   IF ( .NOT.  ALLOCATED( t_surf_wall_v_1(0)%t ) )                  &
+                      ALLOCATE( t_surf_wall_v_1(0)%t(1:surf_usm_v(0)%ns) )
+                   READ ( 13 )  tmp_surf_wall_v(0)%t
                 ENDIF
                 CALL surface_restore_elements(                                 &
-                                        t_surf_v_1(0)%t, tmp_surf_v(0)%t,      &
+                                        t_surf_wall_v_1(0)%t, tmp_surf_wall_v(0)%t,      &
                                         surf_usm_v(0)%start_index,             & 
                                         start_index_on_file,                   &
@@ -6016,13 +7355,13 @@
 #endif
                       
-             CASE ( 't_surf_v(1)' )
+             CASE ( 't_surf_wall_v(1)' )
 #if defined( __nopointer )        
                 IF ( k == 1 )  THEN
-                   IF ( .NOT.  ALLOCATED( t_surf_v(1)%t ) )                    &
-                      ALLOCATE( t_surf_v(1)%t(1:surf_usm_v(1)%ns) )
-                   READ ( 13 )  tmp_surf_v(1)%t
+                   IF ( .NOT.  ALLOCATED( t_surf_wall_v(1)%t ) )                    &
+                      ALLOCATE( t_surf_wall_v(1)%t(1:surf_usm_v(1)%ns) )
+                   READ ( 13 )  tmp_surf_wall_v(1)%t
                 ENDIF
                 CALL surface_restore_elements(                                 &
-                                        t_surf_v(1)%t, tmp_surf_v(1)%t,        &
+                                        t_surf_wall_v(1)%t, tmp_surf_wall_v(1)%t,        &
                                         surf_usm_v(1)%start_index,             & 
                                         start_index_on_file,                   &
@@ -6034,10 +7373,10 @@
 #else                      
                 IF ( k == 1 )  THEN
-                   IF ( .NOT.  ALLOCATED( t_surf_v_1(1)%t ) )                  &
-                      ALLOCATE( t_surf_v_1(1)%t(1:surf_usm_v(1)%ns) )
-                   READ ( 13 )  tmp_surf_v(1)%t
+                   IF ( .NOT.  ALLOCATED( t_surf_wall_v_1(1)%t ) )                  &
+                      ALLOCATE( t_surf_wall_v_1(1)%t(1:surf_usm_v(1)%ns) )
+                   READ ( 13 )  tmp_surf_wall_v(1)%t
                 ENDIF
                 CALL surface_restore_elements(                                 &
-                                        t_surf_v_1(1)%t, tmp_surf_v(1)%t,      &
+                                        t_surf_wall_v_1(1)%t, tmp_surf_wall_v(1)%t,      &
                                         surf_usm_v(1)%start_index,             & 
                                         start_index_on_file,                   &
@@ -6049,13 +7388,13 @@
 #endif
 
-             CASE ( 't_surf_v(2)' )
+             CASE ( 't_surf_wall_v(2)' )
 #if defined( __nopointer )          
                 IF ( k == 1 )  THEN
-                   IF ( .NOT.  ALLOCATED( t_surf_v(2)%t ) )                    &
-                      ALLOCATE( t_surf_v(2)%t(1:surf_usm_v(2)%ns) )
-                   READ ( 13 )  tmp_surf_v(2)%t
+                   IF ( .NOT.  ALLOCATED( t_surf_wall_v(2)%t ) )                    &
+                      ALLOCATE( t_surf_wall_v(2)%t(1:surf_usm_v(2)%ns) )
+                   READ ( 13 )  tmp_surf_wall_v(2)%t
                 ENDIF
                 CALL surface_restore_elements(                                 &
-                                        t_surf_v(2)%t, tmp_surf_v(2)%t,        &
+                                        t_surf_wall_v(2)%t, tmp_surf_wall_v(2)%t,        &
                                         surf_usm_v(2)%start_index,             & 
                                         start_index_on_file,                   &
@@ -6067,10 +7406,10 @@
 #else                      
                 IF ( k == 1 )  THEN
-                   IF ( .NOT.  ALLOCATED( t_surf_v_1(2)%t ) )                  &
-                      ALLOCATE( t_surf_v_1(2)%t(1:surf_usm_v(2)%ns) )
-                   READ ( 13 )  tmp_surf_v(2)%t
+                   IF ( .NOT.  ALLOCATED( t_surf_wall_v_1(2)%t ) )                  &
+                      ALLOCATE( t_surf_wall_v_1(2)%t(1:surf_usm_v(2)%ns) )
+                   READ ( 13 )  tmp_surf_wall_v(2)%t
                 ENDIF
                 CALL surface_restore_elements(                                 &
-                                        t_surf_v_1(2)%t, tmp_surf_v(2)%t,      &
+                                        t_surf_wall_v_1(2)%t, tmp_surf_wall_v(2)%t,      &
                                         surf_usm_v(2)%start_index,             &  
                                         start_index_on_file,                   &
@@ -6082,13 +7421,13 @@
 #endif
                       
-             CASE ( 't_surf_v(3)' )
+             CASE ( 't_surf_wall_v(3)' )
 #if defined( __nopointer )    
                 IF ( k == 1 )  THEN
-                   IF ( .NOT.  ALLOCATED( t_surf_v(3)%t ) )                    &
-                      ALLOCATE( t_surf_v(3)%t(1:surf_usm_v(3)%ns) )
-                   READ ( 13 )  tmp_surf_v(3)%t
+                   IF ( .NOT.  ALLOCATED( t_surf_wall_v(3)%t ) )                    &
+                      ALLOCATE( t_surf_wall_v(3)%t(1:surf_usm_v(3)%ns) )
+                   READ ( 13 )  tmp_surf_wall_v(3)%t
                 ENDIF
                 CALL surface_restore_elements(                                 &
-                                        t_surf_v(3)%t, tmp_surf_v(3)%t,        &
+                                        t_surf_wall_v(3)%t, tmp_surf_wall_v(3)%t,        &
                                         surf_usm_v(3)%start_index,             & 
                                         start_index_on_file,                   &
@@ -6100,10 +7439,10 @@
 #else                      
                 IF ( k == 1 )  THEN
-                   IF ( .NOT.  ALLOCATED( t_surf_v_1(3)%t ) )                  &
-                      ALLOCATE( t_surf_v_1(3)%t(1:surf_usm_v(3)%ns) )
-                   READ ( 13 )  tmp_surf_v(3)%t
+                   IF ( .NOT.  ALLOCATED( t_surf_wall_v_1(3)%t ) )                  &
+                      ALLOCATE( t_surf_wall_v_1(3)%t(1:surf_usm_v(3)%ns) )
+                   READ ( 13 )  tmp_surf_wall_v(3)%t
                 ENDIF
                 CALL surface_restore_elements(                                 &
-                                        t_surf_v_1(3)%t, tmp_surf_v(3)%t,      &
+                                        t_surf_wall_v_1(3)%t, tmp_surf_wall_v(3)%t,      &
                                         surf_usm_v(3)%start_index,             & 
                                         start_index_on_file,                   &
@@ -6706,7 +8045,7 @@
                 CALL surface_restore_elements(                                 &
                                         t_green_v(1)%t, tmp_green_v(1)%t,      &
-                                        surf_usm_v(1)%start_index,             &
+                                        surf_usm_v(1)%start_index,             & 
                                         start_index_on_file,                   &
-                                        end_index_on_file,                     &
+                                        end_index_on_file ,                    &
                                         nxlc, nysc,                            &
                                         nxlf, nxrf, nysf, nynf,                &
@@ -6722,5 +8061,5 @@
                 CALL surface_restore_elements(                                 &
                                         t_green_v_1(1)%t, tmp_green_v(1)%t,    &
-                                        surf_usm_v(1)%start_index,             &
+                                        surf_usm_v(1)%start_index,             & 
                                         start_index_on_file,                   &
                                         end_index_on_file,                     &
@@ -6879,5 +8218,5 @@
                                         surf_usm_v(1)%start_index,             & 
                                         start_index_on_file,                   &
-                                        end_index_on_file,                     &
+                                        end_index_on_file ,                    &
                                         nxlc, nysc,                            &
                                         nxlf, nxrf, nysf, nynf,                &
@@ -7002,5 +8341,5 @@
         INTEGER(iwp), DIMENSION(0:17, nysg:nyng, nxlg:nxrg)   :: usm_par
         REAL(wp), DIMENSION(1:14, nysg:nyng, nxlg:nxrg)       :: usm_val
-        INTEGER(iwp)                                          :: k, l, iw, jw, kw, it, ip, ii, ij, m
+        INTEGER(iwp)                                          :: k, l, d, iw, jw, kw, it, ip, ii, ij, m
         INTEGER(iwp)                                          :: i, j
         INTEGER(iwp)                                          :: nz, roof, dirwe, dirsn
@@ -7595,8 +8934,8 @@
 !--                     assign temperatures
                         IF ( d == 0 ) THEN
-                           t_surf_h(isurfl) = rtsurf
+                           t_surf_wall_h(isurfl) = rtsurf
                            t_wall_h(:,isurfl) = rtwall(:)
                         ELSE
-                           t_surf_v(d-1)%t(isurfl) = rtsurf
+                           t_surf_wall_v(d-1)%t(isurfl) = rtsurf
                            t_wall_v(d-1)%t(:,isurfl) = rtwall(:)
                         ENDIF
@@ -7633,11 +8972,20 @@
 !> TODO better description
 !------------------------------------------------------------------------------!
-    SUBROUTINE usm_surface_energy_balance
+    SUBROUTINE usm_surface_energy_balance( spinup )
+
 
         IMPLICIT NONE
 
-        INTEGER(iwp)                          :: i, j, k, l, m      !< running indices
+        INTEGER(iwp)                          :: i, j, k, l, d, m   !< running indices
         
-        REAL(wp)                              :: stend              !< surface tendency
+        INTEGER(iwp) ::  i_off     !< offset to determine index of surface element, seen from atmospheric grid point, for x
+        INTEGER(iwp) ::  j_off     !< offset to determine index of surface element, seen from atmospheric grid point, for y
+        INTEGER(iwp) ::  k_off     !< offset to determine index of surface element, seen from atmospheric grid point, for z
+
+        LOGICAL                               :: spinup             !true during spinup
+        
+        REAL(wp)                              :: u1,v1,w1           !< near wall u,v,w
+        REAL(wp)                              :: stend_wall              !< surface tendency
+        
         REAL(wp)                              :: stend_window       !< surface tendency
         REAL(wp)                              :: stend_green        !< surface tendency
@@ -7648,5 +8996,5 @@
         REAL(wp)                              :: coef_window_2      !< second  coeficient for prognostic window equation
         REAL(wp)                              :: coef_green_2       !< second  coeficient for prognostic green wall equation
-        REAL(wp)                              :: rho_cp             !< rho_wall_surface * cp
+        REAL(wp)                              :: rho_cp             !< rho_wall_surface * c_p
         REAL(wp)                              :: f_shf              !< factor for shf_eb
         REAL(wp)                              :: f_shf_window       !< factor for shf_eb window
@@ -7659,5 +9007,28 @@
         INTEGER(iwp)                          :: dhour              !< simulated hour of day (in UTC)
         REAL(wp)                              :: acoef              !< actual coefficient of diurnal profile of anthropogenic heat
-
+        REAL(wp) ::  f1,          & !< resistance correction term 1
+                     f2,          & !< resistance correction term 2
+                     f3,          & !< resistance correction term 3
+                     e,           & !< water vapour pressure
+                     e_s,         & !< water vapour saturation pressure
+                     e_s_dt,      & !< derivate of e_s with respect to T
+                     tend,        & !< tendency
+                     dq_s_dt,     & !< derivate of q_s with respect to T
+                     f_qsws,      & !< factor for qsws
+                     f_qsws_veg,  & !< factor for qsws_veg
+                     f_qsws_liq,  & !< factor for qsws_liq
+                     m_liq_max,   & !< maxmimum value of the liq. water reservoir
+                     qv1,         & !< specific humidity at first grid level
+                     m_max_depth = 0.0002_wp, & ! Maximum capacity of the water reservoir (m)
+                     rho_lv,      &
+                     drho_l_lv,   &
+                     q_s
+
+!
+!--     Index offset of surface element point with respect to adjoining 
+!--     atmospheric grid point 
+        k_off = surf_usm_h%koff
+        j_off = surf_usm_h%joff
+        i_off = surf_usm_h%ioff
 
 !        
@@ -7683,7 +9054,20 @@
            ENDIF
 #if ! defined( __nopointer )
+!            pt1  = pt(k,j,i)
+           IF ( humidity )  THEN
+              qv1 = q(k,j,i)
+           ELSE
+              qv1 = 0.0_wp
+           ENDIF
 !
 !--        calculate rho * c_p coefficient at surface layer
            rho_cp  = c_p * hyp(k) / ( r_d * surf_usm_h%pt1(m) * exner(k) )
+
+if (surf_usm_h%frac(ind_pav_green,m).gt.0.0_wp) then
+!
+!--         Calculate frequently used parameters
+            rho_lv    = rho_cp / c_p * l_v
+            drho_l_lv = 1.0_wp / (rho_l * l_v)
+endif
 #endif
 !
@@ -7731,4 +9115,94 @@
            f_shf_green  = rho_cp / surf_usm_h%r_a_green(m)
         
+!***************************************************************************************
+if (surf_usm_h%frac(ind_pav_green,m).gt.0.0_wp) then
+!--    Adapted from LSM:
+!--    Second step: calculate canopy resistance r_canopy
+!--    f1-f3 here are defined as 1/f1-f3 as in ECMWF documentation
+ 
+!--    f1: correction for incoming shortwave radiation (stomata close at 
+!--    night)
+       f1 = MIN( 1.0_wp, ( 0.004_wp * surf_usm_h%rad_sw_in(m) + 0.05_wp ) / &
+                        (0.81_wp * (0.004_wp * surf_usm_h%rad_sw_in(m)      &
+                         + 1.0_wp)) )
+!
+!--    f2: correction for soil moisture availability to plants (the 
+!--    integrated soil moisture must thus be considered here)
+!--    f2 = 0 for very dry soils
+          m_total = 0.0_wp
+          DO  k = nzb_wall, nzt_wall+1
+              m_total = m_total + rootfr_h(nzb_wall,m)                              &
+                        * MAX(swc_h(nzb_wall,m),wilt_h(nzb_wall,m))
+          ENDDO 
+
+          IF ( m_total > wilt_h(nzb_wall,m)  .AND.  m_total < fc_h(nzb_wall,m) )  THEN
+             f2 = ( m_total - wilt_h(nzb_wall,m) ) / (fc_h(nzb_wall,m) - wilt_h(nzb_wall,m) )
+          ELSEIF ( m_total >= fc_h(nzb_wall,m) )  THEN
+             f2 = 1.0_wp
+          ELSE
+             f2 = 1.0E-20_wp
+          ENDIF
+
+!
+!--    Calculate water vapour pressure at saturation 
+       e_s = 0.01_wp * 610.78_wp * EXP( 17.269_wp * ( t_surf_green_h(m) &
+                     - 273.16_wp ) / ( t_surf_green_h(m) - 35.86_wp ) )
+!
+!--    f3: correction for vapour pressure deficit
+       IF ( surf_usm_h%g_d(m) /= 0.0_wp )  THEN
+!
+!--       Calculate vapour pressure
+          e  = qv1 * surface_pressure / ( qv1 + 0.622_wp )
+          f3 = EXP ( - surf_usm_h%g_d(m) * (e_s - e) )
+       ELSE
+          f3 = 1.0_wp
+       ENDIF
+
+!
+!--    Calculate canopy resistance. In case that c_veg is 0 (bare soils),
+!--    this calculation is obsolete, as r_canopy is not used below.
+!--    To do: check for very dry soil -> r_canopy goes to infinity
+       surf_usm_h%r_canopy(m) = surf_usm_h%r_canopy_min(m) /                               &
+                              ( surf_usm_h%lai(m) * f1 * f2 * f3 + 1.0E-20_wp )
+
+!
+!--    Calculate the maximum possible liquid water amount on plants and
+!--    bare surface. For vegetated surfaces, a maximum depth of 0.2 mm is
+!--    assumed, while paved surfaces might hold up 1 mm of water. The 
+!--    liquid water fraction for paved surfaces is calculated after 
+!--    Noilhan & Planton (1989), while the ECMWF formulation is used for
+!--    vegetated surfaces and bare soils.
+       m_liq_max = m_max_depth * ( surf_usm_h%lai(m) )
+       surf_usm_h%c_liq(m) = MIN( 1.0_wp, ( m_liq_usm_h%var_usm_1d(m) / m_liq_max )**0.67 )
+!
+!--    Calculate saturation specific humidity
+       q_s = 0.622_wp * e_s / ( surface_pressure - e_s )
+!
+!--    In case of dewfall, set evapotranspiration to zero
+!--    All super-saturated water is then removed from the air
+       IF ( humidity  .AND.  q_s <= qv1 )  THEN
+          surf_usm_h%r_canopy(m) = 0.0_wp
+       ENDIF
+
+!
+!--    Calculate coefficients for the total evapotranspiration 
+!--    In case of water surface, set vegetation and soil fluxes to zero.
+!--    For pavements, only evaporation of liquid water is possible.
+       f_qsws_veg  = rho_lv *                                &
+                         ( 1.0_wp        - surf_usm_h%c_liq(m)    ) /   &
+                         ( surf_usm_h%r_a_green(m) + surf_usm_h%r_canopy(m) )
+       f_qsws_liq  = rho_lv * surf_usm_h%c_liq(m)   /             &
+                           surf_usm_h%r_a_green(m)
+
+       f_qsws = f_qsws_veg + f_qsws_liq
+!
+!--    Calculate derivative of q_s for Taylor series expansion
+       e_s_dt = e_s * ( 17.269_wp / ( t_surf_green_h(m) - 35.86_wp) -   &
+                        17.269_wp*( t_surf_green_h(m) - 273.16_wp)      &
+                       / ( t_surf_green_h(m) - 35.86_wp)**2 )
+
+       dq_s_dt = 0.622_wp * e_s_dt / ( surface_pressure - e_s_dt )
+endif
+!***********************************************************************************
 !--        add LW up so that it can be removed in prognostic equation
            surf_usm_h%rad_net_l(m) = surf_usm_h%rad_sw_in(m)  -                &
@@ -7742,7 +9216,8 @@
            coef_1 = surf_usm_h%rad_net_l(m) +                                  & 
                  ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(ind_veg_wall,m) * &
-                                       sigma_sb * t_surf_h(m) ** 4 +           &  
+                                       sigma_sb * t_surf_wall_h(m) ** 4 +           &  
                                        f_shf * surf_usm_h%pt1(m) +             &
                                        lambda_surface * t_wall_h(nzb_wall,m)
+if ((.NOT. spinup).AND.(surf_usm_h%frac(ind_wat_win,m).GT.0.0_wp)) then
            coef_window_1 = surf_usm_h%rad_net_l(m) +                           & 
                    ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(ind_wat_win,m)  &
@@ -7750,29 +9225,49 @@
                                        f_shf_window * surf_usm_h%pt1(m) +      &
                                        lambda_surface_window * t_window_h(nzb_wall,m)
+endif                 
+         IF ( (humidity).and.(surf_usm_h%frac(ind_pav_green,m).gt.0.0_wp) )  THEN
+                    coef_green_1 = surf_usm_h%rad_net_l(m) +                              & 
+                   ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(ind_pav_green,m) * sigma_sb * &
+                                       t_surf_green_h(m) ** 4 +                  &  
+                                          f_shf_green * surf_usm_h%pt1(m) + f_qsws * ( qv1 - q_s    &
+                                          + dq_s_dt * t_surf_green_h(m) )        &
+                                          +lambda_surface_green * t_green_h(nzb_wall,m)
+           ELSE
            coef_green_1 = surf_usm_h%rad_net_l(m) +                            & 
                  ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(ind_pav_green,m) *&
                                        sigma_sb * t_surf_green_h(m) ** 4 +     &  
                                        f_shf_green * surf_usm_h%pt1(m) +       &
-                                       lambda_surface_green * t_wall_h(nzb_wall,m)
+                                       lambda_surface_green * t_green_h(nzb_wall,m)
+          ENDIF
 
 !--        denominator of the prognostic equation
            coef_2 = 4.0_wp * surf_usm_h%emissivity(ind_veg_wall,m) *           &
-                             sigma_sb * t_surf_h(m) ** 3                       &
+                             sigma_sb * t_surf_wall_h(m) ** 3                       &
                            + lambda_surface + f_shf / exner(k)
+if ((.NOT. spinup).AND.(surf_usm_h%frac(ind_wat_win,m).GT.0.0_wp)) then
            coef_window_2 = 4.0_wp * surf_usm_h%emissivity(ind_wat_win,m) *     &
                              sigma_sb * t_surf_window_h(m) ** 3                &
                            + lambda_surface_window + f_shf_window / exner(k)
-           coef_green_2 = 4.0_wp * surf_usm_h%emissivity(ind_pav_green,m) *    &
-                             sigma_sb * t_surf_green_h(m) ** 3                 &
+endif
+           IF ( (humidity).and.(surf_usm_h%frac(ind_pav_green,m).gt.0.0_wp) )  THEN
+              coef_green_2 = 4.0_wp * surf_usm_h%emissivity(ind_pav_green,m) * sigma_sb *    &
+                                t_surf_green_h(m) ** 3 + f_qsws * dq_s_dt        &
+                              + lambda_surface_green + f_shf_green / exner(k)
+           ELSE
+           coef_green_2 = 4.0_wp * surf_usm_h%emissivity(ind_pav_green,m) * sigma_sb *    &
+                             t_surf_green_h(m) ** 3                           &
                            + lambda_surface_green + f_shf_green / exner(k)
+           ENDIF
 
 !--        implicit solution when the surface layer has no heat capacity,
 !--        otherwise use RK3 scheme.
-           t_surf_h_p(m) = ( coef_1 * dt_3d * tsc(2) +                        &
-                             surf_usm_h%c_surface(m) * t_surf_h(m) ) /        & 
+           t_surf_wall_h_p(m) = ( coef_1 * dt_3d * tsc(2) +                        &
+                             surf_usm_h%c_surface(m) * t_surf_wall_h(m) ) /        & 
                            ( surf_usm_h%c_surface(m) + coef_2 * dt_3d * tsc(2) ) 
+if ((.NOT. spinup).AND.(surf_usm_h%frac(ind_wat_win,m).GT.0.0_wp)) then
            t_surf_window_h_p(m) = ( coef_window_1 * dt_3d * tsc(2) +                        &
                              surf_usm_h%c_surface_window(m) * t_surf_window_h(m) ) /        & 
-                           ( surf_usm_h%c_surface_window(m) + coef_window_2 * dt_3d * tsc(2) ) 
+                           ( surf_usm_h%c_surface_window(m) + coef_window_2 * dt_3d * tsc(2) )
+endif
            t_surf_green_h_p(m) = ( coef_green_1 * dt_3d * tsc(2) +                        &
                              surf_usm_h%c_surface_green(m) * t_surf_green_h(m) ) /        & 
@@ -7780,8 +9275,10 @@
 
 !--        add RK3 term
-           t_surf_h_p(m) = t_surf_h_p(m) + dt_3d * tsc(3) *                   &
-                           surf_usm_h%tt_surface_m(m)
+           t_surf_wall_h_p(m) = t_surf_wall_h_p(m) + dt_3d * tsc(3) *                   &
+                           surf_usm_h%tt_surface_wall_m(m)
+
            t_surf_window_h_p(m) = t_surf_window_h_p(m) + dt_3d * tsc(3) *     &
                            surf_usm_h%tt_surface_window_m(m)
+
            t_surf_green_h_p(m) = t_surf_green_h_p(m) + dt_3d * tsc(3) *       &
                            surf_usm_h%tt_surface_green_m(m)
@@ -7790,5 +9287,5 @@
 !--        store also vpt_surface, which is, due to the lack of moisture on roofs simply
 !--        assumed to be the surface temperature.
-           surf_usm_h%pt_surface(m) = ( surf_usm_h%frac(ind_veg_wall,m) * t_surf_h_p(m)   &
+           surf_usm_h%pt_surface(m) = ( surf_usm_h%frac(ind_veg_wall,m) * t_surf_wall_h_p(m)   &
                                + surf_usm_h%frac(ind_wat_win,m) * t_surf_window_h_p(m)   &
                                + surf_usm_h%frac(ind_pav_green,m) * t_surf_green_h_p(m) )  &
@@ -7799,6 +9296,6 @@
 
 !--        calculate true tendency
-           stend = ( t_surf_h_p(m) - t_surf_h(m) - dt_3d * tsc(3) *           &
-                     surf_usm_h%tt_surface_m(m)) / ( dt_3d  * tsc(2) )
+           stend_wall = ( t_surf_wall_h_p(m) - t_surf_wall_h(m) - dt_3d * tsc(3) *           &
+                     surf_usm_h%tt_surface_wall_m(m)) / ( dt_3d  * tsc(2) )
            stend_window = ( t_surf_window_h_p(m) - t_surf_window_h(m) - dt_3d * tsc(3) *        &
                      surf_usm_h%tt_surface_window_m(m)) / ( dt_3d  * tsc(2) )
@@ -7809,11 +9306,11 @@
            IF ( timestep_scheme(1:5) == 'runge' )  THEN
               IF ( intermediate_timestep_count == 1 )  THEN
-                 surf_usm_h%tt_surface_m(m) = stend
+                 surf_usm_h%tt_surface_wall_m(m) = stend_wall
                  surf_usm_h%tt_surface_window_m(m) = stend_window
                  surf_usm_h%tt_surface_green_m(m) = stend_green
               ELSEIF ( intermediate_timestep_count <                          &
                         intermediate_timestep_count_max )  THEN
-                 surf_usm_h%tt_surface_m(m) = -9.5625_wp * stend +            &
-                                     5.3125_wp * surf_usm_h%tt_surface_m(m)
+                 surf_usm_h%tt_surface_wall_m(m) = -9.5625_wp * stend_wall +            &
+                                     5.3125_wp * surf_usm_h%tt_surface_wall_m(m)
                  surf_usm_h%tt_surface_window_m(m) = -9.5625_wp * stend_window +   &
                                      5.3125_wp * surf_usm_h%tt_surface_window_m(m)
@@ -7825,8 +9322,8 @@
 !--        in case of fast changes in the skin temperature, it is required to
 !--        update the radiative fluxes in order to keep the solution stable
-           IF ( ( ( ABS( t_surf_h_p(m) - t_surf_h(m) ) > 1.0_wp ) .OR.           &
-                ( ABS( t_surf_green_h_p(m) - t_surf_green_h(m) ) > 1.0_wp ) .OR. &
-                ( ABS( t_surf_window_h_p(m) - t_surf_window_h(m) ) > 1.0_wp ) )  &
-                 .AND.  unscheduled_radiation_calls  ) THEN
+           IF ( ( ( ABS( t_surf_wall_h_p(m)   - t_surf_wall_h(m) )   > 1.0_wp )   .OR. &
+                (   ABS( t_surf_green_h_p(m)  - t_surf_green_h(m) )  > 1.0_wp )   .OR. &
+                (   ABS( t_surf_window_h_p(m) - t_surf_window_h(m) ) > 1.0_wp ) )      &
+                   .AND.  unscheduled_radiation_calls  )  THEN
               force_radiation_call_l = .TRUE.
            ENDIF
@@ -7837,5 +9334,5 @@
                                      surf_usm_h%frac(ind_veg_wall,m) *                   &
                                      sigma_sb * surf_usm_h%emissivity(ind_veg_wall,m) *  &
-                                     ( t_surf_h_p(m)**4 - t_surf_h(m)**4 )               &
+                                     ( t_surf_wall_h_p(m)**4 - t_surf_wall_h(m)**4 )               &
                                     + surf_usm_h%frac(ind_wat_win,m) *                   &
                                      sigma_sb * surf_usm_h%emissivity(ind_wat_win,m) *   &
@@ -7846,5 +9343,5 @@
 
            surf_usm_h%wghf_eb(m)   = lambda_surface *                         &
-                                      ( t_surf_h_p(m) - t_wall_h(nzb_wall,m) )
+                                      ( t_surf_wall_h_p(m) - t_wall_h(nzb_wall,m) )
            surf_usm_h%wghf_eb_green(m)  = lambda_surface_green *                         &
                                           ( t_surf_green_h_p(m) - t_green_h(nzb_wall,m) )
@@ -7854,5 +9351,5 @@
 !
 !--        ground/wall/roof surface heat flux
-           surf_usm_h%wshf_eb(m)   = - f_shf  * ( surf_usm_h%pt1(m) - t_surf_h_p(m) / exner(k) ) *               &
+           surf_usm_h%wshf_eb(m)   = - f_shf  * ( surf_usm_h%pt1(m) - t_surf_wall_h_p(m) / exner(k) ) *               &
                                        surf_usm_h%frac(ind_veg_wall,m)         &
                                      - f_shf_window  * ( surf_usm_h%pt1(m) - t_surf_window_h_p(m) / exner(k) ) * &
@@ -7865,4 +9362,124 @@
            surf_usm_h%shf(m) = surf_usm_h%wshf_eb(m) / c_p
       
+!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+if (surf_usm_h%frac(ind_pav_green,m).gt.0.0_wp) then
+
+! print*, "tsurfroofgreen",m,t_surf_green_h_p(m),i,j,k,surf_usm_h%wghf_eb_green(m),surf_usm_h%rad_net_l(m),&
+!         surf_usm_h%wshf_eb(m),f_qsws_veg,f_qsws_liq,dq_s_dt
+! print*, "B",surf_usm_h%rad_sw_in(m),surf_usm_h%rad_sw_out(m),surf_usm_h%rad_lw_in(m),surf_usm_h%rad_lw_out(m)
+! print*, "lambdasurface",lambda_surface_green,lambda_surface,i,j,k
+! print*, "fractions",i,j,k,surf_usm_h%frac(0:2,m)
+if ((t_surf_green_h_p(m).gt.370.0_wp).or.(t_surf_green_h_p(m).lt.250.0_wp)) then
+  print*, t_surf_green_h_p(m),m,i,j,k
+  stop
+endif
+
+       IF ( humidity )  THEN
+          surf_usm_h%qsws_eb(m)  = - f_qsws * ( qv1 - q_s + dq_s_dt                     &
+                          * t_surf_green_h(m) - dq_s_dt *               &
+                            t_surf_green_h_p(m) )
+
+          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                      &
+                              + 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                      &
+                              + dq_s_dt * t_surf_green_h(m) - dq_s_dt   &
+                              * t_surf_green_h_p(m) )
+       ENDIF
+
+!
+!--    Calculate the true surface resistance
+       IF ( .NOT.  humidity )  THEN
+          surf_usm_h%r_s(m) = 1.0E10_wp
+       ELSE
+          surf_usm_h%r_s(m) = - rho_lv * ( qv1 - q_s + dq_s_dt                       &
+                          *  t_surf_green_h(m) - dq_s_dt *               &
+                            t_surf_green_h_p(m) ) /                     &
+                            (surf_usm_h%qsws(m) + 1.0E-20)  - surf_usm_h%r_a_green(m)
+       ENDIF
+
+!
+!--    Calculate change in liquid water reservoir due to dew fall or 
+!--    evaporation of liquid water
+       IF ( humidity )  THEN
+!
+!--       If precipitation is activated, add rain water to qsws_liq
+!--       and qsws_soil according the the vegetation coverage.
+!--       precipitation_rate is given in mm.
+          IF ( precipitation )  THEN
+
+!
+!--          Add precipitation to liquid water reservoir, if possible.
+!--          Otherwise, add the water to soil. In case of
+!--          pavements, the exceeding water amount is implicitely removed 
+!--          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%frac(ind_pav_green,m) * prr(k+k_off,j+j_off,i+i_off)&
+                                 * hyrho(k+k_off)                              &
+                                 * 0.001_wp * rho_l * l_v
+             ENDIF
+
+          ENDIF
+
+!
+!--       If the air is saturated, check the reservoir water level
+          IF ( surf_usm_h%qsws(m) < 0.0_wp )  THEN
+!
+!--          Check if reservoir is full (avoid values > m_liq_max)
+!--          In that case, qsws_liq goes to qsws_soil. In this 
+!--          case qsws_veg is zero anyway (because c_liq = 1),       
+!--          so that tend is zero and no further check is needed
+             IF ( m_liq_usm_h%var_usm_1d(m) == m_liq_max )  THEN
+!                 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
+             ENDIF
+
+!
+!--          In case qsws_veg becomes negative (unphysical behavior), 
+!--          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
+             ENDIF
+          ENDIF                    
+ 
+          surf_usm_h%qsws(m) = surf_usm_h%qsws(m) / l_v
+ 
+          tend = - surf_usm_h%qsws_liq_eb(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 +                      &
+                                          tsc(3) * tm_liq_usm_h_m%var_usm_1d(m) )
+!
+!--       Check if reservoir is overfull -> reduce to maximum
+!--       (conservation of water is violated here)
+          m_liq_usm_h_p%var_usm_1d(m) = MIN( m_liq_usm_h_p%var_usm_1d(m),m_liq_max )
+
+!
+!--       Check if reservoir is empty (avoid values < 0.0)
+!--       (conservation of water is violated here)
+          m_liq_usm_h_p%var_usm_1d(m) = MAX( m_liq_usm_h_p%var_usm_1d(m), 0.0_wp )
+!
+!--       Calculate m_liq tendencies for the next Runge-Kutta step
+          IF ( timestep_scheme(1:5) == 'runge' )  THEN
+             IF ( intermediate_timestep_count == 1 )  THEN
+                tm_liq_usm_h_m%var_usm_1d(m) = tend
+             ELSEIF ( intermediate_timestep_count <                            &
+                      intermediate_timestep_count_max )  THEN
+                tm_liq_usm_h_m%var_usm_1d(m) = -9.5625_wp * tend +             &
+                                              5.3125_wp * tm_liq_usm_h_m%var_usm_1d(m)
+             ENDIF
+          ENDIF
+
+       ENDIF
+else
+  surf_usm_h%r_s(m) = 1.0E10_wp
+endif
+
        ENDDO
 !
@@ -7886,7 +9503,20 @@
 
 #if ! defined( __nopointer )          
+!            pt1  = pt(k,j,i)
+           IF ( humidity )  THEN
+              qv1 = q(k,j,i)
+           ELSE
+              qv1 = 0.0_wp
+           ENDIF
 !
 !--          calculate rho * c_p coefficient at wall layer
              rho_cp  = c_p * hyp(k) / ( r_d * surf_usm_v(l)%pt1(m) * exner(k) )
+             
+if (surf_usm_v(l)%frac(1,m).gt.0.0_wp) then
+!
+!--         Calculate frequently used parameters
+            rho_lv    = rho_cp / c_p * l_v
+            drho_l_lv = 1.0_wp / (rho_l * l_v)
+endif
 #endif
 
@@ -7932,4 +9562,96 @@
              f_shf_green   = rho_cp / surf_usm_v(l)%r_a(m)
 
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+if (surf_usm_v(l)%frac(1,m).gt.0.0_wp) then
+!--    Adapted from LSM:
+!--    Second step: calculate canopy resistance r_canopy
+!--    f1-f3 here are defined as 1/f1-f3 as in ECMWF documentation
+ 
+!--    f1: correction for incoming shortwave radiation (stomata close at 
+!--    night)
+       f1 = MIN( 1.0_wp, ( 0.004_wp * surf_usm_v(l)%rad_sw_in(m) + 0.05_wp ) / &
+                        (0.81_wp * (0.004_wp * surf_usm_v(l)%rad_sw_in(m)      &
+                         + 1.0_wp)) )
+!
+!--    f2: correction for soil moisture availability to plants (the 
+!--    integrated soil moisture must thus be considered here)
+!--    f2 = 0 for very dry soils
+
+f2=1.0_wp
+!           m_total = 0.0_wp
+!           DO  k = nzb_wall, nzt_wall+1
+!               m_total = m_total + rootfr_h(nzb_wall,m)                              &
+!                         * MAX(swc_h(nzb_wall,m),wilt_h(nzb_wall,m))
+!           ENDDO 
+! 
+!           IF ( m_total > wilt_h(nzb_wall,m)  .AND.  m_total < fc_h(nzb_wall,m) )  THEN
+!              f2 = ( m_total - wilt_h(nzb_wall,m) ) / (fc_h(nzb_wall,m) - wilt_h(nzb_wall,m) )
+!           ELSEIF ( m_total >= fc_h(nzb_wall,m) )  THEN
+!              f2 = 1.0_wp
+!           ELSE
+!              f2 = 1.0E-20_wp
+!           ENDIF
+
+!
+!--    Calculate water vapour pressure at saturation 
+       e_s = 0.01_wp * 610.78_wp * EXP( 17.269_wp * (  t_surf_green_v_p(l)%t(m) &
+                     - 273.16_wp ) / (  t_surf_green_v_p(l)%t(m) - 35.86_wp ) )
+!
+!--    f3: correction for vapour pressure deficit
+       IF ( surf_usm_v(l)%g_d(m) /= 0.0_wp )  THEN
+!
+!--       Calculate vapour pressure
+          e  = qv1 * surface_pressure / ( qv1 + 0.622_wp )
+          f3 = EXP ( - surf_usm_v(l)%g_d(m) * (e_s - e) )
+       ELSE
+          f3 = 1.0_wp
+       ENDIF
+!
+!--    Calculate canopy resistance. In case that c_veg is 0 (bare soils),
+!--    this calculation is obsolete, as r_canopy is not used below.
+!--    To do: check for very dry soil -> r_canopy goes to infinity
+       surf_usm_v(l)%r_canopy(m) = surf_usm_v(l)%r_canopy_min(m) /                               &
+                              ( surf_usm_v(l)%lai(m) * f1 * f2 * f3 + 1.0E-20_wp )
+                              
+! !--    Calculate the maximum possible liquid water amount on plants and
+! !--    bare surface. For vegetated surfaces, a maximum depth of 0.2 mm is
+! !--    assumed, while paved surfaces might hold up 1 mm of water. The 
+! !--    liquid water fraction for paved surfaces is calculated after 
+! !--    Noilhan & Planton (1989), while the ECMWF formulation is used for
+! !--    vegetated surfaces and bare soils.
+! ! surf_usm_h%lai(m)=4.0_wp
+!        m_liq_max = m_max_depth * ( surf_usm_h%lai(m) )
+!        surf_usm_h%c_liq(m) = MIN( 1.0_wp, ( m_liq_usm_h%var_usm_1d(m) / m_liq_max )**0.67 )
+!
+!--    Calculate saturation specific humidity
+       q_s = 0.622_wp * e_s / ( surface_pressure - e_s )
+!
+!--    In case of dewfall, set evapotranspiration to zero
+!--    All super-saturated water is then removed from the air
+       IF ( humidity  .AND.  q_s <= qv1 )  THEN
+          surf_usm_v(l)%r_canopy(m) = 0.0_wp
+       ENDIF
+
+!
+!--    Calculate coefficients for the total evapotranspiration 
+!--    In case of water surface, set vegetation and soil fluxes to zero.
+!--    For pavements, only evaporation of liquid water is possible.
+       f_qsws_veg  = rho_lv *                                &
+                         ( 1.0_wp        - 0.0_wp ) / & !surf_usm_h%c_liq(m)    ) /   &
+                         ( surf_usm_v(l)%r_a(m) + surf_usm_v(l)%r_canopy(m) )
+!        f_qsws_liq  = rho_lv * surf_usm_h%c_liq(m)   /             &
+!                            surf_usm_h%r_a_green(m)
+
+       f_qsws = f_qsws_veg! + f_qsws_liq
+!
+!--    Calculate derivative of q_s for Taylor series expansion
+       e_s_dt = e_s * ( 17.269_wp / ( t_surf_green_v_p(l)%t(m) - 35.86_wp) -   &
+                        17.269_wp*( t_surf_green_v_p(l)%t(m) - 273.16_wp)      &
+                       / ( t_surf_green_v_p(l)%t(m) - 35.86_wp)**2 )
+
+       dq_s_dt = 0.622_wp * e_s_dt / ( surface_pressure - e_s_dt )
+endif
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+                
 !--          add LW up so that it can be removed in prognostic equation
              surf_usm_v(l)%rad_net_l(m) = surf_usm_v(l)%rad_sw_in(m)  -        &
@@ -7938,10 +9660,21 @@
                                           surf_usm_v(l)%rad_lw_out(m)
 
+if ((abs(t_surf_wall_v(l)%t(m)-276.).gt.100.).or.(abs(t_surf_window_v(l)%t(m)-276.).gt.300.) &
+.or.(abs(t_surf_green_v(l)%t(m)-276.).gt.100)) then
+print*, "tsurfvvvv",m,t_surf_wall_v(l)%t(m),t_surf_window_v(l)%t(m),t_surf_green_v(l)%t(m)
+print*, "params", surf_usm_v(l)%emissivity(ind_veg_wall,m),lambda_surface, t_wall_v(l)%t(nzb_wall:nzt_wall,m), &
+                  surf_usm_v(l)%emissivity(ind_wat_win,m),lambda_surface_window,t_window_v(l)%t(nzb_wall:nzt_wall,m),t_green_v(l)%t(nzb_wall:nzt_wall,m)
+print*, "dicken",surf_usm_v(l)%zw(nzb_wall:nzt_wall,m),surf_usm_v(l)%zw_window(nzb_wall:nzt_wall,m),surf_usm_v(l)%zw_green(nzb_wall:nzt_wall,m)
+print*, "c",surf_usm_v(l)%c_surface_window(m),surf_usm_v(l)%c_surface(m)
+!if ((abs(t_surf_v(l)%t(m)-276.).gt.10.).or.(abs(t_surf_window_v(l)%t(m)-276.).gt.10.)) then
+stop
+endif
 !--           numerator of the prognostic equation
               coef_1 = surf_usm_v(l)%rad_net_l(m) +                            & ! coef +1 corresponds to -lwout included in calculation of radnet_l
              ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(ind_veg_wall,m) *  &
-                                     sigma_sb *  t_surf_v(l)%t(m) ** 4 +       &  
+                                     sigma_sb *  t_surf_wall_v(l)%t(m) ** 4 +       &  
                                      f_shf * surf_usm_v(l)%pt1(m) +            &
                                      lambda_surface * t_wall_v(l)%t(nzb_wall,m)
+if ((.NOT. spinup).AND.(surf_usm_v(l)%frac(ind_wat_win,m).GT.0.0_wp)) then
               coef_window_1 = surf_usm_v(l)%rad_net_l(m) +                     & ! coef +1 corresponds to -lwout included in calculation of radnet_l
                ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(ind_wat_win,m) * &
@@ -7949,31 +9682,50 @@
                                      f_shf * surf_usm_v(l)%pt1(m) +            &
                                      lambda_surface_window * t_window_v(l)%t(nzb_wall,m)
-
+endif
+           IF ( (humidity).and.(surf_usm_v(l)%frac(ind_pav_green,m).gt.0.0_wp) )  THEN
               coef_green_1 = surf_usm_v(l)%rad_net_l(m) +                      & ! coef +1 corresponds to -lwout included in calculation of radnet_l
-              ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(ind_pav_green,m) *&
-                                     sigma_sb * t_surf_green_v(l)%t(m) ** 4 +  &  
+               ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(ind_pav_green,m) * sigma_sb *  &
+                                     t_surf_green_v(l)%t(m) ** 4 +               &  
+                                     f_shf * surf_usm_v(l)%pt1(m) +     f_qsws * ( qv1 - q_s    &
+                                          + dq_s_dt * t_surf_green_v(l)%t(m) ) +            &
+                                     lambda_surface_green * t_wall_v(l)%t(nzb_wall,m)
+           ELSE
+              coef_green_1 = surf_usm_v(l)%rad_net_l(m) +                        & ! coef +1 corresponds to -lwout included in calculation of radnet_l
+               ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(ind_pav_green,m) * sigma_sb *  &
+                                     t_surf_green_v(l)%t(m) ** 4 +               &  
                                      f_shf * surf_usm_v(l)%pt1(m) +            &
                                      lambda_surface_green * t_wall_v(l)%t(nzb_wall,m)
+           ENDIF
+                                     
 
 !--           denominator of the prognostic equation
-              coef_2 = 4.0_wp * surf_usm_v(l)%emissivity(ind_veg_wall,m) *     &
-                                sigma_sb * t_surf_v(l)%t(m) ** 3               &
-                              + lambda_surface + f_shf / exner(k)
-              coef_window_2 = 4.0_wp * surf_usm_v(l)%emissivity(ind_wat_win,m) *&
-                                sigma_sb * t_surf_window_v(l)%t(m) ** 3        &
+              coef_2 = 4.0_wp * surf_usm_v(l)%emissivity(ind_veg_wall,m) * sigma_sb *           &
+                                t_surf_wall_v(l)%t(m) ** 3                           &
+                              + lambda_surface + f_shf / exner(k)  
+if ((.NOT. spinup).AND.(surf_usm_v(l)%frac(ind_wat_win,m).GT.0.0_wp)) then             
+              coef_window_2 = 4.0_wp * surf_usm_v(l)%emissivity(ind_wat_win,m) * sigma_sb *           &
+                                t_surf_window_v(l)%t(m) ** 3                         &
                               + lambda_surface_window + f_shf / exner(k)
-              coef_green_2 = 4.0_wp * surf_usm_v(l)%emissivity(ind_pav_green,m) *&
-                                sigma_sb * t_surf_green_v(l)%t(m) ** 3         &
+endif
+           IF ( (humidity).and.(surf_usm_v(l)%frac(ind_pav_green,m).gt.0.0_wp) )  THEN
+               coef_green_2 = 4.0_wp * surf_usm_v(l)%emissivity(ind_pav_green,m) * sigma_sb *     &
+                                t_surf_green_v(l)%t(m) ** 3  + f_qsws * dq_s_dt      &
                               + lambda_surface_green + f_shf / exner(k)
+           ELSE
+              coef_green_2 = 4.0_wp * surf_usm_v(l)%emissivity(ind_pav_green,m) * sigma_sb *     &
+                                t_surf_green_v(l)%t(m) ** 3                          &
+                              + lambda_surface_green + f_shf / exner(k)
+           ENDIF
 
 !--           implicit solution when the surface layer has no heat capacity,
 !--           otherwise use RK3 scheme.
-              t_surf_v_p(l)%t(m) = ( coef_1 * dt_3d * tsc(2) +                 &
-                             surf_usm_v(l)%c_surface(m) * t_surf_v(l)%t(m) ) / & 
+              t_surf_wall_v_p(l)%t(m) = ( coef_1 * dt_3d * tsc(2) +                 &
+                             surf_usm_v(l)%c_surface(m) * t_surf_wall_v(l)%t(m) ) / & 
                            ( surf_usm_v(l)%c_surface(m) + coef_2 * dt_3d * tsc(2) ) 
+if ((.NOT. spinup).AND.(surf_usm_v(l)%frac(ind_wat_win,m).GT.0.0_wp)) then
               t_surf_window_v_p(l)%t(m) = ( coef_window_1 * dt_3d * tsc(2) +                 &
                              surf_usm_v(l)%c_surface_window(m) * t_surf_window_v(l)%t(m) ) / & 
                            ( surf_usm_v(l)%c_surface_window(m) + coef_window_2 * dt_3d * tsc(2) ) 
-
+endif
               t_surf_green_v_p(l)%t(m) = ( coef_green_1 * dt_3d * tsc(2) +                 &
                              surf_usm_v(l)%c_surface_green(m) * t_surf_green_v(l)%t(m) ) / & 
@@ -7981,6 +9733,6 @@
 
 !--           add RK3 term
-              t_surf_v_p(l)%t(m) = t_surf_v_p(l)%t(m) + dt_3d * tsc(3) *                   &
-                                surf_usm_v(l)%tt_surface_m(m)
+              t_surf_wall_v_p(l)%t(m) = t_surf_wall_v_p(l)%t(m) + dt_3d * tsc(3) *         &
+                                surf_usm_v(l)%tt_surface_wall_m(m)
               t_surf_window_v_p(l)%t(m) = t_surf_window_v_p(l)%t(m) + dt_3d * tsc(3) *     &
                                 surf_usm_v(l)%tt_surface_window_m(m)
@@ -7991,6 +9743,6 @@
 !--           store also vpt_surface, which is, due to the lack of moisture on roofs simply
 !--           assumed to be the surface temperature.     
-              surf_usm_v(l)%pt_surface(m) =  ( surf_usm_v(l)%frac(ind_veg_wall,m) * t_surf_v_p(l)%t(m)   &
-                                      + surf_usm_v(l)%frac(ind_wat_win,m) * t_surf_window_v_p(l)%t(m)    &
+              surf_usm_v(l)%pt_surface(m) =  ( surf_usm_v(l)%frac(ind_veg_wall,m) * t_surf_wall_v_p(l)%t(m)  &
+                                      + surf_usm_v(l)%frac(ind_wat_win,m) * t_surf_window_v_p(l)%t(m)  &
                                       + surf_usm_v(l)%frac(ind_pav_green,m) * t_surf_green_v_p(l)%t(m) ) &
                                       / exner(k)
@@ -8000,6 +9752,6 @@
 
 !--           calculate true tendency
-              stend = ( t_surf_v_p(l)%t(m) - t_surf_v(l)%t(m) - dt_3d * tsc(3) *&
-                        surf_usm_v(l)%tt_surface_m(m) ) / ( dt_3d  * tsc(2) )
+              stend_wall = ( t_surf_wall_v_p(l)%t(m) - t_surf_wall_v(l)%t(m) - dt_3d * tsc(3) *&
+                        surf_usm_v(l)%tt_surface_wall_m(m) ) / ( dt_3d  * tsc(2) )
               stend_window = ( t_surf_window_v_p(l)%t(m) - t_surf_window_v(l)%t(m) - dt_3d * tsc(3) *&
                         surf_usm_v(l)%tt_surface_window_m(m) ) / ( dt_3d  * tsc(2) )
@@ -8007,14 +9759,14 @@
                         surf_usm_v(l)%tt_surface_green_m(m) ) / ( dt_3d  * tsc(2) )
 
-!--           calculate t_surf tendencies for the next Runge-Kutta step
+!--           calculate t_surf_* tendencies for the next Runge-Kutta step
               IF ( timestep_scheme(1:5) == 'runge' )  THEN
                  IF ( intermediate_timestep_count == 1 )  THEN
-                    surf_usm_v(l)%tt_surface_m(m) = stend
+                    surf_usm_v(l)%tt_surface_wall_m(m) = stend_wall
                     surf_usm_v(l)%tt_surface_window_m(m) = stend_window
                     surf_usm_v(l)%tt_surface_green_m(m) = stend_green
                  ELSEIF ( intermediate_timestep_count <                                 &
                           intermediate_timestep_count_max )  THEN
-                    surf_usm_v(l)%tt_surface_m(m) = -9.5625_wp * stend +                &
-                                     5.3125_wp * surf_usm_v(l)%tt_surface_m(m)
+                    surf_usm_v(l)%tt_surface_wall_m(m) = -9.5625_wp * stend_wall +      &
+                                     5.3125_wp * surf_usm_v(l)%tt_surface_wall_m(m)
                     surf_usm_v(l)%tt_surface_green_m(m) = -9.5625_wp * stend_green +    &
                                      5.3125_wp * surf_usm_v(l)%tt_surface_green_m(m)
@@ -8027,8 +9779,8 @@
 !--           update the radiative fluxes in order to keep the solution stable
 
-              IF ( ( ( ABS( t_surf_v_p(l)%t(m) - t_surf_v(l)%t(m) ) > 1.0_wp ) .OR.            &
-                   ( ABS( t_surf_green_v_p(l)%t(m) - t_surf_green_v(l)%t(m) ) > 1.0_wp ) .OR.  &
-                   ( ABS( t_surf_window_v_p(l)%t(m) - t_surf_window_v(l)%t(m) ) > 1.0_wp ) )   &
-                     .AND.  unscheduled_radiation_calls ) THEN
+              IF ( ( ( ABS( t_surf_wall_v_p(l)%t(m)   - t_surf_wall_v(l)%t(m) )   > 1.0_wp ) .OR. &
+                   (   ABS( t_surf_green_v_p(l)%t(m)  - t_surf_green_v(l)%t(m) )  > 1.0_wp ) .OR. &
+                   (   ABS( t_surf_window_v_p(l)%t(m) - t_surf_window_v(l)%t(m) ) > 1.0_wp ) )    &
+                      .AND.  unscheduled_radiation_calls )  THEN
                  force_radiation_call_l = .TRUE.
               ENDIF
@@ -8039,6 +9791,6 @@
                                            ( surf_usm_v(l)%rad_net_l(m) +                            &
                                            3.0_wp * sigma_sb *                                       &
-                                           t_surf_v(l)%t(m)**4 - 4.0_wp * sigma_sb *                 &
-                                           t_surf_v(l)%t(m)**3 * t_surf_v_p(l)%t(m) )                &
+                                           t_surf_wall_v(l)%t(m)**4 - 4.0_wp * sigma_sb *                 &
+                                           t_surf_wall_v(l)%t(m)**3 * t_surf_wall_v_p(l)%t(m) )                &
                                          + surf_usm_v(l)%frac(ind_wat_win,m) *                       &
                                            ( surf_usm_v(l)%rad_net_l(m) +                            &
@@ -8055,5 +9807,5 @@
                                                 ( t_surf_window_v_p(l)%t(m) - t_window_v(l)%t(nzb_wall,m) )
               surf_usm_v(l)%wghf_eb(m)   = lambda_surface *                    &
-                                     ( t_surf_v_p(l)%t(m) - t_wall_v(l)%t(nzb_wall,m) )
+                                     ( t_surf_wall_v_p(l)%t(m) - t_wall_v(l)%t(nzb_wall,m) )
               surf_usm_v(l)%wghf_eb_green(m)  = lambda_surface_green *  &
                                                 ( t_surf_green_v_p(l)%t(m) - t_green_v(l)%t(nzb_wall,m) )
@@ -8062,5 +9814,5 @@
               surf_usm_v(l)%wshf_eb(m)   =                                     &
                  - f_shf  * ( surf_usm_v(l)%pt1(m) -                           &
-                 t_surf_v_p(l)%t(m) / exner(k) ) * surf_usm_v(l)%frac(ind_veg_wall,m)       &
+                 t_surf_wall_v_p(l)%t(m) / exner(k) ) * surf_usm_v(l)%frac(ind_veg_wall,m)       &
                  - f_shf_window  * ( surf_usm_v(l)%pt1(m) -                    &
                  t_surf_window_v_p(l)%t(m) / exner(k) ) * surf_usm_v(l)%frac(ind_wat_win,m)&
@@ -8072,4 +9824,69 @@
 !--           diffusion_s, surface_layer_fluxes,...
               surf_usm_v(l)%shf(m) = surf_usm_v(l)%wshf_eb(m) / c_p
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+if (surf_usm_v(l)%frac(ind_pav_green,m).gt.0.0_wp) then !111
+
+! print*, "tsurfroofgreen",m,t_surf_green_h_p(m),i,j,k,surf_usm_h%wghf_eb_green(m),surf_usm_h%rad_net_l(m),&
+!         surf_usm_h%wshf_eb(m),f_qsws_veg,f_qsws_liq,dq_s_dt
+! print*, "B",surf_usm_h%rad_sw_in(m),surf_usm_h%rad_sw_out(m),surf_usm_h%rad_lw_in(m),surf_usm_h%rad_lw_out(m)
+! print*, "lambdasurface",lambda_surface_green,lambda_surface,i,j,k
+! print*, "fractions",i,j,k,surf_usm_h%frac(0:2,m)
+if ((t_surf_green_v_p(l)%t(m).gt.370.0_wp).or.(t_surf_green_v_p(l)%t(m).lt.250.0_wp)) then
+  print*, t_surf_green_v_p(l)%t(m),m,i,j,k
+  stop
+endif
+
+       IF ( humidity )  THEN
+          surf_usm_v(l)%qsws_eb(m)  = - f_qsws * ( 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_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                      &
+                              + 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                      &
+!                               + dq_s_dt * t_surf_green_h(m) - dq_s_dt   &
+!                               * t_surf_green_h_p(m) )
+       ENDIF
+
+!
+!--    Calculate the true surface resistance
+       IF ( .NOT.  humidity )  THEN
+          surf_usm_v(l)%r_s(m) = 1.0E10_wp
+       ELSE
+          surf_usm_v(l)%r_s(m) = - rho_lv * ( 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_v(l)%qsws(m) + 1.0E-20)  - surf_usm_v(l)%r_a(m)
+       ENDIF
+
+       
+!
+!--    Calculate change in liquid water reservoir due to dew fall or 
+!--    evaporation of liquid water
+       IF ( humidity )  THEN
+!
+!--       If the air is saturated, check the reservoir water level
+          IF ( surf_usm_v(l)%qsws(m) < 0.0_wp )  THEN
+       
+!
+!--          In case qsws_veg becomes negative (unphysical behavior), 
+!--          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
+             ENDIF
+          ENDIF   
+    ENDIF
+else
+  surf_usm_v(l)%r_s(m) = 1.0E10_wp
+endif !111
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
 
            ENDDO
@@ -8130,4 +9947,106 @@
        ENDIF
 
+! !
+! !-- Calculate surface specific humidity
+!     IF ( humidity )  THEN
+!        CALL calc_q_surface_usm
+!     ENDIF
+
+
+    CONTAINS
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Calculation of specific humidity of the skin layer (surface). It is assumend
+!> that the skin is always saturated.
+!------------------------------------------------------------------------------!
+       SUBROUTINE calc_q_surface_usm
+
+          IMPLICIT NONE
+
+          REAL(wp) :: resistance    !< aerodynamic and soil resistance term
+
+          DO  m = 1, surf_usm_h%ns
+
+             i   = surf_usm_h%i(m)            
+             j   = surf_usm_h%j(m)
+             k   = surf_usm_h%k(m)
+
+!
+!--          Calculate water vapour pressure at saturation
+             e_s = 0.01_wp * 610.78_wp * EXP( 17.269_wp *                  &
+                                    ( t_surf_green_h_p(m) - 273.16_wp ) /  &
+                                    ( t_surf_green_h_p(m) - 35.86_wp  )    &
+                                         )
+
+!
+!--          Calculate specific humidity at saturation
+             q_s = 0.622_wp * e_s / ( surface_pressure - e_s )
+
+!              surf_usm_h%r_a_green(m) = ( surf_usm_h%pt1(m) - t_surf_green_h(m) / exner(k) ) /                  &
+!                    ( surf_usm_h%ts(m) * surf_usm_h%us(m) + 1.0E-10_wp )
+!                 
+! !--          make sure that the resistance does not drop to zero
+!              IF ( ABS(surf_usm_h%r_a_green(m)) < 1.0E-10_wp )  surf_usm_h%r_a_green(m) = 1.0E-10_wp
+
+             resistance = surf_usm_h%r_a_green(m) / ( surf_usm_h%r_a_green(m) + surf_usm_h%r_s(m) + 1E-5_wp )
+
+!
+!--          Calculate specific humidity at surface
+             IF ( bulk_cloud_model )  THEN
+                q(k,j,i) = resistance * q_s +                   &
+                                           ( 1.0_wp - resistance ) *              &
+                                           ( q(k,j,i) - ql(k,j,i) )
+             ELSE
+                q(k,j,i) = resistance * q_s +                   &
+                                           ( 1.0_wp - resistance ) *              &
+                                             q(k,j,i)
+             ENDIF
+
+!
+!--          Update virtual potential temperature
+             vpt(k,j,i) = pt(k,j,i) *         &
+                        ( 1.0_wp + 0.61_wp * q(k,j,i) )
+
+          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)
+
+!
+!--             Calculate water vapour pressure at saturation
+                e_s = 0.01_wp * 610.78_wp * EXP( 17.269_wp *                       &
+                                       ( t_surf_green_v_p(l)%t(m) - 273.16_wp ) /  &
+                                       ( t_surf_green_v_p(l)%t(m) - 35.86_wp  )    &
+                                            )
+
+!
+!--             Calculate specific humidity at saturation
+                q_s = 0.622_wp * e_s / ( surface_pressure -e_s )
+
+!
+!--             Calculate specific humidity at surface
+                IF ( bulk_cloud_model )  THEN
+                   q(k,j,i) = ( q(k,j,i) - ql(k,j,i) )
+                ELSE
+                   q(k,j,i) = q(k,j,i)
+                ENDIF
+!
+!--             Update virtual potential temperature
+                vpt(k,j,i) = pt(k,j,i) *         &
+                           ( 1.0_wp + 0.61_wp * q(k,j,i) )
+
+             ENDDO
+
+          ENDDO
+
+       END SUBROUTINE calc_q_surface_usm
+       
     END SUBROUTINE usm_surface_energy_balance
 
@@ -8146,7 +10065,7 @@
       
 #if defined( __nopointer )
-       t_surf_h    = t_surf_h_p
+       t_surf_wall_h    = t_surf_wall_h_p
        t_wall_h    = t_wall_h_p
-       t_surf_v    = t_surf_v_p
+       t_surf_wall_v    = t_surf_wall_v_p
        t_wall_v    = t_wall_v_p
        t_surf_window_h    = t_surf_window_h_p
@@ -8163,5 +10082,5 @@
 !
 !--          Horizontal surfaces
-             t_surf_h  => t_surf_h_1; t_surf_h_p  => t_surf_h_2
+             t_surf_wall_h  => t_surf_wall_h_1; t_surf_wall_h_p  => t_surf_wall_h_2
              t_wall_h     => t_wall_h_1;    t_wall_h_p     => t_wall_h_2
              t_surf_window_h  => t_surf_window_h_1; t_surf_window_h_p  => t_surf_window_h_2
@@ -8171,5 +10090,5 @@
 !
 !--          Vertical surfaces
-             t_surf_v  => t_surf_v_1; t_surf_v_p  => t_surf_v_2
+             t_surf_wall_v  => t_surf_wall_v_1; t_surf_wall_v_p  => t_surf_wall_v_2
              t_wall_v     => t_wall_v_1;    t_wall_v_p     => t_wall_v_2
              t_surf_window_v  => t_surf_window_v_1; t_surf_window_v_p  => t_surf_window_v_2
@@ -8180,5 +10099,5 @@
 !
 !--          Horizontal surfaces
-             t_surf_h  => t_surf_h_2; t_surf_h_p  => t_surf_h_1
+             t_surf_wall_h  => t_surf_wall_h_2; t_surf_wall_h_p  => t_surf_wall_h_1
              t_wall_h     => t_wall_h_2;    t_wall_h_p     => t_wall_h_1
              t_surf_window_h  => t_surf_window_h_2; t_surf_window_h_p  => t_surf_window_h_1
@@ -8188,5 +10107,5 @@
 !
 !--          Vertical surfaces
-             t_surf_v  => t_surf_v_2; t_surf_v_p  => t_surf_v_1
+             t_surf_wall_v  => t_surf_wall_v_2; t_surf_wall_v_p  => t_surf_wall_v_1
              t_wall_v     => t_wall_v_2;    t_wall_v_p     => t_wall_v_1
              t_surf_window_v  => t_surf_window_v_2; t_surf_window_v_p  => t_surf_window_v_1
@@ -8224,6 +10143,6 @@
        WRITE ( 14 )  surf_usm_h%end_index
 
-       CALL wrd_write_string( 't_surf_h' )
-       WRITE ( 14 )  t_surf_h
+       CALL wrd_write_string( 't_surf_wall_h' )
+       WRITE ( 14 )  t_surf_wall_h
 
        CALL wrd_write_string( 't_surf_window_h' )
@@ -8243,6 +10162,6 @@
           WRITE( dum, '(I1)')  l          
 
-          CALL wrd_write_string( 't_surf_v(' // dum // ')' )
-          WRITE ( 14 )  t_surf_v(l)%t
+          CALL wrd_write_string( 't_surf_wall_v(' // dum // ')' )
+          WRITE ( 14 )  t_surf_wall_v(l)%t
 
           CALL wrd_write_string( 't_surf_window_v(' // dum // ')' )
