1 | !> @file average_3d_data.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-2019 Leibniz Universitaet Hannover |
---|
18 | !------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: average_3d_data.f90 3933 2019-04-25 12:33:20Z gronemeier $ |
---|
27 | ! Bugfix in CASE theta_2m*, removal of redundant code |
---|
28 | ! |
---|
29 | ! 3773 2019-03-01 08:56:57Z maronga |
---|
30 | ! Added output of theta_2m*_xy_av |
---|
31 | ! |
---|
32 | ! 3655 2019-01-07 16:51:22Z knoop |
---|
33 | ! Implementation of the PALM module interface |
---|
34 | ! |
---|
35 | ! 3597 2018-12-04 08:40:18Z maronga |
---|
36 | ! Added theta_2m |
---|
37 | ! |
---|
38 | ! 3589 2018-11-30 15:09:51Z suehring |
---|
39 | ! Move the control parameter "salsa" from salsa_mod to control_parameters |
---|
40 | ! (M. Kurppa) |
---|
41 | ! |
---|
42 | ! 3582 2018-11-29 19:16:36Z suehring |
---|
43 | ! dom_dwd_user: |
---|
44 | ! Clean up biometeorology call |
---|
45 | ! |
---|
46 | ! 3525 2018-11-14 16:06:14Z kanani |
---|
47 | ! Changes related to clean-up of biometeorology (dom_dwd_user) |
---|
48 | ! |
---|
49 | ! 3467 2018-10-30 19:05:21Z suehring |
---|
50 | ! Implementation of a new aerosol module salsa. |
---|
51 | ! |
---|
52 | ! 3448 2018-10-29 18:14:31Z kanani |
---|
53 | ! Adjustment of biometeorology calls |
---|
54 | ! |
---|
55 | ! 3421 2018-10-24 18:39:32Z gronemeier |
---|
56 | ! Renamed output variables |
---|
57 | ! |
---|
58 | ! 3419 2018-10-24 17:27:31Z gronemeier |
---|
59 | ! (from resler branch) |
---|
60 | ! Add biometeorology output, |
---|
61 | ! fix for chemistry output, |
---|
62 | ! move of urban surface output |
---|
63 | ! |
---|
64 | ! 3294 2018-10-01 02:37:10Z raasch |
---|
65 | ! changes concerning modularization of ocean option |
---|
66 | ! |
---|
67 | ! 3274 2018-09-24 15:42:55Z knoop |
---|
68 | ! Modularization of all bulk cloud physics code components |
---|
69 | ! |
---|
70 | ! 3004 2018-04-27 12:33:25Z Giersch |
---|
71 | ! Further allocation checks implemented, case z0q* added |
---|
72 | ! |
---|
73 | ! 2885 2018-03-14 11:02:46Z Giersch |
---|
74 | ! Preliminary gust module interface implemented |
---|
75 | ! |
---|
76 | ! 2797 2018-02-08 13:24:35Z suehring |
---|
77 | ! Enable output of ground-heat flux also at urban surfaces. |
---|
78 | ! |
---|
79 | ! 2766 2018-01-22 17:17:47Z kanani |
---|
80 | ! Removed preprocessor directive __chem |
---|
81 | ! |
---|
82 | ! 2742 2018-01-12 14:59:47Z suehring |
---|
83 | ! Enable output of surface temperature |
---|
84 | ! |
---|
85 | ! 2735 2018-01-11 12:01:27Z suehring |
---|
86 | ! output of r_a moved from land-surface to consider also urban-type surfaces |
---|
87 | ! |
---|
88 | ! 2718 2018-01-02 08:49:38Z maronga |
---|
89 | ! Corrected "Former revisions" section |
---|
90 | ! |
---|
91 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
92 | ! Change in file header (GPL part) |
---|
93 | ! Implement call for turbulence_closure_mod (TG) |
---|
94 | ! Implementation of chemistry module (FK) |
---|
95 | ! |
---|
96 | ! 2292 2017-06-20 09:51:42Z schwenkel |
---|
97 | ! Implementation of new microphysic scheme: cloud_scheme = 'morrison' |
---|
98 | ! includes two more prognostic equations for cloud drop concentration (nc) |
---|
99 | ! and cloud water content (qc). |
---|
100 | ! |
---|
101 | ! 2233 2017-05-30 18:08:54Z suehring |
---|
102 | ! |
---|
103 | ! 2232 2017-05-30 17:47:52Z suehring |
---|
104 | ! Adjustments to new surface concept - additional ghost point exchange |
---|
105 | ! of surface variable required |
---|
106 | ! |
---|
107 | ! 2031 2016-10-21 15:11:58Z knoop |
---|
108 | ! renamed variable rho to rho_ocean and rho_av to rho_ocean_av |
---|
109 | ! |
---|
110 | ! 2011 2016-09-19 17:29:57Z kanani |
---|
111 | ! Flag urban_surface is now defined in module control_parameters, |
---|
112 | ! changed prefix for urban surface model output to "usm_", |
---|
113 | ! introduced control parameter varnamelength for LEN of trimvar. |
---|
114 | ! |
---|
115 | ! 2007 2016-08-24 15:47:17Z kanani |
---|
116 | ! Added support for new urban surface model (temporary modifications of |
---|
117 | ! SELECT CASE ( ) necessary, see variable trimvar), |
---|
118 | ! added comments in variable declaration section |
---|
119 | ! |
---|
120 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
121 | ! Forced header and separation lines into 80 columns |
---|
122 | ! |
---|
123 | ! 1972 2016-07-26 07:52:02Z maronga |
---|
124 | ! Output of land surface quantities is now done directly in the respective module |
---|
125 | ! |
---|
126 | ! 1960 2016-07-12 16:34:24Z suehring |
---|
127 | ! Treat humidity and passive scalar separately |
---|
128 | ! |
---|
129 | ! 1691 2015-10-26 16:17:44Z maronga |
---|
130 | ! Added output of Obukhov length and radiative heating rates for RRTMG. |
---|
131 | ! |
---|
132 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
133 | ! Code annotations made doxygen readable |
---|
134 | ! |
---|
135 | ! 1585 2015-04-30 07:05:52Z maronga |
---|
136 | ! Adapted for RRTMG |
---|
137 | ! |
---|
138 | ! 1555 2015-03-04 17:44:27Z maronga |
---|
139 | ! Added output of r_a and r_s |
---|
140 | ! |
---|
141 | ! 1551 2015-03-03 14:18:16Z maronga |
---|
142 | ! Added support for land surface and radiation model parameters. |
---|
143 | ! |
---|
144 | ! 1322 2014-03-20 16:38:49Z raasch |
---|
145 | ! REAL functions provided with KIND-attribute |
---|
146 | ! |
---|
147 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
148 | ! ONLY-attribute added to USE-statements, |
---|
149 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
150 | ! kinds are defined in new module kinds, |
---|
151 | ! revision history before 2012 removed, |
---|
152 | ! comment fields (!:) to be used for variable explanations added to |
---|
153 | ! all variable declaration statements |
---|
154 | ! |
---|
155 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
156 | ! barrier argument removed from cpu_log, |
---|
157 | ! module interfaces removed |
---|
158 | ! |
---|
159 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
160 | ! +qc |
---|
161 | ! |
---|
162 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
163 | ! averaging of nr, qr added |
---|
164 | ! |
---|
165 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
166 | ! code put under GPL (PALM 3.9) |
---|
167 | ! |
---|
168 | ! 978 2012-08-09 08:28:32Z fricke |
---|
169 | ! +z0h_av |
---|
170 | ! |
---|
171 | ! Revision 1.1 2006/02/23 09:48:58 raasch |
---|
172 | ! Initial revision |
---|
173 | ! |
---|
174 | ! |
---|
175 | ! Description: |
---|
176 | ! ------------ |
---|
177 | !> Time-averaging of 3d-data-arrays. |
---|
178 | !------------------------------------------------------------------------------! |
---|
179 | SUBROUTINE average_3d_data |
---|
180 | |
---|
181 | |
---|
182 | USE averaging |
---|
183 | |
---|
184 | USE control_parameters, & |
---|
185 | ONLY: average_count_3d, doav, doav_n, varnamelength |
---|
186 | |
---|
187 | USE cpulog, & |
---|
188 | ONLY: cpu_log, log_point |
---|
189 | |
---|
190 | USE indices, & |
---|
191 | ONLY: nbgp, nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt |
---|
192 | |
---|
193 | USE kinds |
---|
194 | |
---|
195 | USE module_interface, & |
---|
196 | ONLY: module_interface_3d_data_averaging |
---|
197 | |
---|
198 | USE turbulence_closure_mod, & |
---|
199 | ONLY: tcm_3d_data_averaging |
---|
200 | |
---|
201 | |
---|
202 | |
---|
203 | |
---|
204 | IMPLICIT NONE |
---|
205 | |
---|
206 | INTEGER(iwp) :: i !< loop index |
---|
207 | INTEGER(iwp) :: ii !< loop index |
---|
208 | INTEGER(iwp) :: j !< loop index |
---|
209 | INTEGER(iwp) :: k !< loop index |
---|
210 | |
---|
211 | CHARACTER (LEN=varnamelength) :: trimvar !< TRIM of output-variable string |
---|
212 | |
---|
213 | |
---|
214 | CALL cpu_log (log_point(35),'average_3d_data','start') |
---|
215 | |
---|
216 | ! |
---|
217 | !-- Check, if averaging is necessary |
---|
218 | IF ( average_count_3d <= 1 ) RETURN |
---|
219 | |
---|
220 | ! |
---|
221 | !-- Loop of all variables to be averaged. |
---|
222 | DO ii = 1, doav_n |
---|
223 | |
---|
224 | trimvar = TRIM( doav(ii) ) |
---|
225 | |
---|
226 | ! |
---|
227 | !-- Store the array chosen on the temporary array. |
---|
228 | SELECT CASE ( trimvar ) |
---|
229 | |
---|
230 | CASE ( 'e' ) |
---|
231 | IF ( ALLOCATED( e_av ) ) THEN |
---|
232 | DO i = nxlg, nxrg |
---|
233 | DO j = nysg, nyng |
---|
234 | DO k = nzb, nzt+1 |
---|
235 | e_av(k,j,i) = e_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
236 | ENDDO |
---|
237 | ENDDO |
---|
238 | ENDDO |
---|
239 | ENDIF |
---|
240 | |
---|
241 | CASE ( 'ghf*' ) |
---|
242 | IF ( ALLOCATED( ghf_av ) ) THEN |
---|
243 | DO i = nxl, nxr |
---|
244 | DO j = nys, nyn |
---|
245 | ghf_av(j,i) = ghf_av(j,i) & |
---|
246 | / REAL( average_count_3d, KIND=wp ) |
---|
247 | ENDDO |
---|
248 | ENDDO |
---|
249 | CALL exchange_horiz_2d( ghf_av, nbgp ) |
---|
250 | ENDIF |
---|
251 | |
---|
252 | CASE ( 'qsws*' ) |
---|
253 | IF ( ALLOCATED( qsws_av ) ) THEN |
---|
254 | DO i = nxlg, nxrg |
---|
255 | DO j = nysg, nyng |
---|
256 | qsws_av(j,i) = qsws_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
257 | ENDDO |
---|
258 | ENDDO |
---|
259 | CALL exchange_horiz_2d( qsws_av, nbgp ) |
---|
260 | ENDIF |
---|
261 | |
---|
262 | CASE ( 'thetal' ) |
---|
263 | IF ( ALLOCATED( lpt_av ) ) THEN |
---|
264 | DO i = nxlg, nxrg |
---|
265 | DO j = nysg, nyng |
---|
266 | DO k = nzb, nzt+1 |
---|
267 | lpt_av(k,j,i) = lpt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
268 | ENDDO |
---|
269 | ENDDO |
---|
270 | ENDDO |
---|
271 | ENDIF |
---|
272 | |
---|
273 | CASE ( 'lwp*' ) |
---|
274 | IF ( ALLOCATED( lwp_av ) ) THEN |
---|
275 | DO i = nxlg, nxrg |
---|
276 | DO j = nysg, nyng |
---|
277 | lwp_av(j,i) = lwp_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
278 | ENDDO |
---|
279 | ENDDO |
---|
280 | ENDIF |
---|
281 | |
---|
282 | CASE ( 'ol*' ) |
---|
283 | IF ( ALLOCATED( ol_av ) ) THEN |
---|
284 | DO i = nxlg, nxrg |
---|
285 | DO j = nysg, nyng |
---|
286 | ol_av(j,i) = ol_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
287 | ENDDO |
---|
288 | ENDDO |
---|
289 | CALL exchange_horiz_2d( ol_av, nbgp ) |
---|
290 | ENDIF |
---|
291 | |
---|
292 | CASE ( 'p' ) |
---|
293 | IF ( ALLOCATED( p_av ) ) THEN |
---|
294 | DO i = nxlg, nxrg |
---|
295 | DO j = nysg, nyng |
---|
296 | DO k = nzb, nzt+1 |
---|
297 | p_av(k,j,i) = p_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
298 | ENDDO |
---|
299 | ENDDO |
---|
300 | ENDDO |
---|
301 | ENDIF |
---|
302 | |
---|
303 | CASE ( 'pc' ) |
---|
304 | IF ( ALLOCATED( pc_av ) ) THEN |
---|
305 | DO i = nxl, nxr |
---|
306 | DO j = nys, nyn |
---|
307 | DO k = nzb, nzt+1 |
---|
308 | pc_av(k,j,i) = pc_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
309 | ENDDO |
---|
310 | ENDDO |
---|
311 | ENDDO |
---|
312 | ENDIF |
---|
313 | |
---|
314 | CASE ( 'pr' ) |
---|
315 | IF ( ALLOCATED( pr_av ) ) THEN |
---|
316 | DO i = nxl, nxr |
---|
317 | DO j = nys, nyn |
---|
318 | DO k = nzb, nzt+1 |
---|
319 | pr_av(k,j,i) = pr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
320 | ENDDO |
---|
321 | ENDDO |
---|
322 | ENDDO |
---|
323 | ENDIF |
---|
324 | |
---|
325 | CASE ( 'theta' ) |
---|
326 | IF ( ALLOCATED( pt_av ) ) THEN |
---|
327 | DO i = nxlg, nxrg |
---|
328 | DO j = nysg, nyng |
---|
329 | DO k = nzb, nzt+1 |
---|
330 | pt_av(k,j,i) = pt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
331 | ENDDO |
---|
332 | ENDDO |
---|
333 | ENDDO |
---|
334 | ENDIF |
---|
335 | |
---|
336 | CASE ( 'q' ) |
---|
337 | IF ( ALLOCATED( q_av ) ) THEN |
---|
338 | DO i = nxlg, nxrg |
---|
339 | DO j = nysg, nyng |
---|
340 | DO k = nzb, nzt+1 |
---|
341 | q_av(k,j,i) = q_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
342 | ENDDO |
---|
343 | ENDDO |
---|
344 | ENDDO |
---|
345 | ENDIF |
---|
346 | |
---|
347 | CASE ( 'ql' ) |
---|
348 | IF ( ALLOCATED( ql_av ) ) THEN |
---|
349 | DO i = nxlg, nxrg |
---|
350 | DO j = nysg, nyng |
---|
351 | DO k = nzb, nzt+1 |
---|
352 | ql_av(k,j,i) = ql_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
353 | ENDDO |
---|
354 | ENDDO |
---|
355 | ENDDO |
---|
356 | ENDIF |
---|
357 | |
---|
358 | CASE ( 'ql_c' ) |
---|
359 | IF ( ALLOCATED( ql_c_av ) ) THEN |
---|
360 | DO i = nxlg, nxrg |
---|
361 | DO j = nysg, nyng |
---|
362 | DO k = nzb, nzt+1 |
---|
363 | ql_c_av(k,j,i) = ql_c_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
364 | ENDDO |
---|
365 | ENDDO |
---|
366 | ENDDO |
---|
367 | ENDIF |
---|
368 | |
---|
369 | CASE ( 'ql_v' ) |
---|
370 | IF ( ALLOCATED( ql_v_av ) ) THEN |
---|
371 | DO i = nxlg, nxrg |
---|
372 | DO j = nysg, nyng |
---|
373 | DO k = nzb, nzt+1 |
---|
374 | ql_v_av(k,j,i) = ql_v_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
375 | ENDDO |
---|
376 | ENDDO |
---|
377 | ENDDO |
---|
378 | ENDIF |
---|
379 | |
---|
380 | CASE ( 'ql_vp' ) |
---|
381 | IF ( ALLOCATED( ql_vp_av ) ) THEN |
---|
382 | DO i = nxlg, nxrg |
---|
383 | DO j = nysg, nyng |
---|
384 | DO k = nzb, nzt+1 |
---|
385 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) / & |
---|
386 | REAL( average_count_3d, KIND=wp ) |
---|
387 | ENDDO |
---|
388 | ENDDO |
---|
389 | ENDDO |
---|
390 | ENDIF |
---|
391 | |
---|
392 | CASE ( 'qv' ) |
---|
393 | IF ( ALLOCATED( qv_av ) ) THEN |
---|
394 | DO i = nxlg, nxrg |
---|
395 | DO j = nysg, nyng |
---|
396 | DO k = nzb, nzt+1 |
---|
397 | qv_av(k,j,i) = qv_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
398 | ENDDO |
---|
399 | ENDDO |
---|
400 | ENDDO |
---|
401 | ENDIF |
---|
402 | |
---|
403 | CASE ( 'r_a*' ) |
---|
404 | IF ( ALLOCATED( r_a_av ) ) THEN |
---|
405 | DO i = nxlg, nxrg |
---|
406 | DO j = nysg, nyng |
---|
407 | r_a_av(j,i) = r_a_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
408 | ENDDO |
---|
409 | ENDDO |
---|
410 | CALL exchange_horiz_2d( r_a_av, nbgp ) |
---|
411 | ENDIF |
---|
412 | |
---|
413 | CASE ( 's' ) |
---|
414 | IF ( ALLOCATED( s_av ) ) THEN |
---|
415 | DO i = nxlg, nxrg |
---|
416 | DO j = nysg, nyng |
---|
417 | DO k = nzb, nzt+1 |
---|
418 | s_av(k,j,i) = s_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
419 | ENDDO |
---|
420 | ENDDO |
---|
421 | ENDDO |
---|
422 | ENDIF |
---|
423 | |
---|
424 | CASE ( 'shf*' ) |
---|
425 | IF ( ALLOCATED( shf_av ) ) THEN |
---|
426 | DO i = nxlg, nxrg |
---|
427 | DO j = nysg, nyng |
---|
428 | shf_av(j,i) = shf_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
429 | ENDDO |
---|
430 | ENDDO |
---|
431 | CALL exchange_horiz_2d( shf_av, nbgp ) |
---|
432 | ENDIF |
---|
433 | |
---|
434 | CASE ( 'ssws*' ) |
---|
435 | IF ( ALLOCATED( ssws_av ) ) THEN |
---|
436 | DO i = nxlg, nxrg |
---|
437 | DO j = nysg, nyng |
---|
438 | ssws_av(j,i) = ssws_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
439 | ENDDO |
---|
440 | ENDDO |
---|
441 | CALL exchange_horiz_2d( ssws_av, nbgp ) |
---|
442 | ENDIF |
---|
443 | |
---|
444 | CASE ( 'theta_2m*' ) |
---|
445 | IF ( ALLOCATED( pt_2m_av ) ) THEN |
---|
446 | DO i = nxlg, nxrg |
---|
447 | DO j = nysg, nyng |
---|
448 | pt_2m_av(j,i) = pt_2m_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
449 | ENDDO |
---|
450 | ENDDO |
---|
451 | CALL exchange_horiz_2d( pt_2m_av, nbgp ) |
---|
452 | ENDIF |
---|
453 | |
---|
454 | CASE ( 't*' ) |
---|
455 | IF ( ALLOCATED( ts_av ) ) THEN |
---|
456 | DO i = nxlg, nxrg |
---|
457 | DO j = nysg, nyng |
---|
458 | ts_av(j,i) = ts_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
459 | ENDDO |
---|
460 | ENDDO |
---|
461 | CALL exchange_horiz_2d( ts_av, nbgp ) |
---|
462 | ENDIF |
---|
463 | |
---|
464 | CASE ( 'tsurf*' ) |
---|
465 | IF ( ALLOCATED( tsurf_av ) ) THEN |
---|
466 | DO i = nxlg, nxrg |
---|
467 | DO j = nysg, nyng |
---|
468 | tsurf_av(j,i) = tsurf_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
469 | ENDDO |
---|
470 | ENDDO |
---|
471 | CALL exchange_horiz_2d( tsurf_av, nbgp ) |
---|
472 | ENDIF |
---|
473 | |
---|
474 | CASE ( 'u' ) |
---|
475 | IF ( ALLOCATED( u_av ) ) THEN |
---|
476 | DO i = nxlg, nxrg |
---|
477 | DO j = nysg, nyng |
---|
478 | DO k = nzb, nzt+1 |
---|
479 | u_av(k,j,i) = u_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
480 | ENDDO |
---|
481 | ENDDO |
---|
482 | ENDDO |
---|
483 | ENDIF |
---|
484 | |
---|
485 | CASE ( 'us*' ) |
---|
486 | IF ( ALLOCATED( us_av ) ) THEN |
---|
487 | DO i = nxlg, nxrg |
---|
488 | DO j = nysg, nyng |
---|
489 | us_av(j,i) = us_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
490 | ENDDO |
---|
491 | ENDDO |
---|
492 | CALL exchange_horiz_2d( us_av, nbgp ) |
---|
493 | ENDIF |
---|
494 | |
---|
495 | CASE ( 'v' ) |
---|
496 | IF ( ALLOCATED( v_av ) ) THEN |
---|
497 | DO i = nxlg, nxrg |
---|
498 | DO j = nysg, nyng |
---|
499 | DO k = nzb, nzt+1 |
---|
500 | v_av(k,j,i) = v_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
501 | ENDDO |
---|
502 | ENDDO |
---|
503 | ENDDO |
---|
504 | ENDIF |
---|
505 | |
---|
506 | CASE ( 'thetav' ) |
---|
507 | IF ( ALLOCATED( vpt_av ) ) THEN |
---|
508 | DO i = nxlg, nxrg |
---|
509 | DO j = nysg, nyng |
---|
510 | DO k = nzb, nzt+1 |
---|
511 | vpt_av(k,j,i) = vpt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
512 | ENDDO |
---|
513 | ENDDO |
---|
514 | ENDDO |
---|
515 | ENDIF |
---|
516 | |
---|
517 | CASE ( 'w' ) |
---|
518 | IF ( ALLOCATED( w_av ) ) THEN |
---|
519 | DO i = nxlg, nxrg |
---|
520 | DO j = nysg, nyng |
---|
521 | DO k = nzb, nzt+1 |
---|
522 | w_av(k,j,i) = w_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
523 | ENDDO |
---|
524 | ENDDO |
---|
525 | ENDDO |
---|
526 | ENDIF |
---|
527 | |
---|
528 | CASE ( 'z0*' ) |
---|
529 | IF ( ALLOCATED( z0_av ) ) THEN |
---|
530 | DO i = nxlg, nxrg |
---|
531 | DO j = nysg, nyng |
---|
532 | z0_av(j,i) = z0_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
533 | ENDDO |
---|
534 | ENDDO |
---|
535 | CALL exchange_horiz_2d( z0_av, nbgp ) |
---|
536 | ENDIF |
---|
537 | |
---|
538 | CASE ( 'z0h*' ) |
---|
539 | IF ( ALLOCATED( z0h_av ) ) THEN |
---|
540 | DO i = nxlg, nxrg |
---|
541 | DO j = nysg, nyng |
---|
542 | z0h_av(j,i) = z0h_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
543 | ENDDO |
---|
544 | ENDDO |
---|
545 | CALL exchange_horiz_2d( z0h_av, nbgp ) |
---|
546 | ENDIF |
---|
547 | |
---|
548 | CASE ( 'z0q*' ) |
---|
549 | IF ( ALLOCATED( z0q_av ) ) THEN |
---|
550 | DO i = nxlg, nxrg |
---|
551 | DO j = nysg, nyng |
---|
552 | z0q_av(j,i) = z0q_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
553 | ENDDO |
---|
554 | ENDDO |
---|
555 | CALL exchange_horiz_2d( z0q_av, nbgp ) |
---|
556 | ENDIF |
---|
557 | |
---|
558 | CASE DEFAULT |
---|
559 | |
---|
560 | ! |
---|
561 | !-- Averaging of data from turbulence closure module |
---|
562 | CALL tcm_3d_data_averaging( 'average', trimvar ) |
---|
563 | ! |
---|
564 | !-- Averaging of data from all other modules |
---|
565 | CALL module_interface_3d_data_averaging( 'average', trimvar ) |
---|
566 | |
---|
567 | END SELECT |
---|
568 | |
---|
569 | ENDDO |
---|
570 | |
---|
571 | ! |
---|
572 | !-- Reset the counter |
---|
573 | average_count_3d = 0.0 |
---|
574 | |
---|
575 | CALL cpu_log( log_point(35), 'average_3d_data', 'stop' ) |
---|
576 | |
---|
577 | |
---|
578 | END SUBROUTINE average_3d_data |
---|