Skip to content

+(*)Correct OBC indexing bugs and errors with OBC grid rotation#905

Merged
Hallberg-NOAA merged 2 commits into
NOAA-GFDL:dev/gfdlfrom
Hallberg-NOAA:fix_OBC_bugs
May 30, 2025
Merged

+(*)Correct OBC indexing bugs and errors with OBC grid rotation#905
Hallberg-NOAA merged 2 commits into
NOAA-GFDL:dev/gfdlfrom
Hallberg-NOAA:fix_OBC_bugs

Conversation

@Hallberg-NOAA
Copy link
Copy Markdown
Member

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_BUG to 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:

  • 0748ceb2e +Add OBC_HOR_INDEXING_BUG to optionally fix 5 bugs
  • 5e0e6c7e4 (*)Arbitrary grid rotation with MOM_open_boundary

@Hallberg-NOAA Hallberg-NOAA added bug Something isn't working enhancement New feature or request answer-changing A change in results (actual or potential) Parameter change Input parameter changes (addition, removal, or description) labels May 22, 2025
@kshedstrom
Copy link
Copy Markdown

I approve of this PR. However, I was surprised that it changed some dumbbell answers even though that doesn't use brushcutter mode.

@Hallberg-NOAA
Copy link
Copy Markdown
Member Author

The changes to the dumbbell answers when OBC_HOR_INDEXING_BUG is set to false would be due to the use of the wrong total thickness when remapping the tangential velocity fields (which are discretized at the vertex points), which is also a part of this fix along with the "brushcutter" corrections.

  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.
@Hallberg-NOAA Hallberg-NOAA merged commit caa7349 into NOAA-GFDL:dev/gfdl May 30, 2025
52 checks passed
@Hallberg-NOAA
Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

answer-changing A change in results (actual or potential) bug Something isn't working enhancement New feature or request Parameter change Input parameter changes (addition, removal, or description)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants