[1682] | 1 | !> @file average_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 | ! ----------------- |
---|
[3589] | 22 | ! |
---|
| 23 | ! |
---|
| 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: average_3d_data.f90 3597 2018-12-04 08:40:18Z kanani $ |
---|
[3597] | 27 | ! Added theta_2m |
---|
| 28 | ! |
---|
| 29 | ! 3589 2018-11-30 15:09:51Z suehring |
---|
[3582] | 30 | ! Move the control parameter "salsa" from salsa_mod to control_parameters |
---|
| 31 | ! (M. Kurppa) |
---|
| 32 | ! |
---|
[3589] | 33 | ! 3582 2018-11-29 19:16:36Z suehring |
---|
[3569] | 34 | ! dom_dwd_user: |
---|
| 35 | ! Clean up biometeorology call |
---|
| 36 | ! |
---|
| 37 | ! 3525 2018-11-14 16:06:14Z kanani |
---|
[3525] | 38 | ! Changes related to clean-up of biometeorology (dom_dwd_user) |
---|
[3467] | 39 | ! |
---|
[3525] | 40 | ! 3467 2018-10-30 19:05:21Z suehring |
---|
| 41 | ! Implementation of a new aerosol module salsa. |
---|
| 42 | ! |
---|
[3467] | 43 | ! 3448 2018-10-29 18:14:31Z kanani |
---|
[3448] | 44 | ! Adjustment of biometeorology calls |
---|
| 45 | ! |
---|
| 46 | ! 3421 2018-10-24 18:39:32Z gronemeier |
---|
[3421] | 47 | ! Renamed output variables |
---|
| 48 | ! |
---|
| 49 | ! 3419 2018-10-24 17:27:31Z gronemeier |
---|
[3337] | 50 | ! (from resler branch) |
---|
| 51 | ! Add biometeorology output, |
---|
| 52 | ! fix for chemistry output, |
---|
| 53 | ! move of urban surface output |
---|
| 54 | ! |
---|
| 55 | ! 3294 2018-10-01 02:37:10Z raasch |
---|
[3294] | 56 | ! changes concerning modularization of ocean option |
---|
| 57 | ! |
---|
| 58 | ! 3274 2018-09-24 15:42:55Z knoop |
---|
[3274] | 59 | ! Modularization of all bulk cloud physics code components |
---|
| 60 | ! |
---|
| 61 | ! 3004 2018-04-27 12:33:25Z Giersch |
---|
[3004] | 62 | ! Further allocation checks implemented, case z0q* added |
---|
| 63 | ! |
---|
| 64 | ! 2885 2018-03-14 11:02:46Z Giersch |
---|
[2817] | 65 | ! Preliminary gust module interface implemented |
---|
| 66 | ! |
---|
| 67 | ! 2797 2018-02-08 13:24:35Z suehring |
---|
[2797] | 68 | ! Enable output of ground-heat flux also at urban surfaces. |
---|
| 69 | ! |
---|
| 70 | ! 2766 2018-01-22 17:17:47Z kanani |
---|
[2766] | 71 | ! Removed preprocessor directive __chem |
---|
| 72 | ! |
---|
| 73 | ! 2742 2018-01-12 14:59:47Z suehring |
---|
[2742] | 74 | ! Enable output of surface temperature |
---|
| 75 | ! |
---|
| 76 | ! 2735 2018-01-11 12:01:27Z suehring |
---|
[2735] | 77 | ! output of r_a moved from land-surface to consider also urban-type surfaces |
---|
| 78 | ! |
---|
| 79 | ! 2718 2018-01-02 08:49:38Z maronga |
---|
[2716] | 80 | ! Corrected "Former revisions" section |
---|
| 81 | ! |
---|
| 82 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
| 83 | ! Change in file header (GPL part) |
---|
[2696] | 84 | ! Implement call for turbulence_closure_mod (TG) |
---|
| 85 | ! Implementation of chemistry module (FK) |
---|
| 86 | ! |
---|
| 87 | ! 2292 2017-06-20 09:51:42Z schwenkel |
---|
[2292] | 88 | ! Implementation of new microphysic scheme: cloud_scheme = 'morrison' |
---|
| 89 | ! includes two more prognostic equations for cloud drop concentration (nc) |
---|
[3467] | 90 | ! and cloud water content (qc). |
---|
[2292] | 91 | ! |
---|
| 92 | ! 2233 2017-05-30 18:08:54Z suehring |
---|
[1321] | 93 | ! |
---|
[2233] | 94 | ! 2232 2017-05-30 17:47:52Z suehring |
---|
| 95 | ! Adjustments to new surface concept - additional ghost point exchange |
---|
| 96 | ! of surface variable required |
---|
| 97 | ! |
---|
[2032] | 98 | ! 2031 2016-10-21 15:11:58Z knoop |
---|
| 99 | ! renamed variable rho to rho_ocean and rho_av to rho_ocean_av |
---|
| 100 | ! |
---|
[2012] | 101 | ! 2011 2016-09-19 17:29:57Z kanani |
---|
| 102 | ! Flag urban_surface is now defined in module control_parameters, |
---|
| 103 | ! changed prefix for urban surface model output to "usm_", |
---|
| 104 | ! introduced control parameter varnamelength for LEN of trimvar. |
---|
| 105 | ! |
---|
[2008] | 106 | ! 2007 2016-08-24 15:47:17Z kanani |
---|
| 107 | ! Added support for new urban surface model (temporary modifications of |
---|
| 108 | ! SELECT CASE ( ) necessary, see variable trimvar), |
---|
| 109 | ! added comments in variable declaration section |
---|
| 110 | ! |
---|
[2001] | 111 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
| 112 | ! Forced header and separation lines into 80 columns |
---|
| 113 | ! |
---|
[1973] | 114 | ! 1972 2016-07-26 07:52:02Z maronga |
---|
| 115 | ! Output of land surface quantities is now done directly in the respective module |
---|
| 116 | ! |
---|
[1961] | 117 | ! 1960 2016-07-12 16:34:24Z suehring |
---|
| 118 | ! Treat humidity and passive scalar separately |
---|
| 119 | ! |
---|
[1692] | 120 | ! 1691 2015-10-26 16:17:44Z maronga |
---|
| 121 | ! Added output of Obukhov length and radiative heating rates for RRTMG. |
---|
| 122 | ! |
---|
[1683] | 123 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 124 | ! Code annotations made doxygen readable |
---|
| 125 | ! |
---|
[1586] | 126 | ! 1585 2015-04-30 07:05:52Z maronga |
---|
| 127 | ! Adapted for RRTMG |
---|
| 128 | ! |
---|
[1556] | 129 | ! 1555 2015-03-04 17:44:27Z maronga |
---|
| 130 | ! Added output of r_a and r_s |
---|
| 131 | ! |
---|
[1552] | 132 | ! 1551 2015-03-03 14:18:16Z maronga |
---|
| 133 | ! Added support for land surface and radiation model parameters. |
---|
| 134 | ! |
---|
[1323] | 135 | ! 1322 2014-03-20 16:38:49Z raasch |
---|
| 136 | ! REAL functions provided with KIND-attribute |
---|
| 137 | ! |
---|
[1321] | 138 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 139 | ! ONLY-attribute added to USE-statements, |
---|
| 140 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 141 | ! kinds are defined in new module kinds, |
---|
| 142 | ! revision history before 2012 removed, |
---|
| 143 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 144 | ! all variable declaration statements |
---|
[772] | 145 | ! |
---|
[1319] | 146 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
| 147 | ! barrier argument removed from cpu_log, |
---|
| 148 | ! module interfaces removed |
---|
| 149 | ! |
---|
[1116] | 150 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
| 151 | ! +qc |
---|
| 152 | ! |
---|
[1054] | 153 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
| 154 | ! averaging of nr, qr added |
---|
| 155 | ! |
---|
[1037] | 156 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 157 | ! code put under GPL (PALM 3.9) |
---|
| 158 | ! |
---|
[979] | 159 | ! 978 2012-08-09 08:28:32Z fricke |
---|
| 160 | ! +z0h_av |
---|
[77] | 161 | ! |
---|
[1] | 162 | ! Revision 1.1 2006/02/23 09:48:58 raasch |
---|
| 163 | ! Initial revision |
---|
| 164 | ! |
---|
| 165 | ! |
---|
| 166 | ! Description: |
---|
| 167 | ! ------------ |
---|
[1682] | 168 | !> Time-averaging of 3d-data-arrays. |
---|
[1] | 169 | !------------------------------------------------------------------------------! |
---|
[1682] | 170 | SUBROUTINE average_3d_data |
---|
| 171 | |
---|
[1] | 172 | |
---|
| 173 | USE averaging |
---|
| 174 | |
---|
[3448] | 175 | USE biometeorology_mod, & |
---|
[3525] | 176 | ONLY: bio_3d_data_averaging |
---|
[3448] | 177 | |
---|
[3274] | 178 | USE bulk_cloud_model_mod, & |
---|
| 179 | ONLY: bulk_cloud_model, bcm_3d_data_averaging |
---|
| 180 | |
---|
[2696] | 181 | USE chemistry_model_mod, & |
---|
| 182 | ONLY: chem_3d_data_averaging |
---|
| 183 | |
---|
[1320] | 184 | USE control_parameters, & |
---|
[3448] | 185 | ONLY: air_chemistry, average_count_3d, biometeorology, doav, doav_n, & |
---|
[3582] | 186 | land_surface, ocean_mode, salsa, urban_surface, varnamelength |
---|
[1320] | 187 | |
---|
| 188 | USE cpulog, & |
---|
| 189 | ONLY: cpu_log, log_point |
---|
| 190 | |
---|
[2817] | 191 | USE gust_mod, & |
---|
| 192 | ONLY: gust_3d_data_averaging, gust_module_enabled |
---|
| 193 | |
---|
[1320] | 194 | USE indices, & |
---|
[2232] | 195 | ONLY: nbgp, nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt |
---|
[1320] | 196 | |
---|
| 197 | USE kinds |
---|
| 198 | |
---|
[1551] | 199 | USE land_surface_model_mod, & |
---|
[2232] | 200 | ONLY: lsm_3d_data_averaging |
---|
[1320] | 201 | |
---|
[3294] | 202 | USE ocean_mod, & |
---|
| 203 | ONLY: ocean_3d_data_averaging |
---|
| 204 | |
---|
[1551] | 205 | USE radiation_model_mod, & |
---|
[1976] | 206 | ONLY: radiation, radiation_3d_data_averaging |
---|
[3467] | 207 | |
---|
| 208 | USE salsa_mod, & |
---|
[3582] | 209 | ONLY: salsa_3d_data_averaging |
---|
[1551] | 210 | |
---|
[2696] | 211 | USE turbulence_closure_mod, & |
---|
| 212 | ONLY: tcm_3d_data_averaging |
---|
| 213 | |
---|
[2007] | 214 | USE urban_surface_mod, & |
---|
[2011] | 215 | ONLY: usm_average_3d_data |
---|
[1691] | 216 | |
---|
[2007] | 217 | |
---|
[2696] | 218 | |
---|
| 219 | |
---|
[1] | 220 | IMPLICIT NONE |
---|
| 221 | |
---|
[3294] | 222 | INTEGER(iwp) :: i !< loop index |
---|
| 223 | INTEGER(iwp) :: ii !< loop index |
---|
| 224 | INTEGER(iwp) :: j !< loop index |
---|
| 225 | INTEGER(iwp) :: k !< loop index |
---|
[1] | 226 | |
---|
[2011] | 227 | CHARACTER (LEN=varnamelength) :: trimvar !< TRIM of output-variable string |
---|
[1] | 228 | |
---|
[2007] | 229 | |
---|
[1] | 230 | CALL cpu_log (log_point(35),'average_3d_data','start') |
---|
| 231 | |
---|
| 232 | ! |
---|
| 233 | !-- Check, if averaging is necessary |
---|
| 234 | IF ( average_count_3d <= 1 ) RETURN |
---|
| 235 | |
---|
| 236 | ! |
---|
| 237 | !-- Loop of all variables to be averaged. |
---|
| 238 | DO ii = 1, doav_n |
---|
| 239 | |
---|
[2007] | 240 | trimvar = TRIM( doav(ii) ) |
---|
| 241 | |
---|
| 242 | ! |
---|
[1] | 243 | !-- Store the array chosen on the temporary array. |
---|
[2007] | 244 | SELECT CASE ( trimvar ) |
---|
[1] | 245 | |
---|
| 246 | CASE ( 'e' ) |
---|
[3004] | 247 | IF ( ALLOCATED( e_av ) ) THEN |
---|
| 248 | DO i = nxlg, nxrg |
---|
| 249 | DO j = nysg, nyng |
---|
| 250 | DO k = nzb, nzt+1 |
---|
| 251 | e_av(k,j,i) = e_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 252 | ENDDO |
---|
[1] | 253 | ENDDO |
---|
| 254 | ENDDO |
---|
[3004] | 255 | ENDIF |
---|
[1] | 256 | |
---|
[2797] | 257 | CASE ( 'ghf*' ) |
---|
[3004] | 258 | IF ( ALLOCATED( ghf_av ) ) THEN |
---|
| 259 | DO i = nxl, nxr |
---|
| 260 | DO j = nys, nyn |
---|
| 261 | ghf_av(j,i) = ghf_av(j,i) & |
---|
| 262 | / REAL( average_count_3d, KIND=wp ) |
---|
| 263 | ENDDO |
---|
[2797] | 264 | ENDDO |
---|
[3004] | 265 | CALL exchange_horiz_2d( ghf_av, nbgp ) |
---|
| 266 | ENDIF |
---|
[2797] | 267 | |
---|
[354] | 268 | CASE ( 'qsws*' ) |
---|
[3004] | 269 | IF ( ALLOCATED( qsws_av ) ) THEN |
---|
| 270 | DO i = nxlg, nxrg |
---|
| 271 | DO j = nysg, nyng |
---|
| 272 | qsws_av(j,i) = qsws_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 273 | ENDDO |
---|
[354] | 274 | ENDDO |
---|
[3004] | 275 | CALL exchange_horiz_2d( qsws_av, nbgp ) |
---|
| 276 | ENDIF |
---|
[354] | 277 | |
---|
[3421] | 278 | CASE ( 'thetal' ) |
---|
[3004] | 279 | IF ( ALLOCATED( lpt_av ) ) THEN |
---|
| 280 | DO i = nxlg, nxrg |
---|
| 281 | DO j = nysg, nyng |
---|
| 282 | DO k = nzb, nzt+1 |
---|
| 283 | lpt_av(k,j,i) = lpt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 284 | ENDDO |
---|
[771] | 285 | ENDDO |
---|
| 286 | ENDDO |
---|
[3004] | 287 | ENDIF |
---|
[771] | 288 | |
---|
[1] | 289 | CASE ( 'lwp*' ) |
---|
[3004] | 290 | IF ( ALLOCATED( lwp_av ) ) THEN |
---|
| 291 | DO i = nxlg, nxrg |
---|
| 292 | DO j = nysg, nyng |
---|
| 293 | lwp_av(j,i) = lwp_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 294 | ENDDO |
---|
[1] | 295 | ENDDO |
---|
[3004] | 296 | ENDIF |
---|
[1] | 297 | |
---|
[1691] | 298 | CASE ( 'ol*' ) |
---|
[3004] | 299 | IF ( ALLOCATED( ol_av ) ) THEN |
---|
| 300 | DO i = nxlg, nxrg |
---|
| 301 | DO j = nysg, nyng |
---|
| 302 | ol_av(j,i) = ol_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 303 | ENDDO |
---|
[1691] | 304 | ENDDO |
---|
[3004] | 305 | CALL exchange_horiz_2d( ol_av, nbgp ) |
---|
| 306 | ENDIF |
---|
[1691] | 307 | |
---|
[1] | 308 | CASE ( 'p' ) |
---|
[3004] | 309 | IF ( ALLOCATED( p_av ) ) THEN |
---|
| 310 | DO i = nxlg, nxrg |
---|
| 311 | DO j = nysg, nyng |
---|
| 312 | DO k = nzb, nzt+1 |
---|
| 313 | p_av(k,j,i) = p_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 314 | ENDDO |
---|
[1] | 315 | ENDDO |
---|
| 316 | ENDDO |
---|
[3004] | 317 | ENDIF |
---|
[1] | 318 | |
---|
| 319 | CASE ( 'pc' ) |
---|
[3004] | 320 | IF ( ALLOCATED( pc_av ) ) THEN |
---|
| 321 | DO i = nxl, nxr |
---|
| 322 | DO j = nys, nyn |
---|
| 323 | DO k = nzb, nzt+1 |
---|
| 324 | pc_av(k,j,i) = pc_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 325 | ENDDO |
---|
[1] | 326 | ENDDO |
---|
| 327 | ENDDO |
---|
[3004] | 328 | ENDIF |
---|
[1] | 329 | |
---|
| 330 | CASE ( 'pr' ) |
---|
[3004] | 331 | IF ( ALLOCATED( pr_av ) ) THEN |
---|
| 332 | DO i = nxl, nxr |
---|
| 333 | DO j = nys, nyn |
---|
| 334 | DO k = nzb, nzt+1 |
---|
| 335 | pr_av(k,j,i) = pr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 336 | ENDDO |
---|
[1] | 337 | ENDDO |
---|
| 338 | ENDDO |
---|
[3004] | 339 | ENDIF |
---|
[1] | 340 | |
---|
[3421] | 341 | CASE ( 'theta' ) |
---|
[3004] | 342 | IF ( ALLOCATED( pt_av ) ) THEN |
---|
| 343 | DO i = nxlg, nxrg |
---|
| 344 | DO j = nysg, nyng |
---|
| 345 | DO k = nzb, nzt+1 |
---|
| 346 | pt_av(k,j,i) = pt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 347 | ENDDO |
---|
[1] | 348 | ENDDO |
---|
| 349 | ENDDO |
---|
[3004] | 350 | ENDIF |
---|
[1] | 351 | |
---|
| 352 | CASE ( 'q' ) |
---|
[3004] | 353 | IF ( ALLOCATED( q_av ) ) THEN |
---|
| 354 | DO i = nxlg, nxrg |
---|
| 355 | DO j = nysg, nyng |
---|
| 356 | DO k = nzb, nzt+1 |
---|
| 357 | q_av(k,j,i) = q_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 358 | ENDDO |
---|
[1] | 359 | ENDDO |
---|
| 360 | ENDDO |
---|
[3004] | 361 | ENDIF |
---|
[367] | 362 | |
---|
[1] | 363 | CASE ( 'ql' ) |
---|
[3004] | 364 | IF ( ALLOCATED( ql_av ) ) THEN |
---|
| 365 | DO i = nxlg, nxrg |
---|
| 366 | DO j = nysg, nyng |
---|
| 367 | DO k = nzb, nzt+1 |
---|
| 368 | ql_av(k,j,i) = ql_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 369 | ENDDO |
---|
[1] | 370 | ENDDO |
---|
| 371 | ENDDO |
---|
[3004] | 372 | ENDIF |
---|
[1] | 373 | |
---|
| 374 | CASE ( 'ql_c' ) |
---|
[3004] | 375 | IF ( ALLOCATED( ql_c_av ) ) THEN |
---|
| 376 | DO i = nxlg, nxrg |
---|
| 377 | DO j = nysg, nyng |
---|
| 378 | DO k = nzb, nzt+1 |
---|
| 379 | ql_c_av(k,j,i) = ql_c_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 380 | ENDDO |
---|
[1] | 381 | ENDDO |
---|
| 382 | ENDDO |
---|
[3004] | 383 | ENDIF |
---|
[1] | 384 | |
---|
| 385 | CASE ( 'ql_v' ) |
---|
[3004] | 386 | IF ( ALLOCATED( ql_v_av ) ) THEN |
---|
| 387 | DO i = nxlg, nxrg |
---|
| 388 | DO j = nysg, nyng |
---|
| 389 | DO k = nzb, nzt+1 |
---|
| 390 | ql_v_av(k,j,i) = ql_v_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 391 | ENDDO |
---|
[1] | 392 | ENDDO |
---|
| 393 | ENDDO |
---|
[3004] | 394 | ENDIF |
---|
[1] | 395 | |
---|
| 396 | CASE ( 'ql_vp' ) |
---|
[3004] | 397 | IF ( ALLOCATED( ql_vp_av ) ) THEN |
---|
| 398 | DO i = nxlg, nxrg |
---|
| 399 | DO j = nysg, nyng |
---|
| 400 | DO k = nzb, nzt+1 |
---|
| 401 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) / & |
---|
| 402 | REAL( average_count_3d, KIND=wp ) |
---|
| 403 | ENDDO |
---|
[1] | 404 | ENDDO |
---|
| 405 | ENDDO |
---|
[3004] | 406 | ENDIF |
---|
[1] | 407 | |
---|
| 408 | CASE ( 'qv' ) |
---|
[3004] | 409 | IF ( ALLOCATED( qv_av ) ) THEN |
---|
| 410 | DO i = nxlg, nxrg |
---|
| 411 | DO j = nysg, nyng |
---|
| 412 | DO k = nzb, nzt+1 |
---|
| 413 | qv_av(k,j,i) = qv_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 414 | ENDDO |
---|
[1] | 415 | ENDDO |
---|
| 416 | ENDDO |
---|
[3004] | 417 | ENDIF |
---|
[367] | 418 | |
---|
[2735] | 419 | CASE ( 'r_a*' ) |
---|
[3004] | 420 | IF ( ALLOCATED( r_a_av ) ) THEN |
---|
| 421 | DO i = nxlg, nxrg |
---|
| 422 | DO j = nysg, nyng |
---|
| 423 | r_a_av(j,i) = r_a_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 424 | ENDDO |
---|
[2735] | 425 | ENDDO |
---|
[3004] | 426 | CALL exchange_horiz_2d( r_a_av, nbgp ) |
---|
| 427 | ENDIF |
---|
[2735] | 428 | |
---|
[1] | 429 | CASE ( 's' ) |
---|
[3004] | 430 | IF ( ALLOCATED( s_av ) ) THEN |
---|
| 431 | DO i = nxlg, nxrg |
---|
| 432 | DO j = nysg, nyng |
---|
| 433 | DO k = nzb, nzt+1 |
---|
| 434 | s_av(k,j,i) = s_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 435 | ENDDO |
---|
[1] | 436 | ENDDO |
---|
| 437 | ENDDO |
---|
[3004] | 438 | ENDIF |
---|
[367] | 439 | |
---|
[354] | 440 | CASE ( 'shf*' ) |
---|
[3004] | 441 | IF ( ALLOCATED( shf_av ) ) THEN |
---|
| 442 | DO i = nxlg, nxrg |
---|
| 443 | DO j = nysg, nyng |
---|
| 444 | shf_av(j,i) = shf_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 445 | ENDDO |
---|
[354] | 446 | ENDDO |
---|
[3004] | 447 | CALL exchange_horiz_2d( shf_av, nbgp ) |
---|
| 448 | ENDIF |
---|
[367] | 449 | |
---|
[1960] | 450 | CASE ( 'ssws*' ) |
---|
[3004] | 451 | IF ( ALLOCATED( ssws_av ) ) THEN |
---|
| 452 | DO i = nxlg, nxrg |
---|
| 453 | DO j = nysg, nyng |
---|
| 454 | ssws_av(j,i) = ssws_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 455 | ENDDO |
---|
[1960] | 456 | ENDDO |
---|
[3004] | 457 | CALL exchange_horiz_2d( ssws_av, nbgp ) |
---|
| 458 | ENDIF |
---|
[1960] | 459 | |
---|
[1] | 460 | CASE ( 't*' ) |
---|
[3004] | 461 | IF ( ALLOCATED( ts_av ) ) THEN |
---|
| 462 | DO i = nxlg, nxrg |
---|
| 463 | DO j = nysg, nyng |
---|
| 464 | ts_av(j,i) = ts_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 465 | ENDDO |
---|
[1] | 466 | ENDDO |
---|
[3004] | 467 | CALL exchange_horiz_2d( ts_av, nbgp ) |
---|
| 468 | ENDIF |
---|
[1] | 469 | |
---|
[2742] | 470 | CASE ( 'tsurf*' ) |
---|
[3004] | 471 | IF ( ALLOCATED( tsurf_av ) ) THEN |
---|
| 472 | DO i = nxlg, nxrg |
---|
| 473 | DO j = nysg, nyng |
---|
| 474 | tsurf_av(j,i) = tsurf_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 475 | ENDDO |
---|
[2742] | 476 | ENDDO |
---|
[3004] | 477 | CALL exchange_horiz_2d( tsurf_av, nbgp ) |
---|
| 478 | ENDIF |
---|
[2742] | 479 | |
---|
[1] | 480 | CASE ( 'u' ) |
---|
[3004] | 481 | IF ( ALLOCATED( u_av ) ) THEN |
---|
| 482 | DO i = nxlg, nxrg |
---|
| 483 | DO j = nysg, nyng |
---|
| 484 | DO k = nzb, nzt+1 |
---|
| 485 | u_av(k,j,i) = u_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 486 | ENDDO |
---|
[1] | 487 | ENDDO |
---|
| 488 | ENDDO |
---|
[3004] | 489 | ENDIF |
---|
[1] | 490 | |
---|
[3421] | 491 | CASE ( 'us*' ) |
---|
[3004] | 492 | IF ( ALLOCATED( us_av ) ) THEN |
---|
| 493 | DO i = nxlg, nxrg |
---|
| 494 | DO j = nysg, nyng |
---|
| 495 | us_av(j,i) = us_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 496 | ENDDO |
---|
[1] | 497 | ENDDO |
---|
[3004] | 498 | CALL exchange_horiz_2d( us_av, nbgp ) |
---|
| 499 | ENDIF |
---|
[1] | 500 | |
---|
| 501 | CASE ( 'v' ) |
---|
[3004] | 502 | IF ( ALLOCATED( v_av ) ) THEN |
---|
| 503 | DO i = nxlg, nxrg |
---|
| 504 | DO j = nysg, nyng |
---|
| 505 | DO k = nzb, nzt+1 |
---|
| 506 | v_av(k,j,i) = v_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 507 | ENDDO |
---|
[1] | 508 | ENDDO |
---|
| 509 | ENDDO |
---|
[3004] | 510 | ENDIF |
---|
[1] | 511 | |
---|
[3421] | 512 | CASE ( 'thetav' ) |
---|
[3004] | 513 | IF ( ALLOCATED( vpt_av ) ) THEN |
---|
| 514 | DO i = nxlg, nxrg |
---|
| 515 | DO j = nysg, nyng |
---|
| 516 | DO k = nzb, nzt+1 |
---|
| 517 | vpt_av(k,j,i) = vpt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 518 | ENDDO |
---|
[1] | 519 | ENDDO |
---|
| 520 | ENDDO |
---|
[3004] | 521 | ENDIF |
---|
[1] | 522 | |
---|
[3597] | 523 | CASE ( 'theta_2m' ) |
---|
| 524 | IF ( ALLOCATED( pt_2m_av ) ) THEN |
---|
| 525 | DO i = nxlg, nxrg |
---|
| 526 | DO j = nysg, nyng |
---|
| 527 | pt_2m_av(j,i) = pt_2m_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 528 | ENDDO |
---|
| 529 | ENDDO |
---|
| 530 | CALL exchange_horiz_2d( pt_2m_av, nbgp ) |
---|
| 531 | ENDIF |
---|
| 532 | |
---|
[1] | 533 | CASE ( 'w' ) |
---|
[3004] | 534 | IF ( ALLOCATED( w_av ) ) THEN |
---|
| 535 | DO i = nxlg, nxrg |
---|
| 536 | DO j = nysg, nyng |
---|
| 537 | DO k = nzb, nzt+1 |
---|
| 538 | w_av(k,j,i) = w_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 539 | ENDDO |
---|
[1] | 540 | ENDDO |
---|
| 541 | ENDDO |
---|
[3004] | 542 | ENDIF |
---|
[1] | 543 | |
---|
[72] | 544 | CASE ( 'z0*' ) |
---|
[3004] | 545 | IF ( ALLOCATED( z0_av ) ) THEN |
---|
| 546 | DO i = nxlg, nxrg |
---|
| 547 | DO j = nysg, nyng |
---|
| 548 | z0_av(j,i) = z0_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 549 | ENDDO |
---|
[72] | 550 | ENDDO |
---|
[3004] | 551 | CALL exchange_horiz_2d( z0_av, nbgp ) |
---|
| 552 | ENDIF |
---|
[72] | 553 | |
---|
[978] | 554 | CASE ( 'z0h*' ) |
---|
[3004] | 555 | IF ( ALLOCATED( z0h_av ) ) THEN |
---|
| 556 | DO i = nxlg, nxrg |
---|
| 557 | DO j = nysg, nyng |
---|
| 558 | z0h_av(j,i) = z0h_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 559 | ENDDO |
---|
[978] | 560 | ENDDO |
---|
[3004] | 561 | CALL exchange_horiz_2d( z0h_av, nbgp ) |
---|
| 562 | ENDIF |
---|
| 563 | |
---|
| 564 | CASE ( 'z0q*' ) |
---|
| 565 | IF ( ALLOCATED( z0q_av ) ) THEN |
---|
| 566 | DO i = nxlg, nxrg |
---|
| 567 | DO j = nysg, nyng |
---|
| 568 | z0q_av(j,i) = z0q_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 569 | ENDDO |
---|
| 570 | ENDDO |
---|
| 571 | CALL exchange_horiz_2d( z0q_av, nbgp ) |
---|
| 572 | ENDIF |
---|
| 573 | |
---|
[1] | 574 | CASE DEFAULT |
---|
| 575 | ! |
---|
[3294] | 576 | !-- Averaging of data from other modules |
---|
[3337] | 577 | IF ( air_chemistry .AND. & |
---|
| 578 | (trimvar(1:3) == 'kc_' .OR. trimvar(1:3) == 'em_') ) THEN |
---|
[3294] | 579 | CALL chem_3d_data_averaging( 'average', doav(ii) ) |
---|
| 580 | ENDIF |
---|
| 581 | |
---|
[3274] | 582 | IF ( bulk_cloud_model ) THEN |
---|
| 583 | CALL bcm_3d_data_averaging( 'average', doav(ii) ) |
---|
| 584 | ENDIF |
---|
[3294] | 585 | |
---|
| 586 | IF ( gust_module_enabled ) THEN |
---|
| 587 | CALL gust_3d_data_averaging( 'average', doav(ii) ) |
---|
| 588 | ENDIF |
---|
| 589 | |
---|
[1972] | 590 | IF ( land_surface ) THEN |
---|
| 591 | CALL lsm_3d_data_averaging( 'average', doav(ii) ) |
---|
| 592 | ENDIF |
---|
[3294] | 593 | |
---|
| 594 | IF ( ocean_mode ) THEN |
---|
| 595 | CALL ocean_3d_data_averaging( 'average', doav(ii) ) |
---|
| 596 | ENDIF |
---|
| 597 | |
---|
[1976] | 598 | IF ( radiation ) THEN |
---|
| 599 | CALL radiation_3d_data_averaging( 'average', doav(ii) ) |
---|
| 600 | ENDIF |
---|
[3467] | 601 | |
---|
| 602 | IF ( salsa ) THEN |
---|
| 603 | CALL salsa_3d_data_averaging( 'average', doav(ii) ) |
---|
| 604 | ENDIF |
---|
[3294] | 605 | |
---|
[3569] | 606 | IF ( biometeorology ) THEN |
---|
[3525] | 607 | CALL bio_3d_data_averaging( 'average', doav(ii) ) |
---|
[3337] | 608 | ENDIF |
---|
| 609 | |
---|
[3294] | 610 | CALL tcm_3d_data_averaging( 'average', doav(ii) ) |
---|
[3337] | 611 | |
---|
| 612 | IF ( urban_surface .AND. trimvar(1:4) == 'usm_' ) THEN |
---|
| 613 | CALL usm_average_3d_data( 'average', doav(ii) ) |
---|
| 614 | ENDIF |
---|
| 615 | |
---|
[1976] | 616 | ! |
---|
[3294] | 617 | !-- User-defined quantities |
---|
[1] | 618 | CALL user_3d_data_averaging( 'average', doav(ii) ) |
---|
| 619 | |
---|
| 620 | END SELECT |
---|
| 621 | |
---|
| 622 | ENDDO |
---|
| 623 | |
---|
| 624 | ! |
---|
| 625 | !-- Reset the counter |
---|
| 626 | average_count_3d = 0.0 |
---|
| 627 | |
---|
[1318] | 628 | CALL cpu_log( log_point(35), 'average_3d_data', 'stop' ) |
---|
[1] | 629 | |
---|
| 630 | |
---|
| 631 | END SUBROUTINE average_3d_data |
---|