1 | !> @file data_log.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-2018 Leibniz Universitaet Hannover |
---|
18 | !------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: data_log.f90 2718 2018-01-02 08:49:38Z schwenkel $ |
---|
27 | ! Corrected "Former revisions" section |
---|
28 | ! |
---|
29 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
30 | ! Change in file header (GPL part) |
---|
31 | ! |
---|
32 | ! 2101 2017-01-05 16:42:31Z suehring |
---|
33 | ! |
---|
34 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
35 | ! Forced header and separation lines into 80 columns |
---|
36 | ! |
---|
37 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
38 | ! Code annotations made doxygen readable |
---|
39 | ! |
---|
40 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
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 |
---|
47 | ! |
---|
48 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
49 | ! code put under GPL (PALM 3.9) |
---|
50 | ! |
---|
51 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
52 | ! |
---|
53 | ! Revision 1.1 2006/02/23 10:09:29 raasch |
---|
54 | ! Initial revision |
---|
55 | ! |
---|
56 | ! |
---|
57 | ! Description: |
---|
58 | ! ------------ |
---|
59 | !> Complete logging of data |
---|
60 | !------------------------------------------------------------------------------! |
---|
61 | SUBROUTINE data_log( array, i1, i2, j1, j2, k1, k2 ) |
---|
62 | |
---|
63 | #if defined( __logging ) |
---|
64 | |
---|
65 | USE control_parameters, & |
---|
66 | ONLY: log_message, simulated_time |
---|
67 | |
---|
68 | USE kinds |
---|
69 | |
---|
70 | USE pegrid |
---|
71 | |
---|
72 | IMPLICIT NONE |
---|
73 | |
---|
74 | INTEGER(iwp) :: i1 !< |
---|
75 | INTEGER(iwp) :: i2 !< |
---|
76 | INTEGER(iwp) :: j1 !< |
---|
77 | INTEGER(iwp) :: j2 !< |
---|
78 | INTEGER(iwp) :: k1 !< |
---|
79 | INTEGER(iwp) :: k2 !< |
---|
80 | |
---|
81 | REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2) :: array !< |
---|
82 | |
---|
83 | |
---|
84 | ! |
---|
85 | !-- Open the file for data logging |
---|
86 | CALL check_open( 20 ) |
---|
87 | |
---|
88 | ! |
---|
89 | !-- Write the message string |
---|
90 | WRITE ( 20 ) log_message |
---|
91 | |
---|
92 | ! |
---|
93 | !-- Write the simulated time and the array indices |
---|
94 | WRITE ( 20 ) simulated_time, i1, i2, j1, j2, k1, k2 |
---|
95 | |
---|
96 | ! |
---|
97 | !-- Write the array |
---|
98 | WRITE ( 20 ) array |
---|
99 | |
---|
100 | #endif |
---|
101 | END SUBROUTINE data_log |
---|
102 | |
---|
103 | |
---|
104 | |
---|
105 | !------------------------------------------------------------------------------! |
---|
106 | ! Description: |
---|
107 | ! ------------ |
---|
108 | !> Complete logging of data for 2d arrays |
---|
109 | !------------------------------------------------------------------------------! |
---|
110 | |
---|
111 | SUBROUTINE data_log_2d( array, i1, i2, j1, j2) |
---|
112 | |
---|
113 | #if defined( __logging ) |
---|
114 | |
---|
115 | USE control_parameters, & |
---|
116 | ONLY: log_message, simulated_time |
---|
117 | |
---|
118 | USE kinds |
---|
119 | |
---|
120 | USE pegrid |
---|
121 | |
---|
122 | IMPLICIT NONE |
---|
123 | |
---|
124 | INTEGER(iwp) :: i1 !< |
---|
125 | INTEGER(iwp) :: i2 !< |
---|
126 | INTEGER(iwp) :: j1 !< |
---|
127 | INTEGER(iwp) :: j2 !< |
---|
128 | |
---|
129 | REAL(wp), DIMENSION(i1:i2,j1:j2) :: array !< |
---|
130 | |
---|
131 | |
---|
132 | ! |
---|
133 | !-- Open the file for data logging |
---|
134 | CALL check_open( 20 ) |
---|
135 | |
---|
136 | ! |
---|
137 | !-- Write the message string |
---|
138 | WRITE ( 20 ) log_message |
---|
139 | |
---|
140 | ! |
---|
141 | !-- Write the simulated time and the array indices |
---|
142 | WRITE ( 20 ) simulated_time, i1, i2, j1, j2 |
---|
143 | |
---|
144 | ! |
---|
145 | !-- Write the array |
---|
146 | WRITE ( 20 ) array |
---|
147 | |
---|
148 | #endif |
---|
149 | END SUBROUTINE data_log_2d |
---|
150 | |
---|
151 | |
---|
152 | |
---|
153 | !------------------------------------------------------------------------------! |
---|
154 | ! Description: |
---|
155 | ! ------------ |
---|
156 | !> Complete logging of data for 2d integer arrays |
---|
157 | !------------------------------------------------------------------------------! |
---|
158 | |
---|
159 | SUBROUTINE data_log_2d_int( array, i1, i2, j1, j2) |
---|
160 | |
---|
161 | #if defined( __logging ) |
---|
162 | |
---|
163 | USE control_parameters, & |
---|
164 | ONLY: log_message, simulated_time |
---|
165 | |
---|
166 | USE kinds |
---|
167 | |
---|
168 | USE pegrid |
---|
169 | |
---|
170 | IMPLICIT NONE |
---|
171 | |
---|
172 | INTEGER(iwp) :: i1 !< |
---|
173 | INTEGER(iwp) :: i2 !< |
---|
174 | INTEGER(iwp) :: j1 !< |
---|
175 | INTEGER(iwp) :: j2 !< |
---|
176 | |
---|
177 | INTEGER(iwp), DIMENSION(i1:i2,j1:j2) :: array !< |
---|
178 | |
---|
179 | |
---|
180 | ! |
---|
181 | !-- Open the file for data logging |
---|
182 | CALL check_open( 20 ) |
---|
183 | |
---|
184 | ! |
---|
185 | !-- Write the message string |
---|
186 | WRITE ( 20 ) log_message |
---|
187 | |
---|
188 | ! |
---|
189 | !-- Write the simulated time and the array indices |
---|
190 | WRITE ( 20 ) simulated_time, i1, i2, j1, j2 |
---|
191 | |
---|
192 | ! |
---|
193 | !-- Write the array |
---|
194 | WRITE ( 20 ) array |
---|
195 | |
---|
196 | #endif |
---|
197 | END SUBROUTINE data_log_2d_int |
---|