Skip to content

Conversation

@xylar
Copy link
Collaborator

@xylar xylar commented Mar 9, 2025

This merge is a port of:
MPAS-Dev/MPAS-Analysis#1069

Instead of computing the BSF using a least-squares solve based on the transport between vertices, the new approach inverts a Poisson equation for the BSF based on the (vertically integrated) vorticity.

Using a SORRM G-Case simulation, the vertically integrated vorticity computed from the streamfunciton is within machine precision of the original vertically integrated vorticity. The velocity produced by the streamfunciton has errors that are on the order of 1e-3 compared with the original vertically integrated velocity (likely caused by the field not being perfectly divergence free).

closes #605

@xylar xylar requested a review from cbegeman March 9, 2025 10:01
@xylar xylar self-assigned this Mar 9, 2025
Comment on lines -12 to +13
min_depth=-5., max_depth=1.e4,
min_depth=None, max_depth=None,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it's probably better to use None to indicate no min or max.

Comment on lines -31 to +33
The minimum depth (positive down) to compute transport over
The minimum depth (positive up) to compute BSF over
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we probably want to use positive up like in MPAS-Analysis.

Comment on lines +44 to +48
include_bolus : bool, optional
Whether to include the GM bolus velocity in the computation
include_submesoscale : bool, optional
Whether to include the submesoscale velocity in the computation
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These would be needed if we want to use this port in MPAS-Analysis.

@xylar
Copy link
Collaborator Author

xylar commented Mar 9, 2025

@cbegeman, I haven't yet tested this in MPAS-Analysis or Polaris. You are certainly free to have a look but I will ping you when this is ready for you to review.

@xylar
Copy link
Collaborator Author

xylar commented Mar 9, 2025

This merge is a port of:
MPAS-Dev/MPAS-Analysis#1069

Instead of computing the BSF using a least-squares solve based on the transport between vertices, the new approach inverts a Poisson equation for the BSF based on the (vertically integrated) vorticity.

Using a SORRM G-Case simulation, the vertically integrated vorticity computed from the streamfunciton is within machine precision of the original vertically integrated vorticity. The velocity produced by the streamfunciton has errors that are on the order of 1e-3 compared with the original vertically integrated velocity (likely caused by the field not being perfectly divergence free).
@xylar
Copy link
Collaborator Author

xylar commented Mar 10, 2025

Testing in Polaris

I have a draft branch at E3SM-Project/polaris#285. I ran the barotropic gyre test case on Chrysalis with MPAS-Ocean and was able to show that the batotropic streamfunction was similar to previous results (E3SM-Project/polaris#285 (comment)).

@xylar
Copy link
Collaborator Author

xylar commented Mar 10, 2025

@cbegeman, this is ready for your review but no rush. It can go in to MPAS-Tools but it won't be possible to update either Polaris or MPAS-Analysis for a bit while we get other pieces of the MPAS-Tools 1.0.0 release together.

Copy link
Contributor

@cbegeman cbegeman left a comment

Choose a reason for hiding this comment

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

Great! The testing you've done seems sufficient to me. Let me know if you'd like me to try out anything else.

@xylar
Copy link
Collaborator Author

xylar commented Mar 10, 2025

@cbegeman, thanks for the review! I think no further testing is needed on your part for now. We'll want to re-test Polaris once MPAS-Tools 1.0.0 is released, just in case.

@xylar xylar merged commit 7537849 into MPAS-Dev:master Mar 10, 2025
5 checks passed
@xylar xylar deleted the fix-bsf branch March 18, 2025 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redo port of barotropic streamfunction from MPAS-Analysis

2 participants