33 procedure,
public :: pass =>
pass_dis
56 allocate (method%name)
60 method%delegates = .true.
70 deallocate (this%name)
73 call this%method_cell_plck%deallocate()
74 deallocate (this%method_cell_plck)
75 call this%method_cell_ptb%deallocate()
76 deallocate (this%method_cell_ptb)
82 integer(I4B),
intent(in) :: ic
98 select type (dis => this%fmi%dis)
100 icu = dis%get_nodeuser(ic)
102 call get_ijk(icu, dis%nrow, dis%ncol, dis%nlay, &
107 dz = cell%defn%top - cell%defn%bot
114 cell%xOrigin = cell%defn%polyvert(1, 1)
115 cell%yOrigin = cell%defn%polyvert(2, 1)
116 cell%zOrigin = cell%defn%bot
119 factor =
done / cell%defn%retfactor
120 factor = factor / cell%defn%porosity
123 term = factor / areaz
125 cell%vz1 = cell%defn%faceflow(6) * term
126 cell%vz2 = -cell%defn%faceflow(7) * term
128 if (this%fmi%ibdgwfsat0(ic) == 0)
then
139 term = factor / areax
140 cell%vx1 = cell%defn%faceflow(1) * term
141 cell%vx2 = -cell%defn%faceflow(3) * term
144 term = factor / areay
145 cell%vy1 = cell%defn%faceflow(4) * term
146 cell%vy2 = -cell%defn%faceflow(2) * term
152 subroutine load_dis(this, particle, next_level, submethod)
156 integer(I4B),
intent(in) :: next_level
157 class(
methodtype),
pointer,
intent(inout) :: submethod
161 select type (cell => this%cell)
163 ic = particle%itrdomain(next_level)
164 call this%load_cell_defn(ic, cell%defn)
165 call this%load_cell(ic, cell)
166 if (this%fmi%ibdgwfsat0(ic) == 0)
then
167 call this%method_cell_ptb%init( &
170 events=this%events, &
171 tracktimes=this%tracktimes)
172 submethod => this%method_cell_ptb
174 call this%method_cell_plck%init( &
177 events=this%events, &
178 tracktimes=this%tracktimes)
179 submethod => this%method_cell_plck
199 integer(I4B) :: inface
200 integer(I4B) :: idiag
211 select type (dis => this%fmi%dis)
215 inbr = cell%defn%facenbr(inface)
216 idiag = this%fmi%dis%con%ia(cell%defn%icell)
218 ic = dis%con%ja(ipos)
219 icu = dis%get_nodeuser(ic)
220 call get_ijk(icu, dis%nrow, dis%ncol, dis%nlay, irow, icol, ilay)
228 if (inface .eq. 1)
then
230 else if (inface .eq. 2)
then
232 else if (inface .eq. 3)
then
234 else if (inface .eq. 4)
then
236 else if (inface .eq. 6)
then
238 else if (inface .eq. 7)
then
246 topfrom = cell%defn%top
247 botfrom = cell%defn%bot
248 zrel = (z - botfrom) / (topfrom - botfrom)
251 sat = this%fmi%gwfsat(ic)
252 z = bot + zrel * sat * (top - bot)
266 integer(I4B) :: idiag
268 integer(I4B) :: inface
272 inbr = cell%defn%facenbr(inface)
273 idiag = this%fmi%dis%con%ia(cell%defn%icell)
277 this%flowja(ipos) = this%flowja(ipos) -
done
280 this%flowja(this%fmi%dis%con%isym(ipos)) &
281 = this%flowja(this%fmi%dis%con%isym(ipos)) +
done
293 integer(I4B) :: iface
294 logical(LGP) :: no_neighbors
296 select type (c => this%cell)
300 no_neighbors = cell%defn%facenbr(iface) == 0
303 if (no_neighbors)
then
308 call this%load_particle(cell, particle)
309 call this%update_flowja(cell, particle)
317 real(DP),
intent(in) :: tmax
319 call this%track(particle, 1, tmax)
325 integer,
intent(in) :: iatop
326 double precision :: top
328 if (iatop .lt. 0)
then
329 top = this%fmi%dis%top(-iatop)
331 top = this%fmi%dis%bot(iatop)
339 integer(I4B),
intent(in) :: ic
342 call this%load_cell_properties(ic, defn)
343 call this%fmi%dis%get_polyverts( &
347 call this%load_cell_neighbors(defn)
348 call this%load_cell_saturation_status(defn)
349 defn%ispv180(1:defn%npolyverts + 1) = .false.
350 call this%load_cell_flows(defn)
357 integer(I4B),
intent(in) :: ic
360 integer(I4B) :: irow, icol, ilay, icu
364 defn%iatop =
get_iatop(this%fmi%dis%get_ncpl(), &
365 this%fmi%dis%get_nodeuser(ic))
366 defn%top = this%fmi%dis%bot(ic) + &
367 this%fmi%gwfsat(ic) * &
368 (this%fmi%dis%top(ic) - this%fmi%dis%bot(ic))
369 defn%bot = this%fmi%dis%bot(ic)
370 defn%sat = this%fmi%gwfsat(ic)
371 defn%porosity = this%porosity(ic)
372 defn%retfactor = this%retfactor(ic)
373 select type (dis => this%fmi%dis)
375 icu = dis%get_nodeuser(ic)
376 call get_ijk(icu, dis%nrow, dis%ncol, dis%nlay, irow, icol, ilay)
379 defn%izone = this%izone(ic)
380 defn%can_be_rect = .true.
381 defn%can_be_quad = .false.
399 integer(I4B) :: irow1
400 integer(I4B) :: irow2
401 integer(I4B) :: jcol1
402 integer(I4B) :: jcol2
403 integer(I4B) :: klay1
404 integer(I4B) :: klay2
405 integer(I4B) :: iedgeface
407 select type (dis => this%fmi%dis)
412 icu1 = dis%get_nodeuser(ic1)
413 call get_ijk(icu1, dis%nrow, dis%ncol, dis%nlay, &
415 call get_jk(icu1, dis%get_ncpl(), dis%nlay, j1, klay1)
416 do iloc = 1, dis%con%ia(ic1 + 1) - dis%con%ia(ic1) - 1
417 ipos = dis%con%ia(ic1) + iloc
419 if (dis%con%mask(ipos) == 0) cycle
420 ic2 = dis%con%ja(ipos)
421 icu2 = dis%get_nodeuser(ic2)
422 call get_ijk(icu2, dis%nrow, dis%ncol, dis%nlay, &
424 if (klay2 == klay1)
then
426 if (irow2 > irow1)
then
429 else if (jcol2 > jcol1)
then
432 else if (irow2 < irow1)
then
439 defn%facenbr(iedgeface) = int(iloc, 1)
440 else if (klay2 > klay1)
then
442 defn%facenbr(defn%npolyverts + 2) = int(iloc, 1)
445 defn%facenbr(defn%npolyverts + 3) = int(iloc, 1)
450 defn%facenbr(defn%npolyverts + 1) = defn%facenbr(1)
464 defn%faceflow =
dzero
465 call this%load_cell_boundary_flows(defn)
466 call this%load_cell_face_flows(defn)
467 call this%cap_cell_wt_flow(defn)
468 call this%load_cell_no_exit_face(defn)
471 defn%distflow = this%fmi%SourceFlows(defn%icell) + &
472 this%fmi%SinkFlows(defn%icell) + &
473 this%fmi%StorageFlows(defn%icell)
476 if (this%fmi%SinkFlows(defn%icell) .ne.
dzero)
then
488 integer(I4B) :: m, n, nfaces
491 nfaces = defn%npolyverts + 3
495 q = this%fmi%gwfflowja(this%fmi%dis%con%ia(defn%icell) + n)
496 defn%faceflow(m) = defn%faceflow(m) + q
509 defn%faceflow(1) = defn%faceflow(1) + &
510 this%fmi%BoundaryFlows(defn%icell, 1)
511 defn%faceflow(2) = defn%faceflow(2) + &
512 this%fmi%BoundaryFlows(defn%icell, 2)
513 defn%faceflow(3) = defn%faceflow(3) + &
514 this%fmi%BoundaryFlows(defn%icell, 3)
515 defn%faceflow(4) = defn%faceflow(4) + &
516 this%fmi%BoundaryFlows(defn%icell, 4)
517 defn%faceflow(5) = defn%faceflow(1)
518 defn%faceflow(6) = defn%faceflow(6) + &
519 this%fmi%BoundaryFlows(defn%icell, this%fmi%max_faces - 1)
520 defn%faceflow(7) = defn%faceflow(7) + &
521 this%fmi%BoundaryFlows(defn%icell, this%fmi%max_faces)
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 ...
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.
pure logical function, public is_close(a, b, rtol, atol, symmetric)
Check if a real value is approximately equal to another.
subroutine, public create_method_cell_ptb(method)
Create a new pass-to-bottom tracking method.
procedure subroutine, public create_method_cell_pollock(method)
Create a tracking method.
subroutine load_cell_face_flows(this, defn)
subroutine load_cell_defn(this, ic, defn)
Loads cell definition from the grid.
double precision function get_top(this, iatop)
Returns a top elevation based on index iatop.
subroutine load_cell_properties(this, ic, defn)
subroutine load_particle(this, cell, particle)
Load cell properties into the particle, including.
subroutine load_cell_boundary_flows(this, defn)
Add boundary flows to the cell definition faceflow array. Assumes cell index and number of vertices a...
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 apply_dis(this, particle, tmax)
Apply the structured tracking method to a particle.
subroutine load_dis(this, particle, next_level, submethod)
Load the cell geometry and tracking method.
subroutine load_cell_neighbors(this, defn)
Loads face neighbors to cell definition from the grid. Assumes cell index and number of vertices are ...
subroutine load_cell(this, ic, cell)
subroutine load_cell_flows(this, defn)
Load flows into the cell definition. These include face, boundary and net distributed flows....
subroutine pass_dis(this, particle)
Pass a particle to the next cell, if there is one.
Particle tracking strategies.
@, public terminate
particle terminated
@ term_boundary
terminated at a boundary face
Base grid cell definition.
Structured grid discretization.
Base type for particle tracking methods.
Particle tracked by the PRT model.