Index: palm/trunk/SOURCE/pmc_particle_interface.f90
===================================================================
--- palm/trunk/SOURCE/pmc_particle_interface.f90	(revision 2884)
+++ palm/trunk/SOURCE/pmc_particle_interface.f90	(revision 2967)
@@ -26,4 +26,7 @@
 ! -----------------! 
 ! $Id$
+! bugfix: missing parallel cpp-directives added
+! 
+! 2884 2018-03-14 08:33:20Z scharf
 ! B: corrected KIND of variable "parsize" for some MPI calls
 ! 
@@ -47,5 +50,5 @@
    USE, INTRINSIC ::  ISO_C_BINDING
 
-#if !defined( __mpifh )
+#if defined( __parallel )  &&  !defined( __mpifh )
    USE MPI
 #endif
@@ -75,4 +78,8 @@
    USE lpm_pack_and_sort_mod
 
+   USE lpm_exchange_horiz_mod,                                                 &
+       ONLY: realloc_particles_array
+
+#if defined( __parallel )
    USE pmc_general,                                                            &
        ONLY: pedef
@@ -97,10 +104,9 @@
        ONLY: pmc_send_to_parent, pmc_recv_from_child
 
-   USE lpm_exchange_horiz_mod,                                                 &
-       ONLY: realloc_particles_array
+#endif
 
    IMPLICIT NONE
 
-#if defined( __mpifh )
+#if defined( __parallel )  &&  defined( __mpifh )
    INCLUDE "mpif.h"
 #endif
@@ -181,4 +187,6 @@
  
     INTEGER(iwp) ::  nr_childs !< Number of child models of the current model
+
+#if defined( __parallel )
 
     nr_childs = get_number_of_childs()
@@ -216,4 +224,5 @@
     ENDIF
 
+#endif
  END SUBROUTINE pmcp_g_init
 !------------------------------------------------------------------------------!
@@ -237,11 +246,13 @@
     
     INTEGER ::  parsize !<
+    TYPE(C_PTR), SAVE ::  ptr !<
+    
+    TYPE(particle_type),DIMENSION(:),POINTER ::  win_buffer !<
+    
+    INTEGER(iwp),DIMENSION(1) ::  buf_shape !<
+
+#if defined( __parallel )
     INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize_mpi_address_kind !<
     INTEGER(KIND=MPI_ADDRESS_KIND) ::  winsize !<
-    TYPE(C_PTR), SAVE ::  ptr !<
-    
-    TYPE(particle_type),DIMENSION(:),POINTER ::  win_buffer !<
-    
-    INTEGER(iwp),DIMENSION(1) ::  buf_shape !<
 
 !
@@ -292,5 +303,8 @@
     ENDIF
 
+#endif
  END SUBROUTINE pmcp_g_alloc_win
+
+
 !------------------------------------------------------------------------------!
 ! Description:
@@ -313,8 +327,10 @@
     
     INTEGER ::  parsize !<
+
+#if defined( __parallel )
+    TYPE(pedef), POINTER ::  ape !< TO_DO Klaus: give a description and better name of the variable
+
     INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize_mpi_address_kind !<
     INTEGER(KIND=MPI_ADDRESS_KIND) ::  target_disp !<
-    
-    TYPE(pedef), POINTER ::  ape !< TO_DO Klaus: give a description and better name of the variable
 
     IF ( cpl_id > 1 )  THEN
@@ -361,5 +377,8 @@
     ENDIF
 
+#endif
  END SUBROUTINE pmcp_c_get_particle_from_parent
+
+
 !------------------------------------------------------------------------------!
 ! Description:
@@ -388,6 +407,4 @@
     
     INTEGER ::  parsize !<
-    INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize_mpi_address_kind !<
-    INTEGER(KIND=MPI_ADDRESS_KIND) ::  target_disp !<
     
     REAL(wp) ::  eps=0.00001 !< used in calculations to avoid rounding errors
@@ -395,7 +412,11 @@
     REAL(wp) ::  yy          !< number of fine grid cells inside a coarse grid cell in y-direction
 
+ !   TYPE(particle_type) ::  dummy_part !< dummy particle (needed for size calculations)
+
+#if defined( __parallel )
     TYPE(pedef), POINTER ::  ape !< TO_DO Klaus: give a description and better name of the variable
