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