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