26 procedure,
public :: pass =>
pass_dis
49 allocate (method%type)
53 method%delegates = .true.
59 deallocate (this%type)
65 integer(I4B),
intent(in) :: ic
81 select type (dis => this%fmi%dis)
83 icu = dis%get_nodeuser(ic)
84 call get_ijk(icu, dis%nrow, dis%ncol, dis%nlay, &
88 dz = cell%defn%top - cell%defn%bot
94 cell%xOrigin = cell%defn%polyvert(1, 1)
95 cell%yOrigin = cell%defn%polyvert(2, 1)
96 cell%zOrigin = cell%defn%bot
101 factor =
done / cell%defn%retfactor
102 factor = factor / cell%defn%porosity
103 term = factor / areax
104 cell%vx1 = cell%defn%faceflow(1) * term
105 cell%vx2 = -cell%defn%faceflow(3) * term
106 term = factor / areay
107 cell%vy1 = cell%defn%faceflow(4) * term
108 cell%vy2 = -cell%defn%faceflow(2) * term
109 term = factor / areaz
110 cell%vz1 = cell%defn%faceflow(6) * term
111 cell%vz2 = -cell%defn%faceflow(7) * term
116 subroutine load_dis(this, particle, next_level, submethod)
120 integer(I4B),
intent(in) :: next_level
121 class(
methodtype),
pointer,
intent(inout) :: submethod
125 select type (cell => this%cell)
128 ic = particle%idomain(next_level)
129 call this%load_celldefn(ic, cell%defn)
130 call this%load_cell(ic, cell)
133 if (this%fmi%ibdgwfsat0(ic) == 0)
then
137 trackctl=this%trackctl, &
138 tracktimes=this%tracktimes)
145 trackctl=this%trackctl, &
146 tracktimes=this%tracktimes)
165 integer(I4B) :: inface
166 integer(I4B) :: idiag
177 select type (dis => this%fmi%dis)
180 inface = particle%iboundary(2)
181 inbr = cell%defn%facenbr(inface)
182 idiag = this%fmi%dis%con%ia(cell%defn%icell)
184 ic = dis%con%ja(ipos)
185 icu = dis%get_nodeuser(ic)
186 call get_ijk(icu, dis%nrow, dis%ncol, dis%nlay, &
188 particle%idomain(2) = ic
193 if (inface .eq. 1)
then
195 else if (inface .eq. 2)
then
197 else if (inface .eq. 3)
then
199 else if (inface .eq. 4)
then
201 else if (inface .eq. 6)
then
203 else if (inface .eq. 7)
then
206 particle%iboundary(2) = inface
211 topfrom = cell%defn%top
212 botfrom = cell%defn%bot
213 zrel = (z - botfrom) / (topfrom - botfrom)
216 sat = this%fmi%gwfsat(ic)
217 z = bot + zrel * sat * (top - bot)
232 integer(I4B) :: idiag
234 integer(I4B) :: inface
237 inface = particle%iboundary(2)
238 inbr = cell%defn%facenbr(inface)
239 idiag = this%fmi%dis%con%ia(cell%defn%icell)
243 this%flowja(ipos) = this%flowja(ipos) -
done
246 this%flowja(this%fmi%dis%con%isym(ipos)) &
247 = this%flowja(this%fmi%dis%con%isym(ipos)) +
done
259 select type (c => this%cell)
265 if (cell%defn%facenbr(particle%iboundary(2)) .eq. 0)
then
267 particle%advancing = .false.
268 call this%save(particle, reason=3)
272 call this%load_particle(cell, particle)
273 call this%update_flowja(cell, particle)
282 real(DP),
intent(in) :: tmax
284 call this%track(particle, 1, tmax)
290 integer,
intent(in) :: iatop
291 double precision :: top
293 if (iatop .lt. 0)
then
294 top = this%fmi%dis%top(-iatop)
296 top = this%fmi%dis%bot(iatop)
304 integer(I4B),
intent(in) :: ic
308 call this%load_properties(ic, defn)
311 call this%fmi%dis%get_polyverts( &
317 call this%load_neighbors(defn)
320 defn%ispv180(1:defn%npolyverts + 1) = .false.
323 call this%load_flows(defn)
330 integer(I4B),
intent(in) :: ic
335 defn%iatop =
get_iatop(this%fmi%dis%get_ncpl(), &
336 this%fmi%dis%get_nodeuser(ic))
337 defn%top = this%fmi%dis%bot(ic) + &
338 this%fmi%gwfsat(ic) * &
339 (this%fmi%dis%top(ic) - this%fmi%dis%bot(ic))
340 defn%bot = this%fmi%dis%bot(ic)
341 defn%sat = this%fmi%gwfsat(ic)
342 defn%porosity = this%porosity(ic)
343 defn%retfactor = this%retfactor(ic)
344 defn%izone = this%izone(ic)
345 defn%can_be_rect = .true.
346 defn%can_be_quad = .false.
364 integer(I4B) :: irow1
365 integer(I4B) :: irow2
366 integer(I4B) :: jcol1
367 integer(I4B) :: jcol2
368 integer(I4B) :: klay1
369 integer(I4B) :: klay2
370 integer(I4B) :: iedgeface
372 select type (dis => this%fmi%dis)
377 icu1 = dis%get_nodeuser(ic1)
378 call get_ijk(icu1, dis%nrow, dis%ncol, dis%nlay, &
380 call get_jk(icu1, dis%get_ncpl(), dis%nlay, j1, klay1)
381 do iloc = 1, dis%con%ia(ic1 + 1) - dis%con%ia(ic1) - 1
382 ipos = dis%con%ia(ic1) + iloc
384 if (dis%con%mask(ipos) == 0) cycle
385 ic2 = dis%con%ja(ipos)
386 icu2 = dis%get_nodeuser(ic2)
387 call get_ijk(icu2, dis%nrow, dis%ncol, dis%nlay, &
389 if (klay2 == klay1)
then
391 if (irow2 > irow1)
then
394 else if (jcol2 > jcol1)
then
397 else if (irow2 < irow1)
then
404 defn%facenbr(iedgeface) = int(iloc, 1)
405 else if (klay2 > klay1)
then
407 defn%facenbr(defn%npolyverts + 2) = int(iloc, 1)
410 defn%facenbr(defn%npolyverts + 3) = int(iloc, 1)
415 defn%facenbr(defn%npolyverts + 1) = defn%facenbr(1)
429 defn%faceflow =
dzero
431 call this%load_boundary_flows_to_defn(defn)
432 call this%load_face_flows_to_defn(defn)
435 defn%distflow = this%fmi%SourceFlows(defn%icell) + &
436 this%fmi%SinkFlows(defn%icell) + &
437 this%fmi%StorageFlows(defn%icell)
440 if (this%fmi%SinkFlows(defn%icell) .ne.
dzero)
then
453 integer(I4B) :: m, n, nfaces
456 nfaces = defn%npolyverts + 3
460 q = this%fmi%gwfflowja(this%fmi%dis%con%ia(defn%icell) + n)
461 defn%faceflow(m) = defn%faceflow(m) + q
463 if (defn%faceflow(m) <
dzero) defn%inoexitface = 0
474 integer(I4B) :: ioffset
477 defn%faceflow(1) = defn%faceflow(1) + &
478 this%fmi%BoundaryFlows(ioffset + 1)
479 defn%faceflow(2) = defn%faceflow(2) + &
480 this%fmi%BoundaryFlows(ioffset + 2)
481 defn%faceflow(3) = defn%faceflow(3) + &
482 this%fmi%BoundaryFlows(ioffset + 3)
483 defn%faceflow(4) = defn%faceflow(4) + &
484 this%fmi%BoundaryFlows(ioffset + 4)
485 defn%faceflow(5) = defn%faceflow(1)
486 defn%faceflow(6) = defn%faceflow(6) + &
487 this%fmi%BoundaryFlows(ioffset + 9)
488 defn%faceflow(7) = defn%faceflow(7) + &
489 this%fmi%BoundaryFlows(ioffset + 10)
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 ...
integer(i4b), parameter, public max_poly_cells
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_flows(this, defn)
Load flows into the cell definition. These include face, boundary and net distributed flows....
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...
double precision function get_top(this, iatop)
Returns a top elevation based on index iatop.
subroutine load_particle(this, cell, particle)
Load cell properties into the particle, including.
subroutine load_properties(this, ic, defn)
subroutine update_flowja(this, cell, particle)
Update cell-cell flows of particle mass. Every particle is currently assigned unit mass.
subroutine, public create_method_dis(method)
Create a new structured grid (DIS) tracking method.
subroutine load_celldefn(this, ic, defn)
Loads cell definition from the grid.
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 tracking method.
subroutine load_cell(this, ic, cell)
subroutine load_face_flows_to_defn(this, defn)
subroutine load_neighbors(this, defn)
Loads face neighbors to cell definition from the grid. Assumes cell index and number of vertices are ...
subroutine pass_dis(this, particle)
Pass a particle to the next cell, if there is one.
Particle tracking strategies.
Base grid cell definition.
Structured grid discretization.
Base type for particle tracking methods.
Particle tracked by the PRT model.