Skip to content

Fix a bug in the Cgrid_Velocity interpolation when grids are unequal staggered - #3095

Merged
erikvansebille merged 2 commits into
Parcels-code:mainfrom
erikvansebille:fix_staggered_cgrid_interpolation
Dec 3, 2026
Merged

erikvansebille merged 2 commits into
Parcels-code:mainfrom
erikvansebille:fix_staggered_cgrid_interpolation

Conversation

@erikvansebille

Copy link
Copy Markdown
Member

Description

While working on a Croco dataset from a collaborator, I found that the CGrid_Velocity interpolator assumes that all velocity fields have the same shape (e.g. xdim == U.shape[3] == V.shape[3] == W.shape[3]).

However, this does not have to be the case, on staggered grids. This PR fixes that. issue by using the shapes of the relevant fields

Checklist

  • Tests added
  • This PR targets the correct branch (main for normal development, v3-support for v3 support)

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.
    • Describe how you used it (e.g., by pasting your prompt):

I asked CoPilot to find the bug, and then fixed it myself in _xinterpolator. The unit test was generated by CoPilot

@erikvansebille
erikvansebille enabled auto-merge (squash) December 3, 2026 13:36
@erikvansebille
erikvansebille merged commit 25a6a9b into Parcels-code:main Dec 3, 2026
20 of 21 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Parcels development Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant