Skip to content

Extend test coverage to HydrostaticFreeSurfaceModel#231

Merged
tomchor merged 1 commit into
mainfrom
tc/hydrostatic-tests
May 15, 2026
Merged

Extend test coverage to HydrostaticFreeSurfaceModel#231
tomchor merged 1 commit into
mainfrom
tc/hydrostatic-tests

Conversation

@tomchor
Copy link
Copy Markdown
Owner

@tomchor tomchor commented May 11, 2026

Summary

Three test groups previously exercised only NonhydrostaticModel even though the underlying diagnostics support both model types. This PR closes those gaps.

  • TKE shear production (test/test_turbulent_kinetic_energy_equation.jl) — removed the NonhydrostaticModel-only guard around test_shear_production_terms so it now runs inside the existing for model_type in model_types loop. The four shear-production constructors (X/Y/Z/total) already accept any model in the source.
  • Canonical flows (test/test_canonical_flows.jl) — added HydrostaticFreeSurfaceModel to the outer iteration for the uniform strain, solid body rotation, and uniform shear flow tests. The set! call branches on model type because HFSM's set! does not accept enforce_incompressibility or a w field. The strain-flow vorticity-zero comparison was relaxed to atol=10eps() to absorb HFSM's ~6e-16 roundoff (the same pattern is already used elsewhere in the file with atol=eps()).
  • Progress messengers (test/test_progress_messengers.jl) — restructured the test loop to iterate over (model_type, closures) pairs. HFSM is tested with ScalarDiffusivity only; the LES closures in the existing list (SmagorinskyLilly, DynamicSmagorinsky, AnisotropicMinimumDissipation) are not generally compatible with HFSM.

Diagnostics that remain NonhydrostaticModel-only (KineticEnergyTendency, KineticEnergyAdvection, KineticEnergyForcing, KineticEnergyPressureRedistribution, BuoyancyProduction, TracerVarianceTendency) are restricted at the source-method level and are out of scope here.

Test plan

  • TEST_GROUP=tke_diagnostics julia --project -e 'using Pkg; Pkg.test()' — 438/438 pass
  • TEST_GROUP=canonical_flows julia --project -e 'using Pkg; Pkg.test()' — 260/260 pass
  • TEST_GROUP=progress_messengers julia --project -e 'using Pkg; Pkg.test()' — 24/24 pass

🤖 Generated with Claude Code

Three test groups previously exercised only NonhydrostaticModel even though
the underlying diagnostics support both model types.

- TKE shear production rates: removed the NonhydrostaticModel guard so the
  four shear production diagnostics now run inside the existing model_types
  loop.
- Canonical flows (uniform strain, solid body rotation, uniform shear):
  added HydrostaticFreeSurfaceModel to the iteration. The set! call is now
  branched on model type because HFSM's set! does not accept
  enforce_incompressibility or a w field. Relaxed the strain-flow vorticity
  comparison to atol=10eps() to absorb roundoff from HFSM's operator paths
  (~6e-16).
- Progress messengers: added a HydrostaticFreeSurfaceModel iteration with a
  ScalarDiffusivity closure (the other LES closures in the existing list are
  not compatible with HFSM).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tomchor tomchor merged commit aa7d904 into main May 15, 2026
13 checks passed
@tomchor tomchor deleted the tc/hydrostatic-tests branch May 15, 2026 15:44
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.

1 participant