[feature/capgen-v1] Bug fix in group_cap.py: use full access path for variables that are not control - #790
Open
climbfuji wants to merge 1 commit into
Open
[feature/capgen-v1] Bug fix in group_cap.py: use full access path for variables that are not control#790climbfuji wants to merge 1 commit into
climbfuji wants to merge 1 commit into
Conversation
…n-control variables in variable declarations so that DDT-components are found correctly
dustinswales
approved these changes
Sep 28, 2026
dustinswales
left a comment
Collaborator
There was a problem hiding this comment.
@climbfuji LGTM. Thank you for fixing this.
"access_path"!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Reported by @dustinswales via email: with a unit transform active, the generated group cap declares the transformation temporary with a bare dimension name instead of the host's full access path.
Everything else about the transform — the pre- and post-scheme assignments and the pointer wiring — was correct.
Cause.
_dim_decl_local(capgen/generator/group_cap.py) resolved each dimension standard name toentry.local_name. For a DDT-held dimension that is the leaf (levs); the full path isentry.access_path(GFS_Control%levs). The rule is already documented insuite_resolver.py:523, using this exact example — this was one site not following it. Fixed by routing through_render_value_expr.Why it surfaced now. The declaration is only emitted when a transform is needed (
if arg.temp_name,group_cap.py:983). UFS performed no variable transformations until now. Changingmp_tempo.metafrom microns to meters created the first transform on a DDT-dimensioned array.Scope. One site. The other
entry.local_nameuses in the emitters are control variables — cap dummy arguments, where the local name is correct. That includes thehorizontal_dimensionbranch of the same function.Test gap. TestDimDeclLocal covered vertical dimensions already, but every fixture used plain module-level host variables, where
local_nameandaccess_pathare the same string. Addedtest_ddt_component_dim_uses_full_access_path.Verified against the reported configuration: the emitted declaration is now
, dimension(lb:ub, GFS_Control%levs).Once this lands, @dustinswales' workaround scaling those fields at the end of
mp_tempo_runcan be removed.Closes #791
🤖 Generated with Claude Code
https://claude.ai/code/session_018LCwe5wtTR5m9qJtPRGMWe