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