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 computation of barotropic streamfunction #1063

Merged
merged 4 commits into from
Feb 14, 2025
Merged

Conversation

xylar
Copy link
Collaborator

@xylar xylar commented Feb 14, 2025

This merge includes several fixes:

  • Most important, the computation of the BSF only includes one constraint on the mean BSF at boundary vertices above 45 deg. S. Previously, the computation attempted to make the BSF zero on all boundary vertices, which is not correct since the value on isolated boundaries (e.g. the coast of South America vs. Antarctica) should differ by the transport between them.
  • The full velocity (including bolus and submesoscale components) is used instead of just the resolved.
  • The mask for transport has been fixed to correctly identify the deepest level on an edge.

The colormap has been changed (to blue-orange-div) to indicate a clear break with the incorrect BSF plots before this fix and to slightly improve the contrast at high absolute values of the BSF.

The code has been linted to follow PEP8 conventions

Checklist

  • User's Guide has been updated
  • If this PR adds a new analysis task, it has also been added to the user's guide
  • Documentation has been built locally and changes look as expected
  • Testing comment in the PR documents testing used to verify the changes

Fixes #1061

This merge includes several fixes:
* Most important, the computation of the BSF only includes one
  constraint on the mean BSF at boundary vertices above 45 deg. S.
  Previously, the computation attempted to make the BSF zero on
  all boundary vertices, which is not correct since the value on
  isolated boundaries (e.g. the coast of South America vs.
  Antarctica) should differ by the transport between them.
* The full velocity (including bolus and submesoscale components)
  is used instead of just the resolved.
* The mask for transport has been fixed to correctly identify
  the deepest level on an edge.

The colormap has been changed (to blue-orange-div) to indicate a
clear break with the incorrect BSF plots before this fix and to
slightly improve the contrast at high absolute values of the BSF.

The code has been linted to follow PEP8 conventions
@xylar xylar added the bug label Feb 14, 2025
@xylar xylar self-assigned this Feb 14, 2025
@xylar
Copy link
Collaborator Author

xylar commented Feb 14, 2025

@xylar
Copy link
Collaborator Author

xylar commented Feb 14, 2025

@irenavankova, please feel free to have a look as well, since this fix affects your work, too.

@xylar
Copy link
Collaborator Author

xylar commented Feb 14, 2025

Test Suite

I ran the test suite and results are here:
https://web.lcrc.anl.gov/public/e3sm/diagnostic_output/ac.xasay-davis/analysis_testing/chrysalis/fix-bsf/

Copy link
Collaborator

@milenaveneziani milenaveneziani left a comment

Choose a reason for hiding this comment

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

Looks great to me @xylar!
Approved based on test results and code inspection.

@xylar
Copy link
Collaborator Author

xylar commented Feb 14, 2025

Thank you for having a look, @milenaveneziani!

@maltrud
Copy link

maltrud commented Feb 14, 2025

thanks @xylar for diving into this so quickly. looks good to me.

Copy link

@maltrud maltrud left a comment

Choose a reason for hiding this comment

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

Approved based on test results and code inspection.

@xylar
Copy link
Collaborator Author

xylar commented Feb 14, 2025

Thanks @maltrud. The sooner this gets fixed, the less embarrassing it will continue to be for me.

@xylar xylar merged commit 4b07bb6 into MPAS-Dev:develop Feb 14, 2025
5 checks passed
@xylar xylar deleted the fix-bsf branch February 14, 2025 18:13
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.

Barotropic Streamfunction strangeness
3 participants