MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
virtualexchangemodule::virtualexchangetype Type Reference

The Virtual Exchange is based on two Virtual Models and is therefore not always strictly local or remote. We have to consider three different cases: More...

Inheritance diagram for virtualexchangemodule::virtualexchangetype:
Inheritance graph
Collaboration diagram for virtualexchangemodule::virtualexchangetype:
Collaboration graph

Public Member Functions

procedure create (this, name, exg_id, m1_id, m2_id)
 Create the virtual exchange base.
procedure prepare_stage (this, stage)
procedure get_send_items (this, stg, rank, vi)
procedure get_recv_items (this, stg, rank, vi)
procedure has_mover (this)
 Checks if there is an active mover in the exchange.
procedure destroy (this)
procedure add_vdi_for_stage (this, vdata_item, stage, virtual_items)
 Convenience routine to add virtual data item to a list.
procedure vdc_create (this, name, id, is_local)
generic map (this, vd, stages)
generic map (this, vd, nrow, stages)
generic map (this, vd, ncol, nrow, stages)
procedure prepare_stage (this, stage)
procedure link_items (this, stage)
 Link all local data items to memory.
procedure set_element_map (this, src_indexes, map_id)
 Add the source indexes associated with map_id as a element map to this container, such that.
procedure get_vrt_mem_path (this, var_name, subcomp_name)
 Get virtual memory path for a certain variable.
procedure destroy (this)
procedure set_orig_rank (this, rank)
procedure get_send_items (this, stg, rank, vi)
 Get indexes of virtual data items to be.
procedure get_recv_items (this, stg, rank, vi)
 Get indexes of virtual data items to be.
procedure get_virtual_data (this, var_name, subcomp_name)
procedure print_items (this, imon, items)
procedure set (this, field, var_name, subcmp_name, map_id, is_local)
 Init virtual data item, without allocation, and store it in this container. The 'is_local' flag makes it possible to mark some fields local in an.

Public Attributes

class(virtualmodeltype), pointer v_model1 => null()
class(virtualmodeltype), pointer v_model2 => null()
type(virtualinttype), pointer nexg => null()
type(virtualinttype), pointer naux => null()
type(virtualinttype), pointer ianglex => null()
type(virtualint1dtype), pointer nodem1 => null()
type(virtualint1dtype), pointer nodem2 => null()
type(virtualint1dtype), pointer ihc => null()
type(virtualdbl1dtype), pointer cl1 => null()
type(virtualdbl1dtype), pointer cl2 => null()
type(virtualdbl1dtype), pointer hwva => null()
type(virtualdbl2dtype), pointer auxvar => null()
integer(i4b) id
 unique identifier matching with the real counterpart
integer(i4b) container_type
 to identify the actual type of this container
character(lencomponentname) name
 container name (model, exchange, ...) used in the memory path
character(lencontextname) vmem_ctx
 prefixes virtual memory located on remote processes
logical(lgp) is_local
 when true, the physical object resides on the same process. However, some of its variables can still be remote
logical(lgp) is_active
 when true, this container is being synchronized
integer(i4b) orig_rank
 the global rank of the process which holds the physical data for this container, for exchanges this is set to be where model1 sits, or if model1 is local, where model2 sits
type(stlvecint) rcv_ranks
 the ranks of processes, other than orig_rank, having this container active (only guaranteed to be complete after synchronization)
type(listtype) virtual_data_list
 a list with all virtual data items for this container
type(vdcelementmaptype), dimension(nr_vdc_element_maps) element_maps
 a list with all element maps
type(vdcelementluttype), dimension(nr_vdc_element_maps) element_luts
 lookup tables from remote index to local index

Private Member Functions

procedure, private init_virtual_data (this)
procedure, private allocate_data (this)
procedure, private deallocate_data (this)
procedure, private add_to_list (this, virtual_data)
procedure, private map_scalar (this, vd, stages)
procedure, private map_array1d (this, vd, nrow, stages)
procedure, private map_array2d (this, vd, ncol, nrow, stages)
procedure, private map_internal (this, vd, shape, stages)
procedure, private vdc_get_virtual_data (this, var_name, subcomp_name)
procedure, private get_items_for_stage (this, stage, virtual_items)

Detailed Description

1) both virtual models are local

RECV: In this case this virtual data container will have no data items to receive from other processes. SEND: Whenever it is called to send its virtual data items to other processes, it simply sends everything.

2) one model is local, one model is remote

Consequently, there is another exchange which has the reverse, we call this our dual exchange.

RECV: The sender is our dual exchange, and we have all data except its list of reduced model node numbers, either thisnodem1 or thisnodem2. We receive the missing array. Receiving from a sender that is not the dual exchange cannot occur.

SEND: here we have to consider two cases a) The receiver is our dual exchange, we return the favor and send the list of model node numbers that is present on this process, this would be either thisnodem1 or thisnodem2 b) The receiver is not the dual exchange. And here we will send everything.

3) both models are remote

RECV: we will receive everything. In case the source exchange is fully local, i.e. type 1) above, we get all the data at the first attempt. Otherwise, it will take a second attempt before all the data is in. (To allow for two attempts, the nodem1 and nodem2 arrays are registered to be synchronized at two consecutive stages)

SEND: nothing to be sent.

Exchange mover data follows the pattern described above for nodem1/m2 except that when both models are remote, none of the mover data is will be synchronized.

This behavior is different from the general VirtualDataContainer, so the get_send_items and get_recv_items subroutines are overridden accordingly. Additionally, for case 2) the container will have a mix of

Definition at line 68 of file VirtualExchange.f90.

Member Function/Subroutine Documentation

◆ add_to_list()

procedure, private virtualdatacontainermodule::virtualdatacontainertype::add_to_list ( class(virtualdatacontainertype) this,
class(virtualdatatype), pointer virtual_data )
privateinherited

Definition at line 86 of file VirtualDataContainer.f90.

◆ add_vdi_for_stage()

procedure virtualexchangemodule::virtualexchangetype::add_vdi_for_stage ( class(virtualexchangetype) this,
class(virtualdatatype), pointer vdata_item,
integer(i4b) stage,
type(stlvecint) virtual_items )

Definition at line 91 of file VirtualExchange.f90.

◆ allocate_data()

procedure, private virtualexchangemodule::virtualexchangetype::allocate_data ( class(virtualexchangetype) this)
private

Definition at line 94 of file VirtualExchange.f90.

◆ create()

procedure virtualexchangemodule::virtualexchangetype::create ( class(virtualexchangetype) this,
character(len=*) name,
integer(i4b) exg_id,
integer(i4b) m1_id,
integer(i4b) m2_id )

Definition at line 84 of file VirtualExchange.f90.

◆ deallocate_data()

procedure, private virtualexchangemodule::virtualexchangetype::deallocate_data ( class(virtualexchangetype) this)
private

Definition at line 95 of file VirtualExchange.f90.

◆ destroy() [1/2]

procedure virtualdatacontainermodule::virtualdatacontainertype::destroy ( class(virtualdatacontainertype) this)
inherited

Definition at line 77 of file VirtualDataContainer.f90.

◆ destroy() [2/2]

procedure virtualexchangemodule::virtualexchangetype::destroy ( class(virtualexchangetype) this)

Definition at line 89 of file VirtualExchange.f90.

◆ get_items_for_stage()

procedure, private virtualdatacontainermodule::virtualdatacontainertype::get_items_for_stage ( class(virtualdatacontainertype) this,
integer(i4b) stage,
type(stlvecint) virtual_items )
privateinherited

Definition at line 92 of file VirtualDataContainer.f90.

◆ get_recv_items() [1/2]

procedure virtualdatacontainermodule::virtualdatacontainertype::get_recv_items ( class(virtualdatacontainertype) this,
integer(i4b) stg,
integer(i4b) rank,
type(stlvecint) vi )
inherited

Definition at line 80 of file VirtualDataContainer.f90.

◆ get_recv_items() [2/2]

procedure virtualexchangemodule::virtualexchangetype::get_recv_items ( class(virtualexchangetype) this,
integer(i4b) stg,
integer(i4b) rank,
type(stlvecint) vi )

Definition at line 87 of file VirtualExchange.f90.

◆ get_send_items() [1/2]

procedure virtualdatacontainermodule::virtualdatacontainertype::get_send_items ( class(virtualdatacontainertype) this,
integer(i4b) stg,
integer(i4b) rank,
type(stlvecint) vi )
inherited

Definition at line 79 of file VirtualDataContainer.f90.

◆ get_send_items() [2/2]

procedure virtualexchangemodule::virtualexchangetype::get_send_items ( class(virtualexchangetype) this,
integer(i4b) stg,
integer(i4b) rank,
type(stlvecint) vi )

Definition at line 86 of file VirtualExchange.f90.

◆ get_virtual_data()

procedure virtualdatacontainermodule::virtualdatacontainertype::get_virtual_data ( class(virtualdatacontainertype) this,
character(len=*) var_name,
character(len=*) subcomp_name )
inherited

Definition at line 81 of file VirtualDataContainer.f90.

◆ get_vrt_mem_path()

procedure virtualdatacontainermodule::virtualdatacontainertype::get_vrt_mem_path ( class(virtualdatacontainertype) this,
character(len=*) var_name,
character(len=*) subcomp_name )
inherited

Definition at line 76 of file VirtualDataContainer.f90.

◆ has_mover()

procedure virtualexchangemodule::virtualexchangetype::has_mover ( class(virtualexchangetype) this)

Definition at line 88 of file VirtualExchange.f90.

◆ init_virtual_data()

procedure, private virtualexchangemodule::virtualexchangetype::init_virtual_data ( class(virtualexchangetype) this)
private

Definition at line 93 of file VirtualExchange.f90.

◆ link_items()

procedure virtualdatacontainermodule::virtualdatacontainertype::link_items ( class(virtualdatacontainertype) this,
integer(i4b) stage )
inherited

Definition at line 74 of file VirtualDataContainer.f90.

◆ map() [1/3]

generic virtualdatacontainermodule::virtualdatacontainertype::map ( class(virtualdatacontainertype) this,
class(virtualdatatype), pointer vd,
integer(i4b) ncol,
integer(i4b) nrow,
integer(i4b), dimension(:) stages )
inherited

Definition at line 72 of file VirtualDataContainer.f90.

◆ map() [2/3]

generic virtualdatacontainermodule::virtualdatacontainertype::map ( class(virtualdatacontainertype) this,
class(virtualdatatype), pointer vd,
integer(i4b) nrow,
integer(i4b), dimension(:) stages )
inherited

Definition at line 72 of file VirtualDataContainer.f90.

◆ map() [3/3]

generic virtualdatacontainermodule::virtualdatacontainertype::map ( class(virtualdatacontainertype) this,
class(virtualdatatype), pointer vd,
integer(i4b), dimension(:) stages )
inherited

Definition at line 72 of file VirtualDataContainer.f90.

Here is the call graph for this function:

◆ map_array1d()

procedure, private virtualdatacontainermodule::virtualdatacontainertype::map_array1d ( class(virtualdatacontainertype) this,
class(virtualdatatype), pointer vd,
integer(i4b) nrow,
integer(i4b), dimension(:) stages )
privateinherited

Definition at line 88 of file VirtualDataContainer.f90.

◆ map_array2d()

procedure, private virtualdatacontainermodule::virtualdatacontainertype::map_array2d ( class(virtualdatacontainertype) this,
class(virtualdatatype), pointer vd,
integer(i4b) ncol,
integer(i4b) nrow,
integer(i4b), dimension(:) stages )
privateinherited

Definition at line 89 of file VirtualDataContainer.f90.

◆ map_internal()

procedure, private virtualdatacontainermodule::virtualdatacontainertype::map_internal ( class(virtualdatacontainertype) this,
class(virtualdatatype), pointer vd,
integer(i4b), dimension(:) shape,
integer(i4b), dimension(:) stages )
privateinherited

