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

Error introduced in builtin function "simpne()" #118

Open
rbrownrigg opened this issue Dec 10, 2019 · 0 comments
Open

Error introduced in builtin function "simpne()" #118

rbrownrigg opened this issue Dec 10, 2019 · 0 comments

Comments

@rbrownrigg
Copy link
Contributor

An ncl-talk user on 12/9/2019 reported a problem using in which they would get this error message:

fatal:simpne: Must have three or more non-missing values.

When in fact their data had no missing values in the x variable. Indeed, this same message results when running the 1st two 1D examples in the documentation page for simpne().

That error message originates in .../ncl/ni/src/lib/nfp/simpsonW.c. The git log shows that back in 2016, an explicit test for more than 3 non-missing vals was added. At around lines 427-428 (at time of writing), there's this:

nvalid = size_leftmost - nmiss;
if(nvalid < 3) {

Following the code logic, if the x input array is 1D, "size_leftmost" will always be 1, and thus "nvalid" always < 3. I'm not certain about an ND input array and I don't really understand the computation of size_leftmost for the ND case. However, I think the calculation for "nvalid" should be something like:

nvalid = npts - nmiss

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

No branches or pull requests

1 participant