[1682] | 1 | !> @file sum_up_3d_data.f90 |
---|
[2000] | 2 | !------------------------------------------------------------------------------! |
---|
[2696] | 3 | ! This file is part of the PALM model system. |
---|
[1036] | 4 | ! |
---|
[2000] | 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. |
---|
[1036] | 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 | ! |
---|
[2718] | 17 | ! Copyright 1997-2018 Leibniz Universitaet Hannover |
---|
[2000] | 18 | !------------------------------------------------------------------------------! |
---|
[1036] | 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[3569] | 21 | ! ------------------ |
---|
[1360] | 22 | ! |
---|
[3553] | 23 | ! |
---|
[1321] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: sum_up_3d_data.f90 3569 2018-11-27 17:03:40Z raasch $ |
---|
[3569] | 27 | ! dom_dwd_user, Schrempf: |
---|
| 28 | ! Remove CALLs to uv exposure model, this is now part of biometeorology_mod |
---|
| 29 | ! |
---|
| 30 | ! 3553 2018-11-22 10:30:48Z suehring |
---|
[3553] | 31 | ! variables documented |
---|
| 32 | ! |
---|
| 33 | ! 3552 2018-11-22 10:28:35Z suehring |
---|
[3525] | 34 | ! Changes related to clean-up of biometeorology (dom_dwd_user) |
---|
| 35 | ! |
---|
| 36 | ! 3467 2018-10-30 19:05:21Z suehring |
---|
[3467] | 37 | ! Implementation of a new aerosol module salsa. |
---|
| 38 | ! |
---|
| 39 | ! 3448 2018-10-29 18:14:31Z kanani |
---|
[3448] | 40 | ! Adjustment of biometeorology calls |
---|
| 41 | ! |
---|
| 42 | ! 3421 2018-10-24 18:39:32Z gronemeier |
---|
[3421] | 43 | ! Renamed output variables |
---|
| 44 | ! |
---|
| 45 | ! 3337 2018-10-12 15:17:09Z kanani |
---|
[3337] | 46 | ! (from branch resler) |
---|
| 47 | ! Add biometeorology, |
---|
| 48 | ! fix chemistry output call, |
---|
| 49 | ! move usm calls |
---|
| 50 | ! |
---|
| 51 | ! 3294 2018-10-01 02:37:10Z raasch |
---|
[3294] | 52 | ! changes concerning modularization of ocean option |
---|
| 53 | ! |
---|
| 54 | ! 3291 2018-09-28 11:33:03Z scharf |
---|
[3291] | 55 | ! corrected previous commit for 3D topography |
---|
| 56 | ! |
---|
| 57 | ! 3285 2018-09-27 17:16:52Z scharf |
---|
[3285] | 58 | ! bugfix for shf_av and qsws_av |
---|
| 59 | ! |
---|
| 60 | ! 3274 2018-09-24 15:42:55Z knoop |
---|
[3274] | 61 | ! Modularization of all bulk cloud physics code components |
---|
| 62 | ! |
---|
| 63 | ! 3241 2018-09-12 15:02:00Z raasch |
---|
[3241] | 64 | ! unused variables removed |
---|
| 65 | ! |
---|
| 66 | ! 3176 2018-07-26 17:12:48Z suehring |
---|
[3176] | 67 | ! Remove output of latent heat flux at urban-surfaces and set fill values |
---|
| 68 | ! instead |
---|
| 69 | ! |
---|
| 70 | ! 3173 2018-07-26 12:55:23Z suehring |
---|
[3173] | 71 | ! Bugfix for last commit |
---|
| 72 | ! |
---|
| 73 | ! 3170 2018-07-25 15:19:37Z suehring |
---|
[3170] | 74 | ! Revise output of surface quantities in case of overhanging structures |
---|
| 75 | ! |
---|
| 76 | ! 3151 2018-07-19 08:45:38Z raasch |
---|
[3151] | 77 | ! Remaining preprocessor directive __chem removed |
---|
| 78 | ! |
---|
| 79 | ! 3004 2018-04-27 12:33:25Z Giersch |
---|
[3004] | 80 | ! prr field added to ONLY-list, prr* case/pr* case/precipitation_rate_av |
---|
| 81 | ! removed, further allocation checks implemented |
---|
| 82 | ! |
---|
| 83 | ! 2963 2018-04-12 14:47:44Z suehring |
---|
[2963] | 84 | ! Introduce index for vegetation/wall, pavement/green-wall and water/window |
---|
| 85 | ! surfaces, for clearer access of surface fraction, albedo, emissivity, etc. . |
---|
| 86 | ! |
---|
| 87 | ! 2894 2018-03-15 09:17:58Z Giersch |
---|
[2894] | 88 | ! Changed comment |
---|
| 89 | ! |
---|
| 90 | ! 2817 2018-02-19 16:32:21Z suehring |
---|
[2817] | 91 | ! Preliminary gust module interface implemented |
---|
| 92 | ! |
---|
| 93 | ! 2798 2018-02-09 17:16:39Z suehring |
---|
[2798] | 94 | ! Consider also default-type surfaces for surface temperature output. |
---|
| 95 | ! |
---|
| 96 | ! 2797 2018-02-08 13:24:35Z suehring |
---|
[2797] | 97 | ! Enable output of ground-heat flux also at urban surfaces. |
---|
| 98 | ! |
---|
| 99 | ! 2790 2018-02-06 11:57:19Z suehring |
---|
[2790] | 100 | ! Bugfix in summation of surface sensible and latent heat flux |
---|
| 101 | ! |
---|
| 102 | ! 2766 2018-01-22 17:17:47Z kanani |
---|
[2766] | 103 | ! Removed preprocessor directive __chem |
---|
| 104 | ! |
---|
| 105 | ! 2743 2018-01-12 16:03:39Z suehring |
---|
[2743] | 106 | ! In case of natural- and urban-type surfaces output surfaces fluxes in W/m2. |
---|
| 107 | ! |
---|
| 108 | ! 2742 2018-01-12 14:59:47Z suehring |
---|
[2742] | 109 | ! Enable output of surface temperature |
---|
| 110 | ! |
---|
| 111 | ! 2735 2018-01-11 12:01:27Z suehring |
---|
[2735] | 112 | ! output of r_a moved from land-surface to consider also urban-type surfaces |
---|
| 113 | ! |
---|
| 114 | ! 2718 2018-01-02 08:49:38Z maronga |
---|
[2716] | 115 | ! Corrected "Former revisions" section |
---|
| 116 | ! |
---|
| 117 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
| 118 | ! - Change in file header (GPL part) |
---|
[2696] | 119 | ! - Implementation of uv exposure model (FK) |
---|
| 120 | ! - output of diss_av, kh_av, km_av (turbulence_closure_mod) (TG) |
---|
| 121 | ! - Implementation of chemistry module (FK) |
---|
| 122 | ! - Workaround for sum-up usm arrays in case of restart runs, to avoid program |
---|
| 123 | ! crash (MS) |
---|
| 124 | ! |
---|
| 125 | ! 2292 2017-06-20 09:51:42Z schwenkel |
---|
[2292] | 126 | ! Implementation of new microphysic scheme: cloud_scheme = 'morrison' |
---|
| 127 | ! includes two more prognostic equations for cloud drop concentration (nc) |
---|
| 128 | ! and cloud water content (qc). |
---|
| 129 | ! |
---|
| 130 | ! 2233 2017-05-30 18:08:54Z suehring |
---|
[1321] | 131 | ! |
---|
[2233] | 132 | ! 2232 2017-05-30 17:47:52Z suehring |
---|
| 133 | ! Adjustments to new surface concept |
---|
| 134 | ! |
---|
[2032] | 135 | ! 2031 2016-10-21 15:11:58Z knoop |
---|
| 136 | ! renamed variable rho to rho_ocean and rho_av to rho_ocean_av |
---|
| 137 | ! |
---|
[2025] | 138 | ! 2024 2016-10-12 16:42:37Z kanani |
---|
| 139 | ! Added missing CASE for ssws* |
---|
| 140 | ! |
---|
[2012] | 141 | ! 2011 2016-09-19 17:29:57Z kanani |
---|
| 142 | ! Flag urban_surface is now defined in module control_parameters, |
---|
| 143 | ! changed prefix for urban surface model output to "usm_", |
---|
| 144 | ! introduced control parameter varnamelength for LEN of trimvar. |
---|
| 145 | ! |
---|
[2008] | 146 | ! 2007 2016-08-24 15:47:17Z kanani |
---|
| 147 | ! Added support for new urban surface model (temporary modifications of |
---|
| 148 | ! SELECT CASE ( ) necessary, see variable trimvar), |
---|
| 149 | ! added comments in variable declaration section |
---|
| 150 | ! |
---|
[2001] | 151 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
| 152 | ! Forced header and separation lines into 80 columns |
---|
| 153 | ! |
---|
[1993] | 154 | ! 1992 2016-08-12 15:14:59Z suehring |
---|
| 155 | ! Bugfix in summation of passive scalar |
---|
| 156 | ! |
---|
[1977] | 157 | ! 1976 2016-07-27 13:28:04Z maronga |
---|
| 158 | ! Radiation actions are now done directly in the respective module |
---|
| 159 | ! |
---|
[1973] | 160 | ! 1972 2016-07-26 07:52:02Z maronga |
---|
| 161 | ! Land surface actions are now done directly in the respective module |
---|
| 162 | ! |
---|
[1961] | 163 | ! 1960 2016-07-12 16:34:24Z suehring |
---|
| 164 | ! Scalar surface flux added |
---|
| 165 | ! |
---|
[1950] | 166 | ! 1949 2016-06-17 07:19:16Z maronga |
---|
| 167 | ! Bugfix: calculation of lai_av, c_veg_av and c_liq_av. |
---|
| 168 | ! |
---|
[1851] | 169 | ! 1849 2016-04-08 11:33:18Z hoffmann |
---|
| 170 | ! precipitation_rate moved to arrays_3d |
---|
[1852] | 171 | ! |
---|
[1789] | 172 | ! 1788 2016-03-10 11:01:04Z maronga |
---|
| 173 | ! Added z0q and z0q_av |
---|
| 174 | ! |
---|
[1694] | 175 | ! 1693 2015-10-27 08:35:45Z maronga |
---|
| 176 | ! Last revision text corrected |
---|
| 177 | ! |
---|
[1692] | 178 | ! 1691 2015-10-26 16:17:44Z maronga |
---|
| 179 | ! Added output of Obukhov length and radiative heating rates for RRTMG. |
---|
[1693] | 180 | ! Corrected output of liquid water path. |
---|
[1692] | 181 | ! |
---|
[1683] | 182 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 183 | ! Code annotations made doxygen readable |
---|
| 184 | ! |
---|
[1586] | 185 | ! 1585 2015-04-30 07:05:52Z maronga |
---|
| 186 | ! Adapted for RRTMG |
---|
| 187 | ! |
---|
[1556] | 188 | ! 1555 2015-03-04 17:44:27Z maronga |
---|
| 189 | ! Added output of r_a and r_s |
---|
| 190 | ! |
---|
[1552] | 191 | ! 1551 2015-03-03 14:18:16Z maronga |
---|
| 192 | ! Added support for land surface model and radiation model data. |
---|
| 193 | ! |
---|
[1360] | 194 | ! 1359 2014-04-11 17:15:14Z hoffmann |
---|
| 195 | ! New particle structure integrated. |
---|
| 196 | ! |
---|
[1354] | 197 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
| 198 | ! REAL constants provided with KIND-attribute |
---|
| 199 | ! |
---|
[1321] | 200 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 201 | ! ONLY-attribute added to USE-statements, |
---|
| 202 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 203 | ! kinds are defined in new module kinds, |
---|
| 204 | ! old module precision_kind is removed, |
---|
| 205 | ! revision history before 2012 removed, |
---|
| 206 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 207 | ! all variable declaration statements |
---|
[1] | 208 | ! |
---|
[1319] | 209 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
| 210 | ! barrier argument removed from cpu_log, |
---|
| 211 | ! module interfaces removed |
---|
| 212 | ! |
---|
[1116] | 213 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
| 214 | ! ql is calculated by calc_liquid_water_content |
---|
| 215 | ! |
---|
[1054] | 216 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
| 217 | ! +nr, prr, qr |
---|
| 218 | ! |
---|
[1037] | 219 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 220 | ! code put under GPL (PALM 3.9) |
---|
| 221 | ! |
---|
[1008] | 222 | ! 1007 2012-09-19 14:30:36Z franke |
---|
| 223 | ! Bugfix in calculation of ql_vp |
---|
| 224 | ! |
---|
[979] | 225 | ! 978 2012-08-09 08:28:32Z fricke |
---|
| 226 | ! +z0h* |
---|
| 227 | ! |
---|
[1] | 228 | ! Revision 1.1 2006/02/23 12:55:23 raasch |
---|
| 229 | ! Initial revision |
---|
| 230 | ! |
---|
| 231 | ! |
---|
| 232 | ! Description: |
---|
| 233 | ! ------------ |
---|
[1682] | 234 | !> Sum-up the values of 3d-arrays. The real averaging is later done in routine |
---|
| 235 | !> average_3d_data. |
---|
[1] | 236 | !------------------------------------------------------------------------------! |
---|
[1682] | 237 | SUBROUTINE sum_up_3d_data |
---|
| 238 | |
---|
[1] | 239 | |
---|
[1320] | 240 | USE arrays_3d, & |
---|
[3294] | 241 | ONLY: dzw, d_exner, e, heatflux_output_conversion, nc, nr, p, prr, & |
---|
| 242 | pt, q, qc, ql, ql_c, ql_v, qr, s, u, v, vpt, w, & |
---|
| 243 | waterflux_output_conversion |
---|
[1] | 244 | |
---|
[1320] | 245 | USE averaging, & |
---|
[3294] | 246 | ONLY: e_av, ghf_av, lpt_av, lwp_av, ol_av, p_av, pc_av, pr_av, pt_av, & |
---|
| 247 | q_av, ql_av, ql_c_av, ql_v_av, ql_vp_av, qsws_av, qv_av, & |
---|
| 248 | r_a_av, s_av, shf_av, ssws_av, ts_av, tsurf_av, u_av, us_av, & |
---|
| 249 | v_av, vpt_av, w_av, z0_av, z0h_av, z0q_av |
---|
[3241] | 250 | |
---|
[3274] | 251 | USE basic_constants_and_equations_mod, & |
---|
| 252 | ONLY: c_p, lv_d_cp, l_v |
---|
| 253 | |
---|
[3448] | 254 | USE biometeorology_mod, & |
---|
[3525] | 255 | ONLY: bio_3d_data_averaging |
---|
[3448] | 256 | |
---|
[3274] | 257 | USE bulk_cloud_model_mod, & |
---|
| 258 | ONLY: bulk_cloud_model, bcm_3d_data_averaging |
---|
| 259 | |
---|
[2696] | 260 | USE chemistry_model_mod, & |
---|
[3241] | 261 | ONLY: chem_3d_data_averaging |
---|
[1320] | 262 | |
---|
| 263 | USE control_parameters, & |
---|
[3448] | 264 | ONLY: air_chemistry, average_count_3d, biometeorology, doav, doav_n, & |
---|
| 265 | land_surface, ocean_mode, rho_surface, urban_surface, & |
---|
[3569] | 266 | varnamelength |
---|
[1320] | 267 | |
---|
| 268 | USE cpulog, & |
---|
| 269 | ONLY: cpu_log, log_point |
---|
| 270 | |
---|
[2817] | 271 | USE gust_mod, & |
---|
| 272 | ONLY: gust_3d_data_averaging, gust_module_enabled |
---|
| 273 | |
---|
[1320] | 274 | USE indices, & |
---|
| 275 | ONLY: nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt |
---|
| 276 | |
---|
| 277 | USE kinds |
---|
| 278 | |
---|
[1551] | 279 | USE land_surface_model_mod, & |
---|
[2232] | 280 | ONLY: lsm_3d_data_averaging |
---|
[1551] | 281 | |
---|
[3294] | 282 | USE ocean_mod, & |
---|
| 283 | ONLY: ocean_3d_data_averaging |
---|
| 284 | |
---|
[1320] | 285 | USE particle_attributes, & |
---|
[1359] | 286 | ONLY: grid_particles, number_of_particles, particles, prt_count |
---|
[1320] | 287 | |
---|
[1551] | 288 | USE radiation_model_mod, & |
---|
[1976] | 289 | ONLY: radiation, radiation_3d_data_averaging |
---|
[3467] | 290 | |
---|
| 291 | USE salsa_mod, & |
---|
| 292 | ONLY: salsa, salsa_3d_data_averaging |
---|
[1551] | 293 | |
---|
[2232] | 294 | USE surface_mod, & |
---|
[2963] | 295 | ONLY: ind_pav_green, ind_veg_wall, ind_wat_win, & |
---|
| 296 | surf_def_h, surf_lsm_h, surf_usm_h |
---|
[2232] | 297 | |
---|
[2696] | 298 | USE turbulence_closure_mod, & |
---|
| 299 | ONLY: tcm_3d_data_averaging |
---|
| 300 | |
---|
[2007] | 301 | USE urban_surface_mod, & |
---|
[2011] | 302 | ONLY: usm_average_3d_data |
---|
[1691] | 303 | |
---|
[2007] | 304 | |
---|
[1] | 305 | IMPLICIT NONE |
---|
| 306 | |
---|
[3170] | 307 | LOGICAL :: match_def !< flag indicating default-type surface |
---|
| 308 | LOGICAL :: match_lsm !< flag indicating natural-type surface |
---|
| 309 | LOGICAL :: match_usm !< flag indicating urban-type surface |
---|
| 310 | |
---|
[2232] | 311 | INTEGER(iwp) :: i !< grid index x direction |
---|
[2007] | 312 | INTEGER(iwp) :: ii !< running index |
---|
[2232] | 313 | INTEGER(iwp) :: j !< grid index y direction |
---|
| 314 | INTEGER(iwp) :: k !< grid index x direction |
---|
[3552] | 315 | INTEGER(iwp) :: m !< running index over surfacle elements |
---|
| 316 | INTEGER(iwp) :: n !< running index over number of particles per grid box |
---|
[1] | 317 | |
---|
[3552] | 318 | REAL(wp) :: mean_r !< mean-particle radius witin grid box |
---|
| 319 | REAL(wp) :: s_r2 !< mean-particle radius witin grid box to the power of two |
---|
| 320 | REAL(wp) :: s_r3 !< mean-particle radius witin grid box to the power of three |
---|
[1] | 321 | |
---|
[2011] | 322 | CHARACTER (LEN=varnamelength) :: trimvar !< TRIM of output-variable string |
---|
[2007] | 323 | |
---|
| 324 | |
---|
[1] | 325 | CALL cpu_log (log_point(34),'sum_up_3d_data','start') |
---|
| 326 | |
---|
| 327 | ! |
---|
| 328 | !-- Allocate and initialize the summation arrays if called for the very first |
---|
| 329 | !-- time or the first time after average_3d_data has been called |
---|
| 330 | !-- (some or all of the arrays may have been already allocated |
---|
[2894] | 331 | !-- in rrd_local) |
---|
[1] | 332 | IF ( average_count_3d == 0 ) THEN |
---|
| 333 | |
---|
| 334 | DO ii = 1, doav_n |
---|
[3337] | 335 | |
---|
[2007] | 336 | trimvar = TRIM( doav(ii) ) |
---|
[3337] | 337 | |
---|
[2007] | 338 | SELECT CASE ( trimvar ) |
---|
[1] | 339 | |
---|
[2797] | 340 | CASE ( 'ghf*' ) |
---|
| 341 | IF ( .NOT. ALLOCATED( ghf_av ) ) THEN |
---|
| 342 | ALLOCATE( ghf_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 343 | ENDIF |
---|
| 344 | ghf_av = 0.0_wp |
---|
| 345 | |
---|
[1] | 346 | CASE ( 'e' ) |
---|
| 347 | IF ( .NOT. ALLOCATED( e_av ) ) THEN |
---|
[667] | 348 | ALLOCATE( e_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 349 | ENDIF |
---|
[1353] | 350 | e_av = 0.0_wp |
---|
[1] | 351 | |
---|
[3421] | 352 | CASE ( 'thetal' ) |
---|
[771] | 353 | IF ( .NOT. ALLOCATED( lpt_av ) ) THEN |
---|
| 354 | ALLOCATE( lpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 355 | ENDIF |
---|
[1353] | 356 | lpt_av = 0.0_wp |
---|
[771] | 357 | |
---|
[1] | 358 | CASE ( 'lwp*' ) |
---|
| 359 | IF ( .NOT. ALLOCATED( lwp_av ) ) THEN |
---|
[667] | 360 | ALLOCATE( lwp_av(nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 361 | ENDIF |
---|
[1353] | 362 | lwp_av = 0.0_wp |
---|
[1] | 363 | |
---|
[1691] | 364 | CASE ( 'ol*' ) |
---|
| 365 | IF ( .NOT. ALLOCATED( ol_av ) ) THEN |
---|
| 366 | ALLOCATE( ol_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 367 | ENDIF |
---|
| 368 | ol_av = 0.0_wp |
---|
| 369 | |
---|
[1] | 370 | CASE ( 'p' ) |
---|
| 371 | IF ( .NOT. ALLOCATED( p_av ) ) THEN |
---|
[667] | 372 | ALLOCATE( p_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 373 | ENDIF |
---|
[1353] | 374 | p_av = 0.0_wp |
---|
[1] | 375 | |
---|
| 376 | CASE ( 'pc' ) |
---|
| 377 | IF ( .NOT. ALLOCATED( pc_av ) ) THEN |
---|
[667] | 378 | ALLOCATE( pc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 379 | ENDIF |
---|
[1353] | 380 | pc_av = 0.0_wp |
---|
[1] | 381 | |
---|
| 382 | CASE ( 'pr' ) |
---|
| 383 | IF ( .NOT. ALLOCATED( pr_av ) ) THEN |
---|
[667] | 384 | ALLOCATE( pr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 385 | ENDIF |
---|
[1353] | 386 | pr_av = 0.0_wp |
---|
[1] | 387 | |
---|
[3421] | 388 | CASE ( 'theta' ) |
---|
[1] | 389 | IF ( .NOT. ALLOCATED( pt_av ) ) THEN |
---|
[667] | 390 | ALLOCATE( pt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 391 | ENDIF |
---|
[1353] | 392 | pt_av = 0.0_wp |
---|
[1] | 393 | |
---|
| 394 | CASE ( 'q' ) |
---|
| 395 | IF ( .NOT. ALLOCATED( q_av ) ) THEN |
---|
[667] | 396 | ALLOCATE( q_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 397 | ENDIF |
---|
[1353] | 398 | q_av = 0.0_wp |
---|
[1] | 399 | |
---|
| 400 | CASE ( 'ql' ) |
---|
| 401 | IF ( .NOT. ALLOCATED( ql_av ) ) THEN |
---|
[667] | 402 | ALLOCATE( ql_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 403 | ENDIF |
---|
[1353] | 404 | ql_av = 0.0_wp |
---|
[1] | 405 | |
---|
| 406 | CASE ( 'ql_c' ) |
---|
| 407 | IF ( .NOT. ALLOCATED( ql_c_av ) ) THEN |
---|
[667] | 408 | ALLOCATE( ql_c_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 409 | ENDIF |
---|
[1353] | 410 | ql_c_av = 0.0_wp |
---|
[1] | 411 | |
---|
| 412 | CASE ( 'ql_v' ) |
---|
| 413 | IF ( .NOT. ALLOCATED( ql_v_av ) ) THEN |
---|
[667] | 414 | ALLOCATE( ql_v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 415 | ENDIF |
---|
[1353] | 416 | ql_v_av = 0.0_wp |
---|
[1] | 417 | |
---|
| 418 | CASE ( 'ql_vp' ) |
---|
| 419 | IF ( .NOT. ALLOCATED( ql_vp_av ) ) THEN |
---|
[667] | 420 | ALLOCATE( ql_vp_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 421 | ENDIF |
---|
[1353] | 422 | ql_vp_av = 0.0_wp |
---|
[1] | 423 | |
---|
[354] | 424 | CASE ( 'qsws*' ) |
---|
| 425 | IF ( .NOT. ALLOCATED( qsws_av ) ) THEN |
---|
[667] | 426 | ALLOCATE( qsws_av(nysg:nyng,nxlg:nxrg) ) |
---|
[354] | 427 | ENDIF |
---|
[1353] | 428 | qsws_av = 0.0_wp |
---|
[354] | 429 | |
---|
[1] | 430 | CASE ( 'qv' ) |
---|
| 431 | IF ( .NOT. ALLOCATED( qv_av ) ) THEN |
---|
[667] | 432 | ALLOCATE( qv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 433 | ENDIF |
---|
[1353] | 434 | qv_av = 0.0_wp |
---|
[1] | 435 | |
---|
[2735] | 436 | CASE ( 'r_a*' ) |
---|
| 437 | IF ( .NOT. ALLOCATED( r_a_av ) ) THEN |
---|
| 438 | ALLOCATE( r_a_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 439 | ENDIF |
---|
| 440 | r_a_av = 0.0_wp |
---|
| 441 | |
---|
[1] | 442 | CASE ( 's' ) |
---|
| 443 | IF ( .NOT. ALLOCATED( s_av ) ) THEN |
---|
[667] | 444 | ALLOCATE( s_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 445 | ENDIF |
---|
[1353] | 446 | s_av = 0.0_wp |
---|
[1] | 447 | |
---|
[354] | 448 | CASE ( 'shf*' ) |
---|
| 449 | IF ( .NOT. ALLOCATED( shf_av ) ) THEN |
---|
[667] | 450 | ALLOCATE( shf_av(nysg:nyng,nxlg:nxrg) ) |
---|
[354] | 451 | ENDIF |
---|
[1353] | 452 | shf_av = 0.0_wp |
---|
[2024] | 453 | |
---|
| 454 | CASE ( 'ssws*' ) |
---|
| 455 | IF ( .NOT. ALLOCATED( ssws_av ) ) THEN |
---|
| 456 | ALLOCATE( ssws_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 457 | ENDIF |
---|
| 458 | ssws_av = 0.0_wp |
---|
[354] | 459 | |
---|
[1] | 460 | CASE ( 't*' ) |
---|
| 461 | IF ( .NOT. ALLOCATED( ts_av ) ) THEN |
---|
[667] | 462 | ALLOCATE( ts_av(nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 463 | ENDIF |
---|
[1353] | 464 | ts_av = 0.0_wp |
---|
[1] | 465 | |
---|
[2742] | 466 | CASE ( 'tsurf*' ) |
---|
| 467 | IF ( .NOT. ALLOCATED( tsurf_av ) ) THEN |
---|
| 468 | ALLOCATE( tsurf_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 469 | ENDIF |
---|
| 470 | tsurf_av = 0.0_wp |
---|
| 471 | |
---|
[1] | 472 | CASE ( 'u' ) |
---|
| 473 | IF ( .NOT. ALLOCATED( u_av ) ) THEN |
---|
[667] | 474 | ALLOCATE( u_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 475 | ENDIF |
---|
[1353] | 476 | u_av = 0.0_wp |
---|
[1] | 477 | |
---|
[3421] | 478 | CASE ( 'us*' ) |
---|
[1] | 479 | IF ( .NOT. ALLOCATED( us_av ) ) THEN |
---|
[667] | 480 | ALLOCATE( us_av(nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 481 | ENDIF |
---|
[1353] | 482 | us_av = 0.0_wp |
---|
[1] | 483 | |
---|
| 484 | CASE ( 'v' ) |
---|
| 485 | IF ( .NOT. ALLOCATED( v_av ) ) THEN |
---|
[667] | 486 | ALLOCATE( v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 487 | ENDIF |
---|
[1353] | 488 | v_av = 0.0_wp |
---|
[1] | 489 | |
---|
[3421] | 490 | CASE ( 'thetav' ) |
---|
[1] | 491 | IF ( .NOT. ALLOCATED( vpt_av ) ) THEN |
---|
[667] | 492 | ALLOCATE( vpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 493 | ENDIF |
---|
[1353] | 494 | vpt_av = 0.0_wp |
---|
[1] | 495 | |
---|
| 496 | CASE ( 'w' ) |
---|
| 497 | IF ( .NOT. ALLOCATED( w_av ) ) THEN |
---|
[667] | 498 | ALLOCATE( w_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 499 | ENDIF |
---|
[1353] | 500 | w_av = 0.0_wp |
---|
[1] | 501 | |
---|
[72] | 502 | CASE ( 'z0*' ) |
---|
| 503 | IF ( .NOT. ALLOCATED( z0_av ) ) THEN |
---|
[667] | 504 | ALLOCATE( z0_av(nysg:nyng,nxlg:nxrg) ) |
---|
[72] | 505 | ENDIF |
---|
[1353] | 506 | z0_av = 0.0_wp |
---|
[72] | 507 | |
---|
[978] | 508 | CASE ( 'z0h*' ) |
---|
| 509 | IF ( .NOT. ALLOCATED( z0h_av ) ) THEN |
---|
| 510 | ALLOCATE( z0h_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 511 | ENDIF |
---|
[1353] | 512 | z0h_av = 0.0_wp |
---|
[978] | 513 | |
---|
[1788] | 514 | CASE ( 'z0q*' ) |
---|
| 515 | IF ( .NOT. ALLOCATED( z0q_av ) ) THEN |
---|
| 516 | ALLOCATE( z0q_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 517 | ENDIF |
---|
| 518 | z0q_av = 0.0_wp |
---|
[3294] | 519 | |
---|
[2007] | 520 | |
---|
[1] | 521 | CASE DEFAULT |
---|
[1972] | 522 | |
---|
[1] | 523 | ! |
---|
[3294] | 524 | !-- Allocating and initializing data arrays for other modules |
---|
[3337] | 525 | |
---|
| 526 | IF ( air_chemistry .AND. & |
---|
| 527 | (trimvar(1:3) == 'kc_' .OR. trimvar(1:3) == 'em_') ) THEN |
---|
| 528 | CALL chem_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 529 | ENDIF |
---|
| 530 | |
---|
[3274] | 531 | IF ( bulk_cloud_model ) THEN |
---|
| 532 | CALL bcm_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 533 | ENDIF |
---|
| 534 | |
---|
[3294] | 535 | IF ( gust_module_enabled ) THEN |
---|
| 536 | CALL gust_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 537 | ENDIF |
---|
| 538 | |
---|
[3569] | 539 | IF ( biometeorology ) THEN |
---|
[3525] | 540 | CALL bio_3d_data_averaging( 'allocate', doav(ii) ) |
---|
[3448] | 541 | ENDIF |
---|
| 542 | |
---|
[1972] | 543 | IF ( land_surface ) THEN |
---|
| 544 | CALL lsm_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 545 | ENDIF |
---|
| 546 | |
---|
[3294] | 547 | IF ( ocean_mode ) THEN |
---|
| 548 | CALL ocean_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 549 | ENDIF |
---|
| 550 | |
---|
[1976] | 551 | IF ( radiation ) THEN |
---|
| 552 | CALL radiation_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 553 | ENDIF |
---|
[3467] | 554 | |
---|
| 555 | ! |
---|
| 556 | !-- SALSA quantity |
---|
| 557 | IF ( salsa ) THEN |
---|
| 558 | CALL salsa_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 559 | ENDIF |
---|
[1976] | 560 | |
---|
[3337] | 561 | CALL tcm_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 562 | |
---|
| 563 | IF ( urban_surface .AND. trimvar(1:4) == 'usm_' ) THEN |
---|
| 564 | CALL usm_average_3d_data( 'allocate', doav(ii) ) |
---|
| 565 | ENDIF |
---|
| 566 | |
---|
[2696] | 567 | ! |
---|
[3294] | 568 | !-- User-defined quantities |
---|
[1] | 569 | CALL user_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 570 | |
---|
| 571 | END SELECT |
---|
| 572 | |
---|
| 573 | ENDDO |
---|
| 574 | |
---|
| 575 | ENDIF |
---|
| 576 | |
---|
| 577 | ! |
---|
| 578 | !-- Loop of all variables to be averaged. |
---|
| 579 | DO ii = 1, doav_n |
---|
[3337] | 580 | |
---|
| 581 | trimvar = TRIM( doav(ii) ) |
---|
[1] | 582 | ! |
---|
| 583 | !-- Store the array chosen on the temporary array. |
---|
[2007] | 584 | SELECT CASE ( trimvar ) |
---|
[1] | 585 | |
---|
[2797] | 586 | CASE ( 'ghf*' ) |
---|
[3004] | 587 | IF ( ALLOCATED( ghf_av ) ) THEN |
---|
[3170] | 588 | DO i = nxl, nxr |
---|
| 589 | DO j = nys, nyn |
---|
| 590 | ! |
---|
| 591 | !-- Check whether grid point is a natural- or urban-type |
---|
| 592 | !-- surface. |
---|
| 593 | match_lsm = surf_lsm_h%start_index(j,i) <= & |
---|
| 594 | surf_lsm_h%end_index(j,i) |
---|
| 595 | match_usm = surf_usm_h%start_index(j,i) <= & |
---|
| 596 | surf_usm_h%end_index(j,i) |
---|
| 597 | ! |
---|
| 598 | !-- In order to avoid double-counting of surface properties, |
---|
| 599 | !-- always assume that natural-type surfaces are below urban- |
---|
| 600 | !-- type surfaces, e.g. in case of bridges. |
---|
| 601 | !-- Further, take only the last suface element, i.e. the |
---|
| 602 | !-- uppermost surface which would be visible from above |
---|
| 603 | IF ( match_lsm .AND. .NOT. match_usm ) THEN |
---|
| 604 | m = surf_lsm_h%end_index(j,i) |
---|
[3173] | 605 | ghf_av(j,i) = ghf_av(j,i) + & |
---|
[3170] | 606 | surf_lsm_h%ghf(m) |
---|
| 607 | ELSEIF ( match_usm ) THEN |
---|
| 608 | m = surf_usm_h%end_index(j,i) |
---|
[3173] | 609 | ghf_av(j,i) = ghf_av(j,i) + & |
---|
[3170] | 610 | surf_usm_h%frac(ind_veg_wall,m) * & |
---|
| 611 | surf_usm_h%wghf_eb(m) + & |
---|
| 612 | surf_usm_h%frac(ind_pav_green,m) * & |
---|
| 613 | surf_usm_h%wghf_eb_green(m) + & |
---|
| 614 | surf_usm_h%frac(ind_wat_win,m) * & |
---|
| 615 | surf_usm_h%wghf_eb_window(m) |
---|
| 616 | ENDIF |
---|
| 617 | ENDDO |
---|
[3004] | 618 | ENDDO |
---|
| 619 | ENDIF |
---|
[2797] | 620 | |
---|
[1] | 621 | CASE ( 'e' ) |
---|
[3004] | 622 | IF ( ALLOCATED( e_av ) ) THEN |
---|
| 623 | DO i = nxlg, nxrg |
---|
| 624 | DO j = nysg, nyng |
---|
| 625 | DO k = nzb, nzt+1 |
---|
| 626 | e_av(k,j,i) = e_av(k,j,i) + e(k,j,i) |
---|
| 627 | ENDDO |
---|
[1] | 628 | ENDDO |
---|
| 629 | ENDDO |
---|
[3004] | 630 | ENDIF |
---|
[1] | 631 | |
---|
[3421] | 632 | CASE ( 'thetal' ) |
---|
[3004] | 633 | IF ( ALLOCATED( lpt_av ) ) THEN |
---|
| 634 | DO i = nxlg, nxrg |
---|
| 635 | DO j = nysg, nyng |
---|
| 636 | DO k = nzb, nzt+1 |
---|
| 637 | lpt_av(k,j,i) = lpt_av(k,j,i) + pt(k,j,i) |
---|
| 638 | ENDDO |
---|
[771] | 639 | ENDDO |
---|
| 640 | ENDDO |
---|
[3004] | 641 | ENDIF |
---|
[771] | 642 | |
---|
[1] | 643 | CASE ( 'lwp*' ) |
---|
[3004] | 644 | IF ( ALLOCATED( lwp_av ) ) THEN |
---|
| 645 | DO i = nxlg, nxrg |
---|
| 646 | DO j = nysg, nyng |
---|
| 647 | lwp_av(j,i) = lwp_av(j,i) + SUM( ql(nzb:nzt,j,i) & |
---|
| 648 | * dzw(1:nzt+1) ) * rho_surface |
---|
| 649 | ENDDO |
---|
[1] | 650 | ENDDO |
---|
[3004] | 651 | ENDIF |
---|
[1] | 652 | |
---|
[1691] | 653 | CASE ( 'ol*' ) |
---|
[3004] | 654 | IF ( ALLOCATED( ol_av ) ) THEN |
---|
[3170] | 655 | DO i = nxl, nxr |
---|
| 656 | DO j = nys, nyn |
---|
| 657 | match_def = surf_def_h(0)%start_index(j,i) <= & |
---|
| 658 | surf_def_h(0)%end_index(j,i) |
---|
| 659 | match_lsm = surf_lsm_h%start_index(j,i) <= & |
---|
| 660 | surf_lsm_h%end_index(j,i) |
---|
| 661 | match_usm = surf_usm_h%start_index(j,i) <= & |
---|
| 662 | surf_usm_h%end_index(j,i) |
---|
| 663 | |
---|
| 664 | IF ( match_def ) THEN |
---|
| 665 | m = surf_def_h(0)%end_index(j,i) |
---|
[3173] | 666 | ol_av(j,i) = ol_av(j,i) + & |
---|
[3170] | 667 | surf_def_h(0)%ol(m) |
---|
| 668 | ELSEIF ( match_lsm .AND. .NOT. match_usm ) THEN |
---|
| 669 | m = surf_lsm_h%end_index(j,i) |
---|
[3173] | 670 | ol_av(j,i) = ol_av(j,i) + & |
---|
[3170] | 671 | surf_lsm_h%ol(m) |
---|
| 672 | ELSEIF ( match_usm ) THEN |
---|
| 673 | m = surf_usm_h%end_index(j,i) |
---|
[3173] | 674 | ol_av(j,i) = ol_av(j,i) + & |
---|
[3170] | 675 | surf_usm_h%ol(m) |
---|
| 676 | ENDIF |
---|
| 677 | ENDDO |
---|
[3004] | 678 | ENDDO |
---|
| 679 | ENDIF |
---|
[1691] | 680 | |
---|
[1] | 681 | CASE ( 'p' ) |
---|
[3004] | 682 | IF ( ALLOCATED( p_av ) ) THEN |
---|
| 683 | DO i = nxlg, nxrg |
---|
| 684 | DO j = nysg, nyng |
---|
| 685 | DO k = nzb, nzt+1 |
---|
| 686 | p_av(k,j,i) = p_av(k,j,i) + p(k,j,i) |
---|
| 687 | ENDDO |
---|
[1] | 688 | ENDDO |
---|
| 689 | ENDDO |
---|
[3004] | 690 | ENDIF |
---|
[1] | 691 | |
---|
| 692 | CASE ( 'pc' ) |
---|
[3004] | 693 | IF ( ALLOCATED( pc_av ) ) THEN |
---|
| 694 | DO i = nxl, nxr |
---|
| 695 | DO j = nys, nyn |
---|
| 696 | DO k = nzb, nzt+1 |
---|
| 697 | pc_av(k,j,i) = pc_av(k,j,i) + prt_count(k,j,i) |
---|
| 698 | ENDDO |
---|
[1] | 699 | ENDDO |
---|
| 700 | ENDDO |
---|
[3004] | 701 | ENDIF |
---|
[1] | 702 | |
---|
| 703 | CASE ( 'pr' ) |
---|
[3004] | 704 | IF ( ALLOCATED( pr_av ) ) THEN |
---|
| 705 | DO i = nxl, nxr |
---|
| 706 | DO j = nys, nyn |
---|
| 707 | DO k = nzb, nzt+1 |
---|
| 708 | number_of_particles = prt_count(k,j,i) |
---|
| 709 | IF ( number_of_particles <= 0 ) CYCLE |
---|
| 710 | particles => & |
---|
| 711 | grid_particles(k,j,i)%particles(1:number_of_particles) |
---|
| 712 | s_r2 = 0.0_wp |
---|
| 713 | s_r3 = 0.0_wp |
---|
[1359] | 714 | |
---|
[3004] | 715 | DO n = 1, number_of_particles |
---|
| 716 | IF ( particles(n)%particle_mask ) THEN |
---|
| 717 | s_r2 = s_r2 + particles(n)%radius**2 * & |
---|
| 718 | particles(n)%weight_factor |
---|
| 719 | s_r3 = s_r3 + particles(n)%radius**3 * & |
---|
| 720 | particles(n)%weight_factor |
---|
| 721 | ENDIF |
---|
| 722 | ENDDO |
---|
| 723 | |
---|
| 724 | IF ( s_r2 > 0.0_wp ) THEN |
---|
| 725 | mean_r = s_r3 / s_r2 |
---|
| 726 | ELSE |
---|
| 727 | mean_r = 0.0_wp |
---|
[1359] | 728 | ENDIF |
---|
[3004] | 729 | pr_av(k,j,i) = pr_av(k,j,i) + mean_r |
---|
[1] | 730 | ENDDO |
---|
| 731 | ENDDO |
---|
| 732 | ENDDO |
---|
[3004] | 733 | ENDIF |
---|
[1] | 734 | |
---|
[3421] | 735 | CASE ( 'theta' ) |
---|
[3004] | 736 | IF ( ALLOCATED( pt_av ) ) THEN |
---|
[3274] | 737 | IF ( .NOT. bulk_cloud_model ) THEN |
---|
[3004] | 738 | DO i = nxlg, nxrg |
---|
| 739 | DO j = nysg, nyng |
---|
| 740 | DO k = nzb, nzt+1 |
---|
| 741 | pt_av(k,j,i) = pt_av(k,j,i) + pt(k,j,i) |
---|
| 742 | ENDDO |
---|
[1] | 743 | ENDDO |
---|
| 744 | ENDDO |
---|
[3004] | 745 | ELSE |
---|
| 746 | DO i = nxlg, nxrg |
---|
| 747 | DO j = nysg, nyng |
---|
| 748 | DO k = nzb, nzt+1 |
---|
[3274] | 749 | pt_av(k,j,i) = pt_av(k,j,i) + pt(k,j,i) + lv_d_cp * & |
---|
| 750 | d_exner(k) * ql(k,j,i) |
---|
[3004] | 751 | ENDDO |
---|
[1] | 752 | ENDDO |
---|
| 753 | ENDDO |
---|
[3004] | 754 | ENDIF |
---|
[1] | 755 | ENDIF |
---|
| 756 | |
---|
| 757 | CASE ( 'q' ) |
---|
[3004] | 758 | IF ( ALLOCATED( q_av ) ) THEN |
---|
| 759 | DO i = nxlg, nxrg |
---|
| 760 | DO j = nysg, nyng |
---|
| 761 | DO k = nzb, nzt+1 |
---|
| 762 | q_av(k,j,i) = q_av(k,j,i) + q(k,j,i) |
---|
| 763 | ENDDO |
---|
[1] | 764 | ENDDO |
---|
| 765 | ENDDO |
---|
[3004] | 766 | ENDIF |
---|
[402] | 767 | |
---|
[1] | 768 | CASE ( 'ql' ) |
---|
[3004] | 769 | IF ( ALLOCATED( ql_av ) ) THEN |
---|
| 770 | DO i = nxlg, nxrg |
---|
| 771 | DO j = nysg, nyng |
---|
| 772 | DO k = nzb, nzt+1 |
---|
| 773 | ql_av(k,j,i) = ql_av(k,j,i) + ql(k,j,i) |
---|
| 774 | ENDDO |
---|
[1] | 775 | ENDDO |
---|
| 776 | ENDDO |
---|
[3004] | 777 | ENDIF |
---|
[1] | 778 | |
---|
| 779 | CASE ( 'ql_c' ) |
---|
[3004] | 780 | IF ( ALLOCATED( ql_c_av ) ) THEN |
---|
| 781 | DO i = nxlg, nxrg |
---|
| 782 | DO j = nysg, nyng |
---|
| 783 | DO k = nzb, nzt+1 |
---|
| 784 | ql_c_av(k,j,i) = ql_c_av(k,j,i) + ql_c(k,j,i) |
---|
| 785 | ENDDO |
---|
[1] | 786 | ENDDO |
---|
| 787 | ENDDO |
---|
[3004] | 788 | ENDIF |
---|
[1] | 789 | |
---|
| 790 | CASE ( 'ql_v' ) |
---|
[3004] | 791 | IF ( ALLOCATED( ql_v_av ) ) THEN |
---|
| 792 | DO i = nxlg, nxrg |
---|
| 793 | DO j = nysg, nyng |
---|
| 794 | DO k = nzb, nzt+1 |
---|
| 795 | ql_v_av(k,j,i) = ql_v_av(k,j,i) + ql_v(k,j,i) |
---|
| 796 | ENDDO |
---|
[1] | 797 | ENDDO |
---|
| 798 | ENDDO |
---|
[3004] | 799 | ENDIF |
---|
[1] | 800 | |
---|
| 801 | CASE ( 'ql_vp' ) |
---|
[3004] | 802 | IF ( ALLOCATED( ql_vp_av ) ) THEN |
---|
| 803 | DO i = nxl, nxr |
---|
| 804 | DO j = nys, nyn |
---|
| 805 | DO k = nzb, nzt+1 |
---|
| 806 | number_of_particles = prt_count(k,j,i) |
---|
| 807 | IF ( number_of_particles <= 0 ) CYCLE |
---|
| 808 | particles => & |
---|
| 809 | grid_particles(k,j,i)%particles(1:number_of_particles) |
---|
| 810 | DO n = 1, number_of_particles |
---|
| 811 | IF ( particles(n)%particle_mask ) THEN |
---|
| 812 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) + & |
---|
| 813 | particles(n)%weight_factor / & |
---|
| 814 | number_of_particles |
---|
| 815 | ENDIF |
---|
| 816 | ENDDO |
---|
[1007] | 817 | ENDDO |
---|
[1] | 818 | ENDDO |
---|
| 819 | ENDDO |
---|
[3004] | 820 | ENDIF |
---|
[1] | 821 | |
---|
[402] | 822 | CASE ( 'qsws*' ) |
---|
[2743] | 823 | ! |
---|
| 824 | !-- In case of default surfaces, clean-up flux by density. |
---|
| 825 | !-- In case of land- and urban-surfaces, convert fluxes into |
---|
| 826 | !-- dynamic units. |
---|
[3004] | 827 | IF ( ALLOCATED( qsws_av ) ) THEN |
---|
[3170] | 828 | DO i = nxl, nxr |
---|
| 829 | DO j = nys, nyn |
---|
| 830 | match_def = surf_def_h(0)%start_index(j,i) <= & |
---|
| 831 | surf_def_h(0)%end_index(j,i) |
---|
| 832 | match_lsm = surf_lsm_h%start_index(j,i) <= & |
---|
| 833 | surf_lsm_h%end_index(j,i) |
---|
| 834 | match_usm = surf_usm_h%start_index(j,i) <= & |
---|
| 835 | surf_usm_h%end_index(j,i) |
---|
| 836 | |
---|
| 837 | IF ( match_def ) THEN |
---|
| 838 | m = surf_def_h(0)%end_index(j,i) |
---|
[3173] | 839 | qsws_av(j,i) = qsws_av(j,i) + & |
---|
[3170] | 840 | surf_def_h(0)%qsws(m) * & |
---|
[3285] | 841 | waterflux_output_conversion(nzb) |
---|
[3170] | 842 | ELSEIF ( match_lsm .AND. .NOT. match_usm ) THEN |
---|
| 843 | m = surf_lsm_h%end_index(j,i) |
---|
[3173] | 844 | qsws_av(j,i) = qsws_av(j,i) + & |
---|
[3170] | 845 | surf_lsm_h%qsws(m) * l_v |
---|
| 846 | ENDIF |
---|
| 847 | ENDDO |
---|
[3004] | 848 | ENDDO |
---|
| 849 | ENDIF |
---|
[402] | 850 | |
---|
[1] | 851 | CASE ( 'qv' ) |
---|
[3004] | 852 | IF ( ALLOCATED( qv_av ) ) THEN |
---|
| 853 | DO i = nxlg, nxrg |
---|
| 854 | DO j = nysg, nyng |
---|
| 855 | DO k = nzb, nzt+1 |
---|
| 856 | qv_av(k,j,i) = qv_av(k,j,i) + q(k,j,i) - ql(k,j,i) |
---|
| 857 | ENDDO |
---|
[1] | 858 | ENDDO |
---|
| 859 | ENDDO |
---|
[3004] | 860 | ENDIF |
---|
[1] | 861 | |
---|
[2735] | 862 | CASE ( 'r_a*' ) |
---|
[3004] | 863 | IF ( ALLOCATED( r_a_av ) ) THEN |
---|
[3170] | 864 | DO i = nxl, nxr |
---|
| 865 | DO j = nys, nyn |
---|
| 866 | match_lsm = surf_lsm_h%start_index(j,i) <= & |
---|
| 867 | surf_lsm_h%end_index(j,i) |
---|
| 868 | match_usm = surf_usm_h%start_index(j,i) <= & |
---|
| 869 | surf_usm_h%end_index(j,i) |
---|
| 870 | |
---|
| 871 | IF ( match_lsm .AND. .NOT. match_usm ) THEN |
---|
| 872 | m = surf_lsm_h%end_index(j,i) |
---|
[3173] | 873 | r_a_av(j,i) = r_a_av(j,i) + & |
---|
[3170] | 874 | surf_lsm_h%r_a(m) |
---|
| 875 | ELSEIF ( match_usm ) THEN |
---|
| 876 | m = surf_usm_h%end_index(j,i) |
---|
[3173] | 877 | r_a_av(j,i) = r_a_av(j,i) + & |
---|
[3170] | 878 | surf_usm_h%frac(ind_veg_wall,m) * & |
---|
| 879 | surf_usm_h%r_a(m) + & |
---|
| 880 | surf_usm_h%frac(ind_pav_green,m) * & |
---|
| 881 | surf_usm_h%r_a_green(m) + & |
---|
| 882 | surf_usm_h%frac(ind_wat_win,m) * & |
---|
| 883 | surf_usm_h%r_a_window(m) |
---|
| 884 | ENDIF |
---|
| 885 | ENDDO |
---|
[3004] | 886 | ENDDO |
---|
| 887 | ENDIF |
---|
[2735] | 888 | |
---|
[1] | 889 | CASE ( 's' ) |
---|
[3004] | 890 | IF ( ALLOCATED( s_av ) ) THEN |
---|
| 891 | DO i = nxlg, nxrg |
---|
| 892 | DO j = nysg, nyng |
---|
| 893 | DO k = nzb, nzt+1 |
---|
| 894 | s_av(k,j,i) = s_av(k,j,i) + s(k,j,i) |
---|
| 895 | ENDDO |
---|
[1] | 896 | ENDDO |
---|
| 897 | ENDDO |
---|
[3004] | 898 | ENDIF |
---|
[402] | 899 | |
---|
| 900 | CASE ( 'shf*' ) |
---|
[2743] | 901 | ! |
---|
| 902 | !-- In case of default surfaces, clean-up flux by density. |
---|
| 903 | !-- In case of land- and urban-surfaces, convert fluxes into |
---|
| 904 | !-- dynamic units. |
---|
[3004] | 905 | IF ( ALLOCATED( shf_av ) ) THEN |
---|
[3170] | 906 | DO i = nxl, nxr |
---|
| 907 | DO j = nys, nyn |
---|
| 908 | match_def = surf_def_h(0)%start_index(j,i) <= & |
---|
| 909 | surf_def_h(0)%end_index(j,i) |
---|
| 910 | match_lsm = surf_lsm_h%start_index(j,i) <= & |
---|
| 911 | surf_lsm_h%end_index(j,i) |
---|
| 912 | match_usm = surf_usm_h%start_index(j,i) <= & |
---|
| 913 | surf_usm_h%end_index(j,i) |
---|
| 914 | |
---|
| 915 | IF ( match_def ) THEN |
---|
| 916 | m = surf_def_h(0)%end_index(j,i) |
---|
[3173] | 917 | shf_av(j,i) = shf_av(j,i) + & |
---|
[3170] | 918 | surf_def_h(0)%shf(m) * & |
---|
[3285] | 919 | heatflux_output_conversion(nzb) |
---|
[3170] | 920 | ELSEIF ( match_lsm .AND. .NOT. match_usm ) THEN |
---|
| 921 | m = surf_lsm_h%end_index(j,i) |
---|
[3173] | 922 | shf_av(j,i) = shf_av(j,i) + & |
---|
[3274] | 923 | surf_lsm_h%shf(m) * c_p |
---|
[3170] | 924 | ELSEIF ( match_usm ) THEN |
---|
| 925 | m = surf_usm_h%end_index(j,i) |
---|
[3173] | 926 | shf_av(j,i) = shf_av(j,i) + & |
---|
[3274] | 927 | surf_usm_h%shf(m) * c_p |
---|
[3170] | 928 | ENDIF |
---|
| 929 | ENDDO |
---|
[3004] | 930 | ENDDO |
---|
| 931 | ENDIF |
---|
[402] | 932 | |
---|
[1960] | 933 | CASE ( 'ssws*' ) |
---|
[3004] | 934 | IF ( ALLOCATED( ssws_av ) ) THEN |
---|
[3170] | 935 | DO i = nxl, nxr |
---|
| 936 | DO j = nys, nyn |
---|
| 937 | match_def = surf_def_h(0)%start_index(j,i) <= & |
---|
| 938 | surf_def_h(0)%end_index(j,i) |
---|
| 939 | match_lsm = surf_lsm_h%start_index(j,i) <= & |
---|
| 940 | surf_lsm_h%end_index(j,i) |
---|
| 941 | match_usm = surf_usm_h%start_index(j,i) <= & |
---|
| 942 | surf_usm_h%end_index(j,i) |
---|
| 943 | |
---|
| 944 | IF ( match_def ) THEN |
---|
| 945 | m = surf_def_h(0)%end_index(j,i) |
---|
[3173] | 946 | ssws_av(j,i) = ssws_av(j,i) + & |
---|
[3170] | 947 | surf_def_h(0)%ssws(m) |
---|
| 948 | ELSEIF ( match_lsm .AND. .NOT. match_usm ) THEN |
---|
| 949 | m = surf_lsm_h%end_index(j,i) |
---|
[3173] | 950 | ssws_av(j,i) = ssws_av(j,i) + & |
---|
[3170] | 951 | surf_lsm_h%ssws(m) |
---|
| 952 | ELSEIF ( match_usm ) THEN |
---|
| 953 | m = surf_usm_h%end_index(j,i) |
---|
[3173] | 954 | ssws_av(j,i) = ssws_av(j,i) + & |
---|
[3170] | 955 | surf_usm_h%ssws(m) |
---|
| 956 | ENDIF |
---|
| 957 | ENDDO |
---|
[3004] | 958 | ENDDO |
---|
| 959 | ENDIF |
---|
[1960] | 960 | |
---|
[1] | 961 | CASE ( 't*' ) |
---|
[3004] | 962 | IF ( ALLOCATED( ts_av ) ) THEN |
---|
[3170] | 963 | DO i = nxl, nxr |
---|
| 964 | DO j = nys, nyn |
---|
| 965 | match_def = surf_def_h(0)%start_index(j,i) <= & |
---|
| 966 | surf_def_h(0)%end_index(j,i) |
---|
| 967 | match_lsm = surf_lsm_h%start_index(j,i) <= & |
---|
| 968 | surf_lsm_h%end_index(j,i) |
---|
| 969 | match_usm = surf_usm_h%start_index(j,i) <= & |
---|
| 970 | surf_usm_h%end_index(j,i) |
---|
| 971 | |
---|
| 972 | IF ( match_def ) THEN |
---|
| 973 | m = surf_def_h(0)%end_index(j,i) |
---|
[3173] | 974 | ts_av(j,i) = ts_av(j,i) + & |
---|
[3170] | 975 | surf_def_h(0)%ts(m) |
---|
| 976 | ELSEIF ( match_lsm .AND. .NOT. match_usm ) THEN |
---|
| 977 | m = surf_lsm_h%end_index(j,i) |
---|
[3173] | 978 | ts_av(j,i) = ts_av(j,i) + & |
---|
[3170] | 979 | surf_lsm_h%ts(m) |
---|
| 980 | ELSEIF ( match_usm ) THEN |
---|
| 981 | m = surf_usm_h%end_index(j,i) |
---|
[3173] | 982 | ts_av(j,i) = ts_av(j,i) + & |
---|
[3170] | 983 | surf_usm_h%ts(m) |
---|
| 984 | ENDIF |
---|
| 985 | ENDDO |
---|
[3004] | 986 | ENDDO |
---|
| 987 | ENDIF |
---|
[1] | 988 | |
---|
[2742] | 989 | CASE ( 'tsurf*' ) |
---|
[3170] | 990 | IF ( ALLOCATED( tsurf_av ) ) THEN |
---|
| 991 | DO i = nxl, nxr |
---|
| 992 | DO j = nys, nyn |
---|
| 993 | match_def = surf_def_h(0)%start_index(j,i) <= & |
---|
| 994 | surf_def_h(0)%end_index(j,i) |
---|
| 995 | match_lsm = surf_lsm_h%start_index(j,i) <= & |
---|
| 996 | surf_lsm_h%end_index(j,i) |
---|
| 997 | match_usm = surf_usm_h%start_index(j,i) <= & |
---|
| 998 | surf_usm_h%end_index(j,i) |
---|
[2798] | 999 | |
---|
[3170] | 1000 | IF ( match_def ) THEN |
---|
| 1001 | m = surf_def_h(0)%end_index(j,i) |
---|
| 1002 | tsurf_av(j,i) = tsurf_av(j,i) + & |
---|
| 1003 | surf_def_h(0)%pt_surface(m) |
---|
| 1004 | ELSEIF ( match_lsm .AND. .NOT. match_usm ) THEN |
---|
| 1005 | m = surf_lsm_h%end_index(j,i) |
---|
| 1006 | tsurf_av(j,i) = tsurf_av(j,i) + & |
---|
| 1007 | surf_lsm_h%pt_surface(m) |
---|
| 1008 | ELSEIF ( match_usm ) THEN |
---|
| 1009 | m = surf_usm_h%end_index(j,i) |
---|
| 1010 | tsurf_av(j,i) = tsurf_av(j,i) + & |
---|
| 1011 | surf_usm_h%pt_surface(m) |
---|
| 1012 | ENDIF |
---|
| 1013 | ENDDO |
---|
[3004] | 1014 | ENDDO |
---|
| 1015 | ENDIF |
---|
[2742] | 1016 | |
---|
[1] | 1017 | CASE ( 'u' ) |
---|
[3004] | 1018 | IF ( ALLOCATED( u_av ) ) THEN |
---|
| 1019 | DO i = nxlg, nxrg |
---|
| 1020 | DO j = nysg, nyng |
---|
| 1021 | DO k = nzb, nzt+1 |
---|
| 1022 | u_av(k,j,i) = u_av(k,j,i) + u(k,j,i) |
---|
| 1023 | ENDDO |
---|
[1] | 1024 | ENDDO |
---|
| 1025 | ENDDO |
---|
[3004] | 1026 | ENDIF |
---|
[1] | 1027 | |
---|
[3421] | 1028 | CASE ( 'us*' ) |
---|
[3004] | 1029 | IF ( ALLOCATED( us_av ) ) THEN |
---|
[3170] | 1030 | DO i = nxl, nxr |
---|
| 1031 | DO j = nys, nyn |
---|
| 1032 | match_def = surf_def_h(0)%start_index(j,i) <= & |
---|
| 1033 | surf_def_h(0)%end_index(j,i) |
---|
| 1034 | match_lsm = surf_lsm_h%start_index(j,i) <= & |
---|
| 1035 | surf_lsm_h%end_index(j,i) |
---|
| 1036 | match_usm = surf_usm_h%start_index(j,i) <= & |
---|
| 1037 | surf_usm_h%end_index(j,i) |
---|
| 1038 | |
---|
| 1039 | IF ( match_def ) THEN |
---|
| 1040 | m = surf_def_h(0)%end_index(j,i) |
---|
[3173] | 1041 | us_av(j,i) = us_av(j,i) + & |
---|
[3170] | 1042 | surf_def_h(0)%us(m) |
---|
| 1043 | ELSEIF ( match_lsm .AND. .NOT. match_usm ) THEN |
---|
| 1044 | m = surf_lsm_h%end_index(j,i) |
---|
[3173] | 1045 | us_av(j,i) = us_av(j,i) + & |
---|
[3170] | 1046 | surf_lsm_h%us(m) |
---|
| 1047 | ELSEIF ( match_usm ) THEN |
---|
| 1048 | m = surf_usm_h%end_index(j,i) |
---|
[3173] | 1049 | us_av(j,i) = us_av(j,i) + & |
---|
[3170] | 1050 | surf_usm_h%us(m) |
---|
| 1051 | ENDIF |
---|
| 1052 | ENDDO |
---|
[3004] | 1053 | ENDDO |
---|
| 1054 | ENDIF |
---|
[1] | 1055 | |
---|
| 1056 | CASE ( 'v' ) |
---|
[3004] | 1057 | IF ( ALLOCATED( v_av ) ) THEN |
---|
| 1058 | DO i = nxlg, nxrg |
---|
| 1059 | DO j = nysg, nyng |
---|
| 1060 | DO k = nzb, nzt+1 |
---|
| 1061 | v_av(k,j,i) = v_av(k,j,i) + v(k,j,i) |
---|
| 1062 | ENDDO |
---|
[1] | 1063 | ENDDO |
---|
| 1064 | ENDDO |
---|
[3004] | 1065 | ENDIF |
---|
[1] | 1066 | |
---|
[3421] | 1067 | CASE ( 'thetav' ) |
---|
[3004] | 1068 | IF ( ALLOCATED( vpt_av ) ) THEN |
---|
| 1069 | DO i = nxlg, nxrg |
---|
| 1070 | DO j = nysg, nyng |
---|
| 1071 | DO k = nzb, nzt+1 |
---|
| 1072 | vpt_av(k,j,i) = vpt_av(k,j,i) + vpt(k,j,i) |
---|
| 1073 | ENDDO |
---|
[1] | 1074 | ENDDO |
---|
| 1075 | ENDDO |
---|
[3004] | 1076 | ENDIF |
---|
[1] | 1077 | |
---|
| 1078 | CASE ( 'w' ) |
---|
[3004] | 1079 | IF ( ALLOCATED( w_av ) ) THEN |
---|
| 1080 | DO i = nxlg, nxrg |
---|
| 1081 | DO j = nysg, nyng |
---|
| 1082 | DO k = nzb, nzt+1 |
---|
| 1083 | w_av(k,j,i) = w_av(k,j,i) + w(k,j,i) |
---|
| 1084 | ENDDO |
---|
[1] | 1085 | ENDDO |
---|
| 1086 | ENDDO |
---|
[3004] | 1087 | ENDIF |
---|
[1] | 1088 | |
---|
[72] | 1089 | CASE ( 'z0*' ) |
---|
[3004] | 1090 | IF ( ALLOCATED( z0_av ) ) THEN |
---|
[3170] | 1091 | DO i = nxl, nxr |
---|
| 1092 | DO j = nys, nyn |
---|
| 1093 | match_def = surf_def_h(0)%start_index(j,i) <= & |
---|
| 1094 | surf_def_h(0)%end_index(j,i) |
---|
| 1095 | match_lsm = surf_lsm_h%start_index(j,i) <= & |
---|
| 1096 | surf_lsm_h%end_index(j,i) |
---|
| 1097 | match_usm = surf_usm_h%start_index(j,i) <= & |
---|
| 1098 | surf_usm_h%end_index(j,i) |
---|
| 1099 | |
---|
| 1100 | IF ( match_def ) THEN |
---|
| 1101 | m = surf_def_h(0)%end_index(j,i) |
---|
[3173] | 1102 | z0_av(j,i) = z0_av(j,i) + & |
---|
[3170] | 1103 | surf_def_h(0)%z0(m) |
---|
| 1104 | ELSEIF ( match_lsm .AND. .NOT. match_usm ) THEN |
---|
| 1105 | m = surf_lsm_h%end_index(j,i) |
---|
[3173] | 1106 | z0_av(j,i) = z0_av(j,i) + & |
---|
[3170] | 1107 | surf_lsm_h%z0(m) |
---|
| 1108 | ELSEIF ( match_usm ) THEN |
---|
| 1109 | m = surf_usm_h%end_index(j,i) |
---|
[3173] | 1110 | z0_av(j,i) = z0_av(j,i) + & |
---|
[3170] | 1111 | surf_usm_h%z0(m) |
---|
| 1112 | ENDIF |
---|
| 1113 | ENDDO |
---|
| 1114 | ENDDO |
---|
[3004] | 1115 | ENDIF |
---|
[72] | 1116 | |
---|
[978] | 1117 | CASE ( 'z0h*' ) |
---|
[3004] | 1118 | IF ( ALLOCATED( z0h_av ) ) THEN |
---|
[3170] | 1119 | DO i = nxl, nxr |
---|
| 1120 | DO j = nys, nyn |
---|
| 1121 | match_def = surf_def_h(0)%start_index(j,i) <= & |
---|
| 1122 | surf_def_h(0)%end_index(j,i) |
---|
| 1123 | match_lsm = surf_lsm_h%start_index(j,i) <= & |
---|
| 1124 | surf_lsm_h%end_index(j,i) |
---|
| 1125 | match_usm = surf_usm_h%start_index(j,i) <= & |
---|
| 1126 | surf_usm_h%end_index(j,i) |
---|
| 1127 | |
---|
| 1128 | IF ( match_def ) THEN |
---|
| 1129 | m = surf_def_h(0)%end_index(j,i) |
---|
[3173] | 1130 | z0h_av(j,i) = z0h_av(j,i) + & |
---|
[3170] | 1131 | surf_def_h(0)%z0h(m) |
---|
| 1132 | ELSEIF ( match_lsm .AND. .NOT. match_usm ) THEN |
---|
| 1133 | m = surf_lsm_h%end_index(j,i) |
---|
[3173] | 1134 | z0h_av(j,i) = z0h_av(j,i) + & |
---|
[3170] | 1135 | surf_lsm_h%z0h(m) |
---|
| 1136 | ELSEIF ( match_usm ) THEN |
---|
| 1137 | m = surf_usm_h%end_index(j,i) |
---|
[3173] | 1138 | z0h_av(j,i) = z0h_av(j,i) + & |
---|
[3170] | 1139 | surf_usm_h%z0h(m) |
---|
| 1140 | ENDIF |
---|
| 1141 | ENDDO |
---|
[3004] | 1142 | ENDDO |
---|
| 1143 | ENDIF |
---|
| 1144 | |
---|
[1788] | 1145 | CASE ( 'z0q*' ) |
---|
[3004] | 1146 | IF ( ALLOCATED( z0q_av ) ) THEN |
---|
[3170] | 1147 | DO i = nxl, nxr |
---|
| 1148 | DO j = nys, nyn |
---|
| 1149 | match_def = surf_def_h(0)%start_index(j,i) <= & |
---|
| 1150 | surf_def_h(0)%end_index(j,i) |
---|
| 1151 | match_lsm = surf_lsm_h%start_index(j,i) <= & |
---|
| 1152 | surf_lsm_h%end_index(j,i) |
---|
| 1153 | match_usm = surf_usm_h%start_index(j,i) <= & |
---|
| 1154 | surf_usm_h%end_index(j,i) |
---|
| 1155 | |
---|
| 1156 | IF ( match_def ) THEN |
---|
| 1157 | m = surf_def_h(0)%end_index(j,i) |
---|
[3173] | 1158 | z0q_av(j,i) = z0q_av(j,i) + & |
---|
[3170] | 1159 | surf_def_h(0)%z0q(m) |
---|
| 1160 | ELSEIF ( match_lsm .AND. .NOT. match_usm ) THEN |
---|
| 1161 | m = surf_lsm_h%end_index(j,i) |
---|
[3173] | 1162 | z0q_av(j,i) = z0q_av(j,i) + & |
---|
[3170] | 1163 | surf_lsm_h%z0q(m) |
---|
| 1164 | ELSEIF ( match_usm ) THEN |
---|
| 1165 | m = surf_usm_h%end_index(j,i) |
---|
[3173] | 1166 | z0q_av(j,i) = z0q_av(j,i) + & |
---|
[3170] | 1167 | surf_usm_h%z0q(m) |
---|
| 1168 | ENDIF |
---|
| 1169 | ENDDO |
---|
[3004] | 1170 | ENDDO |
---|
| 1171 | ENDIF |
---|
[3294] | 1172 | |
---|
[1] | 1173 | CASE DEFAULT |
---|
| 1174 | ! |
---|
[3294] | 1175 | !-- Summing up data from other modules |
---|
[3274] | 1176 | IF ( bulk_cloud_model ) THEN |
---|
| 1177 | CALL bcm_3d_data_averaging( 'sum', doav(ii) ) |
---|
| 1178 | ENDIF |
---|
| 1179 | |
---|
[3337] | 1180 | IF ( air_chemistry .AND. & |
---|
| 1181 | (trimvar(1:3) == 'kc_' .OR. trimvar(1:3) == 'em_') ) THEN |
---|
[3294] | 1182 | CALL chem_3d_data_averaging( 'sum',doav(ii) ) |
---|
| 1183 | ENDIF |
---|
| 1184 | |
---|
| 1185 | IF ( gust_module_enabled ) THEN |
---|
| 1186 | CALL gust_3d_data_averaging( 'sum', doav(ii) ) |
---|
| 1187 | ENDIF |
---|
| 1188 | |
---|
[3569] | 1189 | IF ( biometeorology ) THEN |
---|
[3525] | 1190 | CALL bio_3d_data_averaging( 'sum', doav(ii) ) |
---|
[3448] | 1191 | ENDIF |
---|
| 1192 | |
---|
[1972] | 1193 | IF ( land_surface ) THEN |
---|
| 1194 | CALL lsm_3d_data_averaging( 'sum', doav(ii) ) |
---|
| 1195 | ENDIF |
---|
| 1196 | |
---|
[3294] | 1197 | IF ( ocean_mode ) THEN |
---|
| 1198 | CALL ocean_3d_data_averaging( 'sum', doav(ii) ) |
---|
| 1199 | ENDIF |
---|
| 1200 | |
---|
[1976] | 1201 | IF ( radiation ) THEN |
---|
| 1202 | CALL radiation_3d_data_averaging( 'sum', doav(ii) ) |
---|
| 1203 | ENDIF |
---|
[3467] | 1204 | |
---|
| 1205 | ! |
---|
| 1206 | !-- SALSA quantity |
---|
| 1207 | IF ( salsa ) THEN |
---|
| 1208 | CALL salsa_3d_data_averaging( 'sum', doav(ii) ) |
---|
| 1209 | ENDIF |
---|
[1976] | 1210 | |
---|
[3294] | 1211 | CALL tcm_3d_data_averaging( 'sum', doav(ii) ) |
---|
[2817] | 1212 | |
---|
[3337] | 1213 | !-- In case of urban surface variables it should be always checked |
---|
| 1214 | !-- if respective arrays are allocated, at least in case of a restart |
---|
| 1215 | !-- run, as averaged usm arrays are not read from file at the moment. |
---|
| 1216 | IF ( urban_surface .AND. trimvar(1:4) == 'usm_' ) THEN |
---|
| 1217 | CALL usm_average_3d_data( 'allocate', doav(ii) ) |
---|
| 1218 | CALL usm_average_3d_data( 'sum', doav(ii) ) |
---|
| 1219 | ENDIF |
---|
| 1220 | |
---|
[2696] | 1221 | ! |
---|
[3294] | 1222 | !-- User-defined quantities |
---|
[1] | 1223 | CALL user_3d_data_averaging( 'sum', doav(ii) ) |
---|
| 1224 | |
---|
| 1225 | END SELECT |
---|
| 1226 | |
---|
| 1227 | ENDDO |
---|
| 1228 | |
---|
[1318] | 1229 | CALL cpu_log( log_point(34), 'sum_up_3d_data', 'stop' ) |
---|
[1] | 1230 | |
---|
| 1231 | |
---|
| 1232 | END SUBROUTINE sum_up_3d_data |
---|