-
Notifications
You must be signed in to change notification settings - Fork 230
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 register_diag_field axes_grp pointer init #1456
Conversation
Several axes_grp pointers in register_diag_field were null()-initialized at declaration, e.g. type(axes_grp), pointer :: axes => null() This implicitly declares the pointers with `save`, which preserves its value across calls. First call excepted, these axes will not be initialized to null(). In this instance, this was causing d2 axes to be created when they should not have existed. This patch eliminates the implicit `save` attributes and applies explicit initialization when required.
f3d309f
to
2995cff
Compare
This should fix #1455. |
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #1456 +/- ##
=========================================
Coverage 29.13% 29.13%
=========================================
Files 235 235
Lines 71025 71025
=========================================
Hits 20694 20694
Misses 50331 50331
Continue to review full report at Codecov.
|
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.
I understand and agree with these changes. Moreover, I have verified that the three pointers that are no longer being nullified when they are declared and are not being explicitly nullified in the code are being properly set before they have used.
This PR has passed the TC testing, and I will merge it in as soon as the pipeline tests have run successfully.
https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/jobs/67881 passed with doc string msgs |
Sorry, I updated main -> dev/gfdl before this managed to get in. Since the PR has already been approved and tested, I will do this merge and update the parameters. |
Several axes_grp pointers in register_diag_field were null()-initialized
at declaration, e.g.
This implicitly declares the pointers with
save
, which preserves itsvalue across calls. These axes will not be initialized to null()
(excepting the first call).
In this instance, this was causing d2 axes to be created when they
should not have existed.
This patch eliminates the implicit
save
attributes and appliesexplicit initialization when required.