Index: palm/trunk/SOURCE/lagrangian_particle_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/lagrangian_particle_model_mod.f90	(revision 4430)
+++ palm/trunk/SOURCE/lagrangian_particle_model_mod.f90	(revision 4444)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! bugfix: cpp-directives for serial mode added
+! 
+! 4430 2020-02-27 18:02:20Z suehring
 ! - Bugfix in logarithmic interpolation of near-ground particle speed (density
 !   was not considered).
@@ -175,4 +178,5 @@
     USE particle_attributes
 
+#if defined( __parallel )
     USE pmc_particle_interface,                                                &
         ONLY: pmcp_c_get_particle_from_parent, pmcp_p_fill_particle_win,       &
@@ -180,4 +184,5 @@
               pmcp_p_delete_particles_in_fine_grid_area, pmcp_g_init,          &
               pmcp_g_print_number_of_particles
+#endif
 
     USE pmc_interface,                                                         &
@@ -307,4 +312,6 @@
 
     INTEGER(iwp), PARAMETER ::  NR_2_direction_move = 10000 !<
+
+#if defined( __parallel )
     INTEGER(iwp)            ::  nr_move_north               !<
     INTEGER(iwp)            ::  nr_move_south               !<
@@ -312,4 +319,5 @@
     TYPE(particle_type), DIMENSION(:), ALLOCATABLE ::  move_also_north
     TYPE(particle_type), DIMENSION(:), ALLOCATABLE ::  move_also_south
+#endif
 
     REAL(wp) ::  epsilon_collision !<
@@ -1234,5 +1242,8 @@
     ENDIF
 
+#if defined( __parallel )
     IF ( nested_run )  CALL pmcp_g_init
+#endif
+
 !
 !-- To avoid programm abort, assign particles array to the local version of
@@ -2263,4 +2274,6 @@
                 first_loop_stride = .FALSE.
              ENDDO   ! timestep loop
+
+#if defined( __parallel )
 !
 !--          in case of nested runs do the transfer of particles after every full model time step
@@ -2274,4 +2287,5 @@
                 deleted_particles = 0
              ENDIF
+#endif
 
 !
@@ -2341,4 +2355,20 @@
  END SUBROUTINE lpm_actions
  
+
+#if defined( __parallel )
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!
+!------------------------------------------------------------------------------!
+ SUBROUTINE particles_from_parent_to_child
+
+    CALL pmcp_c_get_particle_from_parent                         ! Child actions
+    CALL pmcp_p_fill_particle_win                                ! Parent actions
+
+    RETURN
+
+ END SUBROUTINE particles_from_parent_to_child
+
  
 !------------------------------------------------------------------------------!
@@ -2347,19 +2377,4 @@
 !
 !------------------------------------------------------------------------------!
- SUBROUTINE particles_from_parent_to_child
-
-    CALL pmcp_c_get_particle_from_parent                         ! Child actions
-    CALL pmcp_p_fill_particle_win                                ! Parent actions
-
-    RETURN
-
- END SUBROUTINE particles_from_parent_to_child
-
- 
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-!
-!------------------------------------------------------------------------------!
  SUBROUTINE particles_from_child_to_parent
 
@@ -2370,4 +2385,5 @@
 
  END SUBROUTINE particles_from_child_to_parent
+#endif
  
 !------------------------------------------------------------------------------!
@@ -2421,8 +2437,10 @@
 #endif
 
+#if defined( __parallel )
     IF ( nested_run )  THEN
        CALL pmcp_g_print_number_of_particles( simulated_time+dt_3d,            &
                                               tot_number_of_particles)
     ENDIF
+#endif
 
 !
@@ -6973,10 +6991,12 @@
  SUBROUTINE lpm_exchange_horiz
 
-    INTEGER(iwp) ::  i                 !< grid index (x) of particle positition
     INTEGER(iwp) ::  ip                !< index variable along x
-    INTEGER(iwp) ::  j                 !< grid index (y) of particle positition
     INTEGER(iwp) ::  jp                !< index variable along y
     INTEGER(iwp) ::  kp                !< index variable along z
     INTEGER(iwp) ::  n                 !< particle index variable 
+
+#if defined( __parallel )
+    INTEGER(iwp) ::  i                 !< grid index (x) of particle positition
+    INTEGER(iwp) ::  j                 !< grid index (y) of particle positition
     INTEGER(iwp) ::  par_size          !< Particle size in bytes
     INTEGER(iwp) ::  trlp_count        !< number of particles send to left PE
@@ -6997,4 +7017,5 @@
     TYPE(particle_type), DIMENSION(:), ALLOCATABLE ::  trrp  !< particles send to right PE
     TYPE(particle_type), DIMENSION(:), ALLOCATABLE ::  trsp  !< particles send to south PE
+#endif
 
     CALL cpu_log( log_point_s(23), 'lpm_exchange_horiz', 'start' )
@@ -7614,4 +7635,5 @@
  END SUBROUTINE lpm_exchange_horiz
 
+#if defined( __parallel )
 !------------------------------------------------------------------------------!
 ! Description:
@@ -7773,7 +7795,6 @@
     ENDDO
 
-    RETURN
-
  END SUBROUTINE lpm_add_particles_to_gridcell
+#endif
  
  
