24 logical(LGP) :: quantities_mapped
26 logical(LGP),
private :: has_mvt
45 character(len=*) :: name
46 integer(I4B) :: exchange_id
49 character(len=*) :: qtype
52 class(*),
pointer :: obj_ptr
56 call v_exg%create(name, exchange_id, m1_id, m2_id)
57 if (qtype ==
"concentration")
then
59 else if (qtype ==
"temperature")
then
71 character(len=*) :: name
72 integer(I4B) :: exg_id
77 call this%VirtualExchangeType%create(name, exg_id, m1_id, m2_id)
79 call this%allocate_data()
80 call this%init_virtual_data()
82 this%quantities_mapped = .false.
83 this%has_mvt = .false.
90 call this%set(this%inmvt%base(),
'INMVT',
'',
map_all_type)
91 call this%set(this%gwfsimvals%base(),
'GWFSIMVALS',
'',
map_all_type)
92 call this%set(this%mvt_maxmvt%base(),
'MAXMVT',
'MVT',
map_all_type)
93 call this%set(this%mvt_quantity_m1%base(),
'QUANTITY_M1',
'MVT', &
95 call this%set(this%mvt_quantity_m2%base(),
'QUANTITY_M2',
'MVT', &
102 integer(I4B) :: stage
104 integer(I4B) :: nexg, nmax
107 call this%VirtualExchangeType%prepare_stage(stage)
117 if (this%inmvt%get() > 0)
then
118 this%has_mvt = .true.
123 nexg = this%nexg%get()
127 if (this%has_mvt .and. this%is_local)
then
135 if (this%has_mvt .and. this%is_local) nmax = this%mvt_maxmvt%get()
138 if (.not. this%quantities_mapped)
then
140 call this%map(this%mvt_quantity_m1%base(), nmax, (/
stg_bfr_exg_fc/))
141 call this%map(this%mvt_quantity_m2%base(), nmax, (/
stg_bfr_exg_fc/))
143 call this%map(this%mvt_quantity_m1%base(), 0, (/
stg_never/))
144 call this%map(this%mvt_quantity_m2%base(), 0, (/
stg_never/))
146 this%quantities_mapped = .true.
159 call this%VirtualExchangeType%get_recv_items(stg, rank, vi)
163 if (this%is_local .and. rank == this%orig_rank)
then
164 if (this%mvt_quantity_m1%is_remote)
then
166 call this%add_vdi_for_stage(this%mvt_quantity_m1%base(), stg, vi)
168 if (this%mvt_quantity_m2%is_remote)
then
170 call this%add_vdi_for_stage(this%mvt_quantity_m2%base(), stg, vi)
183 call this%VirtualExchangeType%get_send_items(stg, rank, vi)
187 if (this%is_local .and. rank == this%orig_rank)
then
188 if (.not. this%mvt_quantity_m1%is_remote)
then
190 call this%add_vdi_for_stage(this%mvt_quantity_m1%base(), stg, vi)
192 if (.not. this%mvt_quantity_m2%is_remote)
then
194 call this%add_vdi_for_stage(this%mvt_quantity_m2%base(), stg, vi)
204 logical(LGP) :: has_mover
206 has_mover = this%has_mvt
213 call this%VirtualExchangeType%destroy()
214 call this%deallocate_data()
221 allocate (this%inmvt)
222 allocate (this%gwfsimvals)
223 allocate (this%mvt_maxmvt)
224 allocate (this%mvt_quantity_m1)
225 allocate (this%mvt_quantity_m2)
232 deallocate (this%inmvt)
233 deallocate (this%gwfsimvals)
234 deallocate (this%mvt_maxmvt)
235 deallocate (this%mvt_quantity_m1)
236 deallocate (this%mvt_quantity_m2)
This module defines variable data types.
integer(i4b), parameter, public stg_aft_exg_df
after exchange define
integer(i4b), parameter, public stg_bfr_exg_ad
before exchange advance (per solution)
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 map_all_type
integer(i4b), parameter, public vdc_gwtexg_type
integer(i4b), parameter, public vdc_gweexg_type
type(listtype), public virtual_exchange_list
subroutine deallocate_data(this)
subroutine init_virtual_data(this)
subroutine allocate_data(this)
subroutine vtx_create(this, name, exg_id, m1_id, m2_id)
Create a virtual GWT-GWT exchange.
subroutine vtx_get_recv_items(this, stg, rank, vi)
subroutine vtx_destroy(this)
subroutine vtx_prepare_stage(this, stage)
subroutine, public add_virtual_tsp_exchange(name, exchange_id, m1_id, m2_id, qtype)
Add a virtual GWT-GWT or GWE-GWE exchange to the simulation.
subroutine vtx_get_send_items(this, stg, rank, vi)
logical(lgp) function vtx_has_mover(this)
Override.
The Virtual Exchange is based on two Virtual Models and is therefore not always strictly local or rem...
GWE and GWT work fully analogously, so we can do with only one virtual exchange for both,...