[modflownwt] ModflowConfig#

TOML section: [modflownwt]

Pydantic model: ModflowConfig defined in hydromodpy.solver.modflow_nwt.nwt.nwt_config.

Source on GitHub

Expert-level MODFLOW configuration organized by concern.

Show fields:

Fields#

runtime in TOML: [modflownwt.runtime]

ModflowRuntimeConfig factory expert source

MODFLOW runtime package options grouped by package.

Fields of ModflowRuntimeConfig
nwt in TOML: [modflownwt.runtime.nwt]

NwtSolverConfig factory expert source

NWT solver and executable settings.

Fields of NwtSolverConfig
version

str default = “mfnwt” expert source

MODFLOW executable/version identifier passed to FloPy.

listunit

int default = 2 expert source

Fortran unit number used for the MODFLOW list file.

verbose

bool default = False expert source

Enable verbose FloPy logging for model setup.

headtol

float default = 0.0001 expert source

Head closure criterion for the NWT nonlinear solver.

fluxtol

float default = 500.0 expert source

Flux closure criterion for the NWT nonlinear solver.

maxiterout

int default = 5000 expert source

Maximum outer nonlinear iterations in the NWT solver.

thickfact

float default = 1e-05 expert source

NWT wetting/thickness factor controlling nonlinear updates.

linmeth

int default = 1 expert source

Linear solver choice for NWT (see MODFLOW-NWT documentation).

iprnwt

int default = 1 expert source

NWT print flag controlling iteration diagnostics in listing outputs.

ibotav

int default = 1 expert source

NWT option for averaging saturated thickness at the cell bottom.

options

str default = “COMPLEX” expert source

NWT nonlinear option keyword (for example SIMPLE or COMPLEX).

continue_run

bool default = False expert source

If true, continue NWT iterations on partially converged stress periods.

backflag

int default = 0 expert source

NWT backtracking activation flag.

stoptol

float default = 1e-10 expert source

NWT backtracking stopping tolerance.

dis in TOML: [modflownwt.runtime.dis]

DisConfig factory expert source

DIS package settings.

Fields of DisConfig
itmuni

int default = 0 dev source

DIS time unit code (ITMUNI). Recorded, not obeyed: the launcher writes seconds because [simulation.time] already materializes every period length in seconds, so the run is in seconds whatever this says.

bas in TOML: [modflownwt.runtime.bas]

BasConfig factory expert source

BAS package settings.

Fields of BasConfig
hnoflo

float default = -9999.0 expert source

BAS no-flow head sentinel value (HNOFLO).

upw in TOML: [modflownwt.runtime.upw]

UpwConfig factory expert source

UPW package settings.

Fields of UpwConfig
iphdry

int default = 1 expert source

UPW dry-cell head output flag (IPHDRY).

hdry

float default = -100.0 expert source

UPW dry-cell head value (HDRY).

layvka

int default = 1 expert source

UPW flag controlling VKA interpretation per layer (LAYVKA).

evt in TOML: [modflownwt.runtime.evt]

EvtConfig factory expert source

EVT package settings.

Fields of EvtConfig
nevtop

int default = 3 expert source

EVT option code that defines how ET extinction depth is applied (NEVTOP).

ievt

int default = 1 expert source

EVT integer array selector used when NEVTOP requires layer indices (IEVT).

ipakcb

int default = 1 expert source

EVT cell-by-cell budget output flag (IPAKCB).

oc in TOML: [modflownwt.runtime.oc]

OcConfig factory expert source

OC package settings.

Fields of OcConfig
compact

bool default = True expert source

Enable compact budget format in OC outputs.

wel in TOML: [modflownwt.runtime.wel]

WelConfig factory expert source

WEL package settings.

Fields of WelConfig
ipakcb

int default = 1 expert source

WEL cell-by-cell budget output flag (IPAKCB).

lmt in TOML: [modflownwt.runtime.lmt]

LmtConfig factory expert source

LMT package settings.

Fields of LmtConfig
output_file_name

str default = “mt3d_link.ftl” expert source

LMT output filename used to couple MODFLOW to MT3DMS.

extension

str default = “lmt8” expert source

LMT package filename extension.

output_format

str default = “unformatted” expert source

LMT file format (typically ‘formatted’ or ‘unformatted’).

process_specific in TOML: [modflownwt.process_specific]

ModflowProcessSpecificConfig factory expert source

Process-specific package controls (currently UPW/EVT knobs).

Fields of ModflowProcessSpecificConfig
vka

float default = 1.0 expert source

Vertical hydraulic conductivity control passed to the UPW package (VKA).

exdp

float default = 1.0 expert source

Extinction depth (metres) used by the EVT package (EXDP). Accepts inline units, e.g. ‘1 m’, ‘50 cm’.

