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