Skip to content

Close u/v momentum budget on HydrostaticFreeSurfaceModel#233

Open
tomchor wants to merge 3 commits into
mainfrom
tc/hfs-momentum-budget
Open

Close u/v momentum budget on HydrostaticFreeSurfaceModel#233
tomchor wants to merge 3 commits into
mainfrom
tc/hfs-momentum-budget

Conversation

@tomchor
Copy link
Copy Markdown
Owner

@tomchor tomchor commented May 17, 2026

Summary

Closes the u/v momentum budget on HydrostaticFreeSurfaceModel. Follow-up to #213, which scoped the budget closure tests to NonhydrostaticModel only because two pieces were missing. This PR adds them.

Changes

  1. Advection(::HydrostaticFreeSurfaceModel) now wraps U_dot_∇u / U_dot_∇v (the vector-invariant kernel that hydrostatic_free_surface_*_velocity_tendency actually calls), instead of div_𝐯u / div_𝐯v. The Advection type alias becomes a Union of both kernel parameterisations:

    const Advection = Union{CustomKFO{<:typeof(div_𝐯u)}, CustomKFO{<:typeof(U_dot_∇u)}}

    isa UAdvection keeps working for both NH and HFS. NH behaviour is unchanged.

  2. New BarotropicPressureGradient diagnostic on U and V, wrapping explicit_barotropic_pressure_{x,y}_gradient(free_surface). Behaviour by free-surface type:

    free-surface type return
    nothing (NH) zero(grid)
    ImplicitFreeSurface (HFS default) zero(grid) — barotropic part solved implicitly
    SplitExplicitFreeSurface zero(grid) — handled inside the split-explicit solver
    ExplicitFreeSurface g ∂_i η

HFS u/v budget

Tendency = -Advection - BarotropicPressureGradient - CoriolisAcceleration - PressureGradient - TotalViscousDissipation + Forcing

No BuoyancyAcceleration (absorbed into pHY′), no Stokes terms (HFS has no stokes_drift field).

Tests / CI

test_u_momentum_hfs_budget_closure and test_v_momentum_hfs_budget_closure build an HFS model with every term active (momentum_advection = Centered() so the advection diagnostic matches the tendency for the test scheme), set non-trivial u, v, b fields, call update_state!, and assert interior(budget) ≈ interior(Tendency) to machine precision. The closure holds on RectilinearGrid with ImmersedBoundaryGrid semantics already exercised by the term-construction tests.

Existing NH budget closure and W tests are unchanged.

Test plan

  • TEST_GROUP=u_momentum_diagnostics julia --project -e 'using Pkg; Pkg.test()'
  • TEST_GROUP=v_momentum_diagnostics julia --project -e 'using Pkg; Pkg.test()'
  • TEST_GROUP=w_momentum_diagnostics julia --project -e 'using Pkg; Pkg.test()'
  • Doctests pass (build_docs CI)

Follow-ups not in this PR

  • HFS budget closure on ExplicitFreeSurfaceBarotropicPressureGradient returns the correct kernel for it, but the test would need to be parameterised on free-surface type. The current test only exercises the implicit/zero branch.
  • Curvilinear-grid metric correction (U_dot_∇u_hydrostatic_metric) is zero on RectilinearGrid, so it's not exposed as a diagnostic; would need a wrapper for LatitudeLongitudeGrid/OrthogonalSphericalShellGrid users.

Add two pieces of machinery to make `UMomentumEquation`/`VMomentumEquation` budgets
close on `HydrostaticFreeSurfaceModel`:

1. `Advection(::HydrostaticFreeSurfaceModel)` now wraps `U_dot_∇u`/`U_dot_∇v` (the
   vector-invariant kernel that `hydrostatic_free_surface_*_velocity_tendency`
   actually calls) instead of `div_𝐯u`/`div_𝐯v`. The `Advection` type alias
   becomes a Union of both kernel parameterisations so existing `isa Advection`
   checks keep working for NH. NH `Advection` is unchanged.

2. New `BarotropicPressureGradient` diagnostic on U and V wraps
   `explicit_barotropic_pressure_{x,y}_gradient(free_surface)`. For
   `ImplicitFreeSurface` and `SplitExplicitFreeSurface` this returns zero
   (the barotropic contribution is solved implicitly), and for the NH
   `free_surface = nothing` case it also returns zero — but for
   `ExplicitFreeSurface` it equals `g ∂_i η` and is the missing term needed
   for closure.

Add HFS budget closure tests for U and V (using the default
`ImplicitFreeSurface`) plus matching `BarotropicPressureGradient` exports
and aliases. Update the docs page with a dedicated HFS budget section
that spells out the formula and the free-surface free-surface-type caveat.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tomchor tomchor requested a review from Copilot May 19, 2026 13:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends Oceanostics’ momentum-budget diagnostics to fully close the u/v momentum budgets for HydrostaticFreeSurfaceModel (HFS), bringing HFS coverage in line with the existing NonhydrostaticModel budget-closure work from #213.

Changes:

  • Update HFS Advection diagnostics to wrap the vector-invariant kernels (U_dot_∇u / U_dot_∇v) used by hydrostatic_free_surface_{u,v}_velocity_tendency.
  • Add BarotropicPressureGradient (u/v) diagnostics wrapping Oceananigans’ explicit barotropic free-surface pressure-gradient kernels.
  • Add HFS u/v budget-closure tests and update the documentation to describe the HFS budget formula and caveats.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/UMomentumEquation.jl Adds HFS advection wrapper (U_dot_∇u) and introduces BarotropicPressureGradient for u-momentum.
