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