MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
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  !
48  ! -- Return
49  return
50  end subroutine exg_df
51 
52  !> @brief If an implicit exchange then add connections to sparse
53  !<
54  subroutine exg_ac(this, sparse)
55  ! -- modules
56  use sparsemodule, only: sparsematrix
57  ! -- dummy
58  class(numericalexchangetype) :: this
59  type(sparsematrix), intent(inout) :: sparse
60  !
61  ! -- Return
62  return
63  end subroutine exg_ac
64 
65  !> @brief Map the connections in the global matrix
66  !<
67  subroutine exg_mc(this, matrix_sln)
68  ! -- module
69  use sparsemodule, only: sparsematrix
70  ! -- dummy
71  class(numericalexchangetype) :: this
72  class(matrixbasetype), pointer :: matrix_sln
73  !
74  ! -- Return
75  end subroutine exg_mc
76 
77  !> @brief Allocate and read
78  !<
79  subroutine exg_ar(this)
80  !
81  class(numericalexchangetype) :: this
82  !
83  ! -- Return
84  return
85  end subroutine exg_ar
86 
87  !> @brief Advance
88  !<
89  subroutine exg_ad(this)
90  ! -- dummy
91  class(numericalexchangetype) :: this
92  !
93  ! -- Return
94  return
95  end subroutine exg_ad
96 
97  !> @brief Calculate conductance, and for explicit exchanges, set the
98  !! conductance in the boundary package
99  !<
100  subroutine exg_cf(this, kiter)
101  ! -- dummy
102  class(numericalexchangetype) :: this
103  integer(I4B), intent(in) :: kiter
104  !
105  ! -- Return
106  return
107  end subroutine exg_cf
108 
109  !> @brief Fill the matrix
110  !<
111  subroutine exg_fc(this, kiter, matrix_sln, rhs_sln, inwtflag)
112  ! -- dummy
113  class(numericalexchangetype) :: this
114  integer(I4B), intent(in) :: kiter
115  class(matrixbasetype), pointer :: matrix_sln
116  real(DP), dimension(:), intent(inout) :: rhs_sln
117  integer(I4B), optional, intent(in) :: inwtflag
118  !
119  ! -- Return
120  return
121  end subroutine exg_fc
122 
123  !> @brief Additional convergence check
124  !<
125  subroutine exg_cc(this, icnvg)
126  ! -- dummy
127  class(numericalexchangetype) :: this
128  integer(I4B), intent(inout) :: icnvg
129  !
130  ! -- Return
131  return
132  end subroutine exg_cc
133 
134  !> @brief Calculate flow
135  !<
136  subroutine exg_cq(this, icnvg, isuppress_output, isolnid)
137  ! -- modules
138  use constantsmodule, only: lenbudtxt
139  ! -- dummy
140  class(numericalexchangetype) :: this
141  integer(I4B), intent(inout) :: icnvg
142  integer(I4B), intent(in) :: isuppress_output
143  integer(I4B), intent(in) :: isolnid
144  !
145  ! -- Return
146  return
147  end subroutine exg_cq
148 
149  !> @brief Exchange budget
150  !<
151  subroutine exg_bd(this, icnvg, isuppress_output, isolnid)
152  ! -- modules
153  use constantsmodule, only: lenbudtxt
154  ! -- dummy
155  class(numericalexchangetype) :: this
156  integer(I4B), intent(inout) :: icnvg
157  integer(I4B), intent(in) :: isuppress_output
158  integer(I4B), intent(in) :: isolnid
159  !
160  ! -- Return
161  return
162  end subroutine exg_bd
163 
164  !> @brief Output
165  !<
166  subroutine exg_ot(this)
167  ! -- dummy
168  class(numericalexchangetype) :: this
169  !
170  ! -- Return
171  return
172  end subroutine exg_ot
173 
174  !> @brief Deallocate memory
175  !<
176  subroutine exg_da(this)
177  ! -- modules
179  ! -- dummy
180  class(numericalexchangetype) :: this
181  !
182  ! -- Return
183  return
184  end subroutine exg_da
185 
186  function get_iasym(this) result(iasym)
187  ! -- dummy
188  class(numericalexchangetype) :: this
189  ! -- return
190  integer(I4B) :: iasym
191  !
192  iasym = 0
193  !
194  ! -- Return
195  return
196  end function get_iasym
197 
198  function castasnumericalexchangeclass(obj) result(res)
199  implicit none
200  ! -- dummy
201  class(*), pointer, intent(inout) :: obj
202  ! -- return
203  class(numericalexchangetype), pointer :: res
204  !
205  res => null()
206  if (.not. associated(obj)) return
207  !
208  select type (obj)
209  class is (numericalexchangetype)
210  res => obj
211  end select
212  !
213  ! -- Return
214  return
215  end function castasnumericalexchangeclass
216 
217  !> @brief Add numerical exchange to a list
218  !<
219  subroutine addnumericalexchangetolist(list, exchange)
220  implicit none
221  ! -- dummy
222  type(listtype), intent(inout) :: list
223  class(numericalexchangetype), pointer, intent(in) :: exchange
224  ! -- local
225  class(*), pointer :: obj
226  !
227  obj => exchange
228  call list%Add(obj)
229  !
230  ! -- Return
231  return
232  end subroutine addnumericalexchangetolist
233 
234  !> @brief Retrieve a specific numerical exchange from a list
235  !<
236  function getnumericalexchangefromlist(list, idx) result(res)
237  implicit none
238  ! -- dummy
239  type(listtype), intent(inout) :: list
240  integer(I4B), intent(in) :: idx
241  class(numericalexchangetype), pointer :: res
242  ! -- local
243  class(*), pointer :: obj
244  !
245  obj => list%GetItem(idx)
246  res => castasnumericalexchangeclass(obj)
247  !
248  ! -- Return
249  return
250  end function getnumericalexchangefromlist
251 
252 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:36
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:10