Index: palm/trunk/SOURCE/run_control.f90
===================================================================
--- palm/trunk/SOURCE/run_control.f90	(revision 4901)
+++ palm/trunk/SOURCE/run_control.f90	(revision 1)
@@ -1,36 +1,70 @@
-!> @file run_control.f90
-!--------------------------------------------------------------------------------------------------!
-! This file is part of the PALM model system.
-!
-! PALM is free software: you can redistribute it and/or modify it under the terms of the GNU General
-! Public License as published by the Free Software Foundation, either version 3 of the License, or
-! (at your option) any later version.
-!
-! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
-! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-! Public License for more details.
-!
-! You should have received a copy of the GNU General Public License along with PALM. If not, see
-! <http://www.gnu.org/licenses/>.
-!
-! Copyright 1997-2021 Leibniz Universitaet Hannover
-!--------------------------------------------------------------------------------------------------!
-!
-!
-! Current revisions:
+ SUBROUTINE run_control
+
+!------------------------------------------------------------------------------!
+! Actual revisions:
 ! -----------------
-!
+! 
 !
 ! Former revisions:
 ! -----------------
-! $Id$
-! File re-formatted to follow the PALM coding standard
+! $Log: run_control.f90,v $
+! Revision 1.20  2006/06/02 15:23:47  raasch
+! cpp-directives extended for lctit
 !
+! Revision 1.19  2006/02/23 12:54:21  raasch
+! Output buffer is flushed also on NEC, nt_anz renamed current_timestep_number
 !
-! 4360 2020-01-07 11:25:50Z suehring
-! Corrected "Former revisions" section
+! Revision 1.18  2004/01/30 10:38:26  raasch
+! Euler-step information removed in case of Runge-Kutta
 !
-! 3655 2019-01-07 16:51:22Z knoop
-! Corrected "Former revisions" section
+! Revision 1.17  2003/10/29 09:13:18  raasch
+! Data are forced to be immediately written on disc on IBM and Linux clusters
+!
+! Revision 1.16  2003/04/16 13:12:39  raasch
+! Output format of iteration count enlarged
+!
+! Revision 1.15  2001/07/20 13:13:45  raasch
+! Additional output of the number of multigrid cycles used
+!
+! Revision 1.14  2001/03/30 07:52:24  raasch
+! Translation of remaining German identifiers (variables, subroutines, etc.)
+!
+! Revision 1.13  2001/01/22 08:04:54  raasch
+! Module test_variables removed
+!
+! Revision 1.12  2001/01/03 13:46:12  letzel
+! File output and all comments translated into English.
+!
+! Revision 1.11  1998/09/22 17:29:49  raasch
+! Ausgabeformate t.w. um einige Kommastellen erweitert
+!
+! Revision 1.10  1998/07/06 12:32:56  raasch
+! + USE test_variables
+!
+! Revision 1.9  1998/04/21 16:23:48  raasch
+! Ausgabe von advected_distance
+!
+! Revision 1.8  1998/03/30 11:50:16  raasch
+! Divergenzen stehen jetzt in hom
+!
+! Revision 1.7  1998/03/25 13:57:06  raasch
+! Erweiterungen fuer Gebietsstatistiken,
+! dt in dt_3d umbenannt
+!
+! Revision 1.6  1998/03/18 20:19:50  raasch
+! Pruefen, ob Einheit 15 bereits geoeffnet ist
+!
+! Revision 1.5  1998/03/03 08:01:49  raasch
+! Aufruf von flow_statistics erfolgt jetzt gegebenenfalls hier,
+! Ausgabe von w* und z_i
+!
+! Revision 1.4  1998/02/04 16:10:46  raasch
+! e_total und e_pertu stehen jetzt im Feld hom
+!
+! Revision 1.3  1998/01/23 10:08:01  raasch
+! Ausgabe von u* und theta*
+!
+! Revision 1.2  1997/08/26 06:34:36  raasch
+! Schoenheitskorrekturen
 !
 ! Revision 1.1  1997/08/11 06:25:38  raasch
@@ -40,47 +74,17 @@
 ! Description:
 ! ------------
-!> Computation and output of run-control quantities
-!--------------------------------------------------------------------------------------------------!
- SUBROUTINE run_control
+! Computation and output of run-control quantities
+!------------------------------------------------------------------------------!
 
-
-    USE cpulog,                                                                                    &
-        ONLY:  cpu_log,                                                                            &
-               log_point
-
-    USE control_parameters,                                                                        &
-        ONLY:  advected_distance_x,                                                                &
-               advected_distance_y,                                                                &
-               current_timestep_number,                                                            &
-               disturbance_created,                                                                &
-               dt_3d,                                                                              &
-               mgcycles,                                                                           &
-               run_control_header,                                                                 &
-               runnr,                                                                              &
-               simulated_time,                                                                     &
-               simulated_time_chr,                                                                 &
-               timestep_reason
-
-    USE indices,                                                                                   &
-        ONLY:  nzb
-
-    USE kinds
-
+    USE cpulog
+    USE indices
+    USE interfaces
     USE pegrid
-
-    USE statistics,                                                                                &
-        ONLY:  flow_statistics_called,                                                             &
-               hom,                                                                                &
-               pr_palm,                                                                            &
-               u_max,                                                                              &
-               u_max_ijk,                                                                          &
-               v_max,                                                                              &
-               v_max_ijk,                                                                          &
-               w_max,                                                                              &
-               w_max_ijk
+    USE statistics
+    USE control_parameters
 
     IMPLICIT NONE
 
