Skip to content

Conversation

@herrwang0
Copy link

This PR fixes a bug that can occur in some marginal cases with an interior OBC.

In subroutine advect_x, the masking that avoids tracer points right outside of OBC to be updated, do_i, is not applied to the last valid point in the zonal direction. This indexing bug causes problems when the interior OBC is right on the edge of a processor's computational domain, or any of the the marching stencil boundaries during the iteration. This also means the answer is sensitive to PE layout.

Two comments/questions:

  1. I did not include a bug flag as I would imagine this bug rarely happens. Not sure how many people are actively using interior OBC. And the bugs is only triggered by interior OBC placed right on the boundary of a processor. Let me know if a bug flag is warranted.

  2. The patch fixes my unlucky case and passes the TC tests. But I am not sure if it breaks or changes answers to any other OBC runs. So any help with additional tests is appreciated.

@herrwang0 herrwang0 added the bug Something isn't working label Jan 5, 2026
Copy link
Member

@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.

I have examined these changes and I agree with them. Thank you for tracking down and fixing this bug.

There is no bug fix flag needed here because this is in essence a parallelization bug and it will not change the single PE answers. There are no valid answers to recreate. Moreover, I do not think that there will be other production cases that are impacted by this.

Move nsten_halo out of iteration loop
Fix a bug that tracers in domain outside of the
OBC is falsely updated when then the OBC is in the
interior. The bug was due to an indexing error in
routine advect_x.
@Hallberg-NOAA Hallberg-NOAA force-pushed the bugfix-interior-obc-tracer branch from eb006d0 to 8849012 Compare January 12, 2026 17:54
@Hallberg-NOAA
Copy link
Member

This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/29801.

@Hallberg-NOAA Hallberg-NOAA merged commit a8f6945 into NOAA-GFDL:dev/gfdl Jan 12, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants