Index: palm/trunk/SCRIPTS/palm_jm
===================================================================
--- palm/trunk/SCRIPTS/palm_jm	(revision 2503)
+++ palm/trunk/SCRIPTS/palm_jm	(revision 2504)
@@ -25,4 +25,7 @@
 # -----------------
 # $Id$
+# Bugfix: jobs were not loaded on start.
+# 
+# 2484 2017-09-20 14:22:42Z maronga
 # Adapted for palmrun with USER_CODE always stored under /JOBS/name/USER_CODE/.
 # Added PALM logo
@@ -105,5 +108,5 @@
         QtGui.QApplication.processEvents()
 
-        #self.load_jobs()
+        self.load_jobs()
 
     
Index: palm/trunk/SOURCE/land_surface_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 2503)
+++ palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 2504)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Support roots and water under pavement. Added several pavement types.
+! 
+! 2476 2017-09-18 07:54:32Z maronga
 ! Bugfix for last commit
 ! 
@@ -558,15 +561,27 @@
 !
 !-- Pavement classes
-    CHARACTER(20), DIMENSION(0:7), PARAMETER :: pavement_type_name = (/ &
-                                   'user defined        ', & ! 0 
-                                   'asphalt             ', & ! 1
-                                   'concrete            ', & ! 2
-                                   'asphalt/concrete mix', & ! 3
-                                   'brick pavers        ', & ! 4
-                                   'cobblestone pavers  ', & ! 5
-                                   'sett pavers         ', & ! 6
-                                   'gravel pavers       '  & ! 7
+    CHARACTER(29), DIMENSION(0:15), PARAMETER :: pavement_type_name = (/ &
+                                   'user defined                 ', & ! 0 
+                                   'asphalt/concrete mix         ', & ! 1
+                                   'asphalt (asphalt concrete)   ', & ! 2
+                                   'concrete (Portland concrete) ', & ! 3
+                                   'sett                         ', & ! 4
+                                   'paving stones                ', & ! 5
+                                   'cobblestone                  ', & ! 6
+                                   'metal                        ', & ! 7
+                                   'wood                         ', & ! 8
+                                   'gravel                       ', & ! 9
+                                   'fine gravel                  ', & ! 10
+                                   'pebblestone                  ', & ! 11
+                                   'woodchips                    ', & ! 12
+                                   'tartan (sports)              ', & ! 13
+                                   'artifical turf (sports)      ', & ! 14
+                                   'clay (sports)                '  & ! 15
                                                                  /)                                                                 
-                                                                 
+   
+
+
+
+                                                              
 !
 !-- Water classes
@@ -587,5 +602,5 @@
 !-- r_canopy_min,     lai,   c_veg,     g_d         z0,         z0h, lambda_s_s, lambda_s_u, f_sw_in,  c_surface, albedo_type, emissivity
     REAL(wp), DIMENSION(0:11,1:18), PARAMETER :: vegetation_pars = RESHAPE( (/ &
-          0.0_wp, 0.00_wp, 0.00_wp, 0.00_wp,  0.005_wp,   0.5E-4_wp,     0.0_wp,    0.0_wp, 0.00_wp, 0.00_wp, 18.0_wp, 0.94_wp, & !  1
+          0.0_wp, 0.00_wp, 0.00_wp, 0.00_wp,  0.005_wp,   0.5E-4_wp,     0.0_wp,    0.0_wp, 0.00_wp, 0.00_wp, 17.0_wp, 0.94_wp, & !  1
         180.0_wp, 3.00_wp, 1.00_wp, 0.00_wp,   0.10_wp,    0.001_wp,    10.0_wp,   10.0_wp, 0.05_wp, 0.00_wp,  2.0_wp, 0.95_wp, & !  2
         110.0_wp, 2.00_wp, 1.00_wp, 0.00_wp,   0.03_wp,   0.3E-4_wp,    10.0_wp,   10.0_wp, 0.05_wp, 0.00_wp,  2.0_wp, 0.95_wp, & !  3
@@ -649,13 +664,21 @@
 !-- TO BE FILLED
 !-- Pavement parameters  depth,        z0,       z0h, lambda_h,      rho_c, albedo_type, emissivity  
-    REAL(wp), DIMENSION(0:6,1:7), PARAMETER :: pavement_pars = RESHAPE( (/ &
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 17.0_wp, 0.97_wp,  & ! 1
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 18.0_wp, 0.94_wp,  & ! 2
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 19.0_wp, 0.98_wp,  & ! 3                                  
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 20.0_wp, 0.93_wp,  & ! 4
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 21.0_wp, 0.97_wp,  & ! 5
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 22.0_wp, 0.97_wp,  & ! 6
-                      0.050_wp, 1.0E-4_wp, 1.0E-5_wp,  1.00_wp,  1.94E6_wp, 23.0_wp, 0.97_wp   & ! 7
-                                                                 /), (/ 7, 7 /) )                             
+    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 /) )                             
 
 !
@@ -2426,5 +2449,5 @@
                 surf_lsm_h%lambda_h_def(m)    = pavement_heat_conduct                                     
                 surf_lsm_h%rho_c_def(m)       = pavement_heat_capacity                                                
-                
+
              ELSEIF ( surf_lsm_h%vegetation_surface(m) )  THEN
 
@@ -2692,6 +2715,20 @@
              j   = surf_lsm_h%j(m)
              DO  k = nzb_soil, nzt_soil 
-                surf_lsm_h%root_fr(k,m) = root_fraction(k)
-             ENDDO
+                IF ( surf_lsm_h%pavement_surface(m)  .AND.  zs(k) <= pavement_depth )  THEN
+                   surf_lsm_h%root_fr(k,m) = 0.0_wp
+                ELSE
+                   surf_lsm_h%root_fr(k,m) = root_fraction(k)
+                ENDIF
+             ENDDO
+
+!
+!--          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) )
+                ENDDO
+             ENDIF
+
           ENDDO
           DO  l = 0, 3
