220
221 class(PrtFmiType) :: this
222
223 integer(I4B) :: j, i, ip, ib
224 integer(I4B) :: iflowface, iauxiflowface, icellface
225 real(DP) :: qbnd
226 character(len=LENAUXNAME) :: auxname
227 integer(I4B) :: naux
228
229 this%StorageFlows = dzero
230 if (this%igwfstrgss /= 0) &
231 this%StorageFlows = this%StorageFlows + this%gwfstrgss
232 if (this%igwfstrgsy /= 0) &
233 this%StorageFlows = this%StorageFlows + this%gwfstrgsy
234
235 this%SourceFlows = dzero
236 this%SinkFlows = dzero
237 this%BoundaryFlows = dzero
238 this%BoundaryFaces = 0
239 do ip = 1, this%nflowpack
240 iauxiflowface = 0
241 naux = this%gwfpackages(ip)%naux
242 if (naux > 0) then
243 do j = 1, naux
244 auxname = this%gwfpackages(ip)%auxname(j)
245 if (trim(adjustl(auxname)) == "IFLOWFACE") then
246 iauxiflowface = j
247 exit
248 end if
249 end do
250 end if
251 do ib = 1, this%gwfpackages(ip)%nbound
252 i = this%gwfpackages(ip)%nodelist(ib)
253 if (i <= 0) cycle
254 if (this%ibound(i) <= 0) cycle
255 qbnd = this%gwfpackages(ip)%get_flow(ib)
256
257 iflowface = 0
258 icellface = 0
259 if (iauxiflowface > 0) then
260 iflowface = nint(this%gwfpackages(ip)%auxvar(iauxiflowface, ib))
261 icellface = this%iflowface_to_icellface(iflowface)
262 end if
263 if (icellface > 0) then
264 call this%mark_boundary_face(i, icellface)
265 this%BoundaryFlows(i, icellface) = &
266 this%BoundaryFlows(i, icellface) + qbnd
267 else if (qbnd .gt. dzero) then
268 this%SourceFlows(i) = this%SourceFlows(i) + qbnd
269 else if (qbnd .lt. dzero) then
270 this%SinkFlows(i) = this%SinkFlows(i) + qbnd
271 end if
272 end do
273 end do
274