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

Last change on this file since 2000 was 2000, checked in by knoop, 8 years ago

Forced header and separation lines into 80 columns

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