MODFLOW 6
version 6.7.0.dev0
USGS Modular Hydrologic Model
|
This module contains the base boundary package. More...
Data Types | |
type | bndtype |
@ brief BndType More... | |
Functions/Subroutines | |
subroutine | bnd_df (this, neq, dis) |
@ brief Define boundary package options and dimensions More... | |
subroutine | bnd_ac (this, moffset, sparse) |
@ brief Add boundary package connection to matrix More... | |
subroutine | bnd_mc (this, moffset, matrix_sln) |
@ brief Map boundary package connection to matrix More... | |
subroutine | bnd_ar (this) |
@ brief Allocate and read method for boundary package More... | |
subroutine | bnd_rp (this) |
@ brief Allocate and read method for package More... | |
subroutine | bnd_ad (this) |
@ brief Advance the boundary package More... | |
subroutine | bnd_ck (this) |
@ brief Check boundary package period data More... | |
subroutine | bnd_reset (this) |
@ brief Reset bnd package before formulating More... | |
subroutine | bnd_cf (this) |
@ brief Formulate the package hcof and rhs terms. More... | |
subroutine | bnd_fc (this, rhs, ia, idxglo, matrix_sln) |
@ brief Copy hcof and rhs terms into solution. More... | |
subroutine | bnd_fn (this, rhs, ia, idxglo, matrix_sln) |
@ brief Add Newton-Raphson terms for package into solution. More... | |
subroutine | bnd_nur (this, neqpak, x, xtemp, dx, inewtonur, dxmax, locmax) |
@ brief Apply Newton-Raphson under-relaxation for package. More... | |
subroutine | bnd_cc (this, innertot, kiter, iend, icnvgmod, cpak, ipak, dpak) |
@ brief Convergence check for package. More... | |
subroutine | bnd_cq (this, x, flowja, iadv) |
@ brief Calculate advanced package flows. More... | |
subroutine | bnd_cq_simrate (this, hnew, flowja, imover) |
@ brief Calculate simrate. More... | |
subroutine | bnd_cq_simtomvr (this, flowja) |
@ brief Calculate flow to the mover. More... | |
subroutine | bnd_bd (this, model_budget) |
@ brief Add package flows to model budget. More... | |
subroutine | bnd_ot_package_flows (this, icbcfl, ibudfl) |
@ brief Output advanced package flow terms. More... | |
subroutine | bnd_ot_dv (this, idvsave, idvprint) |
@ brief Output advanced package dependent-variable terms. More... | |
subroutine | bnd_ot_bdsummary (this, kstp, kper, iout, ibudfl) |
@ brief Output advanced package budget summary. More... | |
subroutine | bnd_ot_model_flows (this, icbcfl, ibudfl, icbcun, imap) |
@ brief Output package flow terms. More... | |
subroutine | bnd_da (this) |
@ brief Deallocate package memory More... | |
subroutine | allocate_scalars (this) |
@ brief Allocate package scalars More... | |
subroutine | allocate_arrays (this, nodelist, auxvar) |
@ brief Allocate package arrays More... | |
subroutine | pack_initialize (this) |
@ brief Allocate and initialize select package members More... | |
subroutine | set_pointers (this, neq, ibound, xnew, xold, flowja) |
@ brief Set pointers to model variables More... | |
subroutine | bnd_read_options (this) |
@ brief Read additional options for package More... | |
subroutine | bnd_read_dimensions (this) |
@ brief Read dimensions for package More... | |
subroutine | bnd_store_user_cond (this, nlist, rlist, condinput) |
@ brief Store user-specified conductances when vsc is active More... | |
subroutine | bnd_read_initial_attr (this) |
@ brief Read initial parameters for package More... | |
subroutine | bnd_options (this, option, found) |
@ brief Read additional options for package More... | |
subroutine | copy_boundname (this) |
@ brief Copy boundnames into boundnames_cst More... | |
subroutine | pak_setup_outputtab (this) |
@ brief Setup output table for package More... | |
subroutine | define_listlabel (this) |
@ brief Define the list label for the package More... | |
logical(lgp) function | bnd_obs_supported (this) |
Determine if observations are supported. More... | |
subroutine | bnd_df_obs (this) |
Define the observation types available in the package. More... | |
subroutine | bnd_rp_obs (this) |
Read and prepare observations for a package. More... | |
subroutine | bnd_bd_obs (this) |
Save observations for the package. More... | |
subroutine | bnd_ot_obs (this) |
Output observations for the package. More... | |
subroutine | bnd_rp_ts (this) |
Assign time series links for the package. More... | |
class(bndtype) function, pointer, private | castasbndclass (obj) |
Cast as a boundary type. More... | |
subroutine, public | addbndtolist (list, bnd) |
Add boundary to package list. More... | |
class(bndtype) function, pointer, public | getbndfromlist (list, idx) |
Get boundary from package list. More... | |
subroutine, public | save_print_model_flows (icbcfl, ibudfl, icbcun, iprflow, outputtab, nbound, nodelist, flow, ibound, title, text, ipakcb, dis, naux, textmodel, textpackage, dstmodel, dstpackage, auxname, auxvar, iout, inamedbound, boundname, imap) |
Save and/or print flows for a package. More... | |
subroutine | bnd_activate_viscosity (this) |
Activate viscosity terms. More... | |
This module contains the base model boundary package class that is extended by all model boundary packages. The base model boundary package extends the NumericalPackageType.
subroutine, public bndmodule::addbndtolist | ( | type(listtype), intent(inout) | list, |
class(bndtype), intent(inout), pointer | bnd | ||
) |
Subroutine to add a boundary package to a package list.
[in,out] | list | package list |
[in,out] | bnd | boundary package |
Definition at line 1760 of file BoundaryPackage.f90.
subroutine bndmodule::allocate_arrays | ( | class(bndtype) | this, |
integer(i4b), dimension(:), optional, pointer, contiguous | nodelist, | ||
real(dp), dimension(:, :), optional, pointer, contiguous | auxvar | ||
) |
Allocate and initialize base boundary package arrays. This method only needs to be overridden if additional arrays are defined for a specific package.
this | BndType object |
nodelist | package nodelist |
auxvar | package aux variable array |
Definition at line 1028 of file BoundaryPackage.f90.
subroutine bndmodule::allocate_scalars | ( | class(bndtype) | this | ) |
Allocate and initialize base boundary package scalars. This method only needs to be overridden if additional scalars are defined for a specific package.
this | BndType object |
Definition at line 952 of file BoundaryPackage.f90.
subroutine bndmodule::bnd_ac | ( | class(bndtype), intent(inout) | this, |
integer(i4b), intent(in) | moffset, | ||
type(sparsematrix), intent(inout) | sparse | ||
) |
Add boundary package connection to the matrix for packages that add connections to the coefficient matrix. An example would be the GWF model MAW package. Base implementation that must be extended.
[in,out] | this | BndType object |
[in] | moffset | solution matrix model offset |
[in,out] | sparse | sparse object |
Definition at line 237 of file BoundaryPackage.f90.
subroutine bndmodule::bnd_activate_viscosity | ( | class(bndtype), intent(inout) | this | ) |
Method to activate addition of viscosity terms when package type is DRN, GHB, or RIV (method not needed by other packages at this point)
[in,out] | this | BndType object |
Definition at line 1954 of file BoundaryPackage.f90.
subroutine bndmodule::bnd_ad | ( | class(bndtype) | this | ) |
Advance data in the boundary package. The method sets advances time series, time array series, and observation data. A boundary package only needs to override this method if additional data needs to be advanced.
this | BndType object |
Definition at line 395 of file BoundaryPackage.f90.
|
private |
Generic method to allocate and read static data for model boundary packages. A boundary package only needs to override this method if input data varies from the standard boundary package.
[in,out] | this | BndType object |
Definition at line 268 of file BoundaryPackage.f90.
|
private |
Add the flow between package and the model (ratin and ratout) to the model budget. This method only needs to be overridden if a different calculation needs to be made.
this | BndType object | |
[in,out] | model_budget | model budget object |
Definition at line 710 of file BoundaryPackage.f90.
|
private |
Method to save simulated values for the boundary package. This method will need to be overridden for boundary packages with more observations than the calculate flow term (simvals) and to-mover.
this | BndType object |
Definition at line 1666 of file BoundaryPackage.f90.
|
private |
Perform additional convergence checks on the flow between the package and the model it is attached to. This additional convergence check is applied to packages that solve their own continuity equation as part of the formulate step at the beginning of a Picard iteration. A boundary package only needs to override this method if a specific boundary package solves its own continuity equation. Example packages that implement this additional convergence check is the CSUB, SFR, LAK, and UZF packages.
[in,out] | this | BndType object |
[in] | innertot | total number of inner iterations |
[in] | kiter | Picard iteration number |
[in] | iend | flag indicating if this is the last Picard iteration |
[in] | icnvgmod | flag inficating if the model has met specific convergence criteria |
[in,out] | cpak | string for user node |
[in,out] | ipak | location of the maximum dependent variable change |
[in,out] | dpak | maximum dependent variable change |
Definition at line 539 of file BoundaryPackage.f90.
|
private |
Formulate the hcof and rhs terms for the package that will be added to the coefficient matrix and right-hand side vector. Base implementation that must be extended by each model boundary package.
this | BndType object |
Definition at line 448 of file BoundaryPackage.f90.
|
private |
Check the boundary package period data. Base implementation that must be extended by each model boundary package.
[in,out] | this | BndType object |
Definition at line 421 of file BoundaryPackage.f90.
|
private |
Calculate the flow between connected advanced package control volumes. Only advanced boundary packages need to override this method.
[in,out] | this | BndType object |
[in] | x | current dependent-variable value |
[in,out] | flowja | flow between two connected control volumes |
[in] | iadv | flag that indicates if this is an advance package |
Definition at line 559 of file BoundaryPackage.f90.
|
private |
Calculate the flow between package and the model (for example, GHB and groundwater cell) and store in the simvals variable. This method only needs to be overridden if a different calculation needs to be made.
this | BndType object | |
[in] | hnew | current dependent-variable value |
[in,out] | flowja | flow between package and model |
[in] | imover | flag indicating if the mover package is active |
Definition at line 598 of file BoundaryPackage.f90.
|
private |
Calculate the flow between package and the model that is sent to the mover package and store in the simtomvr variable. This method only needs to be overridden if a different calculation needs to be made.
this | BndType object | |
[in,out] | flowja | flow between package and model |
Definition at line 643 of file BoundaryPackage.f90.
|
private |
Deallocate base boundary package scalars and arrays. This method only needs to be overridden if additional variables are defined for a specific package.
this | BndType object |
Definition at line 860 of file BoundaryPackage.f90.
|
private |
Define base boundary package options and dimensions for a model boundary package.
[in,out] | this | BndType object |
[in,out] | neq | number of equations |
dis | discretization object |
Definition at line 177 of file BoundaryPackage.f90.
|
private |
Method to define the observation types available in a boundary package. This method should be overridden if observations are supported in a boundary package.
this | BndType object |
Definition at line 1588 of file BoundaryPackage.f90.
|
private |
Add the hcof and rhs terms for the boundary package to the coefficient matrix and right-hand side vector. A boundary package only needs to override this method if it is different for a specific boundary package.
this | BndType object | |
[in,out] | rhs | right-hand side vector for model |
[in] | ia | solution CRS row pointers |
[in] | idxglo | mapping vector for model (local) to solution (global) |
matrix_sln | solution coefficient matrix |
Definition at line 463 of file BoundaryPackage.f90.
|
private |
Calculate and add the Newton-Raphson terms for the boundary package to the coefficient matrix and right-hand side vector. A boundary package only needs to override this method if a specific boundary package needs to add Newton-Raphson terms.
this | BndType object | |
[in,out] | rhs | right-hand side vector for model |
[in] | ia | solution CRS row pointers |
[in] | idxglo | mapping vector for model (local) to solution (global) |
matrix_sln | solution coefficient matrix |
Definition at line 492 of file BoundaryPackage.f90.
subroutine bndmodule::bnd_mc | ( | class(bndtype), intent(inout) | this, |
integer(i4b), intent(in) | moffset, | ||
class(matrixbasetype), pointer | matrix_sln | ||
) |
Map boundary package connection to the matrix for packages that add connections to the coefficient matrix. An example would be the GWF model MAW package. Base implementation that must be extended.
[in,out] | this | BndType object |
[in] | moffset | solution matrix model offset |
matrix_sln | global system matrix |
Definition at line 254 of file BoundaryPackage.f90.
|
private |
Apply Newton-Raphson under-relaxation for a boundary package. A boundary package only needs to override this method if a specific boundary package needs to apply Newton-Raphson under-relaxation. An example is the MAW package which adds rows to the system of equations and may need to have the dependent-variable constrained by the bottom of the model.
[in,out] | this | BndType object |
[in] | neqpak | number of equations in the package |
[in,out] | x | dependent variable |
[in] | xtemp | previous dependent variable |
[in,out] | dx | change in dependent variable |
[in,out] | inewtonur | flag indicating if newton-raphson under-relaxation should be applied |
[in,out] | dxmax | maximum change in the dependent variable |
[in,out] | locmax | location of the maximum change in the dependent variable |
Definition at line 513 of file BoundaryPackage.f90.
|
private |
Function to determine if observations are supported by the boundary package. By default, observations are not supported. This method should be overridden if observations are supported in a boundary package.
this | BndType object |
Definition at line 1571 of file BoundaryPackage.f90.
|
private |
Read additional options for a boundary package. This method should be overridden options in addition to the base options are implemented in a boundary package.
[in,out] | this | BndType object |
[in,out] | option | option keyword string |
[in,out] | found | boolean indicating if the option was found |
Definition at line 1475 of file BoundaryPackage.f90.
|
private |
Output advanced boundary package budget summary. This method only needs to be overridden for advanced packages that save budget summaries to the model listing file.
this | BndType object | |
[in] | kstp | time step number |
[in] | kper | period number |
[in] | iout | flag and unit number for the model listing file |
[in] | ibudfl | flag indicating budget should be written |
Definition at line 778 of file BoundaryPackage.f90.
|
private |
Output advanced boundary package dependent-variable terms. This method only needs to be overridden for advanced packages that save dependent variable terms for each control volume.
this | BndType object | |
[in] | idvsave | flag and unit number for dependent-variable output |
[in] | idvprint | flag indicating if dependent-variable should be written to the model listing file |
Definition at line 762 of file BoundaryPackage.f90.
|
private |
Output flow terms between the boundary package and model to a binary file and/or print flows to the model listing file. This method should not need to be overridden.
this | BndType object | |
[in] | icbcfl | flag for cell-by-cell output |
[in] | ibudfl | flag indication if cell-by-cell data should be saved |
[in] | icbcun | unit number for cell-by-cell output |
[in] | imap | mapping vector that converts the 1 to nbound values to lake number, maw number, etc. |
Definition at line 796 of file BoundaryPackage.f90.
|
private |
Method to output simulated values for the boundary package. This method should not need to be overridden.
this | BndType object |
Definition at line 1709 of file BoundaryPackage.f90.
subroutine bndmodule::bnd_ot_package_flows | ( | class(bndtype) | this, |
integer(i4b), intent(in) | icbcfl, | ||
integer(i4b), intent(in) | ibudfl | ||
) |
Output advanced boundary package flow terms. This method only needs to be overridden for advanced packages that save flow terms than contribute to the continuity equation for each control volume.
this | BndType object | |
[in] | icbcfl | flag and unit number for cell-by-cell output |
[in] | ibudfl | flag indication if cell-by-cell data should be saved |
Definition at line 746 of file BoundaryPackage.f90.
subroutine bndmodule::bnd_read_dimensions | ( | class(bndtype), intent(inout) | this | ) |
Read base dimensions for boundary packages. This method should not need to be overridden unless more than MAXBOUND is specified in the DIMENSIONS block.
[in,out] | this | BndType object |
Definition at line 1375 of file BoundaryPackage.f90.
subroutine bndmodule::bnd_read_initial_attr | ( | class(bndtype), intent(inout) | this | ) |
Read initial parameters for a boundary package. This method is not needed for most boundary packages. The SFR package is an example of a package that has overridden this method.
[in,out] | this | BndType object |
Definition at line 1463 of file BoundaryPackage.f90.
|
private |
Read base options for boundary packages.
[in,out] | this | BndType object |
Definition at line 1168 of file BoundaryPackage.f90.
|
private |
this | BndType object |
Definition at line 431 of file BoundaryPackage.f90.
subroutine bndmodule::bnd_rp | ( | class(bndtype), intent(inout) | this | ) |
Generic method to read and prepare period data for model boundary packages. A boundary package only needs to override this method if period data varies from the standard boundary package.
[in,out] | this | BndType object |
Definition at line 297 of file BoundaryPackage.f90.
|
private |
Method to read and prepare observations for a boundary package This method should not need to be overridden for most boundary packages.
[in,out] | this | BndType object |
Definition at line 1603 of file BoundaryPackage.f90.
|
private |
Assign the time series links for the boundary package. This method will need to be overridden for boundary packages that support time series.
Definition at line 1726 of file BoundaryPackage.f90.
|
private |
VSC will update boundary package conductance values. Because viscosity can change every stress period, but user-specified conductances may not, the base user-input should be stored in backup array so that viscosity-updated conductances may be recalculated every stress period/time step
[in,out] | this | BndType object |
Definition at line 1439 of file BoundaryPackage.f90.
|
private |
Subroutine to cast an object as a boundary package type.
[in,out] | obj | input object |
Definition at line 1738 of file BoundaryPackage.f90.
|
private |
boundnames_cst is an array of type(CharacterStringType), which can be stored in the MemoryManager.
[in,out] | this | BndType object |
Definition at line 1491 of file BoundaryPackage.f90.
|
private |
Method defined the list label for the boundary package. This method needs to be overridden by each boundary package.
[in,out] | this | BndType object |
Definition at line 1555 of file BoundaryPackage.f90.
class(bndtype) function, pointer, public bndmodule::getbndfromlist | ( | type(listtype), intent(inout) | list, |
integer(i4b), intent(in) | idx | ||
) |
Function to get a boundary package from a package list.
[in,out] | list | package list |
[in] | idx | package number |
Definition at line 1778 of file BoundaryPackage.f90.
subroutine bndmodule::pack_initialize | ( | class(bndtype) | this | ) |
Allocate and initialize select base boundary package members. This method needs to be overridden by a package if it is needed for a specific package.
this | BndType object |
Definition at line 1135 of file BoundaryPackage.f90.
|
private |
Setup output table for a boundary package that is used to output package to model flow terms to the model listing file.
[in,out] | this | BndType object |
Definition at line 1512 of file BoundaryPackage.f90.
subroutine, public bndmodule::save_print_model_flows | ( | integer(i4b), intent(in) | icbcfl, |
integer(i4b), intent(in) | ibudfl, | ||
integer(i4b), intent(in) | icbcun, | ||
integer(i4b), intent(in) | iprflow, | ||
type(tabletype), intent(inout), pointer | outputtab, | ||
integer(i4b), intent(in) | nbound, | ||
integer(i4b), dimension(:), intent(in), contiguous | nodelist, | ||
real(dp), dimension(:), intent(in), contiguous | flow, | ||
integer(i4b), dimension(:), intent(in), contiguous | ibound, | ||
character(len=*), intent(in) | title, | ||
character(len=*), intent(in) | text, | ||
integer(i4b), intent(in) | ipakcb, | ||
class(disbasetype), intent(in) | dis, | ||
integer(i4b), intent(in) | naux, | ||
character(len=*), intent(in) | textmodel, | ||
character(len=*), intent(in) | textpackage, | ||
character(len=*), intent(in) | dstmodel, | ||
character(len=*), intent(in) | dstpackage, | ||
character(len=*), dimension(:), intent(in) | auxname, | ||
real(dp), dimension(:, :), intent(in) | auxvar, | ||
integer(i4b), intent(in) | iout, | ||
integer(i4b), intent(in) | inamedbound, | ||
character(len=lenboundname), dimension(:), contiguous | boundname, | ||
integer(i4b), dimension(:), intent(in), optional | imap | ||
) |
Subroutine to save and/or print package flows to a model to a binary cell-by-cell flow file and the model listing file.
[in] | icbcfl | flag indicating if the flow should be saved to the binary cell-by-cell flow file |
[in] | ibudfl | flag indicating if the flow should be saved or printed |
[in] | icbcun | file unit number for the binary cell-by-cell file |
[in] | iprflow | print flows to list file |
[in,out] | outputtab | output table object |
[in] | nbound | number of boundaries this stress period |
[in] | nodelist | boundary node list |
[in] | flow | boundary flow terms |
[in] | ibound | ibound array for the model |
[in] | title | title for the output table |
[in] | text | flow term description |
[in] | ipakcb | flag indicating if flows will be saved |
[in] | dis | model discretization object |
[in] | naux | number of aux variables |
[in] | textmodel | model name |
[in] | textpackage | package name |
[in] | dstmodel | mover destination model |
[in] | dstpackage | mover destination package |
[in] | auxname | aux variable name |
[in] | auxvar | aux variable |
[in] | iout | model listing file unit |
[in] | inamedbound | flag indicating if boundnames are defined for the boundary entries |
boundname | bound names | |
[in] | imap | mapping array |
Definition at line 1797 of file BoundaryPackage.f90.
|
private |
Set pointers to model variables so that a package has access to these variables. This base method should not need to be overridden.
this | BndType object |
neq | number of equations in the model |
ibound | model idomain |
xnew | current dependent variable |
xold | previous dependent variable |
flowja | connection flow terms |
Definition at line 1146 of file BoundaryPackage.f90.