Skip to content
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

Fix small conservation error when using fct thickness and tracer advection #95

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

trhille
Copy link

@trhille trhille commented Oct 19, 2023

Add a halo update on layerThicknessEdgeFlux to fix a small tracer conservation error when using fct thickness and tracer advection. That error was documented in this comment in PR #70 : #70 (comment).

…ction

Add a halo update on layerThicknessEdgeFlux to fix a small tracer
conservation error when using fct thickness and tracer advection.
@trhille
Copy link
Author

trhille commented Oct 19, 2023

Testing

Using the grounded slab advection test with prescribed velocity that I used extensively in #70. Calculating tracer volume using ncap2 -s 'tracer_sum = (passiveTracer2d * thickness * areaCell).sum($nCells)' output_all_timesteps.nc tracer_sum.nc. Before this change, we got a drift in tracer volume:
image

Using this branch, we get full conservation:
image

Copy link

@matthewhoffman matthewhoffman left a comment

Choose a reason for hiding this comment

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

@trhille , good sleuthing. This looks straightforward. It's too bad we have to pass domain around just to do a halo update, but solutions to address that are well beyond the scope of this PR and the solution you have here is the obvious one.

@trhille
Copy link
Author

trhille commented Oct 26, 2023

All full_integration tests passed validation and baseline comparison.

@trhille
Copy link
Author

trhille commented Oct 26, 2023

All fct_integration tests pass validation. landice_humboldt_mesh-3km_restart_test_velo-fo_advec-fct_calving-von_mises_stress_damage-threshold_faceMelting fails baseline comparison, presumably because now damage is treated properly.

@trhille trhille merged commit 81b36a9 into MALI-Dev:develop Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants