Index: palm/trunk/INSTALL/test_oceanml_p3d
===================================================================
--- palm/trunk/INSTALL/test_oceanml_p3d	(revision 2574)
+++ palm/trunk/INSTALL/test_oceanml_p3d	(revision 2575)
@@ -8,5 +8,5 @@
         initializing_actions = 'set_constant_profiles',
  
-        phi = 55.6,
+        latitude = 55.6,
            
         momentum_advec = 'pw-scheme',
Index: palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- palm/trunk/SOURCE/check_parameters.f90	(revision 2574)
+++ palm/trunk/SOURCE/check_parameters.f90	(revision 2575)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Renamed phi --> latitude
+! 
+! 2564 2017-10-19 15:56:56Z Giersch
 ! Variable wind_turbine was added to control_parameters.
 ! 
@@ -1596,6 +1599,6 @@
 !
 !-- Compute Coriolis parameter
-    f  = 2.0_wp * omega * SIN( phi / 180.0_wp * pi )
-    fs = 2.0_wp * omega * COS( phi / 180.0_wp * pi )
+    f  = 2.0_wp * omega * SIN( latitude / 180.0_wp * pi )
+    fs = 2.0_wp * omega * COS( latitude / 180.0_wp * pi )
 
 !
Index: palm/trunk/SOURCE/header.f90
===================================================================
--- palm/trunk/SOURCE/header.f90	(revision 2574)
+++ palm/trunk/SOURCE/header.f90	(revision 2575)
@@ -1764,5 +1764,5 @@
 !
 !-- Geostrophic parameters
-    WRITE ( io, 410 )  phi, omega, f, fs
+    WRITE ( io, 410 )  latitude, longitude, omega, f, fs
 
  !
@@ -2200,5 +2200,6 @@
 400 FORMAT (//' Physical quantities:'/ &
               ' -------------------'/)
-410 FORMAT ('    Geograph. latitude  :   phi    = ',F4.1,' degr'/   &
+410 FORMAT ('    Geograph. latitude  :   latitude  = ',F4.1,' degr'/   &
+            '    Geograph. longitude :   longitude = ',F4.1,' degr'/   &
             '    Angular velocity    :   omega  =',E10.3,' rad/s'/  &
             '    Coriolis parameter  :   f      = ',F9.6,' 1/s'/    &
@@ -2215,5 +2216,4 @@
             '    Specific heat cap. :   c_p   = ',F6.1,' J/(kg K)'/ &
             '    Vapourization heat :   L_v   =',E9.2,' J/kg')
-417 FORMAT ('    Geograph. longitude :   lambda = ',F4.1,' degr')
 418 FORMAT (/'    Day of the year at model start :   day_init      =     ',I3 &
             /'    UTC time at model start        :   time_utc_init = ',F7.1' s')
Index: palm/trunk/SOURCE/land_surface_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 2574)
+++ palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 2575)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Pavement parameterization revised
+! 
+! 2573 2017-10-20 15:57:49Z scharf
 ! bugfixes in last_actions
 ! 
@@ -269,9 +272,6 @@
 !> @todo Implement surface runoff model (required when performing long-term LES 
 !>       with considerable precipitation.
-!> @todo Fix crashes with radiation_scheme == 'constant'
 !> @todo Revise calculation of f2 when wilting point is non-constant in the
 !>       soil
-!> @todo Solve problems with soil heat flux paramterization
-!> @todo Make pavement_depth variable for each surface element
 !> @todo Allow for zero soil moisture (currently, it is set to wilting point)
 !> @note No time step criterion is required as long as the soil layers do not
@@ -336,6 +336,6 @@
     REAL(wp), DIMENSION(0:7), PARAMETER  :: dz_soil_default =                  & ! default soil layer configuration
                                             (/ 0.01_wp, 0.02_wp, 0.04_wp,      &
-                                               0.07_wp, 0.15_wp, 0.21_wp,      &
-                                               0.72_wp, 1.89_wp/)
+                                               0.06_wp, 0.14_wp, 0.26_wp,      &
+                                               0.54_wp, 1.86_wp/)
 
     REAL(wp), DIMENSION(0:3), PARAMETER  :: dz_soil_ref =                      & ! reference four layer soil configuration used for estimating the root fractions