Definition at line 90 of file VirtualDataContainer.f90.

◆ map_scalar()

procedure, private virtualdatacontainermodule::virtualdatacontainertype::map_scalar ( class(virtualdatacontainertype) this,
class(virtualdatatype), pointer vd,
integer(i4b), dimension(:) stages )
privateinherited

Definition at line 87 of file VirtualDataContainer.f90.

◆ prepare_stage() [1/2]

procedure virtualdatacontainermodule::virtualdatacontainertype::prepare_stage ( class(virtualdatacontainertype) this,
integer(i4b) stage )
inherited

Definition at line 73 of file VirtualDataContainer.f90.

◆ prepare_stage() [2/2]

procedure virtualexchangemodule::virtualexchangetype::prepare_stage ( class(virtualexchangetype) this,
integer(i4b) stage )

Definition at line 85 of file VirtualExchange.f90.

◆ print_items()

procedure virtualdatacontainermodule::virtualdatacontainertype::print_items ( class(virtualdatacontainertype) this,
integer(i4b) imon,
type(stlvecint) items )
inherited

Definition at line 82 of file VirtualDataContainer.f90.

◆ set()

procedure virtualdatacontainermodule::virtualdatacontainertype::set ( class(virtualdatacontainertype) this,
class(virtualdatatype), pointer field,
character(len=*) var_name,
character(len=*) subcmp_name,
integer(i4b) map_id,
logical(lgp), optional is_local )
inherited

Definition at line 84 of file VirtualDataContainer.f90.

◆ set_element_map()

procedure virtualdatacontainermodule::virtualdatacontainertype::set_element_map ( class(virtualdatacontainertype) this,
integer(i4b), dimension(:), pointer, contiguous src_indexes,
integer(i4b) map_id )
inherited

Definition at line 75 of file VirtualDataContainer.f90.

◆ set_orig_rank()

procedure virtualdatacontainermodule::virtualdatacontainertype::set_orig_rank ( class(virtualdatacontainertype) this,
integer(i4b) rank )
inherited

Definition at line 78 of file VirtualDataContainer.f90.

◆ vdc_create()

procedure virtualdatacontainermodule::virtualdatacontainertype::vdc_create ( class(virtualdatacontainertype) this,
character(len=*) name,
integer(i4b) id,
logical(lgp) is_local )
inherited

Definition at line 71 of file VirtualDataContainer.f90.

◆ vdc_get_virtual_data()

procedure, private virtualdatacontainermodule::virtualdatacontainertype::vdc_get_virtual_data ( class(virtualdatacontainertype) this,
character(len=*) var_name,
character(len=*) subcomp_name )
privateinherited

Definition at line 91 of file VirtualDataContainer.f90.

Member Data Documentation

◆ auxvar

type(virtualdbl2dtype), pointer virtualexchangemodule::virtualexchangetype::auxvar => null()

Definition at line 82 of file VirtualExchange.f90.

◆ cl1

type(virtualdbl1dtype), pointer virtualexchangemodule::virtualexchangetype::cl1 => null()

Definition at line 79 of file VirtualExchange.f90.

◆ cl2

type(virtualdbl1dtype), pointer virtualexchangemodule::virtualexchangetype::cl2 => null()

Definition at line 80 of file VirtualExchange.f90.

◆ container_type

integer(i4b) virtualdatacontainermodule::virtualdatacontainertype::container_type
inherited

Definition at line 55 of file VirtualDataContainer.f90.

55 integer(I4B) :: container_type !< to identify the actual type of this container

◆ element_luts

type(vdcelementluttype), dimension(nr_vdc_element_maps) virtualdatacontainermodule::virtualdatacontainertype::element_luts
inherited

Definition at line 69 of file VirtualDataContainer.f90.

69 type(VdcElementLutType), dimension(NR_VDC_ELEMENT_MAPS) :: element_luts !< lookup tables from remote index to local index

◆ element_maps

type(vdcelementmaptype), dimension(nr_vdc_element_maps) virtualdatacontainermodule::virtualdatacontainertype::element_maps
inherited

Definition at line 68 of file VirtualDataContainer.f90.

68 type(VdcElementMapType), dimension(NR_VDC_ELEMENT_MAPS) :: element_maps !< a list with all element maps

◆ hwva

type(virtualdbl1dtype), pointer virtualexchangemodule::virtualexchangetype::hwva => null()

Definition at line 81 of file VirtualExchange.f90.

◆ ianglex

type(virtualinttype), pointer virtualexchangemodule::virtualexchangetype::ianglex => null()

Definition at line 74 of file VirtualExchange.f90.

◆ id

integer(i4b) virtualdatacontainermodule::virtualdatacontainertype::id
inherited

Definition at line 54 of file VirtualDataContainer.f90.

54 integer(I4B) :: id !< unique identifier matching with the real counterpart

◆ ihc

type(virtualint1dtype), pointer virtualexchangemodule::virtualexchangetype::ihc => null()

Definition at line 78 of file VirtualExchange.f90.

◆ is_active

logical(lgp) virtualdatacontainermodule::virtualdatacontainertype::is_active
inherited

Definition at line 60 of file VirtualDataContainer.f90.

60 logical(LGP) :: is_active !< when true, this container is being synchronized

◆ is_local

logical(lgp) virtualdatacontainermodule::virtualdatacontainertype::is_local
inherited

Definition at line 58 of file VirtualDataContainer.f90.

58 logical(LGP) :: is_local !< when true, the physical object resides on the same process. However,

◆ name

character(lencomponentname) virtualdatacontainermodule::virtualdatacontainertype::name
inherited

Definition at line 56 of file VirtualDataContainer.f90.

56 character(LENCOMPONENTNAME) :: name !< container name (model, exchange, ...) used in the memory path

◆ naux

type(virtualinttype), pointer virtualexchangemodule::virtualexchangetype::naux => null()

Definition at line 73 of file VirtualExchange.f90.

◆ nexg

type(virtualinttype), pointer virtualexchangemodule::virtualexchangetype::nexg => null()

Definition at line 72 of file VirtualExchange.f90.

◆ nodem1

type(virtualint1dtype), pointer virtualexchangemodule::virtualexchangetype::nodem1 => null()

Definition at line 76 of file VirtualExchange.f90.

◆ nodem2

type(virtualint1dtype), pointer virtualexchangemodule::virtualexchangetype::nodem2 => null()

Definition at line 77 of file VirtualExchange.f90.

◆ orig_rank

integer(i4b) virtualdatacontainermodule::virtualdatacontainertype::orig_rank
inherited

Definition at line 61 of file VirtualDataContainer.f90.

61 integer(I4B) :: orig_rank !< the global rank of the process which holds the physical data for this container,

◆ rcv_ranks

type(stlvecint) virtualdatacontainermodule::virtualdatacontainertype::rcv_ranks
inherited

Definition at line 64 of file VirtualDataContainer.f90.

64 type(STLVecInt) :: rcv_ranks !< the ranks of processes, other than orig_rank, having this container active

◆ v_model1

class(virtualmodeltype), pointer virtualexchangemodule::virtualexchangetype::v_model1 => null()

Definition at line 69 of file VirtualExchange.f90.

◆ v_model2

class(virtualmodeltype), pointer virtualexchangemodule::virtualexchangetype::v_model2 => null()

Definition at line 70 of file VirtualExchange.f90.

◆ virtual_data_list

type(listtype) virtualdatacontainermodule::virtualdatacontainertype::virtual_data_list
inherited

Definition at line 67 of file VirtualDataContainer.f90.

67 type(ListType) :: virtual_data_list !< a list with all virtual data items for this container

◆ vmem_ctx

character(lencontextname) virtualdatacontainermodule::virtualdatacontainertype::vmem_ctx
inherited

Definition at line 57 of file VirtualDataContainer.f90.

57 character(LENCONTEXTNAME) :: vmem_ctx !< prefixes virtual memory located on remote processes

The documentation for this type was generated from the following file: