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

Last change on this file since 1328 was 1321, checked in by raasch, 11 years ago

last commit documented

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