Calculated TAU which is used in computing the viscous source terms.
175 type(model_state_type),
target,
intent(inout) :: current_state
176 type(prognostic_field_type),
intent(inout) :: zu, zv, zw
177 integer,
intent(in) :: local_y, local_x
178 real(kind=DEFAULT_PRECISION),
dimension(:),
intent(out) :: tau12, tau12m1, tau11, tau22, tau22_yp1, tau33, &
179 tau11p1, tau13, tau13m1, tau23, tau23_ym1, tau12_ym1
182 real(kind=DEFAULT_PRECISION) :: vistmp, vis12, vis12a, visonp2, visonp2a, vis13, vis23
185 do k=1, current_state%local_grid%size(z_index)
187 vistmp=current_state%vis_coefficient%data(k, local_y, local_x)+current_state%vis_coefficient%data(k, local_y+1, local_x)+&
188 current_state%vis_coefficient%data(k-1, local_y, local_x)+current_state%vis_coefficient%data(k-1, local_y+1, local_x)
189 vis12=0.125_default_precision*(vistmp + current_state%vis_coefficient%data(k, local_y, local_x+1)+&
190 current_state%vis_coefficient%data(k, local_y+1, local_x+1)+&
191 current_state%vis_coefficient%data(k-1, local_y, local_x+1)+&
192 current_state%vis_coefficient%data(k-1, local_y+1, local_x+1))
193 tau12(k)=0.0_default_precision
195 tau12(k)=(zu%data(k, local_y+1, local_x)-zu%data(k, local_y, local_x))*&
196 current_state%global_grid%configuration%horizontal%cy
199 tau12(k)=tau12(k)+(zv%data(k, local_y, local_x+1)-zv%data(k, local_y, local_x))*&
200 current_state%global_grid%configuration%horizontal%cx
202 tau12(k)=tau12(k)*current_state%global_grid%configuration%vertical%rhon(k)*vis12
204 vis12a=0.125_default_precision*(vistmp +current_state%vis_coefficient%data(k, local_y, local_x-1)+&
205 current_state%vis_coefficient%data(k, local_y+1, local_x-1)+&
206 current_state%vis_coefficient%data(k-1, local_y, local_x-1)+&
207 current_state%vis_coefficient%data(k-1, local_y+1, local_x-1))
208 tau12m1(k)=0.0_default_precision
210 tau12m1(k)=(zu%data(k, local_y+1, local_x-1)-zu%data(k, local_y, local_x-1))*&
211 current_state%global_grid%configuration%horizontal%cy
214 tau12m1(k)=tau12m1(k)+(zv%data(k, local_y, local_x)-zv%data(k, local_y, local_x-1))*&
215 current_state%global_grid%configuration%horizontal%cx
217 tau12m1(k)=tau12m1(k)*current_state%global_grid%configuration%vertical%rhon(k)*vis12a
219 vistmp=current_state%vis_coefficient%data(k, local_y-1, local_x)+current_state%vis_coefficient%data(k, local_y, local_x)+&
220 current_state%vis_coefficient%data(k-1, local_y-1, local_x)+current_state%vis_coefficient%data(k-1, local_y, local_x)
221 vis12=0.125_default_precision*(vistmp + current_state%vis_coefficient%data(k, local_y-1, local_x+1)+&
222 current_state%vis_coefficient%data(k, local_y, local_x+1)+&
223 current_state%vis_coefficient%data(k-1, local_y-1, local_x+1)+&
224 current_state%vis_coefficient%data(k-1, local_y, local_x+1))
225 tau12_ym1(k)=0.0_default_precision
227 tau12_ym1(k)=(zu%data(k, local_y, local_x)-zu%data(k, local_y-1, local_x))*&
228 current_state%global_grid%configuration%horizontal%cy
231 tau12_ym1(k)=tau12_ym1(k)+(zv%data(k, local_y-1, local_x+1)-zv%data(k, local_y-1, local_x))*&
232 current_state%global_grid%configuration%horizontal%cx
234 tau12_ym1(k)=tau12_ym1(k)*current_state%global_grid%configuration%vertical%rhon(k)*vis12
236 visonp2=current_state%global_grid%configuration%vertical%rhon(k)*&
237 (current_state%vis_coefficient%data(k, local_y, local_x)+current_state%vis_coefficient%data(k-1, local_y, local_x))
239 tau11(k)=visonp2*(zu%data(k, local_y, local_x)-zu%data(k, local_y, local_x-1))*&
240 current_state%global_grid%configuration%horizontal%cx
242 tau11(k)=0.0_default_precision
245 tau22(k)=visonp2*(zv%data(k, local_y, local_x)-zv%data(k, local_y-1, local_x))*&
246 current_state%global_grid%configuration%horizontal%cy
248 tau22(k)=0.0_default_precision
251 tau33(k)=visonp2*(zw%data(k, local_y, local_x)-zw%data(k-1, local_y, local_x))*&
252 current_state%global_grid%configuration%vertical%rdz(k)
254 tau33(k)=0.0_default_precision
258 visonp2=current_state%global_grid%configuration%vertical%rhon(k)*&
259 (current_state%vis_coefficient%data(k, local_y+1, local_x)+&
260 current_state%vis_coefficient%data(k-1, local_y+1, local_x))
261 tau22_yp1(k)=visonp2*(zv%data(k, local_y+1, local_x)-zv%data(k, local_y, local_x))*&
262 current_state%global_grid%configuration%horizontal%cy
266 visonp2a=current_state%global_grid%configuration%vertical%rhon(k)*&
267 (current_state%vis_coefficient%data(k, local_y, local_x+1)+&
268 current_state%vis_coefficient%data(k-1, local_y, local_x+1))
269 tau11p1(k)=visonp2a*(current_state%zu%data(k, local_y, local_x+1)-&
270 zu%data(k, local_y, local_x))*current_state%global_grid%configuration%horizontal%cx
273 tau12(k)=0.0_default_precision
274 tau12_ym1(k)=0.0_default_precision
275 tau12m1(k)=0.0_default_precision
276 tau11(k)=0.0_default_precision
277 tau22(k)=0.0_default_precision
278 tau22_yp1(k)=0.0_default_precision
279 tau33(k)=0.0_default_precision
280 tau11p1(k)=0.0_default_precision
282 if (k .lt. current_state%local_grid%size(z_index))
then 283 vis13=0.5_default_precision*(current_state%vis_coefficient%data(k, local_y, local_x)+&
284 current_state%vis_coefficient%data(k, local_y, local_x+1))
285 tau13(k)=0.0_default_precision
287 tau13(k)=(zu%data(k+1, local_y, local_x)-zu%data(k, local_y, local_x))*&
288 current_state%global_grid%configuration%vertical%rdzn(k+1)
291 tau13(k)=tau13(k)+(zw%data(k, local_y, local_x+1)-zw%data(k, local_y, local_x))*&
292 current_state%global_grid%configuration%horizontal%cx
294 tau13(k)=tau13(k)*current_state%global_grid%configuration%vertical%rho(k)*vis13
296 vis13=0.5_default_precision*(current_state%vis_coefficient%data(k, local_y, local_x-1)+&
297 current_state%vis_coefficient%data(k, local_y, local_x))
298 tau13m1(k)=0.0_default_precision
300 tau13m1(k)=(zu%data(k+1, local_y, local_x-1)-zu%data(k, local_y, local_x-1))*&
301 current_state%global_grid%configuration%vertical%rdzn(k+1)
304 tau13m1(k)=tau13m1(k)+(zw%data(k, local_y, local_x)-zw%data(k, local_y, local_x-1))*&
305 current_state%global_grid%configuration%horizontal%cx
307 tau13m1(k)=tau13m1(k)*current_state%global_grid%configuration%vertical%rho(k)*vis13
309 vis23=0.5_default_precision*(current_state%vis_coefficient%data(k, local_y, local_x)+&
310 current_state%vis_coefficient%data(k, local_y+1, local_x))
311 tau23(k)=0.0_default_precision
313 tau23(k)=(zw%data(k, local_y+1, local_x)-zw%data(k, local_y, local_x))*&
314 current_state%global_grid%configuration%horizontal%cy
317 tau23(k)=tau23(k)+(zv%data(k+1, local_y, local_x)-zv%data(k, local_y, local_x))*&
318 current_state%global_grid%configuration%vertical%rdzn(k+1)
320 tau23(k)=tau23(k)*current_state%global_grid%configuration%vertical%rho(k)*vis23
322 vis23=0.5_default_precision*(current_state%vis_coefficient%data(k, local_y-1, local_x)+&
323 current_state%vis_coefficient%data(k, local_y, local_x))
324 tau23_ym1(k)=0.0_default_precision
326 tau23_ym1(k)=(zw%data(k, local_y, local_x)-zw%data(k, local_y-1, local_x))*&
327 current_state%global_grid%configuration%horizontal%cy
330 tau23_ym1(k)=tau23_ym1(k)+(zv%data(k+1, local_y-1, local_x)-zv%data(k, local_y-1, local_x))*&
331 current_state%global_grid%configuration%vertical%rdzn(k+1)
333 tau23_ym1(k)=tau23_ym1(k)*current_state%global_grid%configuration%vertical%rho(k)*vis23
335 tau13(k)=0.0_default_precision
336 tau13m1(k)=0.0_default_precision
337 tau23(k)=0.0_default_precision
338 tau23_ym1(k)=0.0_default_precision