MODFLOW 6
version 6.6.0.dev0
USGS Modular Hydrologic Model
|
This module contains the TspSsm Module. More...
Data Types | |
type | tspssmtype |
Derived type for the SSM Package. More... | |
Functions/Subroutines | |
subroutine, public | ssm_cr (ssmobj, name_model, inunit, iout, fmi, eqnsclfac, depvartype) |
@ brief Create a new SSM package More... | |
subroutine | ssm_df (this) |
@ brief Define SSM Package More... | |
subroutine | ssm_ar (this, dis, ibound, cnew) |
@ brief Allocate and read SSM Package More... | |
subroutine | ssm_rp (this) |
@ brief Read and prepare this SSM Package More... | |
subroutine | ssm_ad (this) |
@ brief Advance the SSM Package More... | |
subroutine | ssm_term (this, ipackage, ientry, rrate, rhsval, hcofval, cssm, qssm) |
@ brief Calculate the SSM mass flow rate and hcof and rhs values More... | |
subroutine | get_ssm_conc (this, ipackage, ientry, nbound_flow, conc, lauxmixed) |
@ brief Provide bound concentration (or temperature) and mixed flag More... | |
subroutine | ssm_fc (this, matrix_sln, idxglo, rhs) |
@ brief Fill coefficients More... | |
subroutine | ssm_cq (this, flowja) |
@ brief Calculate flow More... | |
subroutine | ssm_bd (this, isuppress_output, model_budget) |
@ brief Calculate the global SSM budget terms More... | |
subroutine | ssm_ot_flow (this, icbcfl, ibudfl, icbcun) |
@ brief Output flows More... | |
subroutine | ssm_da (this) |
@ brief Deallocate More... | |
subroutine | allocate_scalars (this) |
@ brief Allocate scalars More... | |
subroutine | allocate_arrays (this) |
@ brief Allocate arrays More... | |
subroutine | read_options (this) |
@ brief Read package options More... | |
subroutine | read_data (this) |
@ brief Read package data More... | |
subroutine | read_sources_aux (this) |
@ brief Read SOURCES block More... | |
subroutine | read_sources_fileinput (this) |
@ brief Read FILEINPUT block More... | |
subroutine | set_iauxpak (this, ip, packname) |
@ brief Set iauxpak array value for package ip More... | |
subroutine | set_ssmivec (this, ip, packname) |
@ brief Set ssmivec array value for package ip More... | |
subroutine | pak_setup_outputtab (this) |
@ brief Setup the output table More... | |
Variables | |
character(len=lenftype) | ftype = 'SSM' |
character(len=lenpackagename) | text = ' SOURCE-SINK MIX' |
This module contains the code for handling sources and sinks associated with groundwater flow model stress packages.
todo: need observations for SSM terms
subroutine tspssmmodule::allocate_arrays | ( | class(tspssmtype) | this | ) |
Allocate array variables for this derived type
this | TspSsmType object |
Definition at line 712 of file tsp-ssm.f90.
subroutine tspssmmodule::allocate_scalars | ( | class(tspssmtype) | this | ) |
Allocate scalar variables for this derived type
this | TspSsmType object |
Definition at line 692 of file tsp-ssm.f90.
subroutine tspssmmodule::get_ssm_conc | ( | class(tspssmtype) | this, |
integer(i4b), intent(in) | ipackage, | ||
integer(i4b), intent(in) | ientry, | ||
integer(i4b), intent(in) | nbound_flow, | ||
real(dp), intent(out) | conc, | ||
logical(lgp), intent(out) | lauxmixed | ||
) |
SSM concentrations and temperatures can be provided in auxiliary variables or through separate SPC files. If not provided, the default concentration (or temperature) is zero. This single routine provides the SSM bound concentration (or temperature) based on these different approaches. The mixed flag indicates whether or not the boundary as a mixed type.
this | TspSsmType | |
[in] | ipackage | package number |
[in] | ientry | bound number |
[in] | nbound_flow | size of flow package bound list |
[out] | conc | user-specified concentration/temperature for this bound |
[out] | lauxmixed | user-specified flag for marking this as a mixed boundary |
Definition at line 356 of file tsp-ssm.f90.
subroutine tspssmmodule::pak_setup_outputtab | ( | class(tspssmtype), intent(inout) | this | ) |
Setup the output table by creating the column headers.
Definition at line 1085 of file tsp-ssm.f90.
subroutine tspssmmodule::read_data | ( | class(tspssmtype) | this | ) |
Read and set the SSM Package data
this | TspSsmType object |
Definition at line 787 of file tsp-ssm.f90.
subroutine tspssmmodule::read_options | ( | class(tspssmtype) | this | ) |
Read and set the SSM Package options
this | TspSsmType object |
Definition at line 740 of file tsp-ssm.f90.
subroutine tspssmmodule::read_sources_aux | ( | class(tspssmtype) | this | ) |
Read SOURCES block and look for auxiliary columns in corresponding flow data.
this | TspSsmType object |
Definition at line 803 of file tsp-ssm.f90.
subroutine tspssmmodule::read_sources_fileinput | ( | class(tspssmtype) | this | ) |
Read optional FILEINPUT block and initialize an SPC input file reader for each entry.
this | TspSsmType object |
Definition at line 900 of file tsp-ssm.f90.
subroutine tspssmmodule::set_iauxpak | ( | class(tspssmtype), intent(inout) | this, |
integer(i4b), intent(in) | ip, | ||
character(len=*), intent(in) | packname | ||
) |
The next call to parser will return the auxiliary name for package ip in the SSM SOURCES block. The routine searches through the auxiliary names in package ip and sets iauxpak to the column number corresponding to the correct auxiliary column.
[in,out] | this | TspSsmType |
[in] | ip | package number |
[in] | packname | name of package |
Definition at line 1015 of file tsp-ssm.f90.
subroutine tspssmmodule::set_ssmivec | ( | class(tspssmtype), intent(inout) | this, |
integer(i4b), intent(in) | ip, | ||
character(len=*), intent(in) | packname | ||
) |
The next call to parser will return the input file name for package ip in the SSM SOURCES block. The routine then initializes the SPC input file.
[in,out] | this | TspSsmType |
[in] | ip | package number |
[in] | packname | name of package |
Definition at line 1054 of file tsp-ssm.f90.
subroutine tspssmmodule::ssm_ad | ( | class(tspssmtype) | this | ) |
This routine is called from gwt_ad(). It is called at the beginning of each time step. The total number of flow boundaries is counted and stored in thisnbound. Also, if any SPC input files are used to provide source and sink concentrations (or temperatures) and time series are referenced in those files, then ssm concenrations must be interpolated for the time step.
this | TspSsmType object |
Definition at line 214 of file tsp-ssm.f90.
subroutine tspssmmodule::ssm_ar | ( | class(tspssmtype) | this, |
class(disbasetype), intent(in), pointer | dis, | ||
integer(i4b), dimension(:), pointer, contiguous | ibound, | ||
real(dp), dimension(:), pointer, contiguous | cnew | ||
) |
This routine is called from gwt_ar(). It allocates arrays, reads options and data, and sets up the output table.
this | TspSsmType object | |
[in] | dis | discretization package |
ibound | GWT model ibound | |
cnew | GWT model dependent variable |
Definition at line 134 of file tsp-ssm.f90.
subroutine tspssmmodule::ssm_bd | ( | class(tspssmtype) | this, |
integer(i4b), intent(in) | isuppress_output, | ||
type(budgettype), intent(inout) | model_budget | ||
) |
Calculate the global SSM budget terms using separate in and out entries for each flow package.
this | TspSsmType object | |
[in] | isuppress_output | flag to suppress output |
[in,out] | model_budget | budget object for the GWT model |
Definition at line 466 of file tsp-ssm.f90.
subroutine tspssmmodule::ssm_cq | ( | class(tspssmtype) | this, |
real(dp), dimension(:), intent(inout), contiguous | flowja | ||
) |
Calculate the resulting mass flow between the boundary and the connected GWT/GWE model cell. Update the diagonal position of the flowja array so that it ultimately contains the solute balance residual.
this | TspSsmType object | |
[in,out] | flowja | flow across each face in the model grid |
Definition at line 431 of file tsp-ssm.f90.
subroutine, public tspssmmodule::ssm_cr | ( | type(tspssmtype), pointer | ssmobj, |
character(len=*), intent(in) | name_model, | ||
integer(i4b), intent(in) | inunit, | ||
integer(i4b), intent(in) | iout, | ||
type(tspfmitype), intent(in), target | fmi, | ||
real(dp), intent(in), pointer | eqnsclfac, | ||
character(len=lenvarname), intent(in) | depvartype | ||
) |
Create a new SSM package by defining names, allocating scalars and initializing the parser.
ssmobj | TspSsmType object | |
[in] | name_model | name of the model |
[in] | inunit | fortran unit for input |
[in] | iout | fortran unit for output |
[in] | fmi | Transport FMI package |
[in] | eqnsclfac | governing equation scale factor |
[in] | depvartype | dependent variable type ('concentration' or 'temperature') |
Definition at line 82 of file tsp-ssm.f90.
subroutine tspssmmodule::ssm_da | ( | class(tspssmtype) | this | ) |
Deallocate the memory associated with this derived type
this | TspSsmType object |
Definition at line 646 of file tsp-ssm.f90.
subroutine tspssmmodule::ssm_df | ( | class(tspssmtype) | this | ) |
This routine is called from gwt_df(), but does not do anything because df is typically used to set up dimensions. For the ssm package, the total number of ssm entries is defined by the flow model.
this | TspSsmType object |
Definition at line 122 of file tsp-ssm.f90.
subroutine tspssmmodule::ssm_fc | ( | class(tspssmtype) | this, |
class(matrixbasetype), pointer | matrix_sln, | ||
integer(i4b), dimension(:), intent(in) | idxglo, | ||
real(dp), dimension(:), intent(inout) | rhs | ||
) |
This routine adds the effects of the SSM to the matrix equations by updating the a matrix and right-hand side vector.
Definition at line 389 of file tsp-ssm.f90.
subroutine tspssmmodule::ssm_ot_flow | ( | class(tspssmtype) | this, |
integer(i4b), intent(in) | icbcfl, | ||
integer(i4b), intent(in) | ibudfl, | ||
integer(i4b), intent(in) | icbcun | ||
) |
Based on user-specified controls, print SSM mass flow rates to the GWT listing file and/or write the SSM mass flow rates to the GWT binary budget file.
this | TspSsmType object | |
[in] | icbcfl | flag for writing binary budget terms |
[in] | ibudfl | flag for printing budget terms to list file |
[in] | icbcun | fortran unit number for binary budget file |
Definition at line 520 of file tsp-ssm.f90.
subroutine tspssmmodule::ssm_rp | ( | class(tspssmtype) | this | ) |
This routine is called from gwt_rp(). It is called at the beginning of each stress period. If any SPC input files are used to provide source and sink concentrations (or temperatures), then period blocks for the current stress period are read.
this | TspSsmType object |
Definition at line 187 of file tsp-ssm.f90.
subroutine tspssmmodule::ssm_term | ( | class(tspssmtype) | this, |
integer(i4b), intent(in) | ipackage, | ||
integer(i4b), intent(in) | ientry, | ||
real(dp), intent(out), optional | rrate, | ||
real(dp), intent(out), optional | rhsval, | ||
real(dp), intent(out), optional | hcofval, | ||
real(dp), intent(out), optional | cssm, | ||
real(dp), intent(out), optional | qssm | ||
) |
This is the primary SSM routine that calculates the matrix coefficient and right-hand-side value for any package and package entry. It returns several different optional variables that are used throughout this package to update matrix terms, budget calculations, and output tables.
this | TspSsmType | |
[in] | ipackage | package number |
[in] | ientry | bound number |
[out] | rrate | calculated mass flow rate |
[out] | rhsval | calculated rhs value |
[out] | hcofval | calculated hcof value |
[out] | cssm | calculated source concentration/temperature depending on flow direction |
[out] | qssm | water flow rate into model cell from boundary package |
Definition at line 256 of file tsp-ssm.f90.
character(len=lenftype) tspssmmodule::ftype = 'SSM' |
Definition at line 28 of file tsp-ssm.f90.
character(len=lenpackagename) tspssmmodule::text = ' SOURCE-SINK MIX' |
Definition at line 29 of file tsp-ssm.f90.