[1] | 1 | SUBROUTINE average_3d_data |
---|
| 2 | |
---|
| 3 | !------------------------------------------------------------------------------! |
---|
[484] | 4 | ! Current revisions: |
---|
[1] | 5 | ! ----------------- |
---|
[772] | 6 | ! |
---|
[979] | 7 | ! |
---|
[1] | 8 | ! Former revisions: |
---|
| 9 | ! ----------------- |
---|
[3] | 10 | ! $Id: average_3d_data.f90 979 2012-08-09 08:50:11Z raasch $ |
---|
[979] | 11 | ! |
---|
| 12 | ! 978 2012-08-09 08:28:32Z fricke |
---|
| 13 | ! +z0h_av |
---|
[77] | 14 | ! |
---|
[772] | 15 | ! 771 2011-10-27 10:56:21Z heinze |
---|
| 16 | ! +lpt_av |
---|
| 17 | ! |
---|
[668] | 18 | ! 667 2010-12-23 12:06:00Z suehring/gryschka |
---|
| 19 | ! nxl-1, nxr+1, nys-1, nyn+1 replaced by nxlg, nxrg, nysg, nyng |
---|
| 20 | ! |
---|
[392] | 21 | ! 367 2009-08-25 08:35:52Z maronga |
---|
| 22 | ! Added calculation of shf* and qsws* |
---|
| 23 | ! |
---|
[98] | 24 | ! 96 2007-06-04 08:07:41Z raasch |
---|
| 25 | ! Averaging of density and salinity |
---|
| 26 | ! |
---|
[77] | 27 | ! 72 2007-03-19 08:20:46Z raasch |
---|
| 28 | ! Averaging the precipitation rate and roughness length (prr*, z0*) |
---|
| 29 | ! |
---|
[3] | 30 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
| 31 | ! |
---|
[1] | 32 | ! Revision 1.1 2006/02/23 09:48:58 raasch |
---|
| 33 | ! Initial revision |
---|
| 34 | ! |
---|
| 35 | ! |
---|
| 36 | ! Description: |
---|
| 37 | ! ------------ |
---|
| 38 | ! Time-averaging of 3d-data-arrays. |
---|
| 39 | !------------------------------------------------------------------------------! |
---|
| 40 | |
---|
| 41 | USE arrays_3d |
---|
| 42 | USE averaging |
---|
| 43 | USE cloud_parameters |
---|
| 44 | USE control_parameters |
---|
| 45 | USE cpulog |
---|
| 46 | USE indices |
---|
| 47 | USE interfaces |
---|
| 48 | |
---|
| 49 | IMPLICIT NONE |
---|
| 50 | |
---|
| 51 | INTEGER :: i, ii, j, k |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | CALL cpu_log (log_point(35),'average_3d_data','start') |
---|
| 55 | |
---|
| 56 | ! |
---|
| 57 | !-- Check, if averaging is necessary |
---|
| 58 | IF ( average_count_3d <= 1 ) RETURN |
---|
| 59 | |
---|
| 60 | ! |
---|
| 61 | !-- Loop of all variables to be averaged. |
---|
| 62 | DO ii = 1, doav_n |
---|
| 63 | |
---|
| 64 | ! |
---|
| 65 | !-- Store the array chosen on the temporary array. |
---|
| 66 | SELECT CASE ( TRIM( doav(ii) ) ) |
---|
| 67 | |
---|
| 68 | CASE ( 'e' ) |
---|
[667] | 69 | DO i = nxlg, nxrg |
---|
| 70 | DO j = nysg, nyng |
---|
[1] | 71 | DO k = nzb, nzt+1 |
---|
| 72 | e_av(k,j,i) = e_av(k,j,i) / REAL( average_count_3d ) |
---|
| 73 | ENDDO |
---|
| 74 | ENDDO |
---|
| 75 | ENDDO |
---|
| 76 | |
---|
[354] | 77 | CASE ( 'qsws*' ) |
---|
[667] | 78 | DO i = nxlg, nxrg |
---|
| 79 | DO j = nysg, nyng |
---|
[354] | 80 | qsws_av(j,i) = qsws_av(j,i) / REAL( average_count_3d ) |
---|
| 81 | ENDDO |
---|
| 82 | ENDDO |
---|
| 83 | |
---|
[771] | 84 | CASE ( 'lpt' ) |
---|
| 85 | DO i = nxlg, nxrg |
---|
| 86 | DO j = nysg, nyng |
---|
| 87 | DO k = nzb, nzt+1 |
---|
| 88 | lpt_av(k,j,i) = lpt_av(k,j,i) / REAL( average_count_3d ) |
---|
| 89 | ENDDO |
---|
| 90 | ENDDO |
---|
| 91 | ENDDO |
---|
| 92 | |
---|
[1] | 93 | CASE ( 'lwp*' ) |
---|
[667] | 94 | DO i = nxlg, nxrg |
---|
| 95 | DO j = nysg, nyng |
---|
[1] | 96 | lwp_av(j,i) = lwp_av(j,i) / REAL( average_count_3d ) |
---|
| 97 | ENDDO |
---|
| 98 | ENDDO |
---|
| 99 | |
---|
| 100 | CASE ( 'p' ) |
---|
[667] | 101 | DO i = nxlg, nxrg |
---|
| 102 | DO j = nysg, nyng |
---|
[1] | 103 | DO k = nzb, nzt+1 |
---|
| 104 | p_av(k,j,i) = p_av(k,j,i) / REAL( average_count_3d ) |
---|
| 105 | ENDDO |
---|
| 106 | ENDDO |
---|
| 107 | ENDDO |
---|
| 108 | |
---|
| 109 | CASE ( 'pc' ) |
---|
| 110 | DO i = nxl, nxr |
---|
| 111 | DO j = nys, nyn |
---|
| 112 | DO k = nzb, nzt+1 |
---|
| 113 | pc_av(k,j,i) = pc_av(k,j,i) / REAL( average_count_3d ) |
---|
| 114 | ENDDO |
---|
| 115 | ENDDO |
---|
| 116 | ENDDO |
---|
| 117 | |
---|
| 118 | CASE ( 'pr' ) |
---|
| 119 | DO i = nxl, nxr |
---|
| 120 | DO j = nys, nyn |
---|
| 121 | DO k = nzb, nzt+1 |
---|
| 122 | pr_av(k,j,i) = pr_av(k,j,i) / REAL( average_count_3d ) |
---|
| 123 | ENDDO |
---|
| 124 | ENDDO |
---|
| 125 | ENDDO |
---|
| 126 | |
---|
[72] | 127 | CASE ( 'prr*' ) |
---|
[667] | 128 | DO i = nxlg, nxrg |
---|
| 129 | DO j = nysg, nyng |
---|
[72] | 130 | precipitation_rate_av(j,i) = precipitation_rate_av(j,i) / & |
---|
| 131 | REAL( average_count_3d ) |
---|
| 132 | ENDDO |
---|
| 133 | ENDDO |
---|
| 134 | |
---|
[1] | 135 | CASE ( 'pt' ) |
---|
[667] | 136 | DO i = nxlg, nxrg |
---|
| 137 | DO j = nysg, nyng |
---|
[1] | 138 | DO k = nzb, nzt+1 |
---|
| 139 | pt_av(k,j,i) = pt_av(k,j,i) / REAL( average_count_3d ) |
---|
| 140 | ENDDO |
---|
| 141 | ENDDO |
---|
| 142 | ENDDO |
---|
| 143 | |
---|
| 144 | CASE ( 'q' ) |
---|
[667] | 145 | DO i = nxlg, nxrg |
---|
| 146 | DO j = nysg, nyng |
---|
[1] | 147 | DO k = nzb, nzt+1 |
---|
| 148 | q_av(k,j,i) = q_av(k,j,i) / REAL( average_count_3d ) |
---|
| 149 | ENDDO |
---|
| 150 | ENDDO |
---|
| 151 | ENDDO |
---|
[367] | 152 | |
---|
[1] | 153 | CASE ( 'ql' ) |
---|
[667] | 154 | DO i = nxlg, nxrg |
---|
| 155 | DO j = nysg, nyng |
---|
[1] | 156 | DO k = nzb, nzt+1 |
---|
| 157 | ql_av(k,j,i) = ql_av(k,j,i) / REAL( average_count_3d ) |
---|
| 158 | ENDDO |
---|
| 159 | ENDDO |
---|
| 160 | ENDDO |
---|
| 161 | |
---|
| 162 | CASE ( 'ql_c' ) |
---|
[667] | 163 | DO i = nxlg, nxrg |
---|
| 164 | DO j = nysg, nyng |
---|
[1] | 165 | DO k = nzb, nzt+1 |
---|
| 166 | ql_c_av(k,j,i) = ql_c_av(k,j,i) / REAL( average_count_3d ) |
---|
| 167 | ENDDO |
---|
| 168 | ENDDO |
---|
| 169 | ENDDO |
---|
| 170 | |
---|
| 171 | CASE ( 'ql_v' ) |
---|
[667] | 172 | DO i = nxlg, nxrg |
---|
| 173 | DO j = nysg, nyng |
---|
[1] | 174 | DO k = nzb, nzt+1 |
---|
| 175 | ql_v_av(k,j,i) = ql_v_av(k,j,i) / REAL( average_count_3d ) |
---|
| 176 | ENDDO |
---|
| 177 | ENDDO |
---|
| 178 | ENDDO |
---|
| 179 | |
---|
| 180 | CASE ( 'ql_vp' ) |
---|
[667] | 181 | DO i = nxlg, nxrg |
---|
| 182 | DO j = nysg, nyng |
---|
[1] | 183 | DO k = nzb, nzt+1 |
---|
| 184 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) / & |
---|
| 185 | REAL( average_count_3d ) |
---|
| 186 | ENDDO |
---|
| 187 | ENDDO |
---|
| 188 | ENDDO |
---|
| 189 | |
---|
| 190 | CASE ( 'qv' ) |
---|
[667] | 191 | DO i = nxlg, nxrg |
---|
| 192 | DO j = nysg, nyng |
---|
[1] | 193 | DO k = nzb, nzt+1 |
---|
| 194 | qv_av(k,j,i) = qv_av(k,j,i) / REAL( average_count_3d ) |
---|
| 195 | ENDDO |
---|
| 196 | ENDDO |
---|
| 197 | ENDDO |
---|
[367] | 198 | |
---|
[96] | 199 | CASE ( 'rho' ) |
---|
[667] | 200 | DO i = nxlg, nxrg |
---|
| 201 | DO j = nysg, nyng |
---|
[96] | 202 | DO k = nzb, nzt+1 |
---|
| 203 | rho_av(k,j,i) = rho_av(k,j,i) / REAL( average_count_3d ) |
---|
| 204 | ENDDO |
---|
| 205 | ENDDO |
---|
| 206 | ENDDO |
---|
[367] | 207 | |
---|
[1] | 208 | CASE ( 's' ) |
---|
[667] | 209 | DO i = nxlg, nxrg |
---|
| 210 | DO j = nysg, nyng |
---|
[1] | 211 | DO k = nzb, nzt+1 |
---|
| 212 | s_av(k,j,i) = s_av(k,j,i) / REAL( average_count_3d ) |
---|
| 213 | ENDDO |
---|
| 214 | ENDDO |
---|
| 215 | ENDDO |
---|
[367] | 216 | |
---|
[96] | 217 | CASE ( 'sa' ) |
---|
[667] | 218 | DO i = nxlg, nxrg |
---|
| 219 | DO j = nysg, nyng |
---|
[96] | 220 | DO k = nzb, nzt+1 |
---|
| 221 | sa_av(k,j,i) = sa_av(k,j,i) / REAL( average_count_3d ) |
---|
| 222 | ENDDO |
---|
| 223 | ENDDO |
---|
| 224 | ENDDO |
---|
[367] | 225 | |
---|
[354] | 226 | CASE ( 'shf*' ) |
---|
[667] | 227 | DO i = nxlg, nxrg |
---|
| 228 | DO j = nysg, nyng |
---|
[354] | 229 | shf_av(j,i) = shf_av(j,i) / REAL( average_count_3d ) |
---|
| 230 | ENDDO |
---|
| 231 | ENDDO |
---|
[367] | 232 | |
---|
[1] | 233 | CASE ( 't*' ) |
---|
[667] | 234 | DO i = nxlg, nxrg |
---|
| 235 | DO j = nysg, nyng |
---|
[1] | 236 | ts_av(j,i) = ts_av(j,i) / REAL( average_count_3d ) |
---|
| 237 | ENDDO |
---|
| 238 | ENDDO |
---|
| 239 | |
---|
| 240 | CASE ( 'u' ) |
---|
[667] | 241 | DO i = nxlg, nxrg |
---|
| 242 | DO j = nysg, nyng |
---|
[1] | 243 | DO k = nzb, nzt+1 |
---|
| 244 | u_av(k,j,i) = u_av(k,j,i) / REAL( average_count_3d ) |
---|
| 245 | ENDDO |
---|
| 246 | ENDDO |
---|
| 247 | ENDDO |
---|
| 248 | |
---|
| 249 | CASE ( 'u*' ) |
---|
[667] | 250 | DO i = nxlg, nxrg |
---|
| 251 | DO j = nysg, nyng |
---|
[1] | 252 | us_av(j,i) = us_av(j,i) / REAL( average_count_3d ) |
---|
| 253 | ENDDO |
---|
| 254 | ENDDO |
---|
| 255 | |
---|
| 256 | CASE ( 'v' ) |
---|
[667] | 257 | DO i = nxlg, nxrg |
---|
| 258 | DO j = nysg, nyng |
---|
[1] | 259 | DO k = nzb, nzt+1 |
---|
| 260 | v_av(k,j,i) = v_av(k,j,i) / REAL( average_count_3d ) |
---|
| 261 | ENDDO |
---|
| 262 | ENDDO |
---|
| 263 | ENDDO |
---|
| 264 | |
---|
| 265 | CASE ( 'vpt' ) |
---|
[667] | 266 | DO i = nxlg, nxrg |
---|
| 267 | DO j = nysg, nyng |
---|
[1] | 268 | DO k = nzb, nzt+1 |
---|
| 269 | vpt_av(k,j,i) = vpt_av(k,j,i) / REAL( average_count_3d ) |
---|
| 270 | ENDDO |
---|
| 271 | ENDDO |
---|
| 272 | ENDDO |
---|
| 273 | |
---|
| 274 | CASE ( 'w' ) |
---|
[667] | 275 | DO i = nxlg, nxrg |
---|
| 276 | DO j = nysg, nyng |
---|
[1] | 277 | DO k = nzb, nzt+1 |
---|
| 278 | w_av(k,j,i) = w_av(k,j,i) / REAL( average_count_3d ) |
---|
| 279 | ENDDO |
---|
| 280 | ENDDO |
---|
| 281 | ENDDO |
---|
| 282 | |
---|
[72] | 283 | CASE ( 'z0*' ) |
---|
[667] | 284 | DO i = nxlg, nxrg |
---|
| 285 | DO j = nysg, nyng |
---|
[72] | 286 | z0_av(j,i) = z0_av(j,i) / REAL( average_count_3d ) |
---|
| 287 | ENDDO |
---|
| 288 | ENDDO |
---|
| 289 | |
---|
[978] | 290 | CASE ( 'z0h*' ) |
---|
| 291 | DO i = nxlg, nxrg |
---|
| 292 | DO j = nysg, nyng |
---|
| 293 | z0h_av(j,i) = z0h_av(j,i) / REAL( average_count_3d ) |
---|
| 294 | ENDDO |
---|
| 295 | ENDDO |
---|
| 296 | |
---|
[1] | 297 | CASE DEFAULT |
---|
| 298 | ! |
---|
| 299 | !-- User-defined quantity |
---|
| 300 | CALL user_3d_data_averaging( 'average', doav(ii) ) |
---|
| 301 | |
---|
| 302 | END SELECT |
---|
| 303 | |
---|
| 304 | ENDDO |
---|
| 305 | |
---|
| 306 | ! |
---|
| 307 | !-- Reset the counter |
---|
| 308 | average_count_3d = 0.0 |
---|
| 309 | |
---|
| 310 | CALL cpu_log (log_point(35),'average_3d_data','stop','nobarrier') |
---|
| 311 | |
---|
| 312 | |
---|
| 313 | END SUBROUTINE average_3d_data |
---|