44 type(CoefficientsType),
target :: phi_face
46 class(TVDSchemeType),
target :: this
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))