Index: palm/trunk/SOURCE/data_output_3d.f90
===================================================================
--- palm/trunk/SOURCE/data_output_3d.f90	(revision 2965)
+++ palm/trunk/SOURCE/data_output_3d.f90	(revision 2967)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! bugfix: missing parallel cpp-directives added
+! 
+! 2817 2018-02-19 16:32:21Z knoop
 ! Preliminary gust module interface implemented
 ! 
@@ -283,5 +286,7 @@
 !-- For netCDF4/HDF5 output, data is written in parallel into one file.
     IF ( netcdf_data_format < 5 )  THEN
+#if defined( __parallel )
        CALL check_open( 30 )
+#endif
        IF ( myid == 0 )  CALL check_open( 106+av*10 )
     ELSE
Index: palm/trunk/SOURCE/header.f90
===================================================================
--- palm/trunk/SOURCE/header.f90	(revision 2965)
+++ palm/trunk/SOURCE/header.f90	(revision 2967)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! bugfix: missing parallel cpp-directives added
+! 
+! 2883 2018-03-14 08:29:10Z Giersch
 ! Format of the output of dt_dopr_listing (325) has been changed
 ! 
@@ -422,6 +425,8 @@
         ONLY:  pcm_header
 
+#if defined( __parallel )
     USE pmc_handle_communicator,                                               &
         ONLY:  pmc_get_model_info
+#endif
 
     USE pmc_interface,                                                         &
@@ -608,4 +613,5 @@
     IF ( nested_run )  THEN
 
+#if defined( __parallel )
        WRITE ( io, 600 )  TRIM( nesting_mode ),                                &
                           TRIM( nesting_datatransfer_mode )
@@ -627,4 +633,6 @@
                              TRIM( cpl_name )
        ENDDO
+#endif
+
     ENDIF
     WRITE ( io, 99 )
Index: palm/trunk/SOURCE/lpm_init.f90
===================================================================
--- palm/trunk/SOURCE/lpm_init.f90	(revision 2965)
+++ palm/trunk/SOURCE/lpm_init.f90	(revision 2967)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! nesting routine is only called if nesting is switched on
+! 
+! 2954 2018-04-09 14:35:46Z schwenkel
 ! Bugfix for particle initialization in case of ocean
 ! 
@@ -288,4 +291,7 @@
         ONLY:  init_kernels
 
+    USE pmc_interface,                                                         &
+        ONLY: nested_run
+
     IMPLICIT NONE
 
@@ -640,5 +646,5 @@
     ENDIF
 
-    CALL pmcp_g_init
+    IF ( nested_run )  CALL pmcp_g_init
 
 !
Index: palm/trunk/SOURCE/lpm_write_exchange_statistics.f90
===================================================================
--- palm/trunk/SOURCE/lpm_write_exchange_statistics.f90	(revision 2965)
+++ palm/trunk/SOURCE/lpm_write_exchange_statistics.f90	(revision 2967)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! nesting routine is only called if nesting is switched on
+! bugfix: missing parallel cpp-directives added
+! 
+! 2841 2018-02-27 15:02:57Z knoop
 ! Bugfix: wrong placement of include 'mpif.h' corrected,
 ! kinds module added and pegrid module scope restricted
@@ -76,5 +80,5 @@
  SUBROUTINE lpm_write_exchange_statistics
 
-#if !defined( __mpifh )
+#if defined( __parallel )  &&  !defined( __mpifh )
     USE MPI
 #endif
@@ -100,7 +104,10 @@
         ONLY:  comm2d, ierr, pleft, pright, psouth, pnorth
 
+    USE pmc_interface,                                                         &
+        ONLY: nested_run
+
     IMPLICIT NONE
 
-#if defined( __mpifh )
+#if defined( __parallel )  &&  defined( __mpifh )
     INCLUDE "mpif.h"
 #endif
@@ -140,15 +147,19 @@
 
     IF ( number_of_particles > 0 ) THEN
-        WRITE(9,*) 'number_of_particles ', number_of_particles, current_timestep_number + 1, simulated_time + dt_3d
+        WRITE(9,*) 'number_of_particles ', number_of_particles,                &
+                    current_timestep_number + 1, simulated_time + dt_3d
     ENDIF
 
 #if defined( __parallel )
-    CALL MPI_ALLREDUCE( number_of_particles, tot_number_of_particles, 1, MPI_INTEGER,      &
-                                    MPI_SUM, comm2d, ierr)
+    CALL MPI_ALLREDUCE( number_of_particles, tot_number_of_particles, 1,       &
+                        MPI_INTEGER, MPI_SUM, comm2d, ierr )
 #else
     tot_number_of_particles = number_of_particles
 #endif
 
-    CALL pmcp_g_print_number_of_particles (simulated_time+dt_3d, tot_number_of_particles)
+    IF ( nested_run )  THEN
+       CALL pmcp_g_print_number_of_particles( simulated_time+dt_3d,            &
+                                              tot_number_of_particles)
+    ENDIF
 
 !
Index: palm/trunk/SOURCE/parin.f90
===================================================================
--- palm/trunk/SOURCE/parin.f90	(revision 2965)
+++ palm/trunk/SOURCE/parin.f90	(revision 2967)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! bugfix: missing parallel cpp-directives added
+! 
+! 2941 2018-04-03 11:54:58Z kanani
 ! Fix for spinup in case of restart run
 ! 
@@ -691,6 +694,11 @@
 !-- communicator.
 !-- First, set the default:
+#if defined( __parallel )
     CALL MPI_COMM_RANK( MPI_COMM_WORLD, global_id, ierr )
     CALL MPI_COMM_SIZE( MPI_COMM_WORLD, global_procs, ierr )
+#else
+    global_id    = 0
+    global_procs = 1
+#endif
     IF ( maximum_parallel_io_streams == -1  .OR.                               &
          maximum_parallel_io_streams > global_procs )  THEN
Index: palm/trunk/SOURCE/pmc_interface_mod.f90
===================================================================
--- palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 2965)
+++ palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 2967)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! bugfix: missing parallel cpp-directives added
+! 
+! 2951 2018-04-06 09:05:08Z kanani
 ! Add log_point_s for pmci_model_configuration
 ! 
@@ -745,4 +748,5 @@
     INTEGER(iwp) ::  ncpl   !<  number of nest domains
 
+#if defined( __parallel )
     CALL location_message( 'setup the nested model configuration', .FALSE. )
     CALL cpu_log( log_point_s(79), 'pmci_model_config', 'start' )
@@ -769,4 +773,5 @@
     CALL cpu_log( log_point_s(79), 'pmci_model_config', 'stop' )
     CALL location_message( 'finished', .TRUE. )
+#endif
 
  END SUBROUTINE pmci_modelconfiguration
@@ -3330,21 +3335,36 @@
 END SUBROUTINE pmci_set_array_pointer
 
+
 INTEGER FUNCTION get_number_of_childs ()
+
    IMPLICIT NONE
 
+#if defined( __parallel )
    get_number_of_childs = SIZE( pmc_parent_for_child ) - 1
+#else
+   get_number_of_childs = 0
+#endif
 
    RETURN
+
 END FUNCTION get_number_of_childs
 
+
 INTEGER FUNCTION get_childid (id_index)
+
    IMPLICIT NONE
 
    INTEGER,INTENT(IN)                 :: id_index
 
+#if defined( __parallel )
    get_childid = pmc_parent_for_child(id_index)
+#else
+   get_childid = 0
+#endif
 
    RETURN
+
 END FUNCTION get_childid
+
 
 SUBROUTINE  get_child_edges (m, lx_coord, lx_coord_b, rx_coord, rx_coord_b,    &
Index: palm/trunk/SOURCE/pmc_particle_interface.f90
===================================================================
--- palm/trunk/SOURCE/pmc_particle_interface.f90	(revision 2965)
+++ 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
 
Index: palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/radiation_model_mod.f90	(revision 2965)
+++ palm/trunk/SOURCE/radiation_model_mod.f90	(revision 2967)
@@ -28,4 +28,7 @@
 ! -----------------
 ! $Id$
+! bugfix: missing parallel cpp-directives added
+! 
+! 2964 2018-04-12 16:04:03Z Giersch
 ! Error message PA0491 has been introduced which could be previously found in 
 ! check_open. The variable numprocs_previous_run is only known in case of 
@@ -5964,5 +5967,7 @@
         ENDIF
 
+#if defined( __parallel )
         CALL MPI_BARRIER( comm2d, ierr )
+#endif
 !         CALL radiation_write_debug_log( 'End of radiation_calc_svf (after mpi_barrier)' )
 
@@ -6223,5 +6228,4 @@
       INTEGER(iwp)                           ::  ip           !< number of processor where gridbox reside
       INTEGER(iwp)                           ::  ig           !< 1D index of gridbox in global 2D array
-      INTEGER(MPI_ADDRESS_KIND)              ::  wdisp        !< RMA window displacement
       INTEGER(iwp)                           ::  wcount       !< RMA window item count
       INTEGER(iwp)                           ::  maxboxes     !< max no of CSF created
@@ -6241,4 +6245,7 @@
       REAL(wp), PARAMETER                    ::  grow_factor = 1.5_wp !< factor of expansion of grow arrays
 
+#if defined( __parallel )
+      INTEGER(MPI_ADDRESS_KIND)              ::  wdisp        !< RMA window displacement
+#endif
       
       yxorigin(:) = origin(2:3)
Index: palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90
===================================================================
--- palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90	(revision 2965)
+++ palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90	(revision 2967)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! bugfix: missing parallel cpp-directives added
+! 
+! 2946 2018-04-04 17:01:23Z suehring
 ! Remove unused module load
 ! 
@@ -125,5 +128,5 @@
     USE kinds
 
-#if !defined( __mpifh )
+#if defined( __parallel )  &&  !defined( __mpifh )
     USE MPI
 #endif
@@ -138,5 +141,5 @@
     IMPLICIT NONE
 
-#if defined( __mpifh )
+#if defined( __parallel )  &&  defined( __mpifh )
     INCLUDE "mpif.h"
 #endif
