1 | SUBROUTINE data_output_tseries |
---|
2 | |
---|
3 | !--------------------------------------------------------------------------------! |
---|
4 | ! This file is part of PALM. |
---|
5 | ! |
---|
6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
8 | ! either version 3 of the License, or (at your option) any later 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-2012 Leibniz University Hannover |
---|
18 | !--------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: data_output_tseries.f90 1037 2012-10-22 14:10:22Z franke $ |
---|
27 | ! |
---|
28 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
29 | ! code put under GPL (PALM 3.9) |
---|
30 | ! |
---|
31 | ! 291 2009-04-16 12:07:26Z raasch |
---|
32 | ! simulated_time in NetCDF output replaced by time_since_reference_point. |
---|
33 | ! Output of NetCDF messages with aid of message handling routine. |
---|
34 | ! |
---|
35 | ! 48 2007-03-06 12:28:36Z raasch |
---|
36 | ! Collection of time series quantities moved to routine flow_statistics, |
---|
37 | ! output for "profil" removed |
---|
38 | ! |
---|
39 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
40 | ! |
---|
41 | ! Revision 1.13 2006/03/14 12:42:51 raasch |
---|
42 | ! Error removed: NetCDF output only if switched on |
---|
43 | ! |
---|
44 | ! Revision 1.1 1998/03/03 08:00:13 raasch |
---|
45 | ! Initial revision |
---|
46 | ! |
---|
47 | ! |
---|
48 | ! Description: |
---|
49 | ! ------------ |
---|
50 | ! Time series output for PROFIL. Always all time series are stored. A selection |
---|
51 | ! can be applied via the PROFIL-parameters in close_file. |
---|
52 | !------------------------------------------------------------------------------! |
---|
53 | |
---|
54 | USE control_parameters |
---|
55 | USE cpulog |
---|
56 | USE indices |
---|
57 | USE interfaces |
---|
58 | USE netcdf_control |
---|
59 | USE pegrid |
---|
60 | USE profil_parameter |
---|
61 | USE statistics |
---|
62 | |
---|
63 | IMPLICIT NONE |
---|
64 | |
---|
65 | |
---|
66 | INTEGER :: file_id, i, j, sr |
---|
67 | |
---|
68 | |
---|
69 | ! |
---|
70 | !-- If required, compute statistics. |
---|
71 | IF ( .NOT. flow_statistics_called ) CALL flow_statistics |
---|
72 | |
---|
73 | ! |
---|
74 | !-- Flow_statistics has its own cpu-time measuring. |
---|
75 | CALL cpu_log( log_point(21), 'data_output_tseries', 'start' ) |
---|
76 | |
---|
77 | IF ( myid == 0 ) THEN |
---|
78 | |
---|
79 | ! |
---|
80 | !-- Open file for time series output in NetCDF format |
---|
81 | IF ( netcdf_output ) THEN |
---|
82 | dots_time_count = dots_time_count + 1 |
---|
83 | CALL check_open( 105 ) |
---|
84 | #if defined( __netcdf ) |
---|
85 | ! |
---|
86 | !-- Update the time series time axis |
---|
87 | nc_stat = NF90_PUT_VAR( id_set_ts, id_var_time_ts, & |
---|
88 | (/ time_since_reference_point /), & |
---|
89 | start = (/ dots_time_count /), & |
---|
90 | count = (/ 1 /) ) |
---|
91 | CALL handle_netcdf_error( 'data_output_tseries', 350 ) |
---|
92 | #endif |
---|
93 | ENDIF |
---|
94 | |
---|
95 | ! |
---|
96 | !-- Time series output for the total domain (and each subregion, if |
---|
97 | !-- applicable) |
---|
98 | DO sr = 0, statistic_regions |
---|
99 | |
---|
100 | #if defined( __netcdf ) |
---|
101 | IF ( netcdf_output ) THEN |
---|
102 | DO i = 1, dots_num |
---|
103 | nc_stat = NF90_PUT_VAR( id_set_ts, id_var_dots(i,sr), & |
---|
104 | (/ ts_value(i,sr) /), & |
---|
105 | start = (/ dots_time_count /), & |
---|
106 | count = (/ 1 /) ) |
---|
107 | CALL handle_netcdf_error( 'data_output_tseries', 351 ) |
---|
108 | ENDDO |
---|
109 | ENDIF |
---|
110 | #endif |
---|
111 | |
---|
112 | ENDDO |
---|
113 | |
---|
114 | ENDIF |
---|
115 | |
---|
116 | |
---|
117 | CALL cpu_log( log_point(21), 'data_output_tseries','stop', 'nobarrier' ) |
---|
118 | |
---|
119 | ! |
---|
120 | !-- formats |
---|
121 | 500 FORMAT (23(E15.7,1X)) |
---|
122 | |
---|
123 | END SUBROUTINE data_output_tseries |
---|