MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
virtualgwtmodelmodule Module Reference

Data Types

type  virtualgwtmodeltype
 

Functions/Subroutines

subroutine, public add_virtual_gwt_model (model_id, model_name, model)
 
subroutine vgwt_create (this, name, id, model)
 
subroutine init_virtual_data (this)
 
subroutine vgwt_prepare_stage (this, stage)
 
subroutine allocate_data (this)
 
subroutine deallocate_data (this)
 
subroutine vgwt_destroy (this)
 

Function/Subroutine Documentation

◆ add_virtual_gwt_model()

subroutine, public virtualgwtmodelmodule::add_virtual_gwt_model ( integer(i4b)  model_id,
character(len=*)  model_name,
class(numericalmodeltype), pointer  model 
)
Parameters
model_idglobal model id
model_namemodel name
modelthe actual model (can be null() when remote)

Definition at line 46 of file VirtualGwtModel.f90.

48  integer(I4B) :: model_id !< global model id
49  character(len=*) :: model_name !< model name
50  class(NumericalModelType), pointer :: model !< the actual model (can be null() when remote)
51  ! local
52  class(VirtualGwtModelType), pointer :: virtual_gwt_model
53  class(*), pointer :: obj
54 
55  allocate (virtual_gwt_model)
56  call virtual_gwt_model%create(model_name, model_id, model)
57 
58  obj => virtual_gwt_model
59  call virtual_model_list%Add(obj)
60 
type(listtype), public virtual_model_list
Here is the caller graph for this function:

◆ allocate_data()

subroutine virtualgwtmodelmodule::allocate_data ( class(virtualgwtmodeltype this)
private

Definition at line 152 of file VirtualGwtModel.f90.

153  class(VirtualGwtModelType) :: this
154 
155  allocate (this%dsp_idiffc)
156  allocate (this%dsp_idisp)
157  allocate (this%dsp_diffc)
158  allocate (this%dsp_alh)
159  allocate (this%dsp_alv)
160  allocate (this%dsp_ath1)
161  allocate (this%dsp_ath2)
162  allocate (this%dsp_atv)
163  allocate (this%fmi_gwfhead)
164  allocate (this%fmi_gwfsat)
165  allocate (this%fmi_gwfspdis)
166  allocate (this%fmi_gwfflowja)
167  allocate (this%mst_thetam)
168  allocate (this%indsp)
169  allocate (this%inmst)
170 

◆ deallocate_data()

subroutine virtualgwtmodelmodule::deallocate_data ( class(virtualgwtmodeltype this)
private

Definition at line 173 of file VirtualGwtModel.f90.

174  class(VirtualGwtModelType) :: this
175 
176  deallocate (this%dsp_idiffc)
177  deallocate (this%dsp_idisp)
178  deallocate (this%dsp_diffc)
179  deallocate (this%dsp_alh)
180  deallocate (this%dsp_alv)
181  deallocate (this%dsp_ath1)
182  deallocate (this%dsp_ath2)
183  deallocate (this%dsp_atv)
184  deallocate (this%fmi_gwfhead)
185  deallocate (this%fmi_gwfsat)
186  deallocate (this%fmi_gwfspdis)
187  deallocate (this%fmi_gwfflowja)
188  deallocate (this%mst_thetam)
189  deallocate (this%indsp)
190  deallocate (this%inmst)
191 

◆ init_virtual_data()

subroutine virtualgwtmodelmodule::init_virtual_data ( class(virtualgwtmodeltype this)
private

Definition at line 78 of file VirtualGwtModel.f90.

79  class(VirtualGwtModelType) :: this
80 
81  call this%set(this%dsp_idiffc%base(), 'IDIFFC', 'DSP', map_all_type)
82  call this%set(this%dsp_idisp%base(), 'IDISP', 'DSP', map_all_type)
83  call this%set(this%dsp_diffc%base(), 'DIFFC', 'DSP', map_node_type)
84  call this%set(this%dsp_alh%base(), 'ALH', 'DSP', map_node_type)
85  call this%set(this%dsp_alv%base(), 'ALV', 'DSP', map_node_type)
86  call this%set(this%dsp_ath1%base(), 'ATH1', 'DSP', map_node_type)
87  call this%set(this%dsp_ath2%base(), 'ATH2', 'DSP', map_node_type)
88  call this%set(this%dsp_atv%base(), 'ATV', 'DSP', map_node_type)
89  call this%set(this%fmi_gwfhead%base(), 'GWFHEAD', 'FMI', map_node_type)
90  call this%set(this%fmi_gwfsat%base(), 'GWFSAT', 'FMI', map_node_type)
91  call this%set(this%fmi_gwfspdis%base(), 'GWFSPDIS', 'FMI', map_node_type)
92  call this%set(this%fmi_gwfflowja%base(), 'GWFFLOWJA', 'FMI', map_conn_type)
93  call this%set(this%mst_thetam%base(), 'THETAM', 'MST', map_node_type)
94  call this%set(this%indsp%base(), 'INDSP', '', map_all_type)
95  call this%set(this%inmst%base(), 'INMST', '', map_all_type)
96 

◆ vgwt_create()

subroutine virtualgwtmodelmodule::vgwt_create ( class(virtualgwtmodeltype this,
character(len=*)  name,
integer(i4b)  id,
class(numericalmodeltype), pointer  model 
)

Definition at line 63 of file VirtualGwtModel.f90.

64  class(VirtualGwtModelType) :: this
65  character(len=*) :: name
66  integer(I4B) :: id
67  class(NumericalModelType), pointer :: model
68 
69  ! create base
70  call this%VirtualModelType%create(name, id, model)
71  this%container_type = vdc_gwtmodel_type
72 
73  call this%allocate_data()
74  call this%init_virtual_data()
75 

◆ vgwt_destroy()

subroutine virtualgwtmodelmodule::vgwt_destroy ( class(virtualgwtmodeltype this)
private

Definition at line 194 of file VirtualGwtModel.f90.

195  class(VirtualGwtModelType) :: this
196 
197  call this%VirtualModelType%destroy()
198  call this%deallocate_data()
199 

◆ vgwt_prepare_stage()

subroutine virtualgwtmodelmodule::vgwt_prepare_stage ( class(virtualgwtmodeltype this,
integer(i4b)  stage 
)
private

Definition at line 99 of file VirtualGwtModel.f90.

100  class(VirtualGwtModelType) :: this
101  integer(I4B) :: stage
102  ! local
103  integer(I4B) :: nr_nodes, nr_conns
104 
105  ! prepare base (=numerical) model data items
106  call this%VirtualModelType%prepare_stage(stage)
107 
108  nr_nodes = 0
109  nr_conns = 0
110 
111  if (stage == stg_aft_mdl_df) then
112 
113  call this%map(this%dsp_idiffc%base(), (/stg_aft_mdl_df/))
114  call this%map(this%dsp_idisp%base(), (/stg_aft_mdl_df/))
115  call this%map(this%indsp%base(), (/stg_aft_mdl_df/))
116  call this%map(this%inmst%base(), (/stg_aft_mdl_df/))
117 
118  else if (stage == stg_bfr_con_ar) then
119 
120  nr_nodes = this%element_maps(map_node_type)%nr_virt_elems
121  nr_conns = this%element_maps(map_conn_type)%nr_virt_elems
122 
123  call this%map(this%x%base(), nr_nodes, &
124  (/stg_bfr_con_ar, stg_bfr_exg_ad, stg_bfr_exg_cf/))
125  call this%map(this%ibound%base(), nr_nodes, (/stg_bfr_con_ar/))
126 
127  if (this%dsp_idiffc%get() > 0) then
128  call this%map(this%dsp_diffc%base(), nr_nodes, (/stg_bfr_con_ar/))
129  end if
130 
131  if (this%dsp_idisp%get() > 0) then
132  call this%map(this%dsp_alh%base(), nr_nodes, (/stg_bfr_con_ar/))
133  call this%map(this%dsp_alv%base(), nr_nodes, (/stg_bfr_con_ar/))
134  call this%map(this%dsp_ath1%base(), nr_nodes, (/stg_bfr_con_ar/))
135  call this%map(this%dsp_ath2%base(), nr_nodes, (/stg_bfr_con_ar/))
136  call this%map(this%dsp_atv%base(), nr_nodes, (/stg_bfr_con_ar/))
137  end if
138 
139  call this%map(this%fmi_gwfhead%base(), nr_nodes, (/stg_bfr_exg_ad/))
140  call this%map(this%fmi_gwfsat%base(), nr_nodes, (/stg_bfr_exg_ad/))
141  call this%map(this%fmi_gwfspdis%base(), 3, nr_nodes, (/stg_bfr_exg_ad/))
142  call this%map(this%fmi_gwfflowja%base(), nr_conns, (/stg_bfr_exg_ad/))
143 
144  if (this%indsp%get() > 0 .and. this%inmst%get() > 0) then
145  call this%map(this%mst_thetam%base(), nr_nodes, (/stg_aft_con_ar/))
146  end if
147 
148  end if
149