Index: palm/trunk/SOURCE/check_for_restart.f90
===================================================================
--- palm/trunk/SOURCE/check_for_restart.f90	(revision 1310)
+++ palm/trunk/SOURCE/check_for_restart.f90	(revision 1320)
@@ -20,5 +20,10 @@
 ! Current revisions:
 ! -----------------
-! 
+! ONLY-attribute added to USE-statements,
+! kind-parameters added to all INTEGER and REAL declaration statements,
+! kinds are defined in new module kinds,
+! revision history before 2012 removed,
+! comment fields (!:) to be used for variable explanations added to
+! all variable declaration statements
 !
 ! Former revisions:
@@ -32,26 +37,4 @@
 ! minor reformatting
 !
-! 667 2010-12-23 12:06:00Z suehring/gryschka
-! Exchange of terminate_coupled between ocean and atmosphere by PE0
-!
-! 622 2010-12-10 08:08:13Z raasch
-! optional barriers included in order to speed up collective operations
-!
-! 291 2009-04-16 12:07:26Z raasch
-! Coupling with independent precursor runs.
-! Output of messages replaced by message handling routine
-!
-! 222 2009-01-12 16:04:16Z letzel
-! Implementation of an MPI-1 coupling: replaced myid with target_id
-! Bugfix for nonparallel execution
-!
-! 108 2007-08-24 15:10:38Z letzel
-! modifications to terminate coupled runs
-!
-! RCS Log replace by Id keyword, revision history cleaned up
-!
-! Revision 1.11  2007/02/11 12:55:13  raasch
-! Informative output to the job protocol
-!
 ! Revision 1.1  1998/03/18 20:06:51  raasch
 ! Initial revision
@@ -64,12 +47,19 @@
 !------------------------------------------------------------------------------!
 
+    USE control_parameters,                                                    &
+        ONLY:  coupling_mode, dt_restart, end_time, message_string,            &
+               run_description_header, simulated_time, terminate_coupled,      &
+               terminate_coupled_remote, terminate_run,                        &
+               termination_time_needed, time_restart,                          &
+               time_since_reference_point, write_binary
+    USE kinds
     USE pegrid
-    USE control_parameters
 
     IMPLICIT NONE
 
 
-    LOGICAL :: terminate_run_l
-    REAL ::  remaining_time
+    LOGICAL :: terminate_run_l  !:
+
+    REAL(wp) ::  remaining_time !:
 
 
@@ -81,5 +71,5 @@
 !-- If necessary set a flag to stop the model run
     terminate_run_l = .FALSE.
-    IF ( remaining_time <= termination_time_needed  .AND. &
+    IF ( remaining_time <= termination_time_needed  .AND.                      &
          write_binary(1:4) == 'true' )  THEN
 
@@ -92,5 +82,5 @@
 !-- one processor has reached the time limit.
     IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
-    CALL MPI_ALLREDUCE( terminate_run_l, terminate_run, 1, MPI_LOGICAL, &
+    CALL MPI_ALLREDUCE( terminate_run_l, terminate_run, 1, MPI_LOGICAL,        &
                         MPI_LOR, comm2d, ierr )
 #else
@@ -101,7 +91,7 @@
 !-- Output that job will be terminated
     IF ( terminate_run  .AND.  myid == 0 )  THEN
-       WRITE( message_string, * ) 'run will be terminated because it is ', &
-                       'running out of job cpu limit & ',                  &
-                       'remaining time:         ', remaining_time, ' s',   &
+       WRITE( message_string, * ) 'run will be terminated because it is ',     &
+                       'running out of job cpu limit & ',                      &
+                       'remaining time:         ', remaining_time, ' s',       &
                        'termination time needed:', termination_time_needed, ' s'
        CALL message( 'check_for_restart', 'PA0163', 0, 1, 0, 6, 0 )
@@ -113,5 +103,5 @@
 !-- informed of another termination reason (terminate_coupled > 0) before, 
 !-- or vice versa (terminate_coupled_remote > 0).
-    IF ( terminate_run .AND. TRIM( coupling_mode ) /= 'uncoupled'  .AND. &
+    IF ( terminate_run .AND. TRIM( coupling_mode ) /= 'uncoupled'  .AND.       &
          terminate_coupled == 0  .AND.  terminate_coupled_remote == 0 )  THEN
 
@@ -125,5 +115,5 @@
                              comm_inter, status, ierr )
        ENDIF
-       CALL MPI_BCAST( terminate_coupled_remote, 1, MPI_INTEGER, 0, comm2d,  &
+       CALL MPI_BCAST( terminate_coupled_remote, 1, MPI_INTEGER, 0, comm2d,    &
                        ierr )
 #endif
@@ -132,5 +122,5 @@
 !
 !-- Set the stop flag also, if restart is forced by user
-    IF ( time_restart /= 9999999.9  .AND.  &
+    IF ( time_restart /= 9999999.9  .AND.                                      &
          time_restart < time_since_reference_point )  THEN
 
@@ -149,7 +139,7 @@
           ENDIF
 
-          WRITE( message_string, * ) 'run will be terminated due to user ', &
-                                  'settings of',                            &
-                                  '&restart_time / dt_restart',             &
+          WRITE( message_string, * ) 'run will be terminated due to user ',    &
+                                  'settings of',                               &
+                                  '&restart_time / dt_restart',                &
                                   '&new restart time is: ', time_restart, ' s' 
           CALL message( 'check_for_restart', 'PA0164', 0, 0, 0, 6, 0 )
@@ -160,5 +150,5 @@
 !--       informed of another termination reason (terminate_coupled > 0) before,
 !--       or vice versa (terminate_coupled_remote > 0).
-          IF ( coupling_mode /= 'uncoupled' .AND. terminate_coupled == 0  &
+          IF ( coupling_mode /= 'uncoupled' .AND. terminate_coupled == 0       &
                .AND.  terminate_coupled_remote == 0 )  THEN
 
@@ -176,5 +166,5 @@
                                    comm_inter, status, ierr )   
              ENDIF
-             CALL MPI_BCAST( terminate_coupled_remote, 1, MPI_INTEGER, 0,  &
+             CALL MPI_BCAST( terminate_coupled_remote, 1, MPI_INTEGER, 0,      &
                              comm2d, ierr )  
 #endif
