Index: palm/trunk/SOURCE/advec_ws.f90
===================================================================
--- palm/trunk/SOURCE/advec_ws.f90	(revision 4327)
+++ palm/trunk/SOURCE/advec_ws.f90	(revision 4328)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Minor formatting adjustments
+! 
+! 4327 2019-12-06 14:48:31Z Giersch
 ! Setting of advection flags for vertical fluxes of w revised, air density for
 ! vertical flux calculation of w at k=1 is considered now
@@ -2088,5 +2091,5 @@
                                            )                                  
                                                                               
-              diss_l_u(k,j,tn) = - ABS( u_comp_l ) * (                         &
+             diss_l_u(k,j,tn) = - ABS( u_comp_l ) * (                          &
                               ( 10.0_wp * ibit2 * adv_mom_5                    &
                            +     3.0_wp * ibit1 * adv_mom_3                    &
@@ -2101,5 +2104,5 @@
                               ) *                                              &
                                         ( u(k,j,i+2) - u(k,j,i-3) )            &
-                                                     )
+                                                    )
 
           ENDDO
@@ -2387,5 +2390,5 @@
                 - ( u(k,j,i)   + u(k,j,i-1)   )                                &
                                     * (                                        &
-                     REAL( IBITS(advc_flags_m(k,j,i-1),0,1),  KIND = wp )      &
+                     REAL( IBITS(advc_flags_m(k,j,i-1),0,1), KIND = wp )       &
                    + REAL( IBITS(advc_flags_m(k,j,i-1),1,1), KIND = wp )       &
                    + REAL( IBITS(advc_flags_m(k,j,i-1),2,1), KIND = wp )       &
@@ -2591,5 +2594,5 @@
                                             )
 
-              diss_l_v(k,j,tn) = - ABS( u_comp(k) ) * (                       &
+             diss_l_v(k,j,tn) = - ABS( u_comp(k) ) * (                        &
                               ( 10.0_wp * ibit11 * adv_mom_5                  &
                            +     3.0_wp * ibit10 * adv_mom_3                  &
@@ -2604,5 +2607,5 @@
                               ) *                                             &
                                         ( v(k,j,i+2) - v(k,j,i-3) )           &
-                                                      )
+                                                     )
 
           ENDDO
@@ -2935,5 +2938,5 @@
           ibit11 = REAL( IBITS(advc_flags_m(k,j,i),11,1), KIND = wp )
           ibit10 = REAL( IBITS(advc_flags_m(k,j,i),10,1), KIND = wp )
-          ibit9  = REAL( IBITS(advc_flags_m(k,j,i),9,1), KIND = wp )
+          ibit9  = REAL( IBITS(advc_flags_m(k,j,i),9,1),  KIND = wp )
           
           ibit14 = REAL( IBITS(advc_flags_m(k,j,i),14,1), KIND = wp )
@@ -3213,5 +3216,5 @@
                                             )
 
-               diss_l_w(k,j,tn) = - ABS( u_comp(k) ) * (                      &
+             diss_l_w(k,j,tn) = - ABS( u_comp(k) ) * (                        &
                              ( 10.0_wp * ibit20 * adv_mom_5                   &
                           +     3.0_wp * ibit19 * adv_mom_3                   &
@@ -3226,5 +3229,5 @@
                              ) *                                              &
                                         ( w(k,j,i+2) - w(k,j,i-3) )           &
-                                                       )
+                                                     )
 
           ENDDO
Index: palm/trunk/SOURCE/init_grid.f90
===================================================================
--- palm/trunk/SOURCE/init_grid.f90	(revision 4327)
+++ palm/trunk/SOURCE/init_grid.f90	(revision 4328)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Minor change in nzb_max computation. Commentation added.
+! 
+! 4314 2019-11-29 10:29:20Z suehring
 ! Set additional topography flag 4 to mark topography grid points emerged
 ! from the filtering process.
@@ -612,5 +615,5 @@
 !-- Determine the maximum level of topography. It is used for
 !-- steering the degradation of order of the applied advection scheme, 
-!-- as well in the lpm. 
+!-- as well in the lpm.
     k_top = 0
     DO  i = nxl, nxr
@@ -622,12 +625,13 @@
     ENDDO
 #if defined( __parallel )
-    CALL MPI_ALLREDUCE( k_top + 1, nzb_max, 1, MPI_INTEGER,                    & !is +1 really necessary here?
+    CALL MPI_ALLREDUCE( k_top, nzb_max, 1, MPI_INTEGER,                        &
                         MPI_MAX, comm2d, ierr )
 #else
-    nzb_max = k_top + 1
+    nzb_max = k_top
 #endif
-!   
-!-- If topography extents up to the model top, limit nzb_max to nzt.
-    nzb_max = MIN( nzb_max, nzt ) 
+!
+!-- Increment nzb_max by 1 in order to allow for proper diverengence correction.
+!-- Further, in case topography extents up to the model top, limit to nzt.
+    nzb_max = MIN( nzb_max+1, nzt ) 
 !
 !-- Determine minimum index of topography. Usually, this will be nzb. In case
