27 procedure,
public :: pass =>
pass_dis
50 allocate (method%name)
54 method%delegates = .true.
60 deallocate (this%name)
66 integer(I4B),
intent(in) :: ic
82 select type (dis => this%fmi%dis)
84 icu = dis%get_nodeuser(ic)
86 call get_ijk(icu, dis%nrow, dis%ncol, dis%nlay, &
91 dz = cell%defn%top - cell%defn%bot
98 cell%xOrigin = cell%defn%polyvert(1, 1)
99 cell%yOrigin = cell%defn%polyvert(2, 1)
100 cell%zOrigin = cell%defn%bot
103 factor =
done / cell%defn%retfactor
104 factor = factor / cell%defn%porosity
107 term = factor / areaz
109 cell%vz1 = cell%defn%faceflow(6) * term
110 cell%vz2 = -cell%defn%faceflow(7) * term
112 if (this%fmi%ibdgwfsat0(ic) == 0)
then
123 term = factor / areax
124 cell%vx1 = cell%defn%faceflow(1) * term
125 cell%vx2 = -cell%defn%faceflow(3) * term
128 term = factor / areay
129 cell%vy1 = cell%defn%faceflow(4) * term
130 cell%vy2 = -cell%defn%faceflow(2) * term
136 subroutine load_dis(this, particle, next_level, submethod)
140 integer(I4B),
intent(in) :: next_level
141 class(
methodtype),
pointer,
intent(inout) :: submethod
145 select type (cell => this%cell)
147 ic = particle%idomain(next_level)
148 call this%load_celldefn(ic, cell%defn)
149 call this%load_cell(ic, cell)
150 if (this%fmi%ibdgwfsat0(ic) == 0)
then
154 trackctl=this%trackctl, &
155 tracktimes=this%tracktimes)
161 trackctl=this%trackctl, &
162 tracktimes=this%tracktimes)
181 integer(I4B) :: inface
182 integer(I4B) :: idiag
193 select type (dis => this%fmi%dis)
196 inface = particle%iboundary(2)
197 inbr = cell%defn%facenbr(inface)
198 idiag = this%fmi%dis%con%ia(cell%defn%icell)
200 ic = dis%con%ja(ipos)
201 icu = dis%get_nodeuser(ic)
202 call get_ijk(icu, dis%nrow, dis%ncol, dis%nlay, &
210 if (ic == particle%icp .and. inface == 7 .and. ilay < particle%ilay)
then
211 particle%advancing = .false.
212 particle%idomain(2) = particle%icp
214 particle%izone = particle%izp
215 call this%save(particle, reason=3)
218 particle%icp = particle%idomain(2)
219 particle%izp = particle%izone
223 particle%idomain(2) = ic
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
241 particle%iboundary(2) = inface
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
271 inface = particle%iboundary(2)
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
292 select type (c => this%cell)
298 if (cell%defn%facenbr(particle%iboundary(2)) .eq. 0)
then
300 particle%advancing = .false.
301 call this%save(particle, reason=3)
304 call this%load_particle(cell, particle)
305 if (.not. particle%advancing)
return
308 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
343 call this%load_properties(ic, defn)
346 call this%fmi%dis%get_polyverts( &
350 call this%load_neighbors(defn)
353 defn%ispv180(1:defn%npolyverts + 1) = .false.
355 call this%load_flows(defn)
362 integer(I4B),
intent(in) :: ic
365 integer(I4B) :: irow, icol, ilay, icu
369 defn%iatop =
get_iatop(this%fmi%dis%get_ncpl(), &
370 this%fmi%dis%get_nodeuser(ic))
371 defn%top = this%fmi%dis%bot(ic) + &
372 this%fmi%gwfsat(ic) * &
373 (this%fmi%dis%top(ic) - this%fmi%dis%bot(ic))
374 defn%bot = this%fmi%dis%bot(ic)
375 defn%sat = this%fmi%gwfsat(ic)
376 defn%porosity = this%porosity(ic)
377 defn%retfactor = this%retfactor(ic)
378 select type (dis => this%fmi%dis)
380 icu = dis%get_nodeuser(ic)
381 call get_ijk(icu, dis%nrow, dis%ncol, dis%nlay, irow, icol, ilay)
384 defn%izone = this%izone(ic)
385 defn%can_be_rect = .true.
386 defn%can_be_quad = .false.
403 integer(I4B) :: irow1
404 integer(I4B) :: irow2
405 integer(I4B) :: jcol1
406 integer(I4B) :: jcol2
407 integer(I4B) :: klay1
408 integer(I4B) :: klay2
409 integer(I4B) :: iedgeface
411 select type (dis => this%fmi%dis)
416 icu1 = dis%get_nodeuser(ic1)
417 call get_ijk(icu1, dis%nrow, dis%ncol, dis%nlay, &
419 call get_jk(icu1, dis%get_ncpl(), dis%nlay, j1, klay1)
420 do iloc = 1, dis%con%ia(ic1 + 1) - dis%con%ia(ic1) - 1
421 ipos = dis%con%ia(ic1) + iloc
423 if (dis%con%mask(ipos) == 0) cycle
424 ic2 = dis%con%ja(ipos)
425 icu2 = dis%get_nodeuser(ic2)
426 call get_ijk(icu2, dis%nrow, dis%ncol, dis%nlay, &
428 if (klay2 == klay1)
then
430 if (irow2 > irow1)
then
433 else if (jcol2 > jcol1)
then
436 else if (irow2 < irow1)
then
443 defn%facenbr(iedgeface) = int(iloc, 1)
444 else if (klay2 > klay1)
then
446 defn%facenbr(defn%npolyverts + 2) = int(iloc, 1)
449 defn%facenbr(defn%npolyverts + 3) = int(iloc, 1)
454 defn%facenbr(defn%npolyverts + 1) = defn%facenbr(1)
468 defn%faceflow =
dzero
470 call this%load_boundary_flows_to_defn(defn)
471 call this%load_face_flows_to_defn(defn)
474 defn%distflow = this%fmi%SourceFlows(defn%icell) + &
475 this%fmi%SinkFlows(defn%icell) + &
476 this%fmi%StorageFlows(defn%icell)
479 if (this%fmi%SinkFlows(defn%icell) .ne.
dzero)
then
491 integer(I4B) :: m, n, nfaces
494 nfaces = defn%npolyverts + 3
498 q = this%fmi%gwfflowja(this%fmi%dis%con%ia(defn%icell) + n)
499 defn%faceflow(m) = defn%faceflow(m) + q
501 if (defn%faceflow(m) <
dzero) defn%inoexitface = 0
512 integer(I4B) :: ioffset
515 defn%faceflow(1) = defn%faceflow(1) + &
516 this%fmi%BoundaryFlows(ioffset + 1)
517 defn%faceflow(2) = defn%faceflow(2) + &
518 this%fmi%BoundaryFlows(ioffset + 2)
519 defn%faceflow(3) = defn%faceflow(3) + &
520 this%fmi%BoundaryFlows(ioffset + 3)
521 defn%faceflow(4) = defn%faceflow(4) + &
522 this%fmi%BoundaryFlows(ioffset + 4)
523 defn%faceflow(5) = defn%faceflow(1)
524 defn%faceflow(6) = defn%faceflow(6) + &
525 this%fmi%BoundaryFlows(ioffset + 9)
526 defn%faceflow(7) = defn%faceflow(7) + &
527 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.
pure logical function, public is_close(a, b, rtol, atol, symmetric)
Check if a real value is approximately equal to another.
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 structured tracking 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.