sgrid in TOML: [modflownwt.sgrid]

SolverSGridConfig factory user source

Spatial-grid payload split into […sgrid.planar] and […sgrid.vertical].

Fields of SolverSGridConfig
planar in TOML: [modflownwt.sgrid.planar]

PlanarGridConfig factory user source

Planar discretization of the solver grid.

Fields of PlanarGridConfig
mode

str default = “keep_native” user source

Planar solver-grid mode: keep the native domain support or resample to an explicit (ny, nx) target shape.

"keep_native"

Keeps the top raster’s native shape and resolution, no resampling.

"resample_to_shape"

Resamples top and bottom onto an explicit (ny, nx) grid, keeping the same extent.

nx

Optional[int] default = None user source

Target number of columns when planar mode is ‘resample_to_shape’.

ny

Optional[int] default = None user source

Target number of rows when planar mode is ‘resample_to_shape’.

resampling

str default = “bilinear” dev source

Resampling rule applied when planar mode is ‘resample_to_shape’.

One of: "bilinear" "average" "nearest"

vertical in TOML: [modflownwt.sgrid.vertical]

VerticalGridConfig factory user source

Vertical layering of the solver grid.

Fields of VerticalGridConfig
genmtd_lay

str default = “constant” user source

Vertical-layering strategy.

"constant"

Splits local thickness into nlay equal-fraction layers at every cell.

"decay"

Grows layer thickness geometrically with depth when lay_decay is above one.

"list"

Uses the explicit per-layer thickness fractions given in lay_proportions.

nlay

int | None default = 1 user source

Number of layers (required for constant/decay, ignored for list).

lay_decay

float | None default = None dev source

Decay exponent (>1) for decay layering.

lay_proportions

list[float] | None default = None dev source

Explicit layer fractions when genmtd_lay=’list’ (must sum to 1).

nodata

float default = -9999.0 dev source

No-data sentinel value.

grid_dual

str default = “voronoi” user source

Applies only to a MODFLOW 6 run on a runtime gmsh mesh; ignored for structured grids, MODFLOW-NWT and Boussinesq (which keeps its own triangulation). ‘voronoi’ uses the PEBI dual (exact CVFD orthogonality, ~half the cells) and is the default; ‘triangle’ keeps the triangulation cells as the DISV grid for simplex comparison runs.

One of: "voronoi" "triangle"

condition_top

bool default = False user source

MODFLOW 6 runtime-mesh only. Hydro-condition the DISV mesh top so it holds no closed depression. Sampling the DEM at irregular Voronoi cell centroids reintroduces local minima (pits) the raster fill removed. When true, a priority-flood epsilon fill on the mesh face graph raises only pit cells to their spill level, giving every active non-lake cell a strictly descending path to the domain boundary. Lake and boundary cells are fixed base levels; the aquifer bottom is untouched. Default false keeps the raw projected top.

condition_top_epsilon

float default = 0.001 user source

Minimal downhill increment (m) added along each filled path so conditioned cells strictly descend instead of forming flats. Only used when condition_top is true.

top_sampling in TOML: [modflownwt.sgrid.top_sampling]

TopSamplingConfig factory user source

How the runtime-mesh top is sampled from the DEM before conditioning.

Fields of TopSamplingConfig
mode

str default = “centroid” user source

Top-sampling strategy. ‘centroid’ samples the DEM at each cell generator (fast, the current behaviour, byte-identical default). ‘zonal’ reduces every DEM pixel inside a cell with per-class stats.

One of: "centroid" "zonal"

hillslope_stat

str default = “median” user source

Zonal statistic over non-channel (hillslope) pixels inside a cell.

"mean"

Averages every hillslope pixel in the cell to set its top elevation.

"median"

Uses the median hillslope pixel elevation, robust to outlier pixels.

"min"

Uses the lowest hillslope pixel elevation found inside the cell.

"max"

Uses the highest hillslope pixel elevation found inside the cell.

"p10"

Uses the 10th percentile of hillslope pixel elevations inside the cell.

"p25"

Uses the 25th percentile of hillslope pixel elevations inside the cell.

channel_stat

str default = “min” user source

Zonal statistic over channel pixels inside a cell (thalweg-preserving; ‘min’ keeps the incised low).

"min"

Uses the lowest channel pixel elevation, keeping the incised thalweg low.

"p10"

Uses the 10th percentile of channel pixel elevations, near the thalweg low.

"p25"

Uses the 25th percentile of channel pixel elevations, above the thalweg low.

"median"

Uses the median channel pixel elevation, less aggressive than the thalweg low.

"mean"

Averages channel pixel elevations, smoothing over the incised thalweg.

channel_source

str default = “streams_raster” user source

