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