Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capgen in SCM: Fix to allow for scheme subcycling. #633

Merged
merged 17 commits into from
Feb 25, 2025

Conversation

dustinswales
Copy link
Collaborator

@dustinswales dustinswales commented Jan 29, 2025

Overview
This PR contains changes to fix scheme subcycling in Capgen and extends the var_compatability_test to exercise subcycling.
UPDATE: Added bugfix for suite-part list ordering (see change to ccpp_suite.py).

Description
Create local group variable for subcycle indexing.
Fix bug (self.loop -> self._loop) in the Subcycle write phase, and in ccpp_datafile.

User interface changes?: No

Fixes: #632
Fixes: #634

Testing:
Added to var_compatibility_test to exercise feature.

@dustinswales dustinswales changed the title Fix to allow for scheme subcycling. Capgen in SCM: Fix to allow for scheme subcycling. Jan 29, 2025
@dustinswales dustinswales marked this pull request as draft February 6, 2025 16:55
@dustinswales dustinswales changed the base branch from main to develop February 11, 2025 04:05
@dustinswales dustinswales marked this pull request as ready for review February 12, 2025 17:58
@gold2718
Copy link
Collaborator

This PR only seems to allow literal integers as a loop index, is that right? I tried adding a fix to allow entering a standard name instead (an NCAR requirement since these loop indices are run-time variables) but ran into:

Invalid local_name: scalar_var already registered, in /home/goldy/Projects/CAMDEN/ccpp_framework/test/var_compatibility_test/var_compatibility_suite.xml

which I thought was fixed in #631. This only happens if I use a standard name in the SDF. This is weird because the standard name has nothing to do with scalar_var. Any ideas?

A standard name can be used instead of a literal integer
Modified the var_compatibility test to test both a
literal integer subcycle and a loop variable subcycle.
@gold2718
Copy link
Collaborator

@dustinswales, I think I found the issues. I have submitted a PR to this PR branch with the fixes. The var_compatibility test now includes both a standard_name (variable) subcycle and a literal integer subcycle. As a bonus, they are nested!

Permit variables as loop variables
@dustinswales
Copy link
Collaborator Author

@gold2718 Thanks for adding this functionality! We have this hardcoded at the moment on the UFS side, but I could see us adopting this for suite extensibility.

Copy link
Collaborator

@gold2718 gold2718 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@dustinswales
Copy link
Collaborator Author

@peverwhee @climbfuji Can you review this one when you get a chance?

@dustinswales dustinswales merged commit dcb5ed5 into NCAR:develop Feb 25, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suite-part list is wrong Sub-cycling not working properly
4 participants