[Thread Prev][Thread Next][Index]
Re: Appending data to NetCDF file
Dear Ferreters-
Thanks to Steve and Ansley, the error I was commiting in appending
user-defined variables to a NetCDf file was rectified. Below is a copy of the
initial message that I sent out. The error was that I wasn't erasing all
user-defined variables from Ferret's memory before trying to visualise the
newly created dataset, and was therefore "confusing" ferret. In short, it was
necessary to either QUIT or CANCEL VARIABLE/ALL before attempting to access
the newly created dataset.
Good day to all.
-Frederic Chagnon
----------------------------------------------------------------------------
Hi Ferreters,
I've been ahving a problem with appending data to a NetCDF dataset. When I
"save" the values for the first time-step, they appear alright. However, when
i append a second time-slice of data, all the values (including those of the
first time-step) go to zero. I'm including my script in this email. If any of
you can spot what I must be doing wrong, I would be very grateful.
define axis/X=64.5W:45W:0.5/UNIT=degrees lon
define axis/Y=14.5S:5N:0.5/UNIT=degrees lat
define grid/X=lon/Y=lat grd
let month = MOD(l-1,12)+1
let add_year = INT((l-1)/12)
let tstep = DAYS1900(1980+add_year,month,1)
define axis/from_data/T/units=days/name=tmonth/t0=1-dec-1907/edges
tstep[l=1:`20*12+1`]
DEFINE GRID/T=tmonth gmonth
LET timestamp = T[G=gmonth] * 0 !always 0
file/var="land"/GRID=grd landfer
file/var="dec97"/GRID=grd rain97fer
file/var="jan98"/GRID=grd rain98fer
define variable landuse=land[d=landfer]
save/title="TRMM-3A25 Rainfall Intensities"/heading=enhanced/file=TRMM-3A25.nc
Landuse
cancel variable landuse
define variable/title="Monthly Rainfall"/units="mm/hr"
Precipitation=dec97[d=rain97fer] + timestamp
save/title="TRMM-3A25 Rainfall Intensities"/heading=enhanced/file=TRMM-3A25.nc/
append Precipitation[l=1]
define variable/title="Monthly Rainfall"/units="mm/hr"
Precipitation=jan98[d=rain98fer] + timestamp
save/title="TRMM-3A25 Rainfall Intensities"/heading=enhanced/file=TRMM-3A25.nc/
append Precipitation[l=2]
Frederic Chagnon (617)253-5483
Ralph M. Parsons Laboratory 48-212
Massachusetts Institute of Technology
Cambridge MA 02139
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement