[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: |
---|
[1] | 21 | ! ----------------- |
---|
[3552] | 22 | ! variables documented |
---|
[1360] | 23 | ! |
---|
[1321] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: sum_up_3d_data.f90 3552 2018-11-22 10:28:35Z suehring $ |
---|
[3525] | 27 | ! Changes related to clean-up of biometeorology (dom_dwd_user) |
---|
| 28 | ! |
---|
| 29 | ! 3467 2018-10-30 19:05:21Z suehring |
---|
[3467] | 30 | ! Implementation of a new aerosol module salsa. |
---|
| 31 | ! |
---|
| 32 | ! 3448 2018-10-29 18:14:31Z kanani |
---|
[3448] | 33 | ! Adjustment of biometeorology calls |
---|
| 34 | ! |
---|
| 35 | ! 3421 2018-10-24 18:39:32Z gronemeier |
---|
[3421] | 36 | ! Renamed output variables |
---|
| 37 | ! |
---|
| 38 | ! 3337 2018-10-12 15:17:09Z kanani |
---|
[3337] | 39 | ! (from branch resler) |
---|
| 40 | ! Add biometeorology, |
---|
| 41 | ! fix chemistry output call, |
---|
| 42 | ! move usm calls |
---|
| 43 | ! |
---|
| 44 | ! 3294 2018-10-01 02:37:10Z raasch |
---|
[3294] | 45 | ! changes concerning modularization of ocean option |
---|
| 46 | ! |
---|
| 47 | ! 3291 2018-09-28 11:33:03Z scharf |
---|
[3291] | 48 | ! corrected previous commit for 3D topography |
---|
| 49 | ! |
---|
| 50 | ! 3285 2018-09-27 17:16:52Z scharf |
---|
[3285] | 51 | ! bugfix for shf_av and qsws_av |
---|
| 52 | ! |
---|
| 53 | ! 3274 2018-09-24 15:42:55Z knoop |
---|
[3274] | 54 | ! Modularization of all bulk cloud physics code components |
---|
| 55 | ! |
---|
| 56 | ! 3241 2018-09-12 15:02:00Z raasch |
---|
[3241] | 57 | ! unused variables removed |
---|
| 58 | ! |
---|
| 59 | ! 3176 2018-07-26 17:12:48Z suehring |
---|
[3176] | 60 | ! Remove output of latent heat flux at urban-surfaces and set fill values |
---|
| 61 | ! instead |
---|
| 62 | ! |
---|
| 63 | ! 3173 2018-07-26 12:55:23Z suehring |
---|
[3173] | 64 | ! Bugfix for last commit |
---|
| 65 | ! |
---|
| 66 | ! 3170 2018-07-25 15:19:37Z suehring |
---|
[3170] | 67 | ! Revise output of surface quantities in case of overhanging structures |
---|
| 68 | ! |
---|
| 69 | ! 3151 2018-07-19 08:45:38Z raasch |
---|
[3151] | 70 | ! Remaining preprocessor directive __chem removed |
---|
| 71 | ! |
---|
| 72 | ! 3004 2018-04-27 12:33:25Z Giersch |
---|
[3004] | 73 | ! prr field added to ONLY-list, prr* case/pr* case/precipitation_rate_av |
---|
| 74 | ! removed, further allocation checks implemented |
---|
| 75 | ! |
---|
| 76 | ! 2963 2018-04-12 14:47:44Z suehring |
---|
[2963] | 77 | ! Introduce index for vegetation/wall, pavement/green-wall and water/window |
---|
| 78 | ! surfaces, for clearer access of surface fraction, albedo, emissivity, etc. . |
---|
| 79 | ! |
---|
| 80 | ! 2894 2018-03-15 09:17:58Z Giersch |
---|
[2894] | 81 | ! Changed comment |
---|
| 82 | ! |
---|
| 83 | ! 2817 2018-02-19 16:32:21Z suehring |
---|
[2817] | 84 | ! Preliminary gust module interface implemented |
---|
| 85 | ! |
---|
| 86 | ! 2798 2018-02-09 17:16:39Z suehring |
---|
[2798] | 87 | ! Consider also default-type surfaces for surface temperature output. |
---|
| 88 | ! |
---|
| 89 | ! 2797 2018-02-08 13:24:35Z suehring |
---|
[2797] | 90 | ! Enable output of ground-heat flux also at urban surfaces. |
---|
| 91 | ! |
---|
| 92 | ! 2790 2018-02-06 11:57:19Z suehring |
---|
[2790] | 93 | ! Bugfix in summation of surface sensible and latent heat flux |
---|
| 94 | ! |
---|
| 95 | ! 2766 2018-01-22 17:17:47Z kanani |
---|
[2766] | 96 | ! Removed preprocessor directive __chem |
---|
| 97 | ! |
---|
| 98 | ! 2743 2018-01-12 16:03:39Z suehring |
---|
[2743] | 99 | ! In case of natural- and urban-type surfaces output surfaces fluxes in W/m2. |
---|
| 100 | ! |
---|
| 101 | ! 2742 2018-01-12 14:59:47Z suehring |
---|
[2742] | 102 | ! Enable output of surface temperature |
---|
| 103 | ! |
---|
| 104 | ! 2735 2018-01-11 12:01:27Z suehring |
---|
[2735] | 105 | ! output of r_a moved from land-surface to consider also urban-type surfaces |
---|
| 106 | ! |
---|
| 107 | ! 2718 2018-01-02 08:49:38Z maronga |
---|
[2716] | 108 | ! Corrected "Former revisions" section |
---|
| 109 | ! |
---|
| 110 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
| 111 | ! - Change in file header (GPL part) |
---|
[2696] | 112 | ! - Implementation of uv exposure model (FK) |
---|
| 113 | ! - output of diss_av, kh_av, km_av (turbulence_closure_mod) (TG) |
---|
| 114 | ! - Implementation of chemistry module (FK) |
---|
| 115 | ! - Workaround for sum-up usm arrays in case of restart runs, to avoid program |
---|
| 116 | ! crash (MS) |
---|
| 117 | ! |
---|
| 118 | ! 2292 2017-06-20 09:51:42Z schwenkel |
---|
[2292] | 119 | ! Implementation of new microphysic scheme: cloud_scheme = 'morrison' |
---|
| 120 | ! includes two more prognostic equations for cloud drop concentration (nc) |
---|
| 121 | ! and cloud water content (qc). |
---|
| 122 | ! |
---|
| 123 | ! 2233 2017-05-30 18:08:54Z suehring |
---|
[1321] | 124 | ! |
---|
[2233] | 125 | ! 2232 2017-05-30 17:47:52Z suehring |
---|
| 126 | ! Adjustments to new surface concept |
---|
| 127 | ! |
---|
[2032] | 128 | ! 2031 2016-10-21 15:11:58Z knoop |
---|
| 129 | ! renamed variable rho to rho_ocean and rho_av to rho_ocean_av |
---|
| 130 | ! |
---|
[2025] | 131 | ! 2024 2016-10-12 16:42:37Z kanani |
---|
| 132 | ! Added missing CASE for ssws* |
---|
| 133 | ! |
---|
[2012] | 134 | ! 2011 2016-09-19 17:29:57Z kanani |
---|
| 135 | ! Flag urban_surface is now defined in module control_parameters, |
---|
| 136 | ! changed prefix for urban surface model output to "usm_", |
---|
| 137 | ! introduced control parameter varnamelength for LEN of trimvar. |
---|
| 138 | ! |
---|
[2008] | 139 | ! 2007 2016-08-24 15:47:17Z kanani |
---|
| 140 | ! Added support for new urban surface model (temporary modifications of |
---|
| 141 | ! SELECT CASE ( ) necessary, see variable trimvar), |
---|
| 142 | ! added comments in variable declaration section |
---|
| 143 | ! |
---|
[2001] | 144 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
| 145 | ! Forced header and separation lines into 80 columns |
---|
| 146 | ! |
---|
[1993] | 147 | ! 1992 2016-08-12 15:14:59Z suehring |
---|
| 148 | ! Bugfix in summation of passive scalar |
---|
| 149 | ! |
---|
[1977] | 150 | ! 1976 2016-07-27 13:28:04Z maronga |
---|
| 151 | ! Radiation actions are now done directly in the respective module |
---|
| 152 | ! |
---|
[1973] | 153 | ! 1972 2016-07-26 07:52:02Z maronga |
---|
| 154 | ! Land surface actions are now done directly in the respective module |
---|
| 155 | ! |
---|
[1961] | 156 | ! 1960 2016-07-12 16:34:24Z suehring |
---|
| 157 | ! Scalar surface flux added |
---|
| 158 | ! |
---|
[1950] | 159 | ! 1949 2016-06-17 07:19:16Z maronga |
---|
| 160 | ! Bugfix: calculation of lai_av, c_veg_av and c_liq_av. |
---|
| 161 | ! |
---|
[1851] | 162 | ! 1849 2016-04-08 11:33:18Z hoffmann |
---|
| 163 | ! precipitation_rate moved to arrays_3d |
---|
[1852] | 164 | ! |
---|
[1789] | 165 | ! 1788 2016-03-10 11:01:04Z maronga |
---|
| 166 | ! Added z0q and z0q_av |
---|
| 167 | ! |
---|
[1694] | 168 | ! 1693 2015-10-27 08:35:45Z maronga |
---|
| 169 | ! Last revision text corrected |
---|
| 170 | ! |
---|
[1692] | 171 | ! 1691 2015-10-26 16:17:44Z maronga |
---|
| 172 | ! Added output of Obukhov length and radiative heating rates for RRTMG. |
---|
[1693] | 173 | ! Corrected output of liquid water path. |
---|
[1692] | 174 | ! |
---|
[1683] | 175 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 176 | ! Code annotations made doxygen readable |
---|
| 177 | ! |
---|
[1586] | 178 | ! 1585 2015-04-30 07:05:52Z maronga |
---|
| 179 | ! Adapted for RRTMG |
---|
| 180 | ! |
---|
[1556] | 181 | ! 1555 2015-03-04 17:44:27Z maronga |
---|
| 182 | ! Added output of r_a and r_s |
---|
| 183 | ! |
---|
[1552] | 184 | ! 1551 2015-03-03 14:18:16Z maronga |
---|
| 185 | ! Added support for land surface model and radiation model data. |
---|
| 186 | ! |
---|
[1360] | 187 | ! 1359 2014-04-11 17:15:14Z hoffmann |
---|
| 188 | ! New particle structure integrated. |
---|
| 189 | ! |
---|
[1354] | 190 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
| 191 | ! REAL constants provided with KIND-attribute |
---|
| 192 | ! |
---|
[1321] | 193 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 194 | ! ONLY-attribute added to USE-statements, |
---|
| 195 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 196 | ! kinds are defined in new module kinds, |
---|
| 197 | ! old module precision_kind is removed, |
---|
| 198 | ! revision history before 2012 removed, |
---|
| 199 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 200 | ! all variable declaration statements |
---|
[1] | 201 | ! |
---|
[1319] | 202 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
| 203 | ! barrier argument removed from cpu_log, |
---|
| 204 | ! module interfaces removed |
---|
| 205 | ! |
---|
[1116] | 206 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
| 207 | ! ql is calculated by calc_liquid_water_content |
---|
| 208 | ! |
---|
[1054] | 209 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
| 210 | ! +nr, prr, qr |
---|
| 211 | ! |
---|
[1037] | 212 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 213 | ! code put under GPL (PALM 3.9) |
---|
| 214 | ! |
---|
[1008] | 215 | ! 1007 2012-09-19 14:30:36Z franke |
---|
| 216 | ! Bugfix in calculation of ql_vp |
---|
| 217 | ! |
---|
[979] | 218 | ! 978 2012-08-09 08:28:32Z fricke |
---|
| 219 | ! +z0h* |
---|
| 220 | ! |
---|
[1] | 221 | ! Revision 1.1 2006/02/23 12:55:23 raasch |
---|
| 222 | ! Initial revision |
---|
| 223 | ! |
---|
| 224 | ! |
---|
| 225 | ! Description: |
---|
| 226 | ! ------------ |
---|
[1682] | 227 | !> Sum-up the values of 3d-arrays. The real averaging is later done in routine |
---|
| 228 | !> average_3d_data. |
---|
[1] | 229 | !------------------------------------------------------------------------------! |
---|
[1682] | 230 | SUBROUTINE sum_up_3d_data |
---|
| 231 | |
---|
[1] | 232 | |
---|
[1320] | 233 | USE arrays_3d, & |
---|
[3294] | 234 | ONLY: dzw, d_exner, e, heatflux_output_conversion, nc, nr, p, prr, & |
---|
| 235 | pt, q, qc, ql, ql_c, ql_v, qr, s, u, v, vpt, w, & |
---|
| 236 | waterflux_output_conversion |
---|
[1] | 237 | |
---|
[1320] | 238 | USE averaging, & |
---|
[3294] | 239 | ONLY: e_av, ghf_av, lpt_av, lwp_av, ol_av, p_av, pc_av, pr_av, pt_av, & |
---|
| 240 | q_av, ql_av, ql_c_av, ql_v_av, ql_vp_av, qsws_av, qv_av, & |
---|
| 241 | r_a_av, s_av, shf_av, ssws_av, ts_av, tsurf_av, u_av, us_av, & |
---|
| 242 | v_av, vpt_av, w_av, z0_av, z0h_av, z0q_av |
---|
[3241] | 243 | |
---|
[3274] | 244 | USE basic_constants_and_equations_mod, & |
---|
| 245 | ONLY: c_p, lv_d_cp, l_v |
---|
| 246 | |
---|
[3448] | 247 | USE biometeorology_mod, & |
---|
[3525] | 248 | ONLY: bio_3d_data_averaging |
---|
[3448] | 249 | |
---|
[3274] | 250 | USE bulk_cloud_model_mod, & |
---|
| 251 | ONLY: bulk_cloud_model, bcm_3d_data_averaging |
---|
| 252 | |
---|
[2696] | 253 | USE chemistry_model_mod, & |
---|
[3241] | 254 | ONLY: chem_3d_data_averaging |
---|
[1320] | 255 | |
---|
| 256 | USE control_parameters, & |
---|
[3448] | 257 | ONLY: air_chemistry, average_count_3d, biometeorology, doav, doav_n, & |
---|
| 258 | land_surface, ocean_mode, rho_surface, urban_surface, & |
---|
| 259 | uv_exposure, varnamelength |
---|
[1320] | 260 | |
---|
| 261 | USE cpulog, & |
---|
| 262 | ONLY: cpu_log, log_point |
---|
| 263 | |
---|
[2817] | 264 | USE gust_mod, & |
---|
| 265 | ONLY: gust_3d_data_averaging, gust_module_enabled |
---|
| 266 | |
---|
[1320] | 267 | USE indices, & |
---|
| 268 | ONLY: nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt |
---|
| 269 | |
---|
| 270 | USE kinds |
---|
| 271 | |
---|
[1551] | 272 | USE land_surface_model_mod, & |
---|
[2232] | 273 | ONLY: lsm_3d_data_averaging |
---|
[1551] | 274 | |
---|
[3294] | 275 | USE ocean_mod, & |
---|
| 276 | ONLY: ocean_3d_data_averaging |
---|
| 277 | |
---|
[1320] | 278 | USE particle_attributes, & |
---|
[1359] | 279 | ONLY: grid_particles, number_of_particles, particles, prt_count |
---|
[1320] | 280 | |
---|
[1551] | 281 | USE radiation_model_mod, & |
---|
[1976] | 282 | ONLY: radiation, radiation_3d_data_averaging |
---|
[3467] | 283 | |
---|
| 284 | USE salsa_mod, & |
---|
| 285 | ONLY: salsa, salsa_3d_data_averaging |
---|
[1551] | 286 | |
---|
[2232] | 287 | USE surface_mod, & |
---|
[2963] | 288 | ONLY: ind_pav_green, ind_veg_wall, ind_wat_win, & |
---|
| 289 | surf_def_h, surf_lsm_h, surf_usm_h |
---|
[2232] | 290 | |
---|
[2696] | 291 | USE turbulence_closure_mod, & |
---|
| 292 | ONLY: tcm_3d_data_averaging |
---|
| 293 | |
---|
[2007] | 294 | USE urban_surface_mod, & |
---|
[2011] | 295 | ONLY: usm_average_3d_data |
---|
[1691] | 296 | |
---|
[2696] | 297 | USE uv_exposure_model_mod, & |
---|
| 298 | ONLY: uvem_3d_data_averaging |
---|
[2007] | 299 | |
---|
[2696] | 300 | |
---|
[1] | 301 | IMPLICIT NONE |
---|
| 302 | |
---|
[3170] | 303 | LOGICAL :: match_def !< flag indicating default-type surface |
---|
| 304 | LOGICAL :: match_lsm !< flag indicating natural-type surface |
---|
| 305 | LOGICAL :: match_usm !< flag indicating urban-type surface |
---|
| 306 | |
---|
[2232] | 307 | INTEGER(iwp) :: i !< grid index x direction |
---|
[2007] | 308 | INTEGER(iwp) :: ii !< running index |
---|
[2232] | 309 | INTEGER(iwp) :: j !< grid index y direction |
---|
| 310 | INTEGER(iwp) :: k !< grid index x direction |
---|
[3552] | 311 | INTEGER(iwp) :: m !< running index over surfacle elements |
---|
| 312 | INTEGER(iwp) :: n !< running index over number of particles per grid box |
---|
[1] | 313 | |
---|
[3552] | 314 | REAL(wp) :: mean_r !< mean-particle radius witin grid box |
---|
| 315 | REAL(wp) :: s_r2 !< mean-particle radius witin grid box to the power of two |
---|
| 316 | REAL(wp) :: s_r3 !< mean-particle radius witin grid box to the power of three |
---|
[1] | 317 | |
---|
[2011] | 318 | CHARACTER (LEN=varnamelength) :: trimvar !< TRIM of output-variable string |
---|
[2007] | 319 | |
---|
| 320 | |
---|
[1] | 321 | CALL cpu_log (log_point(34),'sum_up_3d_data','start') |
---|
| 322 | |
---|
| 323 | ! |
---|
| 324 | !-- Allocate and initialize the summation arrays if called for the very first |
---|
| 325 | !-- time or the first time after average_3d_data has been called |
---|
| 326 | !-- (some or all of the arrays may have been already allocated |
---|
[2894] | 327 | !-- in rrd_local) |
---|
[1] | 328 | IF ( average_count_3d == 0 ) THEN |
---|
| 329 | |
---|
| 330 | DO ii = 1, doav_n |
---|
[3337] | 331 | |
---|
[2007] | 332 | trimvar = TRIM( doav(ii) ) |
---|
[3337] | 333 | |
---|
[2007] | 334 | SELECT CASE ( trimvar ) |
---|
[1] | 335 | |
---|
[2797] | 336 | CASE ( 'ghf*' ) |
---|
| 337 | IF ( .NOT. ALLOCATED( ghf_av ) ) THEN |
---|
| 338 | ALLOCATE( ghf_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 339 | ENDIF |
---|
| 340 | ghf_av = 0.0_wp |
---|
| 341 | |
---|
[1] | 342 | CASE ( 'e' ) |
---|
| 343 | IF ( .NOT. ALLOCATED( e_av ) ) THEN |
---|
[667] | 344 | ALLOCATE( e_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 345 | ENDIF |
---|
[1353] | 346 | e_av = 0.0_wp |
---|
[1] | 347 | |
---|
[3421] | 348 | CASE ( 'thetal' ) |
---|
[771] | 349 | IF ( .NOT. ALLOCATED( lpt_av ) ) THEN |
---|
| 350 | ALLOCATE( lpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 351 | ENDIF |
---|
[1353] | 352 | lpt_av = 0.0_wp |
---|
[771] | 353 | |
---|
[1] | 354 | CASE ( 'lwp*' ) |
---|
| 355 | IF ( .NOT. ALLOCATED( lwp_av ) ) THEN |
---|
[667] | 356 | ALLOCATE( lwp_av(nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 357 | ENDIF |
---|
[1353] | 358 | lwp_av = 0.0_wp |
---|
[1] | 359 | |
---|
[1691] | 360 | CASE ( 'ol*' ) |
---|
| 361 | IF ( .NOT. ALLOCATED( ol_av ) ) THEN |
---|
| 362 | ALLOCATE( ol_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 363 | ENDIF |
---|
| 364 | ol_av = 0.0_wp |
---|
| 365 | |
---|
[1] | 366 | CASE ( 'p' ) |
---|
| 367 | IF ( .NOT. ALLOCATED( p_av ) ) THEN |
---|
[667] | 368 | ALLOCATE( p_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 369 | ENDIF |
---|
[1353] | 370 | p_av = 0.0_wp |
---|
[1] | 371 | |
---|
| 372 | CASE ( 'pc' ) |
---|
| 373 | IF ( .NOT. ALLOCATED( pc_av ) ) THEN |
---|
[667] | 374 | ALLOCATE( pc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 375 | ENDIF |
---|
[1353] | 376 | pc_av = 0.0_wp |
---|
[1] | 377 | |
---|
| 378 | CASE ( 'pr' ) |
---|
| 379 | IF ( .NOT. ALLOCATED( pr_av ) ) THEN |
---|
[667] | 380 | ALLOCATE( pr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 381 | ENDIF |
---|
[1353] | 382 | pr_av = 0.0_wp |
---|
[1] | 383 | |
---|
[3421] | 384 | CASE ( 'theta' ) |
---|
[1] | 385 | IF ( .NOT. ALLOCATED( pt_av ) ) THEN |
---|
[667] | 386 | ALLOCATE( pt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 387 | ENDIF |
---|
[1353] | 388 | pt_av = 0.0_wp |
---|
[1] | 389 | |
---|
| 390 | CASE ( 'q' ) |
---|
| 391 | IF ( .NOT. ALLOCATED( q_av ) ) THEN |
---|
[667] | 392 | ALLOCATE( q_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 393 | ENDIF |
---|
[1353] | 394 | q_av = 0.0_wp |
---|
[1] | 395 | |
---|
| 396 | CASE ( 'ql' ) |
---|
| 397 | IF ( .NOT. ALLOCATED( ql_av ) ) THEN |
---|
[667] | 398 | ALLOCATE( ql_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 399 | ENDIF |
---|
[1353] | 400 | ql_av = 0.0_wp |
---|
[1] | 401 | |
---|
| 402 | CASE ( 'ql_c' ) |
---|
| 403 | IF ( .NOT. ALLOCATED( ql_c_av ) ) THEN |
---|
[667] | 404 | ALLOCATE( ql_c_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 405 | ENDIF |
---|
[1353] | 406 | ql_c_av = 0.0_wp |
---|
[1] | 407 | |
---|
| 408 | CASE ( 'ql_v' ) |
---|
| 409 | IF ( .NOT. ALLOCATED( ql_v_av ) ) THEN |
---|
[667] | 410 | ALLOCATE( ql_v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 411 | ENDIF |
---|
[1353] | 412 | ql_v_av = 0.0_wp |
---|
[1] | 413 | |
---|
| 414 | CASE ( 'ql_vp' ) |
---|
| 415 | IF ( .NOT. ALLOCATED( ql_vp_av ) ) THEN |
---|
[667] | 416 | ALLOCATE( ql_vp_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 417 | ENDIF |
---|
[1353] | 418 | ql_vp_av = 0.0_wp |
---|
[1] | 419 | |
---|
[354] | 420 | CASE ( 'qsws*' ) |
---|
| 421 | IF ( .NOT. ALLOCATED( qsws_av ) ) THEN |
---|
[667] | 422 | ALLOCATE( qsws_av(nysg:nyng,nxlg:nxrg) ) |
---|
[354] | 423 | ENDIF |
---|
[1353] | 424 | qsws_av = 0.0_wp |
---|
[354] | 425 | |
---|
[1] | 426 | CASE ( 'qv' ) |
---|
| 427 | IF ( .NOT. ALLOCATED( qv_av ) ) THEN |
---|
[667] | 428 | ALLOCATE( qv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 429 | ENDIF |
---|
[1353] | 430 | qv_av = 0.0_wp |
---|
[1] | 431 | |
---|
[2735] | 432 | CASE ( 'r_a*' ) |
---|
| 433 | IF ( .NOT. ALLOCATED( r_a_av ) ) THEN |
---|
| 434 | ALLOCATE( r_a_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 435 | ENDIF |
---|
| 436 | r_a_av = 0.0_wp |
---|
| 437 | |
---|
[1] | 438 | CASE ( 's' ) |
---|
| 439 | IF ( .NOT. ALLOCATED( s_av ) ) THEN |
---|
[667] | 440 | ALLOCATE( s_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 441 | ENDIF |
---|
[1353] | 442 | s_av = 0.0_wp |
---|
[1] | 443 | |
---|
[354] | 444 | CASE ( 'shf*' ) |
---|
| 445 | IF ( .NOT. ALLOCATED( shf_av ) ) THEN |
---|
[667] | 446 | ALLOCATE( shf_av(nysg:nyng,nxlg:nxrg) ) |
---|
[354] | 447 | ENDIF |
---|
[1353] | 448 | shf_av = 0.0_wp |
---|
[2024] | 449 | |
---|
| 450 | CASE ( 'ssws*' ) |
---|
| 451 | IF ( .NOT. ALLOCATED( ssws_av ) ) THEN |
---|
| 452 | ALLOCATE( ssws_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 453 | ENDIF |
---|
| 454 | ssws_av = 0.0_wp |
---|
[354] | 455 | |
---|
[1] | 456 | CASE ( 't*' ) |
---|
| 457 | IF ( .NOT. ALLOCATED( ts_av ) ) THEN |
---|
[667] | 458 | ALLOCATE( ts_av(nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 459 | ENDIF |
---|
[1353] | 460 | ts_av = 0.0_wp |
---|
[1] | 461 | |
---|
[2742] | 462 | CASE ( 'tsurf*' ) |
---|
| 463 | IF ( .NOT. ALLOCATED( tsurf_av ) ) THEN |
---|
| 464 | ALLOCATE( tsurf_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 465 | ENDIF |
---|
| 466 | tsurf_av = 0.0_wp |
---|
| 467 | |
---|
[1] | 468 | CASE ( 'u' ) |
---|
| 469 | IF ( .NOT. ALLOCATED( u_av ) ) THEN |
---|
[667] | 470 | ALLOCATE( u_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 471 | ENDIF |
---|
[1353] | 472 | u_av = 0.0_wp |
---|
[1] | 473 | |
---|
[3421] | 474 | CASE ( 'us*' ) |
---|
[1] | 475 | IF ( .NOT. ALLOCATED( us_av ) ) THEN |
---|
[667] | 476 | ALLOCATE( us_av(nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 477 | ENDIF |
---|
[1353] | 478 | us_av = 0.0_wp |
---|
[1] | 479 | |
---|
| 480 | CASE ( 'v' ) |
---|
| 481 | IF ( .NOT. ALLOCATED( v_av ) ) THEN |
---|
[667] | 482 | ALLOCATE( v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 483 | ENDIF |
---|
[1353] | 484 | v_av = 0.0_wp |
---|
[1] | 485 | |
---|
[3421] | 486 | CASE ( 'thetav' ) |
---|
[1] | 487 | IF ( .NOT. ALLOCATED( vpt_av ) ) THEN |
---|
[667] | 488 | ALLOCATE( vpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 489 | ENDIF |
---|
[1353] | 490 | vpt_av = 0.0_wp |
---|
[1] | 491 | |
---|
| 492 | CASE ( 'w' ) |
---|
| 493 | IF ( .NOT. ALLOCATED( w_av ) ) THEN |
---|
[667] | 494 | ALLOCATE( w_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 495 | ENDIF |
---|
[1353] | 496 | w_av = 0.0_wp |
---|
[1] | 497 | |
---|
[72] | 498 | CASE ( 'z0*' ) |
---|
| 499 | IF ( .NOT. ALLOCATED( z0_av ) ) THEN |
---|
[667] | 500 | ALLOCATE( z0_av(nysg:nyng,nxlg:nxrg) ) |
---|
[72] | 501 | ENDIF |
---|
[1353] | 502 | z0_av = 0.0_wp |
---|
[72] | 503 | |
---|
[978] | 504 | CASE ( 'z0h*' ) |
---|
| 505 | IF ( .NOT. ALLOCATED( z0h_av ) ) THEN |
---|
| 506 | ALLOCATE( z0h_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 507 | ENDIF |
---|
[1353] | 508 | z0h_av = 0.0_wp |
---|
[978] | 509 | |
---|
[1788] | 510 | CASE ( 'z0q*' ) |
---|
| 511 | IF ( .NOT. ALLOCATED( z0q_av ) ) THEN |
---|
| 512 | ALLOCATE( z0q_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 513 | ENDIF |
---|
| 514 | z0q_av = 0.0_wp |
---|
[3294] | 515 | |
---|
[2007] | 516 | |
---|
[1] | 517 | CASE DEFAULT |
---|
[1972] | 518 | |
---|
[1] | 519 | ! |
---|
[3294] | 520 | !-- Allocating and initializing data arrays for other modules |
---|
[3337] | 521 | |
---|
| 522 | IF ( air_chemistry .AND. & |
---|
| 523 | (trimvar(1:3) == 'kc_' .OR. trimvar(1:3) == 'em_') ) THEN |
---|
| 524 | CALL chem_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 525 | ENDIF |
---|
| 526 | |
---|
[3274] | 527 | IF ( bulk_cloud_model ) THEN |
---|
| 528 | CALL bcm_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 529 | ENDIF |
---|
| 530 | |
---|
[3294] | 531 | IF ( gust_module_enabled ) THEN |
---|
| 532 | CALL gust_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 533 | ENDIF |
---|
| 534 | |
---|
[3525] | 535 | IF ( biometeorology .AND. trimvar(1:4) == 'bio_') THEN |
---|
| 536 | CALL bio_3d_data_averaging( 'allocate', doav(ii) ) |
---|
[3448] | 537 | ENDIF |
---|
| 538 | |
---|
[1972] | 539 | IF ( land_surface ) THEN |
---|
| 540 | CALL lsm_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 541 | ENDIF |
---|
| 542 | |
---|
[3294] | 543 | IF ( ocean_mode ) THEN |
---|
| 544 | CALL ocean_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 545 | ENDIF |
---|
| 546 | |
---|
[1976] | 547 | IF ( radiation ) THEN |
---|
| 548 | CALL radiation_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 549 | ENDIF |
---|
[3467] | 550 | |
---|
| 551 | ! |
---|
| 552 | !-- SALSA quantity |
---|
| 553 | IF ( salsa ) THEN |
---|
| 554 | CALL salsa_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 555 | ENDIF |
---|
[1976] | 556 | |
---|
[3337] | 557 | CALL tcm_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 558 | |
---|
| 559 | IF ( urban_surface .AND. trimvar(1:4) == 'usm_' ) THEN |
---|
| 560 | CALL usm_average_3d_data( 'allocate', doav(ii) ) |
---|
| 561 | ENDIF |
---|
| 562 | |
---|
[2696] | 563 | IF ( uv_exposure .AND. trimvar(1:5) == 'uvem_') THEN |
---|
| 564 | CALL uvem_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 565 | ENDIF |
---|
| 566 | |
---|
| 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 | |
---|
[3525] | 1189 | IF ( biometeorology .AND. trimvar(1:4) == 'bio_' ) THEN |
---|
| 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 | IF ( uv_exposure ) THEN |
---|
| 1222 | CALL uvem_3d_data_averaging( 'sum', doav(ii) ) |
---|
| 1223 | ENDIF |
---|
| 1224 | |
---|
| 1225 | ! |
---|
[3294] | 1226 | !-- User-defined quantities |
---|
[1] | 1227 | CALL user_3d_data_averaging( 'sum', doav(ii) ) |
---|
| 1228 | |
---|
| 1229 | END SELECT |
---|
| 1230 | |
---|
| 1231 | ENDDO |
---|
| 1232 | |
---|
[1318] | 1233 | CALL cpu_log( log_point(34), 'sum_up_3d_data', 'stop' ) |
---|
[1] | 1234 | |
---|
| 1235 | |
---|
| 1236 | END SUBROUTINE sum_up_3d_data |
---|