MODFLOW 6  version 6.8.0.dev0
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 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 38 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 264 of file Method.f90.

265  class(MethodType), intent(inout) :: this
266  type(ParticleType), pointer, intent(inout) :: particle
267  class(ParticleEventType), pointer :: event
268  allocate (droppedeventtype :: event)
269  call this%events%broadcast(particle, event)
270  deallocate (event)

◆ get_level()

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

Definition at line 187 of file Method.f90.

188  class(MethodType), intent(in) :: this
189  integer(I4B) :: level
190  level = -1 ! suppress compiler warning
191  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 119 of file Method.f90.

121  class(MethodType), intent(inout) :: this
122  type(PrtFmiType), intent(in), pointer, optional :: fmi
123  class(CellType), intent(in), pointer, optional :: cell
124  class(SubcellType), intent(in), pointer, optional :: subcell
125  type(ParticleEventDispatcherType), intent(in), pointer, optional :: events
126  type(TimeSelectType), intent(in), pointer, optional :: tracktimes
127  integer(I4B), intent(in), pointer, optional :: izone(:)
128  real(DP), intent(in), pointer, optional :: flowja(:)
129  real(DP), intent(in), pointer, optional :: porosity(:)
130  real(DP), intent(in), pointer, optional :: retfactor(:)
131 
132  if (present(fmi)) this%fmi => fmi
133  if (present(cell)) this%cell => cell
134  if (present(subcell)) this%subcell => subcell
135  if (present(events)) this%events => events
136  if (present(tracktimes)) this%tracktimes => tracktimes
137  if (present(izone)) this%izone => izone
138  if (present(flowja)) this%flowja => flowja
139  if (present(porosity)) this%porosity => porosity
140  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 195 of file Method.f90.

196  class(MethodType), intent(inout) :: this
197  type(ParticleType), pointer, intent(inout) :: particle
198  integer, intent(in) :: next_level
199  class(MethodType), pointer, intent(inout) :: submethod
200  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 204 of file Method.f90.

205  class(MethodType), intent(inout) :: this
206  type(ParticleType), pointer, intent(inout) :: particle
207  call pstop(1, "pass must be overridden")
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 211 of file Method.f90.

212  class(MethodType), intent(inout) :: this
213  type(ParticleType), pointer, intent(inout) :: particle
214  class(ParticleEventType), pointer :: event
215  allocate (releaseeventtype :: event)
216  call this%events%broadcast(particle, event)
217  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 221 of file Method.f90.

222  class(MethodType), intent(inout) :: this
223  type(ParticleType), pointer, intent(inout) :: particle
224  integer(I4B), intent(in), optional :: status
225  class(ParticleEventType), pointer :: event
226  particle%advancing = .false.
227  if (present(status)) particle%istatus = status
228  allocate (terminationeventtype :: event)
229  call this%events%broadcast(particle, event)
230  deallocate (event)

◆ timestep()

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

Definition at line 234 of file Method.f90.

235  class(MethodType), intent(inout) :: this
236  type(ParticleType), pointer, intent(inout) :: particle
237  class(ParticleEventType), pointer :: event
238  allocate (timestepeventtype :: event)
239  call this%events%broadcast(particle, event)
240  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 145 of file Method.f90.

146  ! dummy
147  class(MethodType), intent(inout) :: this
148  type(ParticleType), pointer, intent(inout) :: particle
149  integer(I4B) :: level
150  real(DP), intent(in) :: tmax
151  ! local
152  logical(LGP) :: advancing
153  integer(I4B) :: nextlevel
154  class(methodType), pointer :: submethod
155 
156  advancing = .true.
157  nextlevel = level + 1
158  do while (advancing)
159  call this%load(particle, nextlevel, submethod)
160  call submethod%apply(particle, tmax)
161  call this%try_pass(particle, nextlevel, advancing)
162  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 166 of file Method.f90.

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

◆ usertime()

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

Definition at line 254 of file Method.f90.

255  class(MethodType), intent(inout) :: this
256  type(ParticleType), pointer, intent(inout) :: particle
257  class(ParticleEventType), pointer :: event
258  allocate (usertimeeventtype :: event)
259  call this%events%broadcast(particle, event)
260  deallocate (event)

◆ weaksink()

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

Definition at line 244 of file Method.f90.

245  class(MethodType), intent(inout) :: this
246  type(ParticleType), pointer, intent(inout) :: particle
247  class(ParticleEventType), pointer :: event
248  allocate (weaksinkeventtype :: event)
249  call this%events%broadcast(particle, event)
250  deallocate (event)

Variable Documentation

◆ level_feature

@, public methodmodule::level_feature = 2

Definition at line 40 of file Method.f90.

40  enumerator :: LEVEL_FEATURE = 2

◆ level_model

@, public methodmodule::level_model = 1

Definition at line 39 of file Method.f90.

39  enumerator :: LEVEL_MODEL = 1

◆ level_subfeature

@, public methodmodule::level_subfeature = 3

Definition at line 41 of file Method.f90.

41  enumerator :: LEVEL_SUBFEATURE = 3