[1] | 1 | SUBROUTINE data_output_tseries |
---|
| 2 | |
---|
[1036] | 3 | !--------------------------------------------------------------------------------! |
---|
| 4 | ! This file is part of PALM. |
---|
| 5 | ! |
---|
| 6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
| 8 | ! either version 3 of the License, or (at your option) any later 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 | ! |
---|
[1310] | 17 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
[1036] | 18 | !--------------------------------------------------------------------------------! |
---|
| 19 | ! |
---|
[263] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[1329] | 22 | ! |
---|
| 23 | ! |
---|
[1321] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: data_output_tseries.f90 1329 2014-03-21 11:09:15Z suehring $ |
---|
| 27 | ! |
---|
[1329] | 28 | ! 1327 2014-03-21 11:00:16Z raasch |
---|
| 29 | ! -netcdf output queries |
---|
| 30 | ! |
---|
[1321] | 31 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 32 | ! ONLY-attribute added to USE-statements, |
---|
| 33 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 34 | ! kinds are defined in new module kinds, |
---|
| 35 | ! revision history before 2012 removed, |
---|
| 36 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 37 | ! all variable declaration statements |
---|
[1] | 38 | ! |
---|
[1319] | 39 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
| 40 | ! barrier argument removed from cpu_log. |
---|
| 41 | ! module interfaces removed |
---|
| 42 | ! |
---|
[1093] | 43 | ! 1092 2013-02-02 11:24:22Z raasch |
---|
| 44 | ! unused variables removed |
---|
| 45 | ! |
---|
[1037] | 46 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 47 | ! code put under GPL (PALM 3.9) |
---|
| 48 | ! |
---|
[1] | 49 | ! Revision 1.1 1998/03/03 08:00:13 raasch |
---|
| 50 | ! Initial revision |
---|
| 51 | ! |
---|
| 52 | ! |
---|
| 53 | ! Description: |
---|
| 54 | ! ------------ |
---|
| 55 | ! Time series output for PROFIL. Always all time series are stored. A selection |
---|
| 56 | ! can be applied via the PROFIL-parameters in close_file. |
---|
| 57 | !------------------------------------------------------------------------------! |
---|
| 58 | |
---|
[1320] | 59 | USE control_parameters, & |
---|
[1327] | 60 | ONLY: dots_time_count, time_since_reference_point |
---|
[1320] | 61 | |
---|
| 62 | USE cpulog, & |
---|
| 63 | ONLY: cpu_log, log_point |
---|
| 64 | |
---|
| 65 | USE kinds |
---|
| 66 | |
---|
[1] | 67 | USE netcdf_control |
---|
[1320] | 68 | |
---|
[1] | 69 | USE pegrid |
---|
[1320] | 70 | |
---|
[1] | 71 | USE profil_parameter |
---|
[1320] | 72 | |
---|
| 73 | USE statistics, & |
---|
| 74 | ONLY: flow_statistics_called, statistic_regions, ts_value |
---|
[1] | 75 | |
---|
| 76 | IMPLICIT NONE |
---|
| 77 | |
---|
| 78 | |
---|
[1320] | 79 | INTEGER(iwp) :: i !: |
---|
| 80 | INTEGER(iwp) :: sr !: |
---|
[1] | 81 | |
---|
| 82 | |
---|
| 83 | ! |
---|
| 84 | !-- If required, compute statistics. |
---|
| 85 | IF ( .NOT. flow_statistics_called ) CALL flow_statistics |
---|
| 86 | |
---|
| 87 | ! |
---|
| 88 | !-- Flow_statistics has its own cpu-time measuring. |
---|
| 89 | CALL cpu_log( log_point(21), 'data_output_tseries', 'start' ) |
---|
| 90 | |
---|
| 91 | IF ( myid == 0 ) THEN |
---|
| 92 | |
---|
| 93 | ! |
---|
| 94 | !-- Open file for time series output in NetCDF format |
---|
[1327] | 95 | dots_time_count = dots_time_count + 1 |
---|
| 96 | CALL check_open( 105 ) |
---|
[1] | 97 | #if defined( __netcdf ) |
---|
| 98 | ! |
---|
[1327] | 99 | !-- Update the time series time axis |
---|
| 100 | nc_stat = NF90_PUT_VAR( id_set_ts, id_var_time_ts, & |
---|
| 101 | (/ time_since_reference_point /), & |
---|
| 102 | start = (/ dots_time_count /), & |
---|
| 103 | count = (/ 1 /) ) |
---|
| 104 | CALL handle_netcdf_error( 'data_output_tseries', 350 ) |
---|
[1] | 105 | #endif |
---|
| 106 | |
---|
| 107 | ! |
---|
| 108 | !-- Time series output for the total domain (and each subregion, if |
---|
| 109 | !-- applicable) |
---|
| 110 | DO sr = 0, statistic_regions |
---|
| 111 | |
---|
| 112 | #if defined( __netcdf ) |
---|
[1327] | 113 | DO i = 1, dots_num |
---|
| 114 | nc_stat = NF90_PUT_VAR( id_set_ts, id_var_dots(i,sr), & |
---|
| 115 | (/ ts_value(i,sr) /), & |
---|
| 116 | start = (/ dots_time_count /), & |
---|
| 117 | count = (/ 1 /) ) |
---|
| 118 | CALL handle_netcdf_error( 'data_output_tseries', 351 ) |
---|
| 119 | ENDDO |
---|
[1] | 120 | #endif |
---|
| 121 | |
---|
[48] | 122 | ENDDO |
---|
[1] | 123 | |
---|
| 124 | ENDIF |
---|
| 125 | |
---|
| 126 | |
---|
[1318] | 127 | CALL cpu_log( log_point(21), 'data_output_tseries', 'stop' ) |
---|
[1] | 128 | |
---|
| 129 | ! |
---|
| 130 | !-- formats |
---|
| 131 | 500 FORMAT (23(E15.7,1X)) |
---|
| 132 | |
---|
| 133 | END SUBROUTINE data_output_tseries |
---|