[Thread Prev][Thread Next][Index]

Re: saving a variable to existing nc file



Hi Emilio,

[Its been a long time!]

I suspect (??) that you are attemping to save a subset region, only of the new
variable??

Try these lines to see if you get the same behavior, which does not reproduce
the problem that you've reported.

     /export/home/ja3/hankin/tmp> ferret
     yes? use coads_climatology
     yes? save/x=130e:80w/y=20s:20n/file=test.nc/clobber sst,airt ! a
     test file - 75x20x12
      LISTing to file test.nc
     yes? quit

     /export/home/ja3/hankin/tmp> ferret
     yes? use test.nc
     yes? let new = sst+airt
     yes? save/append/file=test.nc new   ! add a new variable to it
      LISTing to file test.nc
     yes? quit

     ==> NOTE THAT THEY ALL SHARE THE SAME COORDINATE AXES
     /export/home/ja3/hankin/tmp> ncdump -h test.nc
     netcdf test {
     dimensions:
             COADSX56_130 = 75 ;
             COADSY36_55 = 20 ;
             TIME = UNLIMITED ; // (12 currently)
     variables:
     .
     .
     .

If you want to share the full coordinate axes, despite the fact that you are
saving only a subset you can use the /ilimits and /jlimits (etc.) to force the
full region to be written:

     /export/home/ja3/hankin/tmp> ferret
     yes? use coads_climatology
     yes? save/x=130e:80w/y=20s:20n/file=test.nc/clobber sst,airt ! a
     test file
      LISTing to file test.nc
     yes? q

     /export/home/ja3/hankin/tmp> ferret
     yes? use test.nc
     yes? let new = sst+airt
     yes? save/append/file=test.nc/ilimits=1:75/jlimits=1:20
     new[x=170e:170w]
      LISTing to file test.nc
     yes? q

     /export/home/ja3/hankin/tmp> ferret
     yes? use test.nc
     yes? shade/l=1 new    ! note the 170e:170w band embedded within
     missing values

    - steve

=========================

Emilio Mayorga wrote:

> I want to save a variable into an existing netcdf file. This variable is
> defined in ferret using, say, LET var = var1 + var2, where var1 and var2
> are variables from the netcdf file; the dimensionality of the new variable
> is the same as the other ones (XYT, where T in the nc file is the record
> dimension). But when I save it, Ferret creates 3 new coordinate variables
> to support var. Is it possible to force Ferret to use the existing
> coordinate variables when saving a new variable?
>
> Thanks.
>
> 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

--

                |  NOAA/PMEL               |  ph. (206) 526-6080
Steve Hankin    |  7600 Sand Point Way NE  |  FAX (206) 526-6744
                |  Seattle, WA 98115-0070  |  hankin@pmel.noaa.gov




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement