[Thread Prev][Thread Next][Index]

Re: writing several .nc files to 1 file




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
> 
> 



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement