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.
|
Hallberg-NOAA
left a comment
There was a problem hiding this comment.
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
saveattributes and appliesexplicit initialization when required.