1 | !> @file sum_up_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: sum_up_3d_data.f90 2718 2018-01-02 08:49:38Z maronga $ |
---|
27 | ! Corrected "Former revisions" section |
---|
28 | ! |
---|
29 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
30 | ! - Change in file header (GPL part) |
---|
31 | ! - Implementation of uv exposure model (FK) |
---|
32 | ! - output of diss_av, kh_av, km_av (turbulence_closure_mod) (TG) |
---|
33 | ! - Implementation of chemistry module (FK) |
---|
34 | ! - Workaround for sum-up usm arrays in case of restart runs, to avoid program |
---|
35 | ! crash (MS) |
---|
36 | ! |
---|
37 | ! 2292 2017-06-20 09:51:42Z schwenkel |
---|
38 | ! Implementation of new microphysic scheme: cloud_scheme = 'morrison' |
---|
39 | ! includes two more prognostic equations for cloud drop concentration (nc) |
---|
40 | ! and cloud water content (qc). |
---|
41 | ! |
---|
42 | ! 2233 2017-05-30 18:08:54Z suehring |
---|
43 | ! |
---|
44 | ! 2232 2017-05-30 17:47:52Z suehring |
---|
45 | ! Adjustments to new surface concept |
---|
46 | ! |
---|
47 | ! 2031 2016-10-21 15:11:58Z knoop |
---|
48 | ! renamed variable rho to rho_ocean and rho_av to rho_ocean_av |
---|
49 | ! |
---|
50 | ! 2024 2016-10-12 16:42:37Z kanani |
---|
51 | ! Added missing CASE for ssws* |
---|
52 | ! |
---|
53 | ! 2011 2016-09-19 17:29:57Z kanani |
---|
54 | ! Flag urban_surface is now defined in module control_parameters, |
---|
55 | ! changed prefix for urban surface model output to "usm_", |
---|
56 | ! introduced control parameter varnamelength for LEN of trimvar. |
---|
57 | ! |
---|
58 | ! 2007 2016-08-24 15:47:17Z kanani |
---|
59 | ! Added support for new urban surface model (temporary modifications of |
---|
60 | ! SELECT CASE ( ) necessary, see variable trimvar), |
---|
61 | ! added comments in variable declaration section |
---|
62 | ! |
---|
63 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
64 | ! Forced header and separation lines into 80 columns |
---|
65 | ! |
---|
66 | ! 1992 2016-08-12 15:14:59Z suehring |
---|
67 | ! Bugfix in summation of passive scalar |
---|
68 | ! |
---|
69 | ! 1976 2016-07-27 13:28:04Z maronga |
---|
70 | ! Radiation actions are now done directly in the respective module |
---|
71 | ! |
---|
72 | ! 1972 2016-07-26 07:52:02Z maronga |
---|
73 | ! Land surface actions are now done directly in the respective module |
---|
74 | ! |
---|
75 | ! 1960 2016-07-12 16:34:24Z suehring |
---|
76 | ! Scalar surface flux added |
---|
77 | ! |
---|
78 | ! 1949 2016-06-17 07:19:16Z maronga |
---|
79 | ! Bugfix: calculation of lai_av, c_veg_av and c_liq_av. |
---|
80 | ! |
---|
81 | ! 1849 2016-04-08 11:33:18Z hoffmann |
---|
82 | ! precipitation_rate moved to arrays_3d |
---|
83 | ! |
---|
84 | ! 1788 2016-03-10 11:01:04Z maronga |
---|
85 | ! Added z0q and z0q_av |
---|
86 | ! |
---|
87 | ! 1693 2015-10-27 08:35:45Z maronga |
---|
88 | ! Last revision text corrected |
---|
89 | ! |
---|
90 | ! 1691 2015-10-26 16:17:44Z maronga |
---|
91 | ! Added output of Obukhov length and radiative heating rates for RRTMG. |
---|
92 | ! Corrected output of liquid water path. |
---|
93 | ! |
---|
94 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
95 | ! Code annotations made doxygen readable |
---|
96 | ! |
---|
97 | ! 1585 2015-04-30 07:05:52Z maronga |
---|
98 | ! Adapted for RRTMG |
---|
99 | ! |
---|
100 | ! 1555 2015-03-04 17:44:27Z maronga |
---|
101 | ! Added output of r_a and r_s |
---|
102 | ! |
---|
103 | ! 1551 2015-03-03 14:18:16Z maronga |
---|
104 | ! Added support for land surface model and radiation model data. |
---|
105 | ! |
---|
106 | ! 1359 2014-04-11 17:15:14Z hoffmann |
---|
107 | ! New particle structure integrated. |
---|
108 | ! |
---|
109 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
110 | ! REAL constants provided with KIND-attribute |
---|
111 | ! |
---|
112 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
113 | ! ONLY-attribute added to USE-statements, |
---|
114 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
115 | ! kinds are defined in new module kinds, |
---|
116 | ! old module precision_kind is removed, |
---|
117 | ! revision history before 2012 removed, |
---|
118 | ! comment fields (!:) to be used for variable explanations added to |
---|
119 | ! all variable declaration statements |
---|
120 | ! |
---|
121 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
122 | ! barrier argument removed from cpu_log, |
---|
123 | ! module interfaces removed |
---|
124 | ! |
---|
125 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
126 | ! ql is calculated by calc_liquid_water_content |
---|
127 | ! |
---|
128 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
129 | ! +nr, prr, qr |
---|
130 | ! |
---|
131 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
132 | ! code put under GPL (PALM 3.9) |
---|
133 | ! |
---|
134 | ! 1007 2012-09-19 14:30:36Z franke |
---|
135 | ! Bugfix in calculation of ql_vp |
---|
136 | ! |
---|
137 | ! 978 2012-08-09 08:28:32Z fricke |
---|
138 | ! +z0h* |
---|
139 | ! |
---|
140 | ! Revision 1.1 2006/02/23 12:55:23 raasch |
---|
141 | ! Initial revision |
---|
142 | ! |
---|
143 | ! |
---|
144 | ! Description: |
---|
145 | ! ------------ |
---|
146 | !> Sum-up the values of 3d-arrays. The real averaging is later done in routine |
---|
147 | !> average_3d_data. |
---|
148 | !------------------------------------------------------------------------------! |
---|
149 | SUBROUTINE sum_up_3d_data |
---|
150 | |
---|
151 | |
---|
152 | USE arrays_3d, & |
---|
153 | ONLY: dzw, e, nc, nr, p, pt, precipitation_rate, q, qc, ql, ql_c, & |
---|
154 | ql_v, qr, rho_ocean, s, sa, u, v, vpt, w |
---|
155 | |
---|
156 | USE averaging, & |
---|
157 | ONLY: diss_av, e_av, kh_av, km_av, lpt_av, lwp_av, nc_av, nr_av, & |
---|
158 | ol_av, p_av, pc_av, pr_av, prr_av, precipitation_rate_av, pt_av,& |
---|
159 | q_av, qc_av, ql_av, ql_c_av, ql_v_av, ql_vp_av, qr_av, qsws_av, & |
---|
160 | qv_av, rho_ocean_av, s_av, sa_av, shf_av, ssws_av, ts_av, u_av, & |
---|
161 | us_av, v_av, vpt_av, w_av, z0_av, z0h_av, z0q_av |
---|
162 | #if defined( __chem ) |
---|
163 | USE chemistry_model_mod, & |
---|
164 | ONLY: chem_3d_data_averaging, chem_integrate, chem_species, nspec |
---|
165 | #endif |
---|
166 | |
---|
167 | USE cloud_parameters, & |
---|
168 | ONLY: l_d_cp, pt_d_t |
---|
169 | |
---|
170 | USE control_parameters, & |
---|
171 | ONLY: air_chemistry, average_count_3d, cloud_physics, doav, doav_n, & |
---|
172 | land_surface, rho_surface, urban_surface, uv_exposure, & |
---|
173 | varnamelength |
---|
174 | |
---|
175 | USE cpulog, & |
---|
176 | ONLY: cpu_log, log_point |
---|
177 | |
---|
178 | USE indices, & |
---|
179 | ONLY: nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt |
---|
180 | |
---|
181 | USE kinds |
---|
182 | |
---|
183 | USE land_surface_model_mod, & |
---|
184 | ONLY: lsm_3d_data_averaging |
---|
185 | |
---|
186 | USE particle_attributes, & |
---|
187 | ONLY: grid_particles, number_of_particles, particles, prt_count |
---|
188 | |
---|
189 | USE radiation_model_mod, & |
---|
190 | ONLY: radiation, radiation_3d_data_averaging |
---|
191 | |
---|
192 | USE surface_mod, & |
---|
193 | ONLY: surf_def_h, surf_lsm_h, surf_usm_h |
---|
194 | |
---|
195 | USE turbulence_closure_mod, & |
---|
196 | ONLY: tcm_3d_data_averaging |
---|
197 | |
---|
198 | USE urban_surface_mod, & |
---|
199 | ONLY: usm_average_3d_data |
---|
200 | |
---|
201 | USE uv_exposure_model_mod, & |
---|
202 | ONLY: uvem_3d_data_averaging |
---|
203 | |
---|
204 | |
---|
205 | IMPLICIT NONE |
---|
206 | |
---|
207 | INTEGER(iwp) :: i !< grid index x direction |
---|
208 | INTEGER(iwp) :: ii !< running index |
---|
209 | INTEGER(iwp) :: j !< grid index y direction |
---|
210 | INTEGER(iwp) :: k !< grid index x direction |
---|
211 | INTEGER(iwp) :: m !< running index surface type |
---|
212 | INTEGER(iwp) :: n !< |
---|
213 | |
---|
214 | REAL(wp) :: mean_r !< |
---|
215 | REAL(wp) :: s_r2 !< |
---|
216 | REAL(wp) :: s_r3 !< |
---|
217 | |
---|
218 | CHARACTER (LEN=varnamelength) :: trimvar !< TRIM of output-variable string |
---|
219 | |
---|
220 | |
---|
221 | CALL cpu_log (log_point(34),'sum_up_3d_data','start') |
---|
222 | |
---|
223 | ! |
---|
224 | !-- Allocate and initialize the summation arrays if called for the very first |
---|
225 | !-- time or the first time after average_3d_data has been called |
---|
226 | !-- (some or all of the arrays may have been already allocated |
---|
227 | !-- in read_3d_binary) |
---|
228 | IF ( average_count_3d == 0 ) THEN |
---|
229 | |
---|
230 | DO ii = 1, doav_n |
---|
231 | ! |
---|
232 | !-- Temporary solution to account for data output within the new urban |
---|
233 | !-- surface model (urban_surface_mod.f90), see also SELECT CASE ( trimvar ) |
---|
234 | trimvar = TRIM( doav(ii) ) |
---|
235 | IF ( urban_surface .AND. trimvar(1:4) == 'usm_' ) THEN |
---|
236 | trimvar = 'usm_output' |
---|
237 | ENDIF |
---|
238 | |
---|
239 | SELECT CASE ( trimvar ) |
---|
240 | |
---|
241 | CASE ( 'e' ) |
---|
242 | IF ( .NOT. ALLOCATED( e_av ) ) THEN |
---|
243 | ALLOCATE( e_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
244 | ENDIF |
---|
245 | e_av = 0.0_wp |
---|
246 | |
---|
247 | CASE ( 'lpt' ) |
---|
248 | IF ( .NOT. ALLOCATED( lpt_av ) ) THEN |
---|
249 | ALLOCATE( lpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
250 | ENDIF |
---|
251 | lpt_av = 0.0_wp |
---|
252 | |
---|
253 | CASE ( 'lwp*' ) |
---|
254 | IF ( .NOT. ALLOCATED( lwp_av ) ) THEN |
---|
255 | ALLOCATE( lwp_av(nysg:nyng,nxlg:nxrg) ) |
---|
256 | ENDIF |
---|
257 | lwp_av = 0.0_wp |
---|
258 | |
---|
259 | CASE ( 'nc' ) |
---|
260 | IF ( .NOT. ALLOCATED( nc_av ) ) THEN |
---|
261 | ALLOCATE( nc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
262 | ENDIF |
---|
263 | nc_av = 0.0_wp |
---|
264 | |
---|
265 | CASE ( 'nr' ) |
---|
266 | IF ( .NOT. ALLOCATED( nr_av ) ) THEN |
---|
267 | ALLOCATE( nr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
268 | ENDIF |
---|
269 | nr_av = 0.0_wp |
---|
270 | |
---|
271 | CASE ( 'ol*' ) |
---|
272 | IF ( .NOT. ALLOCATED( ol_av ) ) THEN |
---|
273 | ALLOCATE( ol_av(nysg:nyng,nxlg:nxrg) ) |
---|
274 | ENDIF |
---|
275 | ol_av = 0.0_wp |
---|
276 | |
---|
277 | CASE ( 'p' ) |
---|
278 | IF ( .NOT. ALLOCATED( p_av ) ) THEN |
---|
279 | ALLOCATE( p_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
280 | ENDIF |
---|
281 | p_av = 0.0_wp |
---|
282 | |
---|
283 | CASE ( 'pc' ) |
---|
284 | IF ( .NOT. ALLOCATED( pc_av ) ) THEN |
---|
285 | ALLOCATE( pc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
286 | ENDIF |
---|
287 | pc_av = 0.0_wp |
---|
288 | |
---|
289 | CASE ( 'pr' ) |
---|
290 | IF ( .NOT. ALLOCATED( pr_av ) ) THEN |
---|
291 | ALLOCATE( pr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
292 | ENDIF |
---|
293 | pr_av = 0.0_wp |
---|
294 | |
---|
295 | CASE ( 'prr' ) |
---|
296 | IF ( .NOT. ALLOCATED( prr_av ) ) THEN |
---|
297 | ALLOCATE( prr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
298 | ENDIF |
---|
299 | prr_av = 0.0_wp |
---|
300 | |
---|
301 | CASE ( 'prr*' ) |
---|
302 | IF ( .NOT. ALLOCATED( precipitation_rate_av ) ) THEN |
---|
303 | ALLOCATE( precipitation_rate_av(nysg:nyng,nxlg:nxrg) ) |
---|
304 | ENDIF |
---|
305 | precipitation_rate_av = 0.0_wp |
---|
306 | |
---|
307 | CASE ( 'pt' ) |
---|
308 | IF ( .NOT. ALLOCATED( pt_av ) ) THEN |
---|
309 | ALLOCATE( pt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
310 | ENDIF |
---|
311 | pt_av = 0.0_wp |
---|
312 | |
---|
313 | CASE ( 'q' ) |
---|
314 | IF ( .NOT. ALLOCATED( q_av ) ) THEN |
---|
315 | ALLOCATE( q_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
316 | ENDIF |
---|
317 | q_av = 0.0_wp |
---|
318 | |
---|
319 | CASE ( 'qc' ) |
---|
320 | IF ( .NOT. ALLOCATED( qc_av ) ) THEN |
---|
321 | ALLOCATE( qc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
322 | ENDIF |
---|
323 | qc_av = 0.0_wp |
---|
324 | |
---|
325 | CASE ( 'ql' ) |
---|
326 | IF ( .NOT. ALLOCATED( ql_av ) ) THEN |
---|
327 | ALLOCATE( ql_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
328 | ENDIF |
---|
329 | ql_av = 0.0_wp |
---|
330 | |
---|
331 | CASE ( 'ql_c' ) |
---|
332 | IF ( .NOT. ALLOCATED( ql_c_av ) ) THEN |
---|
333 | ALLOCATE( ql_c_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
334 | ENDIF |
---|
335 | ql_c_av = 0.0_wp |
---|
336 | |
---|
337 | CASE ( 'ql_v' ) |
---|
338 | IF ( .NOT. ALLOCATED( ql_v_av ) ) THEN |
---|
339 | ALLOCATE( ql_v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
340 | ENDIF |
---|
341 | ql_v_av = 0.0_wp |
---|
342 | |
---|
343 | CASE ( 'ql_vp' ) |
---|
344 | IF ( .NOT. ALLOCATED( ql_vp_av ) ) THEN |
---|
345 | ALLOCATE( ql_vp_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
346 | ENDIF |
---|
347 | ql_vp_av = 0.0_wp |
---|
348 | |
---|
349 | CASE ( 'qr' ) |
---|
350 | IF ( .NOT. ALLOCATED( qr_av ) ) THEN |
---|
351 | ALLOCATE( qr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
352 | ENDIF |
---|
353 | qr_av = 0.0_wp |
---|
354 | |
---|
355 | CASE ( 'qsws*' ) |
---|
356 | IF ( .NOT. ALLOCATED( qsws_av ) ) THEN |
---|
357 | ALLOCATE( qsws_av(nysg:nyng,nxlg:nxrg) ) |
---|
358 | ENDIF |
---|
359 | qsws_av = 0.0_wp |
---|
360 | |
---|
361 | CASE ( 'qv' ) |
---|
362 | IF ( .NOT. ALLOCATED( qv_av ) ) THEN |
---|
363 | ALLOCATE( qv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
364 | ENDIF |
---|
365 | qv_av = 0.0_wp |
---|
366 | |
---|
367 | CASE ( 'rho_ocean' ) |
---|
368 | IF ( .NOT. ALLOCATED( rho_ocean_av ) ) THEN |
---|
369 | ALLOCATE( rho_ocean_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
370 | ENDIF |
---|
371 | rho_ocean_av = 0.0_wp |
---|
372 | |
---|
373 | CASE ( 's' ) |
---|
374 | IF ( .NOT. ALLOCATED( s_av ) ) THEN |
---|
375 | ALLOCATE( s_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
376 | ENDIF |
---|
377 | s_av = 0.0_wp |
---|
378 | |
---|
379 | CASE ( 'sa' ) |
---|
380 | IF ( .NOT. ALLOCATED( sa_av ) ) THEN |
---|
381 | ALLOCATE( sa_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
382 | ENDIF |
---|
383 | sa_av = 0.0_wp |
---|
384 | |
---|
385 | CASE ( 'shf*' ) |
---|
386 | IF ( .NOT. ALLOCATED( shf_av ) ) THEN |
---|
387 | ALLOCATE( shf_av(nysg:nyng,nxlg:nxrg) ) |
---|
388 | ENDIF |
---|
389 | shf_av = 0.0_wp |
---|
390 | |
---|
391 | CASE ( 'ssws*' ) |
---|
392 | IF ( .NOT. ALLOCATED( ssws_av ) ) THEN |
---|
393 | ALLOCATE( ssws_av(nysg:nyng,nxlg:nxrg) ) |
---|
394 | ENDIF |
---|
395 | ssws_av = 0.0_wp |
---|
396 | |
---|
397 | CASE ( 't*' ) |
---|
398 | IF ( .NOT. ALLOCATED( ts_av ) ) THEN |
---|
399 | ALLOCATE( ts_av(nysg:nyng,nxlg:nxrg) ) |
---|
400 | ENDIF |
---|
401 | ts_av = 0.0_wp |
---|
402 | |
---|
403 | CASE ( 'u' ) |
---|
404 | IF ( .NOT. ALLOCATED( u_av ) ) THEN |
---|
405 | ALLOCATE( u_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
406 | ENDIF |
---|
407 | u_av = 0.0_wp |
---|
408 | |
---|
409 | CASE ( 'u*' ) |
---|
410 | IF ( .NOT. ALLOCATED( us_av ) ) THEN |
---|
411 | ALLOCATE( us_av(nysg:nyng,nxlg:nxrg) ) |
---|
412 | ENDIF |
---|
413 | us_av = 0.0_wp |
---|
414 | |
---|
415 | CASE ( 'v' ) |
---|
416 | IF ( .NOT. ALLOCATED( v_av ) ) THEN |
---|
417 | ALLOCATE( v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
418 | ENDIF |
---|
419 | v_av = 0.0_wp |
---|
420 | |
---|
421 | CASE ( 'vpt' ) |
---|
422 | IF ( .NOT. ALLOCATED( vpt_av ) ) THEN |
---|
423 | ALLOCATE( vpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
424 | ENDIF |
---|
425 | vpt_av = 0.0_wp |
---|
426 | |
---|
427 | CASE ( 'w' ) |
---|
428 | IF ( .NOT. ALLOCATED( w_av ) ) THEN |
---|
429 | ALLOCATE( w_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
430 | ENDIF |
---|
431 | w_av = 0.0_wp |
---|
432 | |
---|
433 | CASE ( 'z0*' ) |
---|
434 | IF ( .NOT. ALLOCATED( z0_av ) ) THEN |
---|
435 | ALLOCATE( z0_av(nysg:nyng,nxlg:nxrg) ) |
---|
436 | ENDIF |
---|
437 | z0_av = 0.0_wp |
---|
438 | |
---|
439 | CASE ( 'z0h*' ) |
---|
440 | IF ( .NOT. ALLOCATED( z0h_av ) ) THEN |
---|
441 | ALLOCATE( z0h_av(nysg:nyng,nxlg:nxrg) ) |
---|
442 | ENDIF |
---|
443 | z0h_av = 0.0_wp |
---|
444 | |
---|
445 | CASE ( 'z0q*' ) |
---|
446 | IF ( .NOT. ALLOCATED( z0q_av ) ) THEN |
---|
447 | ALLOCATE( z0q_av(nysg:nyng,nxlg:nxrg) ) |
---|
448 | ENDIF |
---|
449 | z0q_av = 0.0_wp |
---|
450 | ! |
---|
451 | !-- Block of urban surface model outputs |
---|
452 | CASE ( 'usm_output' ) |
---|
453 | |
---|
454 | CALL usm_average_3d_data( 'allocate', doav(ii) ) |
---|
455 | |
---|
456 | |
---|
457 | CASE DEFAULT |
---|
458 | |
---|
459 | ! |
---|
460 | !-- Turbulence closure module |
---|
461 | CALL tcm_3d_data_averaging( 'allocate', doav(ii) ) |
---|
462 | |
---|
463 | ! |
---|
464 | !-- Land surface quantity |
---|
465 | IF ( land_surface ) THEN |
---|
466 | CALL lsm_3d_data_averaging( 'allocate', doav(ii) ) |
---|
467 | ENDIF |
---|
468 | |
---|
469 | ! |
---|
470 | !-- Radiation quantity |
---|
471 | IF ( radiation ) THEN |
---|
472 | CALL radiation_3d_data_averaging( 'allocate', doav(ii) ) |
---|
473 | ENDIF |
---|
474 | |
---|
475 | ! |
---|
476 | !-- Chemical quantity |
---|
477 | #if defined( __chem ) |
---|
478 | IF ( air_chemistry .AND. trimvar(1:3) == 'kc_') THEN |
---|
479 | CALL chem_3d_data_averaging( 'allocate', doav(ii) ) |
---|
480 | ENDIF |
---|
481 | #endif |
---|
482 | |
---|
483 | ! |
---|
484 | !-- UV exposure quantity |
---|
485 | IF ( uv_exposure .AND. trimvar(1:5) == 'uvem_') THEN |
---|
486 | CALL uvem_3d_data_averaging( 'allocate', doav(ii) ) |
---|
487 | ENDIF |
---|
488 | |
---|
489 | ! |
---|
490 | !-- User-defined quantity |
---|
491 | CALL user_3d_data_averaging( 'allocate', doav(ii) ) |
---|
492 | |
---|
493 | END SELECT |
---|
494 | |
---|
495 | ENDDO |
---|
496 | |
---|
497 | ENDIF |
---|
498 | |
---|
499 | ! |
---|
500 | !-- Loop of all variables to be averaged. |
---|
501 | DO ii = 1, doav_n |
---|
502 | ! |
---|
503 | !-- Temporary solution to account for data output within the new urban |
---|
504 | !-- surface model (urban_surface_mod.f90), see also SELECT CASE ( trimvar ) |
---|
505 | trimvar = TRIM( doav(ii) ) |
---|
506 | IF ( urban_surface .AND. trimvar(1:4) == 'usm_' ) THEN |
---|
507 | trimvar = 'usm_output' |
---|
508 | ENDIF |
---|
509 | ! |
---|
510 | !-- Store the array chosen on the temporary array. |
---|
511 | SELECT CASE ( trimvar ) |
---|
512 | |
---|
513 | CASE ( 'e' ) |
---|
514 | DO i = nxlg, nxrg |
---|
515 | DO j = nysg, nyng |
---|
516 | DO k = nzb, nzt+1 |
---|
517 | e_av(k,j,i) = e_av(k,j,i) + e(k,j,i) |
---|
518 | ENDDO |
---|
519 | ENDDO |
---|
520 | ENDDO |
---|
521 | |
---|
522 | CASE ( 'lpt' ) |
---|
523 | DO i = nxlg, nxrg |
---|
524 | DO j = nysg, nyng |
---|
525 | DO k = nzb, nzt+1 |
---|
526 | lpt_av(k,j,i) = lpt_av(k,j,i) + pt(k,j,i) |
---|
527 | ENDDO |
---|
528 | ENDDO |
---|
529 | ENDDO |
---|
530 | |
---|
531 | CASE ( 'lwp*' ) |
---|
532 | DO i = nxlg, nxrg |
---|
533 | DO j = nysg, nyng |
---|
534 | lwp_av(j,i) = lwp_av(j,i) + SUM( ql(nzb:nzt,j,i) & |
---|
535 | * dzw(1:nzt+1) ) * rho_surface |
---|
536 | ENDDO |
---|
537 | ENDDO |
---|
538 | |
---|
539 | CASE ( 'nc' ) |
---|
540 | DO i = nxlg, nxrg |
---|
541 | DO j = nysg, nyng |
---|
542 | DO k = nzb, nzt+1 |
---|
543 | nc_av(k,j,i) = nc_av(k,j,i) + nc(k,j,i) |
---|
544 | ENDDO |
---|
545 | ENDDO |
---|
546 | ENDDO |
---|
547 | |
---|
548 | CASE ( 'nr' ) |
---|
549 | DO i = nxlg, nxrg |
---|
550 | DO j = nysg, nyng |
---|
551 | DO k = nzb, nzt+1 |
---|
552 | nr_av(k,j,i) = nr_av(k,j,i) + nr(k,j,i) |
---|
553 | ENDDO |
---|
554 | ENDDO |
---|
555 | ENDDO |
---|
556 | |
---|
557 | CASE ( 'ol*' ) |
---|
558 | DO m = 1, surf_def_h(0)%ns |
---|
559 | i = surf_def_h(0)%i(m) |
---|
560 | j = surf_def_h(0)%j(m) |
---|
561 | ol_av(j,i) = ol_av(j,i) + surf_def_h(0)%ol(m) |
---|
562 | ENDDO |
---|
563 | DO m = 1, surf_lsm_h%ns |
---|
564 | i = surf_lsm_h%i(m) |
---|
565 | j = surf_lsm_h%j(m) |
---|
566 | ol_av(j,i) = ol_av(j,i) + surf_lsm_h%ol(m) |
---|
567 | ENDDO |
---|
568 | DO m = 1, surf_usm_h%ns |
---|
569 | i = surf_usm_h%i(m) |
---|
570 | j = surf_usm_h%j(m) |
---|
571 | ol_av(j,i) = ol_av(j,i) + surf_usm_h%ol(m) |
---|
572 | ENDDO |
---|
573 | |
---|
574 | CASE ( 'p' ) |
---|
575 | DO i = nxlg, nxrg |
---|
576 | DO j = nysg, nyng |
---|
577 | DO k = nzb, nzt+1 |
---|
578 | p_av(k,j,i) = p_av(k,j,i) + p(k,j,i) |
---|
579 | ENDDO |
---|
580 | ENDDO |
---|
581 | ENDDO |
---|
582 | |
---|
583 | CASE ( 'pc' ) |
---|
584 | DO i = nxl, nxr |
---|
585 | DO j = nys, nyn |
---|
586 | DO k = nzb, nzt+1 |
---|
587 | pc_av(k,j,i) = pc_av(k,j,i) + prt_count(k,j,i) |
---|
588 | ENDDO |
---|
589 | ENDDO |
---|
590 | ENDDO |
---|
591 | |
---|
592 | CASE ( 'pr' ) |
---|
593 | DO i = nxl, nxr |
---|
594 | DO j = nys, nyn |
---|
595 | DO k = nzb, nzt+1 |
---|
596 | number_of_particles = prt_count(k,j,i) |
---|
597 | IF ( number_of_particles <= 0 ) CYCLE |
---|
598 | particles => grid_particles(k,j,i)%particles(1:number_of_particles) |
---|
599 | s_r2 = 0.0_wp |
---|
600 | s_r3 = 0.0_wp |
---|
601 | |
---|
602 | DO n = 1, number_of_particles |
---|
603 | IF ( particles(n)%particle_mask ) THEN |
---|
604 | s_r2 = s_r2 + particles(n)%radius**2 * & |
---|
605 | particles(n)%weight_factor |
---|
606 | s_r3 = s_r3 + particles(n)%radius**3 * & |
---|
607 | particles(n)%weight_factor |
---|
608 | ENDIF |
---|
609 | ENDDO |
---|
610 | |
---|
611 | IF ( s_r2 > 0.0_wp ) THEN |
---|
612 | mean_r = s_r3 / s_r2 |
---|
613 | ELSE |
---|
614 | mean_r = 0.0_wp |
---|
615 | ENDIF |
---|
616 | pr_av(k,j,i) = pr_av(k,j,i) + mean_r |
---|
617 | ENDDO |
---|
618 | ENDDO |
---|
619 | ENDDO |
---|
620 | |
---|
621 | |
---|
622 | CASE ( 'pr*' ) |
---|
623 | DO i = nxlg, nxrg |
---|
624 | DO j = nysg, nyng |
---|
625 | precipitation_rate_av(j,i) = precipitation_rate_av(j,i) + & |
---|
626 | precipitation_rate(j,i) |
---|
627 | ENDDO |
---|
628 | ENDDO |
---|
629 | |
---|
630 | CASE ( 'pt' ) |
---|
631 | IF ( .NOT. cloud_physics ) THEN |
---|
632 | DO i = nxlg, nxrg |
---|
633 | DO j = nysg, nyng |
---|
634 | DO k = nzb, nzt+1 |
---|
635 | pt_av(k,j,i) = pt_av(k,j,i) + pt(k,j,i) |
---|
636 | ENDDO |
---|
637 | ENDDO |
---|
638 | ENDDO |
---|
639 | ELSE |
---|
640 | DO i = nxlg, nxrg |
---|
641 | DO j = nysg, nyng |
---|
642 | DO k = nzb, nzt+1 |
---|
643 | pt_av(k,j,i) = pt_av(k,j,i) + pt(k,j,i) + l_d_cp * & |
---|
644 | pt_d_t(k) * ql(k,j,i) |
---|
645 | ENDDO |
---|
646 | ENDDO |
---|
647 | ENDDO |
---|
648 | ENDIF |
---|
649 | |
---|
650 | CASE ( 'q' ) |
---|
651 | DO i = nxlg, nxrg |
---|
652 | DO j = nysg, nyng |
---|
653 | DO k = nzb, nzt+1 |
---|
654 | q_av(k,j,i) = q_av(k,j,i) + q(k,j,i) |
---|
655 | ENDDO |
---|
656 | ENDDO |
---|
657 | ENDDO |
---|
658 | |
---|
659 | CASE ( 'qc' ) |
---|
660 | DO i = nxlg, nxrg |
---|
661 | DO j = nysg, nyng |
---|
662 | DO k = nzb, nzt+1 |
---|
663 | qc_av(k,j,i) = qc_av(k,j,i) + qc(k,j,i) |
---|
664 | ENDDO |
---|
665 | ENDDO |
---|
666 | ENDDO |
---|
667 | |
---|
668 | CASE ( 'ql' ) |
---|
669 | DO i = nxlg, nxrg |
---|
670 | DO j = nysg, nyng |
---|
671 | DO k = nzb, nzt+1 |
---|
672 | ql_av(k,j,i) = ql_av(k,j,i) + ql(k,j,i) |
---|
673 | ENDDO |
---|
674 | ENDDO |
---|
675 | ENDDO |
---|
676 | |
---|
677 | CASE ( 'ql_c' ) |
---|
678 | DO i = nxlg, nxrg |
---|
679 | DO j = nysg, nyng |
---|
680 | DO k = nzb, nzt+1 |
---|
681 | ql_c_av(k,j,i) = ql_c_av(k,j,i) + ql_c(k,j,i) |
---|
682 | ENDDO |
---|
683 | ENDDO |
---|
684 | ENDDO |
---|
685 | |
---|
686 | CASE ( 'ql_v' ) |
---|
687 | DO i = nxlg, nxrg |
---|
688 | DO j = nysg, nyng |
---|
689 | DO k = nzb, nzt+1 |
---|
690 | ql_v_av(k,j,i) = ql_v_av(k,j,i) + ql_v(k,j,i) |
---|
691 | ENDDO |
---|
692 | ENDDO |
---|
693 | ENDDO |
---|
694 | |
---|
695 | CASE ( 'ql_vp' ) |
---|
696 | DO i = nxl, nxr |
---|
697 | DO j = nys, nyn |
---|
698 | DO k = nzb, nzt+1 |
---|
699 | number_of_particles = prt_count(k,j,i) |
---|
700 | IF ( number_of_particles <= 0 ) CYCLE |
---|
701 | particles => grid_particles(k,j,i)%particles(1:number_of_particles) |
---|
702 | DO n = 1, number_of_particles |
---|
703 | IF ( particles(n)%particle_mask ) THEN |
---|
704 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) + & |
---|
705 | particles(n)%weight_factor / & |
---|
706 | number_of_particles |
---|
707 | ENDIF |
---|
708 | ENDDO |
---|
709 | ENDDO |
---|
710 | ENDDO |
---|
711 | ENDDO |
---|
712 | |
---|
713 | CASE ( 'qr' ) |
---|
714 | DO i = nxlg, nxrg |
---|
715 | DO j = nysg, nyng |
---|
716 | DO k = nzb, nzt+1 |
---|
717 | qr_av(k,j,i) = qr_av(k,j,i) + qr(k,j,i) |
---|
718 | ENDDO |
---|
719 | ENDDO |
---|
720 | ENDDO |
---|
721 | |
---|
722 | CASE ( 'qsws*' ) |
---|
723 | DO m = 1, surf_def_h(0)%ns |
---|
724 | i = surf_def_h(0)%i(m) |
---|
725 | j = surf_def_h(0)%j(m) |
---|
726 | qsws_av(j,i) = qsws_av(j,i) + surf_def_h(0)%qsws(m) |
---|
727 | ENDDO |
---|
728 | DO m = 1, surf_lsm_h%ns |
---|
729 | i = surf_lsm_h%i(m) |
---|
730 | j = surf_lsm_h%j(m) |
---|
731 | qsws_av(j,i) = qsws_av(j,i) + surf_lsm_h%qsws(m) |
---|
732 | ENDDO |
---|
733 | DO m = 1, surf_usm_h%ns |
---|
734 | i = surf_usm_h%i(m) |
---|
735 | j = surf_usm_h%j(m) |
---|
736 | qsws_av(j,i) = qsws_av(j,i) + surf_usm_h%qsws(m) |
---|
737 | ENDDO |
---|
738 | |
---|
739 | CASE ( 'qv' ) |
---|
740 | DO i = nxlg, nxrg |
---|
741 | DO j = nysg, nyng |
---|
742 | DO k = nzb, nzt+1 |
---|
743 | qv_av(k,j,i) = qv_av(k,j,i) + q(k,j,i) - ql(k,j,i) |
---|
744 | ENDDO |
---|
745 | ENDDO |
---|
746 | ENDDO |
---|
747 | |
---|
748 | CASE ( 'rho_ocean' ) |
---|
749 | DO i = nxlg, nxrg |
---|
750 | DO j = nysg, nyng |
---|
751 | DO k = nzb, nzt+1 |
---|
752 | rho_ocean_av(k,j,i) = rho_ocean_av(k,j,i) + rho_ocean(k,j,i) |
---|
753 | ENDDO |
---|
754 | ENDDO |
---|
755 | ENDDO |
---|
756 | |
---|
757 | CASE ( 's' ) |
---|
758 | DO i = nxlg, nxrg |
---|
759 | DO j = nysg, nyng |
---|
760 | DO k = nzb, nzt+1 |
---|
761 | s_av(k,j,i) = s_av(k,j,i) + s(k,j,i) |
---|
762 | ENDDO |
---|
763 | ENDDO |
---|
764 | ENDDO |
---|
765 | |
---|
766 | CASE ( 'sa' ) |
---|
767 | DO i = nxlg, nxrg |
---|
768 | DO j = nysg, nyng |
---|
769 | DO k = nzb, nzt+1 |
---|
770 | sa_av(k,j,i) = sa_av(k,j,i) + sa(k,j,i) |
---|
771 | ENDDO |
---|
772 | ENDDO |
---|
773 | ENDDO |
---|
774 | |
---|
775 | CASE ( 'shf*' ) |
---|
776 | DO m = 1, surf_def_h(0)%ns |
---|
777 | i = surf_def_h(0)%i(m) |
---|
778 | j = surf_def_h(0)%j(m) |
---|
779 | shf_av(j,i) = shf_av(j,i) + surf_def_h(0)%shf(m) |
---|
780 | ENDDO |
---|
781 | DO m = 1, surf_lsm_h%ns |
---|
782 | i = surf_lsm_h%i(m) |
---|
783 | j = surf_lsm_h%j(m) |
---|
784 | shf_av(j,i) = shf_av(j,i) + surf_lsm_h%shf(m) |
---|
785 | ENDDO |
---|
786 | DO m = 1, surf_usm_h%ns |
---|
787 | i = surf_usm_h%i(m) |
---|
788 | j = surf_usm_h%j(m) |
---|
789 | shf_av(j,i) = shf_av(j,i) + surf_usm_h%shf(m) |
---|
790 | ENDDO |
---|
791 | |
---|
792 | |
---|
793 | CASE ( 'ssws*' ) |
---|
794 | DO m = 1, surf_def_h(0)%ns |
---|
795 | i = surf_def_h(0)%i(m) |
---|
796 | j = surf_def_h(0)%j(m) |
---|
797 | ssws_av(j,i) = ssws_av(j,i) + surf_def_h(0)%ssws(m) |
---|
798 | ENDDO |
---|
799 | DO m = 1, surf_lsm_h%ns |
---|
800 | i = surf_lsm_h%i(m) |
---|
801 | j = surf_lsm_h%j(m) |
---|
802 | ssws_av(j,i) = ssws_av(j,i) + surf_lsm_h%ssws(m) |
---|
803 | ENDDO |
---|
804 | DO m = 1, surf_usm_h%ns |
---|
805 | i = surf_usm_h%i(m) |
---|
806 | j = surf_usm_h%j(m) |
---|
807 | ssws_av(j,i) = ssws_av(j,i) + surf_usm_h%ssws(m) |
---|
808 | ENDDO |
---|
809 | |
---|
810 | CASE ( 't*' ) |
---|
811 | DO m = 1, surf_def_h(0)%ns |
---|
812 | i = surf_def_h(0)%i(m) |
---|
813 | j = surf_def_h(0)%j(m) |
---|
814 | ts_av(j,i) = ts_av(j,i) + surf_def_h(0)%ts(m) |
---|
815 | ENDDO |
---|
816 | DO m = 1, surf_lsm_h%ns |
---|
817 | i = surf_lsm_h%i(m) |
---|
818 | j = surf_lsm_h%j(m) |
---|
819 | ts_av(j,i) = ts_av(j,i) + surf_lsm_h%ts(m) |
---|
820 | ENDDO |
---|
821 | DO m = 1, surf_usm_h%ns |
---|
822 | i = surf_usm_h%i(m) |
---|
823 | j = surf_usm_h%j(m) |
---|
824 | ts_av(j,i) = ts_av(j,i) + surf_usm_h%ts(m) |
---|
825 | ENDDO |
---|
826 | |
---|
827 | CASE ( 'u' ) |
---|
828 | DO i = nxlg, nxrg |
---|
829 | DO j = nysg, nyng |
---|
830 | DO k = nzb, nzt+1 |
---|
831 | u_av(k,j,i) = u_av(k,j,i) + u(k,j,i) |
---|
832 | ENDDO |
---|
833 | ENDDO |
---|
834 | ENDDO |
---|
835 | |
---|
836 | CASE ( 'u*' ) |
---|
837 | DO m = 1, surf_def_h(0)%ns |
---|
838 | i = surf_def_h(0)%i(m) |
---|
839 | j = surf_def_h(0)%j(m) |
---|
840 | us_av(j,i) = us_av(j,i) + surf_def_h(0)%us(m) |
---|
841 | ENDDO |
---|
842 | DO m = 1, surf_lsm_h%ns |
---|
843 | i = surf_lsm_h%i(m) |
---|
844 | j = surf_lsm_h%j(m) |
---|
845 | us_av(j,i) = us_av(j,i) + surf_lsm_h%us(m) |
---|
846 | ENDDO |
---|
847 | DO m = 1, surf_usm_h%ns |
---|
848 | i = surf_usm_h%i(m) |
---|
849 | j = surf_usm_h%j(m) |
---|
850 | us_av(j,i) = us_av(j,i) + surf_usm_h%us(m) |
---|
851 | ENDDO |
---|
852 | |
---|
853 | CASE ( 'v' ) |
---|
854 | DO i = nxlg, nxrg |
---|
855 | DO j = nysg, nyng |
---|
856 | DO k = nzb, nzt+1 |
---|
857 | v_av(k,j,i) = v_av(k,j,i) + v(k,j,i) |
---|
858 | ENDDO |
---|
859 | ENDDO |
---|
860 | ENDDO |
---|
861 | |
---|
862 | CASE ( 'vpt' ) |
---|
863 | DO i = nxlg, nxrg |
---|
864 | DO j = nysg, nyng |
---|
865 | DO k = nzb, nzt+1 |
---|
866 | vpt_av(k,j,i) = vpt_av(k,j,i) + vpt(k,j,i) |
---|
867 | ENDDO |
---|
868 | ENDDO |
---|
869 | ENDDO |
---|
870 | |
---|
871 | CASE ( 'w' ) |
---|
872 | DO i = nxlg, nxrg |
---|
873 | DO j = nysg, nyng |
---|
874 | DO k = nzb, nzt+1 |
---|
875 | w_av(k,j,i) = w_av(k,j,i) + w(k,j,i) |
---|
876 | ENDDO |
---|
877 | ENDDO |
---|
878 | ENDDO |
---|
879 | |
---|
880 | CASE ( 'z0*' ) |
---|
881 | DO m = 1, surf_def_h(0)%ns |
---|
882 | i = surf_def_h(0)%i(m) |
---|
883 | j = surf_def_h(0)%j(m) |
---|
884 | z0_av(j,i) = z0_av(j,i) + surf_def_h(0)%z0(m) |
---|
885 | ENDDO |
---|
886 | DO m = 1, surf_lsm_h%ns |
---|
887 | i = surf_lsm_h%i(m) |
---|
888 | j = surf_lsm_h%j(m) |
---|
889 | z0_av(j,i) = z0_av(j,i) + surf_lsm_h%z0(m) |
---|
890 | ENDDO |
---|
891 | DO m = 1, surf_usm_h%ns |
---|
892 | i = surf_usm_h%i(m) |
---|
893 | j = surf_usm_h%j(m) |
---|
894 | z0_av(j,i) = z0_av(j,i) + surf_usm_h%z0(m) |
---|
895 | ENDDO |
---|
896 | |
---|
897 | CASE ( 'z0h*' ) |
---|
898 | DO m = 1, surf_def_h(0)%ns |
---|
899 | i = surf_def_h(0)%i(m) |
---|
900 | j = surf_def_h(0)%j(m) |
---|
901 | z0h_av(j,i) = z0h_av(j,i) + surf_def_h(0)%z0h(m) |
---|
902 | ENDDO |
---|
903 | DO m = 1, surf_lsm_h%ns |
---|
904 | i = surf_lsm_h%i(m) |
---|
905 | j = surf_lsm_h%j(m) |
---|
906 | z0h_av(j,i) = z0h_av(j,i) + surf_lsm_h%z0h(m) |
---|
907 | ENDDO |
---|
908 | DO m = 1, surf_usm_h%ns |
---|
909 | i = surf_usm_h%i(m) |
---|
910 | j = surf_usm_h%j(m) |
---|
911 | z0h_av(j,i) = z0h_av(j,i) + surf_usm_h%z0h(m) |
---|
912 | ENDDO |
---|
913 | |
---|
914 | CASE ( 'z0q*' ) |
---|
915 | DO m = 1, surf_def_h(0)%ns |
---|
916 | i = surf_def_h(0)%i(m) |
---|
917 | j = surf_def_h(0)%j(m) |
---|
918 | z0q_av(j,i) = z0q_av(j,i) + surf_def_h(0)%z0q(m) |
---|
919 | ENDDO |
---|
920 | DO m = 1, surf_lsm_h%ns |
---|
921 | i = surf_lsm_h%i(m) |
---|
922 | j = surf_lsm_h%j(m) |
---|
923 | z0q_av(j,i) = z0q_av(j,i) + surf_lsm_h%z0q(m) |
---|
924 | ENDDO |
---|
925 | DO m = 1, surf_usm_h%ns |
---|
926 | i = surf_usm_h%i(m) |
---|
927 | j = surf_usm_h%j(m) |
---|
928 | z0q_av(j,i) = z0q_av(j,i) + surf_usm_h%z0q(m) |
---|
929 | ENDDO |
---|
930 | ! |
---|
931 | !-- Block of urban surface model outputs. |
---|
932 | !-- In case of urban surface variables it should be always checked |
---|
933 | !-- if respective arrays are allocated, at least in case of a restart |
---|
934 | !-- run, as usm arrays are not read from file at the moment. |
---|
935 | CASE ( 'usm_output' ) |
---|
936 | CALL usm_average_3d_data( 'allocate', doav(ii) ) |
---|
937 | CALL usm_average_3d_data( 'sum', doav(ii) ) |
---|
938 | |
---|
939 | CASE DEFAULT |
---|
940 | ! |
---|
941 | !-- Turbulence closure module |
---|
942 | CALL tcm_3d_data_averaging( 'sum', doav(ii) ) |
---|
943 | |
---|
944 | ! |
---|
945 | !-- Land surface quantity |
---|
946 | IF ( land_surface ) THEN |
---|
947 | CALL lsm_3d_data_averaging( 'sum', doav(ii) ) |
---|
948 | ENDIF |
---|
949 | |
---|
950 | ! |
---|
951 | !-- Radiation quantity |
---|
952 | IF ( radiation ) THEN |
---|
953 | CALL radiation_3d_data_averaging( 'sum', doav(ii) ) |
---|
954 | ENDIF |
---|
955 | |
---|
956 | ! |
---|
957 | !-- Chemical quantity |
---|
958 | #if defined( __chem ) |
---|
959 | IF ( air_chemistry .AND. trimvar(1:3) == 'kc_') THEN |
---|
960 | CALL chem_3d_data_averaging( 'sum',doav(ii) ) |
---|
961 | ENDIF |
---|
962 | #endif |
---|
963 | |
---|
964 | ! |
---|
965 | !-- UV exposure quantity |
---|
966 | IF ( uv_exposure ) THEN |
---|
967 | CALL uvem_3d_data_averaging( 'sum', doav(ii) ) |
---|
968 | ENDIF |
---|
969 | |
---|
970 | ! |
---|
971 | !-- User-defined quantity |
---|
972 | CALL user_3d_data_averaging( 'sum', doav(ii) ) |
---|
973 | |
---|
974 | END SELECT |
---|
975 | |
---|
976 | ENDDO |
---|
977 | |
---|
978 | CALL cpu_log( log_point(34), 'sum_up_3d_data', 'stop' ) |
---|
979 | |
---|
980 | |
---|
981 | END SUBROUTINE sum_up_3d_data |
---|