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

Last change on this file since 1683 was 1683, checked in by knoop, 9 years ago

last commit documented

  • Property svn:keywords set to Id
File size: 5.7 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-2014 Leibniz Universitaet Hannover
17!--------------------------------------------------------------------------------!
18!
19! Current revisions:
20! -----------------
21!
22!
23! Former revisions:
24! -----------------
25! $Id: run_control.f90 1683 2015-10-07 23:57:51Z knoop $
26!
27! 1682 2015-10-07 23:56:08Z knoop
28! Code annotations made doxygen readable
29!
30! 1353 2014-04-08 15:21:23Z heinze
31! REAL constants provided with KIND-attribute
32!
33! 1320 2014-03-20 08:40:49Z raasch
34! ONLY-attribute added to USE-statements,
35! kind-parameters added to all INTEGER and REAL declaration statements,
36! kinds are defined in new module kinds,
37! old module precision_kind is removed,
38! revision history before 2012 removed,
39! comment fields (!:) to be used for variable explanations added to
40! all variable declaration statements
41!
42! 1318 2014-03-17 13:35:16Z raasch
43! module interfaces removed
44!
45! 1257 2013-11-08 15:18:40Z raasch
46! output format for theta* changed to avoid output of *****
47!
48! 1036 2012-10-22 13:43:42Z raasch
49! code put under GPL (PALM 3.9)
50!
51! 1001 2012-09-13 14:08:46Z raasch
52! all actions concerning leapfrog scheme removed
53!
54! Revision 1.1  1997/08/11 06:25:38  raasch
55! Initial revision
56!
57!
58! Description:
59! ------------
60!> Computation and output of run-control quantities
61!------------------------------------------------------------------------------!
62 SUBROUTINE run_control
63 
64
65    USE cpulog,                                                                &
66        ONLY:  cpu_log, log_point
67
68    USE control_parameters,                                                    &
69        ONLY:  advected_distance_x, advected_distance_y,                       &
70               current_timestep_number, disturbance_created, dt_3d, mgcycles,  &
71               run_control_header, runnr, simulated_time, simulated_time_chr,  &
72               timestep_reason
73
74    USE indices,                                                               &
75        ONLY:  nzb
76
77    USE kinds
78
79    USE pegrid
80
81    USE statistics,                                                            &
82        ONLY:  flow_statistics_called, hom, pr_palm, u_max, u_max_ijk, v_max,  &
83               v_max_ijk, w_max, w_max_ijk
84
85    IMPLICIT NONE
86
87    CHARACTER (LEN=1) ::  disturb_chr
88
89!
90!-- If required, do statistics
91    IF ( .NOT. flow_statistics_called )  CALL flow_statistics
92
93!
94!-- Flow_statistics has its own cpu-time measurement
95    CALL cpu_log( log_point(11), 'run_control', 'start' )
96
97!
98!-- Output
99    IF ( myid == 0 )  THEN
100
101!
102!--    Check, whether file unit is already open (may have been opened in header
103!--    before)
104       CALL check_open( 15 )
105
106!
107!--    If required, write header
108       IF ( .NOT. run_control_header )  THEN
109          WRITE ( 15, 100 )
110          run_control_header = .TRUE.
111       ENDIF
112
113!
114!--    If required, set disturbance flag
115       IF ( disturbance_created )  THEN
116          disturb_chr = 'D'
117       ELSE
118          disturb_chr = ' '
119       ENDIF
120       WRITE ( 15, 101 )  runnr, current_timestep_number, simulated_time_chr,  &
121                          simulated_time-INT( simulated_time ), dt_3d,         &
122                          timestep_reason, u_max, disturb_chr,                 &
123                          v_max, disturb_chr, w_max, hom(nzb,1,pr_palm,0),     &
124                          hom(nzb+8,1,pr_palm,0), hom(nzb+3,1,pr_palm,0),      &
125                          hom(nzb+6,1,pr_palm,0), hom(nzb+4,1,pr_palm,0),      &
126                          hom(nzb+5,1,pr_palm,0), hom(nzb+9,1,pr_palm,0),      &
127                          hom(nzb+10,1,pr_palm,0), u_max_ijk(1:3),             &
128                          v_max_ijk(1:3), w_max_ijk(1:3),                      &
129                          advected_distance_x/1000.0_wp,                       &
130                          advected_distance_y/1000.0_wp, mgcycles
131!
132!--    Write buffer contents to disc immediately
133       CALL local_flush( 15 )
134
135    ENDIF
136!
137!-- If required, reset disturbance flag. This has to be done outside the above
138!-- IF-loop, because the flag would otherwise only be reset on PE0
139    IF ( disturbance_created )  disturbance_created = .FALSE.
140
141    CALL cpu_log( log_point(11), 'run_control', 'stop' )
142
143!
144!-- Formats
145100 FORMAT (///'Run-control output:'/ &
146              &'------------------'// &
147          &'RUN  ITER. HH:MM:SS.SS    DT(E)     UMAX     VMAX     WMAX     U', &
148          &'*    W*      THETA*     Z_I     ENERG.   DISTENERG    DIVOLD    ', &
149          &' DIVNEW     UMAX(KJI)    VMAX(KJI)    WMAX(KJI)   ADVECX   ADVEC', &
150          &'Y   MGCYC'/                                                        &
151          &'----------------------------------------------------------------', &
152          &'----------------------------------------------------------------', &
153          &'----------------------------------------------------------------', &
154          &'---------')
155101 FORMAT (I3,1X,I6,1X,A8,F3.2,1X,F8.4,A1,1X,F8.4,A1,F8.4,A1,F8.4,2X,F5.3,2X, &
156            F4.2, &
157            2X,E10.3,2X,F6.0,1X,4(E10.3,1X),3(3(I4),1X),F8.3,1X,F8.3,5X,I3)
158
159 END SUBROUTINE run_control
Note: See TracBrowser for help on using the repository browser.