Diag buffer: Set fill_value_3d ks/ke size#1111
Merged
Hallberg-NOAA merged 2 commits intoMay 11, 2026
Merged
Conversation
Member
Author
|
@ashao Does this look right |
There was a problem hiding this comment.
Pull request overview
Reminder: MOM6 has a policy on AI-assisted contributions in Consortium-policy-on-AI.md.
This PR fixes the 3D diagnostic buffer unit test fill_value_3d by ensuring the buffer’s vertical extents are explicitly set before growing/allocating, preventing incorrect allocation sizes and potential memory/segfault failures.
Changes:
- Add
ks/keparameters tofill_value_3dand callbuffer%set_vertical_extent(ks=..., ke=...). - Align the test’s vertical extent with the existing 10-level convention used by other 3D buffer unit tests.
The `fill_value_3d` unit test of `diag_buffer_unit_tests_3d` was not setting its vertical extent, causing inaccurate allocation sizes and potential segmentation faults. (Or, in my case, complete memory consumption and OS meltdowns.) This patch adds `set_vertical_extent` and uses the same 10-element width. This appears to fix the issue for me.
Some unused variables and incorrect comments have been removed from the unit testing. Assisted-by: copilot
2675351 to
e066438
Compare
Hallberg-NOAA
approved these changes
May 11, 2026
Member
Hallberg-NOAA
left a comment
There was a problem hiding this comment.
I have examined these changes and they look correct to me.
Member
|
This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/30833. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
fill_value_3dunit test ofdiag_buffer_unit_tests_3dwas not setting its vertical extent, causing inaccurate allocation sizes and potential segmentation faults. (Or, in my case, complete memory consumption and OS meltdowns.)This patch adds
set_vertical_extentand uses the same 10-element width. This appears to fix the issue for me.