[ncl-talk] ind funtion (not working when used as: ind(variable.eq.variable at _FillValue)
Mary Haley
haley at ucar.edu
Mon Nov 20 08:11:59 MST 2017
Rashed,
For assorted reasons, you do NOT want to directly compare an array with its
_Fillvalue.
Please see this description in the NCL Reference Manual on the "if"
statement and read the discussion about _FillValue:
http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclStatements.shtml#If
You should also read the section on "Expressions and missing values" at:
http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclExpressions.shtml#MissingValues
The use of "ismissing" to check for missing values is the correct way to go.
--Mary
On Sun, Nov 19, 2017 at 11:05 PM, Rashed Mahmood <rashidcomsis at gmail.com>
wrote:
> Hi,
> NCL 6.4:
> I am not sure if that is the intended behaviour, a simple following
> command show the problem:
> I do not why the command line: ncl 2> print(ind(a.eq.a at _FillValue)) would
> produce a missing while it's fine with: ncl 3> print(ind(ismissing(a)))
>
>
> ncl 0> a = (/1,2,3,4,-999.000,6/)
> ncl 1> a at _FillValue = -999.000
> ncl 2> print(ind(a.eq.a at _FillValue))
> (0) -2147483647 <(214)%20748-3647>
> ncl 3> print(ind(ismissing(a)))
> (0) 4
>
>
> If that is how it is supposed to, then should there be any warning/error
> message?
>
> Thanks,
> Rashed
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171120/3dbc3b11/attachment-0001.html>
More information about the ncl-talk
mailing list