@@ -2701,6 +2738,19 @@
 
                 DO  k = nzb_soil, nzt_soil
-                   surf_lsm_v(l)%root_fr(k,m) = root_fraction(k)
+                   IF ( surf_lsm_v(l)%pavement_surface(m)  .AND.  zs(k) <= pavement_depth )  THEN
+                      surf_lsm_v(l)%root_fr(k,m) = 0.0_wp
+                   ELSE
+                      surf_lsm_v(l)%root_fr(k,m) = root_fraction(k)
+                   ENDIF
                 ENDDO
+!
+!--             Normalize so that the sum = 1. Only relevant when the root distribution was
+!--             sset 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) )
+                   ENDDO
+                ENDIF
+
              ENDDO
            ENDDO
@@ -3161,29 +3211,40 @@
 
 !
-!--             Calculate soil diffusivity at the center of the soil layers
-                lambda_temp(k) = (- b_ch * surf%gamma_w_sat(k,m) * psi_sat     &
-                                 / surf%m_sat(k,m) ) * (                       &
-                                 MAX( surf_m_soil%var_2d(k,m),                 &
-                                 surf%m_wilt(k,m) ) / surf%m_sat(k,m) )**(     &
-                                 b_ch + 2.0_wp )
-
-!
-!--             Parametrization of Van Genuchten
-!--             Calculate the hydraulic conductivity after Van Genuchten (1980)
-                h_vg = ( ( ( surf%m_res(k,m) - surf%m_sat(k,m) ) /             &
-                           ( surf%m_res(k,m) -                                 &
-                             MAX( surf_m_soil%var_2d(k,m), surf%m_wilt(k,m) )  &
-                           )                                                   &
-                         )**( surf%n_vg(k,m) / ( surf%n_vg(k,m) - 1.0_wp )     &
-                            ) - 1.0_wp                                         &
-                       )**( 1.0_wp / surf%n_vg(k,m) ) / surf%alpha_vg(k,m)
-
-                gamma_temp(k) = surf%gamma_w_sat(k,m) * ( ( ( 1.0_wp +         &
-                       ( surf%alpha_vg(k,m) * h_vg )**surf%n_vg(k,m)           &
-                       )**( 1.0_wp - 1.0_wp / surf%n_vg(k,m) )                 &
-                       - ( surf%alpha_vg(k,m) * h_vg )**( surf%n_vg(k,m)       &
-                       - 1.0_wp) )**2 ) / ( ( 1.0_wp + ( surf%alpha_vg(k,m)    &
-                       * h_vg )**surf%n_vg(k,m) )**( ( 1.0_wp  - 1.0_wp        &
-                           / surf%n_vg(k,m) ) * ( surf%l_vg(k,m) + 2.0_wp) ) )
+!--             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
+
+                   lambda_temp(k) = 0.0_wp
+                   gamma_temp(k)  = 0.0_wp
+
+                ELSE 
+
+!
+!--                Calculate soil diffusivity at the center of the soil layers
+                   lambda_temp(k) = (- b_ch * surf%gamma_w_sat(k,m) * psi_sat  &
+                                    / surf%m_sat(k,m) ) * (                    &
+                                    MAX( surf_m_soil%var_2d(k,m),              &
+                                    surf%m_wilt(k,m) ) / surf%m_sat(k,m) )**(  &
+                                    b_ch + 2.0_wp )
+
+!
+!--                Parametrization of Van Genuchten
+!--                Calculate the hydraulic conductivity after Van Genuchten (1980)
+                   h_vg = ( ( ( surf%m_res(k,m) - surf%m_sat(k,m) ) /          &
+                              ( surf%m_res(k,m) -                              &
+                                MAX(surf_m_soil%var_2d(k,m), surf%m_wilt(k,m)) &
+                              )                                                &
+                            )**( surf%n_vg(k,m) / ( surf%n_vg(k,m) - 1.0_wp )  &
+                               ) - 1.0_wp                                      &
+                          )**( 1.0_wp / surf%n_vg(k,m) ) / surf%alpha_vg(k,m)
+
+                   gamma_temp(k) = surf%gamma_w_sat(k,m) * ( ( ( 1.0_wp +      &
+                          ( surf%alpha_vg(k,m) * h_vg )**surf%n_vg(k,m)        &
+                          )**( 1.0_wp - 1.0_wp / surf%n_vg(k,m) )              &
+                          - ( surf%alpha_vg(k,m) * h_vg )**( surf%n_vg(k,m)    &
+                          - 1.0_wp) )**2 ) / ( ( 1.0_wp + ( surf%alpha_vg(k,m) &
+                          * h_vg )**surf%n_vg(k,m) )**(( 1.0_wp  - 1.0_wp      &
+                              / surf%n_vg(k,m) ) * ( surf%l_vg(k,m) + 2.0_wp) ))
+                ENDIF
 
              ENDDO
