Index: palm/trunk/SOURCE/land_surface_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 4024)
+++ palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 4026)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Further revision of last commit in order to avoid any side effects when 
+! albedo type is not set in namelist and default albedo type changes. 
+! 
+! 4024 2019-06-12 14:06:46Z suehring
 ! Bugfix in albedo initialization, caused crashes in rrtmg calls
 ! 
@@ -2792,10 +2796,26 @@
        ALLOCATE ( surf_lsm_h%albedo_type(0:2,1:surf_lsm_h%ns) )
        ALLOCATE ( surf_lsm_h%emissivity(0:2,1:surf_lsm_h%ns) )
-       surf_lsm_h%albedo_type = albedo_type     
+!
+!--    Initialize albedo type according to its default type, in order to set values
+!--    independent on default albedo_type in radiation model. 
+       surf_lsm_h%albedo_type(ind_veg_wall,:)  =                               &
+                             INT( vegetation_pars(ind_v_at,vegetation_type) )
+       surf_lsm_h%albedo_type(ind_wat_win,:)   =                               &
+                             INT( water_pars(ind_w_at,water_type)           )
+       surf_lsm_h%albedo_type(ind_pav_green,:) =                               &
+                             INT( pavement_pars(ind_p_at,pavement_type)     )
        surf_lsm_h%emissivity  = emissivity
        DO  l = 0, 3
           ALLOCATE ( surf_lsm_v(l)%albedo_type(0:2,1:surf_lsm_v(l)%ns) )
           ALLOCATE ( surf_lsm_v(l)%emissivity(0:2,1:surf_lsm_v(l)%ns)  )
-          surf_lsm_v(l)%albedo_type = albedo_type
+!
+!--       Initialize albedo type according to its default type, in order to 
+!--       set values independent on default albedo_type in radiation model. 
+          surf_lsm_v(l)%albedo_type(ind_veg_wall,:)  =                         &
+                             INT( vegetation_pars(ind_v_at,vegetation_type) )
+          surf_lsm_v(l)%albedo_type(ind_wat_win,:)   =                         &
+                             INT( water_pars(ind_w_at,water_type)           )
+          surf_lsm_v(l)%albedo_type(ind_pav_green,:) =                         &
+                             INT( pavement_pars(ind_p_at,pavement_type)     )
           surf_lsm_v(l)%emissivity  = emissivity
        ENDDO
Index: palm/trunk/SOURCE/pmc_interface_mod.f90
===================================================================
--- palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 4024)
+++ palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 4026)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Masked topography at boundary grid points in mass conservation, in order to 
+! avoid that mean velocities within topography are imposed
+! 
+! 4011 2019-05-31 14:34:03Z hellstea
 ! Mass (volume) flux correction included to ensure global mass conservation for child domains.
 ! 
@@ -5288,5 +5292,6 @@
           DO  j = nys, nyn
              DO  k = nzb + 1, nzt
-                u(k,j,i) = u(k,j,i) + u_corr_left
+                u(k,j,i) = u(k,j,i) + u_corr_left                              &
+                     * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 1 ) )
              ENDDO
           ENDDO
@@ -5299,5 +5304,6 @@
           DO  j = nys, nyn
              DO  k = nzb + 1, nzt
-                u(k,j,i) = u(k,j,i) + u_corr_right
+                u(k,j,i) = u(k,j,i) + u_corr_right                              &
+                      * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 1 ) )
              ENDDO
           ENDDO
@@ -5310,5 +5316,6 @@
           DO  j = nysg, nys
              DO  k = nzb + 1, nzt
-                v(k,j,i) = v(k,j,i) + v_corr_south
+                v(k,j,i) = v(k,j,i) + v_corr_south                              &
+                      * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 2 ) )
              ENDDO
           ENDDO
@@ -5321,5 +5328,6 @@
           DO  j = nyn+1, nyng
              DO  k = nzb + 1, nzt
-                v(k,j,i) = v(k,j,i) + v_corr_north
+                v(k,j,i) = v(k,j,i) + v_corr_north                              &
+                      * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 2 ) )
              ENDDO
           ENDDO
