MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
NumericalExchange.f90
Go to the documentation of this file.
2 
3  use kindmodule, only: dp, i4b
7  use listmodule, only: listtype
9 
10  implicit none
11 
12  private
13  public :: numericalexchangetype, &
15 
17  character(len=7) :: typename !< name of the type (e.g., 'GWF-GWF')
18 
19  contains
20 
21  procedure :: exg_df
22  procedure :: exg_ac
23  procedure :: exg_mc
24  procedure :: exg_ar
25  !procedure :: exg_rp (not needed yet; base exg_rp does nothing)
26  procedure :: exg_ad
27  procedure :: exg_cf
28  procedure :: exg_fc
29  procedure :: exg_cc
30  procedure :: exg_cq
31  procedure :: exg_bd
32  procedure :: exg_ot
33  procedure :: exg_da
34  procedure :: get_iasym
35  end type numericalexchangetype
36 
37 contains
38 
39  !> @brief Define the exchange
40  !<
41  subroutine exg_df(this)
42  ! -- modules
45  ! -- dummy
46  class(numericalexchangetype) :: this
47  end subroutine exg_df
48 
49  !> @brief If an implicit exchange then add connections to sparse
50  !<
51  subroutine exg_ac(this, sparse)
52  ! -- modules
53  use sparsemodule, only: sparsematrix
54  ! -- dummy
55  class(numericalexchangetype) :: this
56  type(sparsematrix), intent(inout) :: sparse
57  end subroutine exg_ac
58 
59  !> @brief Map the connections in the global matrix
60  !<
61  subroutine exg_mc(this, matrix_sln)
62  ! -- module
63  use sparsemodule, only: sparsematrix
64  ! -- dummy
65  class(numericalexchangetype) :: this
66  class(matrixbasetype), pointer :: matrix_sln
67  !
68  ! -- Return
69  end subroutine exg_mc
70 
71  !> @brief Allocate and read
72  !<
73  subroutine exg_ar(this)
74  !
75  class(numericalexchangetype) :: this
76  end subroutine exg_ar
77 
78  !> @brief Advance
79  !<
80  subroutine exg_ad(this)
81  ! -- dummy
82  class(numericalexchangetype) :: this
83  end subroutine exg_ad
84 
85  !> @brief Calculate conductance, and for explicit exchanges, set the
86  !! conductance in the boundary package
87  !<
88  subroutine exg_cf(this, kiter)
89  ! -- dummy
90  class(numericalexchangetype) :: this
91  integer(I4B), intent(in) :: kiter
92  end subroutine exg_cf
93 
94  !> @brief Fill the matrix
95  !<
96  subroutine exg_fc(this, kiter, matrix_sln, rhs_sln, inwtflag)
97  ! -- dummy
98  class(numericalexchangetype) :: this
99  integer(I4B), intent(in) :: kiter
100  class(matrixbasetype), pointer :: matrix_sln
101  real(DP), dimension(:), intent(inout) :: rhs_sln
102  integer(I4B), optional, intent(in) :: inwtflag
103  end subroutine exg_fc
104 
105  !> @brief Additional convergence check
106  !<
107  subroutine exg_cc(this, icnvg)
108  ! -- dummy
109  class(numericalexchangetype) :: this
110  integer(I4B), intent(inout) :: icnvg
111  end subroutine exg_cc
112 
113  !> @brief Calculate flow
114  !<
115  subroutine exg_cq(this, icnvg, isuppress_output, isolnid)
116  ! -- modules
117  use constantsmodule, only: lenbudtxt
118  ! -- dummy
119  class(numericalexchangetype) :: this
120  integer(I4B), intent(inout) :: icnvg
121  integer(I4B), intent(in) :: isuppress_output
122  integer(I4B), intent(in) :: isolnid
123  end subroutine exg_cq
124 
125  !> @brief Exchange budget
126  !<
127  subroutine exg_bd(this, icnvg, isuppress_output, isolnid)
128  ! -- modules
129  use constantsmodule, only: lenbudtxt
130  ! -- dummy
131  class(numericalexchangetype) :: this
132  integer(I4B), intent(inout) :: icnvg
133  integer(I4B), intent(in) :: isuppress_output
134  integer(I4B), intent(in) :: isolnid
135  end subroutine exg_bd
136 
137  !> @brief Output
138  !<
139  subroutine exg_ot(this)
140  ! -- dummy
141  class(numericalexchangetype) :: this
142  end subroutine exg_ot
143 
144  !> @brief Deallocate memory
145  !<
146  subroutine exg_da(this)
147  ! -- modules
149  ! -- dummy
150  class(numericalexchangetype) :: this
151  end subroutine exg_da
152 
153  function get_iasym(this) result(iasym)
154  ! -- dummy
155  class(numericalexchangetype) :: this
156  ! -- return
157  integer(I4B) :: iasym
158  !
159  iasym = 0
160  end function get_iasym
161 
162  function castasnumericalexchangeclass(obj) result(res)
163  implicit none
164  ! -- dummy
165  class(*), pointer, intent(inout) :: obj
166  ! -- return
167  class(numericalexchangetype), pointer :: res
168  !
169  res => null()
170  if (.not. associated(obj)) return
171  !
172  select type (obj)
173  class is (numericalexchangetype)
174  res => obj
175  end select
176  end function castasnumericalexchangeclass
177 
178  !> @brief Add numerical exchange to a list
179  !<
180  subroutine addnumericalexchangetolist(list, exchange)
181  implicit none
182  ! -- dummy
183  type(listtype), intent(inout) :: list
184  class(numericalexchangetype), pointer, intent(in) :: exchange
185  ! -- local
186  class(*), pointer :: obj
187  !
188  obj => exchange
189  call list%Add(obj)
190  end subroutine addnumericalexchangetolist
191 
192  !> @brief Retrieve a specific numerical exchange from a list
193  !<
194  function getnumericalexchangefromlist(list, idx) result(res)
195  implicit none
196  ! -- dummy
197  type(listtype), intent(inout) :: list
198  integer(I4B), intent(in) :: idx
199  class(numericalexchangetype), pointer :: res
200  ! -- local
201  class(*), pointer :: obj
202  !
203  obj => list%GetItem(idx)
204  res => castasnumericalexchangeclass(obj)
205  end function getnumericalexchangefromlist
206 
207 end module numericalexchangemodule
subroutine, public addbaseexchangetolist(list, exchange)
Add the exchange object (BaseExchangeType) to a list.
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
Definition: Constants.f90:37
integer(i4b) function, public getunit()
Get a free unit number.
subroutine, public openfile(iu, iout, fname, ftype, fmtarg_opt, accarg_opt, filstat_opt, mode_opt)
Open a file.
Definition: InputOutput.f90:30
This module defines variable data types.
Definition: kind.f90:8
class(numericalexchangetype) function, pointer, public getnumericalexchangefromlist(list, idx)
Retrieve a specific numerical exchange from a list.
subroutine exg_ot(this)
Output.
subroutine exg_mc(this, matrix_sln)
Map the connections in the global matrix.
subroutine, public addnumericalexchangetolist(list, exchange)
Add numerical exchange to a list.
subroutine exg_ad(this)
Advance.
class(numericalexchangetype) function, pointer castasnumericalexchangeclass(obj)
subroutine exg_bd(this, icnvg, isuppress_output, isolnid)
Exchange budget.
subroutine exg_cf(this, kiter)
Calculate conductance, and for explicit exchanges, set the conductance in the boundary package.
subroutine exg_cc(this, icnvg)
Additional convergence check.
subroutine exg_cq(this, icnvg, isuppress_output, isolnid)
Calculate flow.
subroutine exg_da(this)
Deallocate memory.
subroutine exg_ac(this, sparse)
If an implicit exchange then add connections to sparse.
integer(i4b) function get_iasym(this)
subroutine exg_fc(this, kiter, matrix_sln, rhs_sln, inwtflag)
Fill the matrix.
Highest level model type. All models extend this parent type.
Definition: BaseModel.f90:13
A generic heterogeneous doubly-linked list.
Definition: List.f90:14