Re: new array

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Nov 28 2011 - 14:19:24 MST

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

===
Below: not sure what 'lev' is! Is it an array:
For example:
       lev = f->lev

If so, it should be

    klev = dimsizes(lev)
    dz = new ( dimsizes(z3) , typeof(z3))
    do l = 1,klev-1
     dz(l,:,:) = z3(l,:,:) - z3(l-1,:,:)
    end do

or

    do l = 0,klev-2
     dz(l,:,:) = z3(l,:,:) - z3(l+1,:,:)
    end do

On 11/26/2011 01:17 PM, Xiaoyan Ma wrote:
> Hi,
>
> I read in an array ( z30(time, lev, lat, lon) ) from nc file, and then I
> want to define a new array ( dz(lev, lat, lon) ), which is calculated
> from z3.
> below is what I did
>
> z30 = in[:]->Z3
> z3 = dim_avg_n_Wrap(z30, 0)
> ;;;;
> jz = dimsizes( z3 )
> dz = new ( jz, typeof(z3))
>
> do l = 1,lev-1
> dz(l,:,:) = z3(l,:,:) - z3(l+1,:,:)
> end do
>
> The erroe is : "fatal:Loop end must be scalar, can't execute loop, error
> occurred at or near line "end do".
>
> Anyone help me to fix the problem? Thanks,
>
> Xiaoyan
>
>
> _______________________________________________
> 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 Mon Nov 28 14:19:30 2011

This archive was generated by hypermail 2.1.8 : Wed Nov 30 2011 - 19:52:47 MST