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