Skip to content

feat: tolerate unknown options#2809

Open
wpbonelli wants to merge 4 commits into
MODFLOW-ORG:developfrom
wpbonelli:tolerate-unknown-options
Open

feat: tolerate unknown options#2809
wpbonelli wants to merge 4 commits into
MODFLOW-ORG:developfrom
wpbonelli:tolerate-unknown-options

Conversation

@wpbonelli

@wpbonelli wpbonelli commented May 21, 2026

Copy link
Copy Markdown
Member

Add a keyword option STRICT to the simulation, defaulting true for consistency with previous behavior. In strict mode, unrecognized variables will stop the simulation with an error, otherwise the simulation will continue with a warning.

Alternative and/or complimentary solution to modflowpy/flopy#2712.


Checklist of items for pull request

  • Replaced section above with description of pull request
  • Added new test or modified an existing test
  • Ran ruff on new and modified python scripts in .doc, autotests, doc, distribution, pymake, and utils subdirectories.
  • Formatted new and modified Fortran source files with fprettify
  • Added doxygen comments to new and modified procedures
  • Updated definition files
  • Updated develop.toml with a plain-language description of the bug fix, change, feature; required for changes that may affect users
  • Updated input and output guide
  • Removed checklist items not relevant to this pull request

@wpbonelli wpbonelli added this to the 6.8.0 milestone May 21, 2026
@wpbonelli wpbonelli added enhancement option MF6 IO related labels May 21, 2026
@wpbonelli wpbonelli requested a review from mjreno May 21, 2026 13:14
@wpbonelli wpbonelli added the question Needs someone's attention label May 25, 2026
this%mf6_input%subcomponent_type, &
this%mf6_input%block_dfns(iblk)%blockname, &
tag, this%filename)
if (itolerate_unknown == 1) then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't specific to the OPTIONS block you would also need to check the block here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this should apply only to options or to any variable. new options are added much more often than new data variables so would probably cover most cases, but seems more consistent to apply to all variables. any thoughts?

@wpbonelli

wpbonelli commented Jun 17, 2026

Copy link
Copy Markdown
Member Author

I'm undecided whether strict should be opt-in or on by default. Opt-in seems like nicer UX for anything driving multiple versions of MF6, like GUIs and flopy, with some added risk of not noticing if options go unused, because the simulation ran and the warning is buried/offscreen.

@wpbonelli wpbonelli force-pushed the tolerate-unknown-options branch from 34bbbd0 to 3b52000 Compare June 18, 2026 01:44
@wpbonelli wpbonelli marked this pull request as ready for review June 18, 2026 11:19
@wpbonelli wpbonelli modified the milestones: 6.8.0, 6.9.0 Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement option MF6 IO related question Needs someone's attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants