Skip to content

feat(dfns): support fill-forward blocks - #367

Merged
wpbonelli merged 4 commits into
MODFLOW-ORG:developfrom
wpbonelli:block-header-fill-forward
Sep 22, 2026
Merged

wpbonelli merged 4 commits into
MODFLOW-ORG:developfrom
wpbonelli:block-header-fill-forward

Conversation

@wpbonelli

Copy link
Copy Markdown
Member

Capture the "fill forward" concept for integer-indexed repeating (e.g. period) blocks. Factor out a BlockHeader type with field and fill_forward attributes where Block.header was previously an InputField directly

Block.repeats (header is not None) says a block can repeat, but not what a
missing occurrence means. MF6 has two distinct answers: `period` blocks
fill forward (a missing period reuses the prior one's data), while other
repeating-header blocks (utl-tas's `time`, solutiongroup, continuous) don't.
Nothing in the schema captured this, forcing flopy4's ingress converter to
hardcode the distinction by block name instead of deriving it from the DFN.

Add `BlockHeader.fill_forward: bool`, nested under `Block.header` so it's
only representable when the block actually has a header. No v1 tag exists
for this, so it's hardcoded by block name in migrate_to_v2_0_0_dev2.py,
same discipline as Block.write_if_empty.
@wpbonelli wpbonelli added this to the 1.10.0 milestone Sep 22, 2026
@wpbonelli wpbonelli added the enhancement New feature or request label Sep 22, 2026
Fill-forward semantics require a sequential ordinal index; a Double or
Record header has no well-defined "prior occurrence" to reuse. Validated
at construction so the invariant can't drift silently.
period's iper and solutiongroup's group_num are both documented in MF6
source as monotonically increasing across occurrences regardless of
fill_forward -- only the meaning of a gap in that sequence varies.
@wpbonelli
wpbonelli marked this pull request as ready for review September 22, 2026 23:41
@wpbonelli
wpbonelli merged commit 7187e70 into MODFLOW-ORG:develop Sep 22, 2026
16 checks passed
@wpbonelli
wpbonelli deleted the block-header-fill-forward branch September 22, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant