94 real(RP),
intent(out) :: S33_C (KA,IA,JA)
95 real(RP),
intent(out) :: S11_C (KA,IA,JA)
96 real(RP),
intent(out) :: S22_C (KA,IA,JA)
97 real(RP),
intent(out) :: S31_C (KA,IA,JA)
98 real(RP),
intent(out) :: S12_C (KA,IA,JA)
99 real(RP),
intent(out) :: S23_C (KA,IA,JA)
100 real(RP),
intent(out) :: S12_Z (KA,IA,JA)
101 real(RP),
intent(out) :: S23_X (KA,IA,JA)
102 real(RP),
intent(out) :: S31_Y (KA,IA,JA)
103 real(RP),
intent(out) :: S2 (KA,IA,JA)
105 real(RP),
intent(in) :: DENS (KA,IA,JA)
106 real(RP),
intent(in) :: MOMZ (KA,IA,JA)
107 real(RP),
intent(in) :: MOMX (KA,IA,JA)
108 real(RP),
intent(in) :: MOMY (KA,IA,JA)
110 real(RP),
intent(in) :: GSQRT (KA,IA,JA,7)
111 real(RP),
intent(in) :: J13G (KA,IA,JA,7)
112 real(RP),
intent(in) :: J23G (KA,IA,JA,7)
113 real(RP),
intent(in) :: J33G
114 real(RP),
intent(in) :: MAPF (IA,JA,2,4)
117 real(RP) :: VELZ_C (KA,IA,JA)
118 real(RP) :: VELZ_XY(KA,IA,JA)
119 real(RP) :: VELX_C (KA,IA,JA)
120 real(RP) :: VELX_YZ(KA,IA,JA)
121 real(RP) :: VELY_C (KA,IA,JA)
122 real(RP) :: VELY_ZX(KA,IA,JA)
125 real(RP) :: WORK_V(KA,IA,JA)
126 real(RP) :: WORK_Z(KA,IA,JA)
127 real(RP) :: WORK_X(KA,IA,JA)
128 real(RP) :: WORK_Y(KA,IA,JA)
130 integer :: IIS, IIE, JJS, JJE
145 velz_c(:,:,:) = undef
146 velz_xy(:,:,:) = undef
147 velx_c(:,:,:) = undef
148 velx_yz(:,:,:) = undef
149 vely_c(:,:,:) = undef
150 vely_zx(:,:,:) = undef
152 work_v(:,:,:) = undef
153 work_z(:,:,:) = undef
154 work_x(:,:,:) = undef
155 work_y(:,:,:) = undef
163 call check( __line__, momz(k,i,j) )
164 call check( __line__, dens(k+1,i,j) )
165 call check( __line__, dens(k,i,j) )
167 velz_xy(k,i,j) = 2.0_rp * momz(k,i,j) / ( dens(k+1,i,j)+dens(k,i,j) )
172 i = iundef; j = iundef; k = iundef
176 velz_xy(ke,i,j) = 0.0_rp
180 i = iundef; j = iundef; k = iundef
186 call check( __line__, momz(k,i,j) )
187 call check( __line__, momz(k-1,i,j) )
188 call check( __line__, dens(k,i,j) )
190 velz_c(k,i,j) = 0.5_rp * ( momz(k,i,j) + momz(k-1,i,j) ) / dens(k,i,j)
195 i = iundef; j = iundef; k = iundef
200 call check( __line__, momz(ks,i,j) )
201 call check( __line__, dens(ks,i,j) )
203 velz_c(ks,i,j) = 0.5_rp * momz(ks,i,j) / dens(ks,i,j)
208 i = iundef; j = iundef; k = iundef
215 call check( __line__, momx(k,i,j) )
216 call check( __line__, dens(k,i+1,j) )
217 call check( __line__, dens(k,i,j) )
219 velx_yz(k,i,j) = 2.0_rp * momx(k,i,j) / ( dens(k,i+1,j)+dens(k,i,j) )
224 i = iundef; j = iundef; k = iundef
228 velx_yz(ke+1,i,j) = 0.0_rp
232 i = iundef; j = iundef; k = iundef
238 call check( __line__, momx(k,i,j) )
239 call check( __line__, momx(k,i-1,j) )
240 call check( __line__, dens(k,i,j) )
242 velx_c(k,i,j) = 0.5_rp * ( momx(k,i,j) + momx(k,i-1,j) ) / dens(k,i,j)
247 i = iundef; j = iundef; k = iundef
256 call check( __line__, momy(k,i,j) )
257 call check( __line__, dens(k,i,j+1) )
258 call check( __line__, dens(k,i,j) )
260 vely_zx(k,i,j) = 2.0_rp * momy(k,i,j) / ( dens(k,i,j+1)+dens(k,i,j) )
265 i = iundef; j = iundef; k = iundef
269 vely_zx(ke+1,i,j) = 0.0_rp
273 i = iundef; j = iundef; k = iundef
279 call check( __line__, momy(k,i,j) )
280 call check( __line__, momy(k,i,j-1) )
281 call check( __line__, dens(k,i,j) )
283 vely_c(k,i,j) = 0.5_rp * ( momy(k,i,j) + momy(k,i,j-1) ) / dens(k,i,j)
288 i = iundef; j = iundef; k = iundef
297 work_z(:,:,:) = undef; work_x(:,:,:) = undef; work_y(:,:,:) = undef; work_v(:,:,:) = undef
307 call check( __line__, velz_c(k,i+1,j) )
308 call check( __line__, velz_c(k,i,j) )
310 work_x(k,i,j) = 0.5_rp * ( velz_c(k,i+1,j) + velz_c(k,i,j) )
315 i = iundef; j = iundef; k = iundef
319 work_x(ke+1,i,j) = 0.0_rp
323 i = iundef; j = iundef; k = iundef
330 call check( __line__, velz_c(k,i,j+1) )
331 call check( __line__, velz_c(k,i,j) )
333 work_y(k,i,j) = 0.5_rp * ( velz_c(k,i,j+1) + velz_c(k,i,j) )
338 i = iundef; j = iundef; k = iundef
342 work_y(ke+1,i,j) = 0.0_rp
346 i = iundef; j = iundef; k = iundef
355 call check( __line__, velz_xy(k,i,j) )
356 call check( __line__, velz_xy(k-1,i,j) )
357 call check( __line__, rcdz(k) )
359 s33_c(k,i,j) = ( velz_xy(k,i,j) - velz_xy(k-1,i,j) ) * rcdz(k) &
360 * j33g / gsqrt(k,i,j,
i_xyz)
365 i = iundef; j = iundef; k = iundef
370 call check( __line__, velz_xy(ks,i,j) )
371 call check( __line__, gsqrt(ks,i,j,
i_xyz) )
372 call check( __line__, rcdz(ks) )
374 s33_c(ks,i,j) = velz_xy(ks,i,j) * rcdz(ks) &
375 * j33g / gsqrt(ks,i,j,
i_xyz)
379 i = iundef; j = iundef; k = iundef
388 call check( __line__, velz_c(k,i+1,j) )
389 call check( __line__, velz_c(k,i-1,j) )
390 call check( __line__, gsqrt(k,i+1,j,
i_xyz) )
391 call check( __line__, gsqrt(k,i-1,j,
i_xyz) )
392 call check( __line__, velz_xy(k,i,j) )
393 call check( __line__, velz_xy(k-1,i,j) )
394 call check( __line__, j13g(k,i,j,
i_xyw) )
395 call check( __line__, j13g(k-1,i,j,
i_xyw) )
396 call check( __line__, fdx(i) )
397 call check( __line__, fdx(i-1) )
399 s31_c(k,i,j) = 0.5_rp * ( &
400 ( gsqrt(k,i+1,j,
i_xyz)*velz_c(k,i+1,j) - gsqrt(k,i-1,j,
i_xyz)*velz_c(k,i-1,j) ) / ( fdx(i) + fdx(i-1) ) &
401 + ( j13g(k,i,j,
i_xyw)*velz_xy(k,i,j) - j13g(k-1,i,j,
i_xyw)*velz_xy(k-1,i,j) ) * rcdz(k) &
408 i = iundef; j = iundef; k = iundef
413 call check( __line__, velz_c(ks,i+1,j) )
414 call check( __line__, velz_c(ks,i-1,j) )
415 call check( __line__, gsqrt(ks,i+1,j,
i_xyz) )
416 call check( __line__, gsqrt(ks,i-1,j,
i_xyz) )
417 call check( __line__, velz_xy(ks,i,j) )
418 call check( __line__, j13g(ks,i,j,
i_xyw) )
419 call check( __line__, velz_c(ke,i+1,j) )
420 call check( __line__, velz_c(ke,i-1,j) )
421 call check( __line__, gsqrt(ke,i+1,j,
i_xyz) )
422 call check( __line__, gsqrt(ke,i-1,j,
i_xyz) )
423 call check( __line__, velz_xy(ke,i,j) )
424 call check( __line__, j13g(ke,i,j,
i_xyw) )
425 call check( __line__, fdx(i) )
426 call check( __line__, fdx(i-1) )
428 s31_c(ks,i,j) = 0.5_rp * ( &
429 ( gsqrt(ks,i+1,j,
i_xyz)*velz_c(ks,i+1,j) - gsqrt(ks,i-1,j,
i_xyz)*velz_c(ks,i-1,j) ) / ( fdx(i) + fdx(i-1) ) &
430 + ( j13g(ks,i,j,
i_xyw)*velz_xy(ks,i,j) ) * rcdz(ks) &
432 s31_c(ke,i,j) = 0.5_rp * ( &
433 ( gsqrt(ke,i+1,j,
i_xyz)*velz_c(ke,i+1,j) - gsqrt(ke,i-1,j,
i_xyz)*velz_c(ke,i-1,j) ) / ( fdx(i) + fdx(i-1) ) &
434 - ( j13g(ke-1,i,j,
i_xyw)*velz_xy(ke-1,i,j) ) * rcdz(ke) &
439 i = iundef; j = iundef; k = iundef
447 call check( __line__, velz_xy(k,i+1,j) )
448 call check( __line__, velz_xy(k,i,j) )
449 call check( __line__, rfdx(i) )
451 s31_y(k,i,j) = 0.5_rp * ( &
452 ( gsqrt(k,i+1,j,
i_xyw)*velz_xy(k,i+1,j) - gsqrt(k,i,j,
i_xyw)*velz_xy(k,i,j) ) * rfdx(i) &
453 + ( j13g(k+1,i,j,
i_uyz)*work_x(k+1,i,j) - j13g(k,i,j,
i_uyz)*work_x(k,i,j)) * rfdz(k) &
459 i = iundef; j = iundef; k = iundef
468 call check( __line__, velz_c(k,i,j+1) )
469 call check( __line__, velz_c(k,i,j-1) )
470 call check( __line__, gsqrt(k,i,j+1,
i_xyz) )
471 call check( __line__, gsqrt(k,i,j-1,
i_xyz) )
472 call check( __line__, velz_xy(k,i,j) )
473 call check( __line__, velz_xy(k-1,i,j) )
474 call check( __line__, j23g(k,i,j,
i_xyw) )
475 call check( __line__, j23g(k-1,i,j,
i_xyw) )
476 call check( __line__, fdy(j) )
477 call check( __line__, fdy(j-1) )
479 s23_c(k,i,j) = 0.5_rp * ( &
480 ( gsqrt(k,i,j+1,
i_xyz)*velz_c(k,i,j+1) - gsqrt(k,i,j-1,
i_xyz)*velz_c(k,i,j-1) ) / ( fdy(j) + fdy(j-1) ) &
481 + ( j23g(k,i,j,
i_xyw)*velz_xy(k,i,j) - j23g(k-1,i,j,
i_xyw)*velz_xy(k-1,i,j) ) * rcdz(k) &
487 i = iundef; j = iundef; k = iundef
492 call check( __line__, velz_c(ks,i,j+1) )
493 call check( __line__, velz_c(ks,i,j-1) )
494 call check( __line__, gsqrt(ks,i,j+1,
i_xyz) )
495 call check( __line__, gsqrt(ks,i,j-1,
i_xyz) )
496 call check( __line__, velz_xy(ks,i,j) )
497 call check( __line__, j23g(ks,i,j,
i_xyw) )
498 call check( __line__, velz_c(ke,i,j+1) )
499 call check( __line__, velz_c(ke,i,j-1) )
500 call check( __line__, gsqrt(ke,i,j+1,
i_xyz) )
501 call check( __line__, gsqrt(ke,i,j-1,
i_xyz) )
502 call check( __line__, velz_xy(ke,i,j) )
503 call check( __line__, j23g(ke,i,j,
i_xyw) )
504 call check( __line__, fdy(j) )
505 call check( __line__, fdy(j-1) )
507 s23_c(ks,i,j) = 0.5_rp * ( &
508 ( gsqrt(ks,i,j+1,
i_xyz)*velz_c(ks,i,j+1) - gsqrt(ks,i,j-1,
i_xyz)*velz_c(ks,i,j-1) ) / ( fdy(j) + fdy(j-1) ) &
509 + ( j23g(ks,i,j,
i_xyw)*velz_xy(ks,i,j) ) * rcdz(ks) &
511 s23_c(ke,i,j) = 0.5_rp * ( &
512 ( gsqrt(ke,i,j+1,
i_xyz)*velz_c(ke,i,j+1) - gsqrt(ke,i,j-1,
i_xyz)*velz_c(ke,i,j-1) ) / ( fdy(j) + fdy(j-1) ) &
513 - ( j23g(ke-1,i,j,
i_xyw)*velz_xy(ke-1,i,j) ) * rcdz(ke) &
518 i = iundef; j = iundef; k = iundef
526 call check( __line__, velz_xy(k,i,j+1) )
527 call check( __line__, velz_xy(k,i,j) )
528 call check( __line__, rfdy(j) )
530 s23_x(k,i,j) = 0.5_rp * ( &
531 ( gsqrt(k,i,j+1,
i_xyw)*velz_xy(k,i,j+1) - gsqrt(k,i,j,
i_xyw)*velz_xy(k,i,j) ) * rfdy(j) &
532 + ( j23g(k+1,i,j,
i_xvz)*work_y(k+1,i,j) - j23g(k,i,j,
i_xvz)*work_y(k,i,j) ) * rfdz(k) &
538 i = iundef; j = iundef; k = iundef
542 work_z(:,:,:) = undef; work_x(:,:,:) = undef; work_y(:,:,:) = undef; work_v(:,:,:) = undef
550 call check( __line__, velx_c(k+1,i,j) )
551 call check( __line__, velx_c(k,i,j) )
553 work_z(k,i,j) = 0.5_rp * ( velx_c(k+1,i,j) + velx_c(k,i,j) )
558 i = iundef; j = iundef; k = iundef
567 call check( __line__, velx_c(k,i,j+1) )
568 call check( __line__, velx_c(k,i,j) )
570 work_y(k,i,j) = 0.5_rp * ( velx_c(k,i,j+1) + velx_c(k,i,j) )
575 i = iundef; j = iundef; k = iundef
582 call check( __line__, velx_yz(k,i,j) )
583 call check( __line__, velx_yz(k,i,j+1) )
584 call check( __line__, velx_yz(k+1,i,j) )
585 call check( __line__, velx_yz(k+1,i,j+1) )
586 call check( __line__, j23g(k ,i,j ,
i_uvz) )
587 call check( __line__, j23g(k+1,i,j ,
i_uvz) )
588 call check( __line__, j23g(k ,i,j+1,
i_uvz) )
589 call check( __line__, j23g(k+1,i,j+1,
i_uvz) )
591 work_v(k,i,j) = 0.25_rp &
592 * ( j23g(k ,i,j ,
i_uyz)*velx_yz(k ,i,j ) &
593 + j23g(k+1,i,j ,
i_uyz)*velx_yz(k+1,i,j ) &
594 + j23g(k ,i,j+1,
i_uyz)*velx_yz(k ,i,j+1) &
595 + j23g(k+1,i,j+1,
i_uyz)*velx_yz(k+1,i,j+1) )
600 i = iundef; j = iundef; k = iundef
609 call check( __line__, velx_yz(k,i,j) )
610 call check( __line__, velx_yz(k,i-1,j) )
611 call check( __line__, gsqrt(k,i,j,
i_uyz) )
612 call check( __line__, gsqrt(k,i-1,j,
i_uyz) )
613 call check( __line__, work_z(k,i,j) )
614 call check( __line__, work_z(k-1,i,j) )
615 call check( __line__, j13g(k,i,j,
i_xyw) )
616 call check( __line__, j13g(k-1,i,j,
i_xyw) )
617 call check( __line__, gsqrt(k,i,j,
i_xyz) )
618 call check( __line__, rcdx(i) )
621 ( gsqrt(k,i,j,
i_uyz)*velx_yz(k,i,j) - gsqrt(k,i-1,j,
i_uyz)*velx_yz(k,i-1,j) ) * rcdx(i) &
622 + ( j13g(k,i,j,
i_xyw)*work_z(k,i,j) - j13g(k-1,i,j,
i_xyw)*work_z(k-1,i,j) ) * rcdz(k) &
623 ) * mapf(i,j,1,
i_xy) / gsqrt(k,i,j,
i_xyz)
628 i = iundef; j = iundef; k = iundef
633 call check( __line__, velx_yz(ks,i,j) )
634 call check( __line__, velx_yz(ks,i-1,j) )
635 call check( __line__, gsqrt(ks,i,j,
i_uyz) )
636 call check( __line__, gsqrt(ks,i-1,j,
i_uyz) )
637 call check( __line__, velx_c(ks+1,i,j) )
638 call check( __line__, velx_c(ks,i,j) )
639 call check( __line__, j13g(ks+1,i,j,
i_xyz) )
640 call check( __line__, j13g(ks,i,j,
i_xyz) )
641 call check( __line__, gsqrt(ks,i,j,
i_xyz) )
642 call check( __line__, velx_yz(ke,i,j) )
643 call check( __line__, velx_yz(ke,i-1,j) )
644 call check( __line__, gsqrt(ke,i,j,
i_uyz) )
645 call check( __line__, gsqrt(ke,i-1,j,
i_uyz) )
646 call check( __line__, velx_c(ke,i,j) )
647 call check( __line__, velx_c(ke-1,i,j) )
648 call check( __line__, j13g(ke,i,j,
i_xyz) )
649 call check( __line__, j13g(ke-1,i,j,
i_xyz) )
650 call check( __line__, gsqrt(ke,i,j,
i_xyz) )
651 call check( __line__, rcdx(i) )
654 ( gsqrt(ks,i,j,
i_uyz)*velx_yz(ks,i,j) - gsqrt(ks,i-1,j,
i_uyz)*velx_yz(ks,i-1,j) ) * rcdx(i) &
655 + ( j13g(ks+1,i,j,
i_xyz)*velx_c(ks+1,i,j) - j13g(ks,i,j,
i_xyz)*velx_c(ks,i,j) ) * rfdz(ks) &
656 ) * mapf(i,j,1,
i_xy) / gsqrt(ks,i,j,
i_xyz)
658 ( gsqrt(ke,i,j,
i_uyz)*velx_yz(ke,i,j) - gsqrt(ke,i-1,j,
i_uyz)*velx_yz(ke,i-1,j) ) * rcdx(i) &
659 + ( j13g(ke,i,j,
i_xyz)*velx_c(ke,i,j) - j13g(ke-1,i,j,
i_xyz)*velx_c(ke-1,i,j) ) * rfdz(ke-1) &
660 ) * mapf(i,j,1,
i_xy) / gsqrt(ke,i,j,
i_xyz)
664 i = iundef; j = iundef; k = iundef
673 call check( __line__, s31_c(k,i,j) )
674 call check( __line__, velx_c(k+1,i,j) )
675 call check( __line__, velx_c(k-1,i,j) )
676 call check( __line__, fdz(k) )
677 call check( __line__, fdz(k-1) )
679 s31_c(k,i,j) = ( s31_c(k,i,j) &
680 + 0.5_rp * ( velx_c(k+1,i,j) - velx_c(k-1,i,j) ) * j33g / ( fdz(k) + fdz(k-1) ) &
681 ) / gsqrt(k,i,j,
i_xyz)
686 i = iundef; j = iundef; k = iundef
691 call check( __line__, s31_c(ks,i,j) )
692 call check( __line__, velx_c(ks+1,i,j) )
693 call check( __line__, velx_c(ks,i,j) )
694 call check( __line__, rfdz(ks) )
695 call check( __line__, s31_c(ke,i,j) )
696 call check( __line__, velx_c(ke,i,j) )
697 call check( __line__, velx_c(ke-1,i,j) )
698 call check( __line__, rfdz(ke-1) )
700 s31_c(ks,i,j) = ( s31_c(ks,i,j) &
701 + 0.5_rp * ( velx_c(ks+1,i,j) - velx_c(ks,i,j) ) * j33g * rfdz(ks) &
702 ) / gsqrt(ks,i,j,
i_xyz)
703 s31_c(ke,i,j) = ( s31_c(ke,i,j) &
704 + 0.5_rp * ( velx_c(ke,i,j) - velx_c(ke-1,i,j) ) * j33g * rfdz(ke-1) &
705 ) / gsqrt(ke,i,j,
i_xyz)
709 i = iundef; j = iundef; k = iundef
716 call check( __line__, s31_y(k,i,j) )
717 call check( __line__, velx_yz(k+1,i,j) )
718 call check( __line__, velx_yz(k,i,j) )
719 call check( __line__, rfdz(k) )
721 s31_y(k,i,j) = ( s31_y(k,i,j) &
722 + 0.5_rp * ( velx_yz(k+1,i,j) - velx_yz(k,i,j) ) * j33g * rfdz(k) &
723 ) / gsqrt(k,i,j,
i_uyw)
728 i = iundef; j = iundef; k = iundef
737 call check( __line__, velx_c(k,i,j+1) )
738 call check( __line__, velx_c(k,i,j-1) )
739 call check( __line__, gsqrt(k,i,j+1,
i_xyz) )
740 call check( __line__, gsqrt(k,i,j-1,
i_xyz) )
741 call check( __line__, work_z(k,i,j) )
742 call check( __line__, work_z(k-1,i,j) )
743 call check( __line__, j23g(k,i,j,
i_xyw) )
744 call check( __line__, j23g(k-1,i,j,
i_xyw) )
746 s12_c(k,i,j) = 0.5_rp * ( &
747 ( gsqrt(k,i,j+1,
i_xyz)*velx_c(k,i,j+1) - gsqrt(k,i,j-1,
i_xyz)*velx_c(k,i,j-1) ) / ( fdy(j) + fdy(j-1) ) &
748 + ( j23g(k,i,j,
i_xyw)*work_z(k,i,j) - j23g(k-1,i,j,
i_xyw)*work_z(k-1,i,j) ) * rcdz(k) &
749 ) * mapf(i,j,2,
i_xy) / gsqrt(k,i,j,
i_xyz)
754 i = iundef; j = iundef; k = iundef
759 call check( __line__, velx_c(ks,i,j+1) )
760 call check( __line__, velx_c(ks,i,j-1) )
761 call check( __line__, gsqrt(ks,i,j+1,
i_xyz) )
762 call check( __line__, gsqrt(ks,i,j-1,
i_xyz) )
763 call check( __line__, velx_c(ks+1,i,j) )
764 call check( __line__, velx_c(ks,i,j) )
765 call check( __line__, j23g(ks+1,i,j,
i_xyz) )
766 call check( __line__, j23g(ks,i,j,
i_xyz) )
767 call check( __line__, gsqrt(ks,i,j,
i_xyz) )
768 call check( __line__, velx_c(ke,i,j+1) )
769 call check( __line__, velx_c(ke,i,j-1) )
770 call check( __line__, gsqrt(ke,i,j+1,
i_xyz) )
771 call check( __line__, gsqrt(ke,i,j-1,
i_xyz) )
772 call check( __line__, velx_c(ke,i,j) )
773 call check( __line__, velx_c(ke-1,i,j) )
774 call check( __line__, j23g(ke,i,j,
i_xyz) )
775 call check( __line__, j23g(ke-1,i,j,
i_xyz) )
776 call check( __line__, gsqrt(ke,i,j,
i_xyz) )
777 call check( __line__, fdy(j) )
778 call check( __line__, fdy(j-1) )
780 s12_c(ks,i,j) = 0.5_rp * ( &
781 ( gsqrt(ks,i,j+1,
i_xyz)*velx_c(ks,i,j+1) - gsqrt(ks,i,j-1,
i_xyz)*velx_c(ks,i,j-1) ) / ( fdy(j) + fdy(j-1) ) &
782 + ( j23g(ks+1,i,j,
i_xyz)*velx_c(ks+1,i,j) - j23g(ks,i,j,
i_xyz)*velx_c(ks,i,j) ) * rfdz(ks) &
783 ) * mapf(i,j,2,
i_xy) / gsqrt(ks,i,j,
i_xyz)
784 s12_c(ke,i,j) = 0.5_rp * ( &
785 ( gsqrt(ke,i,j+1,
i_xyz)*velx_c(ke,i,j+1) - gsqrt(ke,i,j-1,
i_xyz)*velx_c(ke,i,j-1) ) / ( fdy(j) + fdy(j-1) ) &
786 + ( j23g(ke,i,j,
i_xyz)*velx_c(ke,i,j) - j23g(ke-1,i,j,
i_xyz)*velx_c(ke-1,i,j) ) * rfdz(ke-1) &
787 ) * mapf(i,j,2,
i_xy) / gsqrt(ke,i,j,
i_xyz)
791 i = iundef; j = iundef; k = iundef
799 call check( __line__, velx_yz(k,i,j+1) )
800 call check( __line__, velx_yz(k,i,j) )
801 call check( __line__, work_v(k,i,j) )
802 call check( __line__, work_v(k-1,i,j) )
803 call check( __line__, rfdy(j) )
805 s12_z(k,i,j) = 0.5_rp * ( &
806 ( gsqrt(k,i,j+1,
i_uyz)*velx_yz(k,i,j+1) - gsqrt(k,i,j,
i_uyz)*velx_yz(k,i,j) ) * rfdy(j) &
807 + ( work_v(k,i,j) - work_v(k-1,i,j) ) * rcdz(k) &
813 i = iundef; j = iundef; k = iundef
818 call check( __line__, velx_yz(ks,i,j+1) )
819 call check( __line__, velx_yz(ks,i,j) )
820 call check( __line__, velx_yz(ks+1,i,j) )
821 call check( __line__, velx_yz(ks+1,i,j+1) )
822 call check( __line__, j23g(ks+1,i,j,
i_uvz) )
823 call check( __line__, j23g(ks ,i,j,
i_uvz) )
824 call check( __line__, velx_yz(ke,i,j+1) )
825 call check( __line__, velx_yz(ke,i,j) )
826 call check( __line__, velx_yz(ke-1,i,j) )
827 call check( __line__, velx_yz(ke-1,i,j+1) )
828 call check( __line__, j23g(ke ,i,j,
i_uvz) )
829 call check( __line__, j23g(ke-1,i,j,
i_uvz) )
831 s12_z(ks,i,j) = 0.25_rp * ( &
832 ( gsqrt(ks,i,j+1,
i_uyz)*velx_yz(ks,i,j+1) - gsqrt(ks,i,j,
i_uyz)*velx_yz(ks,i,j) ) * rfdy(j) &
833 + ( j23g(ks+1,i,j,
i_uvz) * ( velx_yz(ks+1,i,j) + velx_yz(ks+1,i,j+1) ) &
834 - j23g(ks ,i,j,
i_uvz) * ( velx_yz(ks ,i,j) + velx_yz(ks ,i,j+1) ) ) * rfdz(ks) &
836 s12_z(ke,i,j) = 0.25_rp * ( &
837 ( gsqrt(ke,i,j+1,
i_uyz)*velx_yz(ke,i,j+1) - gsqrt(ke,i,j,
i_uyz)*velx_yz(ke,i,j) ) * rfdy(j) &
838 + ( j23g(ke ,i,j,
i_uvz) * ( velx_yz(ke ,i,j) + velx_yz(ke ,i,j+1) ) &
839 - j23g(ke-1,i,j,
i_uvz) * ( velx_yz(ke-1,i,j) + velx_yz(ke-1,i,j+1) ) ) * rfdz(ke-1) &
844 i = iundef; j = iundef; k = iundef
848 work_z(:,:,:) = undef; work_x(:,:,:) = undef; work_y(:,:,:) = undef; work_v(:,:,:) = undef
856 call check( __line__, vely_c(k+1,i,j) )
857 call check( __line__, vely_c(k,i,j) )
859 work_z(k,i,j) = 0.5_rp * ( vely_c(k+1,i,j) + vely_c(k,i,j) )
864 i = iundef; j = iundef; k = iundef
871 call check( __line__, vely_c(k,i+1,j) )
872 call check( __line__, vely_c(k,i,j) )
874 work_x(k,i,j) = 0.5_rp * ( velz_c(k,i+1,j) + velz_c(k,i,j) )
879 i = iundef; j = iundef; k = iundef
888 call check( __line__, vely_zx(k,i,j) )
889 call check( __line__, vely_zx(k+1,i,j) )
890 call check( __line__, vely_zx(k,i+1,j) )
891 call check( __line__, vely_zx(k+1,i+1,j) )
893 work_v(k,i,j) = 0.25_rp &
894 * ( j13g(k ,i ,j,
i_xvz)*vely_zx(k ,i ,j) &
895 + j13g(k+1,i ,j,
i_xvz)*vely_zx(k+1,i ,j) &
896 + j13g(k ,i+1,j,
i_xvz)*vely_zx(k ,i+1,j) &
897 + j13g(k+1,i+1,j,
i_xvz)*vely_zx(k+1,i+1,j) )
902 i = iundef; j = iundef; k = iundef
911 call check( __line__, vely_zx(k,i,j) )
912 call check( __line__, vely_zx(k,i,j-1) )
913 call check( __line__, gsqrt(k,i,j,
i_xvz) )
914 call check( __line__, gsqrt(k,i,j-1,
i_xvz) )
915 call check( __line__, work_z(k,i,j) )
916 call check( __line__, work_z(k-1,i,j) )
917 call check( __line__, j23g(k,i,j,
i_xyw) )
918 call check( __line__, j23g(k-1,i,j,
i_xyw) )
919 call check( __line__, rcdy(j) )
922 ( gsqrt(k,i,j,
i_xvz)*vely_zx(k,i,j) - gsqrt(k,i,j-1,
i_xvz)*vely_zx(k,i,j-1) ) * rcdy(j) &
923 + ( j23g(k,i,j,
i_xyw)*work_z(k,i,j) - j23g(k-1,i,j,
i_xyw)*work_z(k-1,i,j) ) * rcdz(k) &
924 ) * mapf(i,j,2,
i_xy) / gsqrt(k,i,j,
i_xyz)
929 i = iundef; j = iundef; k = iundef
934 call check( __line__, vely_zx(ks,i,j) )
935 call check( __line__, vely_zx(ks,i,j-1) )
936 call check( __line__, gsqrt(ks,i,j,
i_xvz) )
937 call check( __line__, gsqrt(ks,i,j-1,
i_xvz) )
938 call check( __line__, vely_c(ks+1,i,j) )
939 call check( __line__, vely_c(ks,i,j) )
940 call check( __line__, j23g(ks+1,i,j,
i_xyz) )
941 call check( __line__, j23g(ks,i,j,
i_xyz) )
942 call check( __line__, rcdy(j) )
943 call check( __line__, vely_zx(ke,i,j) )
944 call check( __line__, vely_zx(ke,i,j-1) )
945 call check( __line__, gsqrt(ke,i,j,
i_xvz) )
946 call check( __line__, gsqrt(ke,i,j-1,
i_xvz) )
947 call check( __line__, vely_c(ke,i,j) )
948 call check( __line__, vely_c(ke-1,i,j) )
949 call check( __line__, j23g(ke,i,j,
i_xyz) )
950 call check( __line__, j23g(ke-1,i,j,
i_xyz) )
953 ( gsqrt(ks,i,j,
i_xvz)*vely_zx(ks,i,j) - gsqrt(ks,i,j-1,
i_xvz)*vely_zx(ks,i,j-1) ) * rcdy(j) &
954 + ( j23g(ks+1,i,j,
i_xyz)*vely_c(ks+1,i,j) - j23g(ks,i,j,
i_xyz)*vely_c(ks,i,j) ) * rfdz(ks) &
955 ) * mapf(i,j,2,
i_xy) / gsqrt(ks,i,j,
i_xyz)
957 ( gsqrt(ke,i,j,
i_xvz)*vely_zx(ke,i,j) - gsqrt(ke,i,j-1,
i_xvz)*vely_zx(ke,i,j-1) ) * rcdy(j) &
958 + ( j23g(ke,i,j,
i_xyz)*vely_c(ke,i,j) - j23g(ke-1,i,j,
i_xyz)*vely_c(ke-1,i,j) ) * rfdz(ke-1) &
959 ) * mapf(i,j,2,
i_xy) / gsqrt(ke,i,j,
i_xyz)
963 i = iundef; j = iundef; k = iundef
972 call check( __line__, s12_c(k,i,j) )
973 call check( __line__, vely_c(k,i+1,j) )
974 call check( __line__, vely_c(k,i-1,j) )
975 call check( __line__, gsqrt(k,i+1,j,
i_xyz) )
976 call check( __line__, gsqrt(k,i-1,j,
i_xyz) )
977 call check( __line__, work_z(k,i,j) )
978 call check( __line__, work_z(k-1,i,j) )
979 call check( __line__, j13g(k,i,j,
i_xyw) )
980 call check( __line__, j13g(k-1,i,j,
i_xyw) )
981 call check( __line__, gsqrt(k,i,j,
i_xyz) )
982 call check( __line__, fdx(i) )
983 call check( __line__, fdx(i-1) )
985 s12_c(k,i,j) = ( s12_c(k,i,j) &
987 ( gsqrt(k,i+1,j,
i_xyz)*vely_c(k,i+1,j) - gsqrt(k,i-1,j,
i_xyz)*vely_c(k,i-1,j) ) / ( fdx(i) + fdx(i-1) ) &
988 + ( j13g(k,i,j,
i_xyw)*work_z(k,i,j) - j13g(k-1,i,j,
i_xyw)*work_z(k-1,i,j) ) * rcdz(k) ) * mapf(i,j,1,
i_xy) &
989 ) / gsqrt(k,i,j,
i_xyz)
994 i = iundef; j = iundef; k = iundef
999 call check( __line__, s12_c(ks,i,j) )
1000 call check( __line__, vely_c(ks,i+1,j) )
1001 call check( __line__, vely_c(ks,i-1,j) )
1002 call check( __line__, gsqrt(ks,i+1,j,
i_xyz) )
1003 call check( __line__, gsqrt(ks,i-1,j,
i_xyz) )
1004 call check( __line__, vely_c(ks+1,i,j) )
1005 call check( __line__, vely_c(ks,i,j) )
1006 call check( __line__, j13g(ks+1,i,j,
i_xyz) )
1007 call check( __line__, j13g(ks,i,j,
i_xyz) )
1008 call check( __line__, gsqrt(ks,i,j,
i_xyz) )
1009 call check( __line__, s12_c(ke,i,j) )
1010 call check( __line__, vely_c(ke,i+1,j) )
1011 call check( __line__, vely_c(ke,i-1,j) )
1012 call check( __line__, gsqrt(ke,i+1,j,
i_xyz) )
1013 call check( __line__, gsqrt(ke,i-1,j,
i_xyz) )
1014 call check( __line__, vely_c(ke,i,j) )
1015 call check( __line__, vely_c(ke-1,i,j) )
1016 call check( __line__, j13g(ke,i,j,
i_xyz) )
1017 call check( __line__, j13g(ke-1,i,j,
i_xyz) )
1018 call check( __line__, gsqrt(ke,i,j,
i_xyz) )
1019 call check( __line__, fdx(i) )
1020 call check( __line__, fdx(i-1) )
1022 s12_c(ks,i,j) = ( s12_c(ks,i,j) &
1024 ( gsqrt(ks,i+1,j,
i_xyz)*vely_c(ks,i+1,j) - gsqrt(ks,i-1,j,
i_xyz)*vely_c(ks,i-1,j) ) / ( fdx(i) + fdx(i-1) ) &
1025 + ( j13g(ks+1,i,j,
i_xyz)*vely_c(ks+1,i,j) - j13g(ks,i,j,
i_xyz)*vely_c(ks,i,j) ) * rfdz(ks) ) &
1026 * mapf(i,j,1,
i_xy) &
1027 ) / gsqrt(ks,i,j,
i_xyz)
1028 s12_c(ke,i,j) = ( s12_c(ke,i,j) &
1030 ( gsqrt(ke,i+1,j,
i_xyz)*vely_c(ke,i+1,j) - gsqrt(ke,i-1,j,
i_xyz)*vely_c(ke,i-1,j) ) / ( fdx(i) + fdx(i-1) ) &
1031 + ( j13g(ke,i,j,
i_xyz)*vely_c(ke,i,j) - j13g(ke-1,i,j,
i_xyz)*vely_c(ke-1,i,j) ) * rfdz(ke-1) ) &
1032 * mapf(i,j,1,
i_xy) &
1033 ) / gsqrt(ke,i,j,
i_xyz)
1037 i = iundef; j = iundef; k = iundef
1044 call check( __line__, s12_z(k,i,j) )
1045 call check( __line__, vely_zx(k,i+1,j) )
1046 call check( __line__, vely_zx(k,i,j) )
1047 call check( __line__, work_v(k,i,j) )
1048 call check( __line__, work_v(k-1,i,j) )
1049 call check( __line__, rfdx(i) )
1051 s12_z(k,i,j) = ( s12_z(k,i,j) &
1053 ( gsqrt(k,i+1,j,
i_xvz)*vely_zx(k,i+1,j) - gsqrt(k,i,j,
i_xvz)*vely_zx(k,i,j) ) * rfdx(i) &
1054 + ( work_v(k,i,j) - work_v(k-1,i,j) ) * rcdz(k) ) * mapf(i,j,1,
i_uv) &
1055 ) / gsqrt(k,i,j,
i_uvz)
1060 i = iundef; j = iundef; k = iundef
1065 call check( __line__, s12_z(ks,i,j) )
1066 call check( __line__, vely_zx(ks,i+1,j) )
1067 call check( __line__, vely_zx(ks,i,j) )
1068 call check( __line__, vely_zx(ks+1,i,j) )
1069 call check( __line__, vely_zx(ks+1,i+1,j) )
1070 call check( __line__, s12_z(ke,i,j) )
1071 call check( __line__, vely_zx(ke,i+1,j) )
1072 call check( __line__, vely_zx(ke,i,j) )
1073 call check( __line__, vely_zx(ke-1,i,j) )
1074 call check( __line__, vely_zx(ke-1,i+1,j) )
1075 call check( __line__, rfdx(i) )
1077 s12_z(ks,i,j) = ( s12_z(ks,i,j) &
1079 ( gsqrt(ks,i+1,j,
i_xvz)*vely_zx(ks,i+1,j) - gsqrt(ks,i,j,
i_xvz)*vely_zx(ks,i,j) ) * rfdx(i) &
1080 + ( j13g(ks+1,i,j,
i_uvz) * ( vely_zx(ks+1,i,j) + vely_zx(ks+1,i+1,j) ) &
1081 - j13g(ks ,i,j,
i_uvz) * ( vely_zx(ks ,i,j) + vely_zx(ks ,i+1,j) ) ) * rfdz(ks) ) * mapf(i,j,1,
i_uv) &
1082 ) / gsqrt(ks,i,j,
i_uvz)
1083 s12_z(ke,i,j) = ( s12_z(ke,i,j) &
1085 ( gsqrt(ke,i+1,j,
i_xvz)*vely_zx(ke,i+1,j) - gsqrt(ke,i,j,
i_xvz)*vely_zx(ke,i,j) ) * rfdx(i) &
1086 + ( j13g(ke ,i,j,
i_uvz) * ( vely_zx(ke ,i,j) + vely_zx(ke ,i+1,j) ) &
1087 - j13g(ke-1,i,j,
i_uvz) * ( vely_zx(ke-1,i,j) + vely_zx(ke-1,i+1,j) ) ) * rfdz(ke-1) ) * mapf(i,j,1,
i_uv) &
1088 ) / gsqrt(ke,i,j,
i_uvz)
1092 i = iundef; j = iundef; k = iundef
1101 call check( __line__, s23_c(k,i,j) )
1102 call check( __line__, vely_c(k+1,i,j) )
1103 call check( __line__, vely_c(k-1,i,j) )
1104 call check( __line__, fdz(k) )
1105 call check( __line__, fdz(k-1) )
1107 s23_c(k,i,j) = ( s23_c(k,i,j) &
1108 + 0.5_rp * ( vely_c(k+1,i,j) - vely_c(k-1,i,j) ) * j33g / ( fdz(k) + fdz(k-1) ) &
1109 ) / gsqrt(k,i,j,
i_xyz)
1114 i = iundef; j = iundef; k = iundef
1119 call check( __line__, s23_c(ks,i,j) )
1120 call check( __line__, vely_c(ks+1,i,j) )
1121 call check( __line__, vely_c(ks,i,j) )
1122 call check( __line__, rfdz(ks) )
1123 call check( __line__, s23_c(ke,i,j) )
1124 call check( __line__, vely_c(ke,i,j) )
1125 call check( __line__, vely_c(ke-1,i,j) )
1126 call check( __line__, rfdz(ke-1) )
1128 s23_c(ks,i,j) = ( s23_c(ks,i,j) &
1129 + 0.5_rp * ( vely_c(ks+1,i,j) - vely_c(ks,i,j) ) * j33g * rfdz(ks) &
1130 ) / gsqrt(ks,i,j,
i_xyz)
1131 s23_c(ke,i,j) = ( s23_c(ke,i,j) &
1132 + 0.5_rp * ( vely_c(ke,i,j) - vely_c(ke-1,i,j) ) * j33g * rfdz(ke-1) &
1133 ) / gsqrt(ke,i,j,
i_xyz)
1137 i = iundef; j = iundef; k = iundef
1145 call check( __line__, s23_x(k,i,j) )
1146 call check( __line__, vely_zx(k+1,i,j) )
1147 call check( __line__, vely_zx(k,i,j) )
1148 call check( __line__, rfdz(k) )
1150 s23_x(k,i,j) = ( s23_x(k,i,j) &
1151 + 0.5_rp * ( vely_zx(k+1,i,j) - vely_zx(k,i,j) ) * j33g * rfdz(k) &
1152 ) / gsqrt(k,i,j,
i_xvw)
1157 i = iundef; j = iundef; k = iundef
1163 work_z(:,:,:) = undef; work_x(:,:,:) = undef; work_y(:,:,:) = undef
1173 call check( __line__, s11_c(k,i,j) )
1174 call check( __line__, s22_c(k,i,j) )
1175 call check( __line__, s33_c(k,i,j) )
1176 call check( __line__, s31_c(k,i,j) )
1177 call check( __line__, s12_c(k,i,j) )
1178 call check( __line__, s23_c(k,i,j) )
1180 s2(k,i,j) = max( 1e-10_rp, &
1181 2.0_rp * ( s11_c(k,i,j)**2 + s22_c(k,i,j)**2 + s33_c(k,i,j)**2 ) &
1182 + 4.0_rp * ( s31_c(k,i,j)**2 + s12_c(k,i,j)**2 + s23_c(k,i,j)**2 ) )
1187 i = iundef; j = iundef; k = iundef
integer, public is
start point of inner domain: x, local
integer, public je
end point of inner domain: y, local
real(rp), dimension(:), allocatable, public grid_rcdy
reciprocal of center-dy
real(rp), dimension(:), allocatable, public grid_fdy
y-length of grid(j+1) to grid(j) [m]
integer, public iblock
block size for cache blocking: x
real(rp), dimension(:), allocatable, public grid_rcdx
reciprocal of center-dx
real(rp), dimension(:), allocatable, public grid_rfdy
reciprocal of face-dy
real(rp), dimension(:), allocatable, public grid_rcdz
reciprocal of center-dz
real(rp), dimension(:), allocatable, public grid_fdz
z-length of grid(k+1) to grid(k) [m]
integer, public jblock
block size for cache blocking: y
integer, public js
start point of inner domain: y, local
integer, public ie
end point of inner domain: x, local
real(rp), dimension(:), allocatable, public grid_fdx
x-length of grid(i+1) to grid(i) [m]
real(rp), dimension(:), allocatable, public grid_rfdx
reciprocal of face-dx
real(rp), dimension(:), allocatable, public grid_rfdz
reciprocal of face-dz