Index: palm/trunk/SOURCE/Makefile
===================================================================
--- palm/trunk/SOURCE/Makefile	(revision 1495)
+++ palm/trunk/SOURCE/Makefile	(revision 1496)
@@ -20,5 +20,6 @@
 # Current revisions:
 # ------------------
-# 
+# Added land surface model and radiation model files: land_surface_model, 
+# radiation_model, user_init_land_surface
 # 
 # Former revisions:
@@ -206,6 +207,6 @@
 	init_grid.f90 init_masks.f90 init_ocean.f90 \
 	init_pegrid.f90 init_pt_anomaly.f90 init_rankine.f90 init_slope.f90 \
-	interaction_droplets_ptq.f90 local_flush.f90 local_getenv.f90 \
-	local_stop.f90 local_system.f90 local_tremain.f90 \
+	interaction_droplets_ptq.f90 land_surface_model.f90 local_flush.f90 \
+        local_getenv.f90 local_stop.f90 local_system.f90 local_tremain.f90 \
 	local_tremain_ini.f90 lpm.f90 lpm_advec.f90 lpm_boundary_conds.f90 \
 	lpm_calc_liquid_water_content.f90 lpm_collision_kernels.f90 \
@@ -221,7 +222,7 @@
 	package_parin.f90 palm.f90 parin.f90 plant_canopy_model.f90 poisfft.f90 \
 	poismg.f90 prandtl_fluxes.f90 pres.f90 print_1d.f90 production_e.f90 \
-	prognostic_equations.f90 progress_bar.f90 random_function.f90 \
-	random_gauss.f90 random_generator_parallel.f90 read_3d_binary.f90 \
-	read_var_list.f90 run_control.f90 \
+	prognostic_equations.f90 progress_bar.f90 radiation_model.f90 \
+	random_function.f90 random_gauss.f90 random_generator_parallel.f90 \
+	read_3d_binary.f90 read_var_list.f90 run_control.f90 \
 	set_slicer_attributes_dvrp.f90 singleton.f90 sor.f90 \
 	subsidence.f90 sum_up_3d_data.f90 \
@@ -237,4 +238,5 @@
 	user_dvrp_coltab.f90 user_header.f90 user_init.f90 \
 	user_init_3d_model.f90 user_init_grid.f90 \
+        user_init_land_surface.f90 \
 	user_init_plant_canopy.f90 user_last_actions.f90 user_lpm_advec.f90 \
 	user_lpm_init.f90 user_lpm_set_attributes.f90 user_module.f90 \
@@ -292,5 +294,6 @@
 check_for_restart.o: modules.o mod_kinds.o
 check_open.o: modules.o mod_kinds.o mod_particle_attributes.o
-check_parameters.o: modules.o mod_kinds.o subsidence.o plant_canopy_model.o
+check_parameters.o: modules.o mod_kinds.o subsidence.o land_surface_model.o\
+	plant_canopy_model.o
 close_file.o: modules.o mod_kinds.o
 compute_vpt.o: modules.o mod_kinds.o
@@ -327,5 +330,6 @@
 init_1d_model.o: modules.o mod_kinds.o
 init_3d_model.o: modules.o cpulog.o mod_kinds.o random_function.o advec_ws.o \
-	ls_forcing.o lpm_init.o plant_canopy_model.o random_generator_parallel.o
+	land_surface_model.o ls_forcing.o lpm_init.o plant_canopy_model.o \
+        radiation_model.o random_generator_parallel.o
 init_advec.o: modules.o mod_kinds.o
 init_cloud_physics.o: modules.o mod_kinds.o
@@ -340,4 +344,5 @@
 init_slope.o: modules.o mod_kinds.o
 interaction_droplets_ptq.o: modules.o mod_kinds.o
+land_surface_model.o: modules.o mod_kinds.o radiation_model.o
 local_flush.o: mod_kinds.o
 local_getenv.o: modules.o mod_kinds.o
@@ -383,5 +388,6 @@
 netcdf.o: modules.o mod_kinds.o
 nudging.o: modules.o cpulog.o mod_kinds.o
-package_parin.o: modules.o mod_kinds.o plant_canopy_model.o
+package_parin.o: modules.o mod_kinds.o land_surface_model.o plant_canopy_model.o \
+		 radiation_model.o
 palm.o: modules.o cpulog.o ls_forcing.o mod_kinds.o nudging.o
 parin.o: modules.o cpulog.o mod_kinds.o progress_bar.o
@@ -400,4 +406,5 @@
 	nudging.o plant_canopy_model.o production_e.o subsidence.o user_actions.o
 progress_bar.o: modules.o mod_kinds.o
+radiation_model.o : modules.o
 random_function.o: mod_kinds.o
 random_gauss.o: mod_kinds.o random_function.o random_generator_parallel.o
@@ -415,6 +422,8 @@
 temperton_fft.o: modules.o mod_kinds.o
 time_integration.o: modules.o advec_ws.o buoyancy.o calc_mean_profile.o \
-	cpulog.o interaction_droplets_ptq.o ls_forcing.o mod_kinds.o \
-	nudging.o production_e.o prognostic_equations.o progress_bar.o user_actions.o
+	cpulog.o interaction_droplets_ptq.o land_surface_model.o \
+	ls_forcing.o mod_kinds.o nudging.o production_e.o \
+	prognostic_equations.o progress_bar.o radiation_model.o \
+	user_actions.o
 time_to_string.o: mod_kinds.o
 timestep.o: modules.o cpulog.o mod_kinds.o
@@ -438,4 +447,5 @@
 user_init_3d_model.o: modules.o mod_kinds.o user_module.o
 user_init_grid.o: modules.o mod_kinds.o user_module.o
+user_init_land_surface.o: modules.o mod_kinds.o user_module.o land_surface_model.o
 user_init_plant_canopy.o: modules.o mod_kinds.o user_module.o plant_canopy_model.o
 user_last_actions.o: modules.o mod_kinds.o user_module.o
Index: palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- palm/trunk/SOURCE/check_parameters.f90	(revision 1495)
+++ palm/trunk/SOURCE/check_parameters.f90	(revision 1496)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Added checks for the land surface model
 ! 
 ! Former revisions:
@@ -251,4 +251,5 @@
     USE grid_variables
     USE indices
+    USE land_surface_model_mod
     USE kinds
     USE model_1d
@@ -258,4 +259,5 @@
     USE plant_canopy_model_mod
     USE profil_parameter
+    USE radiation_model_mod
     USE spectrum
     USE statistics
@@ -942,4 +944,48 @@
 
     ENDIF
