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

sangeeta maharjan sangeetamaharjan at gmail.com
Tue Nov 30 00:40:43 MST 2021


Thank you for the clarification.
It worked.

Sang


On Mon, Nov 29, 2021 at 10:33 PM Dennis Shea <shea at ucar.edu> wrote:

> 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/20211130/ac4227b9/attachment.html>


More information about the ncl-talk mailing list