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: Bug fix for scheme ordering in non-run phases #629

Merged

Conversation

dustinswales
Copy link
Collaborator

Description:
A python set is used to gather the schemes to call in the non CCPP run phases. However, python sets don't maintain the order, and hence the call order is wrong outside the run phase.

User interface changes?: No

Fixes: #628

Testing:
Expanded var_compatibility_test to have initialization phases and illustrate bug.
Not sure how to test that the order is unchanged?

@climbfuji
Copy link
Collaborator

Not sure how to test that the order is unchanged?

Write something into the initialization phase that makes them depend on each other? For example init call to scheme two depends on something being set in init call to scheme one, etc? If you were to add more than two schemes (e.g., five scheme inits), you increase the changes that they won't be in the correct order.

Copy link
Collaborator

@peverwhee peverwhee left a comment

Choose a reason for hiding this comment

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

wow I'm surprised we hadn't run into this issue before! thanks @dustinswales

Copy link
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this

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.

I see that you added a bunch of _init routines to a test suite and I was all set to complain but then you added the internal order check. I verified that this suite test fails if the mods in ccpp_suite.py are reverted.

I do have a variable name-change suggestion / request but it is not vital.

BTW, Why is there a branch bugfix/scheme_ordering_in_caps on the NCAR repo?

scripts/ccpp_suite.py Outdated Show resolved Hide resolved
@dustinswales
Copy link
Collaborator Author

@climbfuji @peverwhee Do we need another NOAA approval before merging?

@climbfuji
Copy link
Collaborator

@climbfuji @peverwhee Do we need another NOAA approval before merging?

I'd say go ahead

@climbfuji
Copy link
Collaborator

But your branch is behind develop, let's at least merge that in and rerun the tests

@dustinswales dustinswales merged commit d322103 into NCAR:develop Feb 3, 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.

Fix ordering of scheme calls outside of run phase
4 participants