Re: 3D variable from multiple addfile reads of 2D data?

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Jan 10 2012 - 21:02:05 MST

   diri = "./" ; input directory
   fili = systemfunc("cd "+diri+" ; ls foo*grb")
   print(fili)
                       ; force 'time' dimension
   setfileoption("grb","SingleElementDimensions","Initial_time")

   f = addfiles(diri+fili, "r")
   x = f[:]->FOO ; concatente all times
   printVarSummary(x)

======
If you are new to NCL, please read the mini-Language manual
    http://www.ncl.ucar.edu/Document/Manuals/

Good Luck

On 1/10/12 7:58 PM, Chris Herbster wrote:
> I've been playing around a bit trying to see if I can figure this out.
>
> I was able to create an array with the correct dimensions with:
>
> Newx = new ((/225,301,nlist1/),float)
>
> printVarSummary (Newx)
>
>
> which yields:
> Variable: Newx
> Type: float
> Total Size: 1625400 bytes
> 406350 values
> Number of Dimensions: 3
> Dimensions and sizes: [225] x [301] x [6]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : 9.96921e+36
>
>
> An initial victory! For this test there are just 6 input files (6 hours).
>
> Next I try to process a list of files, filling the variable "x" (in
> the code below)
>
> ; Open each file and read the data
>
> do i = 0, nlist1 - 1
>
> grib_in1= addfile(list1(i),"r")
>
> x = grib_in1->AIA_P0_L10_GLC0
>
> Newx = (/x(:,:),i/)
>
> end do
>
>
> I know this isn't the correct syntax to do what I want, as I get the
> following error that the arrays are not the same dimensions. (I've
> tried a variety of permutations of "(" and "/" arrangements but have
> just gotten other errors.)
>
> fatal:_NclBuildArray: each element of a literal array must have the same
> number of dimensions
> fatal:Execute: Error occurred at or near line 50 in file make3d-correl.ncl
>
> Can someone out there help with the syntax (or proper method) to do
> this? Thanks!
>
> Chris H.
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jan 10 21:02:15 2012

This archive was generated by hypermail 2.1.8 : Wed Jan 18 2012 - 09:21:55 MST