26 procedure,
public :: pass =>
pass_dis
43 allocate (method%type)
47 method%delegates = .true.
53 deallocate (this%type)
57 subroutine load_dis(this, particle, next_level, submethod)
61 integer(I4B),
intent(in) :: next_level
62 class(
methodtype),
pointer,
intent(inout) :: submethod
78 select type (cell => this%cell)
80 select type (dis => this%fmi%dis)
82 ic = particle%idomain(next_level)
83 call this%load_cell_defn(ic, cell%defn)
87 if (this%fmi%ibdgwfsat0(ic) == 0)
then
90 trackfilectl=this%trackfilectl, &
91 tracktimes=this%tracktimes)
95 icu = dis%get_nodeuser(ic)
96 call get_ijk(icu, dis%nrow, dis%ncol, dis%nlay, &
100 dz = cell%defn%top - cell%defn%bot
106 cell%xOrigin = cell%defn%polyvert(1, 1)
107 cell%yOrigin = cell%defn%polyvert(2, 1)
108 cell%zOrigin = cell%defn%bot
113 factor =
done / cell%defn%retfactor
114 factor = factor / cell%defn%porosity
115 term = factor / areax
116 cell%vx1 = cell%defn%faceflow(1) * term
117 cell%vx2 = -cell%defn%faceflow(3) * term
118 term = factor / areay
119 cell%vy1 = cell%defn%faceflow(4) * term
120 cell%vy2 = -cell%defn%faceflow(2) * term
121 term = factor / areaz
122 cell%vz1 = cell%defn%faceflow(6) * term
123 cell%vz2 = -cell%defn%faceflow(7) * term
128 trackfilectl=this%trackfilectl, &
129 tracktimes=this%tracktimes)
142 integer(I4B) :: inface
147 integer(I4B) :: idiag
159 inface = particle%iboundary(2)
162 select type (cell => this%cell)
164 select type (dis => this%fmi%dis)
166 inbr = cell%defn%facenbr(inface)
167 if (inbr .eq. 0)
then
174 particle%advancing = .false.
175 call this%save(particle, reason=3)
178 idiag = dis%con%ia(cell%defn%icell)
180 ic = dis%con%ja(ipos)
181 particle%idomain(2) = ic
184 icu = dis%get_nodeuser(ic)
185 call get_ijk(icu, dis%nrow, dis%ncol, dis%nlay, &
191 if (inface .eq. 1)
then
193 else if (inface .eq. 2)
then
195 else if (inface .eq. 3)
then
197 else if (inface .eq. 4)
then
199 else if (inface .eq. 6)
then
201 else if (inface .eq. 7)
then
204 particle%iboundary(2) = inface
207 topfrom = cell%defn%top
208 botfrom = cell%defn%bot
209 zrel = (z - botfrom) / (topfrom - botfrom)
212 sat = this%fmi%gwfsat(ic)
213 z = bot + zrel * sat * (top - bot)
219 this%flowja(ipos) = this%flowja(ipos) -
done
221 this%flowja(dis%con%isym(ipos)) &
222 = this%flowja(dis%con%isym(ipos)) +
done
232 real(DP),
intent(in) :: tmax
234 call this%track(particle, 1, tmax)
240 integer,
intent(in) :: iatop
241 double precision :: top
243 if (iatop .lt. 0)
then
244 top = this%fmi%dis%top(-iatop)
246 top = this%fmi%dis%bot(iatop)
254 integer(I4B),
intent(in) :: ic
257 select type (dis => this%fmi%dis)
263 dis%get_nodeuser(ic))
264 defn%top = dis%bot(ic) + &
265 this%fmi%gwfsat(ic) * (dis%top(ic) - dis%bot(ic))
266 defn%bot = dis%bot(ic)
267 defn%sat = this%fmi%gwfsat(ic)
268 defn%porosity = this%porosity(ic)
269 defn%retfactor = this%retfactor(ic)
270 defn%izone = this%izone(ic)
271 defn%can_be_rect = .true.
272 defn%can_be_quad = .false.
275 call dis%get_polyverts( &
281 call this%load_nbrs_to_defn(defn)
284 defn%ispv180(1:defn%npolyverts + 1) = .false.
287 call this%load_flows_to_defn(defn)
305 integer(I4B) :: irow1
306 integer(I4B) :: irow2
307 integer(I4B) :: jcol1
308 integer(I4B) :: jcol2
309 integer(I4B) :: klay1
310 integer(I4B) :: klay2
311 integer(I4B) :: iedgeface
313 select type (dis => this%fmi%dis)
318 icu1 = dis%get_nodeuser(ic1)
319 call get_ijk(icu1, dis%nrow, dis%ncol, dis%nlay, &
321 call get_jk(icu1, dis%get_ncpl(), dis%nlay, j1, klay1)
322 do iloc = 1, dis%con%ia(ic1 + 1) - dis%con%ia(ic1) - 1
323 ipos = dis%con%ia(ic1) + iloc
324 if (dis%con%mask(ipos) == 0) cycle
325 ic2 = dis%con%ja(ipos)
326 icu2 = dis%get_nodeuser(ic2)
327 call get_ijk(icu2, dis%nrow, dis%ncol, dis%nlay, &
329 if (klay2 == klay1)
then
331 if (irow2 > irow1)
then
334 else if (jcol2 > jcol1)
then
337 else if (irow2 < irow1)
then
344 defn%facenbr(iedgeface) = int(iloc, 1)
345 else if (klay2 > klay1)
then
347 defn%facenbr(defn%npolyverts + 2) = int(iloc, 1)
350 defn%facenbr(defn%npolyverts + 3) = int(iloc, 1)
356 defn%facenbr(defn%npolyverts + 1) = defn%facenbr(1)
370 integer(I4B) :: npolyverts
373 npolyverts = defn%npolyverts
380 do m = 1, npolyverts + 3
383 defn%faceflow(m) = this%fmi%gwfflowja(this%fmi%dis%con%ia(ic) + n)
387 call this%load_boundary_flows_to_defn(defn)
390 do m = 1, npolyverts + 3
391 if (defn%faceflow(m) < 0d0) defn%inoexitface = 0
395 defn%distflow = this%fmi%SourceFlows(ic) + this%fmi%SinkFlows(ic) + &
396 this%fmi%StorageFlows(ic)
399 if (this%fmi%SinkFlows(ic) .ne. 0d0)
then
415 integer(I4B) :: ioffset
418 ioffset = (ic - 1) * 10
419 defn%faceflow(1) = defn%faceflow(1) + &
420 this%fmi%BoundaryFlows(ioffset + 1)
421 defn%faceflow(2) = defn%faceflow(2) + &
422 this%fmi%BoundaryFlows(ioffset + 2)
423 defn%faceflow(3) = defn%faceflow(3) + &
424 this%fmi%BoundaryFlows(ioffset + 3)
425 defn%faceflow(4) = defn%faceflow(4) + &
426 this%fmi%BoundaryFlows(ioffset + 4)
427 defn%faceflow(5) = defn%faceflow(1)
428 defn%faceflow(6) = defn%faceflow(6) + &
429 this%fmi%BoundaryFlows(ioffset + 9)
430 defn%faceflow(7) = defn%faceflow(7) + &
431 this%fmi%BoundaryFlows(ioffset + 10)
subroutine, public create_cell_rect(cell)
Create a new rectangular cell.
This module contains simulation constants.
real(dp), parameter dzero
real constant zero
real(dp), parameter done
real constant 1
subroutine, public get_ijk(nodenumber, nrow, ncol, nlay, irow, icol, ilay)
Get row, column and layer indices from node number and grid dimensions. If nodenumber is invalid,...
subroutine, public get_jk(nodenumber, ncpl, nlay, icpl, ilay)
Get layer index and within-layer node index from node number and grid dimensions. If nodenumber is in...
This module defines variable data types.
Cell-level tracking methods.
type(methodcellpollocktype), pointer, public method_cell_plck
type(methodcellpasstobottype), pointer, public method_cell_ptb
subroutine load_boundary_flows_to_defn(this, defn)
Add boundary flows to the cell definition faceflow array. Assumes cell index and number of vertices a...
subroutine load_cell_defn(this, ic, defn)
Loads cell definition from the grid.
subroutine load_nbrs_to_defn(this, defn)
Loads face neighbors to cell definition from the grid. Assumes cell index and number of vertices are ...
double precision function get_top(this, iatop)
Returns a top elevation based on index iatop.
subroutine load_flows_to_defn(this, defn)
Load flows into the cell definition. These include face flows and net distributed flows....
subroutine, public create_method_dis(method)
Create a new structured grid (DIS) tracking method.
subroutine apply_dis(this, particle, tmax)
Apply the method to a particle.
subroutine load_dis(this, particle, next_level, submethod)
Load the cell geometry and method (tracking strategy)
subroutine pass_dis(this, particle)
Pass a particle to the next cell, if there is one.
Particle tracking strategies.
integer(i4b) function, public get_iatop(ncpl, icu)
Get the index corresponding to top elevation of a cell in the grid. This is -1 if the cell is in the ...
Base grid cell definition.
Structured grid discretization.
Base type for particle tracking methods.
A particle tracked by the PRT model.
Manages particle track (i.e. pathline) files.