Regularize halo-fold coupling flux fields#267
Open
taimoorsohail wants to merge 10 commits into
Open
Conversation
Collaborator
Author
|
@simone-silvestri Codex found this bug in the (lack of halo filling) in some of the terms in the fluxes in NumericalEarth.jl. While I think it is a legitimate bug (hence the PR), it didn't make a difference to the numerical instabilities around the halo/fold region in the 1/6th run. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Removed regularization of the source ocean tracer state before coupling.
Removed unnecessary comments and halo filling for fluxes.
simone-silvestri
approved these changes
May 21, 2026
Removed unused fill_halo_regions! import and its call.
Removed the call to fill_halo_regions! for net ocean fluxes.
Member
|
Is this the culprit that we were seeing that suspiciously horizontal line of tracer you think? |
…h/NumericalEarth.jl into ts/try-halo-fold-diagnosis
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.
Summary
Regularize sea-ice/ocean coupling fields at halo and fold boundaries before they are reused in tripolar-grid flux calculations.
Problem
The branch
ts/try-halo-fold-diagnosisfixes a halo-fold issue inNumericalEarth.jl. Several interface and assembled boundary-flux fields were being consumed before their halo or fold values were refreshed, which can lead to inconsistent reads across fold-adjacent cells on tripolar grids.Fix
Call
fill_halo_regions!on the relevant momentum, tracer, and assembled net-flux fields at the points where they are about to be reused by later kernels or by the ocean boundary-condition machinery. This keeps the fold treatment delegated to each field's own zipper boundary condition instead of hard-coding a pivot choice into the coupling code.Files changed
src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jlsrc/Oceans/assemble_net_ocean_fluxes.jlChanges in each file
src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl: importfill_halo_regions!and refresh the sea-ice momentum flux halos before computing scalar ice-ocean fluxes.src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl: refresh the source ocean tracer halos before the coupling kernel reads fold-adjacent cells.src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl: refresh the computed scalar surface flux fields, plusTˢⁱandSˢⁱfor the three-equation formulation, before downstream assemblers consume them.src/Oceans/assemble_net_ocean_fluxes.jl: importfill_halo_regions!and refresh the assembled net ocean boundary flux fields (T,S,u,v) before they are used as ocean tracer and momentum boundary conditions.Validation
Not run locally per repository instructions; validation will come from GitHub-managed CI.