Index: palm/trunk/SOURCE/lpm_advec.f90
===================================================================
--- palm/trunk/SOURCE/lpm_advec.f90	(revision 3187)
+++ palm/trunk/SOURCE/lpm_advec.f90	(revision 3189)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Bugfix: Index of the array dzw has to be k+1 during the interpolation. 
+! Otherwise k=0 causes an abortion because dzw is allocated from 1 to nzt+1
+! 
+! 3065 2018-06-12 07:03:02Z Giersch
 ! dz values were replaced by dzw or dz(1) to allow for right vertical stretching
 ! 
@@ -412,5 +416,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) ) / dzw(k) *               &
+                u_int(n) = u_int_l + ( zv(n) - zu(k) ) / dzw(k+1) *               &
                            ( u_int_u - u_int_l )
              ENDIF
@@ -506,5 +510,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) ) / dzw(k) *               &
+                v_int(n) = v_int_l + ( zv(n) - zu(k) ) / dzw(k+1) *               &
                                   ( v_int_u - v_int_l )
              ENDIF
@@ -543,5 +547,5 @@
                             ( gg-dd ) * w(k+1,j+1,i+1) &
                           ) / ( 3.0_wp * gg )
-                w_int(n) = w_int_l + ( zv(n) - zw(k) ) / dzw(k) *               &
+                w_int(n) = w_int_l + ( zv(n) - zw(k) ) / dzw(k+1) *               &
                            ( w_int_u - w_int_l )
              ENDIF
@@ -614,5 +618,5 @@
                                ( gg - dd ) * e(k+1,j+1,i+1) &
                             ) / ( 3.0_wp * gg )
-                   e_int(n) = e_int_l + ( zv(n) - zu(k) ) / dzw(k) *            &
+                   e_int(n) = e_int_l + ( zv(n) - zu(k) ) / dzw(k+1) *            &
                                      ( e_int_u - e_int_l )
                 ENDIF
@@ -640,5 +644,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) ) / dzw(k) *    &
+                   de_dx_int(n) = de_dx_int_l + ( zv(n) - zu(k) ) / dzw(k+1) *    &
                                               ( de_dx_int_u - de_dx_int_l )
                 ENDIF
@@ -658,5 +662,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) ) / dzw(k) * &
+                      de_dy_int(n) = de_dy_int_l + ( zv(n) - zu(k) ) / dzw(k+1) * &
                                                  ( de_dy_int_u - de_dy_int_l )
                 ENDIF
@@ -681,5 +685,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) ) / dzw(k) * &
+                      de_dz_int(n) = de_dz_int_l + ( zv(n) - zu(k) ) / dzw(k+1) * &
                                                  ( de_dz_int_u - de_dz_int_l )
                    ENDIF
@@ -702,5 +706,5 @@
                                   ( gg - dd ) * diss(k+1,j+1,i+1) &
                                  ) / ( 3.0_wp * gg )
-                   diss_int(n) = diss_int_l + ( zv(n) - zu(k) ) / dzw(k) *      &
+                   diss_int(n) = diss_int_l + ( zv(n) - zu(k) ) / dzw(k+1) *      &
                                             ( diss_int_u - diss_int_l )
                 ENDIF
Index: palm/trunk/SOURCE/lpm_boundary_conds.f90
===================================================================
--- palm/trunk/SOURCE/lpm_boundary_conds.f90	(revision 3187)
+++ palm/trunk/SOURCE/lpm_boundary_conds.f90	(revision 3189)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Bugfix in calculation of the x/y indices for current particle postion
+! 
+! 3067 2018-06-12 14:04:34Z suehring
 ! Remove write statements
 ! 
@@ -287,4 +290,5 @@
           j2 = particles(n)%y * ddy
           IF (zw(k)   < particles(n)%z ) k2 = k + 1
+          IF (zw(k)   > particles(n)%z .AND. zw(k-1) < particles(n)%z ) k2 = k
           IF (zw(k-1) > particles(n)%z ) k2 = k - 1 
 !
Index: palm/trunk/SOURCE/user_parin.f90
===================================================================
--- palm/trunk/SOURCE/user_parin.f90	(revision 3187)
+++ palm/trunk/SOURCE/user_parin.f90	(revision 3189)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Indent revised
+! 
+! 3174 2018-07-26 13:46:50Z Giersch
 ! userpar in READ statement has been changed to user_parameters 
 ! 
@@ -187,5 +190,5 @@
              j = j + 1
           ENDDO
-      ENDIF
+       ENDIF
 
 
