Index: /palm/trunk/SOURCE/lpm_advec.f90
===================================================================
--- /palm/trunk/SOURCE/lpm_advec.f90	(revision 1684)
+++ /palm/trunk/SOURCE/lpm_advec.f90	(revision 1685)
@@ -19,6 +19,7 @@
 ! Current revisions:
 ! ------------------
-! 
-! 
+! TKE check for negative values (so far, only zero value was checked)
+! offset_ocean_nzt_m1 removed
+!
 ! Former revisions:
 ! -----------------
@@ -94,7 +95,7 @@
         ONLY:  block_offset, c_0, density_ratio, dt_min_part, grid_particles,  &
                iran_part, log_z_z0, number_of_particles, number_of_sublayers,  &
-               particles, particle_groups, offset_ocean_nzt,                   &
-               offset_ocean_nzt_m1, sgs_wfu_part, sgs_wfv_part, sgs_wfw_part,  &
-               use_sgs_for_particles, vertical_particle_advection, z0_av_global
+               particles, particle_groups, offset_ocean_nzt, sgs_wfu_part,     &
+               sgs_wfv_part, sgs_wfw_part, use_sgs_for_particles,              &
+               vertical_particle_advection, z0_av_global
         
     USE statistics,                                                            &
@@ -289,4 +290,5 @@
 !--    Same procedure for interpolation of the v velocity-component 
        DO  n = start_index(nb), end_index(nb)
+
           IF ( prandtl_layer  .AND.  particles(n)%z < z_p )  THEN
 
@@ -417,6 +419,7 @@
                 ENDIF
 !
-!--             Needed to avoid NaN particle velocities
-                IF ( e_int(n) == 0.0_wp )  THEN
+!--             Needed to avoid NaN particle velocities (this might not be
+!--             required any more)
+                IF ( e_int(n) <= 0.0_wp )  THEN
                    e_int(n) = 1.0E-20_wp
                 ENDIF
@@ -671,6 +674,7 @@
                 ENDIF
 !
-!--             Needed to avoid NaN particle velocities
-                IF ( e_int(n) == 0.0_wp )  THEN
+!--             Needed to avoid NaN particle velocities (this might not be
+!--             required any more)
+                IF ( e_int(n) <= 0.0_wp )  THEN
                    e_int(n) = 1.0E-20_wp
                 ENDIF
@@ -1134,6 +1138,5 @@
              ENDIF
 
- !           kw = particles(n)%z / dz
-             kw = kp-1                                    ! ok for ocean??? ( + offset_ocean_nzt_m1 ???)
+             kw = kp - 1
 
              IF ( k == 0 )  THEN
Index: /palm/trunk/SOURCE/lpm_exchange_horiz.f90
===================================================================
--- /palm/trunk/SOURCE/lpm_exchange_horiz.f90	(revision 1684)
+++ /palm/trunk/SOURCE/lpm_exchange_horiz.f90	(revision 1685)
@@ -19,5 +19,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! bugfix concerning vertical index offset in case of ocean
 ! 
 ! Former revisions:
@@ -85,5 +85,5 @@
                maximum_number_of_tailpoints, min_nr_particle,                  &
                mpi_particle_type, number_of_tails, number_of_particles,        &
-               offset_ocean_nzt, offset_ocean_nzt_m1, particles,               &
+               offset_ocean_nzt, particles,                                    &
                particle_tail_coordinates, particle_type, prt_count,            &
                tail_mask, trlp_count_sum,                                      &
@@ -1079,5 +1079,5 @@
        ip = ( particle_array(n)%x + 0.5_wp * dx ) * ddx
        jp = ( particle_array(n)%y + 0.5_wp * dy ) * ddy
