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 transport for curvilinear grids #164

Merged
merged 1 commit into from
Dec 7, 2020
Merged

Conversation

malmans2
Copy link
Contributor

@malmans2 malmans2 commented Dec 6, 2020

There is a bug in the function that computes transports when using curvilinear grids (the regional setups with rectilinear grids are not affected).
The issue is that currently OceanSpy infers whether path segments are aligned with the X or Y axis using latitude and longitude.
This does not work with curvilinear grids, as the segments might not be zonal/meridional.

The fix is quite straightforward though. We just have to keep track of the indexes (X/Yind variables are now added to the OceanDataset by subsample.mooring_array). These indexes will then be used by compute.mooring_volume_transport to infer the orientation of the segments.

This plot shows the bug:
image

This plot shows the fix:
image

Sorry, the plots are not great but if you zoom on Path 0 you should be able to see what's wrong.

Copy link
Collaborator

@ThomasHaine ThomasHaine left a comment

Choose a reason for hiding this comment

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

Looks good to go.

@malmans2 malmans2 merged commit d422486 into master Dec 7, 2020
@malmans2 malmans2 deleted the fix_curvilinear_transport branch March 2, 2021 15:58
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.

2 participants