Index: palm/trunk/SOURCE/lpm_advec.f90
===================================================================
--- palm/trunk/SOURCE/lpm_advec.f90	(revision 2969)
+++ palm/trunk/SOURCE/lpm_advec.f90	(revision 3065)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! dz values were replaced by dzw or dz(1) to allow for right vertical stretching
+! 
+! 2969 2018-04-13 11:55:09Z thiele
 ! Bugfix in Interpolation indices.
 ! 
@@ -158,5 +161,5 @@
 
     USE arrays_3d,                                                             &
-        ONLY:  de_dx, de_dy, de_dz, diss, e, km, u, v, w, zu, zw
+        ONLY:  de_dx, de_dy, de_dz, diss, dzw, e, km, u, v, w, zu, zw
 
     USE cpulog
@@ -409,5 +412,5 @@
                             + ( gg-cc ) * u(k+1,j+1,i) + ( gg-dd ) *           &
                             u(k+1,j+1,i+1) ) / ( 3.0_wp * gg ) - u_gtrans
-                u_int(n) = u_int_l + ( zv(n) - zu(k) ) / dz *                  &
+                u_int(n) = u_int_l + ( zv(n) - zu(k) ) / dzw(k) *               &
                            ( u_int_u - u_int_l )
              ENDIF
@@ -503,5 +506,5 @@
                           + ( gg-cc ) * v(k+1,j+1,i) + ( gg-dd ) * v(k+1,j+1,i+1) &
                           ) / ( 3.0_wp * gg ) - v_gtrans
-                v_int(n) = v_int_l + ( zv(n) - zu(k) ) / dz * &
+                v_int(n) = v_int_l + ( zv(n) - zu(k) ) / dzw(k) *               &
                                   ( v_int_u - v_int_l )
              ENDIF
@@ -540,5 +543,5 @@
                             ( gg-dd ) * w(k+1,j+1,i+1) &
                           ) / ( 3.0_wp * gg )
-                w_int(n) = w_int_l + ( zv(n) - zw(k) ) / dz * &
+                w_int(n) = w_int_l + ( zv(n) - zw(k) ) / dzw(k) *               &
                            ( w_int_u - w_int_l )
              ENDIF
@@ -611,5 +614,5 @@
                                ( gg - dd ) * e(k+1,j+1,i+1) &
                             ) / ( 3.0_wp * gg )
-                   e_int(n) = e_int_l + ( zv(n) - zu(k) ) / dz * &
+                   e_int(n) = e_int_l + ( zv(n) - zu(k) ) / dzw(k) *            &
                                      ( e_int_u - e_int_l )
                 ENDIF
@@ -637,5 +640,5 @@
                                    ( gg - dd ) * de_dx(k+1,j+1,i+1) &
                                   ) / ( 3.0_wp * gg )
-                   de_dx_int(n) = de_dx_int_l + ( zv(n) - zu(k) ) / dz * &
+                   de_dx_int(n) = de_dx_int_l + ( zv(n) - zu(k) ) / dzw(k) *    &
                                               ( de_dx_int_u - de_dx_int_l )
                 ENDIF
@@ -655,5 +658,5 @@
                                    ( gg - dd ) * de_dy(k+1,j+1,i+1) &
                                   ) / ( 3.0_wp * gg )
-                      de_dy_int(n) = de_dy_int_l + ( zv(n) - zu(k) ) / dz * &
+                      de_dy_int(n) = de_dy_int_l + ( zv(n) - zu(k) ) / dzw(k) * &
                                                  ( de_dy_int_u - de_dy_int_l )
                 ENDIF
@@ -661,5 +664,5 @@
 !
 !--             Interpolate the TKE gradient along z
-                IF ( zv(n) < 0.5_wp * dz )  THEN
+                IF ( zv(n) < 0.5_wp * dz(1) )  THEN
                    de_dz_int(n) = 0.0_wp
                 ELSE
@@ -678,5 +681,5 @@
                                       ( gg - dd ) * de_dz(k+1,j+1,i+1) &
                                      ) / ( 3.0_wp * gg )
-                      de_dz_int(n) = de_dz_int_l + ( zv(n) - zu(k) ) / dz * &
+                      de_dz_int(n) = de_dz_int_l + ( zv(n) - zu(k) ) / dzw(k) * &
                                                  ( de_dz_int_u - de_dz_int_l )
                    ENDIF
@@ -699,5 +702,5 @@
                                   ( gg - dd ) * diss(k+1,j+1,i+1) &
                                  ) / ( 3.0_wp * gg )
-                   diss_int(n) = diss_int_l + ( zv(n) - zu(k) ) / dz * &
+                   diss_int(n) = diss_int_l + ( zv(n) - zu(k) ) / dzw(k) *      &
                                             ( diss_int_u - diss_int_l )
                 ENDIF
