Complete named-constant adoption and parameter declaration generation#1551
Complete named-constant adoption and parameter declaration generation#1551sbryngelson wants to merge 9 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1551 +/- ##
=======================================
Coverage 61.17% 61.17%
=======================================
Files 74 74
Lines 20313 20313
Branches 2961 2961
=======================================
Hits 12427 12427
Misses 5870 5870
Partials 2016 2016 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Sweeps bubble_model, avg_state, wave_speeds, recon_type, muscl_order, muscl_lim, int_comp, format, and precision (99 sites). Includes renaming legacy WENO_TYPE/MUSCL_TYPE comparisons to recon_type_weno/recon_type_muscl (same values) and two select-case labels in m_qbmm; WENO_TYPE/MUSCL_TYPE retirement is a follow-up.
183cab3 to
12dfa2a
Compare
Code reviewNo issues found in this PR's own commits. Checked for bugs and CLAUDE.md compliance across five independent passes (compliance, shallow bug scan, git-history conflicts with recent master merges, prior-PR feedback, and in-code guidance), with emitted-declaration equivalence verified per target. The codecov patch-coverage number reads low because the diff is dominated by generated Fortran declarations, which the golden regression suite (not unit tests) exercises; the toolchain Python in this PR is unit-covered. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Summary
Follow-up to #1550, completing two more pieces of the same strategy — one source of truth in the parameter registry, generated everywhere, no behavior change:
bubble_model,avg_state,wave_speeds,recon_type,muscl_order,muscl_lim,int_comp,format,precision) are swept across all three executables — 99 decision sites move from integer literals to the generated named constants. The legacyWENO_TYPE/MUSCL_TYPEconstants are retired in favor of the generatedrecon_type_weno/recon_type_muscl(same values, one naming scheme).TYPED_DECLStable indefinitions.pydrives generation of the 14 derived-type namelist declarations (fluid_pp,patch_icpp,acoustic, …) per target — including theirGPU_DECLARElines and Doxygen descriptions — and the simulation case-optimization#:if MFC_CASE_OPTIMIZATIONblock is emitted from a registry loop instead of being hand-maintained. The corresponding manual declarations in the threem_global_parameters.fppare deleted (net −40 LOC of hand-synced Fortran). Adding a parameter no longer requires touching Fortran declarations at all; adding a case-optimization parameter no longer requires editing a parallel#:elseblock.Two infrastructure hardenings that fell out of the work:
add_custom_commandnow owns regeneration:touch definitions.py && ninjadoes the right thing without reconfigure.lint_docs.pyvalidates backticked tokens incase.mdagainst the registry's value names and the analytic-expression intrinsics instead of a hand-grown skip list.Verification
.f90: every declaration and GPU-residency directive before the deletion is byte-identical (modulo relocation and comments) to the generated form after, per target and — for the case-optimization block — in bothMFC_CASE_OPTIMIZATIONconfigurations.What still requires manual edits (documented in
.claude/rules/common-pitfalls.md)Derived-type member definitions in
m_derived_types.fpp, default-value assignments, the six case.py-computed case-opt extras, multi-variable declaration lines (bc_x/y/z, domains), and the MPI broadcast lists — the broadcast lists are the next generation target.