![]() |
MODFLOW 6
version 6.9.0.dev0
USGS Modular Hydrologic Model
|
Data Types | |
| type | laktabtype |
| type | lakinputtype |
| input context runtime pointers for LAK More... | |
| type | laktype |
Functions/Subroutines | |
| subroutine, public | lak_create (packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath) |
| Create a new LAK Package and point bndobj to the new package. More... | |
| subroutine | lak_allocate_scalars (this) |
| Allocate scalar members. More... | |
| subroutine | lak_allocate_arrays (this) |
| Allocate scalar members. More... | |
| subroutine | lak_source_packagedata (this) |
| Source PACKAGEDATA block from input context. More... | |
| subroutine | lak_source_connectiondata (this) |
| Source CONNECTIONDATA block from input context. More... | |
| subroutine | lak_source_tables (this) |
| Source TABLES block from input context. More... | |
| subroutine | laktables_to_vectors (this, laketables) |
| Copy the laketables structure data into flattened vectors that are stored in the memory manager. More... | |
| subroutine | lak_source_table (this, ilak, mempath, laketable) |
| Source one lake's table from its LAKTAB6 subpackage. More... | |
| subroutine | lak_source_outlets (this) |
| Source OUTLETS block from input context. More... | |
| subroutine | lak_source_dimensions (this) |
| Source DIMENSIONS block from input context and load static data. More... | |
| subroutine | lak_read_initial_attr (this) |
| Read the initial parameters for this package. More... | |
| subroutine | lak_linear_interpolation (this, n, x, y, z, v) |
| Perform linear interpolation of two vectors. More... | |
| subroutine | lak_calculate_sarea (this, ilak, stage, sarea) |
| Calculate the surface area of a lake at a given stage. More... | |
| subroutine | lak_calculate_warea (this, ilak, stage, warea, hin) |
| Calculate the wetted area of a lake at a given stage. More... | |
| subroutine | lak_calculate_conn_warea (this, ilak, iconn, stage, head, wa) |
| Calculate the wetted area of a lake connection at a given stage. More... | |
| subroutine | lak_calculate_vol (this, ilak, stage, volume) |
| Calculate the volume of a lake at a given stage. More... | |
| subroutine | lak_calculate_conductance (this, ilak, stage, conductance) |
| Calculate the total conductance for a lake at a provided stage. More... | |
| subroutine | lak_calculate_cond_head (this, iconn, stage, head, vv) |
| Calculate the controlling lake stage or groundwater head used to calculate the conductance for a lake connection from a provided stage and groundwater head. More... | |
| subroutine | lak_calculate_conn_conductance (this, ilak, iconn, stage, head, cond) |
| Calculate the conductance for a lake connection at a provided stage and groundwater head. More... | |
| subroutine | lak_calculate_exchange (this, ilak, stage, totflow) |
| Calculate the total groundwater-lake flow at a provided stage. More... | |
| subroutine | lak_calculate_conn_exchange (this, ilak, iconn, stage, head, flow, gwfhcof, gwfrhs) |
| Calculate the groundwater-lake flow at a provided stage and groundwater head. More... | |
| subroutine | lak_calculate_conn_exchange_deriv (this, ilak, iconn, stage, head, flow, dqds, dqdh) |
| Lakebed seepage and its derivatives for a connection (IMPLICIT) More... | |
| subroutine | lak_estimate_conn_exchange (this, iflag, ilak, iconn, idry, stage, head, flow, source, gwfhcof, gwfrhs) |
| Calculate the groundwater-lake flow at a provided stage and groundwater head. More... | |
| subroutine | lak_calculate_storagechange (this, ilak, stage, stage0, delt, dvr) |
| Calculate the storage change in a lake based on provided stages and a passed delt. More... | |
| subroutine | lak_calculate_rainfall (this, ilak, stage, ra) |
| Calculate the rainfall for a lake. More... | |
| subroutine | lak_calculate_runoff (this, ilak, ro) |
| Calculate runoff to a lake. More... | |
| subroutine | lak_calculate_inflow (this, ilak, qin) |
| Calculate specified inflow to a lake. More... | |
| subroutine | lak_calculate_external (this, ilak, ex) |
| Calculate the external flow terms to a lake. More... | |
| subroutine | lak_calculate_withdrawal (this, ilak, avail, wr) |
| Calculate the withdrawal from a lake subject to an available volume. More... | |
| subroutine | lak_calculate_evaporation (this, ilak, stage, avail, ev) |
| Calculate the evaporation from a lake at a provided stage subject to an available volume. More... | |
| subroutine | lak_calculate_outlet_inflow (this, ilak, outinf) |
| Calculate the outlet inflow to a lake. More... | |
| subroutine | lak_calculate_outlet_outflow (this, ilak, stage, avail, outoutf) |
| Calculate the outlet outflow from a lake. More... | |
| subroutine | lak_outlet_outflow_rate (this, ilak, stage, qout) |
| Total uncapped outlet outflow rate from a lake at a provided stage. More... | |
| subroutine | lak_get_internal_inlet (this, ilak, outinf) |
| Get the outlet inflow to a lake from another lake. More... | |
| subroutine | lak_get_internal_outlet (this, ilak, outoutf) |
| Get the outlet from a lake to another lake. More... | |
| subroutine | lak_get_external_outlet (this, ilak, outoutf) |
| Get the outlet outflow from a lake to an external boundary. More... | |
| subroutine | lak_get_external_mover (this, ilak, outoutf) |
| Get the mover outflow from a lake to an external boundary. More... | |
| subroutine | lak_get_internal_mover (this, ilak, outoutf) |
| Get the mover outflow from a lake to another lake. More... | |
| subroutine | lak_get_outlet_tomover (this, ilak, outoutf) |
| Get the outlet to mover from a lake. More... | |
| subroutine | lak_vol2stage (this, ilak, vol, stage) |
| Determine the stage from a provided volume. More... | |
| integer(i4b) function | lak_check_valid (this, itemno) |
| Determine if a valid lake or outlet number has been specified. More... | |
| subroutine | lak_set_nonneg_value (this, n, itemno, setting, value_array, label) |
| Apply a PERIOD lake setting and require its value be non-negative. More... | |
| subroutine | lak_set_attribute_error (this, ilak, keyword, msg) |
| Issue a parameter error for lake ilak. More... | |
| subroutine | lak_source_options (this) |
| Source OPTIONS block from input context. More... | |
| subroutine | lak_input_init (this, mempath, naux, noutlets) |
| Bind LakInputType pointers. More... | |
| subroutine | lak_input_destroy (this) |
| Nullify all LakInputType pointers. More... | |
| subroutine | lak_ar (this) |
| Allocate and Read. More... | |
| subroutine | lak_rp (this) |
| Read and prepare (stress period data) More... | |
| subroutine | lak_ad (this) |
| Add package connection to matrix. More... | |
| subroutine | lak_cf (this) |
| Formulate the HCOF and RHS terms. More... | |
| subroutine | lak_fc (this, rhs, ia, idxglo, matrix_sln) |
| Copy rhs and hcof into solution rhs and amat. More... | |
| subroutine | lak_fn (this, rhs, ia, idxglo, matrix_sln) |
| Fill newton terms. More... | |
| subroutine | lak_nur (this, neqpak, x, xtemp, dx, inewtonur, dxmax, locmax) |
| Apply Newton under-relaxation to the lake stage. More... | |
| subroutine | lak_cc (this, innertot, kiter, iend, icnvgmod, cpak, ipak, dpak) |
| Final convergence check for package. More... | |
| subroutine | lak_cq (this, x, flowja, iadv) |
| Calculate flows. More... | |
| subroutine | lak_ot_package_flows (this, icbcfl, ibudfl) |
| Output LAK package flow terms. More... | |
| subroutine | lak_ot_model_flows (this, icbcfl, ibudfl, icbcun, imap) |
| Write flows to binary file and/or print flows to budget. More... | |
| subroutine | lak_ot_dv (this, idvsave, idvprint) |
| Save LAK-calculated values to binary file. More... | |
| subroutine | lak_ot_bdsummary (this, kstp, kper, iout, ibudfl) |
| Write LAK budget to listing file. More... | |
| subroutine | lak_da (this) |
| Deallocate objects. More... | |
| subroutine | define_listlabel (this) |
| Define the list heading that is written to iout when PRINT_INPUT option is used. More... | |
| subroutine | lak_set_pointers (this, neq, ibound, xnew, xold, flowja) |
| Set pointers to model arrays and variables so that a package has access to these things. More... | |
| subroutine | lak_ac (this, moffset, sparse) |
| Add the lake rows and columns to the sparse matrix. More... | |
| subroutine | lak_mc (this, moffset, matrix_sln) |
| Find the matrix position of each lake row and connection. More... | |
| logical function | lak_obs_supported (this) |
| Procedures related to observations (type-bound) More... | |
| subroutine | lak_df_obs (this) |
| Store observation type supported by LAK package. Overrides BndTypebnd_df_obs. More... | |
| subroutine | lak_bd_obs (this) |
| Calculate observations this time step and call ObsTypeSaveOneSimval for each LakType observation. More... | |
| subroutine | lak_rp_obs (this) |
| Process each observation. More... | |
| subroutine | lak_process_obsid (obsrv, dis, inunitobs, iout) |
| This procedure is pointed to by ObsDataTypeProcesssIdPtr. It processes the ID string of an observation definition for LAK package observations. More... | |
| subroutine | lak_accumulate_chterm (this, ilak, rrate, chratin, chratout) |
| Accumulate constant head terms for budget. More... | |
| subroutine | lak_bound_update (this) |
| Store the lake head and connection conductance in the bound array. More... | |
| subroutine | lak_solve (this, update, only_legacy) |
| Solve for lake stage. More... | |
| subroutine | lak_solve_single (this, n, iter, maxiter, ncnv, lupdate) |
| Advance one lake stage by a single substitution iteration. More... | |
| subroutine | lak_estimate_seepage_single (this, n, ncnv) |
| Estimate the lakebed seepage for a single lake. More... | |
| subroutine | lak_bisection (this, n, ibflg, hlak, temporary_stage, dh, residual) |
| @ brief Lake package bisection method More... | |
| subroutine | lak_calculate_available (this, n, hlak, avail, ra, ro, qinf, ex, headp) |
| Calculate the available volumetric rate for a lake given a passed stage. More... | |
| subroutine | lak_calculate_residual (this, n, hlak, resid, headp) |
| Calculate the residual for a lake given a passed stage. More... | |
| subroutine | lak_setup_budobj (this) |
| Set up the budget object that stores all the lake flows. More... | |
| subroutine | lak_fill_budobj (this) |
| Copy flow terms into thisbudobj. More... | |
| subroutine | lak_setup_tableobj (this) |
| Set up the table object that is used to write the lak stage data. More... | |
| subroutine | lak_activate_density (this) |
| Activate addition of density terms. More... | |
| subroutine | lak_activate_viscosity (this) |
| Activate viscosity terms. More... | |
| subroutine | lak_calculate_density_exchange (this, iconn, stage, head, cond, botl, flow, gwfhcof, gwfrhs) |
| Calculate the groundwater-lake density exchange terms. More... | |
Variables | |
| character(len=lenftype) | ftype = 'LAK' |
| character(len=lenpackagename) | text = ' LAK' |
| subroutine lakmodule::define_listlabel | ( | class(laktype), intent(inout) | this | ) |
Definition at line 4482 of file gwf-lak.f90.
| subroutine lakmodule::lak_ac | ( | class(laktype), intent(inout) | this, |
| integer(i4b), intent(in) | moffset, | ||
| type(sparsematrix), intent(inout) | sparse | ||
| ) |
Implicit formulation only. Each lake adds one equation (row and column) to the groundwater flow matrix: a diagonal entry, plus a symmetric off-diagonal pair (lake-to-cell and cell-to-lake) for every lake-cell connection.
Definition at line 4549 of file gwf-lak.f90.
|
private |
Definition at line 5124 of file gwf-lak.f90.
| subroutine lakmodule::lak_activate_density | ( | class(laktype), intent(inout) | this | ) |
|
private |
Method to activate addition of viscosity terms for a LAK package reach.
| [in,out] | this | LakType object |
Definition at line 6371 of file gwf-lak.f90.
| subroutine lakmodule::lak_ad | ( | class(laktype) | this | ) |
Definition at line 3401 of file gwf-lak.f90.
|
private |
Definition at line 498 of file gwf-lak.f90.
| subroutine lakmodule::lak_allocate_scalars | ( | class(laktype), intent(inout) | this | ) |
Definition at line 436 of file gwf-lak.f90.
|
private |
Create new LAK package and point bndobj to the new package
Definition at line 3128 of file gwf-lak.f90.

|
private |
|
private |
Use bisection method to find lake stage that reduces the residual
| [in] | n | lake number |
| [in,out] | ibflg | bisection flag |
| [in] | hlak | lake stage |
| [in,out] | temporary_stage | temporary lake stage |
| [in,out] | dh | lake stage change |
| [in,out] | residual | lake residual |
Definition at line 5641 of file gwf-lak.f90.
|
private |
Definition at line 5154 of file gwf-lak.f90.
|
private |
Definition at line 5689 of file gwf-lak.f90.
|
private |
Definition at line 2093 of file gwf-lak.f90.
|
private |
Definition at line 2072 of file gwf-lak.f90.
|
private |
|
private |
Definition at line 2212 of file gwf-lak.f90.
|
private |
Returns the lakebed seepage for one connection, positive into the lake, and optionally its stage and head derivatives. The stage and the connected- cell head are each held at or above the lake bottom, the same wet/dry cutoff used by the default formulation, so the implicit seepage matches the default formulation exactly. lak_fc_implicit uses this to assemble the matrix and lak_cq uses it to report the budget, so the two are consistent.
Definition at line 2281 of file gwf-lak.f90.
|
private |
| subroutine lakmodule::lak_calculate_density_exchange | ( | class(laktype), intent(inout) | this, |
| integer(i4b), intent(in) | iconn, | ||
| real(dp), intent(in) | stage, | ||
| real(dp), intent(in) | head, | ||
| real(dp), intent(in) | cond, | ||
| real(dp), intent(in) | botl, | ||
| real(dp), intent(inout) | flow, | ||
| real(dp), intent(inout) | gwfhcof, | ||
| real(dp), intent(inout) | gwfrhs | ||
| ) |
Arguments are as follows: iconn : lak-gwf connection number stage : lake stage head : gwf head cond : conductance botl : bottom elevation of this connection flow : calculated flow, updated here with density terms gwfhcof : gwf head coefficient, updated here with density terms gwfrhs : gwf right-hand-side value, updated here with density terms
Member variable used here denseterms : shape (3, MAXBOUND), filled by buoyancy package col 1 is relative density of lake (denselak / denseref) col 2 is relative density of gwf cell (densegwf / denseref) col 3 is elevation of gwf cell
Definition at line 6411 of file gwf-lak.f90.
|
private |
|
private |
Definition at line 2188 of file gwf-lak.f90.
|
private |
Definition at line 2430 of file gwf-lak.f90.
|
private |
Definition at line 2418 of file gwf-lak.f90.
|
private |
Definition at line 2495 of file gwf-lak.f90.
|
private |
Definition at line 2516 of file gwf-lak.f90.
|
private |
Definition at line 2384 of file gwf-lak.f90.
| subroutine lakmodule::lak_calculate_residual | ( | class(laktype), intent(inout) | this, |
| integer(i4b), intent(in) | n, | ||
| real(dp), intent(in) | hlak, | ||
| real(dp), intent(inout) | resid, | ||
| real(dp), intent(in), optional | headp | ||
| ) |
Definition at line 5754 of file gwf-lak.f90.
|
private |
Definition at line 2406 of file gwf-lak.f90.
|
private |
|
private |
Definition at line 2362 of file gwf-lak.f90.
|
private |
|
private |
Definition at line 1940 of file gwf-lak.f90.
|
private |
Definition at line 2446 of file gwf-lak.f90.
|
private |
Definition at line 3721 of file gwf-lak.f90.

| subroutine lakmodule::lak_cf | ( | class(laktype) | this | ) |
|
private |
Definition at line 2821 of file gwf-lak.f90.

| subroutine lakmodule::lak_cq | ( | class(laktype), intent(inout) | this, |
| real(dp), dimension(:), intent(in) | x, | ||
| real(dp), dimension(:), intent(inout), contiguous | flowja, | ||
| integer(i4b), intent(in), optional | iadv | ||
| ) |
| subroutine, public lakmodule::lak_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 | ||
| ) |
Definition at line 394 of file gwf-lak.f90.


| subroutine lakmodule::lak_da | ( | class(laktype) | this | ) |
Definition at line 4301 of file gwf-lak.f90.
|
private |
Definition at line 4660 of file gwf-lak.f90.
|
private |
Definition at line 2319 of file gwf-lak.f90.
| subroutine lakmodule::lak_estimate_seepage_single | ( | class(laktype), intent(inout) | this, |
| integer(i4b), intent(in) | n, | ||
| integer(i4b), intent(in) | ncnv | ||
| ) |
Runs the two-pass connection-seepage estimate for lake n at its current stage and the perturbed stage, accumulating thisseep(n)/thisseep1(n) and, on the final pass when ncnv == 0, the gwf-cell hcof/rhs contributions. Lakes do not couple within this estimate (each connection touches only its own lake's flwiter), so evaluating both passes per lake is equivalent to the all-lakes-per-pass ordering in lak_solve. Extracted from lak_solve so the same estimate can drive the single-lake legacy solve for the IMPLICIT formulation.
Definition at line 5571 of file gwf-lak.f90.
|
private |
Definition at line 3565 of file gwf-lak.f90.
| subroutine lakmodule::lak_fill_budobj | ( | class(laktype) | this | ) |
Definition at line 6088 of file gwf-lak.f90.
|
private |
Definition at line 3606 of file gwf-lak.f90.
|
private |
Definition at line 2678 of file gwf-lak.f90.
|
private |
Definition at line 2659 of file gwf-lak.f90.
|
private |
Definition at line 2619 of file gwf-lak.f90.
|
private |
Definition at line 2699 of file gwf-lak.f90.
|
private |
Definition at line 2640 of file gwf-lak.f90.
|
private |
Definition at line 2720 of file gwf-lak.f90.
| subroutine lakmodule::lak_input_destroy | ( | class(lakinputtype), intent(inout) | this | ) |
Definition at line 3107 of file gwf-lak.f90.
|
private |
Called once from lak_ar; pointers remain valid for the simulation lifetime. Input tsmanager advances TS-linked values transparently each timestep.
Definition at line 3078 of file gwf-lak.f90.
| subroutine lakmodule::lak_linear_interpolation | ( | class(laktype), intent(inout) | this, |
| integer(i4b), intent(in) | n, | ||
| real(dp), dimension(n), intent(in) | x, | ||
| real(dp), dimension(n), intent(in) | y, | ||
| real(dp), intent(in) | z, | ||
| real(dp), intent(inout) | v | ||
| ) |
| subroutine lakmodule::lak_mc | ( | class(laktype), intent(inout) | this, |
| integer(i4b), intent(in) | moffset, | ||
| class(matrixbasetype), pointer | matrix_sln | ||
| ) |
Implicit formulation only. Finds the position in the assembled matrix of each lake-row diagonal, lake-to-cell, cell diagonal, and cell-to-lake entry and stores them in the idx* arrays so they can be filled during assembly.
Definition at line 4583 of file gwf-lak.f90.
|
private |
Implicit formulation only. The model Newton under-relaxation step (gwf_nur) calls this routine with the lake-stage part of the solution. If an updated stage falls below the lake bottom, it is relaxed back toward the bottom (90 percent of the way) and its change is zeroed. Active only when the model uses NEWTON UNDER_RELAXATION.
Definition at line 3679 of file gwf-lak.f90.
| logical function lakmodule::lak_obs_supported | ( | class(laktype) | this | ) |
Return true because LAK package supports observations. Overrides BndTypebnd_obs_supported()
Definition at line 4650 of file gwf-lak.f90.
| subroutine lakmodule::lak_ot_bdsummary | ( | class(laktype) | this, |
| integer(i4b), intent(in) | kstp, | ||
| integer(i4b), intent(in) | kper, | ||
| integer(i4b), intent(in) | iout, | ||
| integer(i4b), intent(in) | ibudfl | ||
| ) |
| this | LakType 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 4286 of file gwf-lak.f90.
|
private |
Definition at line 4215 of file gwf-lak.f90.

| subroutine lakmodule::lak_ot_model_flows | ( | class(laktype) | this, |
| integer(i4b), intent(in) | icbcfl, | ||
| integer(i4b), intent(in) | ibudfl, | ||
| integer(i4b), intent(in) | icbcun, | ||
| integer(i4b), dimension(:), intent(in), optional | imap | ||
| ) |
Definition at line 4202 of file gwf-lak.f90.
| subroutine lakmodule::lak_ot_package_flows | ( | class(laktype) | this, |
| integer(i4b), intent(in) | icbcfl, | ||
| integer(i4b), intent(in) | ibudfl | ||
| ) |
Definition at line 4176 of file gwf-lak.f90.
|
private |
Side-effect-free companion to lak_calculate_outlet_outflow used by the implicit formulation: returns the summed (negative) rating-curve outflow for all outlets whose source is ilak, without applying the available-water cap or updating simoutrate. Used to linearize the outlet-outflow sink on the lake row in stage.
Definition at line 2580 of file gwf-lak.f90.
| subroutine lakmodule::lak_process_obsid | ( | type(observetype), intent(inout) | obsrv, |
| class(disbasetype), intent(in) | dis, | ||
| integer(i4b), intent(in) | inunitobs, | ||
| integer(i4b), intent(in) | iout | ||
| ) |
|
private |
Definition at line 1591 of file gwf-lak.f90.

| subroutine lakmodule::lak_rp | ( | class(laktype), intent(inout) | this | ) |
Definition at line 3181 of file gwf-lak.f90.

|
private |
Only done the first stress period since boundaries are fixed for the simulation
Definition at line 4920 of file gwf-lak.f90.

|
private |
| subroutine lakmodule::lak_set_nonneg_value | ( | class(laktype), intent(inout) | this, |
| integer(i4b), intent(in) | n, | ||
| integer(i4b), intent(in) | itemno, | ||
| character(len=*), intent(in) | setting, | ||
| real(dp), dimension(:), intent(inout) | value_array, | ||
| character(len=*), intent(in) | label | ||
| ) |
|
private |
Definition at line 4507 of file gwf-lak.f90.
| subroutine lakmodule::lak_setup_budobj | ( | class(laktype) | this | ) |
Definition at line 5836 of file gwf-lak.f90.

|
private |
The terms listed here must correspond in number and order to the ones written to the stage table in the lak_ot method
Definition at line 6276 of file gwf-lak.f90.

|
private |
Solve the lake stage by substitution. With only_legacy set, solve only the lakes flagged for the legacy solver (thisilegacy /= 0) and leave the remaining lakes – whose stage is solved in the global matrix by the IMPLICIT formulation – untouched. Without it (the default), every active lake is solved.
Definition at line 5185 of file gwf-lak.f90.
| subroutine lakmodule::lak_solve_single | ( | class(laktype), intent(inout) | this, |
| integer(i4b), intent(in) | n, | ||
| integer(i4b), intent(in) | iter, | ||
| integer(i4b), intent(in) | maxiter, | ||
| integer(i4b), intent(in) | ncnv, | ||
| logical(lgp), intent(in) | lupdate | ||
| ) |
Performs one Newton update (with a bisection backup) of lake n's stage in the default substitution solver, using the per-iteration seepage estimate (thisseep / thisseep1) already computed for the lake. Extracted from lak_solve so the same per-lake update can be reused to solve a single lake stage on its own – the per-lake legacy solve for the IMPLICIT formulation.
Definition at line 5357 of file gwf-lak.f90.
|
private |
|
private |
| subroutine lakmodule::lak_source_options | ( | class(laktype), intent(inout) | this | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
Definition at line 2740 of file gwf-lak.f90.
|
private |
Definition at line 1171 of file gwf-lak.f90.
|
private |
Definition at line 46 of file gwf-lak.f90.
|
private |
Definition at line 47 of file gwf-lak.f90.