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