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
105 real(rp),
intent(out) :: valw (
ka)
106 real(rp),
intent(in) :: mflx (
ka)
107 real(rp),
intent(in) :: val (
ka)
108 real(rp),
intent(in) :: gsqrt(
ka)
109 real(rp),
intent(in) :: cdz (
ka)
116 call check( __line__, mflx(
k) )
118 call check( __line__, val(
k) )
119 call check( __line__, val(
k+1) )
121 call check( __line__, val(
k-1) )
122 call check( __line__, val(
k+2) )
126 + 0.5_rp * phi(val(
k+1),val(
k),val(
k-1)) * ( val(
k)-val(
k-1) ) ) &
127 * ( 0.5_rp + sign(0.5_rp,mflx(
k)) ) &
129 + 0.5_rp * phi(val(
k),val(
k+1),val(
k+2)) * ( val(
k+1)-val(
k+2) ) ) &
130 * ( 0.5_rp - sign(0.5_rp,mflx(
k)) )
138 call check( __line__, mflx(
ks) )
139 call check( __line__, val(
ks ) )
140 call check( __line__, val(
ks+1) )
141 call check( __line__, mflx(
ke-1) )
142 call check( __line__, val(
ke ) )
143 call check( __line__, val(
ke-1) )
148 * ( 0.5_rp + sign(0.5_rp,mflx(
ks)) ) &
150 + 0.5_rp * phi(val(
ks),val(
ks+1),val(
ks+2)) * ( val(
ks+1)-val(
ks+2) ) ) &
151 * ( 0.5_rp - sign(0.5_rp,mflx(
ks)) )
152 valw(
ke-1) = ( val(
ke-1) &
153 + 0.5_rp * phi(val(
ke-2),val(
ke-1),val(
ke)) * ( val(
ke-1)-val(
ke) ) ) &
154 * ( 0.5_rp + sign(0.5_rp,mflx(
ke-1)) ) &
156 * ( 0.5_rp - sign(0.5_rp,mflx(
ke-1)) )
174 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
175 real(rp),
intent(in) :: mflx (
ka,
ia,
ja)
176 real(rp),
intent(in) :: val (
ka,
ia,
ja)
177 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
178 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
179 real(rp),
intent(in) :: cdz (
ka)
180 integer,
intent(in) :: iis, iie, jjs, jje
194 call check( __line__, mflx(
k,i,j) )
196 call check( __line__, val(
k,i,j) )
197 call check( __line__, val(
k+1,i,j) )
199 call check( __line__, val(
k-1,i,j) )
200 call check( __line__, val(
k+2,i,j) )
206 + 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) ) ) &
207 * ( 0.5_rp + sign(0.5_rp,vel) ) &
209 + 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) ) ) &
210 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
211 + gsqrt(
k,i,j) * num_diff(
k,i,j)
217 k = iundef; i = iundef; j = iundef
225 call check( __line__, mflx(
ks,i,j) )
226 call check( __line__, val(
ks ,i,j) )
227 call check( __line__, val(
ks+1,i,j) )
228 call check( __line__, mflx(
ke-1,i,j) )
229 call check( __line__, val(
ke ,i,j) )
230 call check( __line__, val(
ke-1,i,j) )
233 flux(
ks-1,i,j) = 0.0_rp
238 * ( 0.5_rp + sign(0.5_rp,vel) ) &
240 + 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) ) ) &
241 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
242 + gsqrt(
ks,i,j) * num_diff(
ks,i,j)
244 flux(
ke-1,i,j) = vel &
245 * ( ( val(
ke-1,i,j) &
246 + 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) ) ) &
247 * ( 0.5_rp + sign(0.5_rp,vel) ) &
249 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
250 + gsqrt(
ke-1,i,j) * num_diff(
ke-1,i,j)
252 flux(
ke ,i,j) = 0.0_rp
259 k = iundef; i = iundef; j = iundef
275 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
276 real(rp),
intent(in) :: mflx (
ka,
ia,
ja)
277 real(rp),
intent(in) :: val (
ka,
ia,
ja)
278 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
279 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
280 real(rp),
intent(in) :: cdz(
ka)
281 integer,
intent(in) :: iis, iie, jjs, jje
294 call check( __line__, mflx(
k,i,j) )
296 call check( __line__, val(
k,i,j) )
297 call check( __line__, val(
k,i+1,j) )
299 call check( __line__, val(
k,i-1,j) )
300 call check( __line__, val(
k,i+2,j) )
306 + 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) ) ) &
307 * ( 0.5_rp + sign(0.5_rp,vel) ) &
309 + 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) ) ) &
310 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
311 + gsqrt(
k,i,j) * num_diff(
k,i,j)
316 k = iundef; i = iundef; j = iundef
332 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
333 real(rp),
intent(in) :: mflx (
ka,
ia,
ja)
334 real(rp),
intent(in) :: val (
ka,
ia,
ja)
335 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
336 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
337 real(rp),
intent(in) :: cdz(
ka)
338 integer,
intent(in) :: iis, iie, jjs, jje
351 call check( __line__, mflx(
k,i,j) )
353 call check( __line__, val(
k,i,j) )
354 call check( __line__, val(
k,i,j+1) )
356 call check( __line__, val(
k,i,j-1) )
357 call check( __line__, val(
k,i,j+2) )
363 + 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) ) ) &
364 * ( 0.5_rp + sign(0.5_rp,vel) ) &
366 + 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) ) ) &
367 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
368 + gsqrt(
k,i,j) * num_diff(
k,i,j)
373 k = iundef; i = iundef; j = iundef
392 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
393 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
394 real(rp),
intent(in) :: val (
ka,
ia,
ja)
395 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
396 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
397 real(rp),
intent(in) :: j33g
398 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
399 real(rp),
intent(in) :: cdz (
ka)
400 real(rp),
intent(in) :: fdz (
ka-1)
401 real(rp),
intent(in) :: dtrk
402 integer,
intent(in) :: iis, iie, jjs, jje
418 call check( __line__, mom(
k-1,i,j) )
419 call check( __line__, mom(
k ,i,j) )
421 call check( __line__, val(
k-1,i,j) )
422 call check( __line__, val(
k,i,j) )
424 call check( __line__, val(
k-2,i,j) )
425 call check( __line__, val(
k+1,i,j) )
428 vel = ( 0.5_rp * ( mom(
k-1,i,j) &
431 flux(
k-1,i,j) = j33g * vel &
433 + 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) ) ) &
434 * ( 0.5_rp + sign(0.5_rp,vel) ) &
436 + 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) ) ) &
437 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
438 + gsqrt(
k,i,j) * num_diff(
k,i,j)
444 k = iundef; i = iundef; j = iundef
452 call check( __line__, val(
ks,i,j) )
453 call check( __line__, val(
ks+1,i,j) )
454 call check( __line__, val(
ks+2,i,j) )
461 flux(
ks-1,i,j) = 0.0_rp
463 vel = ( 0.5_rp * ( mom(
ks,i,j) &
464 + mom(
ks+1,i,j) ) ) &
466 flux(
ks,i,j) = j33g * vel &
468 * ( 0.5_rp + sign(0.5_rp,vel) ) &
470 + 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) ) ) &
471 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
472 + gsqrt(
ks+1,i,j) * num_diff(
ks+1,i,j)
476 flux(
ke-1,i,j) = 0.0_rp
477 flux(
ke ,i,j) = 0.0_rp
498 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
499 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
500 real(rp),
intent(in) :: val (
ka,
ia,
ja)
501 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
502 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
503 real(rp),
intent(in) :: j13g (
ka,
ia,
ja)
504 real(rp),
intent(in) :: mapf (
ia,
ja,2)
505 real(rp),
intent(in) :: cdz (
ka)
506 logical,
intent(in) :: twod
507 integer,
intent(in) :: iis, iie, jjs, jje
520 vel = ( 0.5_rp * ( mom(
k,i,j)+mom(
k,i-1,j) ) ) &
522 vel = vel * j13g(
k,i,j)
523 flux(
k-1,i,j) = vel / mapf(i,j,+2) &
525 + 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) ) ) &
526 * ( 0.5_rp + sign(0.5_rp,vel) ) &
528 + 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) ) ) &
529 * ( 0.5_rp - sign(0.5_rp,vel) ) )
541 flux(
ks-1,i,j) = 0.0_rp
544 vel = ( ( 0.5_rp * ( mom(
ks+1,i,j)+mom(
ks+1,i-1,j) ) ) / dens(
ks+1,i,j) &
545 + ( 0.5_rp * ( mom(
ks,i,j)+mom(
ks,i-1,j) ) ) / dens(
ks ,i,j) ) * 0.5_rp
548 vel = vel * j13g(
ks+1,i,j)
549 flux(
ks,i,j) = vel / mapf(i,j,+2) &
551 * ( 0.5_rp + sign(0.5_rp,vel) ) &
553 + 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) ) ) &
554 * ( 0.5_rp - sign(0.5_rp,vel) ) )
557 flux(
ke-1,i,j) = 0.0_rp
577 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
578 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
579 real(rp),
intent(in) :: val (
ka,
ia,
ja)
580 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
581 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
582 real(rp),
intent(in) :: j23g (
ka,
ia,
ja)
583 real(rp),
intent(in) :: mapf (
ia,
ja,2)
584 real(rp),
intent(in) :: cdz (
ka)
585 logical,
intent(in) :: twod
586 integer,
intent(in) :: iis, iie, jjs, jje
599 vel = ( 0.5_rp * ( mom(
k,i,j)+mom(
k,i,j-1) ) ) &
601 vel = vel * j23g(
k,i,j)
602 flux(
k-1,i,j) = vel / mapf(i,j,+1) &
604 + 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) ) ) &
605 * ( 0.5_rp + sign(0.5_rp,vel) ) &
607 + 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) ) ) &
608 * ( 0.5_rp - sign(0.5_rp,vel) ) )
620 flux(
ks-1,i,j) = 0.0_rp
623 vel = ( ( 0.5_rp * ( mom(
ks+1,i,j)+mom(
ks+1,i,j-1) ) ) / dens(
ks+1,i,j) &
624 + ( 0.5_rp * ( mom(
ks,i,j)+mom(
ks,i,j-1) ) ) / dens(
ks ,i,j) ) * 0.5_rp
627 vel = vel * j23g(
ks+1,i,j)
628 flux(
ks,i,j) = vel / mapf(i,j,+1) &
630 * ( 0.5_rp + sign(0.5_rp,vel) ) &
632 + 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) ) ) &
633 * ( 0.5_rp - sign(0.5_rp,vel) ) )
636 flux(
ke-1,i,j) = 0.0_rp
658 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
659 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
660 real(rp),
intent(in) :: val (
ka,
ia,
ja)
661 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
662 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
663 real(rp),
intent(in) :: mapf (
ia,
ja,2)
664 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
665 real(rp),
intent(in) :: cdz (
ka)
666 logical,
intent(in) :: twod
667 integer,
intent(in) :: iis, iie, jjs, jje
682 call check( __line__, mom(
k ,i,j) )
683 call check( __line__, mom(
k+1,i,j) )
685 call check( __line__, val(
k,i,j) )
686 call check( __line__, val(
k,i+1,j) )
688 call check( __line__, val(
k,i-1,j) )
689 call check( __line__, val(
k,i+2,j) )
697 * 0.5_rp * ( dens(
k+1,i,j)+dens(
k+1,i+1,j) ) &
699 * 0.5_rp * ( dens(
k,i,j)+dens(
k,i+1,j) ) )
700 flux(
k,i,j) = gsqrt(
k,i,j) / mapf(i,j,+2) * vel &
702 + 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) ) ) &
703 * ( 0.5_rp + sign(0.5_rp,vel) ) &
705 + 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) ) ) &
706 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
707 + gsqrt(
k,i,j) * num_diff(
k,i,j)
713 k = iundef; i = iundef; j = iundef
719 flux(
ke,i,j) = 0.0_rp
726 k = iundef; i = iundef; j = iundef
743 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
744 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
745 real(rp),
intent(in) :: val (
ka,
ia,
ja)
746 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
747 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
748 real(rp),
intent(in) :: mapf (
ia,
ja,2)
749 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
750 real(rp),
intent(in) :: cdz (
ka)
751 logical,
intent(in) :: twod
752 integer,
intent(in) :: iis, iie, jjs, jje
767 call check( __line__, mom(
k ,i,j) )
768 call check( __line__, mom(
k+1,i,j) )
770 call check( __line__, val(
k,i,j) )
771 call check( __line__, val(
k,i,j+1) )
773 call check( __line__, val(
k,i,j-1) )
774 call check( __line__, val(
k,i,j+2) )
782 * 0.5_rp * ( dens(
k+1,i,j)+dens(
k+1,i,j+1) ) &
784 * 0.5_rp * ( dens(
k,i,j)+dens(
k,i,j+1) ) )
785 flux(
k,i,j) = gsqrt(
k,i,j) / mapf(i,j,+1) * vel &
787 + 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) ) ) &
788 * ( 0.5_rp + sign(0.5_rp,vel) ) &
790 + 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) ) ) &
791 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
792 + gsqrt(
k,i,j) * num_diff(
k,i,j)
798 k = iundef; i = iundef; j = iundef
804 flux(
ke,i,j) = 0.0_rp
811 k = iundef; i = iundef; j = iundef
829 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
830 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
831 real(rp),
intent(in) :: val (
ka,
ia,
ja)
832 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
833 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
834 real(rp),
intent(in) :: j33g
835 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
836 real(rp),
intent(in) :: cdz (
ka)
837 logical,
intent(in) :: twod
838 integer,
intent(in) :: iis, iie, jjs, jje
855 call check( __line__, mom(
k,i,j) )
857 call check( __line__, val(
k,i,j) )
858 call check( __line__, val(
k+1,i,j) )
860 call check( __line__, val(
k-1,i,j) )
861 call check( __line__, val(
k+2,i,j) )
865 vel = ( mom(
k,i,j) ) &
870 flux(
k,i,j) = j33g * vel &
872 + 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) ) ) &
873 * ( 0.5_rp + sign(0.5_rp,vel) ) &
875 + 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) ) ) &
876 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
877 + gsqrt(
k,i,j) * num_diff(
k,i,j)
882 k = iundef; i = iundef; j = iundef
889 call check( __line__, mom(
ks,i ,j) )
890 call check( __line__, val(
ks+1,i,j) )
891 call check( __line__, val(
ks,i,j) )
898 flux(
ks-1,i,j) = 0.0_rp
900 vel = ( mom(
ks,i,j) ) &
905 flux(
ks,i,j) = j33g * vel &
907 * ( 0.5_rp + sign(0.5_rp,vel) ) &
909 + 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) ) ) &
910 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
911 + gsqrt(
ks,i,j) * num_diff(
ks,i,j)
912 vel = ( mom(
ke-1,i,j) ) &
917 flux(
ke-1,i,j) = j33g * vel &
918 * ( ( val(
ke-1,i,j) &
919 + 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) ) ) &
920 * ( 0.5_rp + sign(0.5_rp,vel) ) &
922 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
923 + gsqrt(
ke-1,i,j) * num_diff(
ke-1,i,j)
925 flux(
ke,i,j) = 0.0_rp
937 call check( __line__, mom(
k,i,j) )
938 call check( __line__, mom(
k,i+1,j) )
940 call check( __line__, val(
k,i,j) )
941 call check( __line__, val(
k+1,i,j) )
943 call check( __line__, val(
k-1,i,j) )
944 call check( __line__, val(
k+2,i,j) )
947 vel = ( 0.5_rp * ( mom(
k,i,j)+mom(
k,i+1,j) ) ) &
949 * 0.5_rp * ( dens(
k+1,i,j)+dens(
k+1,i+1,j) ) &
951 * 0.5_rp * ( dens(
k,i,j)+dens(
k,i+1,j) ) )
952 flux(
k,i,j) = j33g * vel &
954 + 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) ) ) &
955 * ( 0.5_rp + sign(0.5_rp,vel) ) &
957 + 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) ) ) &
958 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
959 + gsqrt(
k,i,j) * num_diff(
k,i,j)
965 k = iundef; i = iundef; j = iundef
973 call check( __line__, mom(
ks,i ,j) )
974 call check( __line__, mom(
ks,i+1,j) )
975 call check( __line__, val(
ks+1,i,j) )
976 call check( __line__, val(
ks,i,j) )
982 flux(
ks-1,i,j) = 0.0_rp
984 vel = ( 0.5_rp * ( mom(
ks,i,j)+mom(
ks,i+1,j) ) ) &
986 * 0.5_rp * ( dens(
ks+1,i,j)+dens(
ks+1,i+1,j) ) &
988 * 0.5_rp * ( dens(
ks,i,j)+dens(
ks,i+1,j) ) )
989 flux(
ks,i,j) = j33g * vel &
991 * ( 0.5_rp + sign(0.5_rp,vel) ) &
993 + 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) ) ) &
994 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
995 + gsqrt(
ks,i,j) * num_diff(
ks,i,j)
996 vel = ( 0.5_rp * ( mom(
ke-1,i,j)+mom(
ke-1,i+1,j) ) ) &
998 * 0.5_rp * ( dens(
ke,i,j)+dens(
ke,i+1,j) ) &
1000 * 0.5_rp * ( dens(
ke-1,i,j)+dens(
ke-1,i+1,j) ) )
1001 flux(
ke-1,i,j) = j33g * vel &
1002 * ( ( val(
ke-1,i,j) &
1003 + 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) ) ) &
1004 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1006 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1007 + gsqrt(
ke-1,i,j) * num_diff(
ke-1,i,j)
1009 flux(
ke,i,j) = 0.0_rp
1019 k = iundef; i = iundef; j = iundef
1030 GSQRT, J13G, MAPF, &
1032 IIS, IIE, JJS, JJE )
1035 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1036 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1037 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1038 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1039 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1040 real(rp),
intent(in) :: j13g (
ka,
ia,
ja)
1041 real(rp),
intent(in) :: mapf (
ia,
ja,2)
1042 real(rp),
intent(in) :: cdz (
ka)
1043 logical,
intent(in) :: twod
1044 integer,
intent(in) :: iis, iie, jjs, jje
1065 * 0.5_rp * ( dens(
k+1,i,j)+dens(
k+1,i+1,j) ) &
1067 * 0.5_rp * ( dens(
k,i,j)+dens(
k,i+1,j) ) )
1068 vel = vel * j13g(
k,i,j)
1069 flux(
k,i,j) = vel / mapf(i,j,+2) &
1071 + 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) ) ) &
1072 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1074 + 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) ) ) &
1075 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1087 flux(
ks-1,i,j) = 0.0_rp
1094 * 0.5_rp * ( dens(
ks+1,i,j)+dens(
ks+1,i+1,j) ) &
1096 * 0.5_rp * ( dens(
ks,i,j)+dens(
ks,i+1,j) ) )
1097 vel = vel * j13g(
ks,i,j)
1098 flux(
ks,i,j) = vel / mapf(i,j,+2) &
1100 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1102 + 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) ) ) &
1103 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1110 * 0.5_rp * ( dens(
ke,i,j)+dens(
ke,i+1,j) ) &
1112 * 0.5_rp * ( dens(
ke-1,i,j)+dens(
ke-1,i+1,j) ) )
1113 vel = vel * j13g(
ke-1,i,j)
1114 flux(
ke-1,i,j) = vel / mapf(i,j,+2) &
1115 * ( ( val(
ke-1,i,j) &
1116 + 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) ) ) &
1117 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1119 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1121 flux(
ke ,i,j) = 0.0_rp
1137 GSQRT, J23G, MAPF, &
1139 IIS, IIE, JJS, JJE )
1142 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1143 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1144 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1145 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1146 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1147 real(rp),
intent(in) :: j23g (
ka,
ia,
ja)
1148 real(rp),
intent(in) :: mapf (
ia,
ja,2)
1149 real(rp),
intent(in) :: cdz (
ka)
1150 logical,
intent(in) :: twod
1151 integer,
intent(in) :: iis, iie, jjs, jje
1169 * 0.5_rp * ( mom(
k+1,i,j)+mom(
k+1,i,j-1) ) &
1171 * 0.5_rp * ( mom(
k,i,j)+mom(
k,i,j-1) ) ) &
1176 vel = vel * j23g(
k,i,j)
1177 flux(
k,i,j) = vel * ( ( val(
k,i,j) &
1178 + 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) ) ) &
1179 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1181 + 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) ) ) &
1182 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1193 flux(
ks-1,i,j) = 0.0_rp
1196 * 0.5_rp * ( mom(
ks+1,i,j)+mom(
ks+1,i,j-1) ) &
1198 * 0.5_rp * ( mom(
ks,i,j)+mom(
ks,i,j-1) ) ) &
1203 vel = vel * j23g(
ks,i,j)
1204 flux(
ks,i,j) = vel / mapf(i,j,+1) &
1206 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1208 + 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) ) ) &
1209 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1212 * 0.5_rp * ( mom(
ke,i,j)+mom(
ke,i,j-1) ) &
1214 * 0.5_rp * ( mom(
ke-1,i,j)+mom(
ke-1,i,j-1) ) ) &
1219 vel = vel * j23g(
ke-1,i,j)
1220 flux(
ke-1,i,j) = vel / mapf(i,j,+1) &
1221 * ( ( val(
ke-1,i,j) &
1222 + 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) ) ) &
1223 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1225 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1227 flux(
ke ,i,j) = 0.0_rp
1239 * 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) ) &
1241 * 0.25_rp * ( mom(
k,i,j)+mom(
k,i+1,j)+mom(
k,i,j-1)+mom(
k,i+1,j-1) ) ) &
1243 * 0.5_rp * ( dens(
k+1,i,j)+dens(
k+1,i+1,j) ) &
1245 * 0.5_rp * ( dens(
k,i,j)+dens(
k,i+1,j) ) )
1246 vel = vel * j23g(
k,i,j)
1247 flux(
k,i,j) = vel / mapf(i,j,+1) &
1249 + 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) ) ) &
1250 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1252 + 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) ) ) &
1253 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1265 flux(
ks-1,i,j) = 0.0_rp
1268 * 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) ) &
1270 * 0.25_rp * ( mom(
ks,i,j)+mom(
ks,i+1,j)+mom(
ks,i,j-1)+mom(
ks,i+1,j-1) ) ) &
1272 * 0.5_rp * ( dens(
ks+1,i,j)+dens(
ks+1,i+1,j) ) &
1274 * 0.5_rp * ( dens(
ks,i,j)+dens(
ks,i+1,j) ) )
1275 vel = vel * j23g(
ks,i,j)
1276 flux(
ks,i,j) = vel / mapf(i,j,+1) &
1278 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1280 + 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) ) ) &
1281 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1284 * 0.25_rp * ( mom(
ke,i,j)+mom(
ke,i+1,j)+mom(
ke,i,j-1)+mom(
ke,i+1,j-1) ) &
1286 * 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) ) ) &
1288 * 0.5_rp * ( dens(
ke,i,j)+dens(
ke,i+1,j) ) &
1290 * 0.5_rp * ( dens(
ke-1,i,j)+dens(
ke-1,i+1,j) ) )
1291 vel = vel * j23g(
ke-1,i,j)
1292 flux(
ke-1,i,j) = vel / mapf(i,j,+1) &
1293 * ( ( val(
ke-1,i,j) &
1294 + 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) ) ) &
1295 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1297 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1299 flux(
ke ,i,j) = 0.0_rp
1320 IIS, IIE, JJS, JJE )
1323 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1324 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1325 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1326 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1327 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1328 real(rp),
intent(in) :: mapf (
ia,
ja,2)
1329 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
1330 real(rp),
intent(in) :: cdz (
ka)
1331 logical,
intent(in) :: twod
1332 integer,
intent(in) :: iis, iie, jjs, jje
1349 call check( __line__, mom(
k,i ,j) )
1350 call check( __line__, mom(
k,i-1,j) )
1352 call check( __line__, val(
k,i-1,j) )
1353 call check( __line__, val(
k,i,j) )
1355 call check( __line__, val(
k,i-2,j) )
1356 call check( __line__, val(
k,i+1,j) )
1359 vel = ( 0.5_rp * ( mom(
k,i,j)+mom(
k,i-1,j) ) ) &
1361 flux(
k,i-1,j) = gsqrt(
k,i,j) / mapf(i,j,+2) * vel &
1362 * ( ( val(
k,i-1,j) &
1363 + 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) ) ) &
1364 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1366 + 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) ) ) &
1367 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1368 + gsqrt(
k,i,j) * num_diff(
k,i,j)
1373 k = iundef; i = iundef; j = iundef
1389 IIS, IIE, JJS, JJE )
1392 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1393 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1394 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1395 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1396 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1397 real(rp),
intent(in) :: mapf (
ia,
ja,2)
1398 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
1399 real(rp),
intent(in) :: cdz (
ka)
1400 logical,
intent(in) :: twod
1401 integer,
intent(in) :: iis, iie, jjs, jje
1418 call check( __line__, mom(
k,i ,j) )
1420 call check( __line__, val(
k,i,j) )
1421 call check( __line__, val(
k,i,j+1) )
1423 call check( __line__, val(
k,i,j-1) )
1424 call check( __line__, val(
k,i,j+2) )
1427 vel = ( mom(
k,i,j) ) &
1428 / ( 0.5_rp * ( dens(
k,i,j)+dens(
k,i,j+1) ) )
1429 flux(
k,i,j) = gsqrt(
k,i,j) / mapf(i,j,+1) * vel &
1431 + 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) ) ) &
1432 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1434 + 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) ) ) &
1435 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1436 + gsqrt(
k,i,j) * num_diff(
k,i,j)
1440 k = iundef; i = iundef; j = iundef
1453 call check( __line__, mom(
k,i ,j) )
1454 call check( __line__, mom(
k,i-1,j) )
1456 call check( __line__, val(
k,i,j) )
1457 call check( __line__, val(
k,i,j+1) )
1459 call check( __line__, val(
k,i,j-1) )
1460 call check( __line__, val(
k,i,j+2) )
1463 vel = ( 0.5_rp * ( mom(
k,i,j)+mom(
k,i+1,j) ) ) &
1464 / ( 0.25_rp * ( dens(
k,i,j)+dens(
k,i+1,j)+dens(
k,i,j+1)+dens(
k,i+1,j+1) ) )
1465 flux(
k,i,j) = gsqrt(
k,i,j) / mapf(i,j,+1) * vel &
1467 + 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) ) ) &
1468 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1470 + 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) ) ) &
1471 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1472 + gsqrt(
k,i,j) * num_diff(
k,i,j)
1477 k = iundef; i = iundef; j = iundef
1497 IIS, IIE, JJS, JJE )
1500 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1501 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1502 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1503 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1504 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1505 real(rp),
intent(in) :: j33g
1506 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
1507 real(rp),
intent(in) :: cdz (
ka)
1508 logical,
intent(in) :: twod
1509 integer,
intent(in) :: iis, iie, jjs, jje
1525 call check( __line__, mom(
k,i,j) )
1526 call check( __line__, mom(
k,i,j+1) )
1528 call check( __line__, val(
k,i,j) )
1529 call check( __line__, val(
k+1,i,j) )
1531 call check( __line__, val(
k-1,i,j) )
1532 call check( __line__, val(
k+2,i,j) )
1535 vel = ( 0.5_rp * ( mom(
k,i,j)+mom(
k,i,j+1) ) ) &
1537 * 0.5_rp * ( dens(
k+1,i,j)+dens(
k+1,i,j+1) ) &
1539 * 0.5_rp * ( dens(
k,i,j)+dens(
k,i,j+1) ) )
1540 flux(
k,i,j) = j33g * vel &
1542 + 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) ) ) &
1543 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1545 + 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) ) ) &
1546 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1547 + gsqrt(
k,i,j) * num_diff(
k,i,j)
1553 k = iundef; i = iundef; j = iundef
1561 call check( __line__, mom(
ks,i ,j) )
1562 call check( __line__, mom(
ks,i,j+1) )
1563 call check( __line__, val(
ks+1,i,j) )
1564 call check( __line__, val(
ks,i,j) )
1570 flux(
ks-1,i,j) = 0.0_rp
1572 vel = ( 0.5_rp * ( mom(
ks,i,j)+mom(
ks,i,j+1) ) ) &
1574 * 0.5_rp * ( dens(
ks+1,i,j)+dens(
ks+1,i,j+1) ) &
1576 * 0.5_rp * ( dens(
ks,i,j)+dens(
ks,i,j+1) ) )
1577 flux(
ks,i,j) = j33g * vel &
1579 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1581 + 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) ) ) &
1582 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1583 + gsqrt(
ks,i,j) * num_diff(
ks,i,j)
1584 vel = ( 0.5_rp * ( mom(
ke-1,i,j)+mom(
ke-1,i,j+1) ) ) &
1586 * 0.5_rp * ( dens(
ke,i,j)+dens(
ke,i,j+1) ) &
1588 * 0.5_rp * ( dens(
ke-1,i,j)+dens(
ke-1,i,j+1) ) )
1589 flux(
ke-1,i,j) = j33g * vel &
1590 * ( ( val(
ke-1,i,j) &
1591 + 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) ) ) &
1592 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1594 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1595 + gsqrt(
ke-1,i,j) * num_diff(
ke-1,i,j)
1597 flux(
ke,i,j) = 0.0_rp
1605 k = iundef; i = iundef; j = iundef
1616 GSQRT, J13G, MAPF, &
1618 IIS, IIE, JJS, JJE )
1621 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1622 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1623 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1624 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1625 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1626 real(rp),
intent(in) :: j13g (
ka,
ia,
ja)
1627 real(rp),
intent(in) :: mapf (
ia,
ja,2)
1628 real(rp),
intent(in) :: cdz (
ka)
1629 logical,
intent(in) :: twod
1630 integer,
intent(in) :: iis, iie, jjs, jje
1647 * 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) ) &
1649 * 0.25_rp * ( mom(
k,i,j)+mom(
k,i-1,j)+mom(
k,i,j+1)+mom(
k,i-1,j+1) ) ) &
1651 * 0.5_rp * ( dens(
k+1,i,j)+dens(
k+1,i,j+1) ) &
1653 * 0.5_rp * ( dens(
k,i,j)+dens(
k,i,j+1) ) )
1654 vel = vel * j13g(
k,i,j)
1655 flux(
k,i,j) = vel / mapf(i,j,+2) &
1657 + 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) ) ) &
1658 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1660 + 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) ) ) &
1661 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1673 flux(
ks-1,i,j) = 0.0_rp
1676 * 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) ) &
1678 * 0.25_rp * ( mom(
ks,i,j)+mom(
ks,i-1,j)+mom(
ks,i,j+1)+mom(
ks,i-1,j+1) ) ) &
1680 * 0.5_rp * ( dens(
ks+1,i,j)+dens(
ks+1,i,j+1) ) &
1682 * 0.5_rp * ( dens(
ks,i,j)+dens(
ks,i,j+1) ) )
1683 vel = vel * j13g(
ks,i,j)
1684 flux(
ks,i,j) = vel / mapf(i,j,+2) &
1686 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1688 + 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) ) ) &
1689 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1692 * 0.25_rp * ( mom(
ke,i,j)+mom(
ke,i-1,j)+mom(
ke,i,j+1)+mom(
ke,i-1,j+1) ) &
1694 * 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) ) ) &
1696 * 0.5_rp * ( dens(
ke,i,j)+dens(
ke,i,j+1) ) &
1698 * 0.5_rp * ( dens(
ke-1,i,j)+dens(
ke-1,i,j+1) ) )
1699 vel = vel * j13g(
ke-1,i,j)
1700 flux(
ke-1,i,j) = vel / mapf(i,j,+2) &
1701 * ( ( val(
ke-1,i,j) &
1702 + 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) ) ) &
1703 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1705 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1707 flux(
ke ,i,j) = 0.0_rp
1723 GSQRT, J23G, MAPF, &
1725 IIS, IIE, JJS, JJE )
1728 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1729 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1730 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1731 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1732 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1733 real(rp),
intent(in) :: j23g (
ka,
ia,
ja)
1734 real(rp),
intent(in) :: mapf (
ia,
ja,2)
1735 real(rp),
intent(in) :: cdz (
ka)
1736 logical,
intent(in) :: twod
1737 integer,
intent(in) :: iis, iie, jjs, jje
1758 * 0.5_rp * ( dens(
k+1,i,j)+dens(
k+1,i,j+1) ) &
1760 * 0.5_rp * ( dens(
k,i,j)+dens(
k,i,j+1) ) )
1761 vel = vel * j23g(
k,i,j)
1762 flux(
k,i,j) = vel / mapf(i,j,+1) &
1764 + 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) ) ) &
1765 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1767 + 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) ) ) &
1768 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1780 flux(
ks-1,i,j) = 0.0_rp
1787 * 0.5_rp * ( dens(
ks+1,i,j)+dens(
ks+1,i,j+1) ) &
1789 * 0.5_rp * ( dens(
ks,i,j)+dens(
ks,i,j+1) ) )
1790 vel = vel * j23g(
ks,i,j)
1791 flux(
ks,i,j) = vel / mapf(i,j,+1) &
1793 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1795 + 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) ) ) &
1796 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1803 * 0.5_rp * ( dens(
ke,i,j)+dens(
ke,i,j+1) ) &
1805 * 0.5_rp * ( dens(
ke-1,i,j)+dens(
ke-1,i,j+1) ) )
1806 vel = vel * j23g(
ke-1,i,j)
1807 flux(
ke-1,i,j) = vel / mapf(i,j,+1) &
1808 * ( ( val(
ke-1,i,j) &
1809 + 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) ) ) &
1810 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1812 * ( 0.5_rp - sign(0.5_rp,vel) ) )
1814 flux(
ke ,i,j) = 0.0_rp
1833 IIS, IIE, JJS, JJE )
1836 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1837 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1838 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1839 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1840 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1841 real(rp),
intent(in) :: mapf (
ia,
ja,2)
1842 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
1843 real(rp),
intent(in) :: cdz (
ka)
1844 logical,
intent(in) :: twod
1845 integer,
intent(in) :: iis, iie, jjs, jje
1860 call check( __line__, mom(
k,i ,j) )
1861 call check( __line__, mom(
k,i,j-1) )
1863 call check( __line__, val(
k,i,j) )
1864 call check( __line__, val(
k,i+1,j) )
1866 call check( __line__, val(
k,i-1,j) )
1867 call check( __line__, val(
k,i+2,j) )
1870 vel = ( 0.5_rp * ( mom(
k,i,j)+mom(
k,i,j+1) ) ) &
1871 / ( 0.25_rp * ( dens(
k,i,j)+dens(
k,i+1,j)+dens(
k,i,j+1)+dens(
k,i+1,j+1) ) )
1872 flux(
k,i,j) = gsqrt(
k,i,j) / mapf(i,j,+2) * vel &
1874 + 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) ) ) &
1875 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1877 + 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) ) ) &
1878 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1879 + gsqrt(
k,i,j) * num_diff(
k,i,j)
1884 k = iundef; i = iundef; j = iundef
1900 IIS, IIE, JJS, JJE )
1903 real(rp),
intent(inout) :: flux (
ka,
ia,
ja)
1904 real(rp),
intent(in) :: mom (
ka,
ia,
ja)
1905 real(rp),
intent(in) :: val (
ka,
ia,
ja)
1906 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
1907 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja)
1908 real(rp),
intent(in) :: mapf (
ia,
ja,2)
1909 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja)
1910 real(rp),
intent(in) :: cdz (
ka)
1911 logical,
intent(in) :: twod
1912 integer,
intent(in) :: iis, iie, jjs, jje
1929 call check( __line__, mom(
k,i ,j) )
1930 call check( __line__, mom(
k,i,j-1) )
1932 call check( __line__, val(
k,i,j-1) )
1933 call check( __line__, val(
k,i,j) )
1935 call check( __line__, val(
k,i,j-2) )
1936 call check( __line__, val(
k,i,j+1) )
1939 vel = ( 0.5_rp * ( mom(
k,i,j)+mom(
k,i,j-1) ) ) &
1941 flux(
k,i,j-1) = gsqrt(
k,i,j) / mapf(i,j,+1) * vel &
1942 * ( ( val(
k,i,j-1) &
1943 + 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) ) ) &
1944 * ( 0.5_rp + sign(0.5_rp,vel) ) &
1946 + 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) ) ) &
1947 * ( 0.5_rp - sign(0.5_rp,vel) ) ) &
1948 + gsqrt(
k,i,j) * num_diff(
k,i,j)
1953 k = iundef; i = iundef; j = iundef
1967 function phi(v1, v2, v3)
1973 real(rp),
intent(in) :: v1
1974 real(rp),
intent(in) :: v2
1975 real(rp),
intent(in) :: v3
1978 real(rp) :: zerosw1, zerosw2
1981 zerosw1 = eps - sign(eps, abs(v1-v2)-eps)
1982 zerosw2 = eps - sign(eps, abs(v2-v3)-eps)
1983 r2 = 2.0_rp * (v1-v2+zerosw1*zerosw2) / (v2-v3+zerosw2)
1985 phi = max(0.0_rp, min(r2, min((1.0_rp+r2)/3.0_rp, 2.0_rp) ) )