18 real(dp),
dimension(:),
pointer :: phi
19 integer(I4B),
dimension(:),
pointer,
contiguous :: ibound => null()
30 function constructor(dis, fmi, ibound)
result(interpolation_scheme)
36 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: ibound
38 interpolation_scheme%dis => dis
39 interpolation_scheme%fmi => fmi
40 interpolation_scheme%ibound => ibound
52 real(DP),
intent(in),
dimension(:),
pointer :: phi
57 function compute(this, n, m, iposnm)
result(phi_face)
62 integer(I4B),
intent(in) :: n
63 integer(I4B),
intent(in) :: m
64 integer(I4B),
intent(in) :: iposnm
66 integer(I4B) :: ipos, isympos, iup, idn, i2up, j
67 real(dp) :: qnm, qmax, qupj, elupdn, elup2up
68 real(dp) :: smooth, cdiff, alimiter
69 real(dp),
pointer :: coef_up, coef_dn
72 isympos = this%dis%con%jas(iposnm)
73 qnm = this%fmi%gwfflowja(iposnm)
79 coef_up => phi_face%c_m
80 coef_dn => phi_face%c_n
85 coef_up => phi_face%c_n
86 coef_dn => phi_face%c_m
88 elupdn = this%dis%con%cl1(isympos) + this%dis%con%cl2(isympos)
98 do ipos = this%dis%con%ia(iup) + 1, this%dis%con%ia(iup + 1) - 1
99 j = this%dis%con%ja(ipos)
100 if (this%ibound(j) == 0) cycle
101 qupj = this%fmi%gwfflowja(ipos)
102 isympos = this%dis%con%jas(ipos)
103 if (qupj > qmax)
then
106 elup2up = this%dis%con%cl1(isympos) + this%dis%con%cl2(isympos)
113 cdiff = abs(this%phi(idn) - this%phi(iup))
114 if (cdiff >
dprec)
then
115 smooth = (this%phi(iup) - this%phi(i2up)) / elup2up * &
116 elupdn / (this%phi(idn) - this%phi(iup))
118 if (smooth >
dzero)
then
119 alimiter =
dtwo * smooth / (
done + smooth)
120 phi_face%rhs = -
dhalf * alimiter * (this%phi(idn) - this%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(coefficientstype) function, target compute(this, n, m, iposnm)
type(tvdschemetype) function constructor(dis, fmi, ibound)
subroutine set_field(this, phi)
Set the scalar field for which interpolation will be computed.