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