[1682] | 1 | !> @file data_output_tseries.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 | ! |
---|
[2718] | 17 | ! Copyright 1997-2018 Leibniz Universitaet Hannover |
---|
[2000] | 18 | !------------------------------------------------------------------------------! |
---|
[1036] | 19 | ! |
---|
[263] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[2001] | 22 | ! |
---|
| 23 | ! |
---|
[1321] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: data_output_tseries.f90 2718 2018-01-02 08:49:38Z gronemeier $ |
---|
[2716] | 27 | ! Corrected "Former revisions" section |
---|
| 28 | ! |
---|
| 29 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
| 30 | ! Change in file header (GPL part) |
---|
[1321] | 31 | ! |
---|
[2716] | 32 | ! 2101 2017-01-05 16:42:31Z suehring |
---|
| 33 | ! |
---|
[2001] | 34 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
| 35 | ! Forced header and separation lines into 80 columns |
---|
| 36 | ! |
---|
[1784] | 37 | ! 1783 2016-03-06 18:36:17Z raasch |
---|
| 38 | ! name change of netcdf routines and module + related changes |
---|
| 39 | ! |
---|
[1683] | 40 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 41 | ! Code annotations made doxygen readable |
---|
| 42 | ! |
---|
[1525] | 43 | ! 1524 2015-01-14 13:18:19Z keck |
---|
| 44 | ! Bugfix: increment dots_time_count after the call of subroutine check_open |
---|
| 45 | ! |
---|
[1329] | 46 | ! 1327 2014-03-21 11:00:16Z raasch |
---|
| 47 | ! -netcdf output queries |
---|
| 48 | ! |
---|
[1321] | 49 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 50 | ! ONLY-attribute added to USE-statements, |
---|
| 51 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 52 | ! kinds are defined in new module kinds, |
---|
| 53 | ! revision history before 2012 removed, |
---|
| 54 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 55 | ! all variable declaration statements |
---|
[1] | 56 | ! |
---|
[1319] | 57 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
| 58 | ! barrier argument removed from cpu_log. |
---|
| 59 | ! module interfaces removed |
---|
| 60 | ! |
---|
[1093] | 61 | ! 1092 2013-02-02 11:24:22Z raasch |
---|
| 62 | ! unused variables removed |
---|
| 63 | ! |
---|
[1037] | 64 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 65 | ! code put under GPL (PALM 3.9) |
---|
| 66 | ! |
---|
[1] | 67 | ! Revision 1.1 1998/03/03 08:00:13 raasch |
---|
| 68 | ! Initial revision |
---|
| 69 | ! |
---|
| 70 | ! |
---|
| 71 | ! Description: |
---|
| 72 | ! ------------ |
---|
[1682] | 73 | !> Time series output for PROFIL. Always all time series are stored. A selection |
---|
| 74 | !> can be applied via the PROFIL-parameters in close_file. |
---|
[1] | 75 | !------------------------------------------------------------------------------! |
---|
[1682] | 76 | SUBROUTINE data_output_tseries |
---|
| 77 | |
---|
[1] | 78 | |
---|
[1320] | 79 | USE control_parameters, & |
---|
[1327] | 80 | ONLY: dots_time_count, time_since_reference_point |
---|
[1320] | 81 | |
---|
| 82 | USE cpulog, & |
---|
| 83 | ONLY: cpu_log, log_point |
---|
| 84 | |
---|
| 85 | USE kinds |
---|
| 86 | |
---|
[1783] | 87 | #if defined( __netcdf ) |
---|
| 88 | USE NETCDF |
---|
| 89 | #endif |
---|
| 90 | USE netcdf_interface, & |
---|
| 91 | ONLY: dots_num, id_set_ts, id_var_dots, id_var_time_ts, nc_stat, & |
---|
| 92 | netcdf_handle_error |
---|
[1320] | 93 | |
---|
[1] | 94 | USE pegrid |
---|
[1320] | 95 | |
---|
[1] | 96 | USE profil_parameter |
---|
[1320] | 97 | |
---|
| 98 | USE statistics, & |
---|
| 99 | ONLY: flow_statistics_called, statistic_regions, ts_value |
---|
[1] | 100 | |
---|
| 101 | IMPLICIT NONE |
---|
| 102 | |
---|
| 103 | |
---|
[1682] | 104 | INTEGER(iwp) :: i !< |
---|
| 105 | INTEGER(iwp) :: sr !< |
---|
[1] | 106 | |
---|
| 107 | |
---|
| 108 | ! |
---|
| 109 | !-- If required, compute statistics. |
---|
| 110 | IF ( .NOT. flow_statistics_called ) CALL flow_statistics |
---|
| 111 | |
---|
| 112 | ! |
---|
| 113 | !-- Flow_statistics has its own cpu-time measuring. |
---|
| 114 | CALL cpu_log( log_point(21), 'data_output_tseries', 'start' ) |
---|
| 115 | |
---|
| 116 | IF ( myid == 0 ) THEN |
---|
| 117 | |
---|
| 118 | ! |
---|
| 119 | !-- Open file for time series output in NetCDF format |
---|
[1524] | 120 | CALL check_open( 105 ) |
---|
| 121 | |
---|
| 122 | !-- Increment the counter for number of output times |
---|
| 123 | ! CAUTION: The following line has to be after the call of the subroutine |
---|
| 124 | ! check_open, since check_open resets the counter dots_time_count |
---|
| 125 | ! to 0, if a new file is opened |
---|
[1327] | 126 | dots_time_count = dots_time_count + 1 |
---|
[1524] | 127 | |
---|
[1] | 128 | #if defined( __netcdf ) |
---|
| 129 | ! |
---|
[1327] | 130 | !-- Update the time series time axis |
---|
| 131 | nc_stat = NF90_PUT_VAR( id_set_ts, id_var_time_ts, & |
---|
| 132 | (/ time_since_reference_point /), & |
---|
| 133 | start = (/ dots_time_count /), & |
---|
| 134 | count = (/ 1 /) ) |
---|
[1783] | 135 | CALL netcdf_handle_error( 'data_output_tseries', 350 ) |
---|
[1] | 136 | #endif |
---|
| 137 | |
---|
| 138 | ! |
---|
| 139 | !-- Time series output for the total domain (and each subregion, if |
---|
| 140 | !-- applicable) |
---|
| 141 | DO sr = 0, statistic_regions |
---|
| 142 | |
---|
| 143 | #if defined( __netcdf ) |
---|
[1327] | 144 | DO i = 1, dots_num |
---|
| 145 | nc_stat = NF90_PUT_VAR( id_set_ts, id_var_dots(i,sr), & |
---|
| 146 | (/ ts_value(i,sr) /), & |
---|
| 147 | start = (/ dots_time_count /), & |
---|
| 148 | count = (/ 1 /) ) |
---|
[1783] | 149 | CALL netcdf_handle_error( 'data_output_tseries', 351 ) |
---|
[1327] | 150 | ENDDO |
---|
[1] | 151 | #endif |
---|
| 152 | |
---|
[48] | 153 | ENDDO |
---|
[1] | 154 | |
---|
| 155 | ENDIF |
---|
| 156 | |
---|
| 157 | |
---|
[1318] | 158 | CALL cpu_log( log_point(21), 'data_output_tseries', 'stop' ) |
---|
[1] | 159 | |
---|
| 160 | ! |
---|
| 161 | !-- formats |
---|
| 162 | 500 FORMAT (23(E15.7,1X)) |
---|
| 163 | |
---|
| 164 | END SUBROUTINE data_output_tseries |
---|