@@ -356,11 +356,13 @@
 
 
-    INTEGER(iwp) :: nzb_soil = 0,        & !< bottom of the soil model (Earth's surface)
-                    nzt_soil = 7,        & !< top of the soil model
-                    nzs = 8,             & !< number of soil layers
-                    pavement_type = 1,   & !< default NAMELIST pavement_type                 
-                    soil_type = 3,       & !< default NAMELIST soil_type
-                    vegetation_type = 2, & !< default NAMELIST vegetation_type
-                    water_type = 1         !< default NAMELISt water_type
+    INTEGER(iwp) :: nzb_soil = 0,             & !< bottom of the soil model (Earth's surface)
+                    nzt_soil = 7,             & !< top of the soil model
+                    nzt_pavement = 0,         & !< top of the pavement within the soil
+                    nzs = 8,                  & !< number of soil layers
+                    pavement_depth_level = 0, & !< default NAMELIST nzt_pavement
+                    pavement_type = 1,        & !< default NAMELIST pavement_type                 
+                    soil_type = 3,            & !< default NAMELIST soil_type
+                    vegetation_type = 2,      & !< default NAMELIST vegetation_type
+                    water_type = 1              !< default NAMELISt water_type
                     
    
@@ -392,5 +394,4 @@
                 m_total = 0.0_wp,                       & !< weighted total water content of the soil (m3/m3)
                 n_vangenuchten = 9999999.9_wp,          & !< NAMELIST n_vg
-                pavement_depth = 9999999.9_wp,          & !< depth of the pavement
                 pavement_heat_capacity = 9999999.9_wp,  & !< volumetric heat capacity of pavement (e.g. roads) (J/m3/K)
                 pavement_heat_conduct  = 9999999.9_wp,  & !< heat conductivity for pavements (e.g. roads) (W/m/K)
@@ -679,23 +680,64 @@
 !
 !-- TO BE FILLED
-!-- Pavement parameters  depth,        z0,       z0h, lambda_h,      rho_c, albedo_type, emissivity  
-    REAL(wp), DIMENSION(0:6,1:15), PARAMETER :: pavement_pars = RESHAPE( (/ &
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 18.0_wp, 0.97_wp,  & !  1
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 19.0_wp, 0.94_wp,  & !  2
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 20.0_wp, 0.98_wp,  & !  3                                  
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 21.0_wp, 0.93_wp,  & !  4
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 22.0_wp, 0.97_wp,  & !  5
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 23.0_wp, 0.97_wp,  & !  6
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 24.0_wp, 0.97_wp,  & !  7
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 25.0_wp, 0.94_wp,  & !  8
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 26.0_wp, 0.98_wp,  & !  9                                  
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 27.0_wp, 0.93_wp,  & ! 10
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 28.0_wp, 0.97_wp,  & ! 11
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 29.0_wp, 0.97_wp,  & ! 12
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 30.0_wp, 0.97_wp,  & ! 13
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 31.0_wp, 0.94_wp,  & ! 14
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 32.0_wp, 0.98_wp   & ! 15
-                                                                 /), (/ 7, 15 /) )                             
-
+!-- Pavement parameters      z0,       z0h, albedo_type, emissivity  
+    REAL(wp), DIMENSION(0:3,1:15), PARAMETER :: pavement_pars = RESHAPE( (/ &
+                      1.0E-4_wp, 1.0E-5_wp,     18.0_wp,    0.97_wp,  & !  1
+                      1.0E-4_wp, 1.0E-5_wp,     19.0_wp,    0.94_wp,  & !  2
+                      1.0E-4_wp, 1.0E-5_wp,     20.0_wp,    0.98_wp,  & !  3                                  
+                      1.0E-4_wp, 1.0E-5_wp,     21.0_wp,    0.93_wp,  & !  4
+                      1.0E-4_wp, 1.0E-5_wp,     22.0_wp,    0.97_wp,  & !  5
+                      1.0E-4_wp, 1.0E-5_wp,     23.0_wp,    0.97_wp,  & !  6
+                      1.0E-4_wp, 1.0E-5_wp,     24.0_wp,    0.97_wp,  & !  7
+                      1.0E-4_wp, 1.0E-5_wp,     25.0_wp,    0.94_wp,  & !  8
+                      1.0E-4_wp, 1.0E-5_wp,     26.0_wp,    0.98_wp,  & !  9                                  
+                      1.0E-4_wp, 1.0E-5_wp,     27.0_wp,    0.93_wp,  & ! 10
+                      1.0E-4_wp, 1.0E-5_wp,     28.0_wp,    0.97_wp,  & ! 11
+                      1.0E-4_wp, 1.0E-5_wp,     29.0_wp,    0.97_wp,  & ! 12
+                      1.0E-4_wp, 1.0E-5_wp,     30.0_wp,    0.97_wp,  & ! 13
+                      1.0E-4_wp, 1.0E-5_wp,     31.0_wp,    0.94_wp,  & ! 14
+                      1.0E-4_wp, 1.0E-5_wp,     32.0_wp,    0.98_wp   & ! 15
+                      /), (/ 4, 15 /) )                             
+!
+!-- Pavement subsurface parameters part 1: thermal conductivity (W/m/K)
+!--   0.0-0.01, 0.01-0.03, 0.03-0.07, 0.07-0.15, 0.15-0.30, 0.30-0.50,    0.50-1.25,    1.25-3.00
+    REAL(wp), DIMENSION(0:7,1:15), PARAMETER :: pavement_subsurface_pars_1 = RESHAPE( (/ &
+       1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp, 9999999.9_wp, 9999999.9_wp, & !  1
+       1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp, 9999999.9_wp, 9999999.9_wp, & !  2
+       1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp, 9999999.9_wp, 9999999.9_wp, & !  3
+       1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp, 9999999.9_wp, 9999999.9_wp, & !  4
+       1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp, 9999999.9_wp, 9999999.9_wp, & !  5
+       1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp, 9999999.9_wp, 9999999.9_wp, & !  6
+       1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp, 9999999.9_wp, 9999999.9_wp, & !  7
+       1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp, 9999999.9_wp, 9999999.9_wp, & !  8
+       1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp, 9999999.9_wp, 9999999.9_wp, & !  9
+       1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp, 9999999.9_wp, 9999999.9_wp, & ! 10
+       1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp, 9999999.9_wp, 9999999.9_wp, & ! 11
+       1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp, 9999999.9_wp, 9999999.9_wp, & ! 12
+       1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp, 9999999.9_wp, 9999999.9_wp, & ! 13
+       1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp, 9999999.9_wp, 9999999.9_wp, & ! 14
+       1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp,   1.00_wp, 9999999.9_wp, 9999999.9_wp  & ! 15
+       /), (/ 8, 15 /) )
+
+!
+!-- Pavement subsurface parameters part 2: volumetric heat capacity (J/m3/K)
+!--     0.0-0.01, 0.01-0.03, 0.03-0.07, 0.07-0.15, 0.15-0.30, 0.30-0.50,    0.50-1.25,    1.25-3.00
+    REAL(wp), DIMENSION(0:7,1:15), PARAMETER :: pavement_subsurface_pars_2 = RESHAPE( (/ &
+       1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 9999999.9_wp, 9999999.9_wp, & !  1
+       1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 9999999.9_wp, 9999999.9_wp, & !  2
+       1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 9999999.9_wp, 9999999.9_wp, & !  3
+       1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 9999999.9_wp, 9999999.9_wp, & !  4
+       1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 9999999.9_wp, 9999999.9_wp, & !  5
+       1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 9999999.9_wp, 9999999.9_wp, & !  6
+       1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 9999999.9_wp, 9999999.9_wp, & !  7
+       1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 9999999.9_wp, 9999999.9_wp, & !  8
+       1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 9999999.9_wp, 9999999.9_wp, & !  9
+       1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 9999999.9_wp, 9999999.9_wp, & ! 10
+       1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 9999999.9_wp, 9999999.9_wp, & ! 11
+       1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 9999999.9_wp, 9999999.9_wp, & ! 12
+       1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 9999999.9_wp, 9999999.9_wp, & ! 13
+       1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 9999999.9_wp, 9999999.9_wp, & ! 14
+       1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 1.94E6_wp, 9999999.9_wp, 9999999.9_wp  & ! 15
+                           /), (/ 8, 15 /) )
+ 
 !
 !-- TO BE FILLED
@@ -1121,5 +1163,5 @@
           IF ( vegetation_coverage /= 9999999.9_wp  .AND.  vegetation_coverage &
                /= 0.0_wp )  THEN
-               message_string = 'vegetation_type = 1 (bare soil)'//            &
+             message_string = 'vegetation_type = 1 (bare soil)'//              &
                               ' requires vegetation_coverage = 0'
              CALL message( 'check_parameters', 'PA0471', 1, 2, 0, 6, 0 )
@@ -1167,4 +1209,10 @@
     IF ( TRIM( surface_type ) == 'pavement' )  THEN
 
+       IF ( ANY( dz_soil /= 9999999.9_wp )  .AND.  pavement_type /= 0 )  THEN
+          message_string = 'non-default setting of dz_soil '//                  &
+                           'does not allow to use pavement_type /= 0)'
+             CALL message( 'check_parameters', 'PA0341', 1, 2, 0, 6, 0 )
+          ENDIF
+
        IF ( pavement_type == 0 )  THEN  
        
@@ -1182,13 +1230,6 @@
              CALL message( 'check_parameters', 'PA0353', 1, 2, 0, 6, 0 )
           ENDIF
-
-           IF ( pavement_depth == 9999999.9_wp )  THEN
-             message_string = 'pavement_type = 0 (user_defined)'//             &
-                              'requires setting of pavement_depth'//           &
-                              '/= 9999999.9'
-             CALL message( 'check_parameters', 'PA0341', 1, 2, 0, 6, 0 )
-          ENDIF         
           
-           IF ( pavement_heat_conduct == 9999999.9_wp )  THEN
+          IF ( pavement_heat_conduct == 9999999.9_wp )  THEN
              message_string = 'pavement_type = 0 (user_defined)'//             &
                               'requires setting of pavement_heat_conduct'//    &
@@ -1202,4 +1243,11 @@
                               '/= 9999999.9'
              CALL message( 'check_parameters', 'PA0139', 1, 2, 0, 6, 0 )
+          ENDIF 
+
+          IF ( pavement_depth_level == 0 )  THEN
+             message_string = 'pavement_type = 0 (user_defined)'//             &
+                              'requires setting of pavement_depth_level'//     &
+                              '/= 0'
+             CALL message( 'check_parameters', 'PA0474', 1, 2, 0, 6, 0 )
           ENDIF 
 
@@ -2159,4 +2207,5 @@
        ALLOCATE ( surf_lsm_h%gamma_w_sat(nzb_soil:nzt_soil,1:surf_lsm_h%ns) )
        ALLOCATE ( surf_lsm_h%lambda_h(nzb_soil:nzt_soil,1:surf_lsm_h%ns)    )
+       ALLOCATE ( surf_lsm_h%lambda_h_def(nzb_soil:nzt_soil,1:surf_lsm_h%ns))
        ALLOCATE ( surf_lsm_h%l_vg(nzb_soil:nzt_soil,1:surf_lsm_h%ns)        )
        ALLOCATE ( surf_lsm_h%m_fc(nzb_soil:nzt_soil,1:surf_lsm_h%ns)        )
@@ -2166,4 +2215,5 @@
        ALLOCATE ( surf_lsm_h%n_vg(nzb_soil:nzt_soil,1:surf_lsm_h%ns)        )
        ALLOCATE ( surf_lsm_h%rho_c_total(nzb_soil:nzt_soil,1:surf_lsm_h%ns) )
+       ALLOCATE ( surf_lsm_h%rho_c_total_def(nzb_soil:nzt_soil,1:surf_lsm_h%ns) )
        ALLOCATE ( surf_lsm_h%root_fr(nzb_soil:nzt_soil,1:surf_lsm_h%ns)     )
     
@@ -2183,4 +2233,5 @@
           ALLOCATE ( surf_lsm_v(l)%gamma_w_sat(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns) )
           ALLOCATE ( surf_lsm_v(l)%lambda_h(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns)    )
+          ALLOCATE ( surf_lsm_v(l)%lambda_h_def(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns))
           ALLOCATE ( surf_lsm_v(l)%l_vg(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns)        )
           ALLOCATE ( surf_lsm_v(l)%m_fc(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns)        )
@@ -2190,4 +2241,5 @@
           ALLOCATE ( surf_lsm_v(l)%n_vg(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns)        )
           ALLOCATE ( surf_lsm_v(l)%rho_c_total(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns) )  
+          ALLOCATE ( surf_lsm_v(l)%rho_c_total_def(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns) )  
           ALLOCATE ( surf_lsm_v(l)%root_fr(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns)     )
 
@@ -2365,32 +2417,47 @@
        IF ( pavement_type /= 0 )  THEN  
 
-          IF ( pavement_depth == 9999999.9_wp )  THEN
-             pavement_depth = pavement_pars(0,pavement_type)
-          ELSE
-             pavement_depth = MAX( 0.5_wp * dz_soil(nzb_soil), pavement_depth )
-          ENDIF
+!
+!--       When a pavement_type is used, overwrite a possible setting of 
+!--       the pavement depth as it is already defined by the pavement type
+          pavement_depth_level = 0
 
           IF ( z0_pavement == 9999999.9_wp )  THEN
-             z0_pavement  = pavement_pars(1,pavement_type) 
+             z0_pavement  = pavement_pars(0,pavement_type) 
           ENDIF
 
           IF ( z0h_pavement == 9999999.9_wp )  THEN
-             z0h_pavement = pavement_pars(2,pavement_type)
+             z0h_pavement = pavement_pars(1,pavement_type)
           ENDIF
 
           IF ( pavement_heat_conduct == 9999999.9_wp )  THEN
-             pavement_heat_conduct = pavement_pars(3,pavement_type)
+             pavement_heat_conduct = pavement_subsurface_pars_1(0,pavement_type)
           ENDIF
 
           IF ( pavement_heat_capacity == 9999999.9_wp )  THEN
-             pavement_heat_capacity = pavement_pars(4,pavement_type)
+             pavement_heat_capacity = pavement_subsurface_pars_2(0,pavement_type)
           ENDIF   
     
           IF ( albedo_type == 9999999  .AND.  albedo == 9999999.9_wp )  THEN
-             albedo_type = INT(pavement_pars(5,pavement_type))        
+             albedo_type = INT(pavement_pars(2,pavement_type))        
           ENDIF
    
           IF ( emissivity == 9999999.9_wp )  THEN
-             emissivity = pavement_pars(6,pavement_type)        
+             emissivity = pavement_pars(3,pavement_type)        
+          ENDIF
+
+!
+!--       If the depth level of the pavement is not set, determine it from
+!--       lookup table.
+          IF ( pavement_depth_level == 0 )  THEN
+             DO  k = nzb_soil, nzt_soil  
+                IF ( pavement_subsurface_pars_1(k,pavement_type) == 9999999.9_wp &
+                   .OR. pavement_subsurface_pars_2(k,pavement_type)              &
+                   == 9999999.9_wp)  THEN
+                   nzt_pavement = k-1
+                   EXIT
+                ENDIF
+             ENDDO
+          ELSE
+             nzt_pavement = pavement_depth_level
           ENDIF
 
@@ -2466,6 +2533,14 @@
                                                  * dz_soil(nzb_soil)           &
                                                  * 0.25_wp
-                surf_lsm_h%lambda_h_def(m)    = pavement_heat_conduct                                     
-                surf_lsm_h%rho_c_def(m)       = pavement_heat_capacity                                                
+
+                IF ( pavement_type /= 0 )  THEN
+                   DO  k = nzb_soil, nzt_soil  
+                      surf_lsm_h%lambda_h_def(k,m)      =  pavement_subsurface_pars_1(k,pavement_type)                       
+                      surf_lsm_h%rho_c_total_def(k,m)   =  pavement_subsurface_pars_2(k,pavement_type) 
+                   ENDDO
+                ELSE
+                    surf_lsm_h%lambda_h_def(:,m)     = pavement_heat_conduct
+                    surf_lsm_h%rho_c_total_def(:,m)  = pavement_heat_capacity
+                ENDIF
 
              ELSEIF ( surf_lsm_h%vegetation_surface(m) )  THEN
@@ -2556,6 +2631,14 @@
                                                 * dz_soil(nzb_soil)            &
                                                 * 0.25_wp
-                   surf_lsm_v(l)%lambda_h_def(m)   = pavement_heat_conduct                                     
-                   surf_lsm_v(l)%rho_c_def(m)      = pavement_heat_capacity                           
+                IF ( pavement_type /= 0 )  THEN
+                   DO  k = nzb_soil, nzt_soil  
+                      surf_lsm_v(l)%lambda_h_def(k,m)    =  pavement_subsurface_pars_1(k,pavement_type)                       
+                      surf_lsm_v(l)%rho_c_total_def(k,m) =  pavement_subsurface_pars_2(k,pavement_type)  
+                   ENDDO
+                ELSE
+                    surf_lsm_v(l)%lambda_h_def(:,m)     = pavement_heat_conduct
+                    surf_lsm_v(l)%rho_c_total_def(:,m)  = pavement_heat_capacity
+                ENDIF
+                        
                    
                 ELSEIF ( surf_lsm_v(l)%vegetation_surface(m) )  THEN
@@ -2734,5 +2817,6 @@
              j   = surf_lsm_h%j(m)
              DO  k = nzb_soil, nzt_soil 
-                IF ( surf_lsm_h%pavement_surface(m)  .AND.  zs(k) <= pavement_depth )  THEN
+                IF ( surf_lsm_h%pavement_surface(m)  .AND.                     &
+                     k <= nzt_pavement )  THEN
                    surf_lsm_h%root_fr(k,m) = 0.0_wp
                 ELSE
@@ -2742,9 +2826,10 @@
 
 !
-!--          Normalize so that the sum = 1. Only relevant when the root distribution was
-!--          set to zero due to pavement at some layers.
+!--          Normalize so that the sum = 1. Only relevant when the root         
+!--          distribution was set to zero due to pavement at some layers.
              IF ( SUM( surf_lsm_h%root_fr(:,m) ) > 0.0_wp )  THEN
                 DO k = nzb_soil, nzt_soil
-                   surf_lsm_h%root_fr(k,m) = surf_lsm_h%root_fr(k,m) / SUM( surf_lsm_h%root_fr(:,m) )
+                   surf_lsm_h%root_fr(k,m) = surf_lsm_h%root_fr(k,m)           &
+                   / SUM( surf_lsm_h%root_fr(:,m) )
                 ENDDO
              ENDIF
@@ -2757,5 +2842,6 @@
 
                 DO  k = nzb_soil, nzt_soil
-                   IF ( surf_lsm_v(l)%pavement_surface(m)  .AND.  zs(k) <= pavement_depth )  THEN
+                   IF ( surf_lsm_v(l)%pavement_surface(m)  .AND.               &
+                        k <= nzt_pavement )  THEN
                       surf_lsm_v(l)%root_fr(k,m) = 0.0_wp
                    ELSE
@@ -2764,9 +2850,10 @@
                 ENDDO
 !
-!--             Normalize so that the sum = 1. Only relevant when the root distribution was
-!--             sset to zero due to pavement at some layers.
+!--             Normalize so that the sum = 1. Only relevant when the root      
+!--             distribution was set to zero due to pavement at some layers.
                 IF ( SUM( surf_lsm_v(l)%root_fr(:,m) ) > 0.0_wp )  THEN
                    DO  k = nzb_soil, nzt_soil  
-                      surf_lsm_v(l)%root_fr(k,m) = surf_lsm_v(l)%root_fr(k,m) / SUM( surf_lsm_v(l)%root_fr(:,m) )
+                      surf_lsm_v(l)%root_fr(k,m) = surf_lsm_v(l)%root_fr(k,m)  &
+                      / SUM( surf_lsm_v(l)%root_fr(:,m) )
                    ENDDO
                 ENDIF
@@ -2929,5 +3016,4 @@
        ALLOCATE ( surf_lsm_h%g_d(1:surf_lsm_h%ns)              )
        ALLOCATE ( surf_lsm_h%lai(1:surf_lsm_h%ns)              )
-       ALLOCATE ( surf_lsm_h%lambda_h_def(1:surf_lsm_h%ns)     )
        ALLOCATE ( surf_lsm_h%lambda_surface_u(1:surf_lsm_h%ns) )
        ALLOCATE ( surf_lsm_h%lambda_surface_s(1:surf_lsm_h%ns) )
@@ -2937,6 +3023,5 @@
        ALLOCATE ( surf_lsm_h%qsws_liq(1:surf_lsm_h%ns)         )
        ALLOCATE ( surf_lsm_h%qsws_veg(1:surf_lsm_h%ns)         )
-       ALLOCATE ( surf_lsm_h%rad_net_l(1:surf_lsm_h%ns)        )
-       ALLOCATE ( surf_lsm_h%rho_c_def(1:surf_lsm_h%ns)        )  
+       ALLOCATE ( surf_lsm_h%rad_net_l(1:surf_lsm_h%ns)        ) 
        ALLOCATE ( surf_lsm_h%r_a(1:surf_lsm_h%ns)              )
        ALLOCATE ( surf_lsm_h%r_canopy(1:surf_lsm_h%ns)         )
@@ -2961,5 +3046,4 @@
           ALLOCATE ( surf_lsm_v(l)%g_d(1:surf_lsm_v(l)%ns)              )
           ALLOCATE ( surf_lsm_v(l)%lai(1:surf_lsm_v(l)%ns)              )
-          ALLOCATE ( surf_lsm_v(l)%lambda_h_def(1:surf_lsm_v(l)%ns)     )
           ALLOCATE ( surf_lsm_v(l)%lambda_surface_u(1:surf_lsm_v(l)%ns) )
           ALLOCATE ( surf_lsm_v(l)%lambda_surface_s(1:surf_lsm_v(l)%ns) )
@@ -2970,5 +3054,4 @@
           ALLOCATE ( surf_lsm_v(l)%qsws_veg(1:surf_lsm_v(l)%ns)         )
           ALLOCATE ( surf_lsm_v(l)%rad_net_l(1:surf_lsm_v(l)%ns)        )
-          ALLOCATE ( surf_lsm_v(l)%rho_c_def(1:surf_lsm_h%ns)           )  
           ALLOCATE ( surf_lsm_v(l)%r_a(1:surf_lsm_v(l)%ns)              )
           ALLOCATE ( surf_lsm_v(l)%r_canopy(1:surf_lsm_v(l)%ns)         )
@@ -3028,5 +3111,6 @@
                                   l_vangenuchten, min_canopy_resistance,       &
                                   min_soil_resistance, n_vangenuchten,         &
-                                  pavement_depth, pavement_heat_capacity,      &
+                                  pavement_depth_level,                        &
+                                  pavement_heat_capacity,                      &
                                   pavement_heat_conduct, pavement_type,        &
                                   residual_moisture, root_fraction,            &
@@ -3135,8 +3219,8 @@
              DO  k = nzb_soil, nzt_soil
 
-                IF ( surf%pavement_surface(m)  .AND.  zs(k) <= pavement_depth )  THEN
+                IF ( surf%pavement_surface(m)  .AND.  k <= nzt_pavement )  THEN
                     
-                   surf%rho_c_total(k,m) = surf%rho_c_def(m)
-                   lambda_temp(k)   = surf%lambda_h_def(m) 
+                   surf%rho_c_total(k,m) = surf%rho_c_total_def(k,m)
+                   lambda_temp(k)        = surf%lambda_h_def(k,m) 
 
                 ELSE            
@@ -3167,16 +3251,6 @@
 !--          true pavement depth is considered
              DO  k = nzb_soil, nzt_soil-1
-                IF ( surf%pavement_surface(m)  .AND.  zs(k) < pavement_depth   &
-                     .AND.  zs(k+1) > pavement_depth )                         &
-                THEN
-                   surf%lambda_h(k,m) = ( pavement_depth - zs(k) )             &
-                                      * ddz_soil_center(k+1) * lambda_temp(k)  &
-                                      + ( zs(k+1) - pavement_depth )           &
-                                      * ddz_soil_center(k+1) * lambda_temp(k+1)
-                ELSE
                    surf%lambda_h(k,m) = ( lambda_temp(k+1) + lambda_temp(k) )  &
                                         * 0.5_wp
-                ENDIF
-
              ENDDO
              surf%lambda_h(nzt_soil,m) = lambda_temp(nzt_soil)
@@ -3232,5 +3306,5 @@
 !--             In order to prevent water tranport through paved surfaces, 
 !--             conductivity and diffusivity are set to zero
-                IF ( surf%pavement_surface(m)  .AND.  zs(k) <= pavement_depth )  THEN
+                IF ( surf%pavement_surface(m)  .AND.  k <= nzt_pavement )  THEN
 
                    lambda_temp(k) = 0.0_wp
@@ -3288,24 +3362,9 @@
 !--             ECMWF-IFS Eq. 8.81
                 DO  k = nzb_soil, nzt_soil-1
-                   IF ( surf%pavement_surface(m)  .AND.  zs(k) < pavement_depth&
-                        .AND.  zs(k+1) > pavement_depth )                      &
-                   THEN 
-                      surf%lambda_w(k,m) = ( pavement_depth - zs(k) )          &
-                                      * ddz_soil_center(k+1) * lambda_temp(k)  &
-                                      + ( zs(k+1) - pavement_depth )           &
-                                      * ddz_soil_center(k+1) * lambda_temp(k+1)
-
-                      surf%gamma_w(k,m) = ( pavement_depth - zs(k) )          &
-                                      * ddz_soil_center(k+1) * gamma_temp(k)  &
-                                      + ( zs(k+1) - pavement_depth )           &
-                                      * ddz_soil_center(k+1) * gamma_temp(k+1)
-                   ELSE 
-                      surf%lambda_w(k,m) = ( lambda_temp(k+1) +                &
-                                                   lambda_temp(k) ) * 0.5_wp
-                      surf%gamma_w(k,m)  = ( gamma_temp(k+1)  +                &
-                                                   gamma_temp(k) )  * 0.5_wp
-                   ENDIF
+                   surf%lambda_w(k,m) = ( lambda_temp(k+1) + lambda_temp(k) )  &
+                                        * 0.5_wp
+                   surf%gamma_w(k,m)  = ( gamma_temp(k+1)  +  gamma_temp(k) )  &
+                                        * 0.5_wp
                 ENDDO
-
 !
 !
Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 2574)
+++ palm/trunk/SOURCE/modules.f90	(revision 2575)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Renamed phi -> latitude, moved longitude from radiation model to modules
+! 
+! 2563 2017-10-19 15:36:10Z Giersch
 ! Variable wind_turbine was added to control_parameters
 ! 
@@ -1320,4 +1323,6 @@
     REAL(wp) ::  kappa = 0.4_wp                                !< von Karman constant
     REAL(wp) ::  km_constant = -1.0_wp                         !< namelist parameter
+    REAL(wp) ::  latitude = 55.0_wp                            !< namelist parameter
+    REAL(wp) ::  longitude = 0.0_wp                            !< namelist parameter
     REAL(wp) ::  mask_scale_x = 1.0_wp                         !< namelist parameter
     REAL(wp) ::  mask_scale_y = 1.0_wp                         !< namelist parameter
@@ -1330,5 +1335,4 @@
     REAL(wp) ::  outflow_source_plane = -9999999.9_wp          !< namelist parameter
     REAL(wp) ::  particle_maximum_age = 9999999.9_wp           !< namelist parameter
-    REAL(wp) ::  phi = 55.0_wp                                 !< namelist parameter
     REAL(wp) ::  prandtl_number = 1.0_wp                       !< namelist parameter
     REAL(wp) ::  precipitation_amount_interval = 9999999.9_wp  !< namelist parameter
Index: palm/trunk/SOURCE/parin.f90
===================================================================
--- palm/trunk/SOURCE/parin.f90	(revision 2574)
+++ palm/trunk/SOURCE/parin.f90	(revision 2575)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Renamed phi -> latitude, added longitude
+! 
+! 2563 2017-10-19 15:36:10Z Giersch
 ! Changed position where restart files are closed.
 ! 
@@ -417,11 +420,11 @@
              inflow_disturbance_begin, inflow_disturbance_end,                 &
              initializing_actions, km_constant,                                &
-             large_scale_forcing, large_scale_subsidence,                      &
-             limiter_sedimentation,                                            &
+             large_scale_forcing, large_scale_subsidence, latitude,            &
+             limiter_sedimentation, longitude,                                 &
              loop_optimization, lsf_exception, masking_method, mg_cycles,      &
              mg_switch_to_pe0_level, mixing_length_1d, momentum_advec,         &
              most_method, na_init, nc_const, netcdf_precision, neutral, ngsrb, &
              nsor, nsor_ini, nudging, nx, ny, nz, ocean, omega, omega_sor,     &
-             outflow_source_plane, passive_scalar, phi,                        &
+             outflow_source_plane, passive_scalar,                             &
              prandtl_number, precipitation, psolver, pt_damping_factor,        &
              pt_damping_width, pt_reference, pt_surface,                       &
Index: palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/radiation_model_mod.f90	(revision 2574)
+++ palm/trunk/SOURCE/radiation_model_mod.f90	(revision 2575)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Bugfix: calculation of shortwave and longwave albedos for RRTMG swapped
+! 
+! 2547 2017-10-16 12:41:56Z schwenkel
 ! extended by cloud_droplets option, minor bugfix and correct calculation of
 ! cloud droplet number concentration
@@ -187,7 +190,7 @@
     USE control_parameters,                                                    &
         ONLY:  cloud_droplets, cloud_physics, g, initializing_actions,         &
-               large_scale_forcing, lsf_surf, microphysics_morrison, phi,      & 
-               pt_surface, rho_surface, surface_pressure,                      &
-               time_since_reference_point
+               latitude, longitude, large_scale_forcing, lsf_surf,             &
+               microphysics_morrison, pt_surface, rho_surface,                 &
+               surface_pressure, time_since_reference_point
 
     USE date_and_time_mod,                                                     &
@@ -299,5 +302,4 @@
                 dt_radiation = 0.0_wp,           & !< radiation model timestep
                 emissivity = 9999999.9_wp,       & !< NAMELIST surface emissivity
-                lambda = 0.0_wp,                 & !< longitude in degrees
                 lon = 0.0_wp,                    & !< longitude in radians
                 lat = 0.0_wp,                    & !< latitude in radians
@@ -972,6 +974,6 @@
           decl_2 = 2.0_wp * pi / 365.0_wp
           decl_3 = decl_2 * 81.0_wp
-          lat    = phi * pi / 180.0_wp
-          lon    = lambda * pi / 180.0_wp
+          lat    = latitude * pi / 180.0_wp
+          lon    = longitude * pi / 180.0_wp
        ENDIF
 
@@ -1039,11 +1041,11 @@
 
           IF ( albedo_type /= 0 )  THEN
+             IF ( albedo_sw_dif == 9999999.9_wp )  THEN
+                albedo_sw_dif = albedo_pars(0,albedo_type)
+                albedo_sw_dir = albedo_sw_dif
+             ENDIF
              IF ( albedo_lw_dif == 9999999.9_wp )  THEN
-                albedo_lw_dif = albedo_pars(0,albedo_type)
+                albedo_lw_dif = albedo_pars(1,albedo_type)
                 albedo_lw_dir = albedo_lw_dif
-             ENDIF
-             IF ( albedo_sw_dif == 9999999.9_wp )  THEN
-                albedo_sw_dif = albedo_pars(1,albedo_type)
-                albedo_sw_dir = albedo_sw_dif
              ENDIF
           ENDIF
@@ -1365,12 +1367,7 @@
        ENDIF
        
-       IF ( radiation .AND. radiation_scheme /= 'constant' )  THEN
-          WRITE ( io, 1 )  lambda
-       ENDIF
-
        WRITE( io, 12 ) dt_radiation
  
 
- 1 FORMAT ('    Geograph. longitude            :   lambda = ',F4.1,' degr')
  3 FORMAT (//' Radiation model information:'/                                  &
               ' ----------------------------'/)
@@ -1406,5 +1403,5 @@
                                   albedo_lw_dif, albedo_sw_dir, albedo_sw_dif, &
                                   constant_albedo, dt_radiation,               &
-                                  lambda, lw_radiation, net_radiation,         &
+                                  lw_radiation, net_radiation,                 &
                                   radiation_scheme, skip_time_do_radiation,    &
                                   sw_radiation, unscheduled_radiation_calls
Index: palm/trunk/SOURCE/read_var_list.f90
===================================================================
--- palm/trunk/SOURCE/read_var_list.f90	(revision 2574)
+++ palm/trunk/SOURCE/read_var_list.f90	(revision 2575)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Renamed phi -> latitude, added longitude
+! 
+! 2563 2017-10-19 15:36:10Z Giersch
 ! CALL stg_read_restart_data moved to synthetic_turbulence_generator_mod and
 ! CALL flight_read_restart_data moved to virtual_flights_mod. Furthermore 
@@ -580,6 +583,8 @@
           CASE ( 'passive_scalar' )
              READ ( 13 )  passive_scalar
-          CASE ( 'phi' )
-             READ ( 13 )  phi
+          CASE ( 'latitude' )
+             READ ( 13 )  latitude
+          CASE ( 'longitude' )
+             READ ( 13 )  longitude
           CASE ( 'prandtl_number' )
              READ ( 13 )  prandtl_number
Index: palm/trunk/SOURCE/surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/surface_mod.f90	(revision 2574)
+++ palm/trunk/SOURCE/surface_mod.f90	(revision 2575)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Pavement parameterization revised
+! 
+! 2547 2017-10-16 12:41:56Z schwenkel
 ! extended by cloud_droplets option
 ! 
@@ -170,5 +173,5 @@
        REAL(wp), DIMENSION(:), ALLOCATABLE   ::  rad_net_l         !< net radiation 
        REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  lambda_h          !< heat conductivity of soil (W/m/K) 
-       REAL(wp), DIMENSION(:), ALLOCATABLE   ::  lambda_h_def      !< default heat conductivity of soil (W/m/K)   
+       REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  lambda_h_def      !< default heat conductivity of soil (W/m/K)   
        
        LOGICAL, DIMENSION(:), ALLOCATABLE  ::  building_surface    !< flag parameter indicating that the surface element is covered by buildings (no LSM actions, not implemented yet)
@@ -205,5 +208,5 @@
        REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  m_wilt            !< soil moisture at permanent wilting point (m3/m3)
        REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  n_vg              !< coef. Van Genuchten  
-       REAL(wp), DIMENSION(:),   ALLOCATABLE ::  rho_c_def         !< default volumetric heat capacity of the (soil) layer (J/m3/K)
+       REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  rho_c_total_def   !< default volumetric heat capacity of the (soil) layer (J/m3/K)
        REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  rho_c_total       !< volumetric heat capacity of the actual soil matrix (J/m3/K)
        REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  root_fr           !< root fraction within the soil layers
Index: palm/trunk/SOURCE/write_var_list.f90
===================================================================
--- palm/trunk/SOURCE/write_var_list.f90	(revision 2574)
+++ palm/trunk/SOURCE/write_var_list.f90	(revision 2575)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Renamed phi -> latitude, added longitude
+! 
+! 2574 2017-10-23 09:02:53Z Giersch
 ! Bugfix: Increased length of the character string *** end ***
 ! 
@@ -249,5 +252,5 @@
 
 
-    binary_version = '4.3'
+    binary_version = '4.4'
 
     WRITE ( 14 )  binary_version
@@ -492,6 +495,8 @@
     WRITE ( 14 )  'passive_scalar                '
     WRITE ( 14 )  passive_scalar
-    WRITE ( 14 )  'phi                           '
-    WRITE ( 14 )  phi
+    WRITE ( 14 )  'latitude                      '
+    WRITE ( 14 )  latitude
+    WRITE ( 14 )  'longitude                     '
+    WRITE ( 14 )  longitude
     WRITE ( 14 )  'prandtl_number                '
     WRITE ( 14 )  prandtl_number
