MODFLOW 6  version 6.7.0.dev1
USGS Modular Hydrologic Model
MethodCellPassToBot.f90
Go to the documentation of this file.
2 
3  use kindmodule, only: dp, i4b
6  use prtfmimodule, only: prtfmitype
7  use basedismodule, only: disbasetype
8  use dismodule, only: distype
9  use disvmodule, only: disvtype
10  use particlemodule, only: particletype
11  use cellmodule, only: celltype
12  use subcellmodule, only: subcelltype
14  implicit none
15 
16  private
17  public :: methodcellpasstobottype
18  public :: create_method_cell_ptb
19 
21  private
22  contains
23  procedure, public :: apply => apply_ptb
24  procedure, public :: deallocate
26 
27 contains
28 
29  !> @brief Create a new pass-to-bottom tracking method
30  subroutine create_method_cell_ptb(method)
31  type(methodcellpasstobottype), pointer :: method
32  allocate (method)
33  allocate (method%name)
34  method%name = "passtobottom"
35  method%delegates = .false.
36  end subroutine create_method_cell_ptb
37 
38  !> @brief Deallocate the pass-to-bottom tracking method
39  subroutine deallocate (this)
40  class(methodcellpasstobottype), intent(inout) :: this
41  deallocate (this%name)
42  end subroutine deallocate
43 
44  !> @brief Pass particle vertically and instantaneously to the cell bottom
45  subroutine apply_ptb(this, particle, tmax)
46  use particlemodule, only: term_no_exits
47  ! dummy
48  class(methodcellpasstobottype), intent(inout) :: this
49  type(particletype), pointer, intent(inout) :: particle
50  real(DP), intent(in) :: tmax
51  ! local
52  integer(I4B) :: nlay
53 
54  ! Check termination/reporting conditions
55  call this%check(particle, this%cell%defn, tmax)
56  if (.not. particle%advancing) return
57 
58  ! Pass to bottom face
59  particle%z = this%cell%defn%bot
60  particle%iboundary(2) = this%cell%defn%npolyverts + 2
61 
62  ! Terminate if in bottom layer
63  select type (dis => this%fmi%dis)
64  type is (distype)
65  nlay = dis%nlay
66  type is (disvtype)
67  nlay = dis%nlay
68  end select
69  if (particle%ilay == nlay) then
70  particle%advancing = .false.
71  particle%istatus = term_no_exits
72  call this%save(particle, reason=3)
73  end if
74 
75  ! Save record
76  call this%save(particle, reason=1)
77  end subroutine apply_ptb
78 
subroutine, public create_defn(cellDefn)
Create a new cell definition object.
Definition: CellDefn.f90:42
Definition: Dis.f90:1
This module defines variable data types.
Definition: kind.f90:8
subroutine, public create_method_cell_ptb(method)
Create a new pass-to-bottom tracking method.
subroutine deallocate(this)
Deallocate the pass-to-bottom tracking method.
subroutine apply_ptb(this, particle, tmax)
Pass particle vertically and instantaneously to the cell bottom.
@ term_no_exits
terminated in a cell with no exit face
Definition: Particle.f90:35
Base grid cell definition.
Definition: CellDefn.f90:10
Base type for grid cells of a concrete type. Contains a cell-definition which is information shared b...
Definition: Cell.f90:13
Structured grid discretization.
Definition: Dis.f90:23
Vertex grid discretization.
Definition: Disv.f90:24
Particle tracked by the PRT model.
Definition: Particle.f90:78
A subcell of a cell.
Definition: Subcell.f90:9
Manages particle track (i.e. pathline) files.