[Thread Prev][Thread Next][Index]

Re: writing several .nc files to 1 file






Hi Emilio and Ferreters,

I'm still having trouble with this.  I semi-follow what you're saying but
I'm having trouble defining the z axis.  I have other files that use the
same z axis that I'm trying to create so I thought I could just use the
axis from another file.  The file airanom.1957.nc has the same 17 vertical
levels that I'm trying to create (unevenly spaced) so I tried:
yes? define axis/from_data/name=test/z airanom[d=1]

which returned:
**ERROR: improper grid or axis definition: data for DEFINE AXIS/FROM_VARIABLE is ambiguous

I then tried to skip the define statement with
yes? let zstamp=z[gz=airanom[d=1]] * 0
yes? let aoz=ao[d=2]+zstamp[k=1]
yes? save/file=verttest.nc/clobber/klimits=1:17/k=1 aoz
 LISTing to file verttest.nc
 **ERROR: invalid command: Exceeds grid limits: klimits=1:17
          Variable: AOZ

which is obviously bad.

So I next defined my own axis:
yes? define axis/units=mb/depth my_zax = {10,20,30,50,70,100,150,200,250,300,400,500,600,700,850,925,1000}

and tried to do the same thing:
yes? LET zstamp = Z[GZ=my_zax] * 0
yes? LET aoz = ao[d=2] + zstamp[K=1]
yes? SAVE/FILE=verttest.nc/KLIMITS=1:17/CLOBBER/K=1 aoz
 LISTing to file verttest.nc
 **ERROR: invalid command: Exceeds grid limits: KLIMITS=1:17
          Variable: AOZ


Can anyone help me out please?  I'm at a loss.

Thanks as always,

Brent


On Sun, 6 May 2001, Emilio Mayorga wrote:

>
> Hi Brent,
>
> In your SAVE statement, I imagine ao[d=1] is the variable from one of the
> files, as is. Also, I'm guessing you're not working with Ferret's
> multi-file netcdf scheme.  I will make a suggestion that I haven't tested,
> but it's something that's worked in the time dimension.
>
> It seems you need to first define the common Z axis with DEFINE AXIS. Say
> the name is "depth". You have irregularly spaced values, and I can't
> remember right now how to create such an axis. After the axis is created,
> create a "z stamp" variable:
>
> LET zstamp = Z[GZ=depth] * 0
> Now to write the first ao z-slice, define a new ao variable to stamp ao
> with its z value:
> LET aoz = ao[d=1] + zstamp[K=1]
>
> Now you can write this first value into the file
> SAVE/FILE=verttest.nc/KLIMITS=1:17/CLOBBER/K=1 aoz
>
> For subsequent z slices, eg, K=5:
> LET aoz = ao[d=1] + zstamp[K=5]
> SAVE/FILE=verttest.nc/APPEND/K=5 aoz
>
> Of course, you should add the title and units info to aoz if you want to
> preserve it, and you should probably put this together in a script file
> and use REPEAT/K=1:17
>
> I hope this works, and good luck.
>
> Emilio Mayorga
> ________________________________________________________________
> University of Washington
> School of Oceanography			emiliom@u.washington.edu
> Box 357940				ph. (206) 221-6756
> Seattle, WA  98195-7940	  USA		FAX (206) 685-3351
> http://boto.ocean.washington.edu/staff_pages/emilio
>
> On Fri, 4 May 2001, Brent A McDaniel wrote:
>
> >
> > Hi Ferret Users,
> >
> > Hopefully this should be an easy problem for the more experienced users.
> > I've got 17 netcdf that I want to combine into 1 netcdf file.  They all
> > are of dimension 144x37x1 (no time) of the same variable (ao).  The 144x37
> > are the same but they each have a different z-axis. (1000, 925, 850,
> > 700....)  I want to combine them into a 144x37x17 file.  I tried the
> > simple brute force technique of
> > save/file=verttest.nc/klimits=1:17/clobber ao[d=1]
> > and got the message
> >  LISTing to file verttest.nc
> >  **ERROR: invalid command: Exceeds grid limits: klimits=1:17
> >           Variable: AO
> >
> > For completeness, here's the output of show data/full
> > yes? show data/full 1
> >      currently SET data sets:
> >     1> ./airanom.1000.1000.nc
> >
> >  name     title                             I         J         K
> > L
> >  AO       (TEST97*-1)/3600                 1:144     1:38      1:1
> > ...
> >                on grid GGP1 with -1.E+34 for missing data
> >              X=1.2W(-1.2):1.2W  Y=3.8S:91.2N  Z=999.5:1001
> >
> > Can someone help me out please?
> >
> > Thanks in advance,
> >
> > Brent
> >
> >
>

-- 
Brent A. McDaniel

Dept of Earth and Atmospheric Sciences
Georgia Institute of Technology
Atlanta, Ga.  USA




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement