32 character(len=40),
pointer,
public :: name
33 logical(LGP),
public :: delegates
35 class(
celltype),
pointer,
public :: cell => null()
39 integer(I4B),
dimension(:),
pointer,
contiguous,
public :: izone => null()
40 real(dp),
dimension(:),
pointer,
contiguous,
public :: flowja => null()
41 real(dp),
dimension(:),
pointer,
contiguous,
public :: porosity => null()
42 real(dp),
dimension(:),
pointer,
contiguous,
public :: retfactor => null()
59 subroutine apply(this, particle, tmax)
65 real(DP),
intent(in) :: tmax
75 subroutine init(this, fmi, cell, subcell, trackctl, tracktimes, &
76 izone, flowja, porosity, retfactor)
78 type(
prtfmitype),
intent(in),
pointer,
optional :: fmi
79 class(
celltype),
intent(in),
pointer,
optional :: cell
80 class(
subcelltype),
intent(in),
pointer,
optional :: subcell
83 integer(I4B),
intent(in),
pointer,
optional :: izone(:)
84 real(DP),
intent(in),
pointer,
optional :: flowja(:)
85 real(DP),
intent(in),
pointer,
optional :: porosity(:)
86 real(DP),
intent(in),
pointer,
optional :: retfactor(:)
88 if (
present(fmi)) this%fmi => fmi
89 if (
present(cell)) this%cell => cell
90 if (
present(subcell)) this%subcell => subcell
91 if (
present(trackctl)) this%trackctl => trackctl
92 if (
present(tracktimes)) this%tracktimes => tracktimes
93 if (
present(izone)) this%izone => izone
94 if (
present(flowja)) this%flowja => flowja
95 if (
present(porosity)) this%porosity => porosity
96 if (
present(retfactor)) this%retfactor => retfactor
101 recursive subroutine track(this, particle, level, tmax)
105 integer(I4B) :: level
106 real(dp),
intent(in) :: tmax
108 logical(LGP) :: advancing
109 integer(I4B) :: nextlevel
114 nextlevel = level + 1
116 call this%load(particle, nextlevel, submethod)
117 call submethod%apply(particle, tmax)
118 call this%try_pass(particle, nextlevel, advancing)
123 subroutine try_pass(this, particle, nextlevel, advancing)
126 integer(I4B) :: nextlevel
127 logical(LGP) :: advancing
130 if (.not. particle%advancing)
then
131 particle%iboundary = 0
136 call this%pass(particle)
137 if (particle%iboundary(nextlevel - 1) .ne. 0) &
143 subroutine load(this, particle, next_level, submethod)
146 integer,
intent(in) :: next_level
147 class(
methodtype),
pointer,
intent(inout) :: submethod
148 call pstop(1,
"load must be overridden")
152 subroutine pass(this, particle)
155 call pstop(1,
"pass must be overridden")
159 subroutine save(this, particle, reason)
164 integer(I4B),
intent(in) :: reason
166 integer(I4B) :: per, stp
176 if (particle%ttrack ==
totimc .and. (per > 1 .or. stp > 1))
then
179 else if (per > 1)
then
185 call this%trackctl%save(particle,
kper=per,
kstp=stp, reason=reason)
194 subroutine check(this, particle, cell_defn)
202 logical(LGP) :: dry_cell, dry_particle, no_exit_face, stop_zone, weak_sink
204 dry_cell = this%fmi%ibdgwfsat0(cell_defn%icell) == 0
205 dry_particle = particle%z > cell_defn%top
206 no_exit_face = cell_defn%inoexitface > 0
207 stop_zone = cell_defn%izone > 0 .and. particle%istopzone == cell_defn%izone
208 weak_sink = cell_defn%iweaksink > 0
210 particle%izone = cell_defn%izone
212 particle%advancing = .false.
214 call this%save(particle, reason=3)
218 if (no_exit_face .and. .not. dry_cell)
then
219 particle%advancing = .false.
221 call this%save(particle, reason=3)
226 if (particle%istopweaksink > 0)
then
227 particle%advancing = .false.
229 call this%save(particle, reason=3)
232 call this%save(particle, reason=4)
237 if (particle%idrymeth == 0)
then
238 no_exit_face = .false.
239 else if (particle%idrymeth == 1)
then
241 particle%advancing = .false.
243 call this%save(particle, reason=3)
245 else if (particle%idrymeth == 2)
then
247 no_exit_face = .false.
248 particle%advancing = .false.
249 particle%ttrack =
totim
253 call this%save(particle, reason=3)
256 call this%save(particle, reason=2)
258 else if (dry_particle .and. this%name /=
"passtobottom")
then
260 if (particle%idrymeth == 0)
then
262 particle%z = cell_defn%top
263 call this%save(particle, reason=1)
264 else if (particle%idrymeth == 1)
then
266 particle%advancing = .false.
268 call this%save(particle, reason=3)
270 else if (particle%idrymeth == 2)
then
272 no_exit_face = .false.
273 particle%advancing = .false.
278 if (no_exit_face)
then
279 particle%advancing = .false.
281 call this%save(particle, reason=3)
This module contains simulation constants.
real(dp), parameter dzero
real constant zero
subroutine pstop(status, message)
Stop the program, optionally specifying an error status code.
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.
Particle tracking strategies.
subroutine load(this, particle, next_level, submethod)
Load the subdomain tracking method (submethod).
subroutine save(this, particle, reason)
Save the particle's state to output files.
subroutine check(this, particle, cell_defn)
Check reporting/terminating conditions before tracking.
recursive subroutine track(this, particle, level, tmax)
Track the particle over domains of the given.
subroutine try_pass(this, particle, nextlevel, advancing)
Try passing the particle to the next subdomain.
subroutine pass(this, particle)
Pass the particle to the next subdomain.
logical(lgp), pointer, public endofsimulation
flag indicating end of simulation
real(dp), pointer, public totim
time relative to start of simulation
real(dp), pointer, public totimc
simulation time at start of time step
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number
Specify times for some event to occur.
Base grid cell definition.
Base type for grid cells of a concrete type. Contains a cell-definition which is information shared b...
Base type for particle tracking methods.
Particle tracked by the PRT model.
Represents a series of instants at which some event should occur.
Manages particle track (i.e. pathline) files.