![]() |
MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
|
This class is used to construct the connections object for the interface model's spatial discretization/grid. More...

Public Member Functions | |
| procedure, pass(this) | construct (this, model, nrofprimaries, connectionname) |
| Construct the GridConnection and allocate the data structures for the primary connections. | |
| procedure, pass(this) | destroy (this) |
| Deallocate grid connection resources. | |
| procedure, pass(this) | addtoregionalmodels (this, v_model) |
| Add a model to a list of all regional models. | |
| procedure, pass(this) | connectprimaryexchange (this, primex) |
| Make connections for the primary exchange. | |
| procedure, pass(this) | extendconnection (this) |
| Extend the connection topology to deal with higher levels of connectivity (neighbors-of-neighbors, etc.). | |
| procedure, pass(this) | getdiscretization (this, disu) |
| Sets the discretization (DISU) after all preprocessing by this grid connection has been done,. | |
| procedure, pass(this) | buildinterfacemap (this) |
| Build interface map object for outside use. | |
| procedure, pass(this) | isperiodic (this, n, m) |
| Test if the connection between nodes within. | |
Public Attributes | |
| character(len=lenmempath) | memorypath |
| integer(i4b) | internalstencildepth |
| stencil size for the interior | |
| integer(i4b) | exchangestencildepth |
| stencil size at the interface | |
| integer(i4b) | icondir |
| icondir as defined in DIS, but reduced over all models in the interface | |
| class(numericalmodeltype), pointer | model => null() |
| the model for which this grid connection exists | |
| class(disconnexchangetype), pointer | primaryexchange => null() |
| pointer to the primary exchange for this interface | |
| integer(i4b), pointer | nrofboundarycells => null() |
| nr of boundary cells with connection to another model | |
| type(cellwithnbrstype), dimension(:), pointer | boundarycells => null() |
| cells on our side of the primary connections | |
| type(cellwithnbrstype), dimension(:), pointer | connectedcells => null() |
| cells on the neighbors side of the primary connection | |
| type(stlvecint), pointer | haloexchanges |
| all exchanges that are potentially part of this interface | |
| integer(i4b), pointer | nrofcells => null() |
| the total number of cells in the interface | |
| type(globalcelltype), dimension(:), pointer | idxtoglobal => null() |
| a map from interface index to global coordinate | |
| integer(i4b), dimension(:), pointer, contiguous | idxtoglobalidx => null() |
| a (flat) map from interface index to global index, stored in mem. mgr. so can be used for debugging | |
| type(listtype) | regionalmodels |
| the models participating in the interface | |
| integer(i4b), dimension(:), pointer | region_to_iface_map => null() |
| (sparse) mapping from regional index to interface ixd | |
| integer(i4b), dimension(:), pointer | regionalmodeloffset => null() |
| the new offset to compactify the range of indices | |
| integer(i4b), pointer | indexcount => null() |
| counts the number of cells in the interface | |
| type(connectionstype), pointer | connections => null() |
| sparse matrix with the connections | |
| integer(i4b), dimension(:), pointer | connectionmask => null() |
| to mask out connections from the amat coefficient calculation | |
| type(interfacemaptype), pointer | interfacemap => null() |
| defining map for the interface | |
Private Member Functions | |
| procedure, pass(this), private | allocatescalars (this) |
| Allocate scalar data. | |
| procedure, pass(this), private | connectcell (this, idx1, v_model1, idx2, v_model2) |
| Connect neighboring cells at the interface by storing them in the boundary cell and connected cell arrays. | |
| procedure, pass(this), private | buildconnections (this) |
| Builds a sparse matrix holding all cell connections,. | |
| procedure, pass(this), private | addneighbors (this, cellnbrs, depth, mask, interior) |
| procedure, pass(this), private | addneighborcell (this, cellnbrs, newnbridx, v_nbr_model, mask) |
| Add neighboring cell to tree structure. | |
| procedure, pass(this), private | addremoteneighbors (this, cellnbrs, mask) |
| Add cell neighbors across models using the stored exchange data structures. | |
| procedure, pass(this), private | get_regional_offset (this, v_model) |
| Get the offset for a regional model. | |
| generic, private | getinterfaceindex (this, cell) |
| Get interface index from global cell. | |
| generic, private | getinterfaceindex (this, index, v_model) |
| Get interface index from a model pointer and the local index. | |
| procedure, pass(this), private | getinterfaceindexbycell (this, cell) |
| Get interface index from global cell. | |
| procedure, pass(this), private | getinterfaceindexbyindexmodel (this, index, v_model) |
| Get interface index from a model pointer and the local index. | |
| procedure, pass(this), private | registerinterfacecells (this, cellwithnbrs) |
| Recursively set interface cell indexes and. | |
| procedure, pass(this), private | addtoglobalmap (this, ifaceidx, cell) |
| Add entry to lookup table, inflating when necessary. | |
| procedure, pass(this), private | compressglobalmap (this) |
| Compress lookup table to get rid of unused entries. | |
| procedure, pass(this), private | sortinterfacegrid (this) |
| Soft cell ids in the interface grid such that. | |
| procedure, pass(this), private | makeprimaryconnections (this, sparse) |
| Add primary connections to the sparse data structure. | |
| procedure, pass(this), private | connectneighborcells (this, cell, sparse) |
| Recursively add higher order connections (from cells neighboring the primarily connected cells) to the. | |
| procedure, pass(this), private | fillconnectiondatainternal (this) |
| Fill connection data (ihc, cl1, ...) for. | |
| procedure, pass(this), private | fillconnectiondatafromexchanges (this) |
| Fill connection data (ihc, cl1, ...) for. | |
| procedure, pass(this), private | createconnectionmask (this) |
| Create the connection masks. | |
| procedure, pass(this), private | maskinternalconnections (this, cell, nbrcell, level) |
| Recursively mask connections, increasing the level as we go. | |
| procedure, pass(this), private | setmaskonconnection (this, cell, nbrcell, level) |
| Set a mask on the connection from a cell to its neighbor, (and not the transposed!) not overwriting the current level. | |
It works as follows:
1: construct basic instance, allocate data structures based on nr. of primary connections 2: add primary connections from exchanges 3: add secondary, tertiary, ... MODEL connections, depending on the size of the computational stencil 4: extend the connection, creating the full data structure and relations 5: build the connections object, from which the grid for the interface model can be constructed
A note on the different indices:
We have
Definition at line 57 of file GridConnection.f90.
|
private |
| [in] | this | this grid connection instance |
| [in,out] | cellnbrs | the root cell which to add to |
| [in] | newnbridx | the neighboring cell's index |
| v_nbr_model | the model where the new neighbor lives | |
| mask | don't add connections to this cell (optional) |
Definition at line 105 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection |
| [in,out] | cellnbrs | cell to add to |
| [in,out] | depth | current depth (typically decreases in recursion) |
| mask | mask to excluded back-and-forth connection between cells | |
| interior | when true, we are adding from the exchange back into the model |
Definition at line 104 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection instance |
| [in,out] | cellnbrs | cell to add to |
| mask | a mask to exclude back-and-forth connections |
Definition at line 106 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection instance |
| [in] | ifaceidx | unique idx in the interface grid |
| [in] | cell | the global cell |
Definition at line 113 of file GridConnection.f90.
| procedure, pass(this) gridconnectionmodule::gridconnectiontype::addtoregionalmodels | ( | class(gridconnectiontype), intent(inout) | this, |
| class(virtualmodeltype), pointer | v_model ) |
| [in,out] | this | this grid connection |
| v_model | the model to add to the region |
Definition at line 92 of file GridConnection.f90.
|
private |
| this | this grid connection instance |
Definition at line 90 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection instance |
Definition at line 103 of file GridConnection.f90.
| procedure, pass(this) gridconnectionmodule::gridconnectiontype::buildinterfacemap | ( | class(gridconnectiontype) | this | ) |
| this | this grid connection |
Definition at line 96 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection instance |
Definition at line 114 of file GridConnection.f90.
|
private |
| [in] | this | this grid connection |
| idx1 | local index cell 1 | |
| v_model1 | model of cell 1 | |
| idx2 | local index cell 2 | |
| v_model2 | model of cell 2 |
Definition at line 102 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection instance |
| cell | the cell whose connections is to be added | |
| sparse | the sparse data structure to hold the connections |
Definition at line 117 of file GridConnection.f90.
| procedure, pass(this) gridconnectionmodule::gridconnectiontype::connectprimaryexchange | ( | class(gridconnectiontype) | this, |
| class(disconnexchangetype), pointer | primex ) |
| this | this grid connection |
| primex | the primary exchange for this connection |
Definition at line 93 of file GridConnection.f90.
| procedure, pass(this) gridconnectionmodule::gridconnectiontype::construct | ( | class(gridconnectiontype), intent(inout) | this, |
| class(numericalmodeltype), intent(in), pointer | model, | ||
| integer(i4b) | nrofprimaries, | ||
| character(len=*) | connectionname ) |
Definition at line 89 of file GridConnection.f90.
|
private |
The level indicates the nr of connections away from the remote neighbor, the diagonal term holds the negated value of their nearest connection. We end with setting
| [in,out] | this | instance of this grid connection |
Definition at line 120 of file GridConnection.f90.
| procedure, pass(this) gridconnectionmodule::gridconnectiontype::destroy | ( | class(gridconnectiontype) | this | ) |
| this | this grid connection instance |
Definition at line 91 of file GridConnection.f90.
| procedure, pass(this) gridconnectionmodule::gridconnectiontype::extendconnection | ( | class(gridconnectiontype), intent(inout) | this | ) |
The following steps are taken:
| [in,out] | this | this grid connection |
Definition at line 94 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection instance |
Definition at line 119 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection instance |
Definition at line 118 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection instance |
| v_model | the model to get the offset for |
Definition at line 107 of file GridConnection.f90.
| procedure, pass(this) gridconnectionmodule::gridconnectiontype::getdiscretization | ( | class(gridconnectiontype) | this, |
| class(disutype), pointer | disu ) |
| this | the grid connection |
| disu | the target disu object |
Definition at line 95 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection instance |
| [in] | cell | the global cell to get the interface index for |
Definition at line 108 of file GridConnection.f90.

|
private |
| [in,out] | this | this grid connection instance |
| index | the local cell index | |
| v_model | the cell's model |
Definition at line 108 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection instance |
| [in] | cell | the global cell to get the interface index for |
Definition at line 110 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection instance |
| index | the local cell index | |
| v_model | the cell's model |
Definition at line 111 of file GridConnection.f90.
| procedure, pass(this) gridconnectionmodule::gridconnectiontype::isperiodic | ( | class(gridconnectiontype), intent(in) | this, |
| integer(i4b), intent(in) | n, | ||
| integer(i4b), intent(in) | m ) |
| [in] | this | this grid connection instance |
| [in] | n | first node of the connection |
| [in] | m | second node of the connection |
Definition at line 99 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection instance |
| sparse | the sparse data structure to hold the connections |
Definition at line 116 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection instance |
| [in,out] | cell | cell 1 in the connection to mask |
| [in,out] | nbrcell | cell 2 in the connection to mask |
Definition at line 121 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection instance |
| cellwithnbrs | the cell from where to start registering neighbors |
Definition at line 112 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection instance |
| [in,out] | cell | cell 1 in the connection |
| [in,out] | nbrcell | cell 2 in the connection |
| [in] | level | the level value to set the mask to |
Definition at line 122 of file GridConnection.f90.
|
private |
| [in,out] | this | this grid connection instance |
Definition at line 115 of file GridConnection.f90.
| type(cellwithnbrstype), dimension(:), pointer gridconnectionmodule::gridconnectiontype::boundarycells => null() |
Definition at line 68 of file GridConnection.f90.
| type(cellwithnbrstype), dimension(:), pointer gridconnectionmodule::gridconnectiontype::connectedcells => null() |
Definition at line 69 of file GridConnection.f90.
| integer(i4b), dimension(:), pointer gridconnectionmodule::gridconnectiontype::connectionmask => null() |
Definition at line 82 of file GridConnection.f90.
| type(connectionstype), pointer gridconnectionmodule::gridconnectiontype::connections => null() |
Definition at line 81 of file GridConnection.f90.
| integer(i4b) gridconnectionmodule::gridconnectiontype::exchangestencildepth |
Definition at line 61 of file GridConnection.f90.
| type(stlvecint), pointer gridconnectionmodule::gridconnectiontype::haloexchanges |
Definition at line 70 of file GridConnection.f90.
| integer(i4b) gridconnectionmodule::gridconnectiontype::icondir |
Definition at line 62 of file GridConnection.f90.
| type(globalcelltype), dimension(:), pointer gridconnectionmodule::gridconnectiontype::idxtoglobal => null() |
Definition at line 73 of file GridConnection.f90.
| integer(i4b), dimension(:), pointer, contiguous gridconnectionmodule::gridconnectiontype::idxtoglobalidx => null() |
Definition at line 74 of file GridConnection.f90.
| integer(i4b), pointer gridconnectionmodule::gridconnectiontype::indexcount => null() |
Definition at line 79 of file GridConnection.f90.
| type(interfacemaptype), pointer gridconnectionmodule::gridconnectiontype::interfacemap => null() |
Definition at line 84 of file GridConnection.f90.
| integer(i4b) gridconnectionmodule::gridconnectiontype::internalstencildepth |
Definition at line 60 of file GridConnection.f90.
| character(len=lenmempath) gridconnectionmodule::gridconnectiontype::memorypath |
Definition at line 59 of file GridConnection.f90.
| class(numericalmodeltype), pointer gridconnectionmodule::gridconnectiontype::model => null() |
Definition at line 64 of file GridConnection.f90.
| integer(i4b), pointer gridconnectionmodule::gridconnectiontype::nrofboundarycells => null() |
Definition at line 67 of file GridConnection.f90.
| integer(i4b), pointer gridconnectionmodule::gridconnectiontype::nrofcells => null() |
Definition at line 72 of file GridConnection.f90.
| class(disconnexchangetype), pointer gridconnectionmodule::gridconnectiontype::primaryexchange => null() |
Definition at line 65 of file GridConnection.f90.
| integer(i4b), dimension(:), pointer gridconnectionmodule::gridconnectiontype::region_to_iface_map => null() |
Definition at line 77 of file GridConnection.f90.
| integer(i4b), dimension(:), pointer gridconnectionmodule::gridconnectiontype::regionalmodeloffset => null() |
Definition at line 78 of file GridConnection.f90.
| type(listtype) gridconnectionmodule::gridconnectiontype::regionalmodels |
Definition at line 76 of file GridConnection.f90.