[ncl-talk] how to check whether a variable is in the the given 1 dimensional array

Dennis Shea shea at ucar.edu
Mon Nov 29 09:47:54 MST 2021


This question is obscure. What does "check whether  a variable"  mean.

The one dimensional array is a "variable" .... x[:] ... the variable is "x"

Check if a *value* within the variable 'x' is present:

    value = 4.5     or    value = 2
    if (any(x.eq.value))  then
        ...
    else
        ...
    end if



On Mon, Nov 29, 2021 at 12:51 AM sangeeta maharjan via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Hello,
>
> I have a  1 Dimensional array with numbers.
> I want to check whether  a variable is in the given 1 dimensional array
> then my code will proceed with  the if else condition.
>
> Any help would be appreciated.
>
> Sang.
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20211129/11115e4e/attachment.html>


More information about the ncl-talk mailing list