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

Add initialization tests using CS%initialized #6

Merged
merged 2 commits into from
Nov 25, 2021

Conversation

Hallberg-NOAA
Copy link
Member

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.

  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
Copy link

codecov bot commented Nov 22, 2021

Codecov Report

Merging #6 (4e6e73f) into dev/gfdl (b2f6678) will increase coverage by 0.02%.
The diff coverage is 39.88%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ
src/core/MOM_PressureForce_Montgomery.F90 6.51% <0.00%> (-0.09%) ⬇️
src/diagnostics/MOM_wave_structure.F90 0.00% <0.00%> (ø)
...rameterizations/vertical/MOM_diapyc_energy_req.F90 0.00% <0.00%> (ø)
...meterizations/vertical/MOM_internal_tide_input.F90 0.00% <0.00%> (ø)
src/user/user_change_diffusivity.F90 0.00% <0.00%> (ø)
src/framework/MOM_restart.F90 25.94% <22.80%> (-0.26%) ⬇️
src/diagnostics/MOM_wave_speed.F90 23.97% <33.33%> (+0.09%) ⬆️
src/core/MOM_PressureForce_FV.F90 33.12% <40.00%> (+0.11%) ⬆️
src/parameterizations/vertical/MOM_geothermal.F90 21.81% <40.00%> (+0.38%) ⬆️
...rameterizations/vertical/MOM_regularize_layers.F90 6.45% <40.00%> (+0.43%) ⬆️
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b2f6678...4e6e73f. Read the comment docs.

@marshallward
Copy link
Member

Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/14199 ✔️

Copy link
Member

@marshallward marshallward left a 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.

@marshallward
Copy link
Member

There are rebase conflicts in this PR, so hopefully the merged version will be fine.

@marshallward marshallward merged commit 6608730 into NOAA-GFDL:dev/gfdl Nov 25, 2021
@Hallberg-NOAA Hallberg-NOAA added the refactor Code cleanup with no changes in functionality or results label Feb 1, 2022
@Hallberg-NOAA Hallberg-NOAA deleted the initialized_tests branch February 20, 2022 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code cleanup with no changes in functionality or results
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants