[1682] | 1 | !> @file run_control.f90 |
---|
[2000] | 2 | !------------------------------------------------------------------------------! |
---|
[2696] | 3 | ! This file is part of the PALM model system. |
---|
[1036] | 4 | ! |
---|
[2000] | 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. |
---|
[1036] | 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 | ! |
---|
[3655] | 17 | ! Copyright 1997-2019 Leibniz Universitaet Hannover |
---|
[2000] | 18 | !------------------------------------------------------------------------------! |
---|
[1036] | 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[2001] | 22 | ! |
---|
| 23 | ! |
---|
[1321] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: run_control.f90 4180 2019-08-21 14:37:54Z scharf $ |
---|
[2716] | 27 | ! Corrected "Former revisions" section |
---|
| 28 | ! |
---|
[1321] | 29 | ! |
---|
[1] | 30 | ! Description: |
---|
| 31 | ! ------------ |
---|
[1682] | 32 | !> Computation and output of run-control quantities |
---|
[1] | 33 | !------------------------------------------------------------------------------! |
---|
[1682] | 34 | SUBROUTINE run_control |
---|
| 35 | |
---|
[1] | 36 | |
---|
[1320] | 37 | USE cpulog, & |
---|
| 38 | ONLY: cpu_log, log_point |
---|
| 39 | |
---|
| 40 | USE control_parameters, & |
---|
| 41 | ONLY: advected_distance_x, advected_distance_y, & |
---|
| 42 | current_timestep_number, disturbance_created, dt_3d, mgcycles, & |
---|
| 43 | run_control_header, runnr, simulated_time, simulated_time_chr, & |
---|
| 44 | timestep_reason |
---|
| 45 | |
---|
| 46 | USE indices, & |
---|
| 47 | ONLY: nzb |
---|
| 48 | |
---|
[1353] | 49 | USE kinds |
---|
| 50 | |
---|
[1] | 51 | USE pegrid |
---|
| 52 | |
---|
[1320] | 53 | USE statistics, & |
---|
| 54 | ONLY: flow_statistics_called, hom, pr_palm, u_max, u_max_ijk, v_max, & |
---|
| 55 | v_max_ijk, w_max, w_max_ijk |
---|
| 56 | |
---|
[1] | 57 | IMPLICIT NONE |
---|
| 58 | |
---|
[1001] | 59 | CHARACTER (LEN=1) :: disturb_chr |
---|
[1] | 60 | |
---|
| 61 | ! |
---|
| 62 | !-- If required, do statistics |
---|
| 63 | IF ( .NOT. flow_statistics_called ) CALL flow_statistics |
---|
| 64 | |
---|
| 65 | ! |
---|
| 66 | !-- Flow_statistics has its own cpu-time measurement |
---|
| 67 | CALL cpu_log( log_point(11), 'run_control', 'start' ) |
---|
| 68 | |
---|
| 69 | ! |
---|
| 70 | !-- Output |
---|
| 71 | IF ( myid == 0 ) THEN |
---|
| 72 | |
---|
| 73 | ! |
---|
| 74 | !-- Check, whether file unit is already open (may have been opened in header |
---|
| 75 | !-- before) |
---|
| 76 | CALL check_open( 15 ) |
---|
| 77 | |
---|
| 78 | ! |
---|
| 79 | !-- If required, write header |
---|
| 80 | IF ( .NOT. run_control_header ) THEN |
---|
| 81 | WRITE ( 15, 100 ) |
---|
| 82 | run_control_header = .TRUE. |
---|
| 83 | ENDIF |
---|
| 84 | |
---|
| 85 | ! |
---|
| 86 | !-- If required, set disturbance flag |
---|
| 87 | IF ( disturbance_created ) THEN |
---|
| 88 | disturb_chr = 'D' |
---|
| 89 | ELSE |
---|
| 90 | disturb_chr = ' ' |
---|
| 91 | ENDIF |
---|
| 92 | WRITE ( 15, 101 ) runnr, current_timestep_number, simulated_time_chr, & |
---|
[1697] | 93 | INT( ( simulated_time-INT( simulated_time ) ) * 100),& |
---|
| 94 | dt_3d, timestep_reason, u_max, disturb_chr, & |
---|
[87] | 95 | v_max, disturb_chr, w_max, hom(nzb,1,pr_palm,0), & |
---|
| 96 | hom(nzb+8,1,pr_palm,0), hom(nzb+3,1,pr_palm,0), & |
---|
| 97 | hom(nzb+6,1,pr_palm,0), hom(nzb+4,1,pr_palm,0), & |
---|
| 98 | hom(nzb+5,1,pr_palm,0), hom(nzb+9,1,pr_palm,0), & |
---|
| 99 | hom(nzb+10,1,pr_palm,0), u_max_ijk(1:3), & |
---|
[1] | 100 | v_max_ijk(1:3), w_max_ijk(1:3), & |
---|
[1353] | 101 | advected_distance_x/1000.0_wp, & |
---|
| 102 | advected_distance_y/1000.0_wp, mgcycles |
---|
[1] | 103 | ! |
---|
| 104 | !-- Write buffer contents to disc immediately |
---|
[1808] | 105 | FLUSH( 15 ) |
---|
[82] | 106 | |
---|
[1] | 107 | ENDIF |
---|
| 108 | ! |
---|
| 109 | !-- If required, reset disturbance flag. This has to be done outside the above |
---|
| 110 | !-- IF-loop, because the flag would otherwise only be reset on PE0 |
---|
| 111 | IF ( disturbance_created ) disturbance_created = .FALSE. |
---|
| 112 | |
---|
| 113 | CALL cpu_log( log_point(11), 'run_control', 'stop' ) |
---|
| 114 | |
---|
| 115 | ! |
---|
| 116 | !-- Formats |
---|
| 117 | 100 FORMAT (///'Run-control output:'/ & |
---|
| 118 | &'------------------'// & |
---|
[97] | 119 | &'RUN ITER. HH:MM:SS.SS DT(E) UMAX VMAX WMAX U', & |
---|
[1257] | 120 | &'* W* THETA* Z_I ENERG. DISTENERG DIVOLD ', & |
---|
| 121 | &' DIVNEW UMAX(KJI) VMAX(KJI) WMAX(KJI) ADVECX ADVEC', & |
---|
| 122 | &'Y MGCYC'/ & |
---|
[97] | 123 | &'----------------------------------------------------------------', & |
---|
| 124 | &'----------------------------------------------------------------', & |
---|
| 125 | &'----------------------------------------------------------------', & |
---|
[1257] | 126 | &'---------') |
---|
[1697] | 127 | 101 FORMAT (I3,1X,I6,1X,A8,'.',I2.2,1X,F8.4,A1,1X,F8.4,A1,F8.4,A1,F8.4,1X, & |
---|
| 128 | F6.3,1X,F5.2, & |
---|
[1257] | 129 | 2X,E10.3,2X,F6.0,1X,4(E10.3,1X),3(3(I4),1X),F8.3,1X,F8.3,5X,I3) |
---|
[1] | 130 | |
---|
| 131 | END SUBROUTINE run_control |
---|