[Thread Prev][Thread Next][Index]

re: Error writing CDF file



Mick, Lynn and others:

Here's what worked for me:

Session 1 (created and ran the following code for each year 1950-2001
using Perl to do the file writing and ferret running X 51 years):
SET DATA "/research/NDJFM/wod01_100m.nc"
def axis/t=15-nov-1950:15-mar-1951/npoints=5 tax
def grid/t=tax grd
let t100_ndjfm1 = t100[l=11:15]
let t100_ndjfm = t100_ndjfm1[g=grd]
save/title="T100 NDJFM for
1950-1951"/file="/research/NDJFM/NetCDF/nov50-mar51-ndjfm-t100.nc"/clobber
t100_ndjfm

Session 2:
(used another Perl script to create the following long script:

let time=t[g=t100_ndjfm]
let/title="Feb-Apr Average" t100=t100_ndjfm[l=1:5@ave]+0*time[l=1]
use nov50-mar51-ndjfm-t100.nc
SAVE/clobber/title="T100 NDFFM for
1950-2000"/file=nov-mar-ltm-1950-2000-t100.nc t100
CANCEL DATA nov50-mar51-ndjfm-t100
!*********************************
use nov51-mar52-ndjfm-t100.nc
SAVE/append/title="T100 NDFFM for
1950-2000"/file=nov-mar-ltm-1950-2000-t100.nc t100
CANCEL DATA nov51-mar52-ndjfm-t100
!*********************************
use nov52-mar53-ndjfm-t100.nc
SAVE/append/title="T100 NDFFM for
1950-2000"/file=nov-mar-ltm-1950-2000-t100.nc t100
CANCEL DATA nov52-mar53-ndjfm-t100

....and so on

Then I ran the above script to have one NetCDF file with multiple time steps
of a NDJFN composite (each time step a different year).  I appreciate it the
nudge in the right direction!

Bruce

>-----Original Message-----
>From: owner-ferret_users@ferret.pmel.noaa.gov
>[mailto:owner-ferret_users@ferret.pmel.noaa.gov]On Behalf Of Mick
>Spillane
>Sent: Tuesday, July 22, 2003 1:39 PM
>To: Bruce W. Ford
>Cc: Ferret_Users
>Subject: RE: Error writing CDF file
>
>
>Hi Bruce,
>	It would seem that you need to restore the time information that
>the time averaging transformation removes.  Here is a demo that may help:
>
>-----------------------------------------------------------------------
>Ferret Session 1:
>Make test files of monthly data for jan,...,jun for 4 years
>
>def axis/x=1:4:1 xax ; def axis/y=1:3:1 yax ; def axis/z=1:2:1 zax
>def axis/t=15-jan-1991:15-jun-1991/npoints=6 tax
>def grid/x=xax/y=yax/z=zax/t=tax grd
>
>let v=1000*l[g=grd]+100*k[g=grd]+10*j[g=grd]+i[g=grd]+910000
>save/file=test1991.nc v
>
>def axis/t=15-jan-1992:15-dec-1992/npoints=12 tax
>let v=1000*l[g=grd]+100*k[g=grd]+10*j[g=grd]+i[g=grd]+920000
>save/file=test1992.nc v
>
>def axis/t=15-jan-1993:15-dec-1993/npoints=12 tax
>let v=1000*l[g=grd]+100*k[g=grd]+10*j[g=grd]+i[g=grd]+930000
>save/file=test1993.nc v
>
>def axis/t=15-jan-1994:15-dec-1994/npoints=12 tax
>let v=1000*l[g=grd]+100*k[g=grd]+10*j[g=grd]+i[g=grd]+940000
>save/file=test1994.nc v
>quit
>------------------------------------------------------------
>Ferret Session 2:
>Read each of these file in turn, compute the Feb-Apr average,
>and store it in a new file with an appropriate date, based here
>on the date of the variable "v"
>
>! define a time variable to assist in adding time dimension
>let time=t[g=v]
>! ... and associate the Feb-Apr average with the March date
>let/title="Feb-Apr Average" fma=v[l=2:4@ave]+0*time[l=3]
>
>! access the 1991 data (monthly values jan-jun)
>use test1991.nc ; save/file=fma.nc fma
>
>! add the 1992 average
>use test1992.nc ; save/file=fma.nc/app fma
>
>! add the 1993 average
>use test1993.nc ; save/file=fma.nc/app fma
>
>! add the 1994 average
>use test1994.nc ; save/file=fma.nc/app fma
>quit
>----------------------------------------------------------------
>Ferret Session 3:
>Validate the content of the file "fma.nc"
>
>use fma.nc
>sho grid/all fma
>plot/i=1/j=1/k=1/sym=20 fma
>----------------------------------------------------------------
>
>Good luck,
>Mick
>
>|____Mick.Spillane@noaa.gov____|
>|__Room 2070 Bldg#3 NOAA/PMEL__|
>|____Phone_:_(206)526-6780_____|
>
>
>




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement