-
Notifications
You must be signed in to change notification settings - Fork 128
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
Fix perfmetrics v2.8.0 #3098
Fix perfmetrics v2.8.0 #3098
Conversation
great detective work @axel-lauer 🔍 Could this perhaps be a exposing a bug in the latest build of NCL? 6.6.2 it's ben since ages, since no development being done on it, but the latest build is about two weeks old, it may be that that's the culprit? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @axel-lauer !
Worked fine for me as well. But I think it would be enough to define ii
as local variable in interface_scripts/auxiliary.ncl
.
A reason for this problem could be that there is ii
used in diag_scripts/perfmetrics/main.ncl
since my PR #2856 and therefore it is defined as a global variable for all appending funtions. And this is the reason why it is now passed from interface_scripts/auxiliary.ncl
to the perfmetrics diagnostics "zonal", "latlot" and "cycle". Just an idea...
Thanks @LisaBock for testing. It sounds quite possible, that the changes to main.ncl from #2856 could be the reason for this problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your work on this @axel-lauer! This fix enabled me to run the 4 affected recipes successfully (recipe_perfmetrics_CMIP5_*
and recipe_smip_*
) 👍
This is most probably related to a previous PR that has introduced a conflict in the diagnostics, not something related to the NCL package itself. quite a few NCL diagnostics have been added or changed since the last release. Good to see these all run fine with this fix.
fantastic work, guys and gals! Am merging this now 🍺 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boom!
This PR fixes a newly surfaced issue with the perfmetrics diagnostics "zonal", "latlot" and "cycle" that resulted in the diagnostics getting stuck in an infinite loop (see also #3076).
As it turned out, the problem was local variables used in functions defined in
interface_scipts/auxiliary.ncl
that had the same variable name as a loop variable in the perfmetrics diagnostics mentioned above. For reasons that are still not clear to me, a call to the functionncdf_write
(which then callsncdf_define)
resulted in the variable used as loop index (ii
) being overwritten in the calling procedure. As a consequence, the calling diagnostic got stuck in an infinite loop.Declaring the variables used within the shared functions (
interface_scipts/auxiliary.ncl
) as "local" solved this problem.I still do not fully understand why variables used in a function would overwrite the variables with the same name in the calling procedure when not explicitly declared as "local" variables and why this problem did not emerge earlier, but this problem is fixed with this PR. With the fix, I could (again) successfully run recipe_perfmetrics_CMIP5.yml, the output looks as expected.
Checklist
It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.
- [ ] 🛠 Any changed dependencies have been added or removed correctlyNew or updated recipe/diagnostic
- [ ] 🧪 Recipe is well documented