You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every MFC v5.3.1 Homebrew install crashes immediately on startup with:
RuntimeError: Fortran constant 'num_ib_patches_max' not found in m_constants.fpp.
Toolchain is out of sync with Fortran source.
This breaks mfc case.py for all users who installed via brew install mflowcode/mfc/mfc.
Root cause
Homebrew does not install src/ (only toolchain/, bin/, and examples/), so get_fortran_constants() in namelist_parser.py cannot find src/common/m_constants.fpp and falls back to _FALLBACK_CONSTANTS.
PR #1348 (Ib collisions, @danieljvickers) correctly split patch_ib onto its own Fortran bound by adding:
But _FALLBACK_CONSTANTS in namelist_parser.py — the dict used when src/ is absent — was never updated to include "num_ib_patches_max". As a result, _fc() raised on every Homebrew startup.
The structural problem: _fc(name) and _FALLBACK_CONSTANTS were two separate places that had to stay in sync, with no enforcement.
Summary
Every MFC v5.3.1 Homebrew install crashes immediately on startup with:
This breaks
mfc case.pyfor all users who installed viabrew install mflowcode/mfc/mfc.Root cause
Homebrew does not install
src/(onlytoolchain/,bin/, andexamples/), soget_fortran_constants()innamelist_parser.pycannot findsrc/common/m_constants.fppand falls back to_FALLBACK_CONSTANTS.PR #1348 (Ib collisions, @danieljvickers) correctly split
patch_ibonto its own Fortran bound by adding:But
_FALLBACK_CONSTANTSinnamelist_parser.py— the dict used whensrc/is absent — was never updated to include"num_ib_patches_max". As a result,_fc()raised on every Homebrew startup.The structural problem:
_fc(name)and_FALLBACK_CONSTANTSwere two separate places that had to stay in sync, with no enforcement.Affected versions
NIBdid not yet exist)Fix
PR #1419 removes
_FALLBACK_CONSTANTSentirely and changes_fcto require an inline default:Going forward, any developer adding a new
_fc()call must supply the fallback value at the call site. It is a required argument.cc @danieljvickers