75 #define F2H(k,p,q) (CDZ(k+p-1)*GSQRT(k+p-1,i,j)/(CDZ(k)*GSQRT(k,i,j)+CDZ(k+1)*GSQRT(k+1,i,j)))
77 #define F2H(k,p,q) 0.5_RP
84 real(RP),
parameter :: F2 = 0.5_rp
87 real(RP),
parameter :: F31 = -1.0_rp/12.0_rp
88 real(RP),
parameter :: F32 = 7.0_rp/12.0_rp
89 real(RP),
parameter :: F33 = 3.0_rp/12.0_rp
106 real(rp),
intent(out) :: valw (
ka)
107 real(rp),
intent(in) :: mflx (
ka)
108 real(rp),
intent(in) :: val (
ka)
109 real(rp),
intent(in) :: gsqrt(
ka)
110 real(rp),
intent(in) :: cdz (
ka)
117 call check( __line__, mflx(
k) )
119 call check( __line__, val(
k) )
120 call check( __line__, val(
k+1) )
122 call check( __line__, val(
k-1) )
123 call check( __line__, val(
k+2) )
127 + 0.5_rp * phi(val(
k+1),val(
k),val(
k-1)) * ( val(
k)-val(
k-1) ) ) &
128 * ( 0.5_rp + sign(0.5_rp,mflx(
k)) ) &
130 + 0.5_rp * phi(val(
k),val(
k+1),val(
k+2)) * ( val(
k+1)-val(
k+2) ) ) &
131 * ( 0.5_rp - sign(0.5_rp,mflx(
k)) )
139 call check( __line__, mflx(
ks) )
140 call check( __line__, val(
ks ) )
141 call check( __line__, val(
ks+1) )
142 call check( __line__, mflx(
ke-1) )
143 call check( __line__, val(
ke ) )
144 call check( __line__, val(
ke-1) )
148 valw(
ks) = f2 * ( val(
ks+1)+val(
ks) ) &
149 * ( 0.5_rp + sign(0.5_rp,mflx(
ks)) ) &
151 + 0.5_rp * phi(val(
ks),val(
ks+1),val(
ks+2)) * ( val(
ks+1)-val(
ks+2) ) ) &
152 * ( 0.5_rp - sign(0.5_rp,mflx(
ks)) )
153 valw(
ke-1) = ( val(
ke-1) &
154 + 0.5_rp * phi(val(
ke-2),val(
ke-1),val(
ke)) * ( val(
ke-1)-val(
ke) ) ) &
155 * ( 0.5_rp + sign(0.5_rp,mflx(
ke-1)) ) &
156 + f2 * ( val(
ke)+val(
ke-1) ) &
157 * ( 0.5_rp - sign(0.5_rp,mflx(
ke-1)) )
175 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
176 real(rp),
intent(in) :: mflx (
ka,
ia,
ja)
177 real(rp),
intent(in) :: val (
ka,
ia,
ja)
178 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
179 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
180 real(rp),
intent(in) :: cdz (
ka)
181 integer,
intent(in) :: iis, iie, jjs, jje
198 call check( __line__, mflx(
k,i,j) )
200 call check( __line__, val(
k,i,j) )
201 call check( __line__, val(
k+1,i,j) )
203 call check( __line__, val(
k-1,i,j) )
204 call check( __line__, val(
k+2,i,j) )
210 + 0.5_rp * phi(val(
k+1,i,j),val(
k,i,j),val(
k-1,i,j)) * ( val(
k,i,j)-val(
k-1,i,j) ) ) &
211 * ( 0.5_rp + sign(0.5_rp,vel) ) &
213 + 0.5_rp * phi(val(
k,i,j),val(
k+1,i,j),val(
k+2,i,j)) * ( val(
k+1,i,j)-val(
k+2,i,j) ) ) &
214 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
215 + gsqrt(
k,i,j) * num_diff(
k,i,j)
222 k = iundef; i = iundef; j = iundef
231 call check( __line__, mflx(
ks,i,j) )
232 call check( __line__, val(
ks ,i,j) )
233 call check( __line__, val(
ks+1,i,j) )
234 call check( __line__, mflx(
ke-1,i,j) )
235 call check( __line__, val(
ke ,i,j) )
236 call check( __line__, val(
ke-1,i,j) )
239 flux(
ks-1,i,j) = 0.0_rp
243 * ( f2 * ( val(
ks+1,i,j)+val(
ks,i,j) ) &
244 * ( 0.5_rp + sign(0.5_rp,vel) ) &
246 + 0.5_rp * phi(val(
ks,i,j),val(
ks+1,i,j),val(
ks+2,i,j)) * ( val(
ks+1,i,j)-val(
ks+2,i,j) ) ) &
247 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
248 + gsqrt(
ks,i,j) * num_diff(
ks,i,j)
250 flux(
ke-1,i,j) = vel &
251 * ( ( val(
ke-1,i,j) &
252 + 0.5_rp * phi(val(
ke-2,i,j),val(
ke-1,i,j),val(
ke,i,j)) * ( val(
ke-1,i,j)-val(
ke,i,j) ) ) &
253 * ( 0.5_rp + sign(0.5_rp,vel) ) &
254 + f2 * ( val(
ke,i,j)+val(
ke-1,i,j) ) &
255 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
256 + gsqrt(
ke-1,i,j) * num_diff(
ke-1,i,j)
258 flux(
ke ,i,j) = 0.0_rp
268 k = iundef; i = iundef; j = iundef
284 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
285 real(rp),
intent(in) :: mflx (
ka,
ia,
ja)
286 real(rp),
intent(in) :: val (
ka,
ia,
ja)
287 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
288 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
289 real(rp),
intent(in) :: cdz(
ka)
290 integer,
intent(in) :: iis, iie, jjs, jje
304 call check( __line__, mflx(
k,i,j) )
306 call check( __line__, val(
k,i,j) )
307 call check( __line__, val(
k,i+1,j) )
309 call check( __line__, val(
k,i-1,j) )
310 call check( __line__, val(
k,i+2,j) )
316 + 0.5_rp * phi(val(
k,i+1,j),val(
k,i,j),val(
k,i-1,j)) * ( val(
k,i,j)-val(
k,i-1,j) ) ) &
317 * ( 0.5_rp + sign(0.5_rp,vel) ) &
319 + 0.5_rp * phi(val(
k,i,j),val(
k,i+1,j),val(
k,i+2,j)) * ( val(
k,i+1,j)-val(
k,i+2,j) ) ) &
320 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
321 + gsqrt(
k,i,j) * num_diff(
k,i,j)
327 k = iundef; i = iundef; j = iundef
343 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
344 real(rp),
intent(in) :: mflx (
ka,
ia,
ja)
345 real(rp),
intent(in) :: val (
ka,
ia,
ja)
346 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
347 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
348 real(rp),
intent(in) :: cdz(
ka)
349 integer,
intent(in) :: iis, iie, jjs, jje
363 call check( __line__, mflx(
k,i,j) )
365 call check( __line__, val(
k,i,j) )
366 call check( __line__, val(
k,i,j+1) )
368 call check( __line__, val(
k,i,j-1) )
369 call check( __line__, val(
k,i,j+2) )
375 + 0.5_rp * phi(val(
k,i,j+1),val(
k,i,j),val(
k,i,j-1)) * ( val(
k,i,j)-val(
k,i,j-1) ) ) &
376 * ( 0.5_rp + sign(0.5_rp,vel) ) &
378 + 0.5_rp * phi(val(
k,i,j),val(
k,i,j+1),val(
k,i,j+2)) * ( val(
k,i,j+1)-val(
k,i,j+2) ) ) &
379 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
380 + gsqrt(
k,i,j) * num_diff(
k,i,j)
386 k = iundef; i = iundef; j = iundef
405 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
406 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
407 real(rp),
intent(in) :: val (
ka,
ia,
ja)
408 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
409 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
410 real(rp),
intent(in) :: j33g
411 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
412 real(rp),
intent(in) :: cdz (
ka)
413 real(rp),
intent(in) :: fdz (
ka-1)
414 real(rp),
intent(in) :: dtrk
415 integer,
intent(in) :: iis, iie, jjs, jje
434 call check( __line__, mom(
k-1,i,j) )
435 call check( __line__, mom(
k ,i,j) )
437 call check( __line__, val(
k-1,i,j) )
438 call check( __line__, val(
k,i,j) )
440 call check( __line__, val(
k-2,i,j) )
441 call check( __line__, val(
k+1,i,j) )
444 vel = ( 0.5_rp * ( mom(
k-1,i,j) &
447 flux(
k-1,i,j) = j33g * vel &
449 + 0.5_rp * phi(val(
k,i,j),val(
k-1,i,j),val(
k-2,i,j)) * ( val(
k-1,i,j)-val(
k-2,i,j) ) ) &
450 * ( 0.5_rp + sign(0.5_rp,vel) ) &
452 + 0.5_rp * phi(val(
k-1,i,j),val(
k,i,j),val(
k+1,i,j)) * ( val(
k,i,j)-val(
k+1,i,j) ) ) &
453 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
454 + gsqrt(
k,i,j) * num_diff(
k,i,j)
461 k = iundef; i = iundef; j = iundef
470 call check( __line__, val(
ks,i,j) )
471 call check( __line__, val(
ks+1,i,j) )
472 call check( __line__, val(
ks+2,i,j) )
479 flux(
ks-1,i,j) = 0.0_rp
481 vel = ( 0.5_rp * ( mom(
ks,i,j) &
482 + mom(
ks+1,i,j) ) ) &
484 flux(
ks,i,j) = j33g * vel &
485 * ( f2 * ( val(
ks+1,i,j)+val(
ks,i,j) ) &
486 * ( 0.5_rp + sign(0.5_rp,vel) ) &
488 + 0.5_rp * phi(val(
ks,i,j),val(
ks+1,i,j),val(
ks+2,i,j)) * ( val(
ks+1,i,j)-val(
ks+2,i,j) ) ) &
489 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
490 + gsqrt(
ks+1,i,j) * num_diff(
ks+1,i,j)
494 flux(
ke-1,i,j) = 0.0_rp
495 flux(
ke ,i,j) = 0.0_rp
519 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
520 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
521 real(rp),
intent(in) :: val (
ka,
ia,
ja)
522 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
523 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
524 real(rp),
intent(in) :: j13g (
ka,
ia,
ja)
525 real(rp),
intent(in) :: mapf (
ia,
ja,2)
526 real(rp),
intent(in) :: cdz (
ka)
527 logical,
intent(in) :: twod
528 integer,
intent(in) :: iis, iie, jjs, jje
544 vel = ( 0.5_rp * ( mom(
k,i,j)+mom(
k,i-1,j) ) ) &
546 vel = vel * j13g(
k,i,j)
547 flux(
k-1,i,j) = vel / mapf(i,j,+2) &
549 + 0.5_rp * phi(val(
k,i,j),val(
k-1,i,j),val(
k-2,i,j)) * ( val(
k-1,i,j)-val(
k-2,i,j) ) ) &
550 * ( 0.5_rp + sign(0.5_rp,vel) ) &
552 + 0.5_rp * phi(val(
k-1,i,j),val(
k,i,j),val(
k+1,i,j)) * ( val(
k,i,j)-val(
k+1,i,j) ) ) &
553 * ( 0.5_rp - sign(0.5_rp,vel) ) )
567 flux(
ks-1,i,j) = 0.0_rp
570 vel = ( ( 0.5_rp * ( mom(
ks+1,i,j)+mom(
ks+1,i-1,j) ) ) / dens(
ks+1,i,j) &
571 + ( 0.5_rp * ( mom(
ks,i,j)+mom(
ks,i-1,j) ) ) / dens(
ks ,i,j) ) * 0.5_rp
574 vel = vel * j13g(
ks+1,i,j)
575 flux(
ks,i,j) = vel / mapf(i,j,+2) &
576 * ( f2 * ( val(
ks+1,i,j)+val(
ks,i,j) ) &
577 * ( 0.5_rp + sign(0.5_rp,vel) ) &
579 + 0.5_rp * phi(val(
ks,i,j),val(
ks+1,i,j),val(
ks+2,i,j)) * ( val(
ks+1,i,j)-val(
ks+2,i,j) ) ) &
580 * ( 0.5_rp - sign(0.5_rp,vel) ) )
583 flux(
ke-1,i,j) = 0.0_rp
606 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
607 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
608 real(rp),
intent(in) :: val (
ka,
ia,
ja)
609 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
610 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
611 real(rp),
intent(in) :: j23g (
ka,
ia,
ja)
612 real(rp),
intent(in) :: mapf (
ia,
ja,2)
613 real(rp),
intent(in) :: cdz (
ka)
614 logical,
intent(in) :: twod
615 integer,
intent(in) :: iis, iie, jjs, jje
631 vel = ( 0.5_rp * ( mom(
k,i,j)+mom(
k,i,j-1) ) ) &
633 vel = vel * j23g(
k,i,j)
634 flux(
k-1,i,j) = vel / mapf(i,j,+1) &
636 + 0.5_rp * phi(val(
k,i,j),val(
k-1,i,j),val(
k-2,i,j)) * ( val(
k-1,i,j)-val(
k-2,i,j) ) ) &
637 * ( 0.5_rp + sign(0.5_rp,vel) ) &
639 + 0.5_rp * phi(val(
k-1,i,j),val(
k,i,j),val(
k+1,i,j)) * ( val(
k,i,j)-val(
k+1,i,j) ) ) &
640 * ( 0.5_rp - sign(0.5_rp,vel) ) )
654 flux(
ks-1,i,j) = 0.0_rp
657 vel = ( ( 0.5_rp * ( mom(
ks+1,i,j)+mom(
ks+1,i,j-1) ) ) / dens(
ks+1,i,j) &
658 + ( 0.5_rp * ( mom(
ks,i,j)+mom(
ks,i,j-1) ) ) / dens(
ks ,i,j) ) * 0.5_rp
661 vel = vel * j23g(
ks+1,i,j)
662 flux(
ks,i,j) = vel / mapf(i,j,+1) &
663 * ( f2 * ( val(
ks+1,i,j)+val(
ks,i,j) ) &
664 * ( 0.5_rp + sign(0.5_rp,vel) ) &
666 + 0.5_rp * phi(val(
ks,i,j),val(
ks+1,i,j),val(
ks+2,i,j)) * ( val(
ks+1,i,j)-val(
ks+2,i,j) ) ) &
667 * ( 0.5_rp - sign(0.5_rp,vel) ) )
670 flux(
ke-1,i,j) = 0.0_rp
695 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
696 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
697 real(rp),
intent(in) :: val (
ka,
ia,
ja)
698 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
699 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
700 real(rp),
intent(in) :: mapf (
ia,
ja,2)
701 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
702 real(rp),
intent(in) :: cdz (
ka)
703 logical,
intent(in) :: twod
704 integer,
intent(in) :: iis, iie, jjs, jje
722 call check( __line__, mom(
k ,i,j) )
723 call check( __line__, mom(
k+1,i,j) )
725 call check( __line__, val(
k,i,j) )
726 call check( __line__, val(
k,i+1,j) )
728 call check( __line__, val(
k,i-1,j) )
729 call check( __line__, val(
k,i+2,j) )
737 * 0.5_rp * ( dens(
k+1,i,j)+dens(
k+1,i+1,j) ) &
739 * 0.5_rp * ( dens(
k,i,j)+dens(
k,i+1,j) ) )
740 flux(
k,i,j) = gsqrt(
k,i,j) / mapf(i,j,+2) * vel &
742 + 0.5_rp * phi(val(
k,i+1,j),val(
k,i,j),val(
k,i-1,j)) * ( val(
k,i,j)-val(
k,i-1,j) ) ) &
743 * ( 0.5_rp + sign(0.5_rp,vel) ) &
745 + 0.5_rp * phi(val(
k,i,j),val(
k,i+1,j),val(
k,i+2,j)) * ( val(
k,i+1,j)-val(
k,i+2,j) ) ) &
746 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
747 + gsqrt(
k,i,j) * num_diff(
k,i,j)
754 k = iundef; i = iundef; j = iundef
761 flux(
ke,i,j) = 0.0_rp
771 k = iundef; i = iundef; j = iundef
788 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
789 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
790 real(rp),
intent(in) :: val (
ka,
ia,
ja)
791 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
792 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
793 real(rp),
intent(in) :: mapf (
ia,
ja,2)
794 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
795 real(rp),
intent(in) :: cdz (
ka)
796 logical,
intent(in) :: twod
797 integer,
intent(in) :: iis, iie, jjs, jje
815 call check( __line__, mom(
k ,i,j) )
816 call check( __line__, mom(
k+1,i,j) )
818 call check( __line__, val(
k,i,j) )
819 call check( __line__, val(
k,i,j+1) )
821 call check( __line__, val(
k,i,j-1) )
822 call check( __line__, val(
k,i,j+2) )
830 * 0.5_rp * ( dens(
k+1,i,j)+dens(
k+1,i,j+1) ) &
832 * 0.5_rp * ( dens(
k,i,j)+dens(
k,i,j+1) ) )
833 flux(
k,i,j) = gsqrt(
k,i,j) / mapf(i,j,+1) * vel &
835 + 0.5_rp * phi(val(
k,i,j+1),val(
k,i,j),val(
k,i,j-1)) * ( val(
k,i,j)-val(
k,i,j-1) ) ) &
836 * ( 0.5_rp + sign(0.5_rp,vel) ) &
838 + 0.5_rp * phi(val(
k,i,j),val(
k,i,j+1),val(
k,i,j+2)) * ( val(
k,i,j+1)-val(
k,i,j+2) ) ) &
839 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
840 + gsqrt(
k,i,j) * num_diff(
k,i,j)
847 k = iundef; i = iundef; j = iundef
854 flux(
ke,i,j) = 0.0_rp
864 k = iundef; i = iundef; j = iundef
882 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
883 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
884 real(rp),
intent(in) :: val (
ka,
ia,
ja)
885 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
886 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
887 real(rp),
intent(in) :: j33g
888 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
889 real(rp),
intent(in) :: cdz (
ka)
890 logical,
intent(in) :: twod
891 integer,
intent(in) :: iis, iie, jjs, jje
912 call check( __line__, mom(
k,i,j) )
914 call check( __line__, val(
k,i,j) )
915 call check( __line__, val(
k+1,i,j) )
917 call check( __line__, val(
k-1,i,j) )
918 call check( __line__, val(
k+2,i,j) )
921 vel = ( mom(
k,i,j) ) &
926 flux(
k,i,j) = j33g * vel &
928 + 0.5_rp * phi(val(
k+1,i,j),val(
k,i,j),val(
k-1,i,j)) * ( val(
k,i,j)-val(
k-1,i,j) ) ) &
929 * ( 0.5_rp + sign(0.5_rp,vel) ) &
931 + 0.5_rp * phi(val(
k,i,j),val(
k+1,i,j),val(
k+2,i,j)) * ( val(
k+1,i,j)-val(
k+2,i,j) ) ) &
932 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
933 + gsqrt(
k,i,j) * num_diff(
k,i,j)
939 k = iundef; i = iundef; j = iundef
948 call check( __line__, mom(
ks,i ,j) )
949 call check( __line__, val(
ks+1,i,j) )
950 call check( __line__, val(
ks,i,j) )
956 flux(
ks-1,i,j) = 0.0_rp
958 vel = ( mom(
ks,i,j) ) &
963 flux(
ks,i,j) = j33g * vel &
964 * ( f2 * ( val(
ks+1,i,j)+val(
ks,i,j) ) &
965 * ( 0.5_rp + sign(0.5_rp,vel) ) &
967 + 0.5_rp * phi(val(
ks,i,j),val(
ks+1,i,j),val(
ks+2,i,j)) * ( val(
ks+1,i,j)-val(
ks+2,i,j) ) ) &
968 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
969 + gsqrt(
ks,i,j) * num_diff(
ks,i,j)
970 vel = ( mom(
ke-1,i,j) ) &
975 flux(
ke-1,i,j) = j33g * vel &
976 * ( ( val(
ke-1,i,j) &
977 + 0.5_rp * phi(val(
ke-2,i,j),val(
ke-1,i,j),val(
ke,i,j)) * ( val(
ke-1,i,j)-val(
ke,i,j) ) ) &
978 * ( 0.5_rp + sign(0.5_rp,vel) ) &
979 + f2 * ( val(
ke,i,j)+val(
ke-1,i,j) ) &
980 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
981 + gsqrt(
ke-1,i,j) * num_diff(
ke-1,i,j)
983 flux(
ke,i,j) = 0.0_rp
997 call check( __line__, mom(
k,i,j) )
998 call check( __line__, mom(
k,i+1,j) )
1000 call check( __line__, val(
k,i,j) )
1001 call check( __line__, val(
k+1,i,j) )
1003 call check( __line__, val(
k-1,i,j) )
1004 call check( __line__, val(
k+2,i,j) )
1007 vel = ( 0.5_rp * ( mom(
k,i,j)+mom(
k,i+1,j) ) ) &
1009 * 0.5_rp * ( dens(
k+1,i,j)+dens(
k+1,i+1,j) ) &
1011 * 0.5_rp * ( dens(
k,i,j)+dens(
k,i+1,j) ) )
1012 flux(
k,i,j) = j33g * vel &
1014 + 0.5_rp * phi(val(
k+1,i,j),val(
k,i,j),val(
k-1,i,j)) * ( val(
k,i,j)-val(
k-1,i,j) ) ) &
1015 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1017 + 0.5_rp * phi(val(
k,i,j),val(
k+1,i,j),val(
k+2,i,j)) * ( val(
k+1,i,j)-val(
k+2,i,j) ) ) &
1018 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1019 + gsqrt(
k,i,j) * num_diff(
k,i,j)
1026 k = iundef; i = iundef; j = iundef
1035 call check( __line__, mom(
ks,i ,j) )
1036 call check( __line__, mom(
ks,i+1,j) )
1037 call check( __line__, val(
ks+1,i,j) )
1038 call check( __line__, val(
ks,i,j) )
1044 flux(
ks-1,i,j) = 0.0_rp
1046 vel = ( 0.5_rp * ( mom(
ks,i,j)+mom(
ks,i+1,j) ) ) &
1048 * 0.5_rp * ( dens(
ks+1,i,j)+dens(
ks+1,i+1,j) ) &
1050 * 0.5_rp * ( dens(
ks,i,j)+dens(
ks,i+1,j) ) )
1051 flux(
ks,i,j) = j33g * vel &
1052 * ( f2 * ( val(
ks+1,i,j)+val(
ks,i,j) ) &
1053 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1055 + 0.5_rp * phi(val(
ks,i,j),val(
ks+1,i,j),val(
ks+2,i,j)) * ( val(
ks+1,i,j)-val(
ks+2,i,j) ) ) &
1056 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1057 + gsqrt(
ks,i,j) * num_diff(
ks,i,j)
1058 vel = ( 0.5_rp * ( mom(
ke-1,i,j)+mom(
ke-1,i+1,j) ) ) &
1060 * 0.5_rp * ( dens(
ke,i,j)+dens(
ke,i+1,j) ) &
1062 * 0.5_rp * ( dens(
ke-1,i,j)+dens(
ke-1,i+1,j) ) )
1063 flux(
ke-1,i,j) = j33g * vel &
1064 * ( ( val(
ke-1,i,j) &
1065 + 0.5_rp * phi(val(
ke-2,i,j),val(
ke-1,i,j),val(
ke,i,j)) * ( val(
ke-1,i,j)-val(
ke,i,j) ) ) &
1066 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1067 + f2 * ( val(
ke,i,j)+val(
ke-1,i,j) ) &
1068 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1069 + gsqrt(
ke-1,i,j) * num_diff(
ke-1,i,j)
1071 flux(
ke,i,j) = 0.0_rp
1084 k = iundef; i = iundef; j = iundef
1095 GSQRT, J13G, MAPF, &
1097 IIS, IIE, JJS, JJE )
1100 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1101 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1102 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1103 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1104 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1105 real(rp),
intent(in) :: j13g (
ka,
ia,
ja)
1106 real(rp),
intent(in) :: mapf (
ia,
ja,2)
1107 real(rp),
intent(in) :: cdz (
ka)
1108 logical,
intent(in) :: twod
1109 integer,
intent(in) :: iis, iie, jjs, jje
1133 * 0.5_rp * ( dens(
k+1,i,j)+dens(
k+1,i+1,j) ) &
1135 * 0.5_rp * ( dens(
k,i,j)+dens(
k,i+1,j) ) )
1136 vel = vel * j13g(
k,i,j)
1137 flux(
k,i,j) = vel / mapf(i,j,+2) &
1139 + 0.5_rp * phi(val(
k+1,i,j),val(
k,i,j),val(
k-1,i,j)) * ( val(
k,i,j)-val(
k-1,i,j) ) ) &
1140 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1142 + 0.5_rp * phi(val(
k,i,j),val(
k+1,i,j),val(
k+2,i,j)) * ( val(
k+1,i,j)-val(
k+2,i,j) ) ) &
1143 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1157 flux(
ks-1,i,j) = 0.0_rp
1164 * 0.5_rp * ( dens(
ks+1,i,j)+dens(
ks+1,i+1,j) ) &
1166 * 0.5_rp * ( dens(
ks,i,j)+dens(
ks,i+1,j) ) )
1167 vel = vel * j13g(
ks,i,j)
1168 flux(
ks,i,j) = vel / mapf(i,j,+2) &
1169 * ( f2 * ( val(
ks+1,i,j)+val(
ks,i,j) ) &
1170 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1172 + 0.5_rp * phi(val(
ks,i,j),val(
ks+1,i,j),val(
ks+2,i,j)) * ( val(
ks+1,i,j)-val(
ks+2,i,j) ) ) &
1173 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1180 * 0.5_rp * ( dens(
ke,i,j)+dens(
ke,i+1,j) ) &
1182 * 0.5_rp * ( dens(
ke-1,i,j)+dens(
ke-1,i+1,j) ) )
1183 vel = vel * j13g(
ke-1,i,j)
1184 flux(
ke-1,i,j) = vel / mapf(i,j,+2) &
1185 * ( ( val(
ke-1,i,j) &
1186 + 0.5_rp * phi(val(
ke-2,i,j),val(
ke-1,i,j),val(
ke,i,j)) * ( val(
ke-1,i,j)-val(
ke,i,j) ) ) &
1187 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1188 + f2 * ( val(
ke,i,j)+val(
ke-1,i,j) ) &
1189 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1191 flux(
ke ,i,j) = 0.0_rp
1210 GSQRT, J23G, MAPF, &
1212 IIS, IIE, JJS, JJE )
1215 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1216 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1217 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1218 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1219 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1220 real(rp),
intent(in) :: j23g (
ka,
ia,
ja)
1221 real(rp),
intent(in) :: mapf (
ia,
ja,2)
1222 real(rp),
intent(in) :: cdz (
ka)
1223 logical,
intent(in) :: twod
1224 integer,
intent(in) :: iis, iie, jjs, jje
1245 * 0.5_rp * ( mom(
k+1,i,j)+mom(
k+1,i,j-1) ) &
1247 * 0.5_rp * ( mom(
k,i,j)+mom(
k,i,j-1) ) ) &
1252 vel = vel * j23g(
k,i,j)
1253 flux(
k,i,j) = vel * ( ( val(
k,i,j) &
1254 + 0.5_rp * phi(val(
k+1,i,j),val(
k,i,j),val(
k-1,i,j)) * ( val(
k,i,j)-val(
k-1,i,j) ) ) &
1255 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1257 + 0.5_rp * phi(val(
k,i,j),val(
k+1,i,j),val(
k+2,i,j)) * ( val(
k+1,i,j)-val(
k+2,i,j) ) ) &
1258 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1271 flux(
ks-1,i,j) = 0.0_rp
1274 * 0.5_rp * ( mom(
ks+1,i,j)+mom(
ks+1,i,j-1) ) &
1276 * 0.5_rp * ( mom(
ks,i,j)+mom(
ks,i,j-1) ) ) &
1281 vel = vel * j23g(
ks,i,j)
1282 flux(
ks,i,j) = vel / mapf(i,j,+1) &
1283 * ( f2 * ( val(
ks+1,i,j)+val(
ks,i,j) ) &
1284 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1286 + 0.5_rp * phi(val(
ks,i,j),val(
ks+1,i,j),val(
ks+2,i,j)) * ( val(
ks+1,i,j)-val(
ks+2,i,j) ) ) &
1287 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1290 * 0.5_rp * ( mom(
ke,i,j)+mom(
ke,i,j-1) ) &
1292 * 0.5_rp * ( mom(
ke-1,i,j)+mom(
ke-1,i,j-1) ) ) &
1297 vel = vel * j23g(
ke-1,i,j)
1298 flux(
ke-1,i,j) = vel / mapf(i,j,+1) &
1299 * ( ( val(
ke-1,i,j) &
1300 + 0.5_rp * phi(val(
ke-2,i,j),val(
ke-1,i,j),val(
ke,i,j)) * ( val(
ke-1,i,j)-val(
ke,i,j) ) ) &
1301 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1302 + f2 * ( val(
ke,i,j)+val(
ke-1,i,j) ) &
1303 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1305 flux(
ke ,i,j) = 0.0_rp
1319 * 0.25_rp * ( mom(
k+1,i,j)+mom(
k+1,i+1,j)+mom(
k+1,i,j-1)+mom(
k+1,i+1,j-1) ) &
1321 * 0.25_rp * ( mom(
k,i,j)+mom(
k,i+1,j)+mom(
k,i,j-1)+mom(
k,i+1,j-1) ) ) &
1323 * 0.5_rp * ( dens(
k+1,i,j)+dens(
k+1,i+1,j) ) &
1325 * 0.5_rp * ( dens(
k,i,j)+dens(
k,i+1,j) ) )
1326 vel = vel * j23g(
k,i,j)
1327 flux(
k,i,j) = vel / mapf(i,j,+1) &
1329 + 0.5_rp * phi(val(
k+1,i,j),val(
k,i,j),val(
k-1,i,j)) * ( val(
k,i,j)-val(
k-1,i,j) ) ) &
1330 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1332 + 0.5_rp * phi(val(
k,i,j),val(
k+1,i,j),val(
k+2,i,j)) * ( val(
k+1,i,j)-val(
k+2,i,j) ) ) &
1333 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1347 flux(
ks-1,i,j) = 0.0_rp
1350 * 0.25_rp * ( mom(
ks+1,i,j)+mom(
ks+1,i+1,j)+mom(
ks+1,i,j-1)+mom(
ks+1,i+1,j-1) ) &
1352 * 0.25_rp * ( mom(
ks,i,j)+mom(
ks,i+1,j)+mom(
ks,i,j-1)+mom(
ks,i+1,j-1) ) ) &
1354 * 0.5_rp * ( dens(
ks+1,i,j)+dens(
ks+1,i+1,j) ) &
1356 * 0.5_rp * ( dens(
ks,i,j)+dens(
ks,i+1,j) ) )
1357 vel = vel * j23g(
ks,i,j)
1358 flux(
ks,i,j) = vel / mapf(i,j,+1) &
1359 * ( f2 * ( val(
ks+1,i,j)+val(
ks,i,j) ) &
1360 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1362 + 0.5_rp * phi(val(
ks,i,j),val(
ks+1,i,j),val(
ks+2,i,j)) * ( val(
ks+1,i,j)-val(
ks+2,i,j) ) ) &
1363 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1366 * 0.25_rp * ( mom(
ke,i,j)+mom(
ke,i+1,j)+mom(
ke,i,j-1)+mom(
ke,i+1,j-1) ) &
1368 * 0.25_rp * ( mom(
ke-1,i,j)+mom(
ke-1,i+1,j)+mom(
ke-1,i,j-1)+mom(
ke-1,i+1,j-1) ) ) &
1370 * 0.5_rp * ( dens(
ke,i,j)+dens(
ke,i+1,j) ) &
1372 * 0.5_rp * ( dens(
ke-1,i,j)+dens(
ke-1,i+1,j) ) )
1373 vel = vel * j23g(
ke-1,i,j)
1374 flux(
ke-1,i,j) = vel / mapf(i,j,+1) &
1375 * ( ( val(
ke-1,i,j) &
1376 + 0.5_rp * phi(val(
ke-2,i,j),val(
ke-1,i,j),val(
ke,i,j)) * ( val(
ke-1,i,j)-val(
ke,i,j) ) ) &
1377 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1378 + f2 * ( val(
ke,i,j)+val(
ke-1,i,j) ) &
1379 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1381 flux(
ke ,i,j) = 0.0_rp
1405 IIS, IIE, JJS, JJE )
1408 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1409 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1410 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1411 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1412 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1413 real(rp),
intent(in) :: mapf (
ia,
ja,2)
1414 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
1415 real(rp),
intent(in) :: cdz (
ka)
1416 logical,
intent(in) :: twod
1417 integer,
intent(in) :: iis, iie, jjs, jje
1435 call check( __line__, mom(
k,i ,j) )
1436 call check( __line__, mom(
k,i-1,j) )
1438 call check( __line__, val(
k,i-1,j) )
1439 call check( __line__, val(
k,i,j) )
1441 call check( __line__, val(
k,i-2,j) )
1442 call check( __line__, val(
k,i+1,j) )
1445 vel = ( 0.5_rp * ( mom(
k,i,j)+mom(
k,i-1,j) ) ) &
1447 flux(
k,i-1,j) = gsqrt(
k,i,j) / mapf(i,j,+2) * vel &
1448 * ( ( val(
k,i-1,j) &
1449 + 0.5_rp * phi(val(
k,i,j),val(
k,i-1,j),val(
k,i-2,j)) * ( val(
k,i-1,j)-val(
k,i-2,j) ) ) &
1450 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1452 + 0.5_rp * phi(val(
k,i-1,j),val(
k,i,j),val(
k,i+1,j)) * ( val(
k,i,j)-val(
k,i+1,j) ) ) &
1453 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1454 + gsqrt(
k,i,j) * num_diff(
k,i,j)
1460 k = iundef; i = iundef; j = iundef
1476 IIS, IIE, JJS, JJE )
1479 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1480 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1481 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1482 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1483 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1484 real(rp),
intent(in) :: mapf (
ia,
ja,2)
1485 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
1486 real(rp),
intent(in) :: cdz (
ka)
1487 logical,
intent(in) :: twod
1488 integer,
intent(in) :: iis, iie, jjs, jje
1506 call check( __line__, mom(
k,i ,j) )
1508 call check( __line__, val(
k,i,j) )
1509 call check( __line__, val(
k,i,j+1) )
1511 call check( __line__, val(
k,i,j-1) )
1512 call check( __line__, val(
k,i,j+2) )
1515 vel = ( mom(
k,i,j) ) &
1516 / ( 0.5_rp * ( dens(
k,i,j)+dens(
k,i,j+1) ) )
1517 flux(
k,i,j) = gsqrt(
k,i,j) / mapf(i,j,+1) * vel &
1519 + 0.5_rp * phi(val(
k,i,j+1),val(
k,i,j),val(
k,i,j-1)) * ( val(
k,i,j)-val(
k,i,j-1) ) ) &
1520 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1522 + 0.5_rp * phi(val(
k,i,j),val(
k,i,j+1),val(
k,i,j+2)) * ( val(
k,i,j+1)-val(
k,i,j+2) ) ) &
1523 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1524 + gsqrt(
k,i,j) * num_diff(
k,i,j)
1529 k = iundef; i = iundef; j = iundef
1543 call check( __line__, mom(
k,i ,j) )
1544 call check( __line__, mom(
k,i-1,j) )
1546 call check( __line__, val(
k,i,j) )
1547 call check( __line__, val(
k,i,j+1) )
1549 call check( __line__, val(
k,i,j-1) )
1550 call check( __line__, val(
k,i,j+2) )
1553 vel = ( 0.5_rp * ( mom(
k,i,j)+mom(
k,i+1,j) ) ) &
1554 / ( 0.25_rp * ( dens(
k,i,j)+dens(
k,i+1,j)+dens(
k,i,j+1)+dens(
k,i+1,j+1) ) )
1555 flux(
k,i,j) = gsqrt(
k,i,j) / mapf(i,j,+1) * vel &
1557 + 0.5_rp * phi(val(
k,i,j+1),val(
k,i,j),val(
k,i,j-1)) * ( val(
k,i,j)-val(
k,i,j-1) ) ) &
1558 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1560 + 0.5_rp * phi(val(
k,i,j),val(
k,i,j+1),val(
k,i,j+2)) * ( val(
k,i,j+1)-val(
k,i,j+2) ) ) &
1561 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1562 + gsqrt(
k,i,j) * num_diff(
k,i,j)
1568 k = iundef; i = iundef; j = iundef
1588 IIS, IIE, JJS, JJE )
1591 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1592 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1593 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1594 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1595 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1596 real(rp),
intent(in) :: j33g
1597 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
1598 real(rp),
intent(in) :: cdz (
ka)
1599 logical,
intent(in) :: twod
1600 integer,
intent(in) :: iis, iie, jjs, jje
1619 call check( __line__, mom(
k,i,j) )
1620 call check( __line__, mom(
k,i,j+1) )
1622 call check( __line__, val(
k,i,j) )
1623 call check( __line__, val(
k+1,i,j) )
1625 call check( __line__, val(
k-1,i,j) )
1626 call check( __line__, val(
k+2,i,j) )
1629 vel = ( 0.5_rp * ( mom(
k,i,j)+mom(
k,i,j+1) ) ) &
1631 * 0.5_rp * ( dens(
k+1,i,j)+dens(
k+1,i,j+1) ) &
1633 * 0.5_rp * ( dens(
k,i,j)+dens(
k,i,j+1) ) )
1634 flux(
k,i,j) = j33g * vel &
1636 + 0.5_rp * phi(val(
k+1,i,j),val(
k,i,j),val(
k-1,i,j)) * ( val(
k,i,j)-val(
k-1,i,j) ) ) &
1637 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1639 + 0.5_rp * phi(val(
k,i,j),val(
k+1,i,j),val(
k+2,i,j)) * ( val(
k+1,i,j)-val(
k+2,i,j) ) ) &
1640 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1641 + gsqrt(
k,i,j) * num_diff(
k,i,j)
1648 k = iundef; i = iundef; j = iundef
1657 call check( __line__, mom(
ks,i ,j) )
1658 call check( __line__, mom(
ks,i,j+1) )
1659 call check( __line__, val(
ks+1,i,j) )
1660 call check( __line__, val(
ks,i,j) )
1666 flux(
ks-1,i,j) = 0.0_rp
1668 vel = ( 0.5_rp * ( mom(
ks,i,j)+mom(
ks,i,j+1) ) ) &
1670 * 0.5_rp * ( dens(
ks+1,i,j)+dens(
ks+1,i,j+1) ) &
1672 * 0.5_rp * ( dens(
ks,i,j)+dens(
ks,i,j+1) ) )
1673 flux(
ks,i,j) = j33g * vel &
1674 * ( f2 * ( val(
ks+1,i,j)+val(
ks,i,j) ) &
1675 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1677 + 0.5_rp * phi(val(
ks,i,j),val(
ks+1,i,j),val(
ks+2,i,j)) * ( val(
ks+1,i,j)-val(
ks+2,i,j) ) ) &
1678 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1679 + gsqrt(
ks,i,j) * num_diff(
ks,i,j)
1680 vel = ( 0.5_rp * ( mom(
ke-1,i,j)+mom(
ke-1,i,j+1) ) ) &
1682 * 0.5_rp * ( dens(
ke,i,j)+dens(
ke,i,j+1) ) &
1684 * 0.5_rp * ( dens(
ke-1,i,j)+dens(
ke-1,i,j+1) ) )
1685 flux(
ke-1,i,j) = j33g * vel &
1686 * ( ( val(
ke-1,i,j) &
1687 + 0.5_rp * phi(val(
ke-2,i,j),val(
ke-1,i,j),val(
ke,i,j)) * ( val(
ke-1,i,j)-val(
ke,i,j) ) ) &
1688 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1689 + f2 * ( val(
ke,i,j)+val(
ke-1,i,j) ) &
1690 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1691 + gsqrt(
ke-1,i,j) * num_diff(
ke-1,i,j)
1693 flux(
ke,i,j) = 0.0_rp
1704 k = iundef; i = iundef; j = iundef
1715 GSQRT, J13G, MAPF, &
1717 IIS, IIE, JJS, JJE )
1720 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1721 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1722 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1723 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1724 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1725 real(rp),
intent(in) :: j13g (
ka,
ia,
ja)
1726 real(rp),
intent(in) :: mapf (
ia,
ja,2)
1727 real(rp),
intent(in) :: cdz (
ka)
1728 logical,
intent(in) :: twod
1729 integer,
intent(in) :: iis, iie, jjs, jje
1749 * 0.25_rp * ( mom(
k+1,i,j)+mom(
k+1,i-1,j)+mom(
k+1,i,j+1)+mom(
k+1,i-1,j+1) ) &
1751 * 0.25_rp * ( mom(
k,i,j)+mom(
k,i-1,j)+mom(
k,i,j+1)+mom(
k,i-1,j+1) ) ) &
1753 * 0.5_rp * ( dens(
k+1,i,j)+dens(
k+1,i,j+1) ) &
1755 * 0.5_rp * ( dens(
k,i,j)+dens(
k,i,j+1) ) )
1756 vel = vel * j13g(
k,i,j)
1757 flux(
k,i,j) = vel / mapf(i,j,+2) &
1759 + 0.5_rp * phi(val(
k+1,i,j),val(
k,i,j),val(
k-1,i,j)) * ( val(
k,i,j)-val(
k-1,i,j) ) ) &
1760 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1762 + 0.5_rp * phi(val(
k,i,j),val(
k+1,i,j),val(
k+2,i,j)) * ( val(
k+1,i,j)-val(
k+2,i,j) ) ) &
1763 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1777 flux(
ks-1,i,j) = 0.0_rp
1780 * 0.25_rp * ( mom(
ks+1,i,j)+mom(
ks+1,i-1,j)+mom(
ks+1,i,j+1)+mom(
ks+1,i-1,j+1) ) &
1782 * 0.25_rp * ( mom(
ks,i,j)+mom(
ks,i-1,j)+mom(
ks,i,j+1)+mom(
ks,i-1,j+1) ) ) &
1784 * 0.5_rp * ( dens(
ks+1,i,j)+dens(
ks+1,i,j+1) ) &
1786 * 0.5_rp * ( dens(
ks,i,j)+dens(
ks,i,j+1) ) )
1787 vel = vel * j13g(
ks,i,j)
1788 flux(
ks,i,j) = vel / mapf(i,j,+2) &
1789 * ( f2 * ( val(
ks+1,i,j)+val(
ks,i,j) ) &
1790 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1792 + 0.5_rp * phi(val(
ks,i,j),val(
ks+1,i,j),val(
ks+2,i,j)) * ( val(
ks+1,i,j)-val(
ks+2,i,j) ) ) &
1793 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1796 * 0.25_rp * ( mom(
ke,i,j)+mom(
ke,i-1,j)+mom(
ke,i,j+1)+mom(
ke,i-1,j+1) ) &
1798 * 0.25_rp * ( mom(
ke-1,i,j)+mom(
ke-1,i-1,j)+mom(
ke-1,i,j+1)+mom(
ke-1,i-1,j+1) ) ) &
1800 * 0.5_rp * ( dens(
ke,i,j)+dens(
ke,i,j+1) ) &
1802 * 0.5_rp * ( dens(
ke-1,i,j)+dens(
ke-1,i,j+1) ) )
1803 vel = vel * j13g(
ke-1,i,j)
1804 flux(
ke-1,i,j) = vel / mapf(i,j,+2) &
1805 * ( ( val(
ke-1,i,j) &
1806 + 0.5_rp * phi(val(
ke-2,i,j),val(
ke-1,i,j),val(
ke,i,j)) * ( val(
ke-1,i,j)-val(
ke,i,j) ) ) &
1807 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1808 + f2 * ( val(
ke,i,j)+val(
ke-1,i,j) ) &
1809 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1811 flux(
ke ,i,j) = 0.0_rp
1830 GSQRT, J23G, MAPF, &
1832 IIS, IIE, JJS, JJE )
1835 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1836 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1837 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1838 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1839 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1840 real(rp),
intent(in) :: j23g (
ka,
ia,
ja)
1841 real(rp),
intent(in) :: mapf (
ia,
ja,2)
1842 real(rp),
intent(in) :: cdz (
ka)
1843 logical,
intent(in) :: twod
1844 integer,
intent(in) :: iis, iie, jjs, jje
1868 * 0.5_rp * ( dens(
k+1,i,j)+dens(
k+1,i,j+1) ) &
1870 * 0.5_rp * ( dens(
k,i,j)+dens(
k,i,j+1) ) )
1871 vel = vel * j23g(
k,i,j)
1872 flux(
k,i,j) = vel / mapf(i,j,+1) &
1874 + 0.5_rp * phi(val(
k+1,i,j),val(
k,i,j),val(
k-1,i,j)) * ( val(
k,i,j)-val(
k-1,i,j) ) ) &
1875 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1877 + 0.5_rp * phi(val(
k,i,j),val(
k+1,i,j),val(
k+2,i,j)) * ( val(
k+1,i,j)-val(
k+2,i,j) ) ) &
1878 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1892 flux(
ks-1,i,j) = 0.0_rp
1899 * 0.5_rp * ( dens(
ks+1,i,j)+dens(
ks+1,i,j+1) ) &
1901 * 0.5_rp * ( dens(
ks,i,j)+dens(
ks,i,j+1) ) )
1902 vel = vel * j23g(
ks,i,j)
1903 flux(
ks,i,j) = vel / mapf(i,j,+1) &
1904 * ( f2 * ( val(
ks+1,i,j)+val(
ks,i,j) ) &
1905 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1907 + 0.5_rp * phi(val(
ks,i,j),val(
ks+1,i,j),val(
ks+2,i,j)) * ( val(
ks+1,i,j)-val(
ks+2,i,j) ) ) &
1908 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1915 * 0.5_rp * ( dens(
ke,i,j)+dens(
ke,i,j+1) ) &
1917 * 0.5_rp * ( dens(
ke-1,i,j)+dens(
ke-1,i,j+1) ) )
1918 vel = vel * j23g(
ke-1,i,j)
1919 flux(
ke-1,i,j) = vel / mapf(i,j,+1) &
1920 * ( ( val(
ke-1,i,j) &
1921 + 0.5_rp * phi(val(
ke-2,i,j),val(
ke-1,i,j),val(
ke,i,j)) * ( val(
ke-1,i,j)-val(
ke,i,j) ) ) &
1922 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1923 + f2 * ( val(
ke,i,j)+val(
ke-1,i,j) ) &
1924 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1926 flux(
ke ,i,j) = 0.0_rp
1948 IIS, IIE, JJS, JJE )
1951 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1952 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1953 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1954 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1955 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1956 real(rp),
intent(in) :: mapf (
ia,
ja,2)
1957 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
1958 real(rp),
intent(in) :: cdz (
ka)
1959 logical,
intent(in) :: twod
1960 integer,
intent(in) :: iis, iie, jjs, jje
1976 call check( __line__, mom(
k,i ,j) )
1977 call check( __line__, mom(
k,i,j-1) )
1979 call check( __line__, val(
k,i,j) )
1980 call check( __line__, val(
k,i+1,j) )
1982 call check( __line__, val(
k,i-1,j) )
1983 call check( __line__, val(
k,i+2,j) )
1986 vel = ( 0.5_rp * ( mom(
k,i,j)+mom(
k,i,j+1) ) ) &
1987 / ( 0.25_rp * ( dens(
k,i,j)+dens(
k,i+1,j)+dens(
k,i,j+1)+dens(
k,i+1,j+1) ) )
1988 flux(
k,i,j) = gsqrt(
k,i,j) / mapf(i,j,+2) * vel &
1990 + 0.5_rp * phi(val(
k,i+1,j),val(
k,i,j),val(
k,i-1,j)) * ( val(
k,i,j)-val(
k,i-1,j) ) ) &
1991 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1993 + 0.5_rp * phi(val(
k,i,j),val(
k,i+1,j),val(
k,i+2,j)) * ( val(
k,i+1,j)-val(
k,i+2,j) ) ) &
1994 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1995 + gsqrt(
k,i,j) * num_diff(
k,i,j)
2001 k = iundef; i = iundef; j = iundef
2017 IIS, IIE, JJS, JJE )
2020 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
2021 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
2022 real(rp),
intent(in) :: val (
ka,
ia,
ja)
2023 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
2024 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
2025 real(rp),
intent(in) :: mapf (
ia,
ja,2)
2026 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
2027 real(rp),
intent(in) :: cdz (
ka)
2028 logical,
intent(in) :: twod
2029 integer,
intent(in) :: iis, iie, jjs, jje
2047 call check( __line__, mom(
k,i ,j) )
2048 call check( __line__, mom(
k,i,j-1) )
2050 call check( __line__, val(
k,i,j-1) )
2051 call check( __line__, val(
k,i,j) )
2053 call check( __line__, val(
k,i,j-2) )
2054 call check( __line__, val(
k,i,j+1) )
2057 vel = ( 0.5_rp * ( mom(
k,i,j)+mom(
k,i,j-1) ) ) &
2059 flux(
k,i,j-1) = gsqrt(
k,i,j) / mapf(i,j,+1) * vel &
2060 * ( ( val(
k,i,j-1) &
2061 + 0.5_rp * phi(val(
k,i,j),val(
k,i,j-1),val(
k,i,j-2)) * ( val(
k,i,j-1)-val(
k,i,j-2) ) ) &
2062 * ( 0.5_rp + sign(0.5_rp,vel) ) &
2064 + 0.5_rp * phi(val(
k,i,j-1),val(
k,i,j),val(
k,i,j+1)) * ( val(
k,i,j)-val(
k,i,j+1) ) ) &
2065 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
2066 + gsqrt(
k,i,j) * num_diff(
k,i,j)
2072 k = iundef; i = iundef; j = iundef
2086 function phi(v1, v2, v3)
2094 real(rp),
intent(in),
value :: v1
2095 real(rp),
intent(in),
value :: v2
2096 real(rp),
intent(in),
value :: v3
2098 real(rp),
intent(in) :: v1
2099 real(rp),
intent(in) :: v2
2100 real(rp),
intent(in) :: v3
2104 real(rp) :: zerosw1, zerosw2
2107 zerosw1 = eps - sign(eps, abs(v1-v2)-eps)
2108 zerosw2 = eps - sign(eps, abs(v2-v3)-eps)
2109 r2 = 2.0_rp * (v1-v2+zerosw1*zerosw2) / (v2-v3+zerosw2)
2111 phi = max(0.0_rp, min(r2, min((1.0_rp+r2)/3.0_rp, 2.0_rp) ) )