+(*)Correct OBC indexing bugs and errors with OBC grid rotation#905
Merged
Conversation
|
I approve of this PR. However, I was surprised that it changed some dumbbell answers even though that doesn't use brushcutter mode. |
Member
Author
|
The changes to the dumbbell answers when |
adcroft
approved these changes
May 30, 2025
Revised the MOM_open_boundary module to better handle grid rotation for an arbitrary number of turns. Rotate_OBC_config now properly handles the setting and in some cases swapping of global information between the rotated and unrotated ocean_OBC_types, while rotate_OBC_segment_config and rotate_OBC_segment_data were modified to do the same for OBC_segment_type settings and data fields. These changes also include corrections to the code that rotates the input buffer and corrects the sign of vector components in update_OBC_segment_data when there is grid rotation. It also adds a missing scalar_pair argument to the restart registration call for the normal radiation arrays. Several comments were also corrected or expanded for greater clarity, and some instances of non-standard use of white space were corrected. All answers in non-rotated cases are bitwise identical, and some rotated cases that previously gave segmentation faults are new running, although rotation does not yet work properly for all cases with open boundary conditions.
Added the new runtime parameter OBC_HOR_INDEXING_BUG that can be set to true to retain previous answers or false to correct 5 horizontal indexing bugs that prevent solutions with open boundary conditions from satisfying rotational symmetry. Four of these bugs are related to the use of the brushcutter mode to set various terms in the open boundary conditions, while the fifth corrects the total ocean depth used to adjust the thicknessses used to remap tangential flow fields that are discretized at vorticity points. By default, all answers are bitwise identical, but there is a new runtime parameter in some MOM_parameter_doc files.
0748ceb to
51795a3
Compare
Member
Author
|
This PR passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/27618 with the expected warnings about new runtime parameters. |
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.
This PR consists of two commits that implement the ability to rotate (single-processor) configurations that use open boundary conditions and obtain bitwise identical solutions. It adds a new runtime option (
OBC_HOR_INDEXING_BUG) to correct a group of 5 horizontal indexing bugs that will change answers with OBCs, even when the solution is not rotated. Several other bugs that led to segmentation faults when the grid index rotation is enabled with OBCs were also corrected by setting the requisite pointers and copying missing data between rotated and unrotated OBC types.The specific answer changing bugs that are corrected by setting
OBC_HOR_INDEXING_BUGto false are 4 instances where the wrong horizontal indices are used in the input buffer when reading in velocity-point data from a file in"brushcutter" mode, and the use of the wrong total thickness when remapping tangential velocity fields or their gradients.
By default, all non-rotated solutions are bitwise identical, but there is a new runtime parameter. The specific commits in this PR include: