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