-       kp = particle_array(n)%z / dz + 1 + offset_ocean_nzt_m1
+       kp = particle_array(n)%z / dz + 1 + offset_ocean_nzt
 
        IF ( ip >= nxl  .AND.  ip <= nxr  .AND.  jp >= nys  .AND.  jp <= nyn    &
Index: /palm/trunk/SOURCE/lpm_init.f90
===================================================================
--- /palm/trunk/SOURCE/lpm_init.f90	(revision 1684)
+++ /palm/trunk/SOURCE/lpm_init.f90	(revision 1685)
@@ -19,5 +19,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! bugfix concerning vertical index offset in case of ocean
 ! 
 ! Former revisions:
@@ -128,5 +128,5 @@
                 number_of_initial_tails, number_of_particles,                  &
                 number_of_particle_groups, number_of_sublayers,                &
-                number_of_tails, offset_ocean_nzt, offset_ocean_nzt_m1,        & 
+                number_of_tails, offset_ocean_nzt, offset_ocean_nzt_m1,        &
                 particles, particle_advection_start, particle_groups,          &
                 particle_groups_type, particles_per_point,                     &
@@ -760,5 +760,5 @@
                             ip = ( tmp_particle%x + 0.5_wp * dx ) * ddx
                             jp = ( tmp_particle%y + 0.5_wp * dy ) * ddy
-                            kp = tmp_particle%z / dz + 1 + offset_ocean_nzt_m1
+                            kp = tmp_particle%z / dz + 1 + offset_ocean_nzt
 
                             IF ( seed_follows_topography )  THEN
Index: /palm/trunk/SOURCE/lpm_pack_arrays.f90
===================================================================
--- /palm/trunk/SOURCE/lpm_pack_arrays.f90	(revision 1684)
+++ /palm/trunk/SOURCE/lpm_pack_arrays.f90	(revision 1685)
@@ -19,5 +19,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! bugfix concerning vertical index calculation in case of ocean
 ! 
 ! Former revisions:
@@ -58,5 +58,5 @@
         ONLY:  deleted_tails, grid_particles, new_tail_id,                     &
                number_of_particles, number_of_tails, offset_ocean_nzt,         &
-               offset_ocean_nzt_m1, particles, particle_type, prt_count,       &
+               particles, particle_type, prt_count,                            &
                particle_tail_coordinates, tail_mask, use_particle_tails
 
@@ -202,5 +202,5 @@
 
       USE control_parameters,                                                  &
-          ONLY: dz,  atmos_ocean_sign
+          ONLY: dz
 
       USE indices,                                                             &
@@ -214,19 +214,18 @@
       IMPLICIT NONE
 
-      INTEGER(iwp), INTENT(IN)    :: ip
-      INTEGER(iwp), INTENT(IN)    :: jp
-      INTEGER(iwp), INTENT(IN)    :: kp
-
-      INTEGER(iwp)                :: i
-      INTEGER(iwp)                :: j
-      INTEGER(iwp)                :: k
-      INTEGER(iwp)                :: n
-      INTEGER(iwp)                :: nn
-      INTEGER(iwp)                :: m
-      INTEGER(iwp)                :: sort_index
-      INTEGER(iwp)                :: is
-      INTEGER(iwp)                :: kk
-
-      INTEGER(iwp),DIMENSION(0:7) :: sort_count
+      INTEGER(iwp), INTENT(IN) :: ip
+      INTEGER(iwp), INTENT(IN) :: jp
+      INTEGER(iwp), INTENT(IN) :: kp
+
+      INTEGER(iwp)             :: i
+      INTEGER(iwp)             :: is
+      INTEGER(iwp)             :: j
+      INTEGER(iwp)             :: k
+      INTEGER(iwp)             :: n
+      INTEGER(iwp)             :: nn
+      INTEGER(iwp)             :: m
+      INTEGER(iwp)             :: sort_index
+
+      INTEGER(iwp), DIMENSION(0:7) :: sort_count
 
       TYPE(particle_type), DIMENSION(number_of_particles,0:7) :: sort_particles
@@ -242,7 +241,5 @@
              i = particles(n)%x * ddx
              j = particles(n)%y * ddy
-             k = ( particles(n)%z + 0.5_wp * dz * atmos_ocean_sign ) / dz +    &
-                 offset_ocean_nzt
-             kk= particles(n)%z / dz + 1 + offset_ocean_nzt_m1
+             k = ( particles(n)%z + 0.5_wp * dz ) / dz + offset_ocean_nzt
              IF ( i == ip )  sort_index = sort_index+4
              IF ( j == jp )  sort_index = sort_index+2
