Skip to content

patch_ib case validation accepts indices that overflow the namelist array (bound uses the wrong constant) #1563

Description

@sbryngelson

Symptom: a case setting patch_ib(k) for 54,000 < k <= 2,050,000 passes validation, then fails (or worse) at the Fortran namelist read — the array is dimensioned by the smaller constant.

Mechanism: toolchain/mfc/params/definitions.py:34 reads num_ib_patches_max (= 2,050,000, src/common/m_constants.fpp:30) as the patch_ib max index, while the namelist array is dimensioned num_ib_patches_max_namelist (= 54,000, m_constants.fpp:32).

Introduced: #1524 (16fed9bde, 2026-06-03, @danieljvickers) flipped the constant name from num_ib_patches_max_namelist to num_ib_patches_max; before that (#1378 onward) the toolchain pointed at the namelist constant correctly. Tagging @danieljvickers for context.

Fix: #1552 repoints the bound at num_ib_patches_max_namelist.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions