![]() |
MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
|
Input load context for generic dynamic loaders and StructArray based static loads. Classifies the input, determines in-scope parameters, and manages memory-manager scalars and array pointers. More...

Public Member Functions | |
| procedure | init (this, mf6_input, blockname, named_bound) |
| Initialize the load context. | |
| procedure | allocate_arrays (this) |
| allocate arrays | |
| procedure | allocate_params (this) |
| Allocate each in-scope parameter in the memory manager. | |
| procedure | rsv_alloc (this, mf6varname) |
| allocate a read state variable | |
| procedure | destroy (this) |
| destroy input context object | |
| procedure | check_developmode (this, input_name) |
| Check whether any in-scope parameter is a development-mode feature. | |
| procedure | subindex_dependency (this, tagname, dimname, subindex_tagname) |
| Hardcoded per-package dependency for a subindex param with no SHAPE of its own – same category of special-casing as in_scope, for a dimension name and subindex field instead. | |
| procedure | build_keystring_items (this) |
| Build the per-item descriptor table, the single source of truth for how each keystring item is allocated and applied. | |
| procedure | resolve_item_nfeatures (this, item_tagname, dimname, default_nfeatures) |
| Per-item feature count from a named dimension, falling back to default_nfeatures if unset. Populated-then-released is an error. | |
Public Attributes | |
| integer(i4b), pointer | naux => null() |
| number of auxiliary variables | |
| integer(i4b), pointer | maxbound => null() |
| value associated with named_bound | |
| integer(i4b), pointer | boundnames => null() |
| are bound names optioned | |
| integer(i4b), pointer | iprpak => null() |
| print input option | |
| integer(i4b), pointer | nbound => null() |
| number of bounds in period | |
| integer(i4b), pointer | ncpl => null() |
| ncpl associated with model shape | |
| integer(i4b), pointer | nodes => null() |
| nodes associated with model shape | |
| integer(i4b), dimension(:), pointer, contiguous | mshape => null() |
| model shape | |
| type(characterstringtype), dimension(:), pointer, contiguous | auxname_cst => null() |
| array of auxiliary names | |
| type(characterstringtype), dimension(:), pointer, contiguous | boundname_cst => null() |
| array of bound names | |
| real(dp), dimension(:, :), pointer, contiguous | auxvar => null() |
| auxiliary variable array | |
| integer(i4b) | loadtype |
| load type enum: LIST, LAYERARRAY, GRIDARRAY, KEYSTRING | |
| logical(lgp) | set_scalars = .false. |
| .true. when dimension scalars must be set | |
| logical(lgp) | set_mshape = .false. |
| .true. when model shape is load dependency | |
| logical(lgp) | is_exchange = .false. |
| .true. for exchange contexts | |
| logical(lgp) | is_advanced = .false. |
| .true. for an advanced package, any loadtype | |
| character(len=lenvarname) | blockname |
| load block name | |
| character(len=lenvarname) | named_bound |
| name of dimension variable for maxbound; defaults to MAXBOUND | |
| integer(i4b) | nleading = 0 |
| count of leading (pre-keystring) columns | |
| character(len=linelength), dimension(:), allocatable | params |
| in-scope param tagnames | |
| type(modflowinputtype) | mf6_input |
| description of input | |
| logical(lgp) | keystring_by_feature = .false. |
| .true. for feature-addressed (IFNO/NUMBER/BNDNO) KEYSTRING loadtype | |
| logical(lgp) | keystring_by_node = .false. |
| .true. for CELLID-addressed (e.g. TVK/TVS) KEYSTRING loadtype | |
| logical(lgp) | has_setting_dispatch = .false. |
| .true. when keystring_by_feature .or. keystring_by_node | |
| type(inputparamdefinitiontype), pointer | setting_idt => null() |
| internal idt for SETTING column | |
| integer(i4b) | nkeystring_items = 0 |
| count of expanded keystring items (0 for non-keystring) | |
| type(keystringitemtype), dimension(:), allocatable | keystring_items |
| character(len=lenvarname) | feature_id_varname = '' |
| leading id column mf6varname (feature-addressed) | |
Private Member Functions | |
| procedure, private | resolve_context (this) |
| Set context flags from input load_scope and component metadata. | |
| procedure, private | resolve_loadtype (this) |
| Determine loadtype from block and param definitions. | |
| procedure, private | set_params (this) |
| set set of in scope parameters for package | |
| procedure, private | keystring_item_names (this, item_names, head_nbody, item_is_body, nkeystring_items) |
| Return keystring item column names, per-head body counts, and body flags. A RECORD group's trailing columns are body members; its head and any direct-dispatch param are not. | |
| procedure, private | resolve_dimensions (this) |
| Resolve dimension scalars and scale keystring maxbound. | |
| procedure, private | scale_keystring_maxbound (this) |
| Scale maxbound (a feature or node count) by the number of KEYSTRING items, so every feature can use every setting in one period. | |
| procedure, private | allocate_param (this, idt) |
| allocate a package dynamic input parameter | |
| procedure, private | in_scope (this, tagname) |
| Return .true. if an optional parameter is active for this load. Required/structural params are handled by the caller; generic conditions are checked first, then package-specific ones by subcomponent_type. | |
| procedure, private | option_check (this, varname, threshold) |
| Return .true. if a memory-manager integer option variable exceeds a threshold. | |
| procedure, private | resolve_nfeatures (this) |
| Resolve the permanent array's feature count. The explicit DIMENSIONS dimension (named_bound) is authoritative when present; PACKAGEDATA row count is the fallback. Both present and disagreeing is an error. | |
| procedure, private | shape_param_is_array (this, shape_varname) |
| Is shape_varname a per-feature array (PACKAGEDATA) rather than a package-wide scalar (DIMENSIONS)? | |
Definition at line 89 of file LoadContext.f90.
| procedure loadcontextmodule::loadcontexttype::allocate_arrays | ( | class(loadcontexttype) | this | ) |
Call after input parameters are allocated: after load_params() with create for array-based loaders, or after all mem_create_vector() calls for list-based load.
Definition at line 128 of file LoadContext.f90.
|
private |
Called only from allocate_params(), itself called only by the LAYERARRAY/GRIDARRAY loaders – thisloadtype is never LIST here.
Definition at line 139 of file LoadContext.f90.
| procedure loadcontextmodule::loadcontexttype::allocate_params | ( | class(loadcontexttype) | this | ) |
Call after init() for array-based loaders (LAYERARRAY, GRIDARRAY) that need memory-manager storage allocated for every in-scope parameter. Loaders access thisparams and size(thisparams) directly.
Definition at line 129 of file LoadContext.f90.
| procedure loadcontextmodule::loadcontexttype::build_keystring_items | ( | class(loadcontexttype) | this | ) |
Definition at line 144 of file LoadContext.f90.
| procedure loadcontextmodule::loadcontexttype::check_developmode | ( | class(loadcontexttype) | this, |
| character(len=*), intent(in) | input_name ) |
Definition at line 140 of file LoadContext.f90.
| procedure loadcontextmodule::loadcontexttype::destroy | ( | class(loadcontexttype) | this | ) |
Definition at line 131 of file LoadContext.f90.
|
private |
Definition at line 141 of file LoadContext.f90.
| procedure loadcontextmodule::loadcontexttype::init | ( | class(loadcontexttype) | this, |
| type(modflowinputtype), intent(in) | mf6_input, | ||
| character(len=*), intent(in), optional | blockname, | ||
| character(len=*), intent(in), optional | named_bound ) |
Classifies the input, builds the in-scope parameter list, and resolves memory-manager dimension scalars.
Definition at line 127 of file LoadContext.f90.
|
private |
Definition at line 136 of file LoadContext.f90.
|
private |
Definition at line 143 of file LoadContext.f90.
|
private |
Definition at line 133 of file LoadContext.f90.
|
private |
Definition at line 137 of file LoadContext.f90.
| procedure loadcontextmodule::loadcontexttype::resolve_item_nfeatures | ( | class(loadcontexttype) | this, |
| character(len=*), intent(in) | item_tagname, | ||
| character(len=*), intent(in) | dimname, | ||
| integer(i4b), intent(in) | default_nfeatures ) |
Definition at line 146 of file LoadContext.f90.
|
private |
Definition at line 134 of file LoadContext.f90.
|
private |
Definition at line 145 of file LoadContext.f90.
| procedure loadcontextmodule::loadcontexttype::rsv_alloc | ( | class(loadcontexttype) | this, |
| character(len=*), intent(in) | mf6varname ) |
Create a read state variable, e.g. 'INRECHARGE', set to RS_UNSET. Loaders update it for each period block (see RS_*).
Definition at line 130 of file LoadContext.f90.
|
private |
Definition at line 138 of file LoadContext.f90.
|
private |
Definition at line 135 of file LoadContext.f90.
|
private |
Definition at line 147 of file LoadContext.f90.
| procedure loadcontextmodule::loadcontexttype::subindex_dependency | ( | class(loadcontexttype) | this, |
| character(len=*), intent(in) | tagname, | ||
| character(len=lenvarname), intent(out) | dimname, | ||
| character(len=lenvarname), intent(out) | subindex_tagname ) |
Definition at line 142 of file LoadContext.f90.
| type(characterstringtype), dimension(:), pointer, contiguous loadcontextmodule::loadcontexttype::auxname_cst => null() |
Definition at line 99 of file LoadContext.f90.
| real(dp), dimension(:, :), pointer, contiguous loadcontextmodule::loadcontexttype::auxvar => null() |
Definition at line 103 of file LoadContext.f90.
| character(len=lenvarname) loadcontextmodule::loadcontexttype::blockname |
Definition at line 112 of file LoadContext.f90.
| type(characterstringtype), dimension(:), pointer, contiguous loadcontextmodule::loadcontexttype::boundname_cst => null() |
Definition at line 101 of file LoadContext.f90.
| integer(i4b), pointer loadcontextmodule::loadcontexttype::boundnames => null() |
Definition at line 93 of file LoadContext.f90.
| character(len=lenvarname) loadcontextmodule::loadcontexttype::feature_id_varname = '' |
Definition at line 124 of file LoadContext.f90.
| logical(lgp) loadcontextmodule::loadcontexttype::has_setting_dispatch = .false. |
Definition at line 120 of file LoadContext.f90.
| integer(i4b), pointer loadcontextmodule::loadcontexttype::iprpak => null() |
Definition at line 94 of file LoadContext.f90.
| logical(lgp) loadcontextmodule::loadcontexttype::is_advanced = .false. |
Definition at line 110 of file LoadContext.f90.
| logical(lgp) loadcontextmodule::loadcontexttype::is_exchange = .false. |
Definition at line 109 of file LoadContext.f90.
| logical(lgp) loadcontextmodule::loadcontexttype::keystring_by_feature = .false. |
Definition at line 118 of file LoadContext.f90.
| logical(lgp) loadcontextmodule::loadcontexttype::keystring_by_node = .false. |
Definition at line 119 of file LoadContext.f90.
| type(keystringitemtype), dimension(:), allocatable loadcontextmodule::loadcontexttype::keystring_items |
Definition at line 123 of file LoadContext.f90.
| integer(i4b) loadcontextmodule::loadcontexttype::loadtype |
Definition at line 106 of file LoadContext.f90.
| integer(i4b), pointer loadcontextmodule::loadcontexttype::maxbound => null() |
Definition at line 92 of file LoadContext.f90.
| type(modflowinputtype) loadcontextmodule::loadcontexttype::mf6_input |
Definition at line 116 of file LoadContext.f90.
| integer(i4b), dimension(:), pointer, contiguous loadcontextmodule::loadcontexttype::mshape => null() |
Definition at line 98 of file LoadContext.f90.
| character(len=lenvarname) loadcontextmodule::loadcontexttype::named_bound |
Definition at line 113 of file LoadContext.f90.
| integer(i4b), pointer loadcontextmodule::loadcontexttype::naux => null() |
Definition at line 91 of file LoadContext.f90.
| integer(i4b), pointer loadcontextmodule::loadcontexttype::nbound => null() |
Definition at line 95 of file LoadContext.f90.
| integer(i4b), pointer loadcontextmodule::loadcontexttype::ncpl => null() |
Definition at line 96 of file LoadContext.f90.
| integer(i4b) loadcontextmodule::loadcontexttype::nkeystring_items = 0 |
Definition at line 122 of file LoadContext.f90.
| integer(i4b) loadcontextmodule::loadcontexttype::nleading = 0 |
Definition at line 114 of file LoadContext.f90.
| integer(i4b), pointer loadcontextmodule::loadcontexttype::nodes => null() |
Definition at line 97 of file LoadContext.f90.
| character(len=linelength), dimension(:), allocatable loadcontextmodule::loadcontexttype::params |
Definition at line 115 of file LoadContext.f90.
| logical(lgp) loadcontextmodule::loadcontexttype::set_mshape = .false. |
Definition at line 108 of file LoadContext.f90.
| logical(lgp) loadcontextmodule::loadcontexttype::set_scalars = .false. |
Definition at line 107 of file LoadContext.f90.
| type(inputparamdefinitiontype), pointer loadcontextmodule::loadcontexttype::setting_idt => null() |
Definition at line 121 of file LoadContext.f90.