Re: NCL arrays and if statement

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Jul 19 2012 - 13:14:47 MDT

http://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml

   secondArray = where(firstArray.lt.0, 0, secondArray)

===
New to NCL, please read the Mini-Language Manual at:

   http://www.ncl.ucar.edu/Document/Manuals/

and look at examples at:

   http://www.ncl.ucar.edu/Applications/

On 7/19/12 1:07 PM, Nicolas Baldeck wrote:
> Hi,
>
> I'm quite new to NCL, and have some difficulties with the NCL array
> notation.
>
>
> Here's what I want to do :
>
> firstArray = float[xsize][ysize];
> secondArray = float[xsize][ysize];
>
> // do my stuff...
>
> for (x=0, x<xsize, x++) {
> for (y=0, y<ysize, y++) {
> if ( firstArray[y][x] < 0 ) secondArray[y][x] = 0;
> }
> }
>
> How do you do it, with NCL ? Is there a way to use array subscripting ?
>
> --
> Nicolas BALDECK
> Prévisions Météo libres et gratuites pour le Vol Libre et le Vol à Voile.
> http://rasp-france.org/
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jul 19 13:14:57 2012

This archive was generated by hypermail 2.1.8 : Tue Jul 24 2012 - 09:48:26 MDT