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

(*) N2_floor init fix when FGNV streamfn disabled #1505

Merged
merged 2 commits into from
Oct 2, 2021

Conversation

marshallward
Copy link
Collaborator

The N2_floor buoyancy frequency was left unset when
KHTH_USE_FGNV_STREAMFUNCTION was disabled. This could potentially
cause errors, such as floating point exceptions.

Ideally we would restrict the calculations of hN2_[uv] to when the
streamfunction is enabled. But due to propagation to these values to
hN2_[xy]_PE fields, which may be used outside of the streamfunction,
it is perhaps best to just initialize N2_floor to zero.

Although this would mostly likely be initialized to zero in production,
there is a chance that this could modify answers derived from random
initialization.

Thanks to @wfcooke for reporting this. It was also independently (and
inexplicably) detected during removal of MEKE pointers, suggesting some
memory volatility.

The `N2_floor` buoyancy frequency was left unset when
`KHTH_USE_FGNV_STREAMFUNCTION` was disabled.  This could potentially
cause errors, such as floating point exceptions.

Ideally we would restrict the calculations of `hN2_[uv]` to when the
streamfunction is enabled.  But due to propagation to these values to
`hN2_[xy]_PE` fields, which may be used outside of the streamfunction,
it is perhaps best to just initialize `N2_floor` to zero.

Although this would mostly likely be initialized to zero in production,
there is a chance that this could modify answers derived from random
initialization.

Thanks to @wfcooke for reporting this.  It was also independently (and
inexplicably) detected during removal of MEKE pointers, suggesting some
memory volatility.
@codecov
Copy link

codecov bot commented Oct 1, 2021

Codecov Report

Merging #1505 (456de80) into dev/gfdl (503df0e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           dev/gfdl    #1505   +/-   ##
=========================================
  Coverage     29.06%   29.06%           
=========================================
  Files           237      237           
  Lines         71642    71643    +1     
=========================================
+ Hits          20822    20823    +1     
  Misses        50820    50820           
Impacted Files Coverage Δ
...arameterizations/lateral/MOM_thickness_diffuse.F90 31.56% <100.00%> (+0.07%) ⬆️

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 503df0e...456de80. Read the comment docs.

Copy link
Collaborator

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although this could potentially change answers in some (hopefully unused) cases, I agree that initializing this array to 0 is unambiguously the right thing to do, rather than leaving it uninitialized. I approve this PR. It should be merged in as soon as it has been involved in a successful pipeline test (the TC testing having already passed).

@marshallward
Copy link
Collaborator Author

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

@marshallward marshallward merged commit 4d3d10e into mom-ocean:dev/gfdl Oct 2, 2021
@marshallward marshallward deleted the use_fgnv_flag_fix branch October 20, 2021 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants