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