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

Last change on this file since 4180 was 4180, checked in by scharf, 5 years ago

removed comments in 'Former revisions' section that are older than 01.01.2019

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