Calculated TAU which is used in computing the viscous source terms.
338 type(model_state_type),
target,
intent(inout) :: current_state
339 type(prognostic_field_type),
intent(inout) :: zu, zv, zw
340 integer,
intent(in) :: local_y, local_x
341 real(kind=
default_precision),
dimension(:),
intent(out) :: tau12, tau12m1, tau11, tau22, tau22_yp1, tau33, &
342 tau11p1, tau13, tau13m1, tau23, tau23_ym1, tau12_ym1
345 real(kind=
default_precision) :: vistmp, vis12, vis12a, visonp2, visonp2a, vis13, vis23
348 do k=1, current_state%local_grid%size(
z_index)
350 vistmp=current_state%vis_coefficient%data(k, local_y, local_x)+current_state%vis_coefficient%data(k, local_y+1, local_x)+&
351 current_state%vis_coefficient%data(k-1, local_y, local_x)+current_state%vis_coefficient%data(k-1, local_y+1, local_x)
352 vis12=0.125_default_precision*(vistmp + current_state%vis_coefficient%data(k, local_y, local_x+1)+&
353 current_state%vis_coefficient%data(k, local_y+1, local_x+1)+&
354 current_state%vis_coefficient%data(k-1, local_y, local_x+1)+&
355 current_state%vis_coefficient%data(k-1, local_y+1, local_x+1))
356 tau12(k)=0.0_default_precision
358 tau12(k)=(zu%data(k, local_y+1, local_x)-zu%data(k, local_y, local_x))*&
359 current_state%global_grid%configuration%horizontal%cy
362 tau12(k)=tau12(k)+(zv%data(k, local_y, local_x+1)-zv%data(k, local_y, local_x))*&
363 current_state%global_grid%configuration%horizontal%cx
365 tau12(k)=tau12(k)*current_state%global_grid%configuration%vertical%rhon(k)*vis12
367 vis12a=0.125_default_precision*(vistmp +current_state%vis_coefficient%data(k, local_y, local_x-1)+&
368 current_state%vis_coefficient%data(k, local_y+1, local_x-1)+&
369 current_state%vis_coefficient%data(k-1, local_y, local_x-1)+&
370 current_state%vis_coefficient%data(k-1, local_y+1, local_x-1))
371 tau12m1(k)=0.0_default_precision
373 tau12m1(k)=(zu%data(k, local_y+1, local_x-1)-zu%data(k, local_y, local_x-1))*&
374 current_state%global_grid%configuration%horizontal%cy
377 tau12m1(k)=tau12m1(k)+(zv%data(k, local_y, local_x)-zv%data(k, local_y, local_x-1))*&
378 current_state%global_grid%configuration%horizontal%cx
380 tau12m1(k)=tau12m1(k)*current_state%global_grid%configuration%vertical%rhon(k)*vis12a
382 vistmp=current_state%vis_coefficient%data(k, local_y-1, local_x)+current_state%vis_coefficient%data(k, local_y, local_x)+&
383 current_state%vis_coefficient%data(k-1, local_y-1, local_x)+current_state%vis_coefficient%data(k-1, local_y, local_x)
384 vis12=0.125_default_precision*(vistmp + current_state%vis_coefficient%data(k, local_y-1, local_x+1)+&
385 current_state%vis_coefficient%data(k, local_y, local_x+1)+&
386 current_state%vis_coefficient%data(k-1, local_y-1, local_x+1)+&
387 current_state%vis_coefficient%data(k-1, local_y, local_x+1))
388 tau12_ym1(k)=0.0_default_precision
390 tau12_ym1(k)=(zu%data(k, local_y, local_x)-zu%data(k, local_y-1, local_x))*&
391 current_state%global_grid%configuration%horizontal%cy
394 tau12_ym1(k)=tau12_ym1(k)+(zv%data(k, local_y-1, local_x+1)-zv%data(k, local_y-1, local_x))*&
395 current_state%global_grid%configuration%horizontal%cx
397 tau12_ym1(k)=tau12_ym1(k)*current_state%global_grid%configuration%vertical%rhon(k)*vis12
399 visonp2=current_state%global_grid%configuration%vertical%rhon(k)*&
400 (current_state%vis_coefficient%data(k, local_y, local_x)+current_state%vis_coefficient%data(k-1, local_y, local_x))
402 tau11(k)=visonp2*(zu%data(k, local_y, local_x)-zu%data(k, local_y, local_x-1))*&
403 current_state%global_grid%configuration%horizontal%cx
405 tau11(k)=0.0_default_precision
408 tau22(k)=visonp2*(zv%data(k, local_y, local_x)-zv%data(k, local_y-1, local_x))*&
409 current_state%global_grid%configuration%horizontal%cy
411 tau22(k)=0.0_default_precision
414 tau33(k)=visonp2*(zw%data(k, local_y, local_x)-zw%data(k-1, local_y, local_x))*&
415 current_state%global_grid%configuration%vertical%rdz(k)
417 tau33(k)=0.0_default_precision
421 visonp2=current_state%global_grid%configuration%vertical%rhon(k)*&
422 (current_state%vis_coefficient%data(k, local_y+1, local_x)+&
423 current_state%vis_coefficient%data(k-1, local_y+1, local_x))
424 tau22_yp1(k)=visonp2*(zv%data(k, local_y+1, local_x)-zv%data(k, local_y, local_x))*&
425 current_state%global_grid%configuration%horizontal%cy
429 visonp2a=current_state%global_grid%configuration%vertical%rhon(k)*&
430 (current_state%vis_coefficient%data(k, local_y, local_x+1)+&
431 current_state%vis_coefficient%data(k-1, local_y, local_x+1))
432 tau11p1(k)=visonp2a*(current_state%zu%data(k, local_y, local_x+1)-&
433 zu%data(k, local_y, local_x))*current_state%global_grid%configuration%horizontal%cx
436 tau12(k)=0.0_default_precision
437 tau12_ym1(k)=0.0_default_precision
438 tau12m1(k)=0.0_default_precision
439 tau11(k)=0.0_default_precision
440 tau22(k)=0.0_default_precision
441 tau22_yp1(k)=0.0_default_precision
442 tau33(k)=0.0_default_precision
443 tau11p1(k)=0.0_default_precision
445 if (k .lt. current_state%local_grid%size(
z_index))
then
446 vis13=0.5_default_precision*(current_state%vis_coefficient%data(k, local_y, local_x)+&
447 current_state%vis_coefficient%data(k, local_y, local_x+1))
448 tau13(k)=0.0_default_precision
450 tau13(k)=(zu%data(k+1, local_y, local_x)-zu%data(k, local_y, local_x))*&
451 current_state%global_grid%configuration%vertical%rdzn(k+1)
454 tau13(k)=tau13(k)+(zw%data(k, local_y, local_x+1)-zw%data(k, local_y, local_x))*&
455 current_state%global_grid%configuration%horizontal%cx
457 tau13(k)=tau13(k)*current_state%global_grid%configuration%vertical%rho(k)*vis13
459 vis13=0.5_default_precision*(current_state%vis_coefficient%data(k, local_y, local_x-1)+&
460 current_state%vis_coefficient%data(k, local_y, local_x))
461 tau13m1(k)=0.0_default_precision
463 tau13m1(k)=(zu%data(k+1, local_y, local_x-1)-zu%data(k, local_y, local_x-1))*&
464 current_state%global_grid%configuration%vertical%rdzn(k+1)
467 tau13m1(k)=tau13m1(k)+(zw%data(k, local_y, local_x)-zw%data(k, local_y, local_x-1))*&
468 current_state%global_grid%configuration%horizontal%cx
470 tau13m1(k)=tau13m1(k)*current_state%global_grid%configuration%vertical%rho(k)*vis13
472 vis23=0.5_default_precision*(current_state%vis_coefficient%data(k, local_y, local_x)+&
473 current_state%vis_coefficient%data(k, local_y+1, local_x))
474 tau23(k)=0.0_default_precision
476 tau23(k)=(zw%data(k, local_y+1, local_x)-zw%data(k, local_y, local_x))*&
477 current_state%global_grid%configuration%horizontal%cy
480 tau23(k)=tau23(k)+(zv%data(k+1, local_y, local_x)-zv%data(k, local_y, local_x))*&
481 current_state%global_grid%configuration%vertical%rdzn(k+1)
483 tau23(k)=tau23(k)*current_state%global_grid%configuration%vertical%rho(k)*vis23
485 vis23=0.5_default_precision*(current_state%vis_coefficient%data(k, local_y-1, local_x)+&
486 current_state%vis_coefficient%data(k, local_y, local_x))
487 tau23_ym1(k)=0.0_default_precision
489 tau23_ym1(k)=(zw%data(k, local_y, local_x)-zw%data(k, local_y-1, local_x))*&
490 current_state%global_grid%configuration%horizontal%cy
493 tau23_ym1(k)=tau23_ym1(k)+(zv%data(k+1, local_y-1, local_x)-zv%data(k, local_y-1, local_x))*&
494 current_state%global_grid%configuration%vertical%rdzn(k+1)
496 tau23_ym1(k)=tau23_ym1(k)*current_state%global_grid%configuration%vertical%rho(k)*vis23
498 tau13(k)=0.0_default_precision
499 tau13m1(k)=0.0_default_precision
500 tau23(k)=0.0_default_precision
501 tau23_ym1(k)=0.0_default_precision