Handling for module-level dimension variables for interstitial variables#683
Conversation
climbfuji
left a comment
There was a problem hiding this comment.
Looks reasonable to me. And I agree that if the dimension isn't set, we'll get a runtime error. Do you think the auto-generated code that is added with --debug will catch it in the caps?
| adjust_intent=False): | ||
| def add_variable_dimensions(self, var, ignore_sources, suite_type, | ||
| to_dict=None, adjust_intent=False): | ||
| """Attempt to find a source for each dimension in <var> and add that |
There was a problem hiding this comment.
Can you update the docstring please?
|
@climbfuji good question! I tested this by moving the setting of the dim_inter variable in the capgen test to the |
Great, thanks for testing! |
|
@mkavulich I believe this can be merged? unless I missed a discussion about this at the last framework meeting |
Updates to allow for dimension variables that are set in the register phase to be used to allocate interstitial variables.
Open to feedback, of course! There's no explicit handling right now to ensure that the variable is set in the register phase, but my feeling is that you'll get a run-time error if you try to use an uninitialized variable in an
allocatestatement.User interface changes?: No
Fixes:
closes #681
Testing: Added variables/logic in capgen test to confirm the dimensions are initialized and used properly