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