Skip to content

[WIP] Fix tracer conservation when wind is blowing #4467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

NoraLoose
Copy link
Collaborator

This PR aims to close #4466.

I am adding a test that checks for tracer conservation on a tripolar grid with wind forcing, using the code snippet provided in #4466. Currently, the test fails due to non-conservation of the passive tracer. Once the underlying issue is resolved, this test should pass.

Feel free to push directly to this PR with any proposed fixes of the underlying issue.

@NoraLoose NoraLoose marked this pull request as draft May 2, 2025 17:07
@glwagner
Copy link
Member

glwagner commented May 2, 2025

Is the problem specific to TripolarGrid, or does it also occur on rectilinear or lat-lon?

Co-authored-by: Gregory L. Wagner <[email protected]>
Comment on lines +307 to +309
model = make_tripolar_test_model(arch, with_wind=false)
Δt = 2minutes
test_zstar_coordinate(model, 300, Δt)
Copy link
Member

Choose a reason for hiding this comment

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

is it possible to write this test to use any grid? or maybe too difficult?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could be done with a slight refactor. Question is: Do we want to double the number of tests? We are testing quite a number of rectilinear grid cases (different topologies, immersed boundary vs. not, etc.)

Copy link
Collaborator Author

@NoraLoose NoraLoose May 2, 2025

Choose a reason for hiding this comment

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

It's probably worth doing the refactor and test with wind forcing for all grids. This would also answer the question whether the issue is specific to the TripolarGrid. I will continue working on this in a few hours.

Copy link
Member

@glwagner glwagner May 2, 2025

Choose a reason for hiding this comment

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

we can take a look at how long the test is taking and decide based on that perhaps. Perhaps prioritizing just lat-lon along with Tripolar makes sense

@NoraLoose
Copy link
Collaborator Author

Is the problem specific to TripolarGrid, or does it also occur on rectilinear or lat-lon?

Good question - I haven't tested this for rectilinear and lat-lon.

Co-authored-by: Gregory L. Wagner <[email protected]>
@glwagner
Copy link
Member

glwagner commented May 2, 2025

Is the problem specific to TripolarGrid, or does it also occur on rectilinear or lat-lon?

Good question - I haven't tested this for rectilinear and lat-lon.

could be a red herring, but if there is a difference between grids (also when using immersed boundaries or not) that might be an important clue

Δt = 2minutes
test_zstar_coordinate(model, 300, Δt)
for with_wind in (false, true)
for with_bathymetry in (false, true)
Copy link
Member

@glwagner glwagner May 2, 2025

Choose a reason for hiding this comment

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

I don't think we can use the TripolarGrid without bathymetry because of the coordinate singularities

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh okay, that explains

However, tracer conservation fails at the initial time step for the TripolarGrid without bathymetry (both with and without wind). So this adds more questions than answers...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

okay, I will roll back

@NoraLoose
Copy link
Collaborator Author

In an attempt to get some more clues, 765be75 sets up additional tracer conservation tests but without bathymetry (with and without wind).

However, tracer conservation fails at the initial time step for the TripolarGrid without bathymetry (both with and without wind). So this adds more questions than answers...

@NoraLoose NoraLoose force-pushed the nl/test-zstar-with-wind branch from 765be75 to 6c74724 Compare May 2, 2025 22:08
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.

Passive tracers are not conserved on tripolar grid if wind is blowing
2 participants