[ncl-talk] ind funtion (not working when used as: ind(variable.eq.variable at _FillValue)

Dennis Shea shea at ucar.edu
Mon Nov 20 08:49:26 MST 2017


This behaviour is analogous to checking for 'NaN' (Not-a-Number) in other
languages. A direct 'if' check will not work. A function must be used.

On Mon, Nov 20, 2017 at 8:11 AM, Mary Haley <haley at ucar.edu> wrote:

> 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
>>
>>
>
> _______________________________________________
> 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/41ab3efc/attachment.html>


More information about the ncl-talk mailing list