1 | SUBROUTINE average_3d_data |
---|
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-2014 Leibniz Universitaet Hannover |
---|
18 | !--------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: average_3d_data.f90 1319 2014-03-17 15:08:44Z raasch $ |
---|
27 | ! |
---|
28 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
29 | ! barrier argument removed from cpu_log, |
---|
30 | ! module interfaces removed |
---|
31 | ! |
---|
32 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
33 | ! +qc |
---|
34 | ! |
---|
35 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
36 | ! averaging of nr, qr added |
---|
37 | ! |
---|
38 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
39 | ! code put under GPL (PALM 3.9) |
---|
40 | ! |
---|
41 | ! 978 2012-08-09 08:28:32Z fricke |
---|
42 | ! +z0h_av |
---|
43 | ! |
---|
44 | ! 771 2011-10-27 10:56:21Z heinze |
---|
45 | ! +lpt_av |
---|
46 | ! |
---|
47 | ! 667 2010-12-23 12:06:00Z suehring/gryschka |
---|
48 | ! nxl-1, nxr+1, nys-1, nyn+1 replaced by nxlg, nxrg, nysg, nyng |
---|
49 | ! |
---|
50 | ! 367 2009-08-25 08:35:52Z maronga |
---|
51 | ! Added calculation of shf* and qsws* |
---|
52 | ! |
---|
53 | ! 96 2007-06-04 08:07:41Z raasch |
---|
54 | ! Averaging of density and salinity |
---|
55 | ! |
---|
56 | ! 72 2007-03-19 08:20:46Z raasch |
---|
57 | ! Averaging the precipitation rate and roughness length (prr*, z0*) |
---|
58 | ! |
---|
59 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
60 | ! |
---|
61 | ! Revision 1.1 2006/02/23 09:48:58 raasch |
---|
62 | ! Initial revision |
---|
63 | ! |
---|
64 | ! |
---|
65 | ! Description: |
---|
66 | ! ------------ |
---|
67 | ! Time-averaging of 3d-data-arrays. |
---|
68 | !------------------------------------------------------------------------------! |
---|
69 | |
---|
70 | USE arrays_3d |
---|
71 | USE averaging |
---|
72 | USE cloud_parameters |
---|
73 | USE control_parameters |
---|
74 | USE cpulog |
---|
75 | USE indices |
---|
76 | |
---|
77 | IMPLICIT NONE |
---|
78 | |
---|
79 | INTEGER :: i, ii, j, k |
---|
80 | |
---|
81 | |
---|
82 | CALL cpu_log (log_point(35),'average_3d_data','start') |
---|
83 | |
---|
84 | ! |
---|
85 | !-- Check, if averaging is necessary |
---|
86 | IF ( average_count_3d <= 1 ) RETURN |
---|
87 | |
---|
88 | ! |
---|
89 | !-- Loop of all variables to be averaged. |
---|
90 | DO ii = 1, doav_n |
---|
91 | |
---|
92 | ! |
---|
93 | !-- Store the array chosen on the temporary array. |
---|
94 | SELECT CASE ( TRIM( doav(ii) ) ) |
---|
95 | |
---|
96 | CASE ( 'e' ) |
---|
97 | DO i = nxlg, nxrg |
---|
98 | DO j = nysg, nyng |
---|
99 | DO k = nzb, nzt+1 |
---|
100 | e_av(k,j,i) = e_av(k,j,i) / REAL( average_count_3d ) |
---|
101 | ENDDO |
---|
102 | ENDDO |
---|
103 | ENDDO |
---|
104 | |
---|
105 | CASE ( 'qsws*' ) |
---|
106 | DO i = nxlg, nxrg |
---|
107 | DO j = nysg, nyng |
---|
108 | qsws_av(j,i) = qsws_av(j,i) / REAL( average_count_3d ) |
---|
109 | ENDDO |
---|
110 | ENDDO |
---|
111 | |
---|
112 | CASE ( 'lpt' ) |
---|
113 | DO i = nxlg, nxrg |
---|
114 | DO j = nysg, nyng |
---|
115 | DO k = nzb, nzt+1 |
---|
116 | lpt_av(k,j,i) = lpt_av(k,j,i) / REAL( average_count_3d ) |
---|
117 | ENDDO |
---|
118 | ENDDO |
---|
119 | ENDDO |
---|
120 | |
---|
121 | CASE ( 'lwp*' ) |
---|
122 | DO i = nxlg, nxrg |
---|
123 | DO j = nysg, nyng |
---|
124 | lwp_av(j,i) = lwp_av(j,i) / REAL( average_count_3d ) |
---|
125 | ENDDO |
---|
126 | ENDDO |
---|
127 | |
---|
128 | CASE ( 'nr' ) |
---|
129 | DO i = nxlg, nxrg |
---|
130 | DO j = nysg, nyng |
---|
131 | DO k = nzb, nzt+1 |
---|
132 | nr_av(k,j,i) = nr_av(k,j,i) / REAL( average_count_3d ) |
---|
133 | ENDDO |
---|
134 | ENDDO |
---|
135 | ENDDO |
---|
136 | |
---|
137 | CASE ( 'p' ) |
---|
138 | DO i = nxlg, nxrg |
---|
139 | DO j = nysg, nyng |
---|
140 | DO k = nzb, nzt+1 |
---|
141 | p_av(k,j,i) = p_av(k,j,i) / REAL( average_count_3d ) |
---|
142 | ENDDO |
---|
143 | ENDDO |
---|
144 | ENDDO |
---|
145 | |
---|
146 | CASE ( 'pc' ) |
---|
147 | DO i = nxl, nxr |
---|
148 | DO j = nys, nyn |
---|
149 | DO k = nzb, nzt+1 |
---|
150 | pc_av(k,j,i) = pc_av(k,j,i) / REAL( average_count_3d ) |
---|
151 | ENDDO |
---|
152 | ENDDO |
---|
153 | ENDDO |
---|
154 | |
---|
155 | CASE ( 'pr' ) |
---|
156 | DO i = nxl, nxr |
---|
157 | DO j = nys, nyn |
---|
158 | DO k = nzb, nzt+1 |
---|
159 | pr_av(k,j,i) = pr_av(k,j,i) / REAL( average_count_3d ) |
---|
160 | ENDDO |
---|
161 | ENDDO |
---|
162 | ENDDO |
---|
163 | |
---|
164 | CASE ( 'prr*' ) |
---|
165 | DO i = nxlg, nxrg |
---|
166 | DO j = nysg, nyng |
---|
167 | precipitation_rate_av(j,i) = precipitation_rate_av(j,i) / & |
---|
168 | REAL( average_count_3d ) |
---|
169 | ENDDO |
---|
170 | ENDDO |
---|
171 | |
---|
172 | CASE ( 'pt' ) |
---|
173 | DO i = nxlg, nxrg |
---|
174 | DO j = nysg, nyng |
---|
175 | DO k = nzb, nzt+1 |
---|
176 | pt_av(k,j,i) = pt_av(k,j,i) / REAL( average_count_3d ) |
---|
177 | ENDDO |
---|
178 | ENDDO |
---|
179 | ENDDO |
---|
180 | |
---|
181 | CASE ( 'q' ) |
---|
182 | DO i = nxlg, nxrg |
---|
183 | DO j = nysg, nyng |
---|
184 | DO k = nzb, nzt+1 |
---|
185 | q_av(k,j,i) = q_av(k,j,i) / REAL( average_count_3d ) |
---|
186 | ENDDO |
---|
187 | ENDDO |
---|
188 | ENDDO |
---|
189 | |
---|
190 | CASE ( 'qc' ) |
---|
191 | DO i = nxlg, nxrg |
---|
192 | DO j = nysg, nyng |
---|
193 | DO k = nzb, nzt+1 |
---|
194 | qc_av(k,j,i) = qc_av(k,j,i) / REAL( average_count_3d ) |
---|
195 | ENDDO |
---|
196 | ENDDO |
---|
197 | ENDDO |
---|
198 | |
---|
199 | CASE ( 'ql' ) |
---|
200 | DO i = nxlg, nxrg |
---|
201 | DO j = nysg, nyng |
---|
202 | DO k = nzb, nzt+1 |
---|
203 | ql_av(k,j,i) = ql_av(k,j,i) / REAL( average_count_3d ) |
---|
204 | ENDDO |
---|
205 | ENDDO |
---|
206 | ENDDO |
---|
207 | |
---|
208 | CASE ( 'ql_c' ) |
---|
209 | DO i = nxlg, nxrg |
---|
210 | DO j = nysg, nyng |
---|
211 | DO k = nzb, nzt+1 |
---|
212 | ql_c_av(k,j,i) = ql_c_av(k,j,i) / REAL( average_count_3d ) |
---|
213 | ENDDO |
---|
214 | ENDDO |
---|
215 | ENDDO |
---|
216 | |
---|
217 | CASE ( 'ql_v' ) |
---|
218 | DO i = nxlg, nxrg |
---|
219 | DO j = nysg, nyng |
---|
220 | DO k = nzb, nzt+1 |
---|
221 | ql_v_av(k,j,i) = ql_v_av(k,j,i) / REAL( average_count_3d ) |
---|
222 | ENDDO |
---|
223 | ENDDO |
---|
224 | ENDDO |
---|
225 | |
---|
226 | CASE ( 'ql_vp' ) |
---|
227 | DO i = nxlg, nxrg |
---|
228 | DO j = nysg, nyng |
---|
229 | DO k = nzb, nzt+1 |
---|
230 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) / & |
---|
231 | REAL( average_count_3d ) |
---|
232 | ENDDO |
---|
233 | ENDDO |
---|
234 | ENDDO |
---|
235 | |
---|
236 | CASE ( 'qr' ) |
---|
237 | DO i = nxlg, nxrg |
---|
238 | DO j = nysg, nyng |
---|
239 | DO k = nzb, nzt+1 |
---|
240 | qr_av(k,j,i) = qr_av(k,j,i) / REAL( average_count_3d ) |
---|
241 | ENDDO |
---|
242 | ENDDO |
---|
243 | ENDDO |
---|
244 | |
---|
245 | CASE ( 'qv' ) |
---|
246 | DO i = nxlg, nxrg |
---|
247 | DO j = nysg, nyng |
---|
248 | DO k = nzb, nzt+1 |
---|
249 | qv_av(k,j,i) = qv_av(k,j,i) / REAL( average_count_3d ) |
---|
250 | ENDDO |
---|
251 | ENDDO |
---|
252 | ENDDO |
---|
253 | |
---|
254 | CASE ( 'rho' ) |
---|
255 | DO i = nxlg, nxrg |
---|
256 | DO j = nysg, nyng |
---|
257 | DO k = nzb, nzt+1 |
---|
258 | rho_av(k,j,i) = rho_av(k,j,i) / REAL( average_count_3d ) |
---|
259 | ENDDO |
---|
260 | ENDDO |
---|
261 | ENDDO |
---|
262 | |
---|
263 | CASE ( 's' ) |
---|
264 | DO i = nxlg, nxrg |
---|
265 | DO j = nysg, nyng |
---|
266 | DO k = nzb, nzt+1 |
---|
267 | s_av(k,j,i) = s_av(k,j,i) / REAL( average_count_3d ) |
---|
268 | ENDDO |
---|
269 | ENDDO |
---|
270 | ENDDO |
---|
271 | |
---|
272 | CASE ( 'sa' ) |
---|
273 | DO i = nxlg, nxrg |
---|
274 | DO j = nysg, nyng |
---|
275 | DO k = nzb, nzt+1 |
---|
276 | sa_av(k,j,i) = sa_av(k,j,i) / REAL( average_count_3d ) |
---|
277 | ENDDO |
---|
278 | ENDDO |
---|
279 | ENDDO |
---|
280 | |
---|
281 | CASE ( 'shf*' ) |
---|
282 | DO i = nxlg, nxrg |
---|
283 | DO j = nysg, nyng |
---|
284 | shf_av(j,i) = shf_av(j,i) / REAL( average_count_3d ) |
---|
285 | ENDDO |
---|
286 | ENDDO |
---|
287 | |
---|
288 | CASE ( 't*' ) |
---|
289 | DO i = nxlg, nxrg |
---|
290 | DO j = nysg, nyng |
---|
291 | ts_av(j,i) = ts_av(j,i) / REAL( average_count_3d ) |
---|
292 | ENDDO |
---|
293 | ENDDO |
---|
294 | |
---|
295 | CASE ( 'u' ) |
---|
296 | DO i = nxlg, nxrg |
---|
297 | DO j = nysg, nyng |
---|
298 | DO k = nzb, nzt+1 |
---|
299 | u_av(k,j,i) = u_av(k,j,i) / REAL( average_count_3d ) |
---|
300 | ENDDO |
---|
301 | ENDDO |
---|
302 | ENDDO |
---|
303 | |
---|
304 | CASE ( 'u*' ) |
---|
305 | DO i = nxlg, nxrg |
---|
306 | DO j = nysg, nyng |
---|
307 | us_av(j,i) = us_av(j,i) / REAL( average_count_3d ) |
---|
308 | ENDDO |
---|
309 | ENDDO |
---|
310 | |
---|
311 | CASE ( 'v' ) |
---|
312 | DO i = nxlg, nxrg |
---|
313 | DO j = nysg, nyng |
---|
314 | DO k = nzb, nzt+1 |
---|
315 | v_av(k,j,i) = v_av(k,j,i) / REAL( average_count_3d ) |
---|
316 | ENDDO |
---|
317 | ENDDO |
---|
318 | ENDDO |
---|
319 | |
---|
320 | CASE ( 'vpt' ) |
---|
321 | DO i = nxlg, nxrg |
---|
322 | DO j = nysg, nyng |
---|
323 | DO k = nzb, nzt+1 |
---|
324 | vpt_av(k,j,i) = vpt_av(k,j,i) / REAL( average_count_3d ) |
---|
325 | ENDDO |
---|
326 | ENDDO |
---|
327 | ENDDO |
---|
328 | |
---|
329 | CASE ( 'w' ) |
---|
330 | DO i = nxlg, nxrg |
---|
331 | DO j = nysg, nyng |
---|
332 | DO k = nzb, nzt+1 |
---|
333 | w_av(k,j,i) = w_av(k,j,i) / REAL( average_count_3d ) |
---|
334 | ENDDO |
---|
335 | ENDDO |
---|
336 | ENDDO |
---|
337 | |
---|
338 | CASE ( 'z0*' ) |
---|
339 | DO i = nxlg, nxrg |
---|
340 | DO j = nysg, nyng |
---|
341 | z0_av(j,i) = z0_av(j,i) / REAL( average_count_3d ) |
---|
342 | ENDDO |
---|
343 | ENDDO |
---|
344 | |
---|
345 | CASE ( 'z0h*' ) |
---|
346 | DO i = nxlg, nxrg |
---|
347 | DO j = nysg, nyng |
---|
348 | z0h_av(j,i) = z0h_av(j,i) / REAL( average_count_3d ) |
---|
349 | ENDDO |
---|
350 | ENDDO |
---|
351 | |
---|
352 | CASE DEFAULT |
---|
353 | ! |
---|
354 | !-- User-defined quantity |
---|
355 | CALL user_3d_data_averaging( 'average', doav(ii) ) |
---|
356 | |
---|
357 | END SELECT |
---|
358 | |
---|
359 | ENDDO |
---|
360 | |
---|
361 | ! |
---|
362 | !-- Reset the counter |
---|
363 | average_count_3d = 0.0 |
---|
364 | |
---|
365 | CALL cpu_log( log_point(35), 'average_3d_data', 'stop' ) |
---|
366 | |
---|
367 | |
---|
368 | END SUBROUTINE average_3d_data |
---|