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)
then
144 subroutine load(this, particle, next_level, submethod)
147 integer,
intent(in) :: next_level
148 class(
methodtype),
pointer,
intent(inout) :: submethod
149 call pstop(1,
"load must be overridden")
153 subroutine pass(this, particle)
156 call pstop(1,
"pass must be overridden")
160 subroutine save(this, particle, reason)
165 integer(I4B),
intent(in) :: reason
167 integer(I4B) :: per, stp
177 if (particle%ttrack ==
totimc .and. (per > 1 .or. stp > 1))
then
180 else if (per > 1)
then
186 call this%trackctl%save(particle,
kper=per,
kstp=stp, reason=reason)
195 subroutine check(this, particle, cell_defn)
203 logical(LGP) :: dry_cell, dry_particle, no_exit_face, stop_zone, weak_sink
205 dry_cell = this%fmi%ibdgwfsat0(cell_defn%icell) == 0
206 dry_particle = particle%z > cell_defn%top
207 no_exit_face = cell_defn%inoexitface > 0
208 stop_zone = cell_defn%izone > 0 .and. particle%istopzone == cell_defn%izone
209 weak_sink = cell_defn%iweaksink > 0
211 particle%izone = cell_defn%izone
213 particle%advancing = .false.
215 call this%save(particle, reason=3)
219 if (no_exit_face .and. .not. dry_cell)
then
220 particle%advancing = .false.
222 call this%save(particle, reason=3)
227 if (particle%istopweaksink > 0)
then
228 particle%advancing = .false.
230 call this%save(particle, reason=3)
233 call this%save(particle, reason=4)
238 if (particle%idrymeth == 0)
then
239 no_exit_face = .false.
240 else if (particle%idrymeth == 1)
then
242 particle%advancing = .false.
244 call this%save(particle, reason=3)
246 else if (particle%idrymeth == 2)
then
248 no_exit_face = .false.
249 particle%advancing = .false.
250 particle%ttrack =
totim
254 call this%save(particle, reason=3)
257 call this%save(particle, reason=2)
259 else if (dry_particle .and. this%name /=
"passtobottom")
then
261 if (particle%idrymeth == 0)
then
263 particle%z = cell_defn%top
264 call this%save(particle, reason=1)
265 else if (particle%idrymeth == 1)
then
267 particle%advancing = .false.
269 call this%save(particle, reason=3)
271 else if (particle%idrymeth == 2)
then
273 no_exit_face = .false.
274 particle%advancing = .false.
279 if (no_exit_face)
then
280 particle%advancing = .false.
282 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.