Skip to content

Commit 1dbcdd6

Browse files
committed
fix(codegen): exclude CASE_OPT_PARAMS from sim generated_decls.fpp
generate_decls_fpp was emitting unconditional declarations for all sim-target variables including CASE_OPT_PARAMS (recon_type, weno_order, nb, mapped_weno, viscous, etc.). m_global_parameters.fpp for simulation contains a manual #:if MFC_CASE_OPTIMIZATION / #:else block that declares these same variables — as compile-time constants in case-opt builds and as regular variables otherwise. The generated include + the manual block created duplicate declarations, which is a Fortran compile error for every ./mfc.sh build --case-optimization invocation. Fix: skip CASE_OPT_PARAMS when generating declarations for the sim target. The manual block handles both the parameter and variable cases.
1 parent 56c04f3 commit 1dbcdd6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

toolchain/mfc/params/generators/fortran_gen.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ def generate_decls_fpp(target: str) -> str:
100100
for name in _vars_for_target(target):
101101
if not _is_simple_scalar(name):
102102
continue
103+
# Skip sim case-opt params: declared as compile-time parameters by the
104+
# manual #:if MFC_CASE_OPTIMIZATION / #:else block in m_global_parameters.fpp
105+
if target == "sim" and name in CASE_OPT_PARAMS:
106+
continue
103107
param = REGISTRY.all_params.get(name)
104108
if param is None:
105109
continue

0 commit comments

Comments
 (0)