src/VMomentumEquation.jl Adds HFS advection wrapper (U_dot_∇v) and introduces BarotropicPressureGradient for v-momentum.
src/Oceanostics.jl Re-exports the new prefixed barotropic-pressure-gradient diagnostics.
test/test_u_momentum_diagnostics.jl Adds u-momentum HFS budget-closure test and runs it in the main testset.
test/test_v_momentum_diagnostics.jl Adds v-momentum HFS budget-closure test and runs it in the main testset.
docs/src/momentum_equation.md Documents the HFS u/v budget and adds the new diagnostics to the rendered API docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/UMomentumEquation.jl
Comment thread src/VMomentumEquation.jl
Comment thread docs/src/momentum_equation.md Outdated
Comment thread test/test_u_momentum_diagnostics.jl Outdated
Comment thread test/test_v_momentum_diagnostics.jl Outdated
Comment thread src/UMomentumEquation.jl
Comment thread src/VMomentumEquation.jl
Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 127.255.255.255
    • Triggering command: REDACTED, pid is -1 (packet block)
  • https://api.github.com/repos/CliMA/CubedSphere.jl/tarball/6ffea589cf350b1582722e57a8de787907d59454
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/CliMA/Oceananigans.jl/tarball/ccdb005c9c13ba360512415d627a764ac5296e66
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/CliMA/SeawaterPolynomials.jl/tarball/e2671e9abe2a2faa51dcecd9d911522931c16012
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/EnzymeAD/Reactant.jl/tarball/5b9e0fe7fb2cf3794fd96ac32bf2732aa4bb9776
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/FluxML/MacroTools.jl/tarball/1e0228a030642014fe5cfe68c2c0a818f9e3f522
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaArrays/OffsetArrays.jl/tarball/117432e406b5c023f665fa73dc26e79ec3630151
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaArrays/StaticArrays.jl/tarball/246a8bb2e6667f832eea063c3a56aef96429a3db
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaArrays/StaticArraysCore.jl/tarball/6ab403037779dae8c514bad259f32a447262455a
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaArrays/StructArrays.jl/tarball/ad8002667372439f2e3611cfd14097e03fa4bccd
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/CUDA_Compiler_jll.jl/tarball/b977706846cb0a75d3842a1fed810ab2e6ab2f94
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/CUDA_Driver_jll.jl/tarball/23c51e2c9bb36be09c3f10f92d0b9cc294e1bc5e
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/CUDA_Runtime_jll.jl/tarball/c0314d9fb0ebd00e404feba4c3fbc04c9975abc1
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/FFTW_jll.jl/tarball/6866aec60ef98e3164cd8d6855225684207e9dff
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Hwloc_jll.jl/tarball/baaaebd42ed9ee1bd9173cfd56910e55a8622ee1
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/IntelOpenMP_jll.jl/tarball/ec1debd61c300961f98064cfb21287613ad7f303
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/JuliaNVTXCallbacks_jll.jl/tarball/af433a10f3942e882d3c671aacb203e006a5808f
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/LLVMExtra_jll.jl/tarball/70c96f133c78c3cdc06234157144fab3744c6b38
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/LibTracyClient_jll.jl/tarball/d4e20500d210247322901841d4eafc7a0c52642d
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Libiconv_jll.jl/tarball/be484f5c92fad0bd8acfef35fe017900b0b73809
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/MKL_jll.jl/tarball/282cadc186e7b2ae0eeadbd7a4dffed4196ae2aa
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/MPIABI_jll.jl/tarball/9be143b6045719e8fb019d2b3bc2aebad1184fef
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/MPICH_jll.jl/tarball/07dbec8aab01696edc0151a401a6cdfe95b9b885
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/MPItrampoline_jll.jl/tarball/675df097f8eeb28998b2cfe3b25655af73d5f7df
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/MicrosoftMPI_jll.jl/tarball/bc95bf4149bf535c09602e3acdf950d9b4376227
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/NVTX_jll.jl/tarball/af2232f69447494514c25742ba1503ec7e9877fe
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/OpenMPI_jll.jl/tarball/6d6c0ca4824268c1a7dca1f4721c535ac63d9074
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/XML2_jll.jl/tarball/80d3930c6347cfce7ccf96bd3bafdf079d9c0390
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Xorg_libpciaccess_jll.jl/tarball/58972370b81423fc546c56a60ed1a009450177c3
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Zstd_jll.jl/tarball/446b23e73536f84e8037f5dce465e92275f6a308
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/demumble_jll.jl/tarball/6498e3581023f8e530f34760d18f75a69e3a4ea8
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/oneTBB_jll.jl/tarball/da8c1f6eee04831f14edcfa5dae611d309807e57
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaCollections/OrderedCollections.jl/tarball/05868e21324cede2207c6f0f466b4bfef6d5e7ee
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaConcurrent/Atomix.jl/tarball/b8651b2eb5796a386b0398a20b519a6a6150f75c
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaConcurrent/UnsafeAtomics.jl/tarball/0f30765c32d66d58e41f4cb5624d4fc8a82ec13b
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/DataAPI.jl/tarball/abe83f3a2f1b857aac70ef8b269080af17764bbe
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/Tables.jl/tarball/f2c1efbc8f3a609aadf318094f8fc5204bdaf344
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaDiff/TaylorSeries.jl/tarball/4a5ddc4036946d3a7900b5776b0872e36d848a29
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaDocs/DocStringExtensions.jl/tarball/7442a5dfe1ebb773c29cc2962a8980f47221d76c
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaGPU/Adapt.jl/tarball/28e1637322d4019ed2577cbec9268fab9b7da117
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaGPU/CUDA.jl/tarball/269695e0ac0bfd854feba8179433c57e10dc95a7
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaGPU/CUDA.jl/tarball/3de36a048e6abb49f9d34405e8cf7d0b27715ae7
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaGPU/CUDA.jl/tarball/5da59442cc13bb1a8647bbe20eba66917dc3a64b
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaGPU/CUDA.jl/tarball/6e0ed8fe61c12fced0fcb6912bc73196e323fff2
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaGPU/CUDA.jl/tarball/772beeca0de8e7e58ec013b14fbda981b74108f5
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaGPU/CUDA.jl/tarball/9d6409c7fbdef7105385105b172bb193897ec7a3
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaGPU/CUDA.jl/tarball/d0772ca43c4500c0cce1ff02a9dfda8faf65c960
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaGPU/CUDA.jl/tarball/d57a233b32dc0f7f8eeb73dd986a01348dc4bef5
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaGPU/CUDA.jl/tarball/dae250870a645b30a534a4176985993e615eb944
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaGPU/CUDA.jl/tarball/dd9b7208970e29c459f254a52393f10cdc4357b8
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaGPU/CUDA_Runtime_Discovery.jl/tarball/4fd010410c0c91c8b9bd6194a9ebdebecd9a8107
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaGPU/GPUArrays.jl/tarball/83cf05ab16a73219e5f6bd1bdfa9848fa24ac627
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaGPU/GPUArrays.jl/tarball/cf230532c7871ce9bfa5812dd699cb68da888364
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaGPU/GPUCompiler.jl/tarball/31d46d9e39273b6a7d7784615678d84a29597e1b
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaGPU/GPUToolbox.jl/tarball/a589b6c1a0eff953571f5d8b0474f5020831114d
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaGPU/KernelAbstractions.jl/tarball/f2e76d3ced51a2a9e185abc0b97494c7273f649f
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaGPU/NVTX.jl/tarball/a9083c3e469e63cca454d1fc3b19472d9d92c14a
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaGeometry/Quaternions.jl/tarball/4d8c1b7c3329c1885b857abb50d08fa3f4d9e3c8
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaGeometry/Rotations.jl/tarball/5680a9276685d392c87407df00d57c9924d9f11e
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaIO/ChunkCodecs.jl/tarball/1a3ad7e16a321667698a19e77362b35a1e94c544
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaIO/ChunkCodecs.jl/tarball/34d9873079e4cb3d0c62926a225136824677073f
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaIO/ChunkCodecs.jl/tarball/cee8104904c53d39eb94fd06cbe60cb5acde7177
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaIO/FileIO.jl/tarball/8e9c059d6857607253e837730dbf780b6b151acd
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaIO/JLD2.jl/tarball/941f87a0ae1b14d1ac2fa57245425b23a9d7a516
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaInterop/CEnum.jl/tarball/389ad5c84de1ae7cf0e28e381131c98ea87d54fc
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaLLVM/LLVM.jl/tarball/6884c216a5e3671990d245514aa94c67046b6e40
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaLang/PrecompileTools.jl/tarball/edbeefc7a4889f528644251bdb5fc9ab5348bc2c
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaLang/ScopedValues.jl/tarball/67a144433c4ce877ee6d1ada69a124d6b1ecf7be
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaMath/AbstractFFTs.jl/tarball/d92ad398961a3ed262d8bf04a1a2b8340f915fef
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaMath/BFloat16s.jl/tarball/e386db8b4753b42caac75ac81d0a4fe161a68a97
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaMath/FFTW.jl/tarball/97f08406df914023af55ade2f843c39e99c5d969
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaMath/RealDot.jl/tarball/9f0a1b71baaf7650f4fa8a1d168c7fb6ee41f0c9
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaObjects/ConstructionBase.jl/tarball/b4b092499347b18a015186eae3042f72267106cb
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaPackaging/JLLWrappers.jl/tarball/7204148362dafe5fe6a273f855b8ccbe4df8173e
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaPackaging/Preferences.jl/tarball/8b770b60760d4451834fe79dd483e318eee709c4
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaPackaging/Requires.jl/tarball/62389eeff14780bfe55195b7204c0d8738436d64
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaPackaging/Scratch.jl/tarball/9b81b8393e50b7d4e6d0a9f14e192294d3b7c109
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaParallel/MPI.jl/tarball/8e98d5d80b87403c311fd51e8455d4546ba7a5f8
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaParallel/MPI.jl/tarball/ff6309186ff377782d01f6577d19ae1b5f5185c5
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaPluto/ExpressionExplorer.jl/tarball/5f1c005ed214356bbe41d442cc1ccd416e510b7e
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaRandom/Random123.jl/tarball/dbe5fd0b334694e905cb9fda73cd8554333c46e2
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaRandom/RandomNumbers.jl/tarball/c6ec94d2aaba1ab2ff983052cf6a606ca5985902
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaSIMD/LLVMLoopInfo.jl/tarball/2e5c102cfc41f48ae4740c7eca7743cc7e7b75ea
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaSmoothOptimizers/Krylov.jl/tarball/c4d19f51afc7ba2afbe32031b8f2d21b11c9e26e
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaStats/Distances.jl/tarball/c7e3a542b999843086e2f29dac96a618c105be1d
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaStats/Statistics.jl/tarball/ae3bb1eb3bba077cd276bc5cfc337cc65c3075c0
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaStats/StatsAPI.jl/tarball/178ed29fd5b2a2cfc3bd31c13375ae925623ff36
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaStrings/LaTeXStrings.jl/tarball/dda21b8cbd6a6c40d9d02a73230f9d70fed6918c
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaTesting/ExprTools.jl/tarball/27415f162e6028e81c72b82ef756bf321213b6ec
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/KlausC/PkgVersion.jl/tarball/f9501cc0430a26bc3d156ae1b5b0c1b47af4d6da
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/KristofferC/Crayons.jl/tarball/249fe38abf76d48563e2f4556bebd215aa317e15
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/SciML/MuladdMacro.jl/tarball/cac9cc5499c25554cba55cd3c30543cff5ca4fab
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/queryverse/DataValueInterfaces.jl/tarball/bfc1187b79289637fa0ef6d4436ebdfe6905cbd6
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/queryverse/IteratorInterfaceExtensions.jl/tarball/a3f24677c21f5bbe9d2a714f95dcd58337fb2856
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/queryverse/TableTraits.jl/tarball/c06b2f539df1c6efa794486abfb6ed2022561a39
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/ronisbr/PrettyTables.jl/tarball/624de6279ab7d94fc9f672f0068107eb6619732c
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/ronisbr/StringManipulation.jl/tarball/d05693d339e37d6ab134c5ab53c29fce5ee5d7d5
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/simonster/Reexport.jl/tarball/45e428421666073eab6f2da5c9d310d99bb12f9b
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/topolarity/Tracy.jl/tarball/73e3ff50fd3990874c59fef0f35d10644a1487bc
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/vchuravy/HashArrayMappedTries.jl/tarball/2eaa69a7cab70a52b9687c8bf950a5a93ec895ae
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/vtjnash/Glob.jl/tarball/246c628cec062230b7d183aab88841fa94fcabe9
    • Triggering command: REDACTED, pid is -1 (http block)
  • pkg.julialang.org
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (dns block)
    • Triggering command: /usr/local/julia1.12.6/bin/julia /usr/local/julia1.12.6/bin/julia -C native -J/usr/local/julia1.12.6/lib/julia/sys.so -g1 --code-coverage=none --color=auto --check-bounds=yes --warn-overwrite=yes --depwarn=yes --inline=yes --startup-file=no --track-allocation=none --check-bounds=yes --output-o /home/REDACTED/.julia/compiled/v1.12/MKL_jll/jl_RlMFuI --output-ji /home/REDACTED/.julia/compiled/v1.12/MKL_jll/jl_Kq6vMr --output-incremental=yes --startup-file=no (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

The earlier HFS Advection refactor only added a 3-arg HFS-typed method (model,
scheme, velocities) and an HFS-typed 1-arg convenience method. The generic
5-arg overload `Advection(model, u, v, w, scheme)` was left untyped on
`model`, so an explicit call `Advection(hfs_model, u, v, w, scheme)`
dispatched to the NH `div_𝐯u`/`div_𝐯v` form — inconsistent with the
documented behaviour and with the 1-arg form's `U_dot_∇u`/`U_dot_∇v`.

Add an HFS-typed 5-arg overload that builds `velocities = (; u, v, w)`
and forwards to the HFS 3-arg path. With both construction routes now
consistent, the `momentum_advection = Centered()` workaround required
to make the test_*_momentum_terms HFS branches pass is no longer
necessary — drop it everywhere so the tests exercise HFS's default
VectorInvariant scheme, and update the docs caveat to reflect that
both Advection construction paths use the vector-invariant kernel.

Addresses Copilot review comments on PR #233:
- src/UMomentumEquation.jl:105 (Copilot)
- src/VMomentumEquation.jl:104 (Copilot)
- docs/src/momentum_equation.md:126 (Copilot)
- test/test_u_momentum_diagnostics.jl:318 (Copilot)
- test/test_v_momentum_diagnostics.jl:318 (Copilot)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants