[Thread Prev][Thread Next][Index]

Re: extracting non-uniform pressure levels

Hi Mike,

Your diagnosis is correct.  When you say
    yes? save/file="/tmp/t.nc"/clobber tmp[z=1000,l=1]
you are instructing Ferret to create a Z axis with only a single point on
it.  Owing to the design of netCDF there is no way to change the size of
this axis after it has been created.

If you want to create a file that has room for the whole Z axis, even though
you are saving only a single Z point you can use /KLIMITS=1:26 (or whatever)

    yes? save/file="/tmp/t.nc"/clobber/KLIMITS=1:26 tmp[z=1000,l=1]
Then the SAVE/APPEND that you subsequently give will work.

If you want to save ONLY the Z=500 and the Z=1000 levels and not waste any
space, then you can use
    let tmp500 = tmp[z=500]
    let tmp1000 = tmp[z=1000]
    save/file="/tmp/t.nc"/clobber/l=1 tmp1000, tmp500

You can also go netCDF-crazy and create a file which has a 2-point Z axis,
in order to preserve the just-right relationships without wasting space ...
but maybe that's a bit over the top.

    good luck - steve


Mike Fiorino wrote:

> Dear Ferreteers,
> I'm a ferret newbie using the opendap feature to pull individual
> pressure levels and times from an ncep nomads server of global forecast
> system (atmosphere) model runs, e.g.,
> yes?  ! NOAA/PMEL TMAP
> yes?  ! FERRET v5.60
> yes?  ! Linux(g77) 2.4.18 - 04/09/04
> yes?  ! 19-Apr-04 17:03
> yes? use
> "http://nomad2.ncep.noaa.gov:9090/dods/gfs/archive/gfs20040228/gfs_00z";
> yes? contour/lev=(240,300,5) tmp[z=1000,l=1]
> yes? contour tmp[z=500,l=1]
> yes? list/file="/tmp/t.nc"/form="cdf"/clobber tmp[z=1000,l=1]
>  LISTing to file /tmp/t.nc
> yes? list/file="/tmp/t.nc"/form="cdf"/append tmp[z=500,l=1]
>  LISTing to file /tmp/t.nc
>  **TMAP ERR: Requested data range is outside of data set limits
>              Expected: TMP[K= 14 : 14 ] Found: TMP[K= 26 : 26 ]
> yes? list/file="/tmp/t.nc"/form="cdf"/append tmp[z=1000,l=2]
>  LISTing to file /tmp/t.nc
> I can plot the 1000 (z=1000) and 500 (z=500) mb temperatures
> (variable='tmp') at the first time (l=1) and dump the 1000 mb to
> /tmp/t.nc, but not  500.  I can dump the next time (l=2) and ncdump
> shows that two times have been written.  I can open the file in in both
> ferret and GrADS and make identical plots so the data are OK.
> I know this is related to the z axis and how time is the only
> "unlimited" dimension, the question is how to define an axis of
> arbitrary pressure levels that decrease with k.  After searching the
> mail archive and the docs, I tried defining the levels in a text file,
> reading in and setting a z axis, but ferret complained about the levels
> being non monotonic which is true, but what I want.  I also tried
> dumping as "stream" but ferret doesn't allow append for binary output...
> Thanks in advance for any help. /R Mike


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

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement