18 integer(I4B),
dimension(:),
pointer,
contiguous :: ibound => null()
28 function constructor(dis, fmi, ibound)
result(interpolation_scheme)
34 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: ibound
36 interpolation_scheme%dis => dis
37 interpolation_scheme%fmi => fmi
38 interpolation_scheme%ibound => ibound
42 function compute(this, n, m, iposnm, phi)
result(phi_face)
47 integer(I4B),
intent(in) :: n
48 integer(I4B),
intent(in) :: m
49 integer(I4B),
intent(in) :: iposnm
50 real(dp),
intent(in),
dimension(:) :: phi
52 integer(I4B) :: ipos, isympos, iup, idn, i2up, j
53 real(dp) :: qnm, qmax, qupj, elupdn, elup2up
54 real(dp) :: smooth, cdiff, alimiter
55 real(dp),
pointer :: coef_up, coef_dn
58 isympos = this%dis%con%jas(iposnm)
59 qnm = this%fmi%gwfflowja(iposnm)
65 coef_up => phi_face%c_m
66 coef_dn => phi_face%c_n
71 coef_up => phi_face%c_n
72 coef_dn => phi_face%c_m
74 elupdn = this%dis%con%cl1(isympos) + this%dis%con%cl2(isympos)
84 do ipos = this%dis%con%ia(iup) + 1, this%dis%con%ia(iup + 1) - 1
85 j = this%dis%con%ja(ipos)
86 if (this%ibound(j) == 0) cycle
87 qupj = this%fmi%gwfflowja(ipos)
88 isympos = this%dis%con%jas(ipos)
92 elup2up = this%dis%con%cl1(isympos) + this%dis%con%cl2(isympos)
99 cdiff = abs(phi(idn) - phi(iup))
100 if (cdiff >
dprec)
then
101 smooth = (phi(iup) - phi(i2up)) / elup2up * &
102 elupdn / (phi(idn) - phi(iup))
104 if (smooth >
dzero)
then
105 alimiter =
dtwo * smooth / (
done + smooth)
106 phi_face%rhs = -
dhalf * alimiter * (phi(idn) - phi(iup))
This module contains simulation constants.
real(dp), parameter dhalf
real constant 1/2
real(dp), parameter dzero
real constant zero
real(dp), parameter dprec
real constant machine precision
real(dp), parameter dtwo
real constant 2
real(dp), parameter done
real constant 1
This module defines variable data types.
type(tvdschemetype) function constructor(dis, fmi, ibound)
type(coefficientstype) function, target compute(this, n, m, iposnm, phi)