MODFLOW 6  version 6.7.0.dev3
USGS Modular Hydrologic Model
methodmodule Module Reference

Particle tracking strategies.

Data Types

type  methodtype
 Base type for particle tracking methods. More...
 
interface  apply
 
interface  assess
 
interface  deallocate
 

Enumerations

enum  
 Tracking method level enumeration. More...
 

Functions/Subroutines

subroutine init (this, fmi, cell, subcell, events, tracktimes, izone, flowja, porosity, retfactor)
 Initialize the method with pointers to model data. More...
 
recursive subroutine track (this, particle, level, tmax)
 Track the particle over subdomains of the given. More...
 
subroutine try_pass (this, particle, nextlevel, advancing)
 Try passing the particle to the next subdomain. More...
 
integer(i4b) function get_level (this)
 Get tracking method level. More...
 
subroutine load (this, particle, next_level, submethod)
 Load subdomain tracking method (submethod). More...
 
subroutine pass (this, particle)
 Pass particle to the next subdomain or to a domain boundary. More...
 
subroutine find_exits (this, particle, domain)
 Compute candidate exit solutions. More...
 
integer(i4b) function pick_exit (this, particle)
 Choose an exit solution among candidates. More...
 
subroutine release (this, particle)
 A particle is released. More...
 
subroutine terminate (this, particle, status)
 A particle terminates. More...
 
subroutine timestep (this, particle)
 A time step ends. More...
 
subroutine weaksink (this, particle)
 A particle leaves a weak sink. More...
 
subroutine usertime (this, particle)
 A user-defined tracking time occurs. More...
 
subroutine dropped (this, particle)
 A particle drops to the water table. More...
 

Variables

@, public level_model = 1
 
@, public level_feature = 2
 
@, public level_subfeature = 3
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Tracking levels: 1: model, 2: grid feature, 3: grid subfeature. A tracking level identifies the domain through which a tracking method is responsible for moving a particle. Methods operate on a particular level and delegate to submethods for levels higher than (i.e. below the scope of) their own.

Definition at line 39 of file Method.f90.

Function/Subroutine Documentation

◆ dropped()

subroutine methodmodule::dropped ( class(methodtype), intent(inout)  this,
type(particletype), intent(inout), pointer  particle 
)
private

Definition at line 288 of file Method.f90.

289  class(MethodType), intent(inout) :: this
290  type(ParticleType), pointer, intent(inout) :: particle
291  class(ParticleEventType), pointer :: event
292  allocate (droppedeventtype :: event)
293  call this%events%dispatch(particle, event)
294  deallocate (event)

◆ find_exits()

subroutine methodmodule::find_exits ( class(methodtype), intent(inout)  this,
type(particletype), intent(inout), pointer  particle,
class(domaintype), intent(in)  domain 
)
private

Definition at line 214 of file Method.f90.

215  class(MethodType), intent(inout) :: this
216  type(ParticleType), pointer, intent(inout) :: particle
217  class(DomainType), intent(in) :: domain
218  if (.not. this%delegates) &
219  call pstop(1, "find_exits called on non-delegating method")
220  call pstop(1, "find_exits must be overridden in delegating methods")
Here is the call graph for this function:

◆ get_level()

integer(i4b) function methodmodule::get_level ( class(methodtype), intent(in)  this)
private

Definition at line 190 of file Method.f90.

191  class(MethodType), intent(in) :: this
192  integer(I4B) :: level
193  level = -1 ! suppress compiler warning
194  call pstop(1, "get_level must be overridden")
Here is the call graph for this function:

◆ init()

subroutine methodmodule::init ( class(methodtype), intent(inout)  this,
type(prtfmitype), intent(in), optional, pointer  fmi,
class(celltype), intent(in), optional, pointer  cell,
class(subcelltype), intent(in), optional, pointer  subcell,
type(particleeventdispatchertype), intent(in), optional, pointer  events,
type(timeselecttype), intent(in), optional, pointer  tracktimes,
integer(i4b), dimension(:), intent(in), optional, pointer  izone,
real(dp), dimension(:), intent(in), optional, pointer  flowja,
real(dp), dimension(:), intent(in), optional, pointer  porosity,
real(dp), dimension(:), intent(in), optional, pointer  retfactor 
)
private

Definition at line 122 of file Method.f90.

124  class(MethodType), intent(inout) :: this
125  type(PrtFmiType), intent(in), pointer, optional :: fmi
126  class(CellType), intent(in), pointer, optional :: cell
127  class(SubcellType), intent(in), pointer, optional :: subcell
128  type(ParticleEventDispatcherType), intent(in), pointer, optional :: events
129  type(TimeSelectType), intent(in), pointer, optional :: tracktimes
130  integer(I4B), intent(in), pointer, optional :: izone(:)
131  real(DP), intent(in), pointer, optional :: flowja(:)
132  real(DP), intent(in), pointer, optional :: porosity(:)
133  real(DP), intent(in), pointer, optional :: retfactor(:)
134 
135  if (present(fmi)) this%fmi => fmi
136  if (present(cell)) this%cell => cell
137  if (present(subcell)) this%subcell => subcell
138  if (present(events)) this%events => events
139  if (present(tracktimes)) this%tracktimes => tracktimes
140  if (present(izone)) this%izone => izone
141  if (present(flowja)) this%flowja => flowja
142  if (present(porosity)) this%porosity => porosity
143  if (present(retfactor)) this%retfactor => retfactor

◆ load()

subroutine methodmodule::load ( class(methodtype), intent(inout)  this,
type(particletype), intent(inout), pointer  particle,
integer, intent(in)  next_level,
class(methodtype), intent(inout), pointer  submethod 
)
private

Definition at line 198 of file Method.f90.

199  class(MethodType), intent(inout) :: this
200  type(ParticleType), pointer, intent(inout) :: particle
201  integer, intent(in) :: next_level
202  class(MethodType), pointer, intent(inout) :: submethod
203  call pstop(1, "load must be overridden")
Here is the call graph for this function:

◆ pass()

subroutine methodmodule::pass ( class(methodtype), intent(inout)  this,
type(particletype), intent(inout), pointer  particle 
)
private

Definition at line 207 of file Method.f90.

208  class(MethodType), intent(inout) :: this
209  type(ParticleType), pointer, intent(inout) :: particle
210  call pstop(1, "pass must be overridden")
Here is the call graph for this function:

◆ pick_exit()

integer(i4b) function methodmodule::pick_exit ( class(methodtype), intent(inout)  this,
type(particletype), intent(inout), pointer  particle 
)
private

Definition at line 224 of file Method.f90.

225  class(MethodType), intent(inout) :: this
226  type(ParticleType), pointer, intent(inout) :: particle
227  integer(I4B) :: exit_soln
228  exit_soln = 0 ! suppress compiler warning
229  if (.not. this%delegates) &
230  call pstop(1, "pick_exit called on non-delegating method")
231  call pstop(1, "pick_exit must be overridden in delegating methods")
Here is the call graph for this function:

◆ release()

subroutine methodmodule::release ( class(methodtype), intent(inout)  this,
type(particletype), intent(inout), pointer  particle 
)
private

Definition at line 235 of file Method.f90.

236  class(MethodType), intent(inout) :: this
237  type(ParticleType), pointer, intent(inout) :: particle
238  class(ParticleEventType), pointer :: event
239  allocate (releaseeventtype :: event)
240  call this%events%dispatch(particle, event)
241  deallocate (event)

◆ terminate()

subroutine methodmodule::terminate ( class(methodtype), intent(inout)  this,
type(particletype), intent(inout), pointer  particle,
integer(i4b), intent(in), optional  status 
)
private

Definition at line 245 of file Method.f90.

