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

Last change on this file since 4327 was 4182, checked in by scharf, 5 years ago
  • corrected "Former revisions" section
  • minor formatting in "Former revisions" section
  • added "Author" section
  • Property svn:keywords set to Id
File size: 3.9 KB
RevLine 
[1682]1!> @file data_output_tseries.f90
[2000]2!------------------------------------------------------------------------------!
[2696]3! This file is part of the PALM model system.
[1036]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!
[3655]17! Copyright 1997-2019 Leibniz Universitaet Hannover
[2000]18!------------------------------------------------------------------------------!
[1036]19!
[263]20! Current revisions:
[1]21! -----------------
[2001]22!
23!
[1321]24! Former revisions:
25! -----------------
26! $Id: data_output_tseries.f90 4182 2019-08-22 15:20:23Z Giersch $
[4182]27! Corrected "Former revisions" section
28!
29! 3655 2019-01-07 16:51:22Z knoop
[3241]30! unused format removed
[1321]31!
[4182]32! Revision 1.1  1998/03/03 08:00:13  raasch
33! Initial revision
34!
35!
[1]36! Description:
37! ------------
[1682]38!> Time series output for PROFIL. Always all time series are stored. A selection
39!> can be applied via the PROFIL-parameters in close_file.
[1]40!------------------------------------------------------------------------------!
[1682]41 SUBROUTINE data_output_tseries
42 
[1]43
[1320]44    USE control_parameters,                                                    &
[1327]45        ONLY:  dots_time_count, time_since_reference_point
[1320]46
47    USE cpulog,                                                                &
48        ONLY:  cpu_log, log_point 
49
50    USE kinds
51
[1783]52#if defined( __netcdf )
53    USE NETCDF
54#endif
55    USE netcdf_interface,                                                      &
56        ONLY:  dots_num, id_set_ts, id_var_dots, id_var_time_ts, nc_stat,      &
57               netcdf_handle_error
[1320]58
[1]59    USE pegrid
[1320]60
[1]61    USE profil_parameter
[1320]62   
63    USE statistics,                                                            &
64        ONLY:  flow_statistics_called, statistic_regions, ts_value
[1]65
66    IMPLICIT NONE
67
68
[1682]69    INTEGER(iwp) ::  i  !<
70    INTEGER(iwp) ::  sr !<
[1]71
72
73!
74!-- If required, compute statistics.
75    IF ( .NOT. flow_statistics_called )  CALL flow_statistics
76
77!
78!-- Flow_statistics has its own cpu-time measuring.
79    CALL cpu_log( log_point(21), 'data_output_tseries', 'start' )
80
81    IF ( myid == 0 )  THEN
82
83!
84!--    Open file for time series output in NetCDF format
[1524]85       CALL check_open( 105 )
86       
87!--    Increment the counter for number of output times
88!      CAUTION: The following line has to be after the call of the subroutine
89!               check_open, since check_open resets the counter dots_time_count
90!               to 0, if a new file is opened
[1327]91       dots_time_count = dots_time_count + 1
[1524]92       
[1]93#if defined( __netcdf )
94!
[1327]95!--    Update the time series time axis
96       nc_stat = NF90_PUT_VAR( id_set_ts, id_var_time_ts,        &
97                               (/ time_since_reference_point /), &
98                               start = (/ dots_time_count /),    &
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
110             nc_stat = NF90_PUT_VAR( id_set_ts, id_var_dots(i,sr),  &
111                                     (/ ts_value(i,sr) /),          &
112                                     start = (/ dots_time_count /), &
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.