-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add initialization tests using CS%initialized #6
Add initialization tests using CS%initialized #6
Conversation
Added a new variable, initialized, to the control structures of modules that had been testing for an allocated control structure to verify that it had been initialized before it was going to be used, and then duplicated the tests using this new variable. This was done to enable us to go ahead with MOM6 PR #5, which eliminated many of these checks when converting the control structures from pointers in the parent modules to elements that are always there, and then passing them as simple types instead of as pointers. If we decide that we do not need these tests after all, we can easily delete them, but until this is discussed, this commit avoids losing the messages, as it was easier to do it this way instead of trying to recreate them after they had been removed. All answers and output are bitwise identical.
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #6 +/- ##
============================================
+ Coverage 29.16% 29.18% +0.02%
============================================
Files 239 239
Lines 71108 71280 +172
============================================
+ Hits 20736 20805 +69
- Misses 50372 50475 +103
Continue to review full report at Codecov.
|
Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/14199 ✔️ |
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.
This contribution should allow for the safe removal of even more pointers.
If we move to a more constructor-based approach to instantiating and accessing the control structures, then we may be able to phase these out later.
There are rebase conflicts in this PR, so hopefully the merged version will be fine. |
Added a new variable, initialized, to the control structures of modules that
had been testing for an allocated control structure to verify that it had been
initialized before it was going to be used, and then duplicated the tests using
this new variable. This was done to enable us to go ahead with MOM6 PR #5,
which eliminated many of these checks when converting the control structures
from pointers in the parent modules to elements that are always there, and then
passing them as simple types instead of as pointers. If we decide that we do
not need these tests after all, we can easily delete them, but until this is
discussed, this commit avoids losing the messages, as it was easier to do it
this way instead of trying to recreate them after they had been removed. All
answers and output are bitwise identical.