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