@@ -3201,7 +3262,6 @@
 !
 !--          Prognostic equation for soil moisture content. Only performed,
-!--          when humidity is enabled in the atmosphere and the surface type
-!--          is not pavement (implies dry soil below).
-             IF ( humidity  .AND.  .NOT.  surf%pavement_surface(m) )  THEN
+!--          when humidity is enabled in the atmosphere.
+             IF ( humidity )  THEN
 !
 !--             Calculate soil diffusivity (lambda_w) at the _layer level 
@@ -3209,10 +3269,22 @@
 !--             ECMWF-IFS Eq. 8.81
                 DO  k = nzb_soil, nzt_soil-1
-                    
-                   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
-
+                   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
                 ENDDO
 
@@ -3221,6 +3293,9 @@
 !--             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
+!--             lost in the bottom layer. As gamma_w is always a positive value,
+!--             it cannot be set to zero in case of purely dry soil since this
+!--             would cause accumulation of (non-existing) water in the lowest
+!--             soil layer
+                IF ( conserve_water_content .AND. surf_m_soil%var_2d(nzt_soil,m) /= 0.0_wp )  THEN
                    surf%gamma_w(nzt_soil,m) = 0.0_wp
                 ELSE
@@ -3294,5 +3369,4 @@
                                        + dt_3d * ( tsc(2) * tend(:)            &
                                        + tsc(3) * surf_tm_soil_m%var_2d(:,m) )   
-   
 !
 !--             Account for dry soils (find a better solution here!)
Index: palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/radiation_model_mod.f90	(revision 2503)
+++ palm/trunk/SOURCE/radiation_model_mod.f90	(revision 2504)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Updates pavement types and albedo parameters
+! 
+! 2328 2017-08-03 12:34:22Z maronga
 ! Emissivity can now be set individually for each pixel.
 ! Albedo type can be inferred from land surface model.
@@ -216,5 +219,5 @@
 !
 !-- Predefined Land surface classes (albedo_type) after Briegleb (1992)
