26 logical(LGP),
private :: has_mvr
45 integer(I4B) :: exchange_id
46 character(len=*) :: name
47 integer(I4B) :: model1_id
48 integer(I4B) :: model2_id
51 class(*),
pointer :: obj_ptr
54 call v_exg%create(name, exchange_id, model1_id, model2_id)
65 character(len=*) :: name
66 integer(I4B) :: exg_id
70 call this%VirtualExchangeType%create(name, exg_id, m1_id, m2_id)
73 call this%allocate_data()
74 call this%init_virtual_data()
76 this%has_mvr = .false.
83 logical(LGP) :: is_nodem1_local
84 logical(LGP) :: is_nodem2_local
86 is_nodem1_local = this%v_model1%is_local
87 is_nodem2_local = this%v_model2%is_local
88 call this%set(this%inmvr%base(),
'INMVR',
'',
map_all_type)
89 call this%set(this%mvr_maxmvr%base(),
'MAXMVR',
'MVR',
map_all_type)
91 call this%set(this%mvr_qpactual_m1%base(),
'QPACTUAL_M1',
'MVR', &
93 call this%set(this%mvr_qpactual_m2%base(),
'QPACTUAL_M2',
'MVR', &
95 call this%set(this%mvr_qavailable_m1%base(),
'QAVAILABLE_M1',
'MVR', &
97 call this%set(this%mvr_qavailable_m2%base(),
'QAVAILABLE_M2',
'MVR', &
99 call this%set(this%mvr_id_mapped_m1%base(),
'ID_MAPPED_M1',
'MVR', &
101 call this%set(this%mvr_id_mapped_m2%base(),
'ID_MAPPED_M2',
'MVR', &
108 integer(I4B) :: stage
113 call this%VirtualExchangeType%prepare_stage(stage)
122 if (this%inmvr%get() > 0)
then
123 this%has_mvr = .true.
129 if (this%inmvr%get() > 0)
then
136 if (this%inmvr%get() > 0)
then
137 nmax = this%mvr_maxmvr%get()
139 call this%map(this%mvr_qpactual_m1%base(), nmax, (/
stg_bfr_exg_fc/))
140 call this%map(this%mvr_qpactual_m2%base(), nmax, (/
stg_bfr_exg_fc/))
141 call this%map(this%mvr_qavailable_m1%base(), nmax, (/
stg_bfr_exg_fc/))
142 call this%map(this%mvr_qavailable_m2%base(), nmax, (/
stg_bfr_exg_fc/))
143 call this%map(this%mvr_id_mapped_m1%base(), nmax, (/
stg_aft_con_rp/))
144 call this%map(this%mvr_id_mapped_m2%base(), nmax, (/
stg_aft_con_rp/))
146 call this%map(this%mvr_qpactual_m1%base(), 0, (/
stg_never/))
147 call this%map(this%mvr_qpactual_m2%base(), 0, (/
stg_never/))
148 call this%map(this%mvr_qavailable_m1%base(), 0, (/
stg_never/))
149 call this%map(this%mvr_qavailable_m2%base(), 0, (/
stg_never/))
150 call this%map(this%mvr_id_mapped_m1%base(), 0, (/
stg_never/))
151 call this%map(this%mvr_id_mapped_m2%base(), 0, (/
stg_never/))
161 integer(I4B) :: stage
165 integer(I4B) :: qpactual_m1_idx, qpactual_m2_idx
166 integer(I4B) :: qavailable_m1_idx, qavailable_m2_idx
167 integer(I4B) :: id_mapped_m1_idx, id_mapped_m2_idx
168 class(*),
pointer :: vdi
171 call this%VirtualExchangeType%get_recv_items(stage, rank, &
176 vdi => this%mvr_qpactual_m1
177 qpactual_m1_idx = this%virtual_data_list%GetIndex(vdi)
178 vdi => this%mvr_qpactual_m2
179 qpactual_m2_idx = this%virtual_data_list%GetIndex(vdi)
180 vdi => this%mvr_qavailable_m1
181 qavailable_m1_idx = this%virtual_data_list%GetIndex(vdi)
182 vdi => this%mvr_qavailable_m2
183 qavailable_m2_idx = this%virtual_data_list%GetIndex(vdi)
184 vdi => this%mvr_id_mapped_m1
185 id_mapped_m1_idx = this%virtual_data_list%GetIndex(vdi)
186 vdi => this%mvr_id_mapped_m2
187 id_mapped_m2_idx = this%virtual_data_list%GetIndex(vdi)
189 if (this%v_model1%is_local .and. &
190 this%v_model2%orig_rank == rank)
then
193 if (this%mvr_qpactual_m2%check_stage(stage))
then
194 call virtual_items%push_back(qpactual_m2_idx)
196 if (this%mvr_qavailable_m2%check_stage(stage))
then
197 call virtual_items%push_back(qavailable_m2_idx)
199 if (this%mvr_id_mapped_m2%check_stage(stage))
then
200 call virtual_items%push_back(id_mapped_m2_idx)
202 else if (this%v_model2%is_local .and. &
203 this%v_model1%orig_rank == rank)
then
205 if (this%mvr_qpactual_m1%check_stage(stage))
then
206 call virtual_items%push_back(qpactual_m1_idx)
208 if (this%mvr_qavailable_m1%check_stage(stage))
then
209 call virtual_items%push_back(qavailable_m1_idx)
211 if (this%mvr_id_mapped_m1%check_stage(stage))
then
212 call virtual_items%push_back(id_mapped_m1_idx)
220 integer(I4B) :: stage
224 integer(I4B) :: qpactual_m1_idx, qpactual_m2_idx
225 integer(I4B) :: qavailable_m1_idx, qavailable_m2_idx
226 integer(I4B) :: id_mapped_m1_idx, id_mapped_m2_idx
227 class(*),
pointer :: vdi
230 call this%VirtualExchangeType%get_send_items(stage, rank, &
234 vdi => this%mvr_qpactual_m1
235 qpactual_m1_idx = this%virtual_data_list%GetIndex(vdi)
236 vdi => this%mvr_qpactual_m2
237 qpactual_m2_idx = this%virtual_data_list%GetIndex(vdi)
238 vdi => this%mvr_qavailable_m1
239 qavailable_m1_idx = this%virtual_data_list%GetIndex(vdi)
240 vdi => this%mvr_qavailable_m2
241 qavailable_m2_idx = this%virtual_data_list%GetIndex(vdi)
242 vdi => this%mvr_id_mapped_m1
243 id_mapped_m1_idx = this%virtual_data_list%GetIndex(vdi)
244 vdi => this%mvr_id_mapped_m2
245 id_mapped_m2_idx = this%virtual_data_list%GetIndex(vdi)
247 if (this%v_model1%is_local .and. &
248 this%v_model2%orig_rank == rank)
then
251 if (this%mvr_qpactual_m1%check_stage(stage))
then
252 call virtual_items%push_back(qpactual_m1_idx)
254 if (this%mvr_qavailable_m1%check_stage(stage))
then
255 call virtual_items%push_back(qavailable_m1_idx)
257 if (this%mvr_id_mapped_m1%check_stage(stage))
then
258 call virtual_items%push_back(id_mapped_m1_idx)
260 else if (this%v_model2%is_local .and. &
261 this%v_model1%orig_rank == rank)
then
263 if (this%mvr_qpactual_m2%check_stage(stage))
then
264 call virtual_items%push_back(qpactual_m2_idx)
266 if (this%mvr_qavailable_m2%check_stage(stage))
then
267 call virtual_items%push_back(qavailable_m2_idx)
269 if (this%mvr_id_mapped_m2%check_stage(stage))
then
270 call virtual_items%push_back(id_mapped_m2_idx)
280 logical(LGP) :: has_mover
282 has_mover = this%has_mvr
289 allocate (this%inmvr)
290 allocate (this%mvr_maxmvr)
291 allocate (this%mvr_qpactual_m1)
292 allocate (this%mvr_qpactual_m2)
293 allocate (this%mvr_qavailable_m1)
294 allocate (this%mvr_qavailable_m2)
295 allocate (this%mvr_id_mapped_m1)
296 allocate (this%mvr_id_mapped_m2)
303 deallocate (this%inmvr)
304 deallocate (this%mvr_maxmvr)
305 deallocate (this%mvr_qpactual_m1)
306 deallocate (this%mvr_qpactual_m2)
307 deallocate (this%mvr_qavailable_m1)
308 deallocate (this%mvr_qavailable_m2)
309 deallocate (this%mvr_id_mapped_m1)
310 deallocate (this%mvr_id_mapped_m2)
317 call this%VirtualExchangeType%destroy()
318 call this%deallocate_data()
This module defines variable data types.
integer(i4b), parameter, public stg_aft_con_ar
afterr connection allocate read
integer(i4b), parameter, public stg_aft_exg_df
after exchange define
integer(i4b), parameter, public stg_never
never
integer(i4b), parameter, public stg_aft_con_cr
after connection create
integer(i4b), parameter, public stg_bfr_exg_fc
before exchange formulate (per solution)
integer(i4b), parameter, public stg_bfr_con_ar
before connection allocate read
integer(i4b), parameter, public stg_aft_con_rp
after connection read prepare
integer(i4b), parameter, public map_all_type
integer(i4b), parameter, public vdc_gwfexg_type
type(listtype), public virtual_exchange_list
subroutine deallocate_data(this)
subroutine init_virtual_data(this)
subroutine allocate_data(this)
subroutine, public add_virtual_gwf_exchange(name, exchange_id, model1_id, model2_id)
Add a virtual GWF-GWF exchange to the simulation.
logical(lgp) function vfx_has_mover(this)
Override.
subroutine vfx_create(this, name, exg_id, m1_id, m2_id)
Create a virtual GWF-GWF exchange.
subroutine vfx_destroy(this)
subroutine vfx_get_recv_items(this, stage, rank, virtual_items)
subroutine vfx_get_send_items(this, stage, rank, virtual_items)
subroutine vfx_prepare_stage(this, stage)
The Virtual Exchange is based on two Virtual Models and is therefore not always strictly local or rem...
For synchronization of GWF specific exchange data: