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