![]() |
MODFLOW 6
version 6.9.0.dev0
USGS Modular Hydrologic Model
|
Load context for IDM generic dynamic loaders. More...
Data Types | |
| type | readstatevartype |
| Pointer type for read state variable. More... | |
| interface | setptr |
| type | keystringitemtype |
| One descriptor per expanded keystring item, so loaders iterate uniformly instead of re-deriving per-mode state. More... | |
| type | loadcontexttype |
| 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... | |
Enumerations | |
| enum | { load_undef = 0 , list = 1 , layerarray = 2 , gridarray = 3 , keystring = 4 } |
Functions/Subroutines | |
| subroutine | init (this, mf6_input, blockname, named_bound) |
| Initialize the load context. More... | |
| subroutine | resolve_context (this) |
| Set context flags from input load_scope and component metadata. More... | |
| subroutine | resolve_loadtype (this) |
| Determine loadtype from block and param definitions. More... | |
| subroutine | resolve_dimensions (this) |
| Resolve dimension scalars and scale keystring maxbound. More... | |
| subroutine | 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. More... | |
| subroutine | allocate_arrays (this) |
| allocate arrays More... | |
| subroutine | allocate_param (this, idt) |
| allocate a package dynamic input parameter More... | |
| subroutine | allocate_params (this) |
| Allocate each in-scope parameter in the memory manager. More... | |
| logical(lgp) function | 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. More... | |
| logical(lgp) function | 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. More... | |
| logical(lgp) function | option_check (this, varname, threshold) |
| Return .true. if a memory-manager integer option variable exceeds a threshold. More... | |
| subroutine | build_keystring_items (this) |
| Build the per-item descriptor table, the single source of truth for how each keystring item is allocated and applied. More... | |
| integer(i4b) function | 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. More... | |
| integer(i4b) function | 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. More... | |
| logical(lgp) function | shape_param_is_array (this, shape_varname) |
| Is shape_varname a per-feature array (PACKAGEDATA) rather than a package-wide scalar (DIMENSIONS)? More... | |
| subroutine | set_params (this) |
| set set of in scope parameters for package More... | |
| character(len=lenvarname) function | rsv_alloc (this, mf6varname) |
| allocate a read state variable More... | |
| subroutine | destroy (this) |
| destroy input context object More... | |
| type(inputparamdefinitiontype) function, pointer | find_setting_aggregate (mf6_input, rec_cols, nrec_col) |
| Return the KEYSTRING aggregate for the SETTING token in rec_cols, or null(). More... | |
| subroutine | expand_record_body (mf6_input, rec_idt, item_names, nkeystring_items) |
| Append body column names from a RECORD compound entry to item_names. More... | |
| logical(lgp) function, public | is_keystring_period (mf6_input) |
| Return .true. if mf6_input's PERIOD block uses keystring dispatch. More... | |
| logical(lgp) function, public | is_feature_keystring (mf6_input) |
| .true. if mf6_input's PERIOD block is feature-addressed (see is_feature_tag). Block-independent, unlike LoadContextType's own keystring_by_feature, which is only valid for a PERIOD-scoped instance. More... | |
| logical(lgp) function | is_feature_tag (tagname) |
| .true. if tagname is a record's leading id column (IFNO and its legacy package-specific aliases). Single source for both resolve_loadtype and is_feature_keystring. More... | |
| logical(lgp) function, public | is_advanced (mf6_input) |
| Return .true. if mf6_input is an advanced package. More... | |
| subroutine | 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. More... | |
| subroutine | check_developmode (this, input_name) |
| Check whether any in-scope parameter is a development-mode feature. More... | |
| character(len=lenvarname) function, public | rsv_name (mf6varname) |
| create read state variable name More... | |
| subroutine | allocate_int1d (nrow, varname, mempath) |
| allocate int1d More... | |
| subroutine | allocate_dbl1d (nrow, varname, mempath) |
| allocate dbl1d More... | |
| subroutine | allocate_dbl2d (ncol, nrow, varname, mempath) |
| allocate dbl2d More... | |
| subroutine | setval (intptr, varname, mempath) |
| allocate intptr and update from input context More... | |
| subroutine | setptr_int (intptr, varname, mempath) |
| set intptr to varname More... | |
| subroutine | setptr_charstr1d (charstr1d, varname, mempath, strlen) |
| set charstr1d pointer to varname More... | |
| subroutine | setptr_auxvar (auxvar, mempath) |
| set auxvar pointer More... | |
Variables | |
| integer(i4b), parameter, public | addr_none = 0 |
| not an applied setting More... | |
| integer(i4b), parameter, public | addr_feature = 1 |
| addressed by leading id (IFNO/BNDNO) More... | |
| integer(i4b), parameter, public | addr_node = 2 |
| addressed by CELLID More... | |
| integer(i4b), parameter, public | addr_subindex = 3 |
| addressed by (id, subindex) More... | |
LoadContextType classifies each input, builds the in-scope parameter list for the active block, and manages memory-manager dimension scalars and array pointers. It is used by all dynamic loaders: ListLoadType, KeystringLoadType, LayerArrayLoadType, GridArrayLoadType, and StructArray-based static loads.
|
private |
| Enumerator | |
|---|---|
| load_undef | undefined load type |
| list | list load |
| layerarray | readasarrays load |
| gridarray | readarraygrid load |
| keystring | keystring period block load |
Definition at line 31 of file LoadContext.f90.
|
private |
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 343 of file LoadContext.f90.

