Index: palm/trunk/SOURCE/CURRENT_MODIFICATIONS
===================================================================
--- palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 221)
+++ palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 222)
@@ -12,4 +12,6 @@
 
 User can check user parameters and deduce further quantities in user_check_parameters
+
+Check that PALM is called with mrun -K parallel for coupling
 
 check_for_restart, check_parameters, data_output_dvrp, init_dvrp, init_pegrid, local_stop, modules, package_parin, palm, surface_coupler, timestep, user_additional_routines
@@ -57,4 +59,6 @@
 ------
 
+Bugfixes for nonparallel execution (check_for_restart, cpu_statistics, inflow_turbulence, init_coupling, timestep)
+
 Size of pf3d adjusted to the required output size (1 gridpoint less, along
 all three dimensions), because output of a subset of the data
@@ -78,3 +82,3 @@
 Bugfix: abort in case that absolute temperature is below zero (init_cloud_physics)
 
-advec_particles, combine_plot_fields, data_output_2d, header, init_cloud_physics, production_e, read_3d_binary
+advec_particles, check_for_restart, combine_plot_fields, cpu_statistics, data_output_2d, header, inflow_turbulence, init_cloud_physics, init_coupling, production_e, read_3d_binary, timestep
Index: palm/trunk/SOURCE/check_for_restart.f90
===================================================================
--- palm/trunk/SOURCE/check_for_restart.f90	(revision 221)
+++ palm/trunk/SOURCE/check_for_restart.f90	(revision 222)
@@ -5,4 +5,5 @@
 ! -----------------
 ! Implementation of an MPI-1 coupling: replaced myid with target_id
+! Bugfix for nonparallel execution
 !
 ! Former revisions:
@@ -80,4 +81,5 @@
 
        terminate_coupled = 3
+#if defined( __parallel )
        CALL MPI_SENDRECV( terminate_coupled,        1, MPI_INTEGER,          &
                           target_id, 0,                                      &
@@ -85,4 +87,5 @@
                           target_id, 0,                                      &
                           comm_inter, status, ierr )
+#endif
     ENDIF
 
@@ -125,4 +128,5 @@
                 terminate_coupled = 5
              ENDIF
+#if defined( __parallel )
              CALL MPI_SENDRECV( terminate_coupled,        1, MPI_INTEGER,    &
                                 target_id,  0,                               &
@@ -130,4 +134,5 @@
                                 target_id,  0,                               &
                                 comm_inter, status, ierr )
+#endif
           ENDIF
        ELSE
Index: palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- palm/trunk/SOURCE/check_parameters.f90	(revision 221)
+++ palm/trunk/SOURCE/check_parameters.f90	(revision 222)
@@ -8,4 +8,5 @@
 ! Implementation of an MPI-1 coupling: replaced myid with target_id, 
 ! deleted __mpi2 directives
+! Check that PALM is called with mrun -K parallel for coupling
 !
 ! Former revisions:
@@ -234,4 +235,8 @@
                                     0 )
        ENDIF
+#else
+       WRITE( message_string, * ) 'coupling requires PALM to be called with', &
+            ' ''mrun -K parallel'''
+       CALL handle_palm_message( 'check_parameters', 'PA0141', 1, 2, 0, 6, 0 )
 #endif
     ENDIF
Index: palm/trunk/SOURCE/cpu_statistics.f90
===================================================================
--- palm/trunk/SOURCE/cpu_statistics.f90	(revision 221)
+++ palm/trunk/SOURCE/cpu_statistics.f90	(revision 222)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Bugfix for nonparallel execution
 !
 ! Former revisions:
@@ -125,7 +125,13 @@
 !--    Write cpu-times sorted by size
        CALL check_open( 18 )
+#if defined( __parallel )
        WRITE ( 18, 100 )  TRIM( run_description_header ),        &
                           numprocs * threads_per_task, pdims(1), pdims(2), &
                           threads_per_task
+#else
+       WRITE ( 18, 100 )  TRIM( run_description_header ),        &
+                          numprocs * threads_per_task, 1, 1, &
+                          threads_per_task
+#endif
        DO
           ii = MAXLOC( sum )
Index: palm/trunk/SOURCE/inflow_turbulence.f90
===================================================================
--- palm/trunk/SOURCE/inflow_turbulence.f90	(revision 221)
+++ palm/trunk/SOURCE/inflow_turbulence.f90	(revision 222)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Bugfix for nonparallel execution
 !
 ! Former revisions:
@@ -92,4 +92,5 @@
     i = recycling_plane
 
+#if defined( __parallel )
     IF ( myidx == id_recycling )  THEN
 
@@ -107,4 +108,17 @@
 
     ENDIF
+#else
+    DO  j = nys-1, nyn+1
+       DO  k = nzb, nzt+1
+
+          inflow_dist(k,j,1) = u(k,j,i+1) - avpr(k,1)
+          inflow_dist(k,j,2) = v(k,j,i)   - avpr(k,2)
+          inflow_dist(k,j,3) = w(k,j,i)   - avpr(k,3)
+          inflow_dist(k,j,4) = pt(k,j,i)  - avpr(k,4)
+          inflow_dist(k,j,5) = e(k,j,i)   - avpr(k,5)
+
+       ENDDO
+    ENDDO
+#endif
 
 !
Index: palm/trunk/SOURCE/init_coupling.f90
===================================================================
--- palm/trunk/SOURCE/init_coupling.f90	(revision 221)
+++ palm/trunk/SOURCE/init_coupling.f90	(revision 222)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Bugfix for nonparallel execution
 !
 ! Former revisions:
@@ -41,4 +41,5 @@
 !-- In this case, distribute PEs to 2 new communicators.
 !-- ATTENTION: numprocs will be reset according to the new communicators
+#if defined ( __parallel )
     IF ( myid == 0 )  THEN
        READ (*,*,ERR=10,END=10)  coupling_mode, bc_data(1), bc_data(2)
@@ -108,4 +109,5 @@
     ENDIF
 #endif
+#endif
 
     IF ( coupling_mode == 'ocean_to_atmosphere' )  coupling_char = '_O'
Index: palm/trunk/SOURCE/timestep.f90
===================================================================
--- palm/trunk/SOURCE/timestep.f90	(revision 221)
+++ palm/trunk/SOURCE/timestep.f90	(revision 222)
@@ -5,4 +5,5 @@
 ! -----------------
 ! Implementation of a MPI-1 Coupling: replaced myid with target_id
+! Bugfix for nonparallel execution
 !
 ! Former revisions:
@@ -216,4 +217,5 @@
 !--       and its reason, provided the remote model has not already been 
 !--       informed of another termination reason (terminate_coupled > 0) before.
+#if defined( __parallel )
           IF ( coupling_mode /= 'uncoupled' .AND. terminate_coupled == 0 )  THEN
              terminate_coupled = 2
@@ -223,5 +225,5 @@
                   comm_inter, status, ierr )
           ENDIF
-
+#endif
        ENDIF
 