-    CHARACTER (LEN=1) ::  disturb_chr  !<
+    CHARACTER (LEN=1) ::  change_chr, disturb_chr
 
 !
@@ -97,5 +101,6 @@
 
 !
-!--    Check, whether file unit is already open (may have been opened in header before)
+!--    Check, whether file unit is already open (may have been opened in header
+!--    before)
        CALL check_open( 15 )
 
@@ -108,4 +113,17 @@
 
 !
+!--    Output the the beginning of the run receives no information about an
+!--    Euler-timestep
+       IF ( dt_changed  .AND.  simulated_time /= 0.0  .AND. &
+            timestep_scheme(1:5) /= 'runge' )  THEN
+          IF ( timestep_scheme == 'leapfrog' )  THEN
+             change_chr = 'L'
+          ELSE
+             change_chr = 'E'
+          ENDIF
+       ELSE
+          change_chr = ' '
+       ENDIF
+!
 !--    If required, set disturbance flag
        IF ( disturbance_created )  THEN
@@ -114,19 +132,25 @@
           disturb_chr = ' '
        ENDIF
-       WRITE ( 15, 101 )  runnr, current_timestep_number, simulated_time_chr,                      &
-                          INT( ( simulated_time-INT( simulated_time ) ) * 100),                    &
-                          dt_3d, timestep_reason, u_max, disturb_chr, v_max, disturb_chr, w_max,   &
-                          hom(nzb,1,pr_palm,0), hom(nzb+8,1,pr_palm,0), hom(nzb+3,1,pr_palm,0),    &
-                          hom(nzb+6,1,pr_palm,0), hom(nzb+4,1,pr_palm,0), hom(nzb+5,1,pr_palm,0),  &
-                          hom(nzb+9,1,pr_palm,0), hom(nzb+10,1,pr_palm,0), u_max_ijk(1:3),         &
-                          v_max_ijk(1:3), w_max_ijk(1:3), advected_distance_x/1000.0_wp,           &
-                          advected_distance_y/1000.0_wp, mgcycles
+       WRITE ( 15, 101 )  runnr, current_timestep_number, simulated_time_chr,  &
+                          simulated_time-INT( simulated_time ), dt_3d,         &
+                          timestep_reason, change_chr, u_max, disturb_chr,     &
+                          v_max, disturb_chr, w_max, hom(nzb,1,var_hom,0),     &
+                          hom(nzb+8,1,var_hom,0), hom(nzb+3,1,var_hom,0),      &
+                          hom(nzb+6,1,var_hom,0), hom(nzb+4,1,var_hom,0),      &
+                          hom(nzb+5,1,var_hom,0), hom(nzb+9,1,var_hom,0),      &
+                          hom(nzb+10,1,var_hom,0), u_max_ijk(1:3),             &
+                          v_max_ijk(1:3), w_max_ijk(1:3),                      &
+                          advected_distance_x/1000.0,                          &
+                          advected_distance_y/1000.0, mgcycles
+#if defined( __ibm )
 !
 !--    Write buffer contents to disc immediately
-       FLUSH( 15 )
-
+       CALL FLUSH_( 15 )
+#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
+       CALL FLUSH( 15 )
+#endif
     ENDIF
 !
-!-- If required, reset disturbance flag. This has to be done outside the above
+!-- If required, reset disturbance flag. This has to be done outside the above 
 !-- IF-loop, because the flag would otherwise only be reset on PE0
     IF ( disturbance_created )  disturbance_created = .FALSE.
@@ -138,14 +162,15 @@
 100 FORMAT (///'Run-control output:'/ &
               &'------------------'// &
-          &'RUN  ITER. HH:MM:SS.SS    DT(E)     UMAX     VMAX     WMAX     U', &
-          &'*    W*      THETA*     Z_I     ENERG.   DISTENERG    DIVOLD    ', &
-          &' DIVNEW     UMAX(KJI)    VMAX(KJI)    WMAX(KJI)   ADVECX   ADVEC', &
-          &'Y   MGCYC'/                                                        &
-          &'----------------------------------------------------------------', &
-          &'----------------------------------------------------------------', &
-          &'----------------------------------------------------------------', &
-          &'---------')
-101 FORMAT (I3,1X,I6,1X,A8,'.',I2.2,1X,F8.4,A1,1X,F8.4,A1,F8.4,A1,F8.4,1X, F6.3,1X,F5.2,           &
-            2X,E10.3,2X,F6.0,1X,4(E10.3,1X),3(3(I4),1X),F8.3,1X,F8.3,5X,I3)
+           &'RUN  ITER. HH:MM:SS.SS   DT(E)     UMAX     VMAX     WMAX     U*', &
+           &'    W*   THETA*   Z_I     ENERG.   DISTENERG    DIVOLD     DIVNE', &
+           &'W     UMAX(KJI)    VMAX(KJI)    WMAX(KJI)   ADVECX   ADVECY   MG', &
+           &'CYC'/ &
+           &'----------------------------------------------------------------', &
+           &'----------------------------------------------------------------', &
+           &'----------------------------------------------------------------', &
+           &'--')
+101 FORMAT (I3,1X,I6,1X,A8,F3.2,1X,F7.4,A1,A1,F8.4,A1,F8.4,A1,F8.4,2X,F5.3,2X, &
+            F4.2, &
+            2X,F6.3,2X,F5.0,1X,4(E10.3,1X),3(3(I4),1X),F8.3,1X,F8.3,5X,I3)
 
  END SUBROUTINE run_control