| subroutine loadcontextmodule::allocate_dbl1d | ( | integer(i4b), intent(in) | nrow, |
| character(len=*), intent(in) | varname, | ||
| character(len=*), intent(in) | mempath | ||
| ) |
| [in] | nrow | integer array number of rows |
| [in] | varname | variable name |
| [in] | mempath | variable mempath |
Definition at line 1235 of file LoadContext.f90.

| subroutine loadcontextmodule::allocate_dbl2d | ( | integer(i4b), intent(in) | ncol, |
| integer(i4b), intent(in) | nrow, | ||
| character(len=*), intent(in) | varname, | ||
| character(len=*), intent(in) | mempath | ||
| ) |
| [in] | ncol | integer array number of cols |
| [in] | nrow | integer array number of rows |
| [in] | varname | variable name |
| [in] | mempath | variable mempath |
Definition at line 1250 of file LoadContext.f90.

| subroutine loadcontextmodule::allocate_int1d | ( | integer(i4b), intent(in) | nrow, |
| character(len=*), intent(in) | varname, | ||
| character(len=*), intent(in) | mempath | ||
| ) |
| [in] | nrow | integer array number of rows |
| [in] | varname | variable name |
| [in] | mempath | variable mempath |
Definition at line 1220 of file LoadContext.f90.

| subroutine loadcontextmodule::allocate_param | ( | class(loadcontexttype) | this, |
| type(inputparamdefinitiontype), pointer | idt | ||
| ) |
Called only from allocate_params(), itself called only by the LAYERARRAY/GRIDARRAY loaders – thisloadtype is never LIST here.
Definition at line 389 of file LoadContext.f90.

| subroutine loadcontextmodule::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 441 of file LoadContext.f90.

| subroutine loadcontextmodule::build_keystring_items | ( | class(loadcontexttype) | this | ) |
| subroutine loadcontextmodule::check_developmode | ( | class(loadcontexttype) | this, |
| character(len=*), intent(in) | input_name | ||
| ) |
Definition at line 1177 of file LoadContext.f90.

| subroutine loadcontextmodule::destroy | ( | class(loadcontexttype) | this | ) |
Definition at line 916 of file LoadContext.f90.
| subroutine loadcontextmodule::expand_record_body | ( | type(modflowinputtype), intent(in) | mf6_input, |
| type(inputparamdefinitiontype), intent(in), pointer | rec_idt, | ||
| character(len=linelength), dimension(:), intent(inout), allocatable | item_names, | ||
| integer(i4b), intent(inout) | nkeystring_items | ||
| ) |
Definition at line 982 of file LoadContext.f90.


|
private |
Definition at line 950 of file LoadContext.f90.


| logical(lgp) function loadcontextmodule::in_scope | ( | class(loadcontexttype) | this, |
| character(len=*), intent(in) | tagname | ||
| ) |
|
private |
Classifies the input, builds the in-scope parameter list, and resolves memory-manager dimension scalars.
Definition at line 143 of file LoadContext.f90.

| logical(lgp) function, public loadcontextmodule::is_advanced | ( | type(modflowinputtype), intent(in) | mf6_input | ) |
Definition at line 1084 of file LoadContext.f90.


| logical(lgp) function, public loadcontextmodule::is_feature_keystring | ( | type(modflowinputtype), intent(in) | mf6_input | ) |
Definition at line 1048 of file LoadContext.f90.


| logical(lgp) function loadcontextmodule::is_feature_tag | ( | character(len=*), intent(in) | tagname | ) |
| logical(lgp) function, public loadcontextmodule::is_keystring_period | ( | type(modflowinputtype), intent(in) | mf6_input | ) |
Definition at line 1016 of file LoadContext.f90.


|
private |
|
private |
| subroutine loadcontextmodule::resolve_context | ( | class(loadcontexttype) | this | ) |
| subroutine loadcontextmodule::resolve_dimensions | ( | class(loadcontexttype) | this | ) |
| integer(i4b) function loadcontextmodule::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 738 of file LoadContext.f90.

|
private |
Definition at line 208 of file LoadContext.f90.

| integer(i4b) function loadcontextmodule::resolve_nfeatures | ( | class(loadcontexttype) | this | ) |
Definition at line 685 of file LoadContext.f90.

| character(len=lenvarname) function loadcontextmodule::rsv_alloc | ( | class(loadcontexttype) | this, |
| character(len=*), intent(in) | mf6varname | ||
| ) |
Create and set a read state variable, e.g. 'INRECHARGE', which are updated per iper load as follows: -1: unset, not in use 0: not read in most recent period block 1: numeric input read in most recent period block 2: time series input read in most recent period block
Definition at line 902 of file LoadContext.f90.

| character(len=lenvarname) function, public loadcontextmodule::rsv_name | ( | character(len=*), intent(in) | mf6varname | ) |
| subroutine loadcontextmodule::scale_keystring_maxbound | ( | class(loadcontexttype) | this | ) |
Definition at line 319 of file LoadContext.f90.
|
private |
| subroutine loadcontextmodule::setptr_auxvar | ( | real(dp), dimension(:, :), intent(inout), pointer, contiguous | auxvar, |
| character(len=*), intent(in) | mempath | ||
| ) |
Definition at line 1319 of file LoadContext.f90.
| subroutine loadcontextmodule::setptr_charstr1d | ( | type(characterstringtype), dimension(:), intent(inout), pointer, contiguous | charstr1d, |
| character(len=*), intent(in) | varname, | ||
| character(len=*), intent(in) | mempath, | ||
| integer(i4b), intent(in) | strlen | ||
| ) |
Definition at line 1300 of file LoadContext.f90.
| subroutine loadcontextmodule::setptr_int | ( | integer(i4b), intent(inout), pointer | intptr, |
| character(len=*), intent(in) | varname, | ||
| character(len=*), intent(in) | mempath | ||
| ) |
Definition at line 1283 of file LoadContext.f90.
| subroutine loadcontextmodule::setval | ( | integer(i4b), intent(inout), pointer | intptr, |
| character(len=*), intent(in) | varname, | ||
| character(len=*), intent(in) | mempath | ||
| ) |
| logical(lgp) function loadcontextmodule::shape_param_is_array | ( | class(loadcontexttype) | this, |
| character(len=*), intent(in) | shape_varname | ||
| ) |
Definition at line 777 of file LoadContext.f90.
| logical(lgp) function loadcontextmodule::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 545 of file LoadContext.f90.
| integer(i4b), parameter, public loadcontextmodule::addr_feature = 1 |
Definition at line 52 of file LoadContext.f90.
| integer(i4b), parameter, public loadcontextmodule::addr_node = 2 |
Definition at line 53 of file LoadContext.f90.
| integer(i4b), parameter, public loadcontextmodule::addr_none = 0 |
Definition at line 51 of file LoadContext.f90.
| integer(i4b), parameter, public loadcontextmodule::addr_subindex = 3 |
Definition at line 54 of file LoadContext.f90.