-    CHARACTER(37), DIMENSION(0:18), PARAMETER :: albedo_type_name = (/      &
+    CHARACTER(37), DIMENSION(0:33), PARAMETER :: albedo_type_name = (/      &
                                    'user defined                         ', & !  0 
                                    'ocean                                ', & !  1
@@ -234,7 +237,23 @@
                                    'sea ice                              ', & ! 15 
                                    'snow                                 ', & ! 16
-                                   'pavement/roads                       ', & ! 17
-                                   'bare soil                            '  & ! 18
+                                   'bare soil                            ', & ! 17
+                                   'asphalt/concrete mix                 ', & ! 18
+                                   'asphalt (asphalt concrete)           ', & ! 19
+                                   'concrete (Portland concrete)         ', & ! 20
+                                   'sett                                 ', & ! 21
+                                   'paving stones                        ', & ! 22
+                                   'cobblestone                          ', & ! 23
+                                   'metal                                ', & ! 24
+                                   'wood                                 ', & ! 25
+                                   'gravel                               ', & ! 26
+                                   'fine gravel                          ', & ! 27
+                                   'pebblestone                          ', & ! 28
+                                   'woodchips                            ', & ! 29
+                                   'tartan (sports)                      ', & ! 30
+                                   'artifical turf (sports)              ', & ! 31
+                                   'clay (sports)                        ', & ! 32
+                                   'building (dummy)                     '  & ! 33
                                                          /)
+
 
     INTEGER(iwp) :: albedo_type  = 9999999, & !< Albedo surface type
@@ -292,5 +311,5 @@
 !-- Land surface albedos for solar zenith angle of 60Â° after Briegleb (1992)     
 !-- (shortwave, longwave, broadband):   sw,      lw,      bb,
-    REAL(wp), DIMENSION(0:2,1:18), PARAMETER :: albedo_pars = RESHAPE( (/& 
+    REAL(wp), DIMENSION(0:2,1:33), PARAMETER :: albedo_pars = RESHAPE( (/& 
                                    0.06_wp, 0.06_wp, 0.06_wp,            & !  1
                                    0.09_wp, 0.28_wp, 0.19_wp,            & !  2
@@ -310,6 +329,21 @@
                                    0.95_wp, 0.70_wp, 0.82_wp,            & ! 16
                                    0.08_wp, 0.08_wp, 0.08_wp,            & ! 17
-                                   0.17_wp, 0.17_wp, 0.17_wp             & ! 18
-                                 /), (/ 3, 18 /) )
+                                   0.17_wp, 0.17_wp, 0.17_wp,            & ! 18
+                                   0.17_wp, 0.17_wp, 0.17_wp,            & ! 19
+                                   0.17_wp, 0.17_wp, 0.17_wp,            & ! 20
+                                   0.17_wp, 0.17_wp, 0.17_wp,            & ! 21
+                                   0.17_wp, 0.17_wp, 0.17_wp,            & ! 22
+                                   0.17_wp, 0.17_wp, 0.17_wp,            & ! 23
+                                   0.17_wp, 0.17_wp, 0.17_wp,            & ! 24
+                                   0.17_wp, 0.17_wp, 0.17_wp,            & ! 25
+                                   0.17_wp, 0.17_wp, 0.17_wp,            & ! 26
+                                   0.17_wp, 0.17_wp, 0.17_wp,            & ! 27
+                                   0.17_wp, 0.17_wp, 0.17_wp,            & ! 28
+                                   0.17_wp, 0.17_wp, 0.17_wp,            & ! 29
+                                   0.17_wp, 0.17_wp, 0.17_wp,            & ! 30
+                                   0.17_wp, 0.17_wp, 0.17_wp,            & ! 31
+                                   0.17_wp, 0.17_wp, 0.17_wp,            & ! 32
+                                   0.17_wp, 0.17_wp, 0.17_wp             & ! 33
+                                 /), (/ 3, 33 /) )
 
     REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, TARGET :: &
@@ -1739,5 +1773,5 @@
 
 !
-!--        Asphalt
+!--        Bare soil
            ELSEIF ( albedo_type == 17 )  THEN
                  rrtm_aldir(0,:,:) = aldif
@@ -1745,13 +1779,12 @@
 
 !
-!--        Bare soil
-           ELSEIF ( albedo_type == 18 )  THEN
+!--        For impermeable surfaces, use values from the lookup table
+           ELSEIF ( albedo_type > 17 )  THEN
                  rrtm_aldir(0,:,:) = aldif
                  rrtm_asdir(0,:,:) = asdif
-
 !
 !--        Land surfaces
            ELSE
-              SELECT CASE ( albedo_type )
+               SELECT CASE ( albedo_type )
 
 !