-    
- !   TYPE(particle_type) ::  dummy_part !< dummy particle (needed for size calculations)
+
+    INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize_mpi_address_kind !<
+    INTEGER(KIND=MPI_ADDRESS_KIND) ::  target_disp !<
     
     
@@ -473,5 +494,8 @@
     ENDIF
 
+#endif
  END SUBROUTINE pmcp_c_send_particle_to_parent
+
+
 !------------------------------------------------------------------------------!
 ! Description:
@@ -522,4 +546,5 @@
     INTEGER(iwp),DIMENSION(1) ::  buf_shape !<
     
+#if defined( __parallel )
     TYPE(pedef), POINTER ::  ape !< TO_DO Klaus: give a description and better name of the variable
 
@@ -612,5 +637,7 @@
     lfirst = .FALSE.
 
+#endif
  END SUBROUTINE pmcp_p_fill_particle_win
+
  
 !------------------------------------------------------------------------------!
@@ -621,4 +648,5 @@
 !------------------------------------------------------------------------------!
  SUBROUTINE pmcp_p_empty_particle_win
+
     IMPLICIT NONE
 
@@ -629,4 +657,5 @@
     INTEGER(iwp),DIMENSION(1) ::  buf_shape !<
 
+#if defined( __parallel )
     DO  m = 1, get_number_of_childs()
 
@@ -651,6 +680,8 @@
     ENDDO
 
+#endif
  END SUBROUTINE pmcp_p_empty_particle_win
- 
+
+
 !------------------------------------------------------------------------------!
 ! Description:
@@ -689,4 +720,5 @@
     REAL(wp) ::  z          !< particle position
     
+#if defined( __parallel )
     DO  m = 1, get_number_of_childs()
        CALL get_child_edges( m, lx_coord, lx_coord_b, rx_coord, rx_coord_b,    &
@@ -725,5 +757,8 @@
     ENDDO
 
+#endif
  END SUBROUTINE pmcp_p_delete_particles_in_fine_grid_area
+
+
 !------------------------------------------------------------------------------!
 ! Description:
@@ -755,5 +790,5 @@
     INTEGER(iwp),DIMENSION(2) ::  ivals !< integer value to be send
     
-
+#if defined( __parallel )
     child_nr_particles = 0
     IF ( myid == 0 )  THEN
@@ -779,5 +814,7 @@
     ENDIF
 
+#endif
  END SUBROUTINE pmcp_g_print_number_of_particles
+
 
 !------------------------------------------------------------------------------!
@@ -810,4 +847,5 @@
     TYPE(particle_type), DIMENSION(:), ALLOCATABLE ::  tmp_particles_d !<
 
+#if defined( __parallel )
     with_copy_lo = .FALSE.
     IF ( PRESENT( with_copy ) ) with_copy_lo = with_copy
@@ -843,5 +881,7 @@
     ENDIF
 
+#endif
  END SUBROUTINE check_and_alloc_coarse_particle
+
 
 !------------------------------------------------------------------------------!
@@ -873,4 +913,5 @@
     REAL(wp) ::  zc  !< child z coordinate
 
+#if defined( __parallel )
 !
 !-- Child domain boundaries in the parent index space
@@ -914,5 +955,8 @@
     ENDDO
 
+#endif
  END SUBROUTINE c_copy_particle_to_child_grid
+
+
 !------------------------------------------------------------------------------!
 ! Description:
@@ -949,4 +993,5 @@
     REAL(iwp) ::  z       !< z coordinate
 
+#if defined( __parallel )
 !
 !-- Child domain boundaries in the parent index space
@@ -1025,5 +1070,8 @@
    CALL lpm_sort_in_subboxes
 
+#endif
  END SUBROUTINE c_copy_particle_to_coarse_grid
+
+
 !------------------------------------------------------------------------------!
 ! Description:
@@ -1054,4 +1102,5 @@
     INTEGER(iwp),DIMENSION(1) ::  buf_shape !<
 
+#if defined( __parallel )
     buf_shape(1) = max_nr_particle_in_rma_win
     CALL C_F_POINTER( buf_ptr(m), particle_in_win , buf_shape )
@@ -1090,5 +1139,6 @@
        ENDDO
     ENDDO
-    
+
+#endif
  END SUBROUTINE p_copy_particle_to_org_grid
 
