14 #include "inc_openmp.h" 64 S33_C, S11_C, S22_C, &
65 S31_C, S12_C, S23_C, &
66 S12_Z, S23_X, S31_Y, &
68 DENS, MOMZ, MOMX, MOMY, &
69 GSQRT, J13G, J23G, J33G, MAPF )
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) )
372 call check( __line__, rcdz(
ks) )
374 s33_c(
ks,i,j) = velz_xy(
ks,i,j) * rcdz(
ks) &
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) )
392 call check( __line__, velz_xy(k,i,j) )
393 call check( __line__, velz_xy(k-1,i,j) )
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) )
417 call check( __line__, velz_xy(
ks,i,j) )
419 call check( __line__, velz_c(
ke,i+1,j) )
420 call check( __line__, velz_c(
ke,i-1,j) )
423 call check( __line__, velz_xy(
ke,i,j) )
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) )
472 call check( __line__, velz_xy(k,i,j) )
473 call check( __line__, velz_xy(k-1,i,j) )
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) )
496 call check( __line__, velz_xy(
ks,i,j) )
498 call check( __line__, velz_c(
ke,i,j+1) )
499 call check( __line__, velz_c(
ke,i,j-1) )
502 call check( __line__, velz_xy(
ke,i,j) )
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) )
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) )
613 call check( __line__, work_z(k,i,j) )
614 call check( __line__, work_z(k-1,i,j) )
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) )
637 call check( __line__, velx_c(
ks+1,i,j) )
638 call check( __line__, velx_c(
ks,i,j) )
642 call check( __line__, velx_yz(
ke,i,j) )
643 call check( __line__, velx_yz(
ke,i-1,j) )
646 call check( __line__, velx_c(
ke,i,j) )
647 call check( __line__, velx_c(
ke-1,i,j) )
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) &
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) &
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) &
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) &
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) )
741 call check( __line__, work_z(k,i,j) )
742 call check( __line__, work_z(k-1,i,j) )
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) )
763 call check( __line__, velx_c(
ks+1,i,j) )
764 call check( __line__, velx_c(
ks,i,j) )
768 call check( __line__, velx_c(
ke,i,j+1) )
769 call check( __line__, velx_c(
ke,i,j-1) )
772 call check( __line__, velx_c(
ke,i,j) )
773 call check( __line__, velx_c(
ke-1,i,j) )
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) &
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) &
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) )
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) )
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) )
915 call check( __line__, work_z(k,i,j) )
916 call check( __line__, work_z(k-1,i,j) )
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) )
938 call check( __line__, vely_c(
ks+1,i,j) )
939 call check( __line__, vely_c(
ks,i,j) )
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) )
947 call check( __line__, vely_c(
ke,i,j) )
948 call check( __line__, vely_c(
ke-1,i,j) )
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) &
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) &
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) )
977 call check( __line__, work_z(k,i,j) )
978 call check( __line__, work_z(k-1,i,j) )
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) )
1004 call check( __line__, vely_c(
ks+1,i,j) )
1005 call check( __line__, vely_c(
ks,i,j) )
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) )
1014 call check( __line__, vely_c(
ke,i,j) )
1015 call check( __line__, vely_c(
ke-1,i,j) )
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) &
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) &
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) &
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) &
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) &
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) &
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
1199 DENS, PHI, Kh, FACT, &
1200 GSQRT, J13G, J23G, J33G, MAPF, &
1203 IIS, IIE, JJS, JJE )
1218 real(RP),
intent(inout) :: qflx_phi(
ka,
ia,
ja,3)
1219 real(RP),
intent(in) :: dens (
ka,
ia,
ja)
1220 real(RP),
intent(in) :: phi (
ka,
ia,
ja)
1221 real(RP),
intent(in) :: kh (
ka,
ia,
ja)
1222 real(RP),
intent(in) :: fact
1223 real(RP),
intent(in) :: gsqrt (
ka,
ia,
ja,7)
1224 real(RP),
intent(in) :: j13g (
ka,
ia,
ja,7)
1225 real(RP),
intent(in) :: j23g (
ka,
ia,
ja,7)
1226 real(RP),
intent(in) :: j33g
1227 real(RP),
intent(in) :: mapf (
ia,
ja,2,4)
1228 real(RP),
intent(in) :: a (
ka,
ia,
ja)
1229 real(RP),
intent(in) :: b (
ka,
ia,
ja)
1230 real(RP),
intent(in) :: c (
ka,
ia,
ja)
1231 real(DP),
intent(in) :: dt
1232 logical,
intent(in) :: implicit
1233 integer,
intent(in) :: iis
1234 integer,
intent(in) :: iie
1235 integer,
intent(in) :: jjs
1236 integer,
intent(in) :: jje
1238 real(RP) :: tend(
ka,
ia,
ja)
1251 call check( __line__, dens(k,i,j) )
1252 call check( __line__, dens(k+1,i,j) )
1253 call check( __line__, kh(k,i,j) )
1254 call check( __line__, kh(k+1,i,j) )
1255 call check( __line__, phi(k+1,i,j) )
1256 call check( __line__, phi(k,i,j) )
1257 call check( __line__, rfdz(k) )
1259 qflx_phi(k,i,j,
zdir) = - 0.25_rp &
1260 * ( dens(k,i,j)+dens(k+1,i,j) ) &
1261 * ( kh(k,i,j) + kh(k+1,i,j) ) &
1262 * ( phi(k+1,i,j)-phi(k,i,j) ) * rfdz(k) * j33g &
1263 / gsqrt(k,i,j,
i_xyw)
1268 i = iundef; j = iundef; k = iundef
1272 qflx_phi(
ks-1,i,j,
zdir) = 0.0_rp
1273 qflx_phi(
ke ,i,j,
zdir) = 0.0_rp
1277 i = iundef; j = iundef; k = iundef
1288 call check( __line__, dens(k,i,j) )
1289 call check( __line__, dens(k,i+1,j) )
1290 call check( __line__, kh(k,i,j) )
1291 call check( __line__, kh(k,i+1,j) )
1292 call check( __line__, phi(k,i+1,j) )
1293 call check( __line__, phi(k,i,j) )
1294 call check( __line__, rfdx(i) )
1296 qflx_phi(k,i,j,
xdir) = - 0.25_rp &
1297 * ( dens(k,i,j)+dens(k,i+1,j) ) &
1298 * ( kh(k,i,j) + kh(k,i+1,j) ) &
1300 ( gsqrt(k,i+1,j,
i_xyz) * phi(k,i+1,j) &
1301 - gsqrt(k,i ,j,
i_xyz) * phi(k,i ,j) ) * rfdx(i) &
1302 + ( j13g(k+1,i,j,
i_uyz) * ( phi(k+1,i+1,j)+phi(k+1,i,j) ) &
1303 - j13g(k-1,i,j,
i_uyz) * ( phi(k-1,i+1,j)+phi(k-1,i,j) ) &
1304 ) * 0.5_rp / ( fdz(k)+fdz(k-1) ) &
1305 ) / gsqrt(k,i,j,
i_uyz)
1310 i = iundef; j = iundef; k = iundef
1315 call check( __line__, dens(
ks,i,j) )
1316 call check( __line__, dens(
ks,i+1,j) )
1317 call check( __line__, kh(
ks,i,j) )
1318 call check( __line__, kh(
ks,i+1,j) )
1319 call check( __line__, phi(
ks,i+1,j) )
1320 call check( __line__, phi(
ks,i,j) )
1321 call check( __line__, rfdx(i) )
1323 qflx_phi(
ks,i,j,
xdir) = - 0.25_rp &
1324 * ( dens(
ks,i,j)+dens(
ks,i+1,j) ) &
1325 * ( kh(
ks,i,j) + kh(
ks,i+1,j) ) &
1327 ( gsqrt(
ks,i+1,j,
i_xyz) * phi(
ks,i+1,j) &
1328 - gsqrt(
ks,i ,j,
i_xyz) * phi(
ks,i ,j) ) * rfdx(i) &
1329 + ( j13g(
ks+1,i,j,
i_uyz) * ( phi(
ks+1,i+1,j)+phi(
ks+1,i,j) ) &
1330 - j13g(
ks ,i,j,
i_uyz) * ( phi(
ks ,i+1,j)+phi(
ks ,i,j) ) &
1331 ) * 0.5_rp * rfdz(
ks) &
1333 qflx_phi(
ke,i,j,
xdir) = - 0.25_rp &
1334 * ( dens(
ke,i,j)+dens(
ke,i+1,j) ) &
1335 * ( kh(
ke,i,j) + kh(
ke,i+1,j) ) &
1337 ( gsqrt(
ke,i+1,j,
i_xyz) * phi(
ke,i+1,j) &
1338 - gsqrt(
ke,i ,j,
i_xyz) * phi(
ke,i ,j) ) * rfdx(i) &
1339 + ( j13g(
ke ,i,j,
i_uyz) * ( phi(
ke ,i+1,j)+phi(
ke ,i,j) ) &
1340 - j13g(
ke-1,i,j,
i_uyz) * ( phi(
ke-1,i+1,j)+phi(
ke-1,i,j) ) &
1341 ) * 0.5_rp * rfdz(
ke-1) &
1346 i = iundef; j = iundef; k = iundef
1357 call check( __line__, dens(k,i,j) )
1358 call check( __line__, dens(k,i,j+1) )
1359 call check( __line__, kh(k,i,j) )
1360 call check( __line__, kh(k,i,j+1) )
1361 call check( __line__, phi(k,i,j+1) )
1362 call check( __line__, phi(k,i,j) )
1363 call check( __line__, rfdy(j) )
1365 qflx_phi(k,i,j,
ydir) = - 0.25_rp &
1366 * ( dens(k,i,j)+dens(k,i,j+1) ) &
1367 * ( kh(k,i,j) + kh(k,i,j+1) ) &
1369 ( gsqrt(k,i,j+1,
i_xyz) * phi(k,i,j+1) &
1370 - gsqrt(k,i,j ,
i_xyz) * phi(k,i,j ) ) * rfdy(j) &
1371 + ( j23g(k+1,i,j,
i_xvz) * ( phi(k+1,i,j+1)+phi(k+1,i,j) ) &
1372 - j23g(k-1,i,j,
i_xvz) * ( phi(k-1,i,j+1)+phi(k-1,i,j) ) &
1373 ) * 0.5_rp / ( fdz(k)+fdz(k-1) ) &
1374 ) * mapf(i,j,2,
i_xv) / gsqrt(k,i,j,
i_xvz)
1379 i = iundef; j = iundef; k = iundef
1384 call check( __line__, dens(
ks,i,j) )
1385 call check( __line__, dens(
ks,i,j+1) )
1386 call check( __line__, kh(
ks,i,j) )
1387 call check( __line__, kh(
ks,i,j+1) )
1388 call check( __line__, phi(
ks,i,j+1) )
1389 call check( __line__, phi(
ks,i,j) )
1390 call check( __line__, rfdy(j) )
1392 qflx_phi(
ks,i,j,
ydir) = - 0.25_rp &
1393 * ( dens(
ks,i,j)+dens(
ks,i,j+1) ) &
1394 * ( kh(
ks,i,j) + kh(
ks,i,j+1) ) &
1396 ( gsqrt(
ks,i,j+1,
i_xyz) * phi(
ks,i,j+1) &
1397 - gsqrt(
ks,i,j ,
i_xyz) * phi(
ks,i,j ) ) * rfdy(j) &
1398 + ( j23g(
ks+1,i,j,
i_xvz) * ( phi(
ks+1,i,j+1)+phi(
ks+1,i,j) ) &
1399 - j23g(
ks ,i,j,
i_xvz) * ( phi(
ks ,i,j+1)+phi(
ks ,i,j) ) &
1400 ) * 0.5_rp * rfdz(
ks) &
1402 qflx_phi(
ke,i,j,
ydir) = - 0.25_rp &
1403 * ( dens(
ke,i,j)+dens(
ke,i,j+1) ) &
1404 * ( kh(
ke,i,j) + kh(
ke,i,j+1) ) &
1406 ( gsqrt(
ke,i,j+1,
i_xyz) * phi(
ke,i,j+1) &
1407 - gsqrt(
ke,i,j ,
i_xyz) * phi(
ke,i,j ) ) * rfdy(j) &
1408 + ( j23g(
ke ,i,j,
i_xvz) * ( phi(
ke ,i,j+1)+phi(
ke ,i,j) ) &
1409 - j23g(
ke-1,i,j,
i_xvz) * ( phi(
ke-1,i,j+1)+phi(
ke-1,i,j) ) &
1410 ) * 0.5_rp * rfdz(
ke-1) &
1415 i = iundef; j = iundef; k = iundef
1418 if (
implicit )
then 1421 gsqrt, j13g, j23g, j33g, mapf, &
1422 iis, iie, jjs, jje )
1433 a(:,i,j), b(:,i,j), c(:,i,j), d, &
1437 qflx_phi(k,i,j,
zdir) = qflx_phi(k,i,j,
zdir) &
1439 * ( dens(k,i,j)+dens(k+1,i,j) ) &
1440 * ( kh(k,i,j) + kh(k+1,i,j) ) &
1441 * dt * ( tend(k+1,i,j)-tend(k,i,j) ) * rfdz(k) * j33g &
1442 / gsqrt(k,i,j,
i_xyw)
1460 real(RP),
intent(out) :: phi(
ka)
1461 real(RP),
intent(in) :: a(
ka)
1462 real(RP),
intent(in) :: b(
ka)
1463 real(RP),
intent(in) :: c(
ka)
1464 real(RP),
intent(in) :: d(
ka)
1465 integer,
intent(in) :: ke_tb
1473 do k =
ks+1, ke_tb-1
1474 denom = b(k) + c(k)*e(k-1)
1475 e(k) = - a(k) / denom
1476 f(k) = ( d(k) - c(k)*f(k-1) ) / denom
1480 phi(ke_tb) = ( d(ke_tb) - c(ke_tb)*f(ke_tb-1) ) / ( b(ke_tb) + c(ke_tb)*e(ke_tb-1) )
1482 do k = ke_tb-1,
ks, -1
1483 phi(k) = e(k) * phi(k+1) + f(k)
1499 GSQRT, J13G, J23G, J33G, MAPF, &
1500 IIS, IIE, JJS, JJE )
1514 real(RP),
intent(out) :: momz_t_tb(
ka,
ia,
ja)
1515 real(RP),
intent(in) :: qflx_momz(
ka,
ia,
ja,3)
1516 real(RP),
intent(in) :: gsqrt(
ka,
ia,
ja,7)
1517 real(RP),
intent(in) :: j13g(
ka,
ia,
ja,7)
1518 real(RP),
intent(in) :: j23g(
ka,
ia,
ja,7)
1519 real(RP),
intent(in) :: j33g
1520 real(RP),
intent(in) :: mapf(
ia,
ja,2,4)
1521 integer ,
intent(in) :: iis
1522 integer ,
intent(in) :: iie
1523 integer ,
intent(in) :: jjs
1524 integer ,
intent(in) :: jje
1535 momz_t_tb(k,i,j) = &
1536 - ( ( gsqrt(k,i ,j,
i_uyw) * qflx_momz(k,i ,j,
xdir) &
1537 - gsqrt(k,i-1,j,
i_uyw) * qflx_momz(k,i-1,j,
xdir) ) * rcdx(i) * mapf(i,j,1,
i_xy) &
1538 + ( gsqrt(k,i,j ,
i_xvw) * qflx_momz(k,i,j ,
ydir) &
1539 - gsqrt(k,i,j-1,
i_xvw) * qflx_momz(k,i,j-1,
ydir) ) * rcdy(j) &
1540 + ( ( j13g(k+1,i,j,
i_xyz) * ( qflx_momz(k+1,i,j,
xdir) + qflx_momz(k+1,i-1,j,
xdir) ) &
1541 - j13g(k-1,i,j,
i_xyz) * ( qflx_momz(k-1,i,j,
xdir) + qflx_momz(k-1,i-1,j,
xdir) ) &
1542 ) * mapf(i,j,1,
i_xy) &
1543 + ( j23g(k+1,i,j,
i_xyz) * ( qflx_momz(k+1,i,j,
ydir) + qflx_momz(k+1,i,j-1,
ydir) ) &
1544 - j23g(k-1,i,j,
i_xyz) * ( qflx_momz(k-1,i,j,
ydir) + qflx_momz(k-1,i,j-1,
ydir) ) &
1545 ) * mapf(i,j,2,
i_xy) &
1546 ) * 0.5_rp / ( cdz(k+1)+cdz(k) ) &
1547 + j33g * ( qflx_momz(k+1,i,j,
zdir) - qflx_momz(k,i,j,
zdir) ) * rfdz(k) ) &
1548 / gsqrt(k,i,j,
i_xyw)
1555 momz_t_tb(
ks,i,j) = &
1557 - gsqrt(
ks,i-1,j,
i_uyw) * qflx_momz(
ks,i-1,j,
xdir) ) * rcdx(i) * mapf(i,j,1,
i_xy) &
1559 - gsqrt(
ks,i,j-1,
i_xvw) * qflx_momz(
ks,i,j-1,
ydir) ) * rcdy(j) * mapf(i,j,2,
i_xy) &
1560 + ( ( ( qflx_momz(
ks+1,i,j,
xdir) + qflx_momz(
ks+1,i-1,j,
xdir) &
1561 + qflx_momz(
ks ,i,j,
xdir) + qflx_momz(
ks ,i-1,j,
xdir) &
1563 + ( qflx_momz(
ks+1,i,j,
ydir) + qflx_momz(
ks+1,i,j-1,
ydir) &
1564 + qflx_momz(
ks ,i,j,
ydir) + qflx_momz(
ks ,i,j-1,
ydir) &
1567 + j33g * ( qflx_momz(
ks+1,i,j,
zdir) ) ) * rfdz(
ks) &
1570 momz_t_tb(
ke-1,i,j) = &
1572 - gsqrt(
ke-1,i-1,j,
i_uyw) * qflx_momz(
ke-1,i-1,j,
xdir) ) * rcdx(i) * mapf(i,j,1,
i_xy) &
1574 - gsqrt(
ke-1,i,j-1,
i_xvw) * qflx_momz(
ke-1,i,j-1,
ydir) ) * rcdy(j) * mapf(i,j,2,
i_xy) &
1575 + ( ( - ( qflx_momz(
ke-1,i,j,
xdir) + qflx_momz(
ke-1,i-1,j,
xdir) &
1576 + qflx_momz(
ke-2,i,j,
xdir) + qflx_momz(
ke-2,i-1,j,
xdir) &
1578 - ( qflx_momz(
ke-1,i,j,
ydir) + qflx_momz(
ke-1,i,j-1,
ydir) &
1579 + qflx_momz(
ke-2,i,j,
ydir) + qflx_momz(
ke-2,i,j-1,
ydir) &
1582 - j33g * ( qflx_momz(
ke-1,i,j,
zdir) ) ) * rfdz(
ke-1) &
1593 GSQRT, J13G, J23G, J33G, MAPF, &
1594 IIS, IIE, JJS, JJE )
1608 real(RP),
intent(out) :: momx_t_tb(
ka,
ia,
ja)
1609 real(RP),
intent(in) :: qflx_momx(
ka,
ia,
ja,3)
1610 real(RP),
intent(in) :: gsqrt(
ka,
ia,
ja,7)
1611 real(RP),
intent(in) :: mapf(
ia,
ja,2,4)
1612 real(RP),
intent(in) :: j13g(
ka,
ia,
ja,7)
1613 real(RP),
intent(in) :: j23g(
ka,
ia,
ja,7)
1614 real(RP),
intent(in) :: j33g
1615 integer ,
intent(in) :: iis
1616 integer ,
intent(in) :: iie
1617 integer ,
intent(in) :: jjs
1618 integer ,
intent(in) :: jje
1629 momx_t_tb(k,i,j) = &
1630 - ( ( gsqrt(k,i+1,j,
i_xyz) * qflx_momx(k,i+1,j,
xdir) &
1631 - gsqrt(k,i ,j,
i_xyz) * qflx_momx(k,i ,j,
xdir) ) * rfdx(i) * mapf(i,j,1,
i_uy) &
1632 + ( gsqrt(k,i,j ,
i_uvz) * qflx_momx(k,i,j ,
ydir) &
1633 - gsqrt(k,i,j-1,
i_uvz) * qflx_momx(k,i,j-1,
ydir) ) * rcdy(j) * mapf(i,j,2,
i_uy) &
1634 + ( ( j13g(k+1,i,j,
i_uyw) * ( qflx_momx(k+1,i+1,j,
xdir) + qflx_momx(k+1,i,j ,
xdir) ) &
1635 - j13g(k-1,i,j,
i_uyw) * ( qflx_momx(k-1,i+1,j,
xdir) + qflx_momx(k-1,i,j ,
xdir) ) &
1636 ) * mapf(i,j,1,
i_uy) &
1637 + ( j23g(k+1,i,j,
i_uyw) * ( qflx_momx(k+1,i ,j,
ydir) + qflx_momx(k+1,i,j-1,
ydir) ) &
1638 - j23g(k-1,i,j,
i_uyw) * ( qflx_momx(k-1,i ,j,
ydir) + qflx_momx(k-1,i,j-1,
ydir) ) &
1639 ) * mapf(i,j,2,
i_uy) &
1640 ) * 0.5_rp / ( fdz(k)+fdz(k-1) ) &
1641 + j33g * ( qflx_momx(k,i,j,
zdir) - qflx_momx(k-1,i,j,
zdir) ) * rcdz(k) ) &
1642 / gsqrt(k,i,j,
i_uyz)
1648 momx_t_tb(
ks,i,j) = &
1650 - gsqrt(
ks,i ,j,
i_xyz) * qflx_momx(
ks,i ,j,
xdir) ) * rfdx(i) * mapf(i,j,1,
i_uy) &
1652 - gsqrt(
ks,i,j-1,
i_uvz) * qflx_momx(
ks,i,j-1,
ydir) ) * rcdy(j) &
1653 + ( ( ( qflx_momx(
ks+1,i+1,j,
xdir) + qflx_momx(
ks+1,i,j,
xdir) &
1654 + qflx_momx(
ks ,i+1,j,
xdir) + qflx_momx(
ks ,i,j,
xdir) &
1656 + ( qflx_momx(
ks+1,i,j,
ydir) + qflx_momx(
ks+1,i,j-1,
ydir) &
1657 + qflx_momx(
ks ,i,j,
ydir) + qflx_momx(
ks ,i,j-1,
ydir) &
1660 + j33g * ( qflx_momx(
ks,i,j,
zdir) ) ) * rfdz(
ks) &
1663 momx_t_tb(
ke,i,j) = &
1665 - gsqrt(
ke,i ,j,
i_xyz) * qflx_momx(
ke,i ,j,
xdir) ) * rfdx(i) * mapf(i,j,1,
i_uy) &
1667 - gsqrt(
ke,i,j-1,
i_uvz) * qflx_momx(
ke,i,j-1,
ydir) ) * rcdy(j) * mapf(i,j,2,
i_uy)&
1668 + ( ( - ( qflx_momx(
ke ,i+1,j,
xdir) + qflx_momx(
ke ,i,j,
xdir) &
1669 + qflx_momx(
ke-1,i+1,j,
xdir) + qflx_momx(
ke-1,i,j,
xdir) &
1671 - ( qflx_momx(
ke ,i,j,
ydir) + qflx_momx(
ke ,i,j-1,
ydir) &
1672 + qflx_momx(
ke-1,i,j,
ydir) + qflx_momx(
ke-1,i,j-1,
ydir) &
1675 - j33g * ( qflx_momx(
ke-1,i,j,
zdir) ) ) * rcdz(
ke) &
1686 GSQRT, J13G, J23G, J33G, MAPF, &
1687 IIS, IIE, JJS, JJE )
1700 real(RP),
intent(out) :: momy_t_tb(
ka,
ia,
ja)
1701 real(RP),
intent(in) :: qflx_momy(
ka,
ia,
ja,3)
1702 real(RP),
intent(in) :: gsqrt(
ka,
ia,
ja,7)
1703 real(RP),
intent(in) :: mapf(
ia,
ja,2,4)
1704 real(RP),
intent(in) :: j13g(
ka,
ia,
ja,7)
1705 real(RP),
intent(in) :: j23g(
ka,
ia,
ja,7)
1706 real(RP),
intent(in) :: j33g
1707 integer ,
intent(in) :: iis
1708 integer ,
intent(in) :: iie
1709 integer ,
intent(in) :: jjs
1710 integer ,
intent(in) :: jje
1721 momy_t_tb(k,i,j) = &
1722 - ( ( gsqrt(k,i ,j ,
i_uvz) * qflx_momy(k,i ,j,
xdir) &
1723 - gsqrt(k,i-1,j ,
i_uvz) * qflx_momy(k,i-1,j,
xdir) ) * rcdx(i) * mapf(i,j,1,
i_xv) &
1724 + ( gsqrt(k,i ,j+1,
i_xyz) * qflx_momy(k,i,j+1,
ydir) &
1725 - gsqrt(k,i ,j ,
i_xyz) * qflx_momy(k,i,j ,
ydir) ) * rfdy(j) * mapf(i,j,2,
i_xv) &
1726 + ( ( j13g(k+1,i,j,
i_xvw) * ( qflx_momy(k+1,i,j ,
xdir) + qflx_momy(k+1,i-1,j,
xdir) ) &
1727 - j13g(k-1,i,j,
i_xvw) * ( qflx_momy(k-1,i,j ,
xdir) + qflx_momy(k-1,i-1,j,
xdir) ) &
1728 ) * mapf(i,j,1,
i_xv) &
1729 + ( j23g(k+1,i,j,
i_xvw) * ( qflx_momy(k+1,i,j+1,
ydir) + qflx_momy(k+1,i ,j,
ydir) ) &
1730 - j23g(k-1,i,j,
i_xvw) * ( qflx_momy(k-1,i,j+1,
ydir) + qflx_momy(k-1,i ,j,
ydir) ) &
1731 ) * mapf(i,j,2,
i_xv) &
1732 ) * 0.5_rp / ( fdz(k)+fdz(k-1) ) &
1733 + j33g * ( qflx_momy(k,i,j,
zdir) - qflx_momy(k-1,i,j,
zdir) ) * rcdz(k) ) &
1734 / gsqrt(k,i,j,
i_xvw)
1740 momy_t_tb(
ks,i,j) = &
1742 - gsqrt(
ks,i-1,j ,
i_uvz) * qflx_momy(
ks,i-1,j,
xdir) ) * rcdx(i) * mapf(i,j,1,
i_xv) &
1744 - gsqrt(
ks,i ,j ,
i_xyz) * qflx_momy(
ks,i,j ,
ydir) ) * rfdy(j) * mapf(i,j,2,
i_xv) &
1745 + ( ( ( qflx_momy(
ks+1,i,j ,
xdir) + qflx_momy(
ks+1,i-1,j,
xdir) &
1746 + qflx_momy(
ks ,i,j ,
xdir) + qflx_momy(
ks ,i-1,j,
xdir) &
1748 + ( qflx_momy(
ks+1,i,j+1,
ydir) + qflx_momy(
ks+1,i ,j,
ydir) &
1749 + qflx_momy(
ks ,i,j+1,
ydir) + qflx_momy(
ks ,i ,j,
ydir) &
1752 + j33g * ( qflx_momy(
ks,i,j,
zdir) ) ) * rcdz(
ks) &
1755 momy_t_tb(
ke,i,j) = &
1757 - gsqrt(
ke,i-1,j ,
i_uvz) * qflx_momy(
ke,i-1,j,
xdir) ) * rcdx(i) * mapf(i,j,1,
i_xv) &
1759 - gsqrt(
ke,i ,j ,
i_xyz) * qflx_momy(
ke,i,j ,
ydir) ) * rfdy(j) * mapf(i,j,2,
i_xv) &
1760 + ( ( - ( qflx_momy(
ke ,i,j,
xdir) + qflx_momy(
ke ,i-1,j,
xdir) &
1761 + qflx_momy(
ke-1,i,j,
xdir) + qflx_momy(
ke-1,i-1,j,
xdir) &
1763 - ( qflx_momy(
ke ,i,j+1,
ydir) + qflx_momy(
ke ,i,j,
ydir) &
1764 + qflx_momy(
ke-1,i,j+1,
ydir) + qflx_momy(
ke-1,i,j,
ydir) &
1767 - j33g * ( qflx_momy(
ke-1,i,j,
zdir) ) ) * rcdz(
ke) &
1778 GSQRT, J13G, J23G, J33G, MAPF, &
1779 IIS, IIE, JJS, JJE )
1794 real(RP),
intent(out) :: phi_t_tb(
ka,
ia,
ja)
1795 real(RP),
intent(in) :: qflx_phi(
ka,
ia,
ja,3)
1796 real(RP),
intent(in) :: gsqrt(
ka,
ia,
ja,7)
1797 real(RP),
intent(in) :: mapf(
ia,
ja,2,4)
1798 real(RP),
intent(in) :: j13g(
ka,
ia,
ja,7)
1799 real(RP),
intent(in) :: j23g(
ka,
ia,
ja,7)
1800 real(RP),
intent(in) :: j33g
1801 integer ,
intent(in) :: iis
1802 integer ,
intent(in) :: iie
1803 integer ,
intent(in) :: jjs
1804 integer ,
intent(in) :: jje
1815 - ( ( gsqrt(k,i ,j,
i_uyz) * qflx_phi(k,i ,j,
xdir) &
1816 - gsqrt(k,i-1,j,
i_uvz) * qflx_phi(k,i-1,j,
xdir) ) * rcdx(i) * mapf(i,j,1,
i_xy) &
1817 + ( gsqrt(k,i,j ,
i_xvz) * qflx_phi(k,i,j ,
ydir) &
1818 - gsqrt(k,i,j-1,
i_xvz) * qflx_phi(k,i,j-1,
ydir) ) * rcdy(j) * mapf(i,j,2,
i_xy) &
1819 + ( ( j13g(k+1,i,j,
i_xyw) * ( qflx_phi(k+1,i,j,
xdir) + qflx_phi(k+1,i-1,j,
xdir) ) &
1820 - j13g(k-1,i,j,
i_xyw) * ( qflx_phi(k-1,i,j,
xdir) + qflx_phi(k-1,i-1,j,
xdir) ) &
1821 ) * mapf(i,j,1,
i_xy) &
1822 + ( j23g(k+1,i,j,
i_xyw) * ( qflx_phi(k+1,i,j,
ydir) + qflx_phi(k+1,i,j-1,
ydir) ) &
1823 - j23g(k-1,i,j,
i_xyw) * ( qflx_phi(k-1,i,j,
ydir) + qflx_phi(k-1,i,j-1,
ydir) ) &
1824 ) * mapf(i,j,2,
i_xy) &
1825 ) * 0.5_rp / ( fdz(k) + fdz(k-1) ) &
1826 + j33g * ( qflx_phi(k,i,j,
zdir) - qflx_phi(k-1,i,j,
zdir) ) * rcdz(k) ) &
1827 / gsqrt(k,i,j,
i_xyz)
1833 phi_t_tb(
ks,i,j) = &
1835 - gsqrt(
ks,i-1,j,
i_uvz) * qflx_phi(
ks,i-1,j,
xdir) ) * rcdx(i) * mapf(i,j,1,
i_xy) &
1837 - gsqrt(
ks,i,j-1,
i_xvz) * qflx_phi(
ks,i,j-1,
ydir) ) * rcdy(j) * mapf(i,j,2,
i_xy) &
1838 + ( ( ( qflx_phi(
ks+1,i,j,
xdir) + qflx_phi(
ks+1,i-1,j,
xdir) &
1841 + ( qflx_phi(
ks+1,i,j,
ydir) + qflx_phi(
ks+1,i,j-1,
ydir) &
1845 + j33g * ( qflx_phi(
ks,i,j,
zdir) ) ) * rcdz(
ks) &
1848 phi_t_tb(
ke,i,j) = &
1850 - gsqrt(
ke,i-1,j,
i_uvz) * qflx_phi(
ke,i-1,j,
xdir) ) * rcdx(i) * mapf(i,j,1,
i_xy) &
1852 - gsqrt(
ke,i,j-1,
i_xvz) * qflx_phi(
ke,i,j-1,
ydir) ) * rcdy(j) * mapf(i,j,2,
i_xy) &
1853 + ( ( - ( qflx_phi(
ke ,i,j,
xdir) + qflx_phi(
ke ,i-1,j,
xdir) &
1854 + qflx_phi(
ke-1,i,j,
xdir) + qflx_phi(
ke-1,i-1,j,
xdir) &
1856 - ( qflx_phi(
ke ,i,j,
ydir) + qflx_phi(
ke ,i,j-1,
ydir) &
1857 + qflx_phi(
ke-1,i,j,
ydir) + qflx_phi(
ke-1,i,j-1,
ydir) &
1860 - j33g * ( qflx_phi(
ke-1,i,j,
zdir) ) ) * rcdz(
ke) &
integer, public is
start point of inner domain: x, local
subroutine, public atmos_phy_tb_calc_tend_momz(MOMZ_t_TB, QFLX_MOMZ, GSQRT, J13G, J23G, J33G, MAPF, IIS, IIE, JJS, JJE)
integer, public je
end point of inner domain: y, local
real(rp), dimension(:), allocatable, public grid_rcdy
reciprocal of center-dy
subroutine, public atmos_phy_tb_diffusion_solver(phi, a, b, c, d, KE_TB)
subroutine, public atmos_phy_tb_calc_flux_phi(qflx_phi, DENS, PHI, Kh, FACT, GSQRT, J13G, J23G, J33G, MAPF, a, b, c, dt, implicit, IIS, IIE, JJS, JJE)
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
subroutine, public atmos_phy_tb_calc_tend_momy(MOMY_t_TB, QFLX_MOMY, GSQRT, J13G, J23G, J33G, MAPF, IIS, IIE, JJS, JJE)
real(rp), dimension(:), allocatable, public grid_rcdx
reciprocal of center-dx
integer, parameter, public zdir
integer, parameter, public ydir
integer, public ke
end point of inner domain: z, local
integer, parameter, public xdir
real(rp), dimension(:), allocatable, public grid_rfdy
reciprocal of face-dy
subroutine, public check(current_line, v)
Undefined value checker.
real(rp), dimension(:), allocatable, public grid_rcdz
reciprocal of center-dz
real(rp), public const_undef
subroutine, public atmos_phy_tb_calc_tend_phi(phi_t_TB, QFLX_phi, GSQRT, J13G, J23G, J33G, MAPF, IIS, IIE, JJS, JJE)
integer, public ia
of whole cells: x, local, with HALO
subroutine, public atmos_phy_tb_calc_tend_momx(MOMX_t_TB, QFLX_MOMX, GSQRT, J13G, J23G, J33G, MAPF, IIS, IIE, JJS, JJE)
real(rp), dimension(:), allocatable, public grid_fdz
z-length of grid(k+1) to grid(k) [m]
integer, public ka
of whole cells: z, local, with HALO
integer, public jblock
block size for cache blocking: y
integer, public js
start point of inner domain: y, local
subroutine, public atmos_phy_tb_calc_strain_tensor(S33_C, S11_C, S22_C, S31_C, S12_C, S23_C, S12_Z, S23_X, S31_Y, S2, DENS, MOMZ, MOMX, MOMY, GSQRT, J13G, J23G, J33G, MAPF)
integer, parameter, public const_undef2
undefined value (INT2)
integer, public ks
start point of inner domain: z, local
module ATMOSPHERE / Physics Turbulence
integer, public ie
end point of inner domain: x, local
real(rp), dimension(:), allocatable, public grid_cdz
z-length of control volume [m]
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
integer, public ja
of whole cells: y, local, with HALO