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