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