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