Skip to content

Add tracer budget closure test#5679

Open
navidcy wants to merge 10 commits into
mainfrom
ncc-ts/tracer-conservation
Open

Add tracer budget closure test#5679
navidcy wants to merge 10 commits into
mainfrom
ncc-ts/tracer-conservation

Conversation

@navidcy

@navidcy navidcy commented Jun 12, 2026

Copy link
Copy Markdown
Member

Add tracer conservation tests for hydrostatic and nonhydrostatic model.

The test checks whether the total tracer changes in agreement with how much the surface flux of the tracer is.

w @taimoorsohail

@navidcy navidcy added the testing 🧪 Tests get priority in case of emergency evacuation label Jun 12, 2026
@navidcy navidcy marked this pull request as ready for review June 12, 2026 10:27
@simone-silvestri

Copy link
Copy Markdown
Collaborator

We already have some conservation tests for the hydrostatic model in
https://github.com/CliMA/Oceananigans.jl/blob/main/test/test_zstar_conservation_explicit.jl
https://github.com/CliMA/Oceananigans.jl/blob/main/test/test_zstar_conservation_implicit.jl
https://github.com/CliMA/Oceananigans.jl/blob/main/test/test_zstar_conservation_tripolar.jl
maybe we could add to those (small caveat for tracer conservation in a hydrostatic model zstar is required, on the non-hydrostatic it is not a problem since we use a rigid lid approximation)

@navidcy

navidcy commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

Gotcha. I’ll move them there/combine. Will also perturb the free surface so that zstar is required for.

@simone-silvestri

Copy link
Copy Markdown
Collaborator

apparently tracers are not conserved?

Comment thread test/test_tracer_budget_closure.jl
Comment thread test/test_tracer_conservation.jl Outdated
@navidcy navidcy changed the title Add tracer conservation test Add tracer budget closure test Jun 19, 2026
boundary_conditions=(c=c_bcs,),
free_surface=SplitExplicitFreeSurface(substeps=15))

hydrostatic_model.free_surface.displacement[1:grid.Nx, 1:grid.Ny, grid.Nz+1:grid.Nz+1] .= 2e-1 * rand.()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@simone-silvestri, I perturbed the free surface but locally still the test passes, although we are not using $z$-star. how come?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I guess z-star is required if we were testing point-wise conservation, not conservation in an integral sense?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think its the opposite

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Perhaps I don’t know what “conservation” means? Here I am testing the tracer budget and that the total tracer content changes according to the surface forcing. Seems that it doesn’t require z-star unless my test case is too simple?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing 🧪 Tests get priority in case of emergency evacuation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants