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

Last change on this file since 1783 was 1783, checked in by raasch, 8 years ago

NetCDF routines modularized; new parameter netcdf_deflate; further changes in the pmc

  • Property svn:keywords set to Id
File size: 4.7 KB
Line 
1!> @file data_output_tseries.f90
2!--------------------------------------------------------------------------------!
3! This file is part of PALM.
4!
5! PALM is free software: you can redistribute it and/or modify it under the terms
6! of the GNU General Public License as published by the Free Software Foundation,
7! either version 3 of the License, or (at your option) any later version.
8!
9! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
10! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
12!
13! You should have received a copy of the GNU General Public License along with
14! PALM. If not, see <http://www.gnu.org/licenses/>.
15!
16! Copyright 1997-2014 Leibniz Universitaet Hannover
17!--------------------------------------------------------------------------------!
18!
19! Current revisions:
20! -----------------
21! name change of netcdf routines and module + related changes
22!
23! Former revisions:
24! -----------------
25! $Id: data_output_tseries.f90 1783 2016-03-06 18:36:17Z raasch $
26!
27! 1682 2015-10-07 23:56:08Z knoop
28! Code annotations made doxygen readable
29!
30! 1524 2015-01-14 13:18:19Z keck
31! Bugfix: increment dots_time_count after the call of subroutine check_open
32!
33! 1327 2014-03-21 11:00:16Z raasch
34! -netcdf output queries
35!
36! 1320 2014-03-20 08:40:49Z raasch
37! ONLY-attribute added to USE-statements,
38! kind-parameters added to all INTEGER and REAL declaration statements,
39! kinds are defined in new module kinds,
40! revision history before 2012 removed,
41! comment fields (!:) to be used for variable explanations added to
42! all variable declaration statements
43!
44! 1318 2014-03-17 13:35:16Z raasch
45! barrier argument removed from cpu_log.
46! module interfaces removed
47!
48! 1092 2013-02-02 11:24:22Z raasch
49! unused variables removed
50!
51! 1036 2012-10-22 13:43:42Z raasch
52! code put under GPL (PALM 3.9)
53!
54! Revision 1.1  1998/03/03 08:00:13  raasch
55! Initial revision
56!
57!
58! Description:
59! ------------
60!> Time series output for PROFIL. Always all time series are stored. A selection
61!> can be applied via the PROFIL-parameters in close_file.
62!------------------------------------------------------------------------------!
63 SUBROUTINE data_output_tseries
64 
65
66    USE control_parameters,                                                    &
67        ONLY:  dots_time_count, time_since_reference_point
68
69    USE cpulog,                                                                &
70        ONLY:  cpu_log, log_point 
71
72    USE kinds
73
74#if defined( __netcdf )
75    USE NETCDF
76#endif
77    USE netcdf_interface,                                                      &
78        ONLY:  dots_num, id_set_ts, id_var_dots, id_var_time_ts, nc_stat,      &
79               netcdf_handle_error
80
81    USE pegrid
82
83    USE profil_parameter
84   
85    USE statistics,                                                            &
86        ONLY:  flow_statistics_called, statistic_regions, ts_value
87
88    IMPLICIT NONE
89
90
91    INTEGER(iwp) ::  i  !<
92    INTEGER(iwp) ::  sr !<
93
94
95!
96!-- If required, compute statistics.
97    IF ( .NOT. flow_statistics_called )  CALL flow_statistics
98
99!
100!-- Flow_statistics has its own cpu-time measuring.
101    CALL cpu_log( log_point(21), 'data_output_tseries', 'start' )
102
103    IF ( myid == 0 )  THEN
104
105!
106!--    Open file for time series output in NetCDF format
107       CALL check_open( 105 )
108       
109!--    Increment the counter for number of output times
110!      CAUTION: The following line has to be after the call of the subroutine
111!               check_open, since check_open resets the counter dots_time_count
112!               to 0, if a new file is opened
113       dots_time_count = dots_time_count + 1
114       
115#if defined( __netcdf )
116!
117!--    Update the time series time axis
118       nc_stat = NF90_PUT_VAR( id_set_ts, id_var_time_ts,        &
119                               (/ time_since_reference_point /), &
120                               start = (/ dots_time_count /),    &
121                               count = (/ 1 /) )
122       CALL netcdf_handle_error( 'data_output_tseries', 350 )
123#endif
124
125!
126!--    Time series output for the total domain (and each subregion, if
127!--    applicable)
128       DO  sr = 0, statistic_regions
129
130#if defined( __netcdf )
131          DO  i = 1, dots_num
132             nc_stat = NF90_PUT_VAR( id_set_ts, id_var_dots(i,sr),  &
133                                     (/ ts_value(i,sr) /),          &
134                                     start = (/ dots_time_count /), &
135                                     count = (/ 1 /) )
136             CALL netcdf_handle_error( 'data_output_tseries', 351 )
137          ENDDO
138#endif
139
140       ENDDO
141
142    ENDIF
143
144
145    CALL cpu_log( log_point(21), 'data_output_tseries', 'stop' )
146
147!
148!-- formats
149500 FORMAT (23(E15.7,1X))
150
151 END SUBROUTINE data_output_tseries
Note: See TracBrowser for help on using the repository browser.