Skip to content

ACG-fication of SetServices - #100

Open
pchakraborty wants to merge 2 commits into
developfrom
refactor/pchakrab/acgfication
Open

ACG-fication of SetServices#100
pchakraborty wants to merge 2 commits into
developfrom
refactor/pchakrab/acgfication

Conversation

@pchakraborty

@pchakraborty pchakraborty commented Aug 19, 2026

Copy link
Copy Markdown

Replace SetServices's hand-written MAPL_AddImportSpec/AddExportSpec/AddInternalSpec calls with a single Irrad_StateSpecs.rc file and three generated #include's (Irrad_Import___.h / Irrad_Export___.h / Irrad_Internal___.h), driven by mapl_acg() in CMakeLists.txt. This matches how the MAPL3 port already declares its state specs, so the two versions stay easier to diff and maintain side by side. SetServices drops from ~980 to ~310 lines.

Note

AERO (needs a state-item datatype the .rc schema can't express), the 3-D CO2 import (config-driven, needs a local variable in scope), and the RATS-diagnostics block (fully dynamic - names and count depend on a runtime config list) don't fit the static StateSpecs model and are left hand-written, same as the MAPL3 port does for the same reasons.

Note

Extracted the OLRB{bb}RG/TBRB{bb}RG band exports/internals out of a runtime do-loop (checking a band_output_supported(ibnd) array) into 8 static, conditional StateSpecs rows (COND = USE_RRTMG .or. USE_RRTMGP) instead of a straight syntax swap. Verified these are the exact same 8 bands the array marked true, so this is behavior-preserving. Removed the loop variables (ibnd, bb) and the _ASSERT(NB_RRTMG == nbndlw, ...) checks that only existed to support that loop, since they're now dead code.

Note

CMakeLists.txt's mapl_acg() call also generates Irrad_GetPointer___.h and Irrad_DeclarePointer___.h, though SetServices doesn't #include them yet - harmless to generate now, ready for a later round that converts Run's/LW_Driver's manual MAPL_GetPointer calls.

Purely mechanical follow-up to the earlier formatting pass, no functional
changes. Replaces SetServices's hand-written MAPL_AddImportSpec/
AddExportSpec/AddInternalSpec calls with a single Irrad_StateSpecs.rc file
and three generated #include's (Irrad_Import___.h / Irrad_Export___.h /
Irrad_Internal___.h), driven by mapl_acg() in CMakeLists.txt. This matches
how the MAPL3 port already declares its state specs, so the two versions
stay easier to diff and maintain side by side. SetServices drops from ~980
to ~310 lines.

- AERO (needs a state-item datatype the .rc schema can't express), the 3-D
  CO2 import (config-driven, needs a local variable in scope), and the
  RATS-diagnostics block (fully dynamic - names and count depend on a
  runtime config list) don't fit the static .rc model and are left
  hand-written, same as the MAPL3 port does for the same reasons.

- Extracted the OLRB{bb}RG/TBRB{bb}RG band exports/internals out of a
  runtime do-loop (checking a band_output_supported(ibnd) array) into 8
  static, conditional .rc rows (COND = USE_RRTMG .or. USE_RRTMGP) instead
  of a straight syntax swap. Verified these are the exact same 8 bands the
  array marked true, so this is behavior-preserving. Removed the loop
  variables (ibnd, bb) and the _ASSERT(NB_RRTMG == nbndlw, ...) checks that
  only existed to support that loop, since they're now dead code.

- CMakeLists.txt's mapl_acg() call also generates Irrad_GetPointer___.h and
  Irrad_DeclarePointer___.h, though SetServices doesn't #include them yet -
  harmless to generate now, ready for a later round that converts Run's/
  LW_Driver's manual MAPL_GetPointer calls.
@pchakraborty
pchakraborty requested review from a team as code owners August 19, 2026 00:40
@pchakraborty pchakraborty added 0 diff The changes in this pull request have verified to be zero-diff with the target branch. Contingent - DNA Do Not Approve (DNA). These changes are contingent on other PRs acg-migration Migrate component from manual MAPL_Add*Spec calls to mapl_acg labels Aug 19, 2026
@github-actions

Copy link
Copy Markdown

Label error. Requires exactly 0 of: Contingent - DNA, Needs Lead Approval, Contingent -- Do Not Approve. Found: 0 diff, Contingent - DNA, acg-migration

3 similar comments
@github-actions

Copy link
Copy Markdown

Label error. Requires exactly 0 of: Contingent - DNA, Needs Lead Approval, Contingent -- Do Not Approve. Found: 0 diff, Contingent - DNA, acg-migration

@github-actions

Copy link
Copy Markdown

Label error. Requires exactly 0 of: Contingent - DNA, Needs Lead Approval, Contingent -- Do Not Approve. Found: 0 diff, Contingent - DNA, acg-migration

@github-actions

Copy link
Copy Markdown

Label error. Requires exactly 0 of: Contingent - DNA, Needs Lead Approval, Contingent -- Do Not Approve. Found: 0 diff, Contingent - DNA, acg-migration

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Label error. Requires exactly 0 of: Contingent - DNA, Needs Lead Approval, Contingent -- Do Not Approve. Found: 0 diff, Contingent - DNA, acg-migration

@pchakraborty pchakraborty removed the Contingent - DNA Do Not Approve (DNA). These changes are contingent on other PRs label Sep 3, 2026
@pchakraborty pchakraborty self-assigned this Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0 diff The changes in this pull request have verified to be zero-diff with the target branch. acg-migration Migrate component from manual MAPL_Add*Spec calls to mapl_acg

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant