source: palm/trunk/SOURCE/data_output_tseries.f90 @ 4753

Last change on this file since 4753 was 4583, checked in by raasch, 4 years ago

files re-formatted to follow the PALM coding standard

  • Property svn:keywords set to Id
File size: 4.2 KB
RevLine 
[1682]1!> @file data_output_tseries.f90
[4583]2!--------------------------------------------------------------------------------------------------!
[2696]3! This file is part of the PALM model system.
[1036]4!
[4583]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!
[4583]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!
[4583]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!
[4360]16! Copyright 1997-2020 Leibniz Universitaet Hannover
[4583]17!--------------------------------------------------------------------------------------------------!
[1036]18!
[263]19! Current revisions:
[1]20! -----------------
[2001]21!
22!
[1321]23! Former revisions:
24! -----------------
25! $Id: data_output_tseries.f90 4583 2020-06-29 12:36:47Z raasch $
[4583]26! file re-formatted to follow the PALM coding standard
27!
28! 4360 2020-01-07 11:25:50Z suehring
[4182]29! Corrected "Former revisions" section
[4583]30!
[4182]31! 3655 2019-01-07 16:51:22Z knoop
[3241]32! unused format removed
[1321]33!
[4182]34! Revision 1.1  1998/03/03 08:00:13  raasch
35! Initial revision
36!
37!
[1]38! Description:
39! ------------
[4583]40!> Time series output for PROFIL. Always all time series are stored. A selection can be applied via
41!> the PROFIL-parameters in close_file.
42!--------------------------------------------------------------------------------------------------!
[1682]43 SUBROUTINE data_output_tseries
[1]44
[4583]45
46    USE control_parameters,                                                                        &
[1327]47        ONLY:  dots_time_count, time_since_reference_point
[1320]48
[4583]49    USE cpulog,                                                                                    &
50        ONLY:  cpu_log, log_point
[1320]51
52    USE kinds
53
[1783]54#if defined( __netcdf )
55    USE NETCDF
56#endif
[4583]57    USE netcdf_interface,                                                                          &
58        ONLY:  dots_num, id_set_ts, id_var_dots, id_var_time_ts, nc_stat, netcdf_handle_error
[1320]59
[1]60    USE pegrid
[1320]61
[1]62    USE profil_parameter
[4583]63
64    USE statistics,                                                                                &
[1320]65        ONLY:  flow_statistics_called, statistic_regions, ts_value
[1]66
67    IMPLICIT NONE
68
69
[1682]70    INTEGER(iwp) ::  i  !<
71    INTEGER(iwp) ::  sr !<
[1]72
73
74!
75!-- If required, compute statistics.
76    IF ( .NOT. flow_statistics_called )  CALL flow_statistics
77
78!
79!-- Flow_statistics has its own cpu-time measuring.
80    CALL cpu_log( log_point(21), 'data_output_tseries', 'start' )
81
82    IF ( myid == 0 )  THEN
83
84!
85!--    Open file for time series output in NetCDF format
[1524]86       CALL check_open( 105 )
[4583]87
[1524]88!--    Increment the counter for number of output times
[4583]89!--    CAUTION: The following line has to be after the call of the subroutine check_open, since
90!--             check_open resets the counter dots_time_count to 0, if a new file is opened
[1327]91       dots_time_count = dots_time_count + 1
[4583]92
[1]93#if defined( __netcdf )
94!
[1327]95!--    Update the time series time axis
[4583]96       nc_stat = NF90_PUT_VAR( id_set_ts, id_var_time_ts,                                          &
97                               (/ time_since_reference_point /),                                   &
98                               start = (/ dots_time_count /),                                      &
[1327]99                               count = (/ 1 /) )
[1783]100       CALL netcdf_handle_error( 'data_output_tseries', 350 )
[1]101#endif
102
103!
104!--    Time series output for the total domain (and each subregion, if
105!--    applicable)
106       DO  sr = 0, statistic_regions
107
108#if defined( __netcdf )
[1327]109          DO  i = 1, dots_num
[4583]110             nc_stat = NF90_PUT_VAR( id_set_ts, id_var_dots(i,sr),                                 &
111                                     (/ ts_value(i,sr) /),                                         &
112                                     start = (/ dots_time_count /),                                &
[1327]113                                     count = (/ 1 /) )
[1783]114             CALL netcdf_handle_error( 'data_output_tseries', 351 )
[1327]115          ENDDO
[1]116#endif
117
[48]118       ENDDO
[1]119
120    ENDIF
121
122
[1318]123    CALL cpu_log( log_point(21), 'data_output_tseries', 'stop' )
[1]124
125 END SUBROUTINE data_output_tseries
Note: See TracBrowser for help on using the repository browser.