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