+
+
+    IF ( land_surface )  THEN
+ 
+       IF ( ANY(soil_temperature == 9999999.9_wp) )  THEN
+             message_string = '&lsm_par list requires setting'//               &
+                              'of soil_temperature(0:3)'//                     &
+                              '/= 9999999.9'
+             CALL message( 'check_parameters', 'PA0398', 1, 2, 0, 6, 0 )
+       ENDIF   
+
+!      Dirichlet boundary conditions are allowed at the moment for testing 
+!      purposes
+!        IF ( bc_pt_b == 'dirichlet' .OR. bc_q_b == 'dirichlet' )  THEN
+!           message_string = 'lsm requires setting of'//                         &
+!                            'bc_pt_b = "neumann" and '//                        &
+!                            'bc_q_b  = "neumann"'
+!           CALL message( 'check_parameters', 'PA0399', 1, 2, 0, 6, 0 )
+!        ENDIF
+
+       IF ( .NOT. prandtl_layer )  THEN
+          message_string = 'lsm requires '//                                   &
+                           'prandtl_layer = .T.'
+          CALL message( 'check_parameters', 'PA0400', 1, 2, 0, 6, 0 )
+       ENDIF
+
+       IF ( veg_type == 0 )  THEN
+          IF ( SUM(root_fraction) /= 1.0_wp)  THEN
+             message_string = 'veg_type = 0 (user_defined)'//                  &
+                              'requires setting of root_fraction(0:3)'//       &
+                              '/= 9999999.9 and SUM(root_fraction) = 1'
+             CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
+          ENDIF
+       ENDIF
+
+       IF ( .NOT. radiation )  THEN
+          message_string = 'lsm requires '//                                   &
+                           'radiation = .T.'
+          CALL message( 'check_parameters', 'PA0402', 1, 2, 0, 6, 0 )
+       ENDIF
+
+
+    END IF 
+
 
     IF ( .NOT. ( loop_optimization == 'cache'  .OR.                            &
@@ -1599,11 +1645,14 @@
     IF ( surface_heatflux == 9999999.9_wp  )  THEN
        constant_heatflux = .FALSE.
-       IF ( large_scale_forcing )  THEN
+       IF ( large_scale_forcing  .OR.  land_surface )  THEN
           IF ( ibc_pt_b == 0 )  THEN
              constant_heatflux = .FALSE.
           ELSEIF ( ibc_pt_b == 1 )  THEN
              constant_heatflux = .TRUE.
-             IF ( TRIM( initializing_actions ) /= 'read_restart_data' )  THEN
+             IF ( TRIM( initializing_actions ) /= 'read_restart_data' .AND.    &
+                  .NOT. land_surface )  THEN
                 surface_heatflux = shf_surf(1)
+             ELSE
+                surface_heatflux = 0.0_wp
              ENDIF
           ENDIF
@@ -1611,6 +1660,6 @@
     ELSE
         constant_heatflux = .TRUE.
-        IF ( TRIM( initializing_actions ) /= 'read_restart_data' .AND. &
-               large_scale_forcing ) THEN
+        IF ( TRIM( initializing_actions ) /= 'read_restart_data' .AND.         &
+             .NOT. land_surface )  THEN
            surface_heatflux = shf_surf(1)
         ENDIF
@@ -1621,5 +1670,5 @@
     IF ( neutral )  THEN
 
-       IF ( surface_heatflux /= 0.0_wp  .AND.  surface_heatflux /= 9999999.9_wp ) &
+       IF ( surface_heatflux /= 0.0_wp  .AND. surface_heatflux /= 9999999.9_wp ) &
        THEN
           message_string = 'heatflux must not be set for pure neutral flow'
Index: palm/trunk/SOURCE/header.f90
===================================================================
--- palm/trunk/SOURCE/header.f90	(revision 1495)
+++ palm/trunk/SOURCE/header.f90	(revision 1496)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Renamed: "radiation -> "cloud_top_radiation"
 ! 
 ! Former revisions:
@@ -1600,5 +1600,5 @@
     ELSEIF ( humidity  .AND.  cloud_physics )  THEN
        WRITE ( io, 432 )
-       IF ( radiation )  WRITE ( io, 132 )
+       IF ( cloud_top_radiation )  WRITE ( io, 132 )
        IF ( icloud_scheme == 1 )  THEN
           IF ( precipitation )  WRITE ( io, 133 )
Index: palm/trunk/SOURCE/init_3d_model.f90
===================================================================
--- palm/trunk/SOURCE/init_3d_model.f90	(revision 1495)
+++ palm/trunk/SOURCE/init_3d_model.f90	(revision 1496)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! Added initialization of the land surface and radiation schemes
 ! 
 ! Former revisions:
@@ -210,5 +210,8 @@
     
     USE kinds
-    
+
+    USE land_surface_model_mod,                                                &
+        ONLY:  init_lsm, land_surface
+  
     USE ls_forcing_mod
     
@@ -225,4 +228,7 @@
     USE plant_canopy_model_mod,                                                &
         ONLY:  init_plant_canopy, plant_canopy
+
+    USE radiation_model_mod,                                                   &
+        ONLY:  init_radiation, radiation
     
     USE random_function_mod 
@@ -1584,4 +1590,17 @@
     IF ( particle_advection )  CALL lpm_init
 
+
+!
+!-- If required, initialize radiation model
+    IF ( radiation )  THEN
+       CALL init_radiation
+    ENDIF
+
+!
+!-- If required, initialize quantities needed for the LSM
+    IF ( land_surface )  THEN
+       CALL init_lsm
+    ENDIF
+
 !
 !-- Initialize the ws-scheme.    
Index: palm/trunk/SOURCE/land_surface_model.f90
===================================================================
--- palm/trunk/SOURCE/land_surface_model.f90	(revision 1496)
+++ palm/trunk/SOURCE/land_surface_model.f90	(revision 1496)
@@ -0,0 +1,1250 @@
+ MODULE land_surface_model_mod
+
+!--------------------------------------------------------------------------------!
+! This file is part of PALM.
+!
+! PALM is free software: you can redistribute it and/or modify it under the terms
+! of the GNU General Public License as published by the Free Software Foundation,
+! either version 3 of the License, or (at your option) any later version.
+!
+! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
+! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+!
+! You should have received a copy of the GNU General Public License along with
+! PALM. If not, see <http://www.gnu.org/licenses/>.
+!
+! Copyright 1997-2014 Leibniz Universitaet Hannover
+!--------------------------------------------------------------------------------!
+!
+! Current revisions:
+! -----------------
+! Initial revision
+! 
+! Former revisions:
+! -----------------
+! $Id$
+!
+!
+! Description:
+! ------------
+! Land surface model, consisting of a solver for the energy balance at the
+! surface and a four layer soil scheme. The scheme is similar to the TESSEL
+! scheme implemented in the ECMWF IFS model, with modifications according to
+! H-TESSEL. The implementation is based on the formulation implemented in the 
+! DALES model.
+!------------------------------------------------------------------------------!
+     USE arrays_3d,                                                            &
+         ONLY:  pt, pt_p, q, q_p, qsws, rif, shf, ts, us, z0, z0h
+
+     USE cloud_parameters,                                                     &
+         ONLY: cp, l_d_r, l_v, rho_l, r_d, r_v
+
+     USE control_parameters,                                                   &
+         ONLY: dt_3d, humidity, intermediate_timestep_count,                   &
+               intermediate_timestep_count_max, pt_surface, rho_surface,       &
+               surface_pressure, timestep_scheme, tsc
+
+     USE indices,                                                              &
+         ONLY: nxlg, nxrg, nyng, nysg, nzb_s_inner 
+
+     USE kinds
+
+     USE radiation_model_mod,                                                  &
+         ONLY: Rn, SW_in, sigma_SB
+
+
+    IMPLICIT NONE
+
+!
+!-- LSM model constants
+    INTEGER(iwp), PARAMETER :: soil_layers = 4 !: number of soil layers (fixed for now)
+
+    REAL(wp), PARAMETER ::                     &
+              b_CH               = 6.04_wp,    & ! Clapp & Hornberger exponent
+              lambda_h_dry       = 0.19_wp,    & ! heat conductivity for dry soil
+              lambda_h_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
+              rhoC_soil          = 2.19E6_wp,  & ! volumetric heat capacity of soil
+              rhoC_water         = 4.20E6_wp,  & ! volumetric heat capacity of water
+              m_max_depth        = 0.0002_wp     ! Maximum capacity of the water reservoir (m)
+
+
+!
+!-- LSM variables
+    INTEGER(iwp) :: veg_type  = 2, & !: vegetation type, 0: user-defined, 1-19: generic (see list)
+                    soil_type = 3    !: soil type, 0: user-defined, 1-6: generic (see list)
+
+    LOGICAL :: conserve_water_content = .TRUE., & !: open or closed bottom surface for the soil model
+               land_surface = .FALSE.             !: flag parameter indicating wheather the lsm is used
+
+!   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 = 0.0_wp,            & !: NAMELIST alpha_VG
+                canopy_resistance_coefficient = 0.0_wp, & !: NAMELIST gD
+                C_skin   = 20000.0_wp,                  & !: Skin heat capacity
+                drho_l_lv,                              & !: (rho_l * l_v)**-1
+                exn,                                    & !: value of the Exner function
+                e_s = 0.0_wp,                           & !: saturation water vapour pressure
+                field_capacity = 0.0_wp,                & !: NAMELIST m_fc
+                f_shortwave_incoming = 9999999.9_wp,    & !: NAMELIST f_SW_in
+                hydraulic_conductivity = 0.0_wp,        & !: NAMELIST gamma_w_sat
+                Ke = 0.0_wp,                            & !: Kersten number
+                lambda_skin_stable = 9999999.9_wp,      & !: NAMELIST lambda_skin_s
+                lambda_skin_unstable = 9999999.9_wp,    & !: NAMELIST lambda_skin_u
+                leaf_area_index = 9999999.9_wp,         & !: NAMELIST LAI
+                l_VanGenuchten = 0.0_WP,                & !: NAMELIST l_VG
+                min_canopy_resistance = 110.0_wp,       & !: NAMELIST r_s_min
+                m_total = 0.0_wp,                       & !: weighed total water content of the soil (m3/m3)
+                n_VanGenuchten = 0.0_WP,                & !: NAMELIST n_VG
+                q_s = 0.0_wp,                           & !: saturation specific humidity
+                residual_moisture = 0.0_wp,             & !: NAMELIST m_res
+                rho_cp,                                 & !: rho_surface * cp
+                rho_lv,                                 & !: rho * l_v
+                rd_d_rv,                                & !: r_d / r_v
+                saturation_moisture = 0.0_wp,           & !: NAMELIST m_sat
+                vegetation_coverage = 9999999.9_wp,     & !: NAMELIST c_veg
+                wilting_point = 0.0_wp                    !: NAMELIST m_wilt
+
+    REAL(wp), DIMENSION(0:soil_layers-1) :: &
+              ddz_soil,                     & !: 1/dz_soil
+              ddz_soil_stag,                & !: 1/dz_soil_stag
+              dz_soil,                      & !: soil grid spacing (center-center)
+              dz_soil_stag,                 & !: soil grid spacing (edge-edge) 
+              root_extr = 0.0_wp,           & !: root extraction
+              root_fraction = (/0.35_wp, 0.38_wp, 0.23_wp, 0.04_wp/), & !: distribution of root surface area to the individual soil layers
+              soil_level = (/0.07_wp, 0.28_wp, 1.00_wp,  2.89_wp/),   & !: soil layer depths (m)
+              soil_moisture    = 0.0_wp       !: soil moisture content (m3/m3)
+
+    REAL(wp), DIMENSION(0:soil_layers) ::   &
+              soil_temperature = 9999999.9_wp !: soil temperature (K)
+
+#if defined( __nopointer )
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: T_0,    & !: skin temperature (K)
+                                                     T_0_p,  & !: progn. skin temperature (K)
+                                                     m_liq,  & !: liquid water reservoir (m)
+                                                     m_liq_p   !: progn. liquid water reservoir (m)
+#else
+    REAL(wp), DIMENSION(:,:), POINTER :: T_0,   &
+                                         T_0_p, & 
+                                         m_liq, & 
+                                         m_liq_p
+
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: T_0_1, T_0_2,    &
+                                                     m_liq_1, m_liq_2
+#endif
+
+!
+!-- Temporal tendencies for time stepping            
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE :: tT_0_m,  & !: skin temperature tendency (K)
+                                             tm_liq_m   !: liquid water reservoir tendency (m)
+
+!
+!-- Energy balance variables                
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::                                   &
+              alpha_VG,      & !: coef. of Van Genuchten
+              c_liq,         & !: liquid water coverage (of vegetated area)
+              c_veg,         & !: vegetation coverage   
+              f_SW_in,       & !: ?
+              G,             & !: surface soil heat flux
+              H,             & !: surface flux of sensible heat
+              gamma_w_sat,   & !: hydraulic conductivity at saturation
+              gD,            & !: coefficient for dependence of r_canopy on water vapour pressure deficit
+              LAI,           & !: leaf area index
+              LE,            & !: surface flux of latent heat (total)
+              LE_veg,        & !: surface flux of latent heat (vegetation portion)
+              LE_soil,       & !: surface flux of latent heat (soil portion)
+              LE_liq,        & !: surface flux of latent heat (liquid water portion)
+              lambda_h_sat,  & !: heat conductivity for dry soil
+              lambda_skin_s, & !: coupling between skin and soil (depends on vegetation type)
+              lambda_skin_u, & !: coupling between skin and soil (depends on vegetation type)
+              l_VG,          & !: coef. of Van Genuchten
+              m_fc,          & !: soil moisture at field capacity (m3/m3)
+              m_res,         & !: residual soil moisture
+              m_sat,         & !: saturation soil moisture (m3/m3)
+              m_wilt,        & !: soil moisture at permanent wilting point (m3/m3)
+              n_VG,          & !: coef. Van Genuchten  
+              r_a,           & !: aerodynamic resistance 
+              r_canopy,      & !: canopy resistance
+              r_soil,        & !: soil resitance
+              r_soil_min,    & !: minimum soil resistance
+              r_s,           & !: total surface resistance (combination of r_soil and r_canopy)          
+              r_s_min          !: minimum canopy resistance
+
+    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::                                 &
+              lambda_h, &   !: heat conductivity of soil (?)                            
+              lambda_w, &   !: hydraulic diffusivity of soil (?)
+              gamma_w,  &   !: hydraulic conductivity of soil (?)
+              rhoC_total    !: volumetric heat capacity of the actual soil matrix (?) 
+
+#if defined( __nopointer )
+    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, TARGET ::                         &
+              T_soil,    & !: Soil temperature (K)
+              T_soil_p,  & !: Prog. soil temperature (K)
+              m_soil,    & !: Soil moisture (m3/m3)
+              m_soil_p     !: Prog. soil moisture (m3/m3)
+#else
+    REAL(wp), DIMENSION(:,:,:), POINTER ::                                     &
+              T_soil, T_soil_p, &
+              m_soil, m_soil_p    
+
+    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, TARGET ::                         &
+              T_soil_1, T_soil_2, &
+              m_soil_1, m_soil_2
+
+
+#endif
+
+
+    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::                                 &
+              tT_soil_m, & !: T_soil storage array 
+              tm_soil_m, & !: m_soil storage array 
+              root_fr      !: root fraction (sum=1) 
+
+!
+!--  Land surface parameters according to the following classes (veg_type)
+!--  (0 user defined)
+!--  1 crops, mixed farming
+!--  2 short grass
+!--  3 evergreen needleleaf trees
+!--  4 deciduous needleleaf trees
+!--  5 evergreen broadleaf trees
+!--  6 deciduous broadleaf trees
+!--  7 tall grass
+!--  8 desert
+!--  9 tundra
+!-- 10 irrigated crops
+!-- 11 semidesert 
+!-- 12 ice caps and glaciers 
+!-- 13 bogs and marshes 
+!-- 14 inland water 
+!-- 15 ocean 
+!-- 16 evergreen shrubs 
+!-- 17 deciduous shrubs 
+!-- 18 mixed forest/woodland 
+!-- 19 interrupted forest 
+
+!
+!-- Land surface parameters I     r_s_min,     LAI,   c_veg,      gD
+    REAL(wp), DIMENSION(0:3,1:19) :: veg_pars = RESHAPE( (/           &
+                                 180.0_wp, 3.00_wp, 0.90_wp, 0.00_wp, & !  1
+                                 110.0_wp, 2.00_wp, 0.85_wp, 0.00_wp, & !  2
+                                 500.0_wp, 5.00_wp, 0.90_wp, 0.03_wp, & !  3
+                                 500.0_wp, 5.00_wp, 0.90_wp, 0.03_wp, & !  4
+                                 175.0_wp, 5.00_wp, 0.90_wp, 0.03_wp, & !  5
+                                 240.0_wp, 6.00_wp, 0.99_wp, 0.13_wp, & !  6
+                                 100.0_wp, 2.00_wp, 0.70_wp, 0.00_wp, & !  7
+                                 250.0_wp, 0.50_wp, 0.00_wp, 0.00_wp, & !  8
+                                  80.0_wp, 1.00_wp, 0.50_wp, 0.00_wp, & !  9
+                                 180.0_wp, 3.00_wp, 0.90_wp, 0.00_wp, & ! 10
+                                 150.0_wp, 0.50_wp, 0.10_wp, 0.00_wp, & ! 11
+                                   0.0_wp, 0.00_wp, 0.00_wp, 0.00_wp, & ! 12
+                                 240.0_wp, 4.00_wp, 0.60_wp, 0.00_wp, & ! 13
+                                   0.0_wp, 0.00_wp, 0.00_wp, 0.00_wp, & ! 14
+                                   0.0_wp, 0.00_wp, 0.00_wp, 0.00_wp, & ! 15
+                                 225.0_wp, 3.00_wp, 0.50_wp, 0.00_wp, & ! 16
+                                 225.0_wp, 1.50_wp, 0.50_wp, 0.00_wp, & ! 17
+                                 250.0_wp, 5.00_wp, 0.90_wp, 0.03_wp, & ! 18
+                                 175.0_wp, 2.50_wp, 0.90_wp, 0.03_wp  & ! 19
+                                 /), (/ 4, 19 /) )
+
+!
+!-- Land surface parameters II          z0,         z0h
+    REAL(wp), DIMENSION(0:1,1:19) :: roughness_par = RESHAPE( (/ & 
+                                   0.25_wp,  0.25E-2_wp,         & !  1
+                                   0.20_wp,  0.20E-2_wp,         & !  2
+                                   2.00_wp,     2.00_wp,         & !  3
+                                   2.00_wp,     2.00_wp,         & !  4
+                                   2.00_wp,     2.00_wp,         & !  5
+                                   2.00_wp,     2.00_wp,         & !  6
+                                   0.47_wp,  0.47E-2_wp,         & !  7
+                                  0.013_wp, 0.013E-2_wp,         & !  8
+                                  0.034_wp, 0.034E-2_wp,         & !  9
+                                    0.5_wp,  0.50E-2_wp,         & ! 10
+                                   0.17_wp,  0.17E-2_wp,         & ! 11
+                                 1.3E-3_wp,   1.3E-4_wp,         & ! 12
+                                   0.83_wp,  0.83E-2_wp,         & ! 13
+                                   0.00_wp,  0.00E-2_wp,         & ! 14
+                                   0.00_wp,  0.00E-2_wp,         & ! 15
+                                   0.10_wp,  0.10E-2_wp,         & ! 16
+                                   0.25_wp,  0.25E-2_wp,         & ! 17
+                                   2.00_wp,  2.00E-2_wp,         & ! 18
+                                   1.10_wp,  1.10E-2_wp          & ! 19
+                                 /), (/ 2, 19 /) )
+
+!
+!-- Land surface parameters III lambda_skin_s, lambda_skin_u, f_SW_in
+    REAL(wp), DIMENSION(0:2,1:19) :: skin_pars = RESHAPE( (/           &
+                                      10.0_wp,       10.0_wp, 0.05_wp, & !  1
+                                      10.0_wp,       10.0_wp, 0.05_wp, & !  2
+                                      20.0_wp,       15.0_wp, 0.03_wp, & !  3
+                                      20.0_wp,       15.0_wp, 0.03_wp, & !  4
+                                      20.0_wp,       15.0_wp, 0.03_wp, & !  5
+                                      20.0_wp,       15.0_wp, 0.03_wp, & !  6
+                                      10.0_wp,       10.0_wp, 0.05_wp, & !  7
+                                      15.0_wp,       15.0_wp, 0.00_wp, & !  8
+                                      10.0_wp,       10.0_wp, 0.05_wp, & !  9
+                                      10.0_wp,       10.0_wp, 0.05_wp, & ! 10 
+                                      10.0_wp,       10.0_wp, 0.05_wp, & ! 11
+                                      58.0_wp,       58.0_wp, 0.00_wp, & ! 12
+                                      10.0_wp,       10.0_wp, 0.05_wp, & ! 13 
+                                    1.0E20_wp,     1.0E20_wp, 0.00_wp, & ! 14
+                                    1.0E20_wp,     1.0E20_wp, 0.00_wp, & ! 15
+                                      10.0_wp,       10.0_wp, 0.05_wp, & ! 16
+                                      10.0_wp,       10.0_wp, 0.05_wp, & ! 17
+                                      20.0_wp,       15.0_wp, 0.03_wp, & ! 18
+                                      20.0_wp,       15.0_wp, 0.03_wp  & ! 19
+                                      /), (/ 3, 19 /) )
+
+!
+!-- Root distribution (sum = 1)  level 1, level 2, level 3, level 4,
+    REAL(wp), DIMENSION(0:3,1:19) :: root_distribution = RESHAPE( (/ &
+                                 0.24_wp, 0.41_wp, 0.31_wp, 0.04_wp, & !  1
+                                 0.35_wp, 0.38_wp, 0.23_wp, 0.04_wp, & !  2
+                                 0.26_wp, 0.39_wp, 0.29_wp, 0.06_wp, & !  3
+                                 0.26_wp, 0.38_wp, 0.29_wp, 0.07_wp, & !  4
+                                 0.24_wp, 0.38_wp, 0.31_wp, 0.07_wp, & !  5
+                                 0.25_wp, 0.34_wp, 0.27_wp, 0.14_wp, & !  6
+                                 0.27_wp, 0.27_wp, 0.27_wp, 0.09_wp, & !  7
+                                 1.00_wp, 0.00_wp, 0.00_wp, 0.00_wp, & !  8
+                                 0.47_wp, 0.45_wp, 0.08_wp, 0.00_wp, & !  9
+                                 0.24_wp, 0.41_wp, 0.31_wp, 0.04_wp, & ! 10
+                                 0.17_wp, 0.31_wp, 0.33_wp, 0.19_wp, & ! 11
+                                 0.00_wp, 0.00_wp, 0.00_wp, 0.00_wp, & ! 12
+                                 0.25_wp, 0.34_wp, 0.27_wp, 0.11_wp, & ! 13
+                                 0.00_wp, 0.00_wp, 0.00_wp, 0.00_wp, & ! 14
+                                 0.00_wp, 0.00_wp, 0.00_wp, 0.00_wp, & ! 15
+                                 0.23_wp, 0.36_wp, 0.30_wp, 0.11_wp, & ! 16 
+                                 0.23_wp, 0.36_wp, 0.30_wp, 0.11_wp, & ! 17 
+                                 0.19_wp, 0.35_wp, 0.36_wp, 0.10_wp, & ! 18
+                                 0.19_wp, 0.35_wp, 0.36_wp, 0.10_wp  & ! 19
+                                 /), (/ 4, 19 /) )
+
+!
+!-- Soil parameters according to the following porosity classes (soil_type)
+!-- (0 user defined)
+!-- 1 coarse
+!-- 2 medium
+!-- 3 medium-fine
+!-- 4 fine
+!-- 5 very fine
+!-- 6 organic
+!
+!-- Soil parameters I           alpha_VG,      l_VG,    n_VG, gamma_w_sat
+    REAL(wp), DIMENSION(0:3,1:6) :: 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
+                                 /), (/ 4, 6 /) )
+
+!
+!-- Soil parameters II              m_sat,     m_fc,   m_wilt,    m_res  
+    REAL(wp), DIMENSION(0:3,1:6) :: 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
+                                 /), (/ 4, 6 /) )
+
+
+    SAVE
+
+
+    PRIVATE
+
+
+    PUBLIC alpha_VanGenuchten, C_skin, canopy_resistance_coefficient,          &
+           conserve_water_content,      field_capacity, f_shortwave_incoming,  &
+           hydraulic_conductivity, init_lsm, lambda_skin_stable,               &
+           lambda_skin_unstable, land_surface, leaf_area_index,                &
+           lsm_energy_balance, lsm_soil_model, l_VanGenuchten,                 &
+           min_canopy_resistance, n_VanGenuchten, residual_moisture,           &
+           root_fraction, saturation_moisture, soil_level, soil_moisture,      &
+           soil_temperature, soil_type, vegetation_coverage, veg_type,         &
+           wilting_point
+
+#if defined( __nopointer )
+    PUBLIC m_liq, m_liq_p, m_soil, m_soil_p, T_0, T_0_p, T_soil, T_soil_p
+#else
+    PUBLIC m_liq, m_liq_1, m_liq_2, m_liq_p, m_soil, m_soil_1, m_soil_2,       &
+           m_soil_p, T_0, T_0_1, T_0_2, T_0_p, T_soil, T_soil_1, T_soil_2,     &
+           T_soil_p
+#endif
+
+
+    INTERFACE init_lsm
+       MODULE PROCEDURE init_lsm
+    END INTERFACE init_lsm
+
+    INTERFACE lsm_energy_balance
+       MODULE PROCEDURE lsm_energy_balance
+    END INTERFACE lsm_energy_balance
+
+    INTERFACE lsm_soil_model
+       MODULE PROCEDURE lsm_soil_model
+    END INTERFACE lsm_soil_model
+
+
+ CONTAINS
+
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!-- Initialization of the land surface model
+!------------------------------------------------------------------------------!
+    SUBROUTINE init_lsm
+    
+
+       IMPLICIT NONE
+
+       INTEGER(iwp) ::  i !: running index
+       INTEGER(iwp) ::  j !: running index
+       INTEGER(iwp) ::  k !: running index
+
+
+!
+!--    Calculate frequently used parameters
+       rho_cp    = cp * rho_surface
+       rd_d_rv   = r_d / r_v
+       rho_lv    = rho_surface * l_v
+       drho_l_lv = 1.0 / (rho_l * l_v)
+
+!
+!--    Allocate skin and soil temperature / humidity
+#if defined( __nopointer )
+       ALLOCATE ( T_0(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( T_0_p(nysg:nyng,nxlg:nxrg) )
+#else
+       ALLOCATE ( T_0_1(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( T_0_2(nysg:nyng,nxlg:nxrg) )
+#endif
+
+       ALLOCATE ( tT_0_m(nysg:nyng,nxlg:nxrg) )
+
+#if defined( __nopointer )
+       ALLOCATE ( T_soil(0:soil_layers,nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( T_soil_p(0:soil_layers,nysg:nyng,nxlg:nxrg) )
+#else
+       ALLOCATE ( T_soil_1(0:soil_layers,nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( T_soil_2(0:soil_layers,nysg:nyng,nxlg:nxrg) )
+#endif
+
+       ALLOCATE ( tT_soil_m(0:soil_layers-1,nysg:nyng,nxlg:nxrg) )
+
+#if defined( __nopointer )
+       ALLOCATE ( m_liq(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( m_liq_p(nysg:nyng,nxlg:nxrg) )
+#else
+       ALLOCATE ( m_liq_1(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( m_liq_2(nysg:nyng,nxlg:nxrg) )
+#endif
+
+       ALLOCATE ( tm_liq_m(nysg:nyng,nxlg:nxrg) )
+
+#if defined( __nopointer )
+       ALLOCATE ( m_soil(0:soil_layers-1,nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( m_soil_p(0:soil_layers-1,nysg:nyng,nxlg:nxrg) )
+#else
+       ALLOCATE ( m_soil_1(0:soil_layers-1,nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( m_soil_2(0:soil_layers-1,nysg:nyng,nxlg:nxrg) )
+#endif
+
+       ALLOCATE ( tm_soil_m(0:soil_layers-1,nysg:nyng,nxlg:nxrg) )
+
+
+#if ! defined( __nopointer )
+!
+!--    Initial assignment of the pointers
+       T_soil => T_soil_1; T_soil_p => T_soil_2
+       T_0 => T_0_1; T_0_p => T_0_2
+       m_soil => m_soil_1; m_soil_p => m_soil_2
+       m_liq => m_liq_1; m_liq_p => m_liq_2
+#endif
+
+       T_0    = 0.0_wp
+       T_0_p  = 0.0_wp
+       tT_0_m = 0.0_wp
+
+       T_soil    = 0.0_wp
+       T_soil_p  = 0.0_wp
+       tT_soil_m = 0.0_wp
+
+       m_liq    = 0.0_wp
+       m_liq_p  = 0.0_wp
+       tm_liq_m = 0.0_wp
+
+       m_soil    = 0.0_wp
+       m_soil_p  = 0.0_wp
+       tm_soil_m = 0.0_wp
+
+!
+!--    Allocate 2D vegetation model arrays
+       ALLOCATE ( alpha_VG(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( c_liq(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( c_veg(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( f_SW_in(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( G(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( H(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( gamma_w_sat(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( gD(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( LAI(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( LE(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( LE_veg(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( LE_soil(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( LE_liq(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( l_VG(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( lambda_h_sat(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( lambda_skin_u(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( lambda_skin_s(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( m_fc(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( m_res(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( m_sat(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( m_wilt(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( n_VG(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( r_a(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( r_canopy(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( r_soil(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( r_soil_min(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( r_s(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( r_s_min(nysg:nyng,nxlg:nxrg) )
+
+!
+!--    Set initial and default values
+       c_liq   = 0.0_wp
+       c_veg   = 0.0_wp
+       f_SW_in = 0.05_wp
+       gD      = 0.0_wp
+       LAI     = 0.0_wp
+       lambda_skin_u = 10.0_wp
+       lambda_skin_s = 10.0_wp
+
+
+       G       = 0.0_wp
+       H       = rho_cp * shf
+       LE      = rho_l * l_v * qsws
+       LE_veg  = 0.0_wp
+       LE_soil = LE
+       LE_liq  = 0.0_wp
+
+       r_a        = 50.0_wp
+       r_canopy   = 0.0_wp
+       r_soil     = 0.0_wp
+       r_soil_min = 50.0_wp
+       r_s        = 110.0_wp
+       r_s_min    = min_canopy_resistance
+
+!
+!--    Allocate 3D soil model arrays
+       ALLOCATE ( root_fr(0:soil_layers-1,nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( lambda_h(0:soil_layers-1,nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( rhoC_total(0:soil_layers-1,nysg:nyng,nxlg:nxrg) )
+
+       lambda_h = 0.0_wp
+!
+!--    If required, allocate humidity-related variables for the soil model
+       IF ( humidity )  THEN
+          ALLOCATE ( lambda_w(0:soil_layers-1,nysg:nyng,nxlg:nxrg) )
+          ALLOCATE ( gamma_w(0:soil_layers-1,nysg:nyng,nxlg:nxrg) )   
+
+          lambda_w = 0.0_wp 
+       ENDIF
+
+!
+!--    Calculate grid spacings. Temperature and moisture are defined at
+!--    the center of the soil layers, whereas gradients/fluxes are defined
+!--    at the edges (_stag)
+       dz_soil_stag(0) = soil_level(0)
+
+       DO k = 1, soil_layers-1
+          dz_soil_stag(k) = soil_level(k) - soil_level(k-1)
+       ENDDO
+
+       DO k = 0, soil_layers-2
+          dz_soil(k) = 0.5 * (dz_soil_stag(k+1) + dz_soil_stag(k))
+       ENDDO
+       dz_soil(soil_layers-1) = dz_soil_stag(soil_layers-1)
+
+       ddz_soil      = 1.0 / dz_soil
+       ddz_soil_stag = 1.0 / dz_soil_stag
+!
+!--    Initialize soil
+       IF ( soil_type .NE. 0 )  THEN   
+          alpha_VG    = soil_pars(0,soil_type)
+          l_VG        = soil_pars(1,soil_type)
+          n_VG        = soil_pars(2,soil_type)    
+          gamma_w_sat = soil_pars(3,soil_type) 
+          m_sat       = m_soil_pars(0,soil_type)
+          m_fc        = m_soil_pars(1,soil_type)   
+          m_wilt      = m_soil_pars(2,soil_type) 
+          m_res       = m_soil_pars(3,soil_type)
+       ELSE
+          alpha_VG    = alpha_VanGenuchten
+          l_VG        = l_VanGenuchten
+          n_VG        = n_VanGenuchten 
+          gamma_w_sat = hydraulic_conductivity
+          m_sat       = saturation_moisture
+          m_fc        = field_capacity
+          m_wilt      = wilting_point
+          m_res       = residual_moisture
+       ENDIF    
+
+!
+!--    Map user settings of T and q for each soil layer
+!--    (make sure that the soil moisture does not drop below the permanent
+!--    wilting point) -> problems with devision by zero)
+       DO k = 0, soil_layers-1
+          T_soil(k,:,:)  = soil_temperature(k)
+          m_soil(k,:,:)  = MAX(soil_moisture(k),m_wilt(:,:))
+       ENDDO
+       T_soil(soil_layers,:,:) = soil_temperature(soil_layers)
+
+
+       exn = ( surface_pressure / 1000.0_wp )**0.286_wp
+       T_0  = pt_surface * exn
+
+       T_soil_p = T_soil
+       m_soil_p = m_soil
+
+!
+!--    Calculate saturation soil heat conductivity
+       lambda_h_sat(:,:) = lambda_h_sm ** (1.0_wp - m_sat(:,:)) *              &
+                           lambda_h_water ** m_sat(:,:)
+
+!
+!--    Initialize vegetation
+       IF ( veg_type .NE. 0 )  THEN
+
+          r_s_min              = veg_pars(0,veg_type)
+          LAI                  = veg_pars(1,veg_type)
+          c_veg                = veg_pars(2,veg_type)
+          gD                   = veg_pars(3,veg_type)
+          lambda_skin_s        = skin_pars(0,veg_type)
+          lambda_skin_u        = skin_pars(1,veg_type)
+          f_SW_in              = skin_pars(2,veg_type)
+          z0                   = roughness_par(0,veg_type)
+          z0h                  = roughness_par(1,veg_type)
+
+
+          DO k = 0, soil_layers-1
+             root_fr(k,:,:) = root_distribution(k,veg_type)
+          ENDDO
+
+       ELSE
+
+          DO k = 0, soil_layers-1
+             root_fr(k,:,:) = root_fraction(k)
+          ENDDO
+
+       ENDIF
+
+!
+!--    Possibly do user-defined actions (e.g. define heterogeneous land surface)
+       CALL user_init_land_surface
+
+!
+!--    Set artifical values for ts and us so that r_a has its initial value for 
+!--    the first time step
+       DO  i = nxlg, nxrg
+          DO  j = nysg, nyng
+             k = nzb_s_inner(j,i)
+             us(j,i) = 0.1_wp
+             ts(j,i) = (pt(k+1,j,i) - pt(k,j,i)) / r_a(j,i)
+             shf(j,i) = - us(j,i) * ts(j,i)
+          ENDDO
+       ENDDO
+
+!
+!--    Calculate humidity at the surface
+       IF ( humidity )  THEN
+          CALL calc_q0
+       ENDIF
+
+       RETURN
+
+    END SUBROUTINE init_lsm
+
+
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!
+!------------------------------------------------------------------------------!
+    SUBROUTINE lsm_energy_balance
+
+
+       IMPLICIT NONE
+
+       INTEGER(iwp) ::  i         !: running index
+       INTEGER(iwp) ::  j         !: running index
+       INTEGER(iwp) ::  k, ks     !: running index
+
+       REAL(wp) :: f1,          & !: resistance correction term 1
+                   f2,          & !: resistance correction term 2
+                   f3,          & !: resistance correction term 3
+                   m_min,       & !: minimum soil moisture
+                   T_1,         & !: actual temperature at first grid point
+                   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
+                   coef_1,      & !: coef. for prognostic equation
+                   coef_2,      & !: coef. for prognostic equation
+                   f_LE,        & !: factor for LE
+                   f_LE_veg,    & !: factor for LE_veg
+                   f_LE_soil,   & !: factor for LE_soil
+                   f_LE_liq,    & !: factor for LE_liq
+                   f_H,         & !: factor for H
+                   lambda_skin, & !: Current value of lambda_skin
+                   m_liq_max      !: maxmimum value of the liquid water reservoir
+
+!
+!--    Calculate the exner function for the current time step
+       exn = ( surface_pressure / 1000.0_wp )**0.286_wp
+
+
+       DO i = nxlg, nxrg
+          DO j = nysg, nyng
+
+
+!
+!--          Set lambda_skin according to stratification
+             IF ( rif(j,i) >= 0.0_wp )  THEN
+                lambda_skin = lambda_skin_s(j,i)
+             ELSE
+                lambda_skin = lambda_skin_u(j,i)
+             ENDIF
+!
+!--          First step: calculate aerodyamic resistance. As pt(0), us, ts
+!--          are not available for the current time step, data from the last
+!--          time step is used here.
+             k = nzb_s_inner(j,i)
+
+!            r_a(j,i) = (pt(k+1,j,i) - pt(k,j,i)) / (ts(j,i) * us(j,i) + 1.0E-20)
+             r_a(j,i) = (pt(k+1,j,i) - pt(k,j,i)) / - (shf(j,i) + 1.0E-20)
+
+!
+!--          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
+             f1 = MIN(1.0_wp, ( 0.004_wp * SW_in(j,i) + 0.05_wp ) /     &
+                              (0.81_wp * (0.004_wp * SW_in(j,i) + 1.0_wp) ) )
+
+!
+!--          f2: correction for soil moisture f2=0 for very dry soil
+             m_total = 0.0_wp
+             DO ks = 0, soil_layers-1
+                 m_total = m_total + root_fr(ks,j,i) * m_soil(ks,j,i)
+             ENDDO 
+
+             IF (  m_total .GT. m_wilt(j,i) .AND. m_total .LE. m_fc(j,i) )  THEN
+                f2 = ( m_total - m_wilt(j,i) ) / (m_fc(j,i) - m_wilt(j,i) )
+             ELSE
+                f2 = 1.0E-20_wp
+             ENDIF
+
+!
+!--          Calculate water vapour pressure at saturation 
+!--          (T_0 should be replaced by liquid water temp?!)
+             e_s = 0.01 * 610.78_wp * EXP( 17.269_wp * ( T_0(j,i) - 273.16_wp )&
+                                           / ( T_0(j,i) - 35.86_wp ) )
+
+!
+!--          f3: correction for vapour pressure deficit
+             IF ( gD(j,i) .NE. 0.0_wp )  THEN
+!
+!--             Calculate vapour pressure
+                e  = q_p(k+1,j,i) * surface_pressure / 0.622
+                f3 = EXP ( -gD(j,i) * (e_s - e) )
+             ELSE
+                f3 = 1.0_wp
+             ENDIF
+
+!
+!--          To do: check for very dry soil -> r_canopy goes to infinity
+             r_canopy(j,i)  = r_s_min(j,i) / (LAI(j,i) * f1 * f2 * f3 + 1.0E-20)
+
+!
+!--          Third step: calculate bare soil resistance r_soil
+             m_min = c_veg(j,i) * m_wilt(j,i) + (1.0_wp - c_veg(j,i)) *        &
+                     m_res(j,i)
+
+             f2 = ( m_soil(0,j,i) - m_min ) / ( m_fc(j,i) - m_min )
+             f2 = MAX(f2,1.0E-20)
+
+             r_soil(j,i) = r_soil_min(j,i) / f2
+
+!
+!--          Calculate fraction of liquid water reservoir
+             m_liq_max = m_max_depth * LAI(j,i)
+             c_liq(j,i) = MIN(1.0, m_liq(j,i)/m_liq_max)
+
+             q_s = 0.622_wp * e_s / surface_pressure
+             IF ( q_s .LE. q_p(k+1,j,i))  THEN
+!               PRINT*, "dew fall at (before)", time_since_reference_point
+                r_canopy(j,i) = 0.0_wp
+                r_soil(j,i) = 0.0_wp
+             ENDIF 
+
+
+!
+!--          Calculate coefficients for the total evapotranspiration 
+             f_LE_veg  = rho_lv * c_veg(j,i) * (1.0 - c_liq(j,i)) / (r_a(j,i)  &
+                                                + r_canopy(j,i))
+             f_LE_soil = rho_lv * (1.0 - c_veg(j,i)) / (r_a(j,i) + r_soil(j,i))
+             f_LE_liq  = rho_lv * c_veg(j,i) * c_liq(j,i) / r_a(j,i)
+
+
+!            Plant cannot transpirate below wilting point. here, r_canopy
+!            should go to infinity
+!              IF ( m_soil(k,j,i) .LT. m_wilt(j,i) )  THEN
+!                 f_LE_veg(j,i) = 0.0
+!              ENDIF
+
+             f_H  = rho_cp / r_a(j,i)
+             f_LE = f_LE_veg + f_LE_soil + f_LE_liq
+       
+!
+!--          Calculate derivative of q_s for Taylor series expansion
+             e_s_dT = e_s * ( 17.269_wp / (T_0(j,i) - 35.86_wp) -              &
+                              17.269_wp*(T_0(j,i) - 273.16_wp) / (T_0(j,i)     &
+                              - 35.86_wp)**2 )
+
+             dq_s_dT = 0.622_wp * e_s_dT / surface_pressure
+
+             T_1 = pt_p(k+1,j,i) * exn
+
+!
+!--          Add LW up so that it can be removed in prognostic equation
+             Rn(j,i) = Rn(j,i) + sigma_SB * T_0(j,i) ** 4
+
+!
+!--          Numerator of the prognostic equation
+             coef_1 = Rn(j,i) + 3.0_wp * sigma_SB * T_0(j,i) ** 4 + f_H / exn  &
+                      * T_1 + f_LE * ( q_p(k+1,j,i) - q_s + dq_s_dT * T_0(j,i) &
+                                     ) + lambda_skin * T_soil(0,j,i)
+
+!
+!--          Denominator of the prognostic equation
+             coef_2 = 4.0_wp * sigma_SB * T_0(j,i) ** 3 + f_LE * dq_s_dT +     &
+                      lambda_skin + f_H / exn
+
+             tend = 0.0_wp
+
+!
+!--          Implicit solution when the skin layer has no heat capacity,
+!--          otherwise use RK3 scheme.
+             T_0_p(j,i) = ( coef_1 * dt_3d * tsc(2) + C_skin * T_0(j,i) ) /    &
+                          ( C_skin + coef_2 * dt_3d * tsc(2) ) 
+
+!
+!--          Add RK3 term
+             T_0_p(j,i) = T_0_p(j,i) + dt_3d * tsc(3) * tT_soil_m(0,j,i)
+
+!
+!--          Calculate true tendency
+             tend = (T_0_p(j,i) - T_0(j,i) - tsc(3) * tT_0_m(j,i)) / (dt_3d    &
+                      * tsc(2))
+
+!
+!--          Calculate T_0 tendencies for the next Runge-Kutta step
+             IF ( timestep_scheme(1:5) == 'runge' )  THEN
+                IF ( intermediate_timestep_count == 1 )  THEN
+                   tT_0_m(j,i) = tend
+                ELSEIF ( intermediate_timestep_count <                         &
+                         intermediate_timestep_count_max )  THEN
+                   tT_0_m(j,i) = -9.5625_wp * tend + 5.3125_wp * tT_0_m(j,i)
+                ENDIF
+             ENDIF
+
+             pt_p(k,j,i) = T_0_p(j,i) / exn
+!
+!--          Calculate fluxes
+             Rn(j,i)        = Rn(j,i) + 3.0_wp * sigma_SB * T_0(j,i)**4        &
+                              - 4.0_wp * sigma_SB * T_0(j,i)**3 * T_0_p(j,i)
+             G(j,i)         = lambda_skin * (T_0_p(j,i) - T_soil(0,j,i))
+             H(j,i)         = - f_H  * ( pt_p(k+1,j,i) - pt_p(k,j,i) )
+             LE(j,i)        = - f_LE      * ( q_p(k+1,j,i) - q_s + dq_s_dT *   &
+                                T_0(j,i) - dq_s_dT * T_0_p(j,i) )
+
+             LE_veg(j,i)    = - f_LE_veg  * ( q_p(k+1,j,i) - q_s + dq_s_dT *   &
+                                T_0(j,i) - dq_s_dT * T_0_p(j,i) )
+             LE_soil(j,i)   = - f_LE_soil * ( q_p(k+1,j,i) - q_s + dq_s_dT *   &
+                                T_0(j,i) - dq_s_dT * T_0_p(j,i) )
+             LE_liq(j,i)    = - f_LE_liq  * ( q_p(k+1,j,i) - q_s + dq_s_dT *   &
+                                T_0(j,i) - dq_s_dT * T_0_p(j,i) )
+
+
+!              IF ( i == 1 .AND. j == 1 )  THEN
+!                 PRINT*, "Rn", Rn(j,i)
+!                  PRINT*, "H", H(j,i)
+!                 PRINT*, "LE", LE(j,i)
+!                 PRINT*, "LE_liq", LE_liq(j,i)
+!                 PRINT*, "LE_veg", LE_veg(j,i)
+!                 PRINT*, "LE_soil", LE_soil(j,i)
+!                 PRINT*, "G", G(j,i)
+!              ENDIF
+
+
+             IF ( LE(j,i) .EQ. 0.0 )  THEN
+!               PRINT*, "+++ Evapotranspiration -> 0"
+                r_s(j,i) = 1.0E10
+             ELSE
+                r_s(j,i) = - rho_lv * ( q_p(k+1,j,i) - q_s + dq_s_dT * T_0(j,i)&
+                           - dq_s_dT * T_0_p(j,i) ) / LE(j,i) - r_a(j,i)
+             ENDIF
+
+!
+!--          Calculate change in liquid water reservoir due to dew fall or 
+!--          evaporation of liquid water (to do: add interception from rainfall)
+             IF ( q_s .LE. q_p(k+1,j,i))  THEN
+!
+!--             Check if reservoir is full (avoid values > m_liq_max)
+!--             In that case, LE_liq goes to LE_soil. In this case
+!--             LE_veg is zero anyway (because c_liq = 1), so that tend is
+!--             zero and no further check is needed
+                IF ( m_liq(j,i) .EQ. m_liq_max )  THEN
+                   LE_soil(j,i) = LE_soil(j,i) + LE_liq(j,i)
+                   LE_liq(j,i) = 0.0_wp
+                ENDIF
+
+!
+!--             In case LE_veg becomes negative (unphysical behavior), let
+!--             the water enter the liquid water reservoir as dew on the
+!--             plant
+                IF ( LE_veg(j,i) .LT. 0.0_wp )  THEN
+                   LE_liq(j,i) = LE_liq(j,i) + LE_veg(j,i)
+                   LE_veg(j,i) = 0.0_wp
+                ENDIF
+             ENDIF                    
+  
+             tend = - LE_liq(j,i) * drho_l_lv
+  
+
+             m_liq_p(j,i) = m_liq(j,i) + dt_3d * ( tsc(2) * tend               &
+                                                   + tsc(3) * tm_liq_m(j,i) )
+
+!
+!--          Check if reservoir is overfull -> reduce to maximum
+!--          (conservation of water is violated here)
+             m_liq_p(j,i) = MIN(m_liq_p(j,i),m_liq_max)
+
+!
+!--          Check if reservoir is empty (avoid values < 0.0)
+!--          (conservation of water is violated here)
+             m_liq_p(j,i) = MAX(m_liq_p(j,i),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_m(j,i) = tend
+                ELSEIF ( intermediate_timestep_count <                         &
+                         intermediate_timestep_count_max )  THEN
+                   tm_liq_m(j,i) = -9.5625_wp * tend + 5.3125_wp * tm_liq_m(j,i)
+                ENDIF
+             ENDIF
+
+!
+!--          Calculate fluxes in the atmosphere
+             shf(j,i) = H(j,i) / rho_cp
+             qsws(j,i) = LE(j,i) / rho_lv
+
+             ENDDO
+          ENDDO
+
+
+
+    END SUBROUTINE lsm_energy_balance
+
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!
+!------------------------------------------------------------------------------!
+    SUBROUTINE lsm_soil_model
+
+
+       IMPLICIT NONE
+
+       INTEGER(iwp) ::  i   !: running index
+       INTEGER(iwp) ::  j   !: running index
+       INTEGER(iwp) ::  k   !: running index
+
+       REAL(wp)     :: h_VG !: Van Genuchten coef. h
+
+       REAL(wp), DIMENSION(0:soil_layers-1) :: gamma_temp,  & !: temp. gamma
+                                               lambda_temp, & !: temp. lambda
+                                               tend           !: tendency
+
+       DO i = nxlg, nxrg    
+          DO j = nysg, nyng
+             DO k = 0, soil_layers-1
+!
+!--             Calculate volumetric heat capacity of the soil, taking into 
+!--             account water content 
+                rhoC_total(k,j,i) = (rhoC_soil * (1.0 - m_sat(j,i))            &
+                                     + rhoC_water * m_soil(k,j,i))
+
+!
+!--             Calculate soil heat conductivity at the center of the soil 
+!--             layers
+                Ke = 1.0 + LOG10(MAX(0.1,m_soil(k,j,i) / m_sat(j,i)))
+                lambda_temp(k) = Ke * (lambda_h_sat(j,i) + lambda_h_dry) +     &
+                                 lambda_h_dry
+
+             ENDDO
+
+!
+!--          Calculate soil heat conductivity (lambda_h) at the _stag level 
+!--          using linear interpolation
+             DO k = 0, soil_layers-2
+                  
+                lambda_h(k,j,i) = lambda_temp(k) +                             &
+                                  ( lambda_temp(k+1) - lambda_temp(k) )        &
+                                  * 0.5 * dz_soil_stag(k) * ddz_soil(k+1)
+
+             ENDDO
+             lambda_h(soil_layers-1,j,i) = lambda_temp(soil_layers-1)
+
+!
+!--          Prognostic equation for soil temperature T_soil
+             tend(:) = 0.0_wp
+             tend(0) = (1.0/rhoC_total(0,j,i)) *                               &
+                       ( lambda_h(0,j,i) * ( T_soil(1,j,i) - T_soil(0,j,i) )   &
+                         * ddz_soil(0) + G(j,i) ) * ddz_soil_stag(0)
+
+             DO  k = 1, soil_layers-1
+                tend(k) = (1.0/rhoC_total(k,j,i))                              &
+                          * (   lambda_h(k,j,i)                                &
+                              * ( T_soil(k+1,j,i) - T_soil(k,j,i) )            &
+                              * ddz_soil(k)                                    &
+                              - lambda_h(k-1,j,i)                              &
+                              * ( T_soil(k,j,i) - T_soil(k-1,j,i) )            &
+                              * ddz_soil(k-1)                                  &
+                            ) * ddz_soil_stag(k)
+             ENDDO
+
+             T_soil_p(0:soil_layers-1,j,i) = T_soil(0:soil_layers-1,j,i)       &
+                                             + dt_3d * ( tsc(2)                &
+                                             * tend(:) + tsc(3)                &
+                                             * tT_soil_m(:,j,i) )   
+
+!
+!--          Calculate T_soil tendencies for the next Runge-Kutta step
+             IF ( timestep_scheme(1:5) == 'runge' )  THEN
+                IF ( intermediate_timestep_count == 1 )  THEN
+                   DO  k = 0, soil_layers-1
+                      tT_soil_m(k,j,i) = tend(k)
+                   ENDDO
+                ELSEIF ( intermediate_timestep_count <                         &
+                         intermediate_timestep_count_max )  THEN
+                   DO  k = 0, soil_layers-1
+                      tT_soil_m(k,j,i) = -9.5625_wp * tend(k) + 5.3125_wp      &
+                                         * tT_soil_m(k,j,i)
+                   ENDDO
+                ENDIF
+             ENDIF
+
+
+             DO k = 0, soil_layers-1
+!
+!--             Calculate soil diffusivity at the center of the soil layers
+                lambda_temp(k) = (- b_CH * gamma_w_sat(j,i) * psi_sat          &
+                                  / m_sat(j,i) ) * ( MAX(m_soil(k,j,i),        &
+                                  m_wilt(j,i)) / m_sat(j,i) )**(b_CH + 2.0_wp)
+
+!
+!--             Calculate the hydraulic conductivity after Van Genuchten (1980)
+                h_VG = ( ( (m_res(j,i) - m_sat(j,i)) / ( m_res(j,i) -          &
+                           MAX(m_soil(k,j,i),m_wilt(j,i)) ) )**(n_VG(j,i)      &
+                           / (n_VG(j,i)-1.0_wp)) - 1.0_wp                      &
+                       )**(1.0_wp/n_VG(j,i)) / alpha_VG(j,i)
+
+                gamma_temp(k) = gamma_w_sat(j,i) * ( ( (1.0_wp +               &
+                                (alpha_VG(j,i)*h_VG)**n_VG(j,i))**(1.0_wp      &
+                                -1.0_wp/n_VG(j,i)) - (alpha_VG(j,i)*h_VG       &
+                                )**(n_VG(j,i)-1.0_wp))**2 )                    &
+                                / ( (1.0_wp + (alpha_VG(j,i)*h_VG)**n_VG(j,i)  &
+                                )**((1.0_wp - 1.0_wp/n_VG(j,i))*(l_VG(j,i)     &
+                                + 2.0)) )
+
+             ENDDO
+
+
+             IF ( humidity )  THEN
+!
+!--             Calculate soil diffusivity (lambda_w) at the _stag level 
+!--             using linear interpolation
+                DO k = 0, soil_layers-2
+                     
+                   lambda_w(k,j,i) = lambda_temp(k) +                          &
+                                     ( lambda_temp(k+1) - lambda_temp(k) )     &
+                                     * 0.5 * dz_soil_stag(k) * ddz_soil(k+1)
+                   gamma_w(k,j,i)  = gamma_temp(k) +                           &
+                                     ( gamma_temp(k+1) - gamma_temp(k) )       &
+                                     * 0.5 * dz_soil_stag(k) * ddz_soil(k+1)                 
+
+                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
+                   gamma_w(soil_layers-1,j,i) = 0.0_wp
+                ELSE
+                   gamma_w(soil_layers-1,j,i) = lambda_temp(soil_layers-1)
+                ENDIF     
+
+!--             The root extraction (= root_extr * LE_veg / (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
+
+!
+!--             Calculate the root extraction (ECMWF 7.69, with some
+!--             modifications)
+                m_total = 0.0_wp
+                DO k = 0, soil_layers-1
+                    m_total = m_total + root_fr(k,j,i) * m_soil(k,j,i) *       &
+                              dz_soil_stag(k) 
+
+                ENDDO  
+
+!
+!--             For conservation of mass, the sum of root_extr must be 1
+                DO k = 0, soil_layers-1 
+                   root_extr(k) = root_fr(k,j,i) * m_soil(k,j,i)               &
+                                  * dz_soil_stag(k) / m_total
+                ENDDO
+
+
+!
+!--             Prognostic equation for soil water content m_soil
+                tend(:) = 0.0_wp
+                tend(0) = ( lambda_w(0,j,i) * ( m_soil(1,j,i) - m_soil(0,j,i) )&
+                            * ddz_soil(0) - gamma_w(0,j,i) - ( root_extr(0)    &
+                            * LE_veg(j,i) + LE_soil(j,i) ) * drho_l_lv         &
+                          ) * ddz_soil_stag(0)
+
+                DO  k = 1, soil_layers-2
+                   tend(k) = ( lambda_w(k,j,i) * ( m_soil(k+1,j,i)             &
+                               - m_soil(k,j,i) ) * ddz_soil(k) - gamma_w(k,j,i)&
+                               - lambda_w(k-1,j,i) * (m_soil(k,j,i) -          &
+                               m_soil(k-1,j,i)) * ddz_soil(k-1)                &
+                               + gamma_w(k-1,j,i) - (root_extr(k) * LE_veg(j,i)&
+                               * drho_l_lv)                                    &
+                             ) * ddz_soil_stag(k)
+
+                ENDDO
+                tend(soil_layers-1) = ( - gamma_w(soil_layers-1,j,i)           &
+                                        - lambda_w(soil_layers-2,j,i)          &
+                                        * (m_soil(soil_layers-1,j,i)           &
+                                        - m_soil(soil_layers-2,j,i))           &
+                                        * ddz_soil(soil_layers-2)              &
+                                        + gamma_w(soil_layers-2,j,i) - (       &
+                                          root_extr(soil_layers-1)             &
+                                        * LE_veg(j,i) * drho_l_lv      )       &
+                                      ) * ddz_soil_stag(soil_layers-1)             
+
+                m_soil_p(0:soil_layers-1,j,i) = m_soil(0:soil_layers-1,j,i)    &
+                                                + dt_3d * ( tsc(2) * tend(:)   &
+                                                + tsc(3) * tm_soil_m(:,j,i) )   
+
+!
+!--             Account for dry soils (find a better solution here!)
+                m_soil_p(:,j,i) = MAX(m_soil_p(:,j,i),0.0_wp)
+
+!
+!--             Calculate m_soil tendencies for the next Runge-Kutta step
+                IF ( timestep_scheme(1:5) == 'runge' )  THEN
+                   IF ( intermediate_timestep_count == 1 )  THEN
+                      DO  k = 0, soil_layers-1
+                         tm_soil_m(k,j,i) = tend(k)
+                      ENDDO
+                   ELSEIF ( intermediate_timestep_count <                      &
+                            intermediate_timestep_count_max )  THEN
+                      DO  k = 0, soil_layers-1
+                         tm_soil_m(k,j,i) = -9.5625_wp * tend(k) + 5.3125_wp   &
+                                     * tm_soil_m(k,j,i)
+                      ENDDO
+                   ENDIF
+                ENDIF
+
+             ENDIF
+
+          ENDDO
+       ENDDO
+
+!
+!--    Calculate surface specific humidity
+       IF ( humidity )  THEN
+          CALL calc_q0
+       ENDIF
+
+
+    END SUBROUTINE lsm_soil_model
+
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!
+!------------------------------------------------------------------------------!
+    SUBROUTINE calc_q0
+
+       IMPLICIT NONE
+
+       INTEGER :: i              !: running index
+       INTEGER :: j              !: running index
+       INTEGER :: k              !: running index
+       REAL(wp) :: resistance    !: aerodynamic and soil resistance term
+
+       DO i = nxlg, nxrg    
+          DO j = nysg, nyng
+
+             k = nzb_s_inner(j,i)
+!
+!--          Temporary solution as long as T_0 is prescribed
+
+             pt_p(k,j,i) = T_0(j,i) / exn
+!
+!--          Calculate water vapour pressure at saturation
+             e_s = 0.01_wp * 610.78_wp * EXP( 17.269_wp * ( T_0(j,i) -         &
+                                              273.16_wp ) /  ( T_0(j,i) -      &
+                                              35.86_wp ) )
+
+!
+!--          Calculate specific humidity at saturation
+             q_s = 0.622_wp * e_s / surface_pressure
+
+
+             resistance = r_a(j,i) / (r_a(j,i) + r_s(j,i))
+
+!
+!--          Calculate specific humidity at surface
+             q_p(k,j,i) = resistance * q_s + (1.0_wp - resistance)             &
+                          * q_p(k+1,j,i)
+
+          ENDDO
+       ENDDO
+
+    END SUBROUTINE calc_q0
+
+
+ END MODULE land_surface_model_mod
Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 1495)
+++ palm/trunk/SOURCE/modules.f90	(revision 1496)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! Renamed "radiation" -> "cloud_top_radiation"
 ! 
 ! Former revisions:
@@ -629,4 +629,5 @@
                 call_psolver_at_all_substeps = .TRUE., &
                 cloud_droplets = .FALSE., cloud_physics = .FALSE., &
+                cloud_top_radiation = .FALSE., &
                 conserve_volume_flow = .FALSE., constant_diffusion = .FALSE., &
                 constant_heatflux = .TRUE., constant_top_heatflux = .TRUE., &
@@ -657,5 +658,5 @@
                 prandtl_layer = .TRUE., &
                 precipitation = .FALSE., &
-                radiation = .FALSE., random_heatflux = .FALSE., &
+                random_heatflux = .FALSE., &
                 run_control_header = .FALSE., run_coupled = .TRUE., &
                 scalar_rayleigh_damping = .TRUE., sloping_surface = .FALSE., &
@@ -699,5 +700,6 @@
                  dt_do2d_xy = 9999999.9_wp, dt_do2d_xz = 9999999.9_wp, &
                  dt_do2d_yz = 9999999.9_wp, dt_do3d = 9999999.9_wp, dt_dvrp = 9999999.9_wp, &
-                 dt_max = 20.0_wp, dt_micro = -1.0_wp, dt_restart = 9999999.9_wp, &
+                 dt_max = 20.0_wp, dt_micro = -1.0_wp, &
+                 dt_restart = 9999999.9_wp, &
                  dt_run_control = 60.0_wp, dt_3d = -1.0_wp, dz = -1.0_wp, &
                  dz_max = 9999999.9_wp, dz_stretch_factor = 1.08_wp, &
Index: palm/trunk/SOURCE/package_parin.f90
===================================================================
--- palm/trunk/SOURCE/package_parin.f90	(revision 1495)
+++ palm/trunk/SOURCE/package_parin.f90	(revision 1496)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Added support for the land surface model and radiation scheme
 ! 
 ! Former revisions:
@@ -79,5 +79,6 @@
     USE control_parameters,                                                    &
         ONLY:  averaging_interval_sp, dt_data_output, dt_dopts, dt_dosp,       &
-               dt_dvrp, particle_maximum_age, skip_time_dosp, threshold
+               dt_dvrp, particle_maximum_age, skip_time_dosp,                  &
+               threshold
 
     USE dvrp_variables,                                                        &
@@ -94,4 +95,14 @@
                vc_alpha, vc_gradient_normals, vc_mode, vc_size_x, vc_size_y,   &
                vc_size_z
+
+    USE land_surface_model_mod,                                                &
+        ONLY: alpha_VanGenuchten, C_skin, canopy_resistance_coefficient,       &
+              conserve_water_content, f_shortwave_incoming,                    &
+              hydraulic_conductivity, lambda_skin_stable, lambda_skin_unstable,&
+              leaf_area_index, land_surface, l_VanGenuchten,                   &
+              min_canopy_resistance, field_capacity, residual_moisture,        &
+              saturation_moisture, wilting_point, n_VanGenuchten,              &
+              root_fraction, soil_level, soil_moisture, soil_temperature,      &
+              soil_type, vegetation_coverage, veg_type 
 
     USE kinds
@@ -118,4 +129,9 @@
                leaf_scalar_exch_coeff, leaf_surface_conc, pch_index,           &
                plant_canopy
+
+    USE radiation_model_mod,                                                   &
+        ONLY: albedo, day_init, dt_radiation, lambda, radiation,               &
+              time_radiation, time_utc_init 
+                
 
     USE spectrum,                                                              &
@@ -151,4 +167,18 @@
                                   vc_gradient_normals, vc_mode, vc_size_x,     &
                                   vc_size_y, vc_size_z
+
+    NAMELIST /lsm_par/            alpha_VanGenuchten, C_skin,                  &
+                                  canopy_resistance_coefficient,               &
+                                  conserve_water_content, f_shortwave_incoming,& 
+                                  hydraulic_conductivity, lambda_skin_stable,  &
+                                  lambda_skin_unstable, leaf_area_index,       &
+                                  l_VanGenuchten, min_canopy_resistance,       &
+                                  field_capacity, residual_moisture,           &
+                                  saturation_moisture, wilting_point,          &
+                                  n_VanGenuchten, root_fraction, soil_level,   &
+                                  soil_moisture, soil_temperature, soil_type,  &
+                                  vegetation_coverage, veg_type 
+
+
 
     NAMELIST /particles_par/      alloc_factor, bc_par_b, bc_par_lr,           &
@@ -174,4 +204,7 @@
                                   write_particle_statistics
 
+    NAMELIST /radiation_par/      lambda, albedo, day_init, dt_radiation,      &
+                                  time_utc_init 
+
     NAMELIST /spectra_par/        averaging_interval_sp, comp_spectra_level,   &
                                   data_output_sp, dt_dosp, plot_spectra_level, &
@@ -265,3 +298,42 @@
 #endif
 
+!
+!-- Try to find land surface model package
+    REWIND ( 11 )
+    line = ' '
+    DO   WHILE ( INDEX( line, '&lsm_par' ) == 0 )
+       READ ( 11, '(A)', END=50 )  line
+    ENDDO
+    BACKSPACE ( 11 )
+
+!
+!-- Read user-defined namelist
+    READ ( 11, lsm_par )
+
+!
+!-- Set flag that indicates that the land surface model is switched on
+    land_surface = .TRUE.
+
+ 50 CONTINUE
+
+!
+!-- Try to find radiation package
+    REWIND ( 11 )
+    line = ' '
+    DO   WHILE ( INDEX( line, '&radiation_par' ) == 0 )
+       READ ( 11, '(A)', END=51 )  line
+    ENDDO
+    BACKSPACE ( 11 )
+
+!
+!-- Read user-defined namelist
+    READ ( 11, radiation_par )
+
+!
+!-- Set flag that indicates that the radiation scheme is switched on
+    radiation = .TRUE.
+
+ 51 CONTINUE
+
+
  END SUBROUTINE package_parin
Index: palm/trunk/SOURCE/parin.f90
===================================================================
--- palm/trunk/SOURCE/parin.f90	(revision 1495)
+++ palm/trunk/SOURCE/parin.f90	(revision 1496)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Renamed: "radiation -> "cloud_top_radiation"
 ! 
 ! Former revisions:
@@ -174,7 +174,7 @@
                canyon_wall_south, cfl_factor,                                  &
                cloud_droplets, cloud_physics, cloud_scheme,                    &
-               conserve_volume_flow, conserve_volume_flow_mode,                &
-               coupling_start_time, create_disturbances, cycle_mg,             &
-               data_output, data_output_masks,                                 &
+               cloud_top_radiation, conserve_volume_flow,                      &
+               conserve_volume_flow_mode, coupling_start_time,                 &
+               create_disturbances, cycle_mg, data_output, data_output_masks,  &
                data_output_pr, data_output_2d_on_each_pe,                      &
                disturbance_amplitude, disturbance_energy_limit,                &
@@ -209,5 +209,5 @@
                pt_vertical_gradient_level, q_surface,                          &
                q_surface_initial_change, q_vertical_gradient,                  &
-               q_vertical_gradient_level, radiation, random_generator,         &
+               q_vertical_gradient_level, random_generator,                    &
                random_heatflux, rayleigh_damping_factor,                       &
                rayleigh_damping_height, recycling_width, reference_state,      &
@@ -278,6 +278,6 @@
              canyon_width_x, canyon_width_y, canyon_wall_left,                 &
              canyon_wall_south, c_sedimentation, cfl_factor, cloud_droplets,   &
-             cloud_physics, cloud_scheme, collective_wait,                     &
-             conserve_volume_flow,                                             &
+             cloud_physics, cloud_scheme, cloud_top_radiation,                 &
+             collective_wait, conserve_volume_flow,                            &
              conserve_volume_flow_mode, coupling_start_time,                   &
              curvature_solution_effects, cycle_mg, damp_level_1d,              &
@@ -292,10 +292,10 @@
              initializing_actions, km_constant,                                &
              large_scale_forcing, large_scale_subsidence,                      &
-             limiter_sedimentation, &
+             limiter_sedimentation,                                            &
              loop_optimization, masking_method, mg_cycles,                     &
              mg_switch_to_pe0_level, mixing_length_1d, momentum_advec,         &
              nc_const, netcdf_precision, neutral, ngsrb,                       &
              nsor, nsor_ini, nudging, nx, ny, nz, ocean, omega, omega_sor,     &
-             passive_scalar, phi, prandtl_layer, &
+             passive_scalar, phi, prandtl_layer,                               &
              prandtl_number, precipitation, psolver, pt_damping_factor,        &
              pt_damping_width, pt_reference, pt_surface,                       &
@@ -303,5 +303,5 @@
              pt_vertical_gradient_level, q_surface, q_surface_initial_change,  &
              q_vertical_gradient, q_vertical_gradient_level,                   &
-             radiation, random_generator, random_heatflux,                     &
+             random_generator, random_heatflux,                                &
              rayleigh_damping_factor, rayleigh_damping_height, recycling_width,&
              reference_state, residual_limit,                                  &
Index: palm/trunk/SOURCE/prandtl_fluxes.f90
===================================================================
--- palm/trunk/SOURCE/prandtl_fluxes.f90	(revision 1495)
+++ palm/trunk/SOURCE/prandtl_fluxes.f90	(revision 1496)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Adapted for land surface model
 ! 
 ! Former revisions:
@@ -89,4 +89,7 @@
     USE kinds
 
+    USE land_surface_model_mod,                                                &
+        ONLY: land_surface
+
     IMPLICIT NONE
 
@@ -112,4 +115,5 @@
 !-- Compute theta*
     IF ( constant_heatflux )  THEN
+
 !
 !--    For a given heat flux in the Prandtl layer:
@@ -131,8 +135,14 @@
 !
 !--    For a given surface temperature:
-!--    (the Richardson number is still the one from the previous time step)
-   
+!--    (the Richardson number is still the one from the previous time step) 
        IF ( large_scale_forcing .AND. lsf_surf )  THEN
-          pt(nzb_s_inner(j,i),:,:) = pt_surface
+          !$OMP PARALLEL DO
+          !$acc kernels loop
+          DO  i = nxlg, nxrg
+             DO  j = nysg, nyng
+                k = nzb_s_inner(j,i)
+                pt(k,j,i) = pt_surface
+             ENDDO
+          ENDDO
        ENDIF
 
@@ -185,5 +195,12 @@
 
            IF ( large_scale_forcing .AND. lsf_surf )  THEN
-              q(nzb_s_inner(j,i),:,:) = q_surface
+                !$OMP PARALLEL DO
+                !$acc kernels loop
+                 DO  i = nxlg, nxrg
+                    DO  j = nysg, nyng
+                       k = nzb_s_inner(j,i)
+                       q(k,j,i) = q_surface
+                    ENDDO
+                 ENDDO
            ENDIF
 
@@ -462,5 +479,5 @@
 !
 !-- Compute the vertical kinematic heat flux
-    IF ( .NOT. constant_heatflux )  THEN
+    IF ( .NOT. constant_heatflux .AND. .NOT. land_surface )  THEN
        !$OMP PARALLEL DO
        !$acc kernels loop independent
@@ -475,5 +492,6 @@
 !
 !-- Compute the vertical water/scalar flux
-    IF ( .NOT. constant_waterflux .AND. ( humidity .OR. passive_scalar ) ) THEN
+    IF ( .NOT. constant_waterflux .AND. ( humidity .OR. passive_scalar )       &
+         .AND. .NOT. land_surface )  THEN
        !$OMP PARALLEL DO
        !$acc kernels loop independent
Index: palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- palm/trunk/SOURCE/prognostic_equations.f90	(revision 1495)
+++ palm/trunk/SOURCE/prognostic_equations.f90	(revision 1496)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! Renamed "radiation" -> "cloud_top_radiation"
 ! 
 ! Former revisions:
@@ -169,5 +169,5 @@
     USE control_parameters,                                                    &
         ONLY:  call_microphysics_at_all_substeps, cloud_physics,               &
-               constant_diffusion, dp_external,                                &
+               cloud_top_radiation, constant_diffusion, dp_external,       &
                dp_level_ind_b, dp_smooth_factor, dpdxy, dt_3d, humidity,       &
                icloud_scheme, inflow_l, intermediate_timestep_count,           &
@@ -176,8 +176,8 @@
                outflow_s, passive_scalar, precipitation,                       &
                prho_reference, prho_reference, prho_reference, pt_reference,   &
-               pt_reference, pt_reference, radiation, scalar_advec,            &
-               scalar_advec, simulated_time, sloping_surface, timestep_scheme, &
-               tsc, use_subsidence_tendencies, use_upstream_for_tke,           &
-               wall_heatflux,                                                  &
+               pt_reference, pt_reference, scalar_advec, scalar_advec,         &
+               simulated_time, sloping_surface,                                &
+               timestep_scheme, tsc, use_subsidence_tendencies,                &
+               use_upstream_for_tke, wall_heatflux,                            &
                wall_nrflux, wall_qflux, wall_qflux, wall_qflux, wall_qrflux,   &
                wall_salinityflux, ws_scheme_mom, ws_scheme_sca
@@ -551,5 +551,5 @@
 !--          If required compute heating/cooling due to long wave radiation
 !--          processes
-             IF ( radiation )  THEN
+             IF ( cloud_top_radiation )  THEN
                 CALL calc_radiation( i, j )
              ENDIF
@@ -1206,5 +1206,5 @@
 !
 !--    If required compute heating/cooling due to long wave radiation processes
-       IF ( radiation )  THEN
+       IF ( cloud_top_radiation )  THEN
           CALL calc_radiation
        ENDIF
@@ -2021,5 +2021,5 @@
 !
 !--    If required compute heating/cooling due to long wave radiation processes
-       IF ( radiation )  THEN
+       IF ( cloud_top_radiation )  THEN
           CALL calc_radiation
        ENDIF
Index: palm/trunk/SOURCE/radiation_model.f90
===================================================================
--- palm/trunk/SOURCE/radiation_model.f90	(revision 1496)
+++ palm/trunk/SOURCE/radiation_model.f90	(revision 1496)
@@ -0,0 +1,199 @@
+ MODULE radiation_model_mod
+
+!--------------------------------------------------------------------------------!
+! This file is part of PALM.
+!
+! PALM is free software: you can redistribute it and/or modify it under the terms
+! of the GNU General Public License as published by the Free Software Foundation,
+! either version 3 of the License, or (at your option) any later version.
+!
+! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
+! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+!
+! You should have received a copy of the GNU General Public License along with
+! PALM. If not, see <http://www.gnu.org/licenses/>.
+!
+! Copyright 1997-2014 Leibniz Universitaet Hannover
+!--------------------------------------------------------------------------------!
+!
+! Current revisions:
+! -----------------
+! Initial revision
+! 
+! Former revisions:
+! -----------------
+! $Id$
+!
+!
+! Description:
+! ------------
+! Radiation model(s), to be used e.g. with the land surface scheme
+!------------------------------------------------------------------------------!
+
+    USE arrays_3d,                                                             &
+        ONLY: pt
+
+    USE control_parameters,                                                    &
+        ONLY: phi, surface_pressure, time_since_reference_point
+
+    USE indices,                                                               &
+        ONLY:  nxlg, nxrg, nyng, nysg, nzb_s_inner
+
+    USE kinds
+
+
+    IMPLICIT NONE
+
+    INTEGER(iwp) :: i, j, k
+
+
+    INTEGER(iwp) :: day_init = 1 !: day of the year at model start
+
+    LOGICAL :: radiation = .FALSE.  !: flag parameter indicating wheather the radiation model is used
+
+    REAL(wp), PARAMETER :: SW_0 = 1368.0, &       !: solar constant  
+                           pi = 3.14159265358979323_wp, &
+                           sigma_SB  = 5.67E-8_wp !: Stefan-Boltzmann constant
+ 
+    REAL(wp) :: albedo = 0.2_wp,             & !: NAMELIST alpha
+                dt_radiation = 9999999.9_wp, &
+                exn,                         & !: Exner function
+                lon = 0.0_wp,                & !: longitude in radians
+                lat = 0.0_wp,                & !: latitude in radians
+                decl_1,                      & !: declination coef. 1
+                decl_2,                      & !: declination coef. 2
+                decl_3,                      & !: declination coef. 3
+                time_utc,                    & !: current time in UTC
+                time_utc_init = 0.0_wp,      & !: UTC time at model start
+                day,                         & !: current day of the year
+                lambda = 0.0_wp,             & !: longitude in degrees
+                declination,                 & !: solar declination angle
+                hour_angle,                  & !: solar hour angle
+                time_radiation = 0.0_wp,     &
+                zenith,                      & !: solar zenith angle
+                sky_trans                      !: sky transmissivity
+
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE :: &
+                alpha,                       & !: surface albedo
+                Rn,                          & !: net radiation at the surface
+                LW_in,                       & !: incoming longwave radiation
+                LW_out,                      & !: outgoing longwave radiation
+                SW_in,                       & !: incoming shortwave radiation
+                SW_out                         !: outgoing shortwave radiation
+
+
+    INTERFACE init_radiation
+       MODULE PROCEDURE init_radiation
+    END INTERFACE init_radiation
+
+    INTERFACE lsm_radiation
+       MODULE PROCEDURE lsm_radiation
+    END INTERFACE lsm_radiation
+
+    SAVE
+
+    PRIVATE
+
+    PUBLIC albedo, day_init, dt_radiation, init_radiation, lambda,             &
+           lsm_radiation, Rn, radiation, SW_in, sigma_SB, time_radiation,      &
+           time_utc_init 
+
+
+
+ CONTAINS
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!-- Initialization of the radiation model
+!------------------------------------------------------------------------------!
+    SUBROUTINE init_radiation
+    
+
+       IMPLICIT NONE
+
+       ALLOCATE ( alpha(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( Rn(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( LW_in(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( LW_out(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( SW_in(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE ( SW_out(nysg:nyng,nxlg:nxrg) )
+
+       alpha = albedo
+
+!
+!--    Calculate radiation scheme constants
+       decl_1 = SIN(23.45_wp * pi / 180.0_wp)
+       decl_2 = 2.0 * pi / 365.0_wp
+       decl_3 = decl_2 * 81.0_wp
+
+!
+!--    Calculate latitude and longitude angles (lat and lon, respectively)
+       lat = phi * pi / 180.0_wp
+       lon = lambda * pi / 180.0_wp
+
+       RETURN
+
+    END SUBROUTINE init_radiation
+
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!-- A simple clear sky radiation model
+!------------------------------------------------------------------------------!
+    SUBROUTINE lsm_radiation
+    
+
+       IMPLICIT NONE
+
+!
+!--    Calculate current day and time based on the initial values and simulation
+!--    time
+       day = day_init + FLOOR( (time_utc_init + time_since_reference_point)    &
+                               / 86400.0_wp )
+       time_utc = MOD((time_utc_init + time_since_reference_point), 86400.0_wp)
+
+
+!
+!--    Calculate solar declination and hour angle   
+       declination = ASIN( decl_1 * SIN(decl_2 * day - decl_3) )
+       hour_angle  = 2.0_wp * pi * (time_utc / 86400.0_wp) + lon - pi
+
+!
+!--    Calculate zenith angle
+       zenith = SIN(lat)*SIN(declination) + COS(lat) * COS(declination)        &
+                                            * COS(hour_angle)
+       zenith = MAX(0.0_wp,zenith)
+
+!
+!--    Calculate sky transmissivity
+       sky_trans = 0.6_wp + 0.2_wp * zenith
+
+!
+!--    Calculate value of the Exner function
+       exn = (surface_pressure / 1000.0_wp )**0.286_wp
+
+!
+!--    Calculate radiation fluxes and net radiation (Rn) for each grid point
+       DO i = nxlg, nxrg
+          DO j = nysg, nyng
+
+             k = nzb_s_inner(j,i)
+             SW_in(j,i)  = SW_0 * sky_trans * zenith
+             SW_out(j,i) = - alpha(j,i) * SW_in(j,i)
+             LW_out(j,i) = - sigma_SB * (pt(k,j,i) * exn)**4
+             LW_in(j,i)  = 0.8 * sigma_SB * (pt(k+1,j,i) * exn)**4
+             Rn(j,i)     = SW_in(j,i) + SW_out(j,i) + LW_in(j,i) + LW_out(j,i)
+
+          ENDDO
+       ENDDO
+
+       RETURN
+
+    END SUBROUTINE lsm_radiation
+
+
+
+ END MODULE radiation_model_mod
Index: palm/trunk/SOURCE/read_var_list.f90
===================================================================
--- palm/trunk/SOURCE/read_var_list.f90	(revision 1495)
+++ palm/trunk/SOURCE/read_var_list.f90	(revision 1496)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! Renamed "radiation" -> "cloud_top_radiation"
 ! 
 ! Former revisions:
@@ -542,6 +542,6 @@
           CASE ( 'q_vertical_gradient_level_ind' )
              READ ( 13 )  q_vertical_gradient_level_ind
-          CASE ( 'radiation' )
-             READ ( 13 )  radiation
+          CASE ( 'cloud_top_radiation' )
+             READ ( 13 )  cloud_top_radiation
           CASE ( 'random_generator' )
              READ ( 13 )  random_generator
Index: palm/trunk/SOURCE/swap_timelevel.f90
===================================================================
--- palm/trunk/SOURCE/swap_timelevel.f90	(revision 1495)
+++ palm/trunk/SOURCE/swap_timelevel.f90	(revision 1496)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Added swapping of land surface model quantities
 ! 
 ! Former revisions:
@@ -69,4 +69,8 @@
         ONLY:  e, e_p, nr, nr_p, pt, pt_p, q, q_p, qr, qr_p, sa, sa_p, u, u_p, &
                v, v_p, w, w_p
+
+    USE land_surface_model_mod,                                                &
+        ONLY: land_surface, m_liq, m_liq_p, m_soil, m_soil_p, T_0, T_0_p,      &
+              T_soil, T_soil_p
 #else
     USE arrays_3d,                                                             &
@@ -74,4 +78,9 @@
                q_1, q_2, q_p, qr, qr_1, qr_2, qr_p, sa, sa_1, sa_2, sa_p, u,   &
                u_1, u_2, u_p, v, v_1, v_2, v_p, w, w_1, w_2, w_p
+
+    USE land_surface_model_mod,                                                &
+        ONLY: land_surface, m_liq, m_liq_1, m_liq_2, m_liq_p, m_soil,          &
+              m_soil_1, m_soil_2, m_soil_p, T_0, T_0_1, T_0_2, T_0_p, T_soil,  &
+              T_soil_1, T_soil_2, T_soil_p
 #endif
 
@@ -116,4 +125,14 @@
     ENDIF
 
+    IF ( land_surface )  THEN
+       T_0    = T_0_p
+       T_soil = T_soil_p
+       IF ( humidity )  THEN
+          m_soil = m_soil_p
+          m_liq  = m_liq_p
+       ENDIF
+    ENDIF
+
+
     CALL cpu_log( log_point(28), 'swap_timelevel (nop)', 'stop' )
 #else
@@ -145,4 +164,13 @@
           ENDIF
 
+          IF ( land_surface )  THEN
+             T_0    => T_0_1;    T_0_p    => T_0_2
+             T_soil => T_soil_1; T_soil_p => T_soil_2
+             IF ( humidity )  THEN
+                m_soil => m_soil_1; m_soil_p  => m_soil_2
+                m_liq  => m_liq_1;  m_liq_p   => m_liq_2
+             ENDIF
+          ENDIF
+
 
        CASE ( 1 )
@@ -169,4 +197,13 @@
           ENDIF
 
+          IF ( land_surface )  THEN
+             T_0    => T_0_2;    T_0_p    => T_0_1
+             T_soil => T_soil_2; T_soil_p => T_soil_1
+             IF ( humidity )  THEN
+                m_soil => m_soil_2; m_soil_p  => m_soil_1
+                m_liq  => m_liq_2;  m_liq_p   => m_liq_1
+             ENDIF
+          ENDIF
+
 
     END SELECT
Index: palm/trunk/SOURCE/time_integration.f90
===================================================================
--- palm/trunk/SOURCE/time_integration.f90	(revision 1495)
+++ palm/trunk/SOURCE/time_integration.f90	(revision 1496)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! Added calls for the land surface model and radiation scheme
 ! 
 ! Former revisions:
@@ -177,5 +177,6 @@
                time_dopr_listing, time_dopts, time_dosp, time_dosp_av,         &
                time_dots, time_do_av, time_do_sla, time_disturb, time_dvrp,    &
-               time_run_control, time_since_reference_point, turbulence,       &
+               time_run_control, time_since_reference_point,                   &
+               turbulence,                                                     &
                turbulent_inflow, use_initial_profile_as_reference,             &
                use_single_reference_value, u_gtrans, v_gtrans, ws_scheme_mom,  &
@@ -194,4 +195,7 @@
     USE kinds
 
+    USE land_surface_model_mod,                                                &
+        ONLY:  land_surface, lsm_energy_balance, lsm_soil_model
+
     USE ls_forcing_mod,                                                        &
         ONLY:  ls_forcing_surf, ls_forcing_vert
@@ -214,4 +218,7 @@
         ONLY:  prognostic_equations_acc, prognostic_equations_cache,           &
                prognostic_equations_vector
+
+    USE radiation_model_mod,                                                   &
+        ONLY: dt_radiation, lsm_radiation, radiation, time_radiation
 
     USE statistics,                                                            &
@@ -577,4 +584,31 @@
 !--       velocities at the outflow in case of a non-cyclic lateral wall)
           CALL boundary_conds
+
+!
+!--       When using the land surface model: 
+!--       1) solve energy balance equation to calculate new skin temperature
+!--       2) run soil model 
+          IF ( land_surface )  THEN
+
+             time_radiation = time_radiation + dt_3d
+
+             IF ( time_radiation >= dt_radiation )  THEN
+
+                CALL cpu_log( log_point(50), 'radiation', 'start' )
+
+                time_radiation = time_radiation - dt_radiation
+                CALL lsm_radiation
+
+                CALL cpu_log( log_point(50), 'radiation', 'stop' )
+             ENDIF
+
+             CALL cpu_log( log_point(54), 'land_surface', 'start' )
+
+             CALL lsm_energy_balance
+             CALL lsm_soil_model
+
+             CALL cpu_log( log_point(54), 'land_surface', 'stop' )
+
+          ENDIF
 
 !
Index: palm/trunk/SOURCE/user_init_land_surface.f90
===================================================================
--- palm/trunk/SOURCE/user_init_land_surface.f90	(revision 1496)
+++ palm/trunk/SOURCE/user_init_land_surface.f90	(revision 1496)
@@ -0,0 +1,56 @@
+ SUBROUTINE user_init_land_surface
+
+!--------------------------------------------------------------------------------!
+! This file is part of PALM.
+!
+! PALM is free software: you can redistribute it and/or modify it under the terms
+! of the GNU General Public License as published by the Free Software Foundation,
+! either version 3 of the License, or (at your option) any later version.
+!
+! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
+! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+!
+! You should have received a copy of the GNU General Public License along with
+! PALM. If not, see <http://www.gnu.org/licenses/>.
+!
+! Copyright 1997-2014 Leibniz Universitaet Hannover
+!--------------------------------------------------------------------------------!
+!
+! Current revisions:
+! -----------------
+! Initial revision
+! 
+! Former revisions:
+! -----------------
+! $Id$
+
+! Description:
+! ------------
+! Execution of user-defined actions to initiate the land surface model
+!------------------------------------------------------------------------------!
+
+    USE arrays_3d
+    
+    USE control_parameters
+    
+    USE indices
+    
+    USE kinds
+
+    USE land_surface_model_mod
+    
+    USE user
+
+    IMPLICIT NONE
+
+    INTEGER(iwp) :: i   !: running index
+    INTEGER(iwp) :: j   !: running index
+
+!
+!-- Here the user-defined grid initializing actions follow:
+
+
+
+ END SUBROUTINE user_init_land_surface
+
Index: palm/trunk/SOURCE/write_var_list.f90
===================================================================
--- palm/trunk/SOURCE/write_var_list.f90	(revision 1495)
+++ palm/trunk/SOURCE/write_var_list.f90	(revision 1496)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Renamed "radiation" -> "cloud_top_radiation"
 ! 
 ! Former revisions:
@@ -459,6 +459,6 @@
     WRITE ( 14 )  'q_vertical_gradient_level_ind '
     WRITE ( 14 )  q_vertical_gradient_level_ind
-    WRITE ( 14 )  'radiation                     '
-    WRITE ( 14 )  radiation
+    WRITE ( 14 )  'cloud_top_radiation       '
+    WRITE ( 14 )  cloud_top_radiation
     WRITE ( 14 )  'random_generator              '
     WRITE ( 14 )  random_generator