Where channel pixels come from when mode=’zonal’. ‘streams_raster’ uses the delineated river-network raster reprojected onto the DEM grid; ‘none’ disables the channel class (every pixel is hillslope).

One of: "none" "streams_raster"

channel_buffer_px

int default = 0 dev source

Dilate the channel pixel mask by this many pixels before reducing, to capture a channel that grazes a cell without a pixel centre on it.

spike_guard_tol_m

float default = 2.0 dev source

Revert a hillslope cell’s zonal value to the centroid sample when it deviates more than this many metres (guards nodata/edge spikes); channel cells are exempt since they are lowered on purpose. 0 disables the guard.

min_pixels

int default = 3 dev source

Minimum DEM pixels inside a cell to trust a hillslope zonal statistic; below this the cell falls back to the centroid sample. A channel cell uses its channel stat from a single thalweg pixel.

min_thickness_m

float default = 0.1 dev source

Minimum layer-0 thickness (m) kept after zonal top lowering, so a carved channel top never collides with the aquifer bottom.

network_safety_net

bool default = False user source

Before the priority-flood fill, carve the channel cells into a monotone descending thalweg (lower-only) and pin them so the fill never raises them. Fixes the fill re-raising a zonal-lowered channel; needs a channel source (mode=’zonal’ with channel_source!=’none’). Off by default.

max_channel_lowering_m

float default = 5.0 dev source

Cap (m) on how far the network safety net may carve a single channel cell below its sampled top.

tgrid in TOML: [modflownwt.tgrid]

TMeshConfig | None default = None user source

Optional temporal discretization payload as one validated TMeshConfig model. In launcher mode, stress periods are driven by [simulation.time]; steady/transient policy is driven by [flow].flow_regime and [flow].first_period_steady.

Fields of TMeshConfig
itmuni

str default = “d” dev source

Time unit used to interpret lenper values. In launcher mode stress periods come from [simulation.time], so this field is mirrored only for compatibility.

genmtd

str default = “synthetic_regular” user source

Temporal generation method. In launcher mode stress periods come from [simulation.time], so this field is mirrored only for compatibility.

"synthetic_regular"

Builds nper stress periods from lenper and itmuni, ignoring any chronicle file.

"from_chron"

Derives stress-period lengths from consecutive timestamps in the chronicle file at chron_path.

nper

int default = 1 user source

Stress-period count. In launcher mode this is mirrored from [simulation.time] and is not the authoritative source.

lenper

float | int | list[int] | list[float] | None default = 1 user source

Stress-period length(s) interpreted with itmuni. Scalar means one regular step length repeated nper times; list means one explicit value per stress period. In launcher mode this is mirrored from [simulation.time] and is not the authoritative source.

chron_path

str | None default = None user source

Chronicle file path used when genmtd=’from_chron’. In launcher mode this field is generally not used.

chron_dateformat

str default = “%Y-%m-%d %H:%M:%S” dev source

Date format string used to parse the chronicle file.

chron_colsep

str default = “ “ dev source

Column separator used in the chronicle file.

chron_time_col

str default = “Date” dev source

Name of the time/date column in the chronicle file.

start_datetime

Any | None default = None user source

Lower datetime bound used by the temporal mesh. In launcher mode this field is mirrored from [simulation.time] and is not the authoritative source.

end_datetime

Any | None default = None user source

Upper datetime bound used by the temporal mesh. In launcher mode this field is mirrored from [simulation.time] and is not the authoritative source.

tsmult

int | float | list[int] | list[float] default = 1 dev source

Time-step multiplier per stress period (scalar or list). In launcher mode this field is currently forced to 1.0 and generally not intended for manual editing.

ntsp

int | list[int] default = 1 dev source

Number of time steps per stress period (scalar or list). In launcher mode this field is currently forced to 1 and generally not intended for manual editing.

temporal_nodata

float default = -9999.0 dev source

No-data sentinel value for temporal data.

Starter TOML snippet#

Click to expand a copy-pasteable [modflownwt] TOML skeleton

Copy this block into your project.toml and uncomment the lines you want to set. Sub-tables ([parent.subfield]) appear in the order Pydantic expects them.

[modflownwt]

[modflownwt.sgrid]
# planar = ...  # factory default
# vertical = ...  # factory default
# grid_dual = "voronoi"
# condition_top = false
# condition_top_epsilon = 0.001
# top_sampling = ...  # factory default

[modflownwt.tgrid]
# genmtd = "synthetic_regular"
# nper = 1
# lenper = 1
# chron_path = ...  # default = None
# start_datetime = ...  # default = None
# end_datetime = ...  # default = None

Cases using this section#

Validation gallery cases that reference fields from this section:

Entity-relationship diagram#

ER diagram for ModflowConfig

Click to zoom and pan. Press Esc or click outside to close.