60 S33_C, S11_C, S22_C, &
61 S31_C, S12_C, S23_C, &
62 S12_Z, S23_X, S31_Y, &
64 DENS, MOMZ, MOMX, MOMY, &
65 GSQRT, J13G, J23G, J33G, MAPF )
78 real(
rp),
intent(out) :: s33_c (
ka,
ia,
ja)
79 real(
rp),
intent(out) :: s11_c (
ka,
ia,
ja)
80 real(
rp),
intent(out) :: s22_c (
ka,
ia,
ja)
81 real(
rp),
intent(out) :: s31_c (
ka,
ia,
ja)
82 real(
rp),
intent(out) :: s12_c (
ka,
ia,
ja)
83 real(
rp),
intent(out) :: s23_c (
ka,
ia,
ja)
84 real(
rp),
intent(out) :: s12_z (
ka,
ia,
ja)
85 real(
rp),
intent(out) :: s23_x (
ka,
ia,
ja)
86 real(
rp),
intent(out) :: s31_y (
ka,
ia,
ja)
87 real(
rp),
intent(out) :: s2 (
ka,
ia,
ja)
89 real(
rp),
intent(in) :: dens (
ka,
ia,
ja)
90 real(
rp),
intent(in) :: momz (
ka,
ia,
ja)
91 real(
rp),
intent(in) :: momx (
ka,
ia,
ja)
92 real(
rp),
intent(in) :: momy (
ka,
ia,
ja)
94 real(
rp),
intent(in) :: gsqrt (
ka,
ia,
ja,7)
95 real(
rp),
intent(in) :: j13g (
ka,
ia,
ja,7)
96 real(
rp),
intent(in) :: j23g (
ka,
ia,
ja,7)
97 real(
rp),
intent(in) :: j33g
98 real(
rp),
intent(in) :: mapf (
ia,
ja,2,4)
114 integer :: iis, iie, jjs, jje
136 velz_c(:,:,:) = undef
137 velz_xy(:,:,:) = undef
138 velx_c(:,:,:) = undef
139 velx_yz(:,:,:) = undef
140 vely_c(:,:,:) = undef
141 vely_zx(:,:,:) = undef
143 work_v(:,:,:) = undef
144 work_z(:,:,:) = undef
145 work_x(:,:,:) = undef
146 work_y(:,:,:) = undef
157 call check( __line__, momz(
k,i,j) )
158 call check( __line__, dens(
k+1,i,j) )
159 call check( __line__, dens(
k,i,j) )
161 velz_xy(
k,i,j) = 2.0_rp * momz(
k,i,j) / ( dens(
k+1,i,j)+dens(
k,i,j) )
167 i = iundef; j = iundef;
k = iundef
173 velz_xy(
ke,i,j) = 0.0_rp
178 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)
196 i = iundef; j = iundef;
k = iundef
203 call check( __line__, momz(
ks,i,j) )
204 call check( __line__, dens(
ks,i,j) )
206 velz_c(
ks,i,j) = 0.5_rp * momz(
ks,i,j) / dens(
ks,i,j)
211 i = iundef; j = iundef;
k = iundef
220 call check( __line__, momx(
k,i,j) )
221 call check( __line__, dens(
k,i+1,j) )
222 call check( __line__, dens(
k,i,j) )
224 velx_yz(
k,i,j) = 2.0_rp * momx(
k,i,j) / ( dens(
k,i+1,j)+dens(
k,i,j) )
230 i = iundef; j = iundef;
k = iundef
236 velx_yz(
ke+1,i,j) = 0.0_rp
241 i = iundef; j = iundef;
k = iundef
249 call check( __line__, momx(
k,i,j) )
250 call check( __line__, momx(
k,i-1,j) )
251 call check( __line__, dens(
k,i,j) )
253 velx_c(
k,i,j) = 0.5_rp * ( momx(
k,i,j) + momx(
k,i-1,j) ) / dens(
k,i,j)
259 i = iundef; j = iundef;
k = iundef
269 call check( __line__, momy(
k,i,j) )
270 call check( __line__, dens(
k,i,j+1) )
271 call check( __line__, dens(
k,i,j) )
273 vely_zx(
k,i,j) = 2.0_rp * momy(
k,i,j) / ( dens(
k,i,j+1)+dens(
k,i,j) )
279 i = iundef; j = iundef;
k = iundef
285 vely_zx(
ke+1,i,j) = 0.0_rp
290 i = iundef; j = iundef;
k = iundef
298 call check( __line__, momy(
k,i,j) )
299 call check( __line__, momy(
k,i,j-1) )
300 call check( __line__, dens(
k,i,j) )
302 vely_c(
k,i,j) = 0.5_rp * ( momy(
k,i,j) + momy(
k,i,j-1) ) / dens(
k,i,j)
308 i = iundef; j = iundef;
k = iundef
317 work_z(:,:,:) = undef; work_x(:,:,:) = undef; work_y(:,:,:) = undef; work_v(:,:,:) = undef
329 call check( __line__, velz_c(
k,i+1,j) )
330 call check( __line__, velz_c(
k,i,j) )
332 work_x(
k,i,j) = 0.5_rp * ( velz_c(
k,i+1,j) + velz_c(
k,i,j) )
338 i = iundef; j = iundef;
k = iundef
344 work_x(
ke+1,i,j) = 0.0_rp
349 i = iundef; j = iundef;
k = iundef
358 call check( __line__, velz_c(
k,i,j+1) )
359 call check( __line__, velz_c(
k,i,j) )
361 work_y(
k,i,j) = 0.5_rp * ( velz_c(
k,i,j+1) + velz_c(
k,i,j) )
367 i = iundef; j = iundef;
k = iundef
373 work_y(
ke+1,i,j) = 0.0_rp
378 i = iundef; j = iundef;
k = iundef
389 call check( __line__, velz_xy(
k,i,j) )
390 call check( __line__, velz_xy(
k-1,i,j) )
391 call check( __line__, rcdz(
k) )
393 s33_c(
k,i,j) = ( velz_xy(
k,i,j) - velz_xy(
k-1,i,j) ) * rcdz(
k) &
394 * j33g / gsqrt(
k,i,j,
i_xyz)
400 i = iundef; j = iundef;
k = iundef
407 call check( __line__, velz_xy(
ks,i,j) )
409 call check( __line__, rcdz(
ks) )
411 s33_c(
ks,i,j) = velz_xy(
ks,i,j) * rcdz(
ks) &
417 i = iundef; j = iundef;
k = iundef
429 call check( __line__, velz_c(
k,i+1,j) )
430 call check( __line__, velz_c(
k,i-1,j) )
433 call check( __line__, velz_xy(
k,i,j) )
434 call check( __line__, velz_xy(
k-1,i,j) )
437 call check( __line__, fdx(i) )
438 call check( __line__, fdx(i-1) )
440 s31_c(
k,i,j) = 0.5_rp * ( &
441 ( 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) ) &
442 + ( 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) &
450 i = iundef; j = iundef;
k = iundef
457 call check( __line__, velz_c(
ks,i+1,j) )
458 call check( __line__, velz_c(
ks,i-1,j) )
461 call check( __line__, velz_xy(
ks,i,j) )
463 call check( __line__, velz_c(
ke,i+1,j) )
464 call check( __line__, velz_c(
ke,i-1,j) )
467 call check( __line__, velz_xy(
ke,i,j) )
469 call check( __line__, fdx(i) )
470 call check( __line__, fdx(i-1) )
472 s31_c(
ks,i,j) = 0.5_rp * ( &
473 ( 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) ) &
474 + ( j13g(
ks,i,j,
i_xyw)*velz_xy(
ks,i,j) ) * rcdz(
ks) &
476 s31_c(
ke,i,j) = 0.5_rp * ( &
477 ( 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) ) &
478 - ( j13g(
ke-1,i,j,
i_xyw)*velz_xy(
ke-1,i,j) ) * rcdz(
ke) &
484 i = iundef; j = iundef;
k = iundef
494 call check( __line__, velz_xy(
k,i+1,j) )
495 call check( __line__, velz_xy(
k,i,j) )
496 call check( __line__, rfdx(i) )
498 s31_y(
k,i,j) = 0.5_rp * ( &
499 ( 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) &
500 + ( 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) &
507 i = iundef; j = iundef;
k = iundef
518 call check( __line__, velz_c(
k,i,j+1) )
519 call check( __line__, velz_c(
k,i,j-1) )
522 call check( __line__, velz_xy(
k,i,j) )
523 call check( __line__, velz_xy(
k-1,i,j) )
526 call check( __line__, fdy(j) )
527 call check( __line__, fdy(j-1) )
529 s23_c(
k,i,j) = 0.5_rp * ( &
530 ( 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) ) &
531 + ( 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) &
538 i = iundef; j = iundef;
k = iundef
545 call check( __line__, velz_c(
ks,i,j+1) )
546 call check( __line__, velz_c(
ks,i,j-1) )
549 call check( __line__, velz_xy(
ks,i,j) )
551 call check( __line__, velz_c(
ke,i,j+1) )
552 call check( __line__, velz_c(
ke,i,j-1) )
555 call check( __line__, velz_xy(
ke,i,j) )
557 call check( __line__, fdy(j) )
558 call check( __line__, fdy(j-1) )
560 s23_c(
ks,i,j) = 0.5_rp * ( &
561 ( 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) ) &
562 + ( j23g(
ks,i,j,
i_xyw)*velz_xy(
ks,i,j) ) * rcdz(
ks) &
564 s23_c(
ke,i,j) = 0.5_rp * ( &
565 ( 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) ) &
566 - ( j23g(
ke-1,i,j,
i_xyw)*velz_xy(
ke-1,i,j) ) * rcdz(
ke) &
572 i = iundef; j = iundef;
k = iundef
582 call check( __line__, velz_xy(
k,i,j+1) )
583 call check( __line__, velz_xy(
k,i,j) )
584 call check( __line__, rfdy(j) )
586 s23_x(
k,i,j) = 0.5_rp * ( &
587 ( 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) &
588 + ( 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) &
595 i = iundef; j = iundef;
k = iundef
599 work_z(:,:,:) = undef; work_x(:,:,:) = undef; work_y(:,:,:) = undef; work_v(:,:,:) = undef
609 call check( __line__, velx_c(
k+1,i,j) )
610 call check( __line__, velx_c(
k,i,j) )
612 work_z(
k,i,j) = 0.5_rp * ( velx_c(
k+1,i,j) + velx_c(
k,i,j) )
618 i = iundef; j = iundef;
k = iundef
629 call check( __line__, velx_c(
k,i,j+1) )
630 call check( __line__, velx_c(
k,i,j) )
632 work_y(
k,i,j) = 0.5_rp * ( velx_c(
k,i,j+1) + velx_c(
k,i,j) )
638 i = iundef; j = iundef;
k = iundef
647 call check( __line__, velx_yz(
k,i,j) )
648 call check( __line__, velx_yz(
k,i,j+1) )
649 call check( __line__, velx_yz(
k+1,i,j) )
650 call check( __line__, velx_yz(
k+1,i,j+1) )
656 work_v(
k,i,j) = 0.25_rp &
657 * ( j23g(
k ,i,j ,
i_uyz)*velx_yz(
k ,i,j ) &
658 + j23g(
k+1,i,j ,
i_uyz)*velx_yz(
k+1,i,j ) &
659 + j23g(
k ,i,j+1,
i_uyz)*velx_yz(
k ,i,j+1) &
660 + j23g(
k+1,i,j+1,
i_uyz)*velx_yz(
k+1,i,j+1) )
666 i = iundef; j = iundef;
k = iundef
677 call check( __line__, velx_yz(
k,i,j) )
678 call check( __line__, velx_yz(
k,i-1,j) )
681 call check( __line__, work_z(
k,i,j) )
682 call check( __line__, work_z(
k-1,i,j) )
686 call check( __line__, rcdx(i) )
689 ( 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) &
690 + ( 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) &
697 i = iundef; j = iundef;
k = iundef
704 call check( __line__, velx_yz(
ks,i,j) )
705 call check( __line__, velx_yz(
ks,i-1,j) )
708 call check( __line__, velx_c(
ks+1,i,j) )
709 call check( __line__, velx_c(
ks,i,j) )
713 call check( __line__, velx_yz(
ke,i,j) )
714 call check( __line__, velx_yz(
ke,i-1,j) )
717 call check( __line__, velx_c(
ke,i,j) )
718 call check( __line__, velx_c(
ke-1,i,j) )
722 call check( __line__, rcdx(i) )
725 ( 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) &
726 + ( 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) &
729 ( 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) &
730 + ( 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) &
736 i = iundef; j = iundef;
k = iundef
747 call check( __line__, s31_c(
k,i,j) )
748 call check( __line__, velx_c(
k+1,i,j) )
749 call check( __line__, velx_c(
k-1,i,j) )
750 call check( __line__, fdz(
k) )
751 call check( __line__, fdz(
k-1) )
753 s31_c(
k,i,j) = ( s31_c(
k,i,j) &
754 + 0.5_rp * ( velx_c(
k+1,i,j) - velx_c(
k-1,i,j) ) * j33g / ( fdz(
k) + fdz(
k-1) ) &
761 i = iundef; j = iundef;
k = iundef
768 call check( __line__, s31_c(
ks,i,j) )
769 call check( __line__, velx_c(
ks+1,i,j) )
770 call check( __line__, velx_c(
ks,i,j) )
771 call check( __line__, rfdz(
ks) )
772 call check( __line__, s31_c(
ke,i,j) )
773 call check( __line__, velx_c(
ke,i,j) )
774 call check( __line__, velx_c(
ke-1,i,j) )
775 call check( __line__, rfdz(
ke-1) )
777 s31_c(
ks,i,j) = ( s31_c(
ks,i,j) &
778 + 0.5_rp * ( velx_c(
ks+1,i,j) - velx_c(
ks,i,j) ) * j33g * rfdz(
ks) &
780 s31_c(
ke,i,j) = ( s31_c(
ke,i,j) &
781 + 0.5_rp * ( velx_c(
ke,i,j) - velx_c(
ke-1,i,j) ) * j33g * rfdz(
ke-1) &
787 i = iundef; j = iundef;
k = iundef
796 call check( __line__, s31_y(
k,i,j) )
797 call check( __line__, velx_yz(
k+1,i,j) )
798 call check( __line__, velx_yz(
k,i,j) )
799 call check( __line__, rfdz(
k) )
801 s31_y(
k,i,j) = ( s31_y(
k,i,j) &
802 + 0.5_rp * ( velx_yz(
k+1,i,j) - velx_yz(
k,i,j) ) * j33g * rfdz(
k) &
809 i = iundef; j = iundef;
k = iundef
820 call check( __line__, velx_c(
k,i,j+1) )
821 call check( __line__, velx_c(
k,i,j-1) )
824 call check( __line__, work_z(
k,i,j) )
825 call check( __line__, work_z(
k-1,i,j) )
829 s12_c(
k,i,j) = 0.5_rp * ( &
830 ( 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) ) &
831 + ( 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) &
838 i = iundef; j = iundef;
k = iundef
845 call check( __line__, velx_c(
ks,i,j+1) )
846 call check( __line__, velx_c(
ks,i,j-1) )
849 call check( __line__, velx_c(
ks+1,i,j) )
850 call check( __line__, velx_c(
ks,i,j) )
854 call check( __line__, velx_c(
ke,i,j+1) )
855 call check( __line__, velx_c(
ke,i,j-1) )
858 call check( __line__, velx_c(
ke,i,j) )
859 call check( __line__, velx_c(
ke-1,i,j) )
863 call check( __line__, fdy(j) )
864 call check( __line__, fdy(j-1) )
866 s12_c(
ks,i,j) = 0.5_rp * ( &
867 ( 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) ) &
868 + ( 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) &
870 s12_c(
ke,i,j) = 0.5_rp * ( &
871 ( 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) ) &
872 + ( 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) &
878 i = iundef; j = iundef;
k = iundef
888 call check( __line__, velx_yz(
k,i,j+1) )
889 call check( __line__, velx_yz(
k,i,j) )
890 call check( __line__, work_v(
k,i,j) )
891 call check( __line__, work_v(
k-1,i,j) )
892 call check( __line__, rfdy(j) )
894 s12_z(
k,i,j) = 0.5_rp * ( &
895 ( 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) &
896 + ( work_v(
k,i,j) - work_v(
k-1,i,j) ) * rcdz(
k) &
903 i = iundef; j = iundef;
k = iundef
910 call check( __line__, velx_yz(
ks,i,j+1) )
911 call check( __line__, velx_yz(
ks,i,j) )
912 call check( __line__, velx_yz(
ks+1,i,j) )
913 call check( __line__, velx_yz(
ks+1,i,j+1) )
916 call check( __line__, velx_yz(
ke,i,j+1) )
917 call check( __line__, velx_yz(
ke,i,j) )
918 call check( __line__, velx_yz(
ke-1,i,j) )
919 call check( __line__, velx_yz(
ke-1,i,j+1) )
923 s12_z(
ks,i,j) = 0.25_rp * ( &
924 ( 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) &
925 + ( j23g(
ks+1,i,j,
i_uvz) * ( velx_yz(
ks+1,i,j) + velx_yz(
ks+1,i,j+1) ) &
926 - j23g(
ks ,i,j,
i_uvz) * ( velx_yz(
ks ,i,j) + velx_yz(
ks ,i,j+1) ) ) * rfdz(
ks) &
928 s12_z(
ke,i,j) = 0.25_rp * ( &
929 ( 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) &
930 + ( j23g(
ke ,i,j,
i_uvz) * ( velx_yz(
ke ,i,j) + velx_yz(
ke ,i,j+1) ) &
931 - j23g(
ke-1,i,j,
i_uvz) * ( velx_yz(
ke-1,i,j) + velx_yz(
ke-1,i,j+1) ) ) * rfdz(
ke-1) &
937 i = iundef; j = iundef;
k = iundef
941 work_z(:,:,:) = undef; work_x(:,:,:) = undef; work_y(:,:,:) = undef; work_v(:,:,:) = undef
951 call check( __line__, vely_c(
k+1,i,j) )
952 call check( __line__, vely_c(
k,i,j) )
954 work_z(
k,i,j) = 0.5_rp * ( vely_c(
k+1,i,j) + vely_c(
k,i,j) )
960 i = iundef; j = iundef;
k = iundef
969 call check( __line__, vely_c(
k,i+1,j) )
970 call check( __line__, vely_c(
k,i,j) )
972 work_x(
k,i,j) = 0.5_rp * ( velz_c(
k,i+1,j) + velz_c(
k,i,j) )
978 i = iundef; j = iundef;
k = iundef
989 call check( __line__, vely_zx(
k,i,j) )
990 call check( __line__, vely_zx(
k+1,i,j) )
991 call check( __line__, vely_zx(
k,i+1,j) )
992 call check( __line__, vely_zx(
k+1,i+1,j) )
994 work_v(
k,i,j) = 0.25_rp &
995 * ( j13g(
k ,i ,j,
i_xvz)*vely_zx(
k ,i ,j) &
996 + j13g(
k+1,i ,j,
i_xvz)*vely_zx(
k+1,i ,j) &
997 + j13g(
k ,i+1,j,
i_xvz)*vely_zx(
k ,i+1,j) &
998 + j13g(
k+1,i+1,j,
i_xvz)*vely_zx(
k+1,i+1,j) )
1004 i = iundef; j = iundef;
k = iundef
1015 call check( __line__, vely_zx(
k,i,j) )
1016 call check( __line__, vely_zx(
k,i,j-1) )
1019 call check( __line__, work_z(
k,i,j) )
1020 call check( __line__, work_z(
k-1,i,j) )
1023 call check( __line__, rcdy(j) )
1026 ( 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) &
1027 + ( 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) &
1034 i = iundef; j = iundef;
k = iundef
1041 call check( __line__, vely_zx(
ks,i,j) )
1042 call check( __line__, vely_zx(
ks,i,j-1) )
1045 call check( __line__, vely_c(
ks+1,i,j) )
1046 call check( __line__, vely_c(
ks,i,j) )
1049 call check( __line__, rcdy(j) )
1050 call check( __line__, vely_zx(
ke,i,j) )
1051 call check( __line__, vely_zx(
ke,i,j-1) )
1054 call check( __line__, vely_c(
ke,i,j) )
1055 call check( __line__, vely_c(
ke-1,i,j) )
1060 ( 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) &
1061 + ( 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) &
1064 ( 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) &
1065 + ( 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) &
1071 i = iundef; j = iundef;
k = iundef
1082 call check( __line__, s12_c(
k,i,j) )
1083 call check( __line__, vely_c(
k,i+1,j) )
1084 call check( __line__, vely_c(
k,i-1,j) )
1087 call check( __line__, work_z(
k,i,j) )
1088 call check( __line__, work_z(
k-1,i,j) )
1092 call check( __line__, fdx(i) )
1093 call check( __line__, fdx(i-1) )
1095 s12_c(
k,i,j) = ( s12_c(
k,i,j) &
1097 ( 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) ) &
1098 + ( 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) &
1105 i = iundef; j = iundef;
k = iundef
1112 call check( __line__, s12_c(
ks,i,j) )
1113 call check( __line__, vely_c(
ks,i+1,j) )
1114 call check( __line__, vely_c(
ks,i-1,j) )
1117 call check( __line__, vely_c(
ks+1,i,j) )
1118 call check( __line__, vely_c(
ks,i,j) )
1122 call check( __line__, s12_c(
ke,i,j) )
1123 call check( __line__, vely_c(
ke,i+1,j) )
1124 call check( __line__, vely_c(
ke,i-1,j) )
1127 call check( __line__, vely_c(
ke,i,j) )
1128 call check( __line__, vely_c(
ke-1,i,j) )
1132 call check( __line__, fdx(i) )
1133 call check( __line__, fdx(i-1) )
1135 s12_c(
ks,i,j) = ( s12_c(
ks,i,j) &
1137 ( 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) ) &
1138 + ( 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) ) &
1139 * mapf(i,j,1,
i_xy) &
1141 s12_c(
ke,i,j) = ( s12_c(
ke,i,j) &
1143 ( 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) ) &
1144 + ( 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) ) &
1145 * mapf(i,j,1,
i_xy) &
1151 i = iundef; j = iundef;
k = iundef
1160 call check( __line__, s12_z(
k,i,j) )
1161 call check( __line__, vely_zx(
k,i+1,j) )
1162 call check( __line__, vely_zx(
k,i,j) )
1163 call check( __line__, work_v(
k,i,j) )
1164 call check( __line__, work_v(
k-1,i,j) )
1165 call check( __line__, rfdx(i) )
1167 s12_z(
k,i,j) = ( s12_z(
k,i,j) &
1169 ( 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) &
1170 + ( work_v(
k,i,j) - work_v(
k-1,i,j) ) * rcdz(
k) ) * mapf(i,j,1,
i_uv) &
1177 i = iundef; j = iundef;
k = iundef
1184 call check( __line__, s12_z(
ks,i,j) )
1185 call check( __line__, vely_zx(
ks,i+1,j) )
1186 call check( __line__, vely_zx(
ks,i,j) )
1187 call check( __line__, vely_zx(
ks+1,i,j) )
1188 call check( __line__, vely_zx(
ks+1,i+1,j) )
1189 call check( __line__, s12_z(
ke,i,j) )
1190 call check( __line__, vely_zx(
ke,i+1,j) )
1191 call check( __line__, vely_zx(
ke,i,j) )
1192 call check( __line__, vely_zx(
ke-1,i,j) )
1193 call check( __line__, vely_zx(
ke-1,i+1,j) )
1194 call check( __line__, rfdx(i) )
1196 s12_z(
ks,i,j) = ( s12_z(
ks,i,j) &
1198 ( 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) &
1199 + ( j13g(
ks+1,i,j,
i_uvz) * ( vely_zx(
ks+1,i,j) + vely_zx(
ks+1,i+1,j) ) &
1200 - 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) &
1202 s12_z(
ke,i,j) = ( s12_z(
ke,i,j) &
1204 ( 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) &
1205 + ( j13g(
ke ,i,j,
i_uvz) * ( vely_zx(
ke ,i,j) + vely_zx(
ke ,i+1,j) ) &
1206 - 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) &
1212 i = iundef; j = iundef;
k = iundef
1223 call check( __line__, s23_c(
k,i,j) )
1224 call check( __line__, vely_c(
k+1,i,j) )
1225 call check( __line__, vely_c(
k-1,i,j) )
1226 call check( __line__, fdz(
k) )
1227 call check( __line__, fdz(
k-1) )
1229 s23_c(
k,i,j) = ( s23_c(
k,i,j) &
1230 + 0.5_rp * ( vely_c(
k+1,i,j) - vely_c(
k-1,i,j) ) * j33g / ( fdz(
k) + fdz(
k-1) ) &
1237 i = iundef; j = iundef;
k = iundef
1244 call check( __line__, s23_c(
ks,i,j) )
1245 call check( __line__, vely_c(
ks+1,i,j) )
1246 call check( __line__, vely_c(
ks,i,j) )
1247 call check( __line__, rfdz(
ks) )
1248 call check( __line__, s23_c(
ke,i,j) )
1249 call check( __line__, vely_c(
ke,i,j) )
1250 call check( __line__, vely_c(
ke-1,i,j) )
1251 call check( __line__, rfdz(
ke-1) )
1253 s23_c(
ks,i,j) = ( s23_c(
ks,i,j) &
1254 + 0.5_rp * ( vely_c(
ks+1,i,j) - vely_c(
ks,i,j) ) * j33g * rfdz(
ks) &
1256 s23_c(
ke,i,j) = ( s23_c(
ke,i,j) &
1257 + 0.5_rp * ( vely_c(
ke,i,j) - vely_c(
ke-1,i,j) ) * j33g * rfdz(
ke-1) &
1263 i = iundef; j = iundef;
k = iundef
1273 call check( __line__, s23_x(
k,i,j) )
1274 call check( __line__, vely_zx(
k+1,i,j) )
1275 call check( __line__, vely_zx(
k,i,j) )
1276 call check( __line__, rfdz(
k) )
1278 s23_x(
k,i,j) = ( s23_x(
k,i,j) &
1279 + 0.5_rp * ( vely_zx(
k+1,i,j) - vely_zx(
k,i,j) ) * j33g * rfdz(
k) &
1286 i = iundef; j = iundef;
k = iundef
1292 work_z(:,:,:) = undef; work_x(:,:,:) = undef; work_y(:,:,:) = undef
1303 call check( __line__, s11_c(
k,i,j) )
1304 call check( __line__, s22_c(
k,i,j) )
1305 call check( __line__, s33_c(
k,i,j) )
1306 call check( __line__, s31_c(
k,i,j) )
1307 call check( __line__, s12_c(
k,i,j) )
1308 call check( __line__, s23_c(
k,i,j) )
1310 s2(
k,i,j) = 2.0_rp * ( s11_c(
k,i,j)**2 + s22_c(
k,i,j)**2 + s33_c(
k,i,j)**2 ) &
1311 + 4.0_rp * ( s31_c(
k,i,j)**2 + s12_c(
k,i,j)**2 + s23_c(
k,i,j)**2 )
1317 i = iundef; j = iundef;
k = iundef
1331 DENS, PHI, Kh, FACT, &
1332 GSQRT, J13G, J23G, J33G, MAPF, &
1336 IIS, IIE, JJS, JJE )
1343 matrix_solver_tridiagonal
1346 real(
rp),
intent(inout) :: qflx_phi(
ka,
ia,
ja,3)
1347 real(
rp),
intent(in) :: dens (
ka,
ia,
ja)
1348 real(
rp),
intent(in) :: phi (
ka,
ia,
ja)
1349 real(
rp),
intent(in) :: kh (
ka,
ia,
ja)
1350 real(
rp),
intent(in) :: fact
1351 real(
rp),
intent(in) :: gsqrt (
ka,
ia,
ja,7)
1352 real(
rp),
intent(in) :: j13g (
ka,
ia,
ja,7)
1353 real(
rp),
intent(in) :: j23g (
ka,
ia,
ja,7)
1354 real(
rp),
intent(in) :: j33g
1355 real(
rp),
intent(in) :: mapf (
ia,
ja,2,4)
1356 logical,
intent(in) :: horizontal
1357 logical,
intent(in) :: implicit
1358 real(
rp),
intent(in) :: a (
ka,
ia,
ja)
1359 real(
rp),
intent(in) :: b (
ka,
ia,
ja)
1360 real(
rp),
intent(in) :: c (
ka,
ia,
ja)
1361 real(
dp),
intent(in) :: dt
1362 integer,
intent(in) :: iis
1363 integer,
intent(in) :: iie
1364 integer,
intent(in) :: jjs
1365 integer,
intent(in) :: jje
1380 if ( horizontal )
then
1384 qflx_phi(:,:,:,
zdir) = 0.0_rp
1395 call check( __line__, dens(
k,i,j) )
1396 call check( __line__, dens(
k+1,i,j) )
1397 call check( __line__, kh(
k,i,j) )
1398 call check( __line__, kh(
k+1,i,j) )
1399 call check( __line__, phi(
k+1,i,j) )
1400 call check( __line__, phi(
k,i,j) )
1401 call check( __line__, rfdz(
k) )
1403 qflx_phi(
k,i,j,
zdir) = - 0.25_rp &
1404 * ( dens(
k,i,j)+dens(
k+1,i,j) ) &
1405 * ( kh(
k,i,j) + kh(
k+1,i,j) ) * fact &
1406 * ( phi(
k+1,i,j)-phi(
k,i,j) ) * rfdz(
k) * j33g &
1413 i = iundef; j = iundef;
k = iundef
1419 qflx_phi(
ks-1,i,j,
zdir) = 0.0_rp
1420 qflx_phi(
ke ,i,j,
zdir) = 0.0_rp
1425 i = iundef; j = iundef;
k = iundef
1438 call check( __line__, dens(
k,i,j) )
1439 call check( __line__, dens(
k,i+1,j) )
1440 call check( __line__, kh(
k,i,j) )
1441 call check( __line__, kh(
k,i+1,j) )
1442 call check( __line__, phi(
k,i+1,j) )
1443 call check( __line__, phi(
k,i,j) )
1444 call check( __line__, rfdx(i) )
1446 qflx_phi(
k,i,j,
xdir) = - 0.25_rp &
1447 * ( dens(
k,i,j) + dens(
k,i+1,j) ) &
1448 * ( kh(
k,i,j) + kh(
k,i+1,j) ) * fact &
1450 ( gsqrt(
k,i+1,j,
i_xyz) * phi(
k,i+1,j) &
1451 - gsqrt(
k,i ,j,
i_xyz) * phi(
k,i ,j) ) * rfdx(i) &
1452 + ( j13g(
k ,i,j,
i_uyz) * ( phi(
k+1,i+1,j)+phi(
k+1,i,j)+phi(
k ,i+1,j)+phi(
k ,i,j) ) &
1453 - j13g(
k-1,i,j,
i_uyz) * ( phi(
k ,i+1,j)+phi(
k ,i,j)+phi(
k-1,i+1,j)+phi(
k-1,i,j) ) &
1454 ) * 0.25_rp * rcdz(
k) &
1461 i = iundef; j = iundef;
k = iundef
1468 call check( __line__, dens(
ks,i,j) )
1469 call check( __line__, dens(
ks,i+1,j) )
1470 call check( __line__, kh(
ks,i,j) )
1471 call check( __line__, kh(
ks,i+1,j) )
1472 call check( __line__, phi(
ks,i+1,j) )
1473 call check( __line__, phi(
ks,i,j) )
1474 call check( __line__, rfdx(i) )
1476 qflx_phi(
ks,i,j,
xdir) = - 0.25_rp &
1477 * ( dens(
ks,i,j) + dens(
ks,i+1,j) ) &
1478 * ( kh(
ks,i,j) + kh(
ks,i+1,j) ) * fact &
1480 ( gsqrt(
ks,i+1,j,
i_xyz) * phi(
ks,i+1,j) &
1481 - gsqrt(
ks,i ,j,
i_xyz) * phi(
ks,i ,j) ) * rfdx(i) &
1482 + ( j13g(
ks+1,i,j,
i_uyz) * ( phi(
ks+1,i+1,j)+phi(
ks+1,i,j) ) &
1483 - j13g(
ks ,i,j,
i_uyz) * ( phi(
ks ,i+1,j)+phi(
ks ,i,j) ) &
1484 ) * 0.5_rp * rfdz(
ks) &
1486 qflx_phi(
ke,i,j,
xdir) = - 0.25_rp &
1487 * ( dens(
ke,i,j) + dens(
ke,i+1,j) ) &
1488 * ( kh(
ke,i,j) + kh(
ke,i+1,j) ) * fact &
1490 ( gsqrt(
ke,i+1,j,
i_xyz) * phi(
ke,i+1,j) &
1491 - gsqrt(
ke,i ,j,
i_xyz) * phi(
ke,i ,j) ) * rfdx(i) &
1492 + ( j13g(
ke ,i,j,
i_uyz) * ( phi(
ke ,i+1,j)+phi(
ke ,i,j) ) &
1493 - j13g(
ke-1,i,j,
i_uyz) * ( phi(
ke-1,i+1,j)+phi(
ke-1,i,j) ) &
1494 ) * 0.5_rp * rfdz(
ke-1) &
1500 i = iundef; j = iundef;
k = iundef
1512 call check( __line__, dens(
k,i,j) )
1513 call check( __line__, dens(
k,i,j+1) )
1514 call check( __line__, kh(
k,i,j) )
1515 call check( __line__, kh(
k,i,j+1) )
1516 call check( __line__, phi(
k,i,j+1) )
1517 call check( __line__, phi(
k,i,j) )
1518 call check( __line__, rfdy(j) )
1520 qflx_phi(
k,i,j,
ydir) = - 0.25_rp &
1521 * ( dens(
k,i,j) + dens(
k,i,j+1) ) &
1522 * ( kh(
k,i,j) + kh(
k,i,j+1) ) * fact &
1524 ( gsqrt(
k,i,j+1,
i_xyz) * phi(
k,i,j+1) &
1525 - gsqrt(
k,i,j ,
i_xyz) * phi(
k,i,j ) ) * rfdy(j) &
1526 + ( j23g(
k ,i,j,
i_xvz) * ( phi(
k+1,i,j+1)+phi(
k+1,i,j)+phi(
k ,i,j+1)+phi(
k ,i,j) ) &
1527 - j23g(
k-1,i,j,
i_xvz) * ( phi(
k ,i,j+1)+phi(
k ,i,j)+phi(
k-1,i,j+1)+phi(
k-1,i,j) ) &
1528 ) * 0.25_rp * rcdz(
k) &
1535 i = iundef; j = iundef;
k = iundef
1542 call check( __line__, dens(
ks,i,j) )
1543 call check( __line__, dens(
ks,i,j+1) )
1544 call check( __line__, kh(
ks,i,j) )
1545 call check( __line__, kh(
ks,i,j+1) )
1546 call check( __line__, phi(
ks,i,j+1) )
1547 call check( __line__, phi(
ks,i,j) )
1548 call check( __line__, rfdy(j) )
1550 qflx_phi(
ks,i,j,
ydir) = - 0.25_rp &
1551 * ( dens(
ks,i,j) + dens(
ks,i,j+1) ) &
1552 * ( kh(
ks,i,j) + kh(
ks,i,j+1) ) * fact &
1554 ( gsqrt(
ks,i,j+1,
i_xyz) * phi(
ks,i,j+1) &
1555 - gsqrt(
ks,i,j ,
i_xyz) * phi(
ks,i,j ) ) * rfdy(j) &
1556 + ( j23g(
ks+1,i,j,
i_xvz) * ( phi(
ks+1,i,j+1)+phi(
ks+1,i,j) ) &
1557 - j23g(
ks ,i,j,
i_xvz) * ( phi(
ks ,i,j+1)+phi(
ks ,i,j) ) &
1558 ) * 0.5_rp * rfdz(
ks) &
1560 qflx_phi(
ke,i,j,
ydir) = - 0.25_rp &
1561 * ( dens(
ke,i,j) + dens(
ke,i,j+1) ) &
1562 * ( kh(
ke,i,j) + kh(
ke,i,j+1) ) * fact &
1564 ( gsqrt(
ke,i,j+1,
i_xyz) * phi(
ke,i,j+1) &
1565 - gsqrt(
ke,i,j ,
i_xyz) * phi(
ke,i,j ) ) * rfdy(j) &
1566 + ( j23g(
ke ,i,j,
i_xvz) * ( phi(
ke ,i,j+1)+phi(
ke ,i,j) ) &
1567 - j23g(
ke-1,i,j,
i_xvz) * ( phi(
ke-1,i,j+1)+phi(
ke-1,i,j) ) &
1568 ) * 0.5_rp * rfdz(
ke-1) &
1574 i = iundef; j = iundef;
k = iundef
1577 if ( (.not. horizontal) .and.
implicit )
then
1580 gsqrt, j13g, j23g, j33g, mapf, &
1581 iis, iie, jjs, jje )
1583 call matrix_solver_tridiagonal(
ka,
ks,
ke,
ia, iis, iie,
ja, jjs, jje, &
1584 a(:,:,:), b(:,:,:), c(:,:,:), tend(:,:,:), &
1592 qflx_phi(
k,i,j,
zdir) = qflx_phi(
k,i,j,
zdir) &
1594 * ( dens(
k,i,j)+dens(
k+1,i,j) ) &
1595 * ( kh(
k,i,j) + kh(
k+1,i,j) ) * fact &
1596 * dt * ( tend2(
k+1,i,j)-tend2(
k,i,j) ) * rfdz(
k) * j33g &
1614 GSQRT, J13G, J23G, J33G, MAPF, &
1615 IIS, IIE, JJS, JJE )
1622 real(
rp),
intent(out) :: momz_t_tb(
ka,
ia,
ja)
1624 real(
rp),
intent(in) :: qflx_momz(
ka,
ia,
ja,3)
1625 real(
rp),
intent(in) :: gsqrt(
ka,
ia,
ja,7)
1626 real(
rp),
intent(in) :: j13g(
ka,
ia,
ja,7)
1627 real(
rp),
intent(in) :: j23g(
ka,
ia,
ja,7)
1628 real(
rp),
intent(in) :: j33g
1629 real(
rp),
intent(in) :: mapf(
ia,
ja,2,4)
1630 integer ,
intent(in) :: iis
1631 integer ,
intent(in) :: iie
1632 integer ,
intent(in) :: jjs
1633 integer ,
intent(in) :: jje
1635 real(
rp) :: fluxz(
ka)
1648 fluxz(
k) = ( ( qflx_momz(
k ,i,j,
xdir) + qflx_momz(
k ,i-1,j,
xdir) &
1649 + qflx_momz(
k-1,i,j,
xdir) + qflx_momz(
k-1,i-1,j,
xdir) ) * j13g(
k,i,j,
i_xyz) * mapf(i,j,1,
i_xy) &
1650 + ( qflx_momz(
k ,i,j,
ydir) + qflx_momz(
k ,i,j-1,
ydir) &
1651 + qflx_momz(
k-1,i,j,
ydir) + qflx_momz(
k-1,i,j-1,
ydir) ) * j23g(
k,i,j,
i_xyz) * mapf(i,j,2,
i_xy) &
1653 + j33g * qflx_momz(
k,i,j,
zdir)
1658 momz_t_tb(
k,i,j) = &
1659 - ( ( ( gsqrt(
k,i ,j,
i_uyw) * qflx_momz(
k,i ,j,
xdir) / mapf(i ,j,2,
i_uy) &
1660 - gsqrt(
k,i-1,j,
i_uyw) * qflx_momz(
k,i-1,j,
xdir) / mapf(i-1,j,2,
i_uy) ) * rcdx(i) &
1661 + ( gsqrt(
k,i,j ,
i_xvw) * qflx_momz(
k,i,j ,
ydir) / mapf(i,j ,1,
i_xv) &
1662 - gsqrt(
k,i,j-1,
i_xvw) * qflx_momz(
k,i,j-1,
ydir) / mapf(i,j-1,1,
i_xv) ) * rcdy(j) &
1663 ) * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) &
1664 + ( fluxz(
k+1) - fluxz(
k) ) * rfdz(
k) &
1677 GSQRT, J13G, J23G, J33G, MAPF, &
1678 IIS, IIE, JJS, JJE )
1684 real(
rp),
intent(out) :: momx_t_tb(
ka,
ia,
ja)
1686 real(
rp),
intent(in) :: qflx_momx(
ka,
ia,
ja,3)
1687 real(
rp),
intent(in) :: gsqrt(
ka,
ia,
ja,7)
1688 real(
rp),
intent(in) :: mapf(
ia,
ja,2,4)
1689 real(
rp),
intent(in) :: j13g(
ka,
ia,
ja,7)
1690 real(
rp),
intent(in) :: j23g(
ka,
ia,
ja,7)
1691 real(
rp),
intent(in) :: j33g
1692 integer ,
intent(in) :: iis
1693 integer ,
intent(in) :: iie
1694 integer ,
intent(in) :: jjs
1695 integer ,
intent(in) :: jje
1697 real(
rp) :: fluxz(
ka)
1710 fluxz(
k) = ( ( qflx_momx(
k+1,i+1,j,
xdir) + qflx_momx(
k+1,i,j ,
xdir) &
1711 + qflx_momx(
k ,i+1,j,
xdir) + qflx_momx(
k ,i,j ,
xdir) ) * j13g(
k,i,j,
i_uyw) * mapf(i,j,1,
i_uy) &
1712 + ( qflx_momx(
k+1,i ,j,
ydir) + qflx_momx(
k+1,i,j-1,
ydir) &
1713 + qflx_momx(
k ,i ,j,
ydir) + qflx_momx(
k ,i,j-1,
ydir) ) * j23g(
k,i,j,
i_uyw) * mapf(i,j,2,
i_uy) &
1715 + j33g * qflx_momx(
k,i,j,
zdir)
1717 fluxz(
ks-1) = 0.0_rp
1720 momx_t_tb(
k,i,j) = &
1721 - ( ( ( gsqrt(
k,i+1,j,
i_xyz) * qflx_momx(
k,i+1,j,
xdir) / mapf(i+1,j ,2,
i_xy) &
1722 - gsqrt(
k,i ,j,
i_xyz) * qflx_momx(
k,i ,j,
xdir) / mapf(i ,j ,2,
i_xy) ) * rfdx(i) &
1723 + ( gsqrt(
k,i,j ,
i_uvz) * qflx_momx(
k,i,j ,
ydir) / mapf(i ,j ,1,
i_uv) &
1724 - gsqrt(
k,i,j-1,
i_uvz) * qflx_momx(
k,i,j-1,
ydir) / mapf(i ,j-1,1,
i_uv) ) * rcdy(j) &
1725 ) * mapf(i,j,1,
i_uy) * mapf(i,j,2,
i_uy) &
1726 + ( fluxz(
k) - fluxz(
k-1) ) * rcdz(
k) &
1739 GSQRT, J13G, J23G, J33G, MAPF, &
1740 IIS, IIE, JJS, JJE )
1747 real(
rp),
intent(out) :: momy_t_tb(
ka,
ia,
ja)
1749 real(
rp),
intent(in) :: qflx_momy(
ka,
ia,
ja,3)
1750 real(
rp),
intent(in) :: gsqrt(
ka,
ia,
ja,7)
1751 real(
rp),
intent(in) :: mapf(
ia,
ja,2,4)
1752 real(
rp),
intent(in) :: j13g(
ka,
ia,
ja,7)
1753 real(
rp),
intent(in) :: j23g(
ka,
ia,
ja,7)
1754 real(
rp),
intent(in) :: j33g
1755 integer ,
intent(in) :: iis
1756 integer ,
intent(in) :: iie
1757 integer ,
intent(in) :: jjs
1758 integer ,
intent(in) :: jje
1760 real(
rp) :: fluxz(
ka)
1773 fluxz(
k) = ( ( qflx_momy(
k+1,i,j ,
xdir) + qflx_momy(
k+1,i-1,j,
xdir) &
1774 + qflx_momy(
k ,i,j ,
xdir) + qflx_momy(
k ,i-1,j,
xdir) ) * j13g(
k,i,j,
i_xvw) * mapf(i,j,1,
i_xv) &
1775 + ( qflx_momy(
k+1,i,j+1,
ydir) + qflx_momy(
k+1,i ,j,
ydir) &
1776 + qflx_momy(
k ,i,j+1,
ydir) + qflx_momy(
k ,i ,j,
ydir) ) * j23g(
k,i,j,
i_xvw) * mapf(i,j,2,
i_xv) &
1778 + j33g * qflx_momy(
k,i,j,
zdir)
1780 fluxz(
ks-1) = 0.0_rp
1783 momy_t_tb(
k,i,j) = &
1784 - ( ( ( gsqrt(
k,i ,j ,
i_uvz) * qflx_momy(
k,i ,j,
xdir) / mapf(i ,j,2,
i_uv) &
1785 - gsqrt(
k,i-1,j ,
i_uvz) * qflx_momy(
k,i-1,j,
xdir) / mapf(i-1,j,2,
i_uv) ) * rcdx(i) &
1786 + ( gsqrt(
k,i ,j+1,
i_xyz) * qflx_momy(
k,i,j+1,
ydir) / mapf(i,j+1,2,
i_xy) &
1787 - gsqrt(
k,i ,j ,
i_xyz) * qflx_momy(
k,i,j ,
ydir) / mapf(i,j ,2,
i_xy) ) * rfdy(j) &
1788 ) * mapf(i,j,1,
i_xv) * mapf(i,j,2,
i_xv) &
1789 + ( fluxz(
k) - fluxz(
k-1) ) * rcdz(
k) &
1802 GSQRT, J13G, J23G, J33G, MAPF, &
1803 IIS, IIE, JJS, JJE )
1811 real(
rp),
intent(out) :: phi_t_tb(
ka,
ia,
ja)
1813 real(
rp),
intent(in) :: qflx_phi(
ka,
ia,
ja,3)
1814 real(
rp),
intent(in) :: gsqrt(
ka,
ia,
ja,7)
1815 real(
rp),
intent(in) :: j13g(
ka,
ia,
ja,7)
1816 real(
rp),
intent(in) :: j23g(
ka,
ia,
ja,7)
1817 real(
rp),
intent(in) :: j33g
1818 real(
rp),
intent(in) :: mapf(
ia,
ja,2,4)
1819 integer ,
intent(in) :: iis
1820 integer ,
intent(in) :: iie
1821 integer ,
intent(in) :: jjs
1822 integer ,
intent(in) :: jje
1824 real(
rp) :: fluxz(0:
ka)
1838 fluxz(
k) = ( ( qflx_phi(
k+1,i,j,
xdir) + qflx_phi(
k+1,i-1,j,
xdir) &
1839 + qflx_phi(
k ,i,j,
xdir) + qflx_phi(
k ,i-1,j,
xdir) ) * j13g(
k,i,j,
i_xyw) * mapf(i,j,1,
i_xy) &
1840 + ( qflx_phi(
k+1,i,j,
ydir) + qflx_phi(
k+1,i,j-1,
ydir) &
1841 + qflx_phi(
k ,i,j,
ydir) + qflx_phi(
k ,i,j-1,
ydir) ) * j23g(
k,i,j,
i_xyw) * mapf(i,j,2,
i_xy) &
1843 + j33g * qflx_phi(
k,i,j,
zdir)
1845 fluxz(
ks-1) = 0.0_rp
1849 - ( ( ( gsqrt(
k,i ,j,
i_uyz) * qflx_phi(
k,i ,j,
xdir) / mapf(i ,j,2,
i_uy) &
1850 - gsqrt(
k,i-1,j,
i_uyz) * qflx_phi(
k,i-1,j,
xdir) / mapf(i-1,j,2,
i_uy) ) * rcdx(i) &
1852 - gsqrt(
k,i,j-1,
i_xvz) * qflx_phi(
k,i,j-1,
ydir) / mapf(i,j-1,1,
i_xv) ) * rcdy(j) &
1853 ) * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) &
1854 + ( fluxz(
k) - fluxz(
k-1) ) * rcdz(
k) &