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