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

Make sure n_steps_default >= 3 #174

Merged
merged 3 commits into from
Nov 13, 2024
Merged

Conversation

NoraLoose
Copy link
Member

Issue

Our current computation of the n_steps_default returns a value smaller than 3 for very small filter factors (<= 1.8) together with a Gaussian filter shape. If the user does not specify their own n_steps, the code will then set

n_steps = n_steps_default < 3

which then leads to an error when the mass matrix for the Galerkin basis is set up (which assumes n_steps >=3).

Changes

This PR simply makes sure that n_steps_default is always at least 3 by setting n_steps_default as the maximum of our current computation and 3. There is also a new test, which would have failed with the previous implementation.

Copy link
Member

@iangrooms iangrooms 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 me. Thanks for finding and fixing this.

@NoraLoose NoraLoose merged commit bcd900d into ocean-eddy-cpt:master Nov 13, 2024
5 checks passed
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