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

Last change on this file since 1931 was 1818, checked in by maronga, 9 years ago

last commit documented / copyright update

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