MODFLOW 6  version 6.7.0.dev3
USGS Modular Hydrologic Model
virtualgwemodelmodule Module Reference

Data Types

type  virtualgwemodeltype
 

Functions/Subroutines

subroutine, public add_virtual_gwe_model (model_id, model_name, model)
 
subroutine vgwe_create (this, name, id, model)
 
subroutine init_virtual_data (this)
 
subroutine vgwe_prepare_stage (this, stage)
 
subroutine allocate_data (this)
 
subroutine deallocate_data (this)
 
subroutine vgwe_destroy (this)
 

Function/Subroutine Documentation

◆ add_virtual_gwe_model()

subroutine, public virtualgwemodelmodule::add_virtual_gwe_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 47 of file VirtualGweModel.f90.

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

◆ allocate_data()

subroutine virtualgwemodelmodule::allocate_data ( class(virtualgwemodeltype this)
private

Definition at line 162 of file VirtualGweModel.f90.

163  class(VirtualGweModelType) :: this
164 
165  allocate (this%cnd_idisp)
166  allocate (this%cnd_alh)
167  allocate (this%cnd_alv)
168  allocate (this%cnd_ath1)
169  allocate (this%cnd_ath2)
170  allocate (this%cnd_atv)
171  allocate (this%cnd_ktw)
172  allocate (this%cnd_kts)
173  allocate (this%fmi_igwfspdis)
174  allocate (this%fmi_gwfhead)
175  allocate (this%fmi_gwfsat)
176  allocate (this%fmi_gwfspdis)
177  allocate (this%fmi_gwfflowja)
178  allocate (this%est_porosity)
179  allocate (this%incnd)
180  allocate (this%inest)
181 

◆ deallocate_data()

subroutine virtualgwemodelmodule::deallocate_data ( class(virtualgwemodeltype this)
private

Definition at line 184 of file VirtualGweModel.f90.

185  class(VirtualGweModelType) :: this
186 
187  deallocate (this%cnd_idisp)
188  deallocate (this%cnd_alh)
189  deallocate (this%cnd_alv)
190  deallocate (this%cnd_ath1)
191  deallocate (this%cnd_ath2)
192  deallocate (this%cnd_atv)
193  deallocate (this%cnd_ktw)
194  deallocate (this%cnd_kts)
195  deallocate (this%fmi_igwfspdis)
196  deallocate (this%fmi_gwfhead)
197  deallocate (this%fmi_gwfsat)
198  deallocate (this%fmi_gwfspdis)
199  deallocate (this%fmi_gwfflowja)
200  deallocate (this%est_porosity)
201  deallocate (this%incnd)
202  deallocate (this%inest)
203 

◆ init_virtual_data()

subroutine virtualgwemodelmodule::init_virtual_data ( class(virtualgwemodeltype this)
private

Definition at line 79 of file VirtualGweModel.f90.

80  class(VirtualGweModelType) :: this
81 
82  call this%set(this%cnd_idisp%base(), 'IDISP', 'CND', map_all_type)
83  call this%set(this%cnd_alh%base(), 'ALH', 'CND', map_node_type)
84  call this%set(this%cnd_alv%base(), 'ALV', 'CND', map_node_type)
85  call this%set(this%cnd_ath1%base(), 'ATH1', 'CND', map_node_type)
86  call this%set(this%cnd_ath2%base(), 'ATH2', 'CND', map_node_type)
87  call this%set(this%cnd_atv%base(), 'ATV', 'CND', map_node_type)
88  call this%set(this%cnd_ktw%base(), 'KTW', 'CND', map_node_type)
89  call this%set(this%cnd_kts%base(), 'KTS', 'CND', map_node_type)
90  call this%set(this%fmi_igwfspdis%base(), 'IGWFSPDIS', 'FMI', map_all_type)
91  call this%set(this%fmi_gwfhead%base(), 'GWFHEAD', 'FMI', map_node_type)
92  call this%set(this%fmi_gwfsat%base(), 'GWFSAT', 'FMI', map_node_type)
93  call this%set(this%fmi_gwfspdis%base(), 'GWFSPDIS', 'FMI', map_node_type)
94  call this%set(this%fmi_gwfflowja%base(), 'GWFFLOWJA', 'FMI', map_conn_type)
95  call this%set(this%est_porosity%base(), 'POROSITY', 'EST', map_node_type)
96  call this%set(this%incnd%base(), 'INCND', '', map_all_type)
97  call this%set(this%inest%base(), 'INEST', '', map_all_type)
98 

◆ vgwe_create()

subroutine virtualgwemodelmodule::vgwe_create ( class(virtualgwemodeltype this,
character(len=*)  name,
integer(i4b)  id,
class(numericalmodeltype), pointer  model 
)

Definition at line 64 of file VirtualGweModel.f90.

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

◆ vgwe_destroy()

subroutine virtualgwemodelmodule::vgwe_destroy ( class(virtualgwemodeltype this)
private

Definition at line 206 of file VirtualGweModel.f90.

207  class(VirtualGweModelType) :: this
208 
209  call this%VirtualModelType%destroy()
210  call this%deallocate_data()
211 

◆ vgwe_prepare_stage()

subroutine virtualgwemodelmodule::vgwe_prepare_stage ( class(virtualgwemodeltype this,
integer(i4b)  stage 
)
private

Definition at line 101 of file VirtualGweModel.f90.

102  class(VirtualGweModelType) :: this
103  integer(I4B) :: stage
104  ! local
105  integer(I4B) :: nr_nodes, nr_conns
106 
107  ! prepare base (=numerical) model data items
108  call this%VirtualModelType%prepare_stage(stage)
109 
110  nr_nodes = 0
111  nr_conns = 0
112 
113  if (stage == stg_aft_mdl_df) then
114 
115  call this%map(this%cnd_idisp%base(), (/stg_aft_mdl_df/))
116  call this%map(this%incnd%base(), (/stg_aft_mdl_df/))
117  call this%map(this%inest%base(), (/stg_aft_mdl_df/))
118 
119  else if (stage == stg_bfr_con_ar) then
120 
121  nr_nodes = this%element_maps(map_node_type)%nr_virt_elems
122  nr_conns = this%element_maps(map_conn_type)%nr_virt_elems
123 
124  call this%map(this%x%base(), nr_nodes, &
125  (/stg_bfr_con_ar, stg_bfr_exg_ad, stg_bfr_exg_cf/))
126  call this%map(this%ibound%base(), nr_nodes, (/stg_bfr_con_ar/))
127 
128  call this%map(this%fmi_igwfspdis%base(), (/stg_bfr_con_ar/))
129 
130  if (this%cnd_idisp%get() > 0) then
131  call this%map(this%cnd_alh%base(), nr_nodes, (/stg_bfr_con_ar/))
132  call this%map(this%cnd_alv%base(), nr_nodes, (/stg_bfr_con_ar/))
133  call this%map(this%cnd_ath1%base(), nr_nodes, (/stg_bfr_con_ar/))
134  call this%map(this%cnd_ath2%base(), nr_nodes, (/stg_bfr_con_ar/))
135  call this%map(this%cnd_atv%base(), nr_nodes, (/stg_bfr_con_ar/))
136  call this%map(this%cnd_ktw%base(), nr_nodes, (/stg_bfr_con_ar/))
137  call this%map(this%cnd_kts%base(), nr_nodes, (/stg_bfr_con_ar/))
138  end if
139 
140  if (this%incnd%get() > 0 .and. this%inest%get() > 0) then
141  call this%map(this%est_porosity%base(), nr_nodes, (/stg_aft_con_ar/))
142  end if
143 
144  else if (stage == stg_aft_con_ar) then
145 
146  nr_nodes = this%element_maps(map_node_type)%nr_virt_elems
147  nr_conns = this%element_maps(map_conn_type)%nr_virt_elems
148 
149  call this%map(this%fmi_gwfhead%base(), nr_nodes, (/stg_bfr_exg_ad/))
150  call this%map(this%fmi_gwfsat%base(), nr_nodes, (/stg_bfr_exg_ad/))
151  if (this%fmi_igwfspdis%get() > 0) then
152  call this%map(this%fmi_gwfspdis%base(), 3, nr_nodes, (/stg_bfr_exg_ad/))
153  else
154  call this%map(this%fmi_gwfspdis%base(), 3, 0, (/stg_never/))
155  end if
156  call this%map(this%fmi_gwfflowja%base(), nr_conns, (/stg_bfr_exg_ad/))
157 
158  end if
159