Skip to content

Commit 83f4818

Browse files
committed
fix: restore drift detection in _fc() — raise when src/ is present but key is missing
1 parent f9316a4 commit 83f4818

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

toolchain/mfc/params/definitions.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@
2020

2121
def _fc(name: str, default: int) -> int:
2222
"""Get a Fortran constant, using the inline default when m_constants.fpp is unavailable."""
23-
return _FC.get(name, default)
23+
if _FC:
24+
if name not in _FC:
25+
raise RuntimeError(
26+
f"Fortran constant '{name}' not found in m_constants.fpp. "
27+
f"Toolchain is out of sync with Fortran source."
28+
)
29+
return _FC[name]
30+
return default
2431

2532

2633
NF = _fc("num_fluids_max", 10) # fluid_pp

0 commit comments

Comments
 (0)