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