source: palm/trunk/SOURCE/run_control.f90 @ 3358

Last change on this file since 3358 was 2718, checked in by maronga, 7 years ago

deleting of deprecated files; headers updated where needed

  • Property svn:keywords set to Id
File size: 6.1 KB
Line 
1!> @file run_control.f90
2!------------------------------------------------------------------------------!
3! This file is part of the PALM model system.
4!
5! PALM is free software: you can redistribute it and/or modify it under the
6! terms of the GNU General Public License as published by the Free Software
7! Foundation, either version 3 of the License, or (at your option) any later
8! version.
9!
10! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
11! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13!
14! You should have received a copy of the GNU General Public License along with
15! PALM. If not, see <http://www.gnu.org/licenses/>.
16!
17! Copyright 1997-2018 Leibniz Universitaet Hannover
18!------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22!
23!
24! Former revisions:
25! -----------------
26! $Id: run_control.f90 2718 2018-01-02 08:49:38Z knoop $
27! Corrected "Former revisions" section
28!
29! 2696 2017-12-14 17:12:51Z kanani
30! Change in file header (GPL part)
31!
32! 2101 2017-01-05 16:42:31Z suehring
33!
34! 2000 2016-08-20 18:09:15Z knoop
35! Forced header and separation lines into 80 columns
36!
37! 1808 2016-04-05 19:44:00Z raasch
38! routine local_flush replaced by FORTRAN statement
39!
40! 1697 2015-10-28 17:14:10Z raasch
41! small E- and F-FORMAT changes to avoid informative compiler messages about
42! insufficient field width
43!
44! 1682 2015-10-07 23:56:08Z knoop
45! Code annotations made doxygen readable
46!
47! 1353 2014-04-08 15:21:23Z heinze
48! REAL constants provided with KIND-attribute
49!
50! 1320 2014-03-20 08:40:49Z raasch
51! ONLY-attribute added to USE-statements,
52! kind-parameters added to all INTEGER and REAL declaration statements,
53! kinds are defined in new module kinds,
54! old module precision_kind is removed,
55! revision history before 2012 removed,
56! comment fields (!:) to be used for variable explanations added to
57! all variable declaration statements
58!
59! 1318 2014-03-17 13:35:16Z raasch
60! module interfaces removed
61!
62! 1257 2013-11-08 15:18:40Z raasch
63! output format for theta* changed to avoid output of *****
64!
65! 1036 2012-10-22 13:43:42Z raasch
66! code put under GPL (PALM 3.9)
67!
68! 1001 2012-09-13 14:08:46Z raasch
69! all actions concerning leapfrog scheme removed
70!
71! Revision 1.1  1997/08/11 06:25:38  raasch
72! Initial revision
73!
74!
75! Description:
76! ------------
77!> Computation and output of run-control quantities
78!------------------------------------------------------------------------------!
79 SUBROUTINE run_control
80 
81
82    USE cpulog,                                                                &
83        ONLY:  cpu_log, log_point
84
85    USE control_parameters,                                                    &
86        ONLY:  advected_distance_x, advected_distance_y,                       &
87               current_timestep_number, disturbance_created, dt_3d, mgcycles,  &
88               run_control_header, runnr, simulated_time, simulated_time_chr,  &
89               timestep_reason
90
91    USE indices,                                                               &
92        ONLY:  nzb
93
94    USE kinds
95
96    USE pegrid
97
98    USE statistics,                                                            &
99        ONLY:  flow_statistics_called, hom, pr_palm, u_max, u_max_ijk, v_max,  &
100               v_max_ijk, w_max, w_max_ijk
101
102    IMPLICIT NONE
103
104    CHARACTER (LEN=1) ::  disturb_chr
105
106!
107!-- If required, do statistics
108    IF ( .NOT. flow_statistics_called )  CALL flow_statistics
109
110!
111!-- Flow_statistics has its own cpu-time measurement
112    CALL cpu_log( log_point(11), 'run_control', 'start' )
113
114!
115!-- Output
116    IF ( myid == 0 )  THEN
117
118!
119!--    Check, whether file unit is already open (may have been opened in header
120!--    before)
121       CALL check_open( 15 )
122
123!
124!--    If required, write header
125       IF ( .NOT. run_control_header )  THEN
126          WRITE ( 15, 100 )
127          run_control_header = .TRUE.
128       ENDIF
129
130!
131!--    If required, set disturbance flag
132       IF ( disturbance_created )  THEN
133          disturb_chr = 'D'
134       ELSE
135          disturb_chr = ' '
136       ENDIF
137       WRITE ( 15, 101 )  runnr, current_timestep_number, simulated_time_chr,  &
138                          INT( ( simulated_time-INT( simulated_time ) ) * 100),&
139                          dt_3d, timestep_reason, u_max, disturb_chr,          &
140                          v_max, disturb_chr, w_max, hom(nzb,1,pr_palm,0),     &
141                          hom(nzb+8,1,pr_palm,0), hom(nzb+3,1,pr_palm,0),      &
142                          hom(nzb+6,1,pr_palm,0), hom(nzb+4,1,pr_palm,0),      &
143                          hom(nzb+5,1,pr_palm,0), hom(nzb+9,1,pr_palm,0),      &
144                          hom(nzb+10,1,pr_palm,0), u_max_ijk(1:3),             &
145                          v_max_ijk(1:3), w_max_ijk(1:3),                      &
146                          advected_distance_x/1000.0_wp,                       &
147                          advected_distance_y/1000.0_wp, mgcycles
148!
149!--    Write buffer contents to disc immediately
150       FLUSH( 15 )
151
152    ENDIF
153!
154!-- If required, reset disturbance flag. This has to be done outside the above
155!-- IF-loop, because the flag would otherwise only be reset on PE0
156    IF ( disturbance_created )  disturbance_created = .FALSE.
157
158    CALL cpu_log( log_point(11), 'run_control', 'stop' )
159
160!
161!-- Formats
162100 FORMAT (///'Run-control output:'/ &
163              &'------------------'// &
164          &'RUN  ITER. HH:MM:SS.SS    DT(E)     UMAX     VMAX     WMAX     U', &
165          &'*    W*      THETA*     Z_I     ENERG.   DISTENERG    DIVOLD    ', &
166          &' DIVNEW     UMAX(KJI)    VMAX(KJI)    WMAX(KJI)   ADVECX   ADVEC', &
167          &'Y   MGCYC'/                                                        &
168          &'----------------------------------------------------------------', &
169          &'----------------------------------------------------------------', &
170          &'----------------------------------------------------------------', &
171          &'---------')
172101 FORMAT (I3,1X,I6,1X,A8,'.',I2.2,1X,F8.4,A1,1X,F8.4,A1,F8.4,A1,F8.4,1X,     &
173            F6.3,1X,F5.2, &
174            2X,E10.3,2X,F6.0,1X,4(E10.3,1X),3(3(I4),1X),F8.3,1X,F8.3,5X,I3)
175
176 END SUBROUTINE run_control
Note: See TracBrowser for help on using the repository browser.