Repository navigation
Keep uniform tracers uniform at open boundaries under z★ with split-explicit free surface - #6362
Open
aklocker42 wants to merge 7 commits into
Open
aklocker42 wants to merge 7 commits into
aklocker42 wants to merge 7 commits into
Conversation
Accumulate the filtered transport Ũ/Ṽ in the free-surface kernel from U★/V★, the transport that advances η, including face N+1 on a Closed right side, and give Ũ/Ṽ boundary conditions that skip NormalFlow sides so the post-substep halo fill keeps the accumulated boundary faces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6362 +/- ##
==========================================
- Coverage 75.70% 74.39% -1.31%
==========================================
Files 452 452
Lines 29091 29097 +6
==========================================
- Hits 22022 21647 -375
- Misses 7069 7450 +381
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aklocker42
marked this pull request as ready for review
October 28, 2026 11:21
Collaborator
|
There are a couple of fixes required. I will merge main, then push here directly. |
Collaborator
|
I have cleaned up a bit, however, I am a bit hesitant to merge any open boundary fix before #6277 gets merged. I think we are close there to a merge, so I would keep this PR a sec to figure out if there is a better way to do this once radiation schemes do not use fill halo anymore |
Parse error (unparenthesized @inbounds in ternary), call to undefined V★ (use U★ for both components), U/V argument swap at the V call site, dropped transport_weight parameter, and unimported Sides (now TwoSided after CliMA#6276). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Resolves conflict in step_split_explicit_free_surface.jl between this PR's relocation of transport_weight/Ũ,Ṽ plumbing from the velocity kernel to the free-surface kernel, and main's (CliMA#6277) new cache_boundary_conditions!/step_boundary_conditions! calls around the same call sites. Both changes are kept. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
simone-silvestri
approved these changes
Nov 1, 2026
This branch has not been deployed
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.
With
ZStarCoordinateand aSplitExplicitFreeSurface, a tracer that starts at c ≡ 1 (and has value 1 at the boundary) doesn't stay at 1 next to open boundaries. In the interior it does, to round-off.The cause is that σ and w̃ see different boundary transports. σ is advanced with η, and η is stepped with the substep
U/Vafter the halo fill and transport pin. The filtered transportŨ/Ṽ, which sets w̃ through ∂t σ = −∇·Ũ/H, disagrees with that at the boundary faces in two ways:Ũ/Ṽare accumulated in the velocity kernel, before the substep fill/pin. So face 1 gets pre-fill values, and face N+1 is outside the kernel range and never accumulated.fill_halo_regions!((Ũ, Ṽ))overwrites the boundary faces with the open-boundary value.So (σⁿ⁺¹ − σⁿ)/Δt ≠ −∇·Ũ/H in the boundary rows only. Because the tracer update divides by σ, the result is a multiplicative error in every tracer there.
This PR:
Ũ/Ṽaccumulation into the free-surface kernel, usingU★(the same transport that advances η);Closed;Ũ/Ṽwith boundary conditions that dropNormalFlowsides, so the post-substep fill keeps the accumulated faces.Fixing only (1) gives results bit-identical to main, because (2) overwrites the faces anyway.
In a small channel (
SplitRungeKutta3,GravityWaveRadiationBoundaryConditionon both open sides, 200 steps), max |c − 1| goes from ~2e-5 on main to ~3e-15.The new test in
split_explicit_boundaries.jlruns c ≡ 1 under z★ through open north/south and west/east boundaries. It fails on main (|c − 1| ≈ 7e-6) and passes here (< 1e-12).In a 16-day realistic regional run with open boundaries, the fix also removes the spurious bottom-cell jets that develop along the open boundaries without it.
This is a fix for
SplitRungeKutta3. UnderQuasiAdamsBashforth2, z★ doesn't keep c ≡ 1 even with closed walls (~4e-5 after 50 steps, identical on main and here). With open boundaries there is an extra boundary error of similar size (~1e-4), which this PR doesn't fix.Related: #5812 changes the same kernel.
🤖 Generated with Claude Code