![]() |
MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
|
This module contains the SFR package methods. More...
Data Types | |
| type | sfrinputtype |
| Input context array pointers for SFR. More... | |
| type | sfrtype |
Functions/Subroutines | |
| subroutine, public | sfr_create (packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath) |
| Create a new package object. | |
| subroutine | sfr_allocate_scalars (this) |
| Allocate scalars. | |
| subroutine | sfr_allocate_arrays (this) |
| Allocate arrays. | |
| subroutine | sfr_checkin_deprecated_names (this) |
| Alias deprecated SFR variable names to their current storage. | |
| subroutine | sfr_source_options (this) |
| Source OPTIONS from input context. | |
| subroutine | sfr_source_dimensions (this) |
| Source DIMENSIONS block from input context and load static data. | |
| subroutine | sfr_source_packagedata (this) |
| Source PACKAGEDATA block from input context. | |
| subroutine | sfr_source_crosssections (this) |
| Source CROSSSECTIONS block from input context. | |
| subroutine | sfr_source_connectiondata (this) |
| Source CONNECTIONDATA block from input context. | |
| subroutine | sfr_source_diversions (this) |
| Source DIVERSIONS block from input context. | |
| subroutine | sfr_source_initialstages (this) |
| Source INITIALSTAGES block from input context. | |
| subroutine | sfr_ar (this) |
| Allocate and read method for package. | |
| subroutine | sfr_rp (this) |
| Read and prepare period data for package. | |
| subroutine | sfr_ad (this) |
| Advance the package. | |
| subroutine | sfr_cf (this) |
| Formulate the package hcof and rhs terms. | |
| subroutine | sfr_fc (this, rhs, ia, idxglo, matrix_sln) |
| Copy hcof and rhs terms into solution. | |
| subroutine | sfr_fn (this, rhs, ia, idxglo, matrix_sln) |
| Add Newton-Raphson terms for package into solution. | |
| subroutine | sfr_cc (this, innertot, kiter, iend, icnvgmod, cpak, ipak, dpak) |
| Convergence check for package. | |
| subroutine | sfr_cq (this, x, flowja, iadv) |
| Calculate package flows. | |
| subroutine | sfr_ot_package_flows (this, icbcfl, ibudfl) |
| Output package flow terms. | |
| subroutine | sfr_ot_dv (this, idvsave, idvprint) |
| Output package dependent-variable terms. | |
| subroutine | sfr_ot_bdsummary (this, kstp, kper, iout, ibudfl) |
| Output advanced package budget summary. | |
| subroutine | sfr_fp (this) |
| Write the Courant-number summary table to the listing file. | |
| subroutine | sfr_dt (this) |
| Submit the ATS time step for the most Courant-constraining reach. | |
| subroutine | sfr_calc_celerity (this, n, q, celerity) |
| Kinematic-wave celerity from a flow perturbation (0 if dry). | |
| subroutine | sfr_da (this) |
| Deallocate package memory. | |
| subroutine | sfr_precompute_tvd (this) |
| Pre-compute the single upstream reach index for the TVD limiter. | |
| subroutine | define_listlabel (this) |
| Define the list label for the package. | |
| logical function | sfr_obs_supported (this) |
| Determine if observations are supported. | |
| subroutine | sfr_df_obs (this) |
| Define the observation types available in the package. | |
| subroutine | sfr_bd_obs (this) |
| Save observations for the package. | |
| subroutine | sfr_rp_obs (this) |
| Read and prepare observations for a package. | |
| subroutine | sfr_process_obsid (obsrv, dis, inunitobs, iout) |
| Process observation IDs for a package. | |
| subroutine | sfr_solve (this, n, h, hcof, rhs, update) |
| Solve reach continuity equation. | |
| subroutine | sfr_update_flows (this, n, qd, qgwf) |
| Update flow terms. | |
| subroutine | sfr_adjust_ro_ev (this, qc, qu, qi, qr, qro, qe, qfrommvr) |
| Adjust runoff and evaporation. | |
| subroutine | sfr_calc_qd (this, n, depth, hgwf, qgwf, qd) |
| Calculate downstream flow term. | |
| subroutine | sfr_calc_qsource (this, n, depth, qsrc) |
| Calculate sum of sources. | |
| subroutine | sfr_calc_qman (this, n, depth, qman) |
| Calculate streamflow. | |
| subroutine | sfr_calc_qgwf (this, n, depth, hgwf, qgwf, gwfhcof, gwfrhs) |
| Calculate reach-aquifer exchange. | |
| integer(i4b) function | sfr_gwf_conn (this, n) |
| Determine if a reach is connected to a gwf cell. | |
| subroutine | sfr_calc_cond (this, n, depth, cond, hsfr, h_temp) |
| Calculate reach-aquifer conductance. | |
| subroutine | sfr_calc_div (this, n, i, qd, qdiv) |
| Calculate diversion flow. | |
| subroutine | sfr_calc_reach_depth (this, n, q1, d1) |
| Calculate the depth at the midpoint. | |
| subroutine | sfr_calc_xs_depth (this, n, qrch, d) |
| Calculate the depth at the midpoint of a irregular cross-section. | |
| subroutine | sfr_check_conversion (this) |
| Check unit conversion data. | |
| subroutine | sfr_check_storage_weight (this) |
| Check storage weight. | |
| subroutine | sfr_check_reaches (this) |
| Check reach data. | |
| subroutine | sfr_check_connections (this) |
| Check connection data. | |
| subroutine | sfr_check_diversions (this) |
| Check diversions data. | |
| subroutine | sfr_check_initialstages (this) |
| Check initial stage data. | |
| subroutine | sfr_check_ustrf (this) |
| Check upstream fraction data. | |
| subroutine | sfr_set_period_value (this, i, n, setting) |
| Apply a PERIOD setting value to reach n. | |
| subroutine | sfr_setup_budobj (this) |
| Setup budget object for package. | |
| subroutine | sfr_fill_budobj (this) |
| Copy flow terms into budget object for package. | |
| subroutine | sfr_setup_tableobj (this) |
| Setup stage table object for package. | |
| real(dp) function | calc_area_wet (this, n, depth) |
| Calculate wetted area. | |
| real(dp) function | calc_perimeter_wet (this, n, depth) |
| Calculate wetted perimeter. | |
| real(dp) function | calc_surface_area (this, n) |
| Calculate maximum surface area. | |
| real(dp) function | calc_surface_area_wet (this, n, depth) |
| Calculate wetted surface area. | |
| real(dp) function | calc_top_width_wet (this, n, depth) |
| Calculate wetted top width. | |
| subroutine | sfr_activate_density (this) |
| Activate density terms. | |
| subroutine | sfr_activate_viscosity (this) |
| Activate viscosity terms. | |
| subroutine | sfr_calculate_density_exchange (this, n, stage, head, cond, tops, flow, gwfhcof, gwfrhs) |
| Calculate density terms. | |
| subroutine | sfr_input_init (this, mempath, naux) |
| Bind SfrInputType PERIOD pointers to input context arrays. | |
| subroutine | sfr_input_destroy (this) |
| Nullify all SfrInputType pointers. | |
Variables | |
| character(len=lenftype) | ftype = 'SFR' |
| package ftype string | |
| character(len=lenpackagename) | text = ' SFR' |
| package budget string | |
This module contains the overridden methods for the streamflow routing (SFR) package. Most of the methods in the base Boundary Package are overridden.
|
private |
Function to calculate the wetted area for a SFR package reach.
| this | SfrType object | |
| [in] | n | reach number |
| [in] | depth | reach depth |
Definition at line 5579 of file gwf-sfr.f90.

|
private |
Function to calculate the wetted perimeter for a SFR package reach.
| this | SfrType object | |
| [in] | n | reach number |
| [in] | depth | reach depth |
Definition at line 5607 of file gwf-sfr.f90.

|
private |
Function to calculate the maximum surface area for a SFR package reach.
| this | SfrType object | |
| [in] | n | reach number |
Definition at line 5635 of file gwf-sfr.f90.

|
private |
Function to calculate the wetted surface area for a SFR package reach.
| this | SfrType object | |
| [in] | n | reach number |
| [in] | depth | reach depth |
Definition at line 5663 of file gwf-sfr.f90.
|
private |
Function to calculate the wetted top width for a SFR package reach.
| this | SfrType object | |
| [in] | n | reach number |
| [in] | depth | reach depth |
Definition at line 5682 of file gwf-sfr.f90.

|
private |
Method defined the list label for the SFR package. The list label is the heading that is written to iout when PRINT_INPUT option is used.
| [in,out] | this | SfrType object |
Definition at line 3080 of file gwf-sfr.f90.
|
private |
Method to activate addition of density terms for a SFR package reach.
| [in,out] | this | SfrType object |
Definition at line 5714 of file gwf-sfr.f90.
|
private |
Method to activate addition of viscosity terms for exchange with groundwater along a SFR package reach.
| [in,out] | this | SfrType object |
Definition at line 5741 of file gwf-sfr.f90.
|
private |
Advance data in the SFR package. The method sets advances time series, time array series, and observation data.
| this | SfrType object |
Definition at line 2054 of file gwf-sfr.f90.
|
private |
Method to adjust runoff and evaporation for a SFR package reach based on the total reach flow.
| this | SfrType object | |
| [in,out] | qc | total reach volumetric flow |
| [in] | qu | upstream reach volumetric flow |
| [in] | qi | reach volumetric inflow |
| [in] | qr | reach volumetric rainfall |
| [in,out] | qro | reach volumetric runoff |
| [in,out] | qe | reach volumetric evaporation |
| [in] | qfrommvr | reach volumetric flow from mover |
Definition at line 3714 of file gwf-sfr.f90.
|
private |
Allocate and initialize array for the SFR package.
| [in,out] | this | SfrType object |
Definition at line 504 of file gwf-sfr.f90.
|
private |
Allocate and initialize scalars for the SFR package. The base model allocate scalars method is also called.
| [in,out] | this | SfrType object |
Definition at line 433 of file gwf-sfr.f90.

|
private |
Method to read and prepare period data for the SFR package.
| [in,out] | this | SfrType object |
Definition at line 1703 of file gwf-sfr.f90.

|
private |
Method to save simulated values for the SFR package.
| this | SfrType object |
Definition at line 3220 of file gwf-sfr.f90.

|
private |
| this | SfrType object | |
| [in] | n | reach number |
| [in] | q | reach flow |
| [out] | celerity | kinematic-wave celerity |
Definition at line 2861 of file gwf-sfr.f90.
|
private |
Method to calculate the reach-aquifer conductance for a SFR package reach.
| this | SfrType object | |
| [in] | n | reach number |
| [in] | depth | reach depth |
| [in,out] | cond | reach-aquifer conductance |
| [in] | hsfr | stream stage |
| [in] | h_temp | head in gw cell |
Definition at line 3992 of file gwf-sfr.f90.
|
private |
Method to calculate the diversion flow for a diversion connected to a SFR package reach. The downstream flow for a reach is passed in and adjusted by the diversion flow amount calculated in this method.
| this | SfrType object | |
| [in] | n | reach number |
| [in] | i | diversion number in reach |
| [in,out] | qd | remaining downstream flow for reach |
| [in,out] | qdiv | diversion flow for diversion i |
Definition at line 4039 of file gwf-sfr.f90.
|
private |
Method to calculate downstream flow for a SFR package reach.
| this | SfrType object | |
| [in] | n | reach number |
| [in] | depth | reach depth |
| [in] | hgwf | groundwater head in connected GWF cell |
| [in,out] | qgwf | groundwater leakage for reach |
| [in,out] | qd | residual |
Definition at line 3754 of file gwf-sfr.f90.
|
private |
Method to calculate the reach-aquifer exchange for a SFR package reach. The reach-aquifer exchange is relative to the reach. Calculated flow is positive if flow is from the aquifer to the reach.
| this | SfrType object | |
| [in] | n | reach number |
| [in] | depth | reach depth |
| [in] | hgwf | head in GWF cell connected to reach |
| [in,out] | qgwf | reach-aquifer exchange |
| [in,out] | gwfhcof | diagonal coefficient term for reach |
| [in,out] | gwfrhs | right-hand side term for reach |
Definition at line 3905 of file gwf-sfr.f90.

|
private |
Method to calculate the streamflow using Manning's equation for a SFR package reach.
| this | SfrType object | |
| [in] | n | reach number |
| [in] | depth | reach depth |
| [in,out] | qman | streamflow |
Definition at line 3835 of file gwf-sfr.f90.

|
private |
Method to calculate the sum of sources for reach, excluding reach leakage, for a SFR package reach.
| this | SfrType object | |
| [in] | n | reach number |
| [in] | depth | reach depth |
| [in,out] | qsrc | sum of sources for reach |
Definition at line 3787 of file gwf-sfr.f90.
|
private |
Method to calculate the depth at the midpoint of a reach.
| this | SfrType object | |
| [in] | n | reach number |
| [in] | q1 | streamflow |
| [in,out] | d1 | stream depth at midpoint of reach |
Definition at line 4093 of file gwf-sfr.f90.
|
private |
Method to calculate the depth at the midpoint of a reach with a irregular cross-section using Newton-Raphson.
| this | SfrType object | |
| [in] | n | reach number |
| [in] | qrch | streamflow |
| [in,out] | d | stream depth at midpoint of reach |
Definition at line 4128 of file gwf-sfr.f90.
|
private |
Method to calculate groundwater-reach density exchange terms for a SFR package reach.
Member variable used here denseterms : shape (3, MAXBOUND), filled by buoyancy package col 1 is relative density of sfr (densesfr / denseref) col 2 is relative density of gwf cell (densegwf / denseref) col 3 is elevation of gwf cell
| [in,out] | this | SfrType object |
| [in] | n | reach number |
| [in] | stage | reach stage |
| [in] | head | head in connected GWF cell |
| [in] | cond | reach conductance |
| [in] | tops | top elevation of streambed |
| [in,out] | flow | calculated flow, updated here with density terms |
| [in,out] | gwfhcof | GWF diagonal coefficient, updated here with density terms |
| [in,out] | gwfrhs | GWF right-hand-side value, updated here with density terms |
Definition at line 5774 of file gwf-sfr.f90.
|
private |
Perform additional convergence checks on the flow between the SFR package and the model it is attached to.
| [in,out] | this | SfrType 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 2330 of file gwf-sfr.f90.

|
private |
Formulate the hcof and rhs terms for the WEL package that will be added to the coefficient matrix and right-hand side vector.
| this | SfrType object |
Definition at line 2152 of file gwf-sfr.f90.
|
private |
Method to check connection data for a SFR package. This method also creates the tables used to print input data, if this option in enabled in the SFR package.
| this | SfrType object |
Definition at line 4355 of file gwf-sfr.f90.

|
private |
Method to check unit conversion data for a SFR package. This method also calculates unitconv that is used in the Manning's equation.
| this | SfrType object |
Definition at line 4176 of file gwf-sfr.f90.

|
private |
Method to check diversion data for a SFR package. This method also creates the tables used to print input data, if this option in enabled in the SFR package.
| this | SfrType object |
Definition at line 4631 of file gwf-sfr.f90.

|
private |
Method to check initial data for a SFR package and calculates the initial upstream and downstream flows for the reach based on the initial staalso creates the tables used to print input data, if this option in enabled in the SFR package.
| this | SfrType object |
Definition at line 4738 of file gwf-sfr.f90.

|
private |
Method to check specified data for a SFR package. This method also creates the tables used to print input data, if this option in enabled in the SFR package.
| this | SfrType object |
Definition at line 4237 of file gwf-sfr.f90.

|
private |
Method to check the kinematic storage weight for a SFR package. If the kinematic storage weight has not been set it is set to the default value.
| this | SfrType object |
Definition at line 4213 of file gwf-sfr.f90.
|
private |
Method to check upstream fraction data for a SFR package. This method also creates the tables used to print input data, if this option in enabled in the SFR package.
| this | SfrType object |
Definition at line 4793 of file gwf-sfr.f90.

|
private |
IDM integration moved several reach variables into the input context, renaming some. These aliases share memory with the relocated variables so that programs addressing them through the API by their old package-path names continue to resolve; each use is reported as deprecated. DIVFLOW is only set from the input context when diversions are present; otherwise an empty DIVFLOW is allocated at the package path, as before IDM integration.
Definition at line 729 of file gwf-sfr.f90.

|
private |
Calculate the flow between connected SFR package control volumes.
| [in,out] | this | SfrType 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 2531 of file gwf-sfr.f90.
| subroutine, public sfrmodule::sfr_create | ( | class(bndtype), pointer | packobj, |
| integer(i4b), intent(in) | id, | ||
| integer(i4b), intent(in) | ibcnum, | ||
| integer(i4b), intent(in) | inunit, | ||
| integer(i4b), intent(in) | iout, | ||
| character(len=*), intent(in) | namemodel, | ||
| character(len=*), intent(in) | pakname, | ||
| character(len=*), intent(in) | mempath ) |
Create a new SFR Package object
| packobj | pointer to default package type | |
| [in] | id | package id |
| [in] | ibcnum | boundary condition number |
| [in] | inunit | unit number of SFR package input file |
| [in] | iout | unit number of model listing file |
| [in] | namemodel | model name |
| [in] | pakname | package name |
| [in] | mempath | input mempath |
Definition at line 388 of file gwf-sfr.f90.


|
private |
Deallocate SFR package scalars and arrays.
| this | SfrType object |
Definition at line 2888 of file gwf-sfr.f90.
|
private |
Method to define the observation types available in the SFR package.
| this | SfrType object |
Definition at line 3124 of file gwf-sfr.f90.
|
private |
| this | SfrType object |
Definition at line 2823 of file gwf-sfr.f90.
|
private |
Add the hcof and rhs terms for the SFR package to the coefficient matrix and right-hand side vector.
| this | SfrType 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 2180 of file gwf-sfr.f90.
|
private |
Method to copy flows into the budget object that stores all the sfr flows The terms listed here must correspond in number and order to the ones added in the sfr_setup_budobj method.
| this | SfrType object |
Definition at line 5233 of file gwf-sfr.f90.
|
private |
Calculate and add the Newton-Raphson terms for the SFR package to the coefficient matrix and right-hand side vector.
| this | SfrType 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 2280 of file gwf-sfr.f90.
|
private |
| this | SfrType object |
Definition at line 2788 of file gwf-sfr.f90.
|
private |
Function to determine if a reach is connected to a gwf cell. If connected, the return value is 1. Otherwise, the return value is 0.
| this | SfrType object | |
| [in] | n | reach number |
Definition at line 3972 of file gwf-sfr.f90.
|
private |
Definition at line 5884 of file gwf-sfr.f90.
|
private |
Called once from sfr_ar; PACKAGEDATA pointers are set separately in sfr_source_packagedata.
Definition at line 5865 of file gwf-sfr.f90.
|
private |
Function to determine if observations are supported by the SFR package. Observations are supported by the SFR package.
| this | SfrType object |
Definition at line 3112 of file gwf-sfr.f90.
|
private |
Output SFR package budget summary.
| this | SfrType 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 2773 of file gwf-sfr.f90.
|
private |
Output SFR boundary package dependent-variable terms.
| this | SfrType 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 2661 of file gwf-sfr.f90.

|
private |
Output SFR package flow terms.
| this | SfrType 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 2608 of file gwf-sfr.f90.
|
private |
Index 0 for reaches with zero or multiple upstream connections.
| [in,out] | this | SfrType object |
Definition at line 3049 of file gwf-sfr.f90.
|
private |
Method to process observation ID strings for a SFR package.
| [in,out] | obsrv | Observation object |
| [in] | dis | Discretization object |
| [in] | inunitobs | file unit number for the package observation file |
| [in] | iout | model listing file unit number |
Definition at line 3424 of file gwf-sfr.f90.
|
private |
Method to read and prepare period data for the SFR package.
| [in,out] | this | SfrType object |
Definition at line 1804 of file gwf-sfr.f90.

|
private |
Method to read and prepare observations for a SFR package.
| [in,out] | this | SfrType object |
Definition at line 3312 of file gwf-sfr.f90.

|
private |
Shared by sfr_rp and sfr_ad; DIVERSION is handled separately by both callers because its target index requires its own validation.
| [in] | i | row index into input context arrays |
| [in] | n | reach number |
| [in] | setting | uppercase mf6varname dispatch key |
Definition at line 4995 of file gwf-sfr.f90.
|
private |
Method to set up the budget object that stores all the sfr flows The terms listed here must correspond in number and order to the ones listed in the sfr_fill_budobj method.
| this | SfrType object |
Definition at line 5018 of file gwf-sfr.f90.

|
private |
Method to set up the table object that is used to write the sfr stage data. The terms listed here must correspond in number and order to the ones written to the stage table in the sfr_ot method.
| this | SfrType object |
Definition at line 5465 of file gwf-sfr.f90.

|
private |
Method to solve the continuity equation for a SFR package reach.
| this | SfrType object | |
| [in] | n | reach number |
| [in] | h | groundwater head in cell connected to reach |
| [in,out] | hcof | coefficient term added to the diagonal |
| [in,out] | rhs | right-hand side term |
| [in] | update | boolean indicating if the reach depth and stage variables should be updated to current iterate |
Definition at line 3460 of file gwf-sfr.f90.
|
private |
| [in,out] | this | SfrType object |
Definition at line 1296 of file gwf-sfr.f90.

|
private |
| [in,out] | this | SfrType object |
Definition at line 1206 of file gwf-sfr.f90.

|
private |
| [in,out] | this | SfrType object |
Definition at line 960 of file gwf-sfr.f90.

|
private |
| [in,out] | this | SfrType object |
Definition at line 1483 of file gwf-sfr.f90.

|
private |
| [in,out] | this | SfrType object |
Definition at line 1634 of file gwf-sfr.f90.

|
private |
| [in,out] | this | SfrType object |
Definition at line 776 of file gwf-sfr.f90.

|
private |
| [in,out] | this | SfrType object |
Definition at line 1030 of file gwf-sfr.f90.

|
private |
Method to update downstream flow and groundwater leakage terms for a SFR package reach.
| [in,out] | this | SfrType object |
| [in] | n | reach number |
| [in,out] | qd | downstream reach flow |
| [in] | qgwf | groundwater leakage for reach |
Definition at line 3644 of file gwf-sfr.f90.
| character(len=lenftype) sfrmodule::ftype = 'SFR' |
Definition at line 50 of file gwf-sfr.f90.
| character(len=lenpackagename) sfrmodule::text = ' SFR' |
Definition at line 51 of file gwf-sfr.f90.