When allocating dyn_const_array pre-calculate size to avoid line length limits#724
Open
jimmielin wants to merge 1 commit intoNCAR:developfrom
Open
When allocating dyn_const_array pre-calculate size to avoid line length limits#724jimmielin wants to merge 1 commit intoNCAR:developfrom
jimmielin wants to merge 1 commit intoNCAR:developfrom
Conversation
climbfuji
approved these changes
Mar 13, 2026
Collaborator
climbfuji
left a comment
There was a problem hiding this comment.
This looks great to me, thanks for fixing the bug. I am ok with not creating a separate issue here, because it's all explained nicely in the PR description.
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.
[ 50 character, one line summary ]
Avoid syntax error in long dyn_const_array alloc.
[ Description of the changes in this commit. It should be enough
information for someone not following this development to understand.
Lines should be wrapped at about 72 characters. ]
When multiple schemes return dynamic constituents, the host cap generator
builds the allocate statement as a single long expression like:
This got chopped off mid-identifier, producing a syntax error.
Fix: compute the total size incrementally into
num_dyn_constsbefore the allocate, so no single line is long enough (hopefully!)
to trigger continuation:
I reset
num_dyn_conststo 0 afterward for the packing loop so there is no logicchange downstream.
User interface changes?: No
Fixes: TBA
Testing:
test removed:
unit tests:
system tests:
manual testing: tested to work in CAM-SIMA where it previously was not