[1682] | 1 | !> @file run_control.f90 |
---|
[4591] | 2 | !--------------------------------------------------------------------------------------------------! |
---|
[2696] | 3 | ! This file is part of the PALM model system. |
---|
[1036] | 4 | ! |
---|
[4591] | 5 | ! PALM is free software: you can redistribute it and/or modify it under the terms of the GNU General |
---|
| 6 | ! Public License as published by the Free Software Foundation, either version 3 of the License, or |
---|
| 7 | ! (at your option) any later version. |
---|
[1036] | 8 | ! |
---|
[4591] | 9 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
---|
| 10 | ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
---|
| 11 | ! Public License for more details. |
---|
[1036] | 12 | ! |
---|
[4591] | 13 | ! You should have received a copy of the GNU General Public License along with PALM. If not, see |
---|
| 14 | ! <http://www.gnu.org/licenses/>. |
---|
[1036] | 15 | ! |
---|
[4828] | 16 | ! Copyright 1997-2021 Leibniz Universitaet Hannover |
---|
[4591] | 17 | !--------------------------------------------------------------------------------------------------! |
---|
[1036] | 18 | ! |
---|
[4591] | 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[4591] | 22 | ! |
---|
| 23 | ! |
---|
[1321] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: run_control.f90 4828 2021-01-05 11:21:41Z raasch $ |
---|
[4591] | 27 | ! File re-formatted to follow the PALM coding standard |
---|
| 28 | ! |
---|
| 29 | ! |
---|
| 30 | ! 4360 2020-01-07 11:25:50Z suehring |
---|
[2716] | 31 | ! Corrected "Former revisions" section |
---|
[4591] | 32 | ! |
---|
[4182] | 33 | ! 3655 2019-01-07 16:51:22Z knoop |
---|
| 34 | ! Corrected "Former revisions" section |
---|
[1321] | 35 | ! |
---|
[4182] | 36 | ! Revision 1.1 1997/08/11 06:25:38 raasch |
---|
| 37 | ! Initial revision |
---|
| 38 | ! |
---|
| 39 | ! |
---|
[1] | 40 | ! Description: |
---|
| 41 | ! ------------ |
---|
[1682] | 42 | !> Computation and output of run-control quantities |
---|
[4591] | 43 | !--------------------------------------------------------------------------------------------------! |
---|
[1682] | 44 | SUBROUTINE run_control |
---|
[1] | 45 | |
---|
[1320] | 46 | |
---|
[4591] | 47 | USE cpulog, & |
---|
| 48 | ONLY: cpu_log, & |
---|
| 49 | log_point |
---|
| 50 | |
---|
| 51 | USE control_parameters, & |
---|
| 52 | ONLY: advected_distance_x, & |
---|
| 53 | advected_distance_y, & |
---|
| 54 | current_timestep_number, & |
---|
| 55 | disturbance_created, & |
---|
| 56 | dt_3d, & |
---|
| 57 | mgcycles, & |
---|
| 58 | run_control_header, & |
---|
| 59 | runnr, & |
---|
| 60 | simulated_time, & |
---|
| 61 | simulated_time_chr, & |
---|
[1320] | 62 | timestep_reason |
---|
| 63 | |
---|
[4591] | 64 | USE indices, & |
---|
[1320] | 65 | ONLY: nzb |
---|
| 66 | |
---|
[1353] | 67 | USE kinds |
---|
| 68 | |
---|
[1] | 69 | USE pegrid |
---|
| 70 | |
---|
[4591] | 71 | USE statistics, & |
---|
| 72 | ONLY: flow_statistics_called, & |
---|
| 73 | hom, & |
---|
| 74 | pr_palm, & |
---|
| 75 | u_max, & |
---|
| 76 | u_max_ijk, & |
---|
| 77 | v_max, & |
---|
| 78 | v_max_ijk, & |
---|
| 79 | w_max, & |
---|
| 80 | w_max_ijk |
---|
[1320] | 81 | |
---|
[1] | 82 | IMPLICIT NONE |
---|
| 83 | |
---|
[4591] | 84 | CHARACTER (LEN=1) :: disturb_chr !< |
---|
[1] | 85 | |
---|
| 86 | ! |
---|
| 87 | !-- If required, do statistics |
---|
| 88 | IF ( .NOT. flow_statistics_called ) CALL flow_statistics |
---|
| 89 | |
---|
| 90 | ! |
---|
| 91 | !-- Flow_statistics has its own cpu-time measurement |
---|
| 92 | CALL cpu_log( log_point(11), 'run_control', 'start' ) |
---|
| 93 | |
---|
| 94 | ! |
---|
| 95 | !-- Output |
---|
| 96 | IF ( myid == 0 ) THEN |
---|
| 97 | |
---|
| 98 | ! |
---|
[4591] | 99 | !-- Check, whether file unit is already open (may have been opened in header before) |
---|
[1] | 100 | CALL check_open( 15 ) |
---|
| 101 | |
---|
| 102 | ! |
---|
| 103 | !-- If required, write header |
---|
| 104 | IF ( .NOT. run_control_header ) THEN |
---|
| 105 | WRITE ( 15, 100 ) |
---|
| 106 | run_control_header = .TRUE. |
---|
| 107 | ENDIF |
---|
| 108 | |
---|
| 109 | ! |
---|
| 110 | !-- If required, set disturbance flag |
---|
| 111 | IF ( disturbance_created ) THEN |
---|
| 112 | disturb_chr = 'D' |
---|
| 113 | ELSE |
---|
| 114 | disturb_chr = ' ' |
---|
| 115 | ENDIF |
---|
[4591] | 116 | WRITE ( 15, 101 ) runnr, current_timestep_number, simulated_time_chr, & |
---|
| 117 | INT( ( simulated_time-INT( simulated_time ) ) * 100), & |
---|
| 118 | dt_3d, timestep_reason, u_max, disturb_chr, v_max, disturb_chr, w_max, & |
---|
| 119 | hom(nzb,1,pr_palm,0), hom(nzb+8,1,pr_palm,0), hom(nzb+3,1,pr_palm,0), & |
---|
| 120 | hom(nzb+6,1,pr_palm,0), hom(nzb+4,1,pr_palm,0), hom(nzb+5,1,pr_palm,0), & |
---|
| 121 | hom(nzb+9,1,pr_palm,0), hom(nzb+10,1,pr_palm,0), u_max_ijk(1:3), & |
---|
| 122 | v_max_ijk(1:3), w_max_ijk(1:3), advected_distance_x/1000.0_wp, & |
---|
[1353] | 123 | advected_distance_y/1000.0_wp, mgcycles |
---|
[1] | 124 | ! |
---|
| 125 | !-- Write buffer contents to disc immediately |
---|
[1808] | 126 | FLUSH( 15 ) |
---|
[82] | 127 | |
---|
[1] | 128 | ENDIF |
---|
| 129 | ! |
---|
[4591] | 130 | !-- If required, reset disturbance flag. This has to be done outside the above |
---|
[1] | 131 | !-- IF-loop, because the flag would otherwise only be reset on PE0 |
---|
| 132 | IF ( disturbance_created ) disturbance_created = .FALSE. |
---|
| 133 | |
---|
| 134 | CALL cpu_log( log_point(11), 'run_control', 'stop' ) |
---|
| 135 | |
---|
| 136 | ! |
---|
| 137 | !-- Formats |
---|
| 138 | 100 FORMAT (///'Run-control output:'/ & |
---|
| 139 | &'------------------'// & |
---|
[97] | 140 | &'RUN ITER. HH:MM:SS.SS DT(E) UMAX VMAX WMAX U', & |
---|
[1257] | 141 | &'* W* THETA* Z_I ENERG. DISTENERG DIVOLD ', & |
---|
| 142 | &' DIVNEW UMAX(KJI) VMAX(KJI) WMAX(KJI) ADVECX ADVEC', & |
---|
| 143 | &'Y MGCYC'/ & |
---|
[97] | 144 | &'----------------------------------------------------------------', & |
---|
| 145 | &'----------------------------------------------------------------', & |
---|
| 146 | &'----------------------------------------------------------------', & |
---|
[1257] | 147 | &'---------') |
---|
[4591] | 148 | 101 FORMAT (I3,1X,I6,1X,A8,'.',I2.2,1X,F8.4,A1,1X,F8.4,A1,F8.4,A1,F8.4,1X, F6.3,1X,F5.2, & |
---|
[1257] | 149 | 2X,E10.3,2X,F6.0,1X,4(E10.3,1X),3(3(I4),1X),F8.3,1X,F8.3,5X,I3) |
---|
[1] | 150 | |
---|
| 151 | END SUBROUTINE run_control |
---|