[1] | 1 | SUBROUTINE average_3d_data |
---|
| 2 | |
---|
| 3 | !------------------------------------------------------------------------------! |
---|
| 4 | ! Actual revisions: |
---|
| 5 | ! ----------------- |
---|
| 6 | ! |
---|
| 7 | ! |
---|
| 8 | ! Former revisions: |
---|
| 9 | ! ----------------- |
---|
[3] | 10 | ! $Id: average_3d_data.f90 4 2007-02-13 11:33:16Z raasch $ |
---|
| 11 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
| 12 | ! |
---|
[1] | 13 | ! Revision 1.1 2006/02/23 09:48:58 raasch |
---|
| 14 | ! Initial revision |
---|
| 15 | ! |
---|
| 16 | ! |
---|
| 17 | ! Description: |
---|
| 18 | ! ------------ |
---|
| 19 | ! Time-averaging of 3d-data-arrays. |
---|
| 20 | !------------------------------------------------------------------------------! |
---|
| 21 | |
---|
| 22 | USE arrays_3d |
---|
| 23 | USE averaging |
---|
| 24 | USE cloud_parameters |
---|
| 25 | USE control_parameters |
---|
| 26 | USE cpulog |
---|
| 27 | USE indices |
---|
| 28 | USE interfaces |
---|
| 29 | |
---|
| 30 | IMPLICIT NONE |
---|
| 31 | |
---|
| 32 | INTEGER :: i, ii, j, k |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | CALL cpu_log (log_point(35),'average_3d_data','start') |
---|
| 36 | |
---|
| 37 | ! |
---|
| 38 | !-- Check, if averaging is necessary |
---|
| 39 | IF ( average_count_3d <= 1 ) RETURN |
---|
| 40 | |
---|
| 41 | ! |
---|
| 42 | !-- Loop of all variables to be averaged. |
---|
| 43 | DO ii = 1, doav_n |
---|
| 44 | |
---|
| 45 | ! |
---|
| 46 | !-- Store the array chosen on the temporary array. |
---|
| 47 | SELECT CASE ( TRIM( doav(ii) ) ) |
---|
| 48 | |
---|
| 49 | CASE ( 'e' ) |
---|
| 50 | DO i = nxl-1, nxr+1 |
---|
| 51 | DO j = nys-1, nyn+1 |
---|
| 52 | DO k = nzb, nzt+1 |
---|
| 53 | e_av(k,j,i) = e_av(k,j,i) / REAL( average_count_3d ) |
---|
| 54 | ENDDO |
---|
| 55 | ENDDO |
---|
| 56 | ENDDO |
---|
| 57 | |
---|
| 58 | CASE ( 'lwp*' ) |
---|
| 59 | DO i = nxl-1, nxr+1 |
---|
| 60 | DO j = nys-1, nyn+1 |
---|
| 61 | lwp_av(j,i) = lwp_av(j,i) / REAL( average_count_3d ) |
---|
| 62 | ENDDO |
---|
| 63 | ENDDO |
---|
| 64 | |
---|
| 65 | CASE ( 'p' ) |
---|
| 66 | DO i = nxl-1, nxr+1 |
---|
| 67 | DO j = nys-1, nyn+1 |
---|
| 68 | DO k = nzb, nzt+1 |
---|
| 69 | p_av(k,j,i) = p_av(k,j,i) / REAL( average_count_3d ) |
---|
| 70 | ENDDO |
---|
| 71 | ENDDO |
---|
| 72 | ENDDO |
---|
| 73 | |
---|
| 74 | CASE ( 'pc' ) |
---|
| 75 | DO i = nxl, nxr |
---|
| 76 | DO j = nys, nyn |
---|
| 77 | DO k = nzb, nzt+1 |
---|
| 78 | pc_av(k,j,i) = pc_av(k,j,i) / REAL( average_count_3d ) |
---|
| 79 | ENDDO |
---|
| 80 | ENDDO |
---|
| 81 | ENDDO |
---|
| 82 | |
---|
| 83 | CASE ( 'pr' ) |
---|
| 84 | DO i = nxl, nxr |
---|
| 85 | DO j = nys, nyn |
---|
| 86 | DO k = nzb, nzt+1 |
---|
| 87 | pr_av(k,j,i) = pr_av(k,j,i) / REAL( average_count_3d ) |
---|
| 88 | ENDDO |
---|
| 89 | ENDDO |
---|
| 90 | ENDDO |
---|
| 91 | |
---|
| 92 | CASE ( 'pt' ) |
---|
| 93 | DO i = nxl-1, nxr+1 |
---|
| 94 | DO j = nys-1, nyn+1 |
---|
| 95 | DO k = nzb, nzt+1 |
---|
| 96 | pt_av(k,j,i) = pt_av(k,j,i) / REAL( average_count_3d ) |
---|
| 97 | ENDDO |
---|
| 98 | ENDDO |
---|
| 99 | ENDDO |
---|
| 100 | |
---|
| 101 | CASE ( 'q' ) |
---|
| 102 | DO i = nxl-1, nxr+1 |
---|
| 103 | DO j = nys-1, nyn+1 |
---|
| 104 | DO k = nzb, nzt+1 |
---|
| 105 | q_av(k,j,i) = q_av(k,j,i) / REAL( average_count_3d ) |
---|
| 106 | ENDDO |
---|
| 107 | ENDDO |
---|
| 108 | ENDDO |
---|
| 109 | |
---|
| 110 | CASE ( 'ql' ) |
---|
| 111 | DO i = nxl-1, nxr+1 |
---|
| 112 | DO j = nys-1, nyn+1 |
---|
| 113 | DO k = nzb, nzt+1 |
---|
| 114 | ql_av(k,j,i) = ql_av(k,j,i) / REAL( average_count_3d ) |
---|
| 115 | ENDDO |
---|
| 116 | ENDDO |
---|
| 117 | ENDDO |
---|
| 118 | |
---|
| 119 | CASE ( 'ql_c' ) |
---|
| 120 | DO i = nxl-1, nxr+1 |
---|
| 121 | DO j = nys-1, nyn+1 |
---|
| 122 | DO k = nzb, nzt+1 |
---|
| 123 | ql_c_av(k,j,i) = ql_c_av(k,j,i) / REAL( average_count_3d ) |
---|
| 124 | ENDDO |
---|
| 125 | ENDDO |
---|
| 126 | ENDDO |
---|
| 127 | |
---|
| 128 | CASE ( 'ql_v' ) |
---|
| 129 | DO i = nxl-1, nxr+1 |
---|
| 130 | DO j = nys-1, nyn+1 |
---|
| 131 | DO k = nzb, nzt+1 |
---|
| 132 | ql_v_av(k,j,i) = ql_v_av(k,j,i) / REAL( average_count_3d ) |
---|
| 133 | ENDDO |
---|
| 134 | ENDDO |
---|
| 135 | ENDDO |
---|
| 136 | |
---|
| 137 | CASE ( 'ql_vp' ) |
---|
| 138 | DO i = nxl-1, nxr+1 |
---|
| 139 | DO j = nys-1, nyn+1 |
---|
| 140 | DO k = nzb, nzt+1 |
---|
| 141 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) / & |
---|
| 142 | REAL( average_count_3d ) |
---|
| 143 | ENDDO |
---|
| 144 | ENDDO |
---|
| 145 | ENDDO |
---|
| 146 | |
---|
| 147 | CASE ( 'qv' ) |
---|
| 148 | DO i = nxl-1, nxr+1 |
---|
| 149 | DO j = nys-1, nyn+1 |
---|
| 150 | DO k = nzb, nzt+1 |
---|
| 151 | qv_av(k,j,i) = qv_av(k,j,i) / REAL( average_count_3d ) |
---|
| 152 | ENDDO |
---|
| 153 | ENDDO |
---|
| 154 | ENDDO |
---|
| 155 | |
---|
| 156 | CASE ( 's' ) |
---|
| 157 | DO i = nxl-1, nxr+1 |
---|
| 158 | DO j = nys-1, nyn+1 |
---|
| 159 | DO k = nzb, nzt+1 |
---|
| 160 | s_av(k,j,i) = s_av(k,j,i) / REAL( average_count_3d ) |
---|
| 161 | ENDDO |
---|
| 162 | ENDDO |
---|
| 163 | ENDDO |
---|
| 164 | |
---|
| 165 | CASE ( 't*' ) |
---|
| 166 | DO i = nxl-1, nxr+1 |
---|
| 167 | DO j = nys-1, nyn+1 |
---|
| 168 | ts_av(j,i) = ts_av(j,i) / REAL( average_count_3d ) |
---|
| 169 | ENDDO |
---|
| 170 | ENDDO |
---|
| 171 | |
---|
| 172 | CASE ( 'u' ) |
---|
| 173 | DO i = nxl-1, nxr+1 |
---|
| 174 | DO j = nys-1, nyn+1 |
---|
| 175 | DO k = nzb, nzt+1 |
---|
| 176 | u_av(k,j,i) = u_av(k,j,i) / REAL( average_count_3d ) |
---|
| 177 | ENDDO |
---|
| 178 | ENDDO |
---|
| 179 | ENDDO |
---|
| 180 | |
---|
| 181 | CASE ( 'u*' ) |
---|
| 182 | DO i = nxl-1, nxr+1 |
---|
| 183 | DO j = nys-1, nyn+1 |
---|
| 184 | us_av(j,i) = us_av(j,i) / REAL( average_count_3d ) |
---|
| 185 | ENDDO |
---|
| 186 | ENDDO |
---|
| 187 | |
---|
| 188 | CASE ( 'v' ) |
---|
| 189 | DO i = nxl-1, nxr+1 |
---|
| 190 | DO j = nys-1, nyn+1 |
---|
| 191 | DO k = nzb, nzt+1 |
---|
| 192 | v_av(k,j,i) = v_av(k,j,i) / REAL( average_count_3d ) |
---|
| 193 | ENDDO |
---|
| 194 | ENDDO |
---|
| 195 | ENDDO |
---|
| 196 | |
---|
| 197 | CASE ( 'vpt' ) |
---|
| 198 | DO i = nxl-1, nxr+1 |
---|
| 199 | DO j = nys-1, nyn+1 |
---|
| 200 | DO k = nzb, nzt+1 |
---|
| 201 | vpt_av(k,j,i) = vpt_av(k,j,i) / REAL( average_count_3d ) |
---|
| 202 | ENDDO |
---|
| 203 | ENDDO |
---|
| 204 | ENDDO |
---|
| 205 | |
---|
| 206 | CASE ( 'w' ) |
---|
| 207 | DO i = nxl-1, nxr+1 |
---|
| 208 | DO j = nys-1, nyn+1 |
---|
| 209 | DO k = nzb, nzt+1 |
---|
| 210 | w_av(k,j,i) = w_av(k,j,i) / REAL( average_count_3d ) |
---|
| 211 | ENDDO |
---|
| 212 | ENDDO |
---|
| 213 | ENDDO |
---|
| 214 | |
---|
| 215 | CASE DEFAULT |
---|
| 216 | ! |
---|
| 217 | !-- User-defined quantity |
---|
| 218 | CALL user_3d_data_averaging( 'average', doav(ii) ) |
---|
| 219 | |
---|
| 220 | END SELECT |
---|
| 221 | |
---|
| 222 | ENDDO |
---|
| 223 | |
---|
| 224 | ! |
---|
| 225 | !-- Reset the counter |
---|
| 226 | average_count_3d = 0.0 |
---|
| 227 | |
---|
| 228 | CALL cpu_log (log_point(35),'average_3d_data','stop','nobarrier') |
---|
| 229 | |
---|
| 230 | |
---|
| 231 | END SUBROUTINE average_3d_data |
---|