MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
gwtinterfacemodelmodule Module Reference

Data Types

type  gwtinterfacemodeltype
 The GWT Interface Model is a utility to calculate the solution's exchange coefficients from the interface between a GWT model and its GWT neighbors. The interface model itself will not be part of the solution, it is not being solved. More...
 

Functions/Subroutines

subroutine gwtifmod_cr (this, name, iout, gridConn)
 Create the interface model, analogously to what. More...
 
subroutine allocate_scalars (this, modelname)
 Allocate scalars associated with the interface model object. More...
 
subroutine allocate_fmi (this)
 Allocate a Flow Model Interface (FMI) object for the interface model. More...
 
subroutine gwtifmod_df (this)
 Define the GWT interface model. More...
 
subroutine gwtifmod_ar (this)
 Override allocate and read the GWT interface model and its packages so that we can create stuff from memory instead of input files. More...
 
subroutine gwtifmod_da (this)
 Clean up resources. More...
 

Function/Subroutine Documentation

◆ allocate_fmi()

subroutine gwtinterfacemodelmodule::allocate_fmi ( class(gwtinterfacemodeltype this)
private
Parameters
thisthe GWT interface model

Definition at line 111 of file GwtInterfaceModel.f90.

112  ! -- dummy
113  class(GwtInterfaceModelType) :: this !< the GWT interface model
114  !
115  call mem_allocate(this%fmi%gwfflowja, this%nja, 'GWFFLOWJA', &
116  this%fmi%memoryPath)
117  call mem_allocate(this%fmi%gwfhead, this%neq, 'GWFHEAD', &
118  this%fmi%memoryPath)
119  call mem_allocate(this%fmi%gwfsat, this%neq, 'GWFSAT', &
120  this%fmi%memoryPath)
121  call mem_allocate(this%fmi%gwfspdis, 3, this%neq, 'GWFSPDIS', &
122  this%fmi%memoryPath)

◆ allocate_scalars()

subroutine gwtinterfacemodelmodule::allocate_scalars ( class(gwtinterfacemodeltype this,
character(len=*), intent(in)  modelname 
)
private
Parameters
thisthe GWT interface model
[in]modelnamethe model name

Definition at line 97 of file GwtInterfaceModel.f90.

98  ! -- dummy
99  class(GwtInterfaceModelType) :: this !< the GWT interface model
100  character(len=*), intent(in) :: modelname !< the model name
101  !
102  call this%GwtModelType%allocate_scalars(modelname)
103  !
104  call mem_allocate(this%iAdvScheme, 'ADVSCHEME', this%memoryPath)
105  call mem_allocate(this%ixt3d, 'IXT3D', this%memoryPath)
106  call mem_allocate(this%ieqnsclfac, 'IEQNSCLFAC', this%memoryPath)

◆ gwtifmod_ar()

subroutine gwtinterfacemodelmodule::gwtifmod_ar ( class(gwtinterfacemodeltype this)
private
Parameters
thisthe GWT interface model

Definition at line 185 of file GwtInterfaceModel.f90.

186  ! -- dummy
187  class(GwtInterfaceModelType) :: this !< the GWT interface model
188  !
189  call this%fmi%fmi_ar(this%ibound)
190  if (this%inadv > 0) then
191  call this%adv%adv_ar(this%dis, this%ibound)
192  end if
193  if (this%indsp > 0) then
194  call this%dsp%dsp_ar(this%ibound, this%mst%thetam)
195  end if

◆ gwtifmod_cr()

subroutine gwtinterfacemodelmodule::gwtifmod_cr ( class(gwtinterfacemodeltype this,
character(len=*), intent(in)  name,
integer(i4b), intent(in)  iout,
class(gridconnectiontype), intent(in), pointer  gridConn 
)
Parameters
thisthe GWT interface model
[in]namethe interface model's name
[in]ioutthe output unit
[in]gridconnthe grid connection data for creating a DISU

Definition at line 49 of file GwtInterfaceModel.f90.

50  ! -- dummy
51  class(GwtInterfaceModelType) :: this !< the GWT interface model
52  character(len=*), intent(in) :: name !< the interface model's name
53  integer(I4B), intent(in) :: iout !< the output unit
54  class(GridConnectionType), pointer, intent(in) :: gridConn !< the grid connection data for creating a DISU
55  ! local
56  class(*), pointer :: modelPtr
57  integer(I4B), target :: inobs
58  integer(I4B) :: adv_unit, dsp_unit
59  !
60  this%memoryPath = create_mem_path(name)
61  call this%allocate_scalars(name)
62  !
63  ! defaults
64  this%iAdvScheme = 0
65  this%ixt3d = 0
66  this%ieqnsclfac = done
67  !
68  this%iout = iout
69  this%gridConnection => gridconn
70  modelptr => gridconn%model
71  this%owner => castasgwtmodel(modelptr)
72  !
73  inobs = 0
74  adv_unit = 0
75  dsp_unit = 0
76  if (this%owner%inadv > 0) then
77  this%inadv = huge(1_i4b)
78  adv_unit = huge(1_i4b)
79  end if
80  if (this%owner%indsp > 0) then
81  this%indsp = huge(1_i4b)
82  dsp_unit = huge(1_i4b)
83  end if
84  !
85  ! create dis and packages
86  call disu_cr(this%dis, this%name, '', -1, this%iout)
87  call fmi_cr(this%fmi, this%name, 0, this%iout, this%ieqnsclfac, &
88  this%depvartype)
89  call adv_cr(this%adv, this%name, adv_unit, this%iout, this%fmi, &
90  this%ieqnsclfac)
91  call dsp_cr(this%dsp, this%name, '', -dsp_unit, this%iout, this%fmi)
92  call tsp_obs_cr(this%obs, inobs, this%depvartype)
Here is the call graph for this function:

◆ gwtifmod_da()

subroutine gwtinterfacemodelmodule::gwtifmod_da ( class(gwtinterfacemodeltype this)
private
Parameters
thisthe GWT interface model

Definition at line 200 of file GwtInterfaceModel.f90.

201  ! -- dummy
202  class(GwtInterfaceModelType) :: this !< the GWT interface model
203  !
204 
205  ! this
206  call mem_deallocate(this%iAdvScheme)
207  call mem_deallocate(this%ixt3d)
208  call mem_deallocate(this%ieqnsclfac)
209  !
210  ! gwt packages
211  call this%dis%dis_da()
212  call this%fmi%fmi_da()
213  call this%adv%adv_da()
214  call this%dsp%dsp_da()
215  !
216  deallocate (this%dis)
217  deallocate (this%fmi)
218  deallocate (this%adv)
219  deallocate (this%dsp)
220  !
221  if (associated(this%mst)) then
222  call mem_deallocate(this%mst%thetam)
223  deallocate (this%mst)
224  end if
225  !
226  ! gwt scalars
227  call mem_deallocate(this%inic)
228  call mem_deallocate(this%infmi)
229  call mem_deallocate(this%inadv)
230  call mem_deallocate(this%indsp)
231  call mem_deallocate(this%inssm)
232  call mem_deallocate(this%inmst)
233  call mem_deallocate(this%inmvt)
234  call mem_deallocate(this%inoc)
235  call mem_deallocate(this%inobs)
236  call mem_deallocate(this%eqnsclfac)
237  !
238  ! base
239  call this%NumericalModelType%model_da()

◆ gwtifmod_df()

subroutine gwtinterfacemodelmodule::gwtifmod_df ( class(gwtinterfacemodeltype this)
private
Parameters
thisthe GWT interface model

Definition at line 127 of file GwtInterfaceModel.f90.

128  ! -- dummy
129  class(GwtInterfaceModelType) :: this !< the GWT interface model
130  ! -- local
131  class(*), pointer :: disPtr
132  type(TspAdvOptionsType) :: adv_options
133  type(GwtDspOptionsType) :: dsp_options
134  !
135  this%moffset = 0
136  adv_options%iAdvScheme = this%iAdvScheme
137  dsp_options%ixt3d = this%ixt3d
138  !
139  ! define DISU
140  disptr => this%dis
141  call this%gridConnection%getDiscretization(castasdisutype(disptr))
142  call this%fmi%fmi_df(this%dis, 1)
143  !
144  if (this%inadv > 0) then
145  call this%adv%adv_df(adv_options)
146  end if
147  if (this%indsp > 0) then
148  this%dsp%idiffc = this%owner%dsp%idiffc
149  this%dsp%idisp = this%owner%dsp%idisp
150  call this%dsp%dsp_df(this%dis, dsp_options)
151  if (this%dsp%idiffc > 0) then
152  call mem_reallocate(this%dsp%diffc, this%dis%nodes, 'DIFFC', &
153  trim(this%dsp%memoryPath))
154  end if
155  if (this%dsp%idisp > 0) then
156  call mem_reallocate(this%dsp%alh, this%dis%nodes, 'ALH', &
157  trim(this%dsp%memoryPath))
158  call mem_reallocate(this%dsp%alv, this%dis%nodes, 'ALV', &
159  trim(this%dsp%memoryPath))
160  call mem_reallocate(this%dsp%ath1, this%dis%nodes, 'ATH1', &
161  trim(this%dsp%memoryPath))
162  call mem_reallocate(this%dsp%ath2, this%dis%nodes, 'ATH2', &
163  trim(this%dsp%memoryPath))
164  call mem_reallocate(this%dsp%atv, this%dis%nodes, 'ATV', &
165  trim(this%dsp%memoryPath))
166  end if
167  allocate (this%mst)
168  call mem_allocate(this%mst%thetam, this%dis%nodes, &
169  'THETAM', create_mem_path(this%name, 'MST'))
170  end if
171  !
172  ! assign or point model members to dis members
173  this%neq = this%dis%nodes
174  this%nja = this%dis%nja
175  this%ia => this%dis%con%ia
176  this%ja => this%dis%con%ja
177  !
178  ! allocate model arrays, now that neq and nja are assigned
179  call this%allocate_arrays()
Here is the call graph for this function: