[1682] | 1 | !> @file average_3d_data.f90 |
---|
[1036] | 2 | !--------------------------------------------------------------------------------! |
---|
| 3 | ! This file is part of PALM. |
---|
| 4 | ! |
---|
| 5 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 6 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
| 7 | ! either version 3 of the License, or (at your option) any later version. |
---|
| 8 | ! |
---|
| 9 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 10 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 11 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 12 | ! |
---|
| 13 | ! You should have received a copy of the GNU General Public License along with |
---|
| 14 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 15 | ! |
---|
[1818] | 16 | ! Copyright 1997-2016 Leibniz Universitaet Hannover |
---|
[1036] | 17 | !--------------------------------------------------------------------------------! |
---|
| 18 | ! |
---|
[484] | 19 | ! Current revisions: |
---|
[1] | 20 | ! ----------------- |
---|
[1552] | 21 | ! |
---|
[1692] | 22 | ! |
---|
[1321] | 23 | ! Former revisions: |
---|
| 24 | ! ----------------- |
---|
| 25 | ! $Id: average_3d_data.f90 1818 2016-04-06 15:53:27Z hoffmann $ |
---|
| 26 | ! |
---|
[1692] | 27 | ! 1691 2015-10-26 16:17:44Z maronga |
---|
| 28 | ! Added output of Obukhov length and radiative heating rates for RRTMG. |
---|
| 29 | ! |
---|
[1683] | 30 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 31 | ! Code annotations made doxygen readable |
---|
| 32 | ! |
---|
[1586] | 33 | ! 1585 2015-04-30 07:05:52Z maronga |
---|
| 34 | ! Adapted for RRTMG |
---|
| 35 | ! |
---|
[1556] | 36 | ! 1555 2015-03-04 17:44:27Z maronga |
---|
| 37 | ! Added output of r_a and r_s |
---|
| 38 | ! |
---|
[1552] | 39 | ! 1551 2015-03-03 14:18:16Z maronga |
---|
| 40 | ! Added support for land surface and radiation model parameters. |
---|
| 41 | ! |
---|
[1323] | 42 | ! 1322 2014-03-20 16:38:49Z raasch |
---|
| 43 | ! REAL functions provided with KIND-attribute |
---|
| 44 | ! |
---|
[1321] | 45 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 46 | ! ONLY-attribute added to USE-statements, |
---|
| 47 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 48 | ! kinds are defined in new module kinds, |
---|
| 49 | ! revision history before 2012 removed, |
---|
| 50 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 51 | ! all variable declaration statements |
---|
[772] | 52 | ! |
---|
[1319] | 53 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
| 54 | ! barrier argument removed from cpu_log, |
---|
| 55 | ! module interfaces removed |
---|
| 56 | ! |
---|
[1116] | 57 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
| 58 | ! +qc |
---|
| 59 | ! |
---|
[1054] | 60 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
| 61 | ! averaging of nr, qr added |
---|
| 62 | ! |
---|
[1037] | 63 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 64 | ! code put under GPL (PALM 3.9) |
---|
| 65 | ! |
---|
[979] | 66 | ! 978 2012-08-09 08:28:32Z fricke |
---|
| 67 | ! +z0h_av |
---|
[77] | 68 | ! |
---|
[1] | 69 | ! Revision 1.1 2006/02/23 09:48:58 raasch |
---|
| 70 | ! Initial revision |
---|
| 71 | ! |
---|
| 72 | ! |
---|
| 73 | ! Description: |
---|
| 74 | ! ------------ |
---|
[1682] | 75 | !> Time-averaging of 3d-data-arrays. |
---|
[1] | 76 | !------------------------------------------------------------------------------! |
---|
[1682] | 77 | SUBROUTINE average_3d_data |
---|
| 78 | |
---|
[1] | 79 | |
---|
| 80 | USE averaging |
---|
| 81 | |
---|
[1320] | 82 | USE control_parameters, & |
---|
| 83 | ONLY: average_count_3d, doav, doav_n |
---|
| 84 | |
---|
| 85 | USE cpulog, & |
---|
| 86 | ONLY: cpu_log, log_point |
---|
| 87 | |
---|
| 88 | USE indices, & |
---|
| 89 | ONLY: nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt |
---|
| 90 | |
---|
| 91 | USE kinds |
---|
| 92 | |
---|
[1551] | 93 | USE land_surface_model_mod, & |
---|
| 94 | ONLY: c_liq_av, c_soil_av, c_veg_av, ghf_eb_av, lai_av, m_liq_eb_av, & |
---|
| 95 | m_soil_av, nzb_soil, nzt_soil, qsws_eb_av, qsws_liq_eb_av, & |
---|
[1555] | 96 | qsws_soil_eb_av, qsws_veg_eb_av, r_a, r_a_av, r_s, r_s_av, & |
---|
| 97 | shf_eb_av, t_soil_av |
---|
[1320] | 98 | |
---|
[1551] | 99 | USE radiation_model_mod, & |
---|
[1585] | 100 | ONLY: rad_net, rad_net_av, rad_lw_in, rad_lw_in_av, rad_lw_out, & |
---|
[1691] | 101 | rad_lw_out_av, rad_lw_cs_hr, rad_lw_cs_hr_av, rad_lw_hr, & |
---|
| 102 | rad_lw_hr_av, rad_sw_in, rad_sw_in_av, rad_sw_out, & |
---|
| 103 | rad_sw_out_av, rad_sw_cs_hr, rad_sw_cs_hr_av, rad_sw_hr, & |
---|
| 104 | rad_sw_hr_av |
---|
[1551] | 105 | |
---|
[1691] | 106 | |
---|
[1] | 107 | IMPLICIT NONE |
---|
| 108 | |
---|
[1682] | 109 | INTEGER(iwp) :: i !< |
---|
| 110 | INTEGER(iwp) :: ii !< |
---|
| 111 | INTEGER(iwp) :: j !< |
---|
| 112 | INTEGER(iwp) :: k !< |
---|
[1] | 113 | |
---|
| 114 | |
---|
| 115 | CALL cpu_log (log_point(35),'average_3d_data','start') |
---|
| 116 | |
---|
| 117 | ! |
---|
| 118 | !-- Check, if averaging is necessary |
---|
| 119 | IF ( average_count_3d <= 1 ) RETURN |
---|
| 120 | |
---|
| 121 | ! |
---|
| 122 | !-- Loop of all variables to be averaged. |
---|
| 123 | DO ii = 1, doav_n |
---|
| 124 | |
---|
| 125 | ! |
---|
| 126 | !-- Store the array chosen on the temporary array. |
---|
| 127 | SELECT CASE ( TRIM( doav(ii) ) ) |
---|
| 128 | |
---|
[1551] | 129 | CASE ( 'c_liq*' ) |
---|
| 130 | DO i = nxlg, nxrg |
---|
| 131 | DO j = nysg, nyng |
---|
| 132 | c_liq_av(j,i) = c_liq_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 133 | ENDDO |
---|
| 134 | ENDDO |
---|
| 135 | |
---|
| 136 | CASE ( 'c_soil*' ) |
---|
| 137 | DO i = nxlg, nxrg |
---|
| 138 | DO j = nysg, nyng |
---|
| 139 | c_soil_av(j,i) = c_soil_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 140 | ENDDO |
---|
| 141 | ENDDO |
---|
| 142 | |
---|
| 143 | CASE ( 'c_veg*' ) |
---|
| 144 | DO i = nxlg, nxrg |
---|
| 145 | DO j = nysg, nyng |
---|
| 146 | c_veg_av(j,i) = c_veg_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 147 | ENDDO |
---|
| 148 | ENDDO |
---|
| 149 | |
---|
[1] | 150 | CASE ( 'e' ) |
---|
[667] | 151 | DO i = nxlg, nxrg |
---|
| 152 | DO j = nysg, nyng |
---|
[1] | 153 | DO k = nzb, nzt+1 |
---|
[1322] | 154 | e_av(k,j,i) = e_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 155 | ENDDO |
---|
| 156 | ENDDO |
---|
| 157 | ENDDO |
---|
| 158 | |
---|
[1551] | 159 | CASE ( 'ghf_eb*' ) |
---|
| 160 | DO i = nxlg, nxrg |
---|
| 161 | DO j = nysg, nyng |
---|
| 162 | ghf_eb_av(j,i) = ghf_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 163 | ENDDO |
---|
| 164 | ENDDO |
---|
| 165 | |
---|
[354] | 166 | CASE ( 'qsws*' ) |
---|
[667] | 167 | DO i = nxlg, nxrg |
---|
| 168 | DO j = nysg, nyng |
---|
[1322] | 169 | qsws_av(j,i) = qsws_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[354] | 170 | ENDDO |
---|
| 171 | ENDDO |
---|
| 172 | |
---|
[1551] | 173 | CASE ( 'lai*' ) |
---|
| 174 | DO i = nxlg, nxrg |
---|
| 175 | DO j = nysg, nyng |
---|
| 176 | lai_av(j,i) = lai_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 177 | ENDDO |
---|
| 178 | ENDDO |
---|
| 179 | |
---|
[771] | 180 | CASE ( 'lpt' ) |
---|
| 181 | DO i = nxlg, nxrg |
---|
| 182 | DO j = nysg, nyng |
---|
| 183 | DO k = nzb, nzt+1 |
---|
[1322] | 184 | lpt_av(k,j,i) = lpt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[771] | 185 | ENDDO |
---|
| 186 | ENDDO |
---|
| 187 | ENDDO |
---|
| 188 | |
---|
[1] | 189 | CASE ( 'lwp*' ) |
---|
[667] | 190 | DO i = nxlg, nxrg |
---|
| 191 | DO j = nysg, nyng |
---|
[1322] | 192 | lwp_av(j,i) = lwp_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 193 | ENDDO |
---|
| 194 | ENDDO |
---|
| 195 | |
---|
[1551] | 196 | CASE ( 'm_liq_eb*' ) |
---|
| 197 | DO i = nxlg, nxrg |
---|
| 198 | DO j = nysg, nyng |
---|
| 199 | m_liq_eb_av(j,i) = m_liq_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 200 | ENDDO |
---|
| 201 | ENDDO |
---|
| 202 | |
---|
| 203 | CASE ( 'm_soil' ) |
---|
| 204 | DO i = nxlg, nxrg |
---|
| 205 | DO j = nysg, nyng |
---|
| 206 | DO k = nzb_soil, nzt_soil |
---|
| 207 | m_soil_av(k,j,i) = m_soil_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 208 | ENDDO |
---|
| 209 | ENDDO |
---|
| 210 | ENDDO |
---|
| 211 | |
---|
[1053] | 212 | CASE ( 'nr' ) |
---|
| 213 | DO i = nxlg, nxrg |
---|
| 214 | DO j = nysg, nyng |
---|
| 215 | DO k = nzb, nzt+1 |
---|
[1322] | 216 | nr_av(k,j,i) = nr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1053] | 217 | ENDDO |
---|
| 218 | ENDDO |
---|
| 219 | ENDDO |
---|
| 220 | |
---|
[1691] | 221 | CASE ( 'ol*' ) |
---|
| 222 | DO i = nxlg, nxrg |
---|
| 223 | DO j = nysg, nyng |
---|
| 224 | ol_av(j,i) = ol_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 225 | ENDDO |
---|
| 226 | ENDDO |
---|
| 227 | |
---|
[1] | 228 | CASE ( 'p' ) |
---|
[667] | 229 | DO i = nxlg, nxrg |
---|
| 230 | DO j = nysg, nyng |
---|
[1] | 231 | DO k = nzb, nzt+1 |
---|
[1322] | 232 | p_av(k,j,i) = p_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 233 | ENDDO |
---|
| 234 | ENDDO |
---|
| 235 | ENDDO |
---|
| 236 | |
---|
| 237 | CASE ( 'pc' ) |
---|
| 238 | DO i = nxl, nxr |
---|
| 239 | DO j = nys, nyn |
---|
| 240 | DO k = nzb, nzt+1 |
---|
[1322] | 241 | pc_av(k,j,i) = pc_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 242 | ENDDO |
---|
| 243 | ENDDO |
---|
| 244 | ENDDO |
---|
| 245 | |
---|
| 246 | CASE ( 'pr' ) |
---|
| 247 | DO i = nxl, nxr |
---|
| 248 | DO j = nys, nyn |
---|
| 249 | DO k = nzb, nzt+1 |
---|
[1322] | 250 | pr_av(k,j,i) = pr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 251 | ENDDO |
---|
| 252 | ENDDO |
---|
| 253 | ENDDO |
---|
| 254 | |
---|
[72] | 255 | CASE ( 'prr*' ) |
---|
[667] | 256 | DO i = nxlg, nxrg |
---|
| 257 | DO j = nysg, nyng |
---|
[1320] | 258 | precipitation_rate_av(j,i) = precipitation_rate_av(j,i) / & |
---|
[1322] | 259 | REAL( average_count_3d, KIND=wp ) |
---|
[72] | 260 | ENDDO |
---|
| 261 | ENDDO |
---|
| 262 | |
---|
[1] | 263 | CASE ( 'pt' ) |
---|
[667] | 264 | DO i = nxlg, nxrg |
---|
| 265 | DO j = nysg, nyng |
---|
[1] | 266 | DO k = nzb, nzt+1 |
---|
[1322] | 267 | pt_av(k,j,i) = pt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 268 | ENDDO |
---|
| 269 | ENDDO |
---|
| 270 | ENDDO |
---|
| 271 | |
---|
| 272 | CASE ( 'q' ) |
---|
[667] | 273 | DO i = nxlg, nxrg |
---|
| 274 | DO j = nysg, nyng |
---|
[1] | 275 | DO k = nzb, nzt+1 |
---|
[1322] | 276 | q_av(k,j,i) = q_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 277 | ENDDO |
---|
| 278 | ENDDO |
---|
| 279 | ENDDO |
---|
[367] | 280 | |
---|
[1115] | 281 | CASE ( 'qc' ) |
---|
| 282 | DO i = nxlg, nxrg |
---|
| 283 | DO j = nysg, nyng |
---|
| 284 | DO k = nzb, nzt+1 |
---|
[1322] | 285 | qc_av(k,j,i) = qc_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1115] | 286 | ENDDO |
---|
| 287 | ENDDO |
---|
| 288 | ENDDO |
---|
| 289 | |
---|
[1] | 290 | CASE ( 'ql' ) |
---|
[667] | 291 | DO i = nxlg, nxrg |
---|
| 292 | DO j = nysg, nyng |
---|
[1] | 293 | DO k = nzb, nzt+1 |
---|
[1322] | 294 | ql_av(k,j,i) = ql_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 295 | ENDDO |
---|
| 296 | ENDDO |
---|
| 297 | ENDDO |
---|
| 298 | |
---|
| 299 | CASE ( 'ql_c' ) |
---|
[667] | 300 | DO i = nxlg, nxrg |
---|
| 301 | DO j = nysg, nyng |
---|
[1] | 302 | DO k = nzb, nzt+1 |
---|
[1322] | 303 | ql_c_av(k,j,i) = ql_c_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 304 | ENDDO |
---|
| 305 | ENDDO |
---|
| 306 | ENDDO |
---|
| 307 | |
---|
| 308 | CASE ( 'ql_v' ) |
---|
[667] | 309 | DO i = nxlg, nxrg |
---|
| 310 | DO j = nysg, nyng |
---|
[1] | 311 | DO k = nzb, nzt+1 |
---|
[1322] | 312 | ql_v_av(k,j,i) = ql_v_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 313 | ENDDO |
---|
| 314 | ENDDO |
---|
| 315 | ENDDO |
---|
| 316 | |
---|
| 317 | CASE ( 'ql_vp' ) |
---|
[667] | 318 | DO i = nxlg, nxrg |
---|
| 319 | DO j = nysg, nyng |
---|
[1] | 320 | DO k = nzb, nzt+1 |
---|
[1320] | 321 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) / & |
---|
[1322] | 322 | REAL( average_count_3d, KIND=wp ) |
---|
[1] | 323 | ENDDO |
---|
| 324 | ENDDO |
---|
| 325 | ENDDO |
---|
| 326 | |
---|
[1053] | 327 | CASE ( 'qr' ) |
---|
| 328 | DO i = nxlg, nxrg |
---|
| 329 | DO j = nysg, nyng |
---|
| 330 | DO k = nzb, nzt+1 |
---|
[1322] | 331 | qr_av(k,j,i) = qr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1053] | 332 | ENDDO |
---|
| 333 | ENDDO |
---|
| 334 | ENDDO |
---|
| 335 | |
---|
[1551] | 336 | CASE ( 'qsws_eb*' ) |
---|
| 337 | DO i = nxlg, nxrg |
---|
| 338 | DO j = nysg, nyng |
---|
| 339 | qsws_eb_av(j,i) = qsws_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 340 | ENDDO |
---|
| 341 | ENDDO |
---|
| 342 | |
---|
| 343 | CASE ( 'qsws_liq_eb*' ) |
---|
| 344 | DO i = nxlg, nxrg |
---|
| 345 | DO j = nysg, nyng |
---|
| 346 | qsws_liq_eb_av(j,i) = qsws_liq_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 347 | ENDDO |
---|
| 348 | ENDDO |
---|
| 349 | |
---|
| 350 | CASE ( 'qsws_soil_eb*' ) |
---|
| 351 | DO i = nxlg, nxrg |
---|
| 352 | DO j = nysg, nyng |
---|
| 353 | qsws_soil_eb_av(j,i) = qsws_soil_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 354 | ENDDO |
---|
| 355 | ENDDO |
---|
| 356 | |
---|
| 357 | CASE ( 'qsws_veg_eb*' ) |
---|
| 358 | DO i = nxlg, nxrg |
---|
| 359 | DO j = nysg, nyng |
---|
| 360 | qsws_veg_eb_av(j,i) = qsws_veg_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 361 | ENDDO |
---|
| 362 | ENDDO |
---|
| 363 | |
---|
[1] | 364 | CASE ( 'qv' ) |
---|
[667] | 365 | DO i = nxlg, nxrg |
---|
| 366 | DO j = nysg, nyng |
---|
[1] | 367 | DO k = nzb, nzt+1 |
---|
[1322] | 368 | qv_av(k,j,i) = qv_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 369 | ENDDO |
---|
| 370 | ENDDO |
---|
| 371 | ENDDO |
---|
[367] | 372 | |
---|
[1585] | 373 | CASE ( 'rad_net*' ) |
---|
[1551] | 374 | DO i = nxlg, nxrg |
---|
| 375 | DO j = nysg, nyng |
---|
[1585] | 376 | rad_net_av(j,i) = rad_net_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1551] | 377 | ENDDO |
---|
| 378 | ENDDO |
---|
| 379 | |
---|
[1585] | 380 | CASE ( 'rad_lw_in' ) |
---|
[1551] | 381 | DO i = nxlg, nxrg |
---|
| 382 | DO j = nysg, nyng |
---|
[1585] | 383 | DO k = nzb, nzt+1 |
---|
| 384 | rad_lw_in_av(k,j,i) = rad_lw_in_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 385 | ENDDO |
---|
[1551] | 386 | ENDDO |
---|
| 387 | ENDDO |
---|
| 388 | |
---|
[1585] | 389 | CASE ( 'rad_lw_out' ) |
---|
| 390 | DO i = nxlg, nxrg |
---|
| 391 | DO j = nysg, nyng |
---|
| 392 | DO k = nzb, nzt+1 |
---|
| 393 | rad_lw_out_av(k,j,i) = rad_lw_out_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 394 | ENDDO |
---|
| 395 | ENDDO |
---|
| 396 | ENDDO |
---|
| 397 | |
---|
[1691] | 398 | CASE ( 'rad_lw_cs_hr' ) |
---|
| 399 | DO i = nxlg, nxrg |
---|
| 400 | DO j = nysg, nyng |
---|
| 401 | DO k = nzb, nzt+1 |
---|
| 402 | rad_lw_cs_hr_av(k,j,i) = rad_lw_cs_hr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 403 | ENDDO |
---|
| 404 | ENDDO |
---|
| 405 | ENDDO |
---|
| 406 | |
---|
| 407 | CASE ( 'rad_lw_hr' ) |
---|
| 408 | DO i = nxlg, nxrg |
---|
| 409 | DO j = nysg, nyng |
---|
| 410 | DO k = nzb, nzt+1 |
---|
| 411 | rad_lw_hr_av(k,j,i) = rad_lw_hr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 412 | ENDDO |
---|
| 413 | ENDDO |
---|
| 414 | ENDDO |
---|
| 415 | |
---|
[1585] | 416 | CASE ( 'rad_sw_in' ) |
---|
| 417 | DO i = nxlg, nxrg |
---|
| 418 | DO j = nysg, nyng |
---|
| 419 | DO k = nzb, nzt+1 |
---|
| 420 | rad_sw_in_av(k,j,i) = rad_sw_in_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 421 | ENDDO |
---|
| 422 | ENDDO |
---|
| 423 | ENDDO |
---|
| 424 | |
---|
| 425 | CASE ( 'rad_sw_out' ) |
---|
| 426 | DO i = nxlg, nxrg |
---|
| 427 | DO j = nysg, nyng |
---|
| 428 | DO k = nzb, nzt+1 |
---|
| 429 | rad_sw_out_av(k,j,i) = rad_sw_out_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 430 | ENDDO |
---|
| 431 | ENDDO |
---|
| 432 | ENDDO |
---|
| 433 | |
---|
[1691] | 434 | CASE ( 'rad_sw_cs_hr' ) |
---|
| 435 | DO i = nxlg, nxrg |
---|
| 436 | DO j = nysg, nyng |
---|
| 437 | DO k = nzb, nzt+1 |
---|
| 438 | rad_sw_cs_hr_av(k,j,i) = rad_sw_cs_hr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 439 | ENDDO |
---|
| 440 | ENDDO |
---|
| 441 | ENDDO |
---|
| 442 | |
---|
| 443 | CASE ( 'rad_sw_hr' ) |
---|
| 444 | DO i = nxlg, nxrg |
---|
| 445 | DO j = nysg, nyng |
---|
| 446 | DO k = nzb, nzt+1 |
---|
| 447 | rad_sw_hr_av(k,j,i) = rad_sw_hr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 448 | ENDDO |
---|
| 449 | ENDDO |
---|
| 450 | ENDDO |
---|
| 451 | |
---|
[1555] | 452 | CASE ( 'r_a*' ) |
---|
| 453 | DO i = nxlg, nxrg |
---|
| 454 | DO j = nysg, nyng |
---|
| 455 | r_a_av(j,i) = r_a_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 456 | ENDDO |
---|
| 457 | ENDDO |
---|
| 458 | |
---|
| 459 | CASE ( 'r_s*' ) |
---|
| 460 | DO i = nxlg, nxrg |
---|
| 461 | DO j = nysg, nyng |
---|
| 462 | r_s_av(j,i) = r_s_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 463 | ENDDO |
---|
| 464 | ENDDO |
---|
| 465 | |
---|
[96] | 466 | CASE ( 'rho' ) |
---|
[667] | 467 | DO i = nxlg, nxrg |
---|
| 468 | DO j = nysg, nyng |
---|
[96] | 469 | DO k = nzb, nzt+1 |
---|
[1322] | 470 | rho_av(k,j,i) = rho_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[96] | 471 | ENDDO |
---|
| 472 | ENDDO |
---|
| 473 | ENDDO |
---|
[367] | 474 | |
---|
[1] | 475 | CASE ( 's' ) |
---|
[667] | 476 | DO i = nxlg, nxrg |
---|
| 477 | DO j = nysg, nyng |
---|
[1] | 478 | DO k = nzb, nzt+1 |
---|
[1322] | 479 | s_av(k,j,i) = s_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 480 | ENDDO |
---|
| 481 | ENDDO |
---|
| 482 | ENDDO |
---|
[367] | 483 | |
---|
[96] | 484 | CASE ( 'sa' ) |
---|
[667] | 485 | DO i = nxlg, nxrg |
---|
| 486 | DO j = nysg, nyng |
---|
[96] | 487 | DO k = nzb, nzt+1 |
---|
[1322] | 488 | sa_av(k,j,i) = sa_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[96] | 489 | ENDDO |
---|
| 490 | ENDDO |
---|
| 491 | ENDDO |
---|
[367] | 492 | |
---|
[354] | 493 | CASE ( 'shf*' ) |
---|
[667] | 494 | DO i = nxlg, nxrg |
---|
| 495 | DO j = nysg, nyng |
---|
[1322] | 496 | shf_av(j,i) = shf_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[354] | 497 | ENDDO |
---|
| 498 | ENDDO |
---|
[367] | 499 | |
---|
[1] | 500 | CASE ( 't*' ) |
---|
[667] | 501 | DO i = nxlg, nxrg |
---|
| 502 | DO j = nysg, nyng |
---|
[1322] | 503 | ts_av(j,i) = ts_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 504 | ENDDO |
---|
| 505 | ENDDO |
---|
| 506 | |
---|
[1551] | 507 | CASE ( 't_soil' ) |
---|
| 508 | DO i = nxlg, nxrg |
---|
| 509 | DO j = nysg, nyng |
---|
| 510 | DO k = nzb_soil, nzt_soil |
---|
| 511 | t_soil_av(k,j,i) = t_soil_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 512 | ENDDO |
---|
| 513 | ENDDO |
---|
| 514 | ENDDO |
---|
| 515 | |
---|
[1] | 516 | CASE ( 'u' ) |
---|
[667] | 517 | DO i = nxlg, nxrg |
---|
| 518 | DO j = nysg, nyng |
---|
[1] | 519 | DO k = nzb, nzt+1 |
---|
[1322] | 520 | u_av(k,j,i) = u_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 521 | ENDDO |
---|
| 522 | ENDDO |
---|
| 523 | ENDDO |
---|
| 524 | |
---|
| 525 | CASE ( 'u*' ) |
---|
[667] | 526 | DO i = nxlg, nxrg |
---|
| 527 | DO j = nysg, nyng |
---|
[1322] | 528 | us_av(j,i) = us_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 529 | ENDDO |
---|
| 530 | ENDDO |
---|
| 531 | |
---|
| 532 | CASE ( 'v' ) |
---|
[667] | 533 | DO i = nxlg, nxrg |
---|
| 534 | DO j = nysg, nyng |
---|
[1] | 535 | DO k = nzb, nzt+1 |
---|
[1322] | 536 | v_av(k,j,i) = v_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 537 | ENDDO |
---|
| 538 | ENDDO |
---|
| 539 | ENDDO |
---|
| 540 | |
---|
| 541 | CASE ( 'vpt' ) |
---|
[667] | 542 | DO i = nxlg, nxrg |
---|
| 543 | DO j = nysg, nyng |
---|
[1] | 544 | DO k = nzb, nzt+1 |
---|
[1322] | 545 | vpt_av(k,j,i) = vpt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 546 | ENDDO |
---|
| 547 | ENDDO |
---|
| 548 | ENDDO |
---|
| 549 | |
---|
| 550 | CASE ( 'w' ) |
---|
[667] | 551 | DO i = nxlg, nxrg |
---|
| 552 | DO j = nysg, nyng |
---|
[1] | 553 | DO k = nzb, nzt+1 |
---|
[1322] | 554 | w_av(k,j,i) = w_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[1] | 555 | ENDDO |
---|
| 556 | ENDDO |
---|
| 557 | ENDDO |
---|
| 558 | |
---|
[72] | 559 | CASE ( 'z0*' ) |
---|
[667] | 560 | DO i = nxlg, nxrg |
---|
| 561 | DO j = nysg, nyng |
---|
[1322] | 562 | z0_av(j,i) = z0_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[72] | 563 | ENDDO |
---|
| 564 | ENDDO |
---|
| 565 | |
---|
[978] | 566 | CASE ( 'z0h*' ) |
---|
| 567 | DO i = nxlg, nxrg |
---|
| 568 | DO j = nysg, nyng |
---|
[1322] | 569 | z0h_av(j,i) = z0h_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[978] | 570 | ENDDO |
---|
| 571 | ENDDO |
---|
| 572 | |
---|
[1] | 573 | CASE DEFAULT |
---|
| 574 | ! |
---|
| 575 | !-- User-defined quantity |
---|
| 576 | CALL user_3d_data_averaging( 'average', doav(ii) ) |
---|
| 577 | |
---|
| 578 | END SELECT |
---|
| 579 | |
---|
| 580 | ENDDO |
---|
| 581 | |
---|
| 582 | ! |
---|
| 583 | !-- Reset the counter |
---|
| 584 | average_count_3d = 0.0 |
---|
| 585 | |
---|
[1318] | 586 | CALL cpu_log( log_point(35), 'average_3d_data', 'stop' ) |
---|
[1] | 587 | |
---|
| 588 | |
---|
| 589 | END SUBROUTINE average_3d_data |
---|