246  class(MethodType), intent(inout) :: this
247  type(ParticleType), pointer, intent(inout) :: particle
248  integer(I4B), intent(in), optional :: status
249  class(ParticleEventType), pointer :: event
250  particle%advancing = .false.
251  if (present(status)) particle%istatus = status
252  allocate (terminationeventtype :: event)
253  call this%events%dispatch(particle, event)
254  deallocate (event)

◆ timestep()

subroutine methodmodule::timestep ( class(methodtype), intent(inout)  this,
type(particletype), intent(inout), pointer  particle 
)
private

Definition at line 258 of file Method.f90.

259  class(MethodType), intent(inout) :: this
260  type(ParticleType), pointer, intent(inout) :: particle
261  class(ParticleEventType), pointer :: event
262  allocate (timestepeventtype :: event)
263  call this%events%dispatch(particle, event)
264  deallocate (event)

◆ track()

recursive subroutine methodmodule::track ( class(methodtype), intent(inout)  this,
type(particletype), intent(inout), pointer  particle,
integer(i4b)  level,
real(dp), intent(in)  tmax 
)
private

Definition at line 148 of file Method.f90.

149  ! dummy
150  class(MethodType), intent(inout) :: this
151  type(ParticleType), pointer, intent(inout) :: particle
152  integer(I4B) :: level
153  real(DP), intent(in) :: tmax
154  ! local
155  logical(LGP) :: advancing
156  integer(I4B) :: nextlevel
157  class(methodType), pointer :: submethod
158 
159  advancing = .true.
160  nextlevel = level + 1
161  do while (advancing)
162  call this%load(particle, nextlevel, submethod)
163  call submethod%apply(particle, tmax)
164  call this%try_pass(particle, nextlevel, advancing)
165  end do

◆ try_pass()

subroutine methodmodule::try_pass ( class(methodtype), intent(inout)  this,
type(particletype), intent(inout), pointer  particle,
integer(i4b)  nextlevel,
logical(lgp)  advancing 
)
private

Definition at line 169 of file Method.f90.

170  class(MethodType), intent(inout) :: this
171  type(ParticleType), pointer, intent(inout) :: particle
172  integer(I4B) :: nextlevel
173  logical(LGP) :: advancing
174 
175  if (particle%advancing) then
176  ! if still advancing, pass to the next subdomain.
177  ! if that puts us on a boundary, then we're done.
178  call this%pass(particle)
179  if (particle%iboundary(nextlevel - 1) .ne. 0) &
180  advancing = .false.
181  else
182  ! otherwise we're already done so
183  ! reset the domain boundary value.
184  advancing = .false.
185  particle%iboundary = 0
186  end if

◆ usertime()

subroutine methodmodule::usertime ( class(methodtype), intent(inout)  this,
type(particletype), intent(inout), pointer  particle 
)
private

Definition at line 278 of file Method.f90.

279  class(MethodType), intent(inout) :: this
280  type(ParticleType), pointer, intent(inout) :: particle
281  class(ParticleEventType), pointer :: event
282  allocate (usertimeeventtype :: event)
283  call this%events%dispatch(particle, event)
284  deallocate (event)

◆ weaksink()

subroutine methodmodule::weaksink ( class(methodtype), intent(inout)  this,
type(particletype), intent(inout), pointer  particle 
)
private

Definition at line 268 of file Method.f90.

269  class(MethodType), intent(inout) :: this
270  type(ParticleType), pointer, intent(inout) :: particle
271  class(ParticleEventType), pointer :: event
272  allocate (weaksinkeventtype :: event)
273  call this%events%dispatch(particle, event)
274  deallocate (event)

Variable Documentation

◆ level_feature

@, public methodmodule::level_feature = 2

Definition at line 41 of file Method.f90.

41  enumerator :: LEVEL_FEATURE = 2

◆ level_model

@, public methodmodule::level_model = 1

Definition at line 40 of file Method.f90.

40  enumerator :: LEVEL_MODEL = 1

◆ level_subfeature

@, public methodmodule::level_subfeature = 3

Definition at line 42 of file Method.f90.

42  enumerator :: LEVEL_SUBFEATURE = 3