[ncl-talk] Logical statement with multiple conditions

Alan Brammer abrammer at albany.edu
Thu Jul 2 09:24:36 MDT 2015


Do you not mean .or. then.

var can not possibly equal 1 and 2 and 3 at the same location which is what
you are currently asking.  var could however be either 1 or 2 or 3.

e.g. The month is either Jan or Feb or March.  A single month can not be
Jan and Feb and March though.

Alan.

On Thu, Jul 2, 2015 at 1:37 AM, Rabah Hachelaf <hachelaf at sca.uqam.ca> wrote:

> Hi NCL users,
>
> This statement did not work for me :
>
> idx_months  = ind (var.eq.1 .and. var.eq.2 .and. var.eq.3 )
>
> i want to get indices corresponding to var ==1 &2 & 3
>
> it works only for one condition like : idx_months  = ind (var.eq.1)
>
> Any suggestions,
>
> Thanks in advance
>
> --
> ------------------------------
> Cordialement,
> Rabah Hachelaf
>
> _______________________________________________
> 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/20150702/cd9feedf/attachment.html 


More information about the ncl-talk mailing list