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