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