[Thread Prev][Thread Next][Index]

RE: Concatenating netcdf files




Ni hao Li, Yun:

Here is a script I wrote to join ncep files. You'll have to modify it, in hopefully obvious ways, to your application.

Best wishes,
Rob

! must specify:

DEFINE SYMBOL out_file = nlw_1990_2004.cdf


!------------------------------------------------------------------------------
! access many files:
!------------------------------------------------------------------------------
let names = {spawn:"ls nlwrs.sfc.gauss.????.nc"}



SET MEMORY/SIZE=528

SET DATA/regulart `names[i=1]`


LET/TITLE="Net Short Wave Radiation"/UNITS="W/m^2" \
nlw = nlwrs

SAVE/CLOBBER/FILE=($out_file) nlw

!------------------------------------------------------------------------------
! now append the rest
!------------------------------------------------------------------------------

REPEAT/k=2:15 (LET a = names[i=`k`]; \
SET DATA/regulart "`a` "; \
SAVE/APPEND/FILE=($out_file) nlw; \
CANCEL DATA /ALL)

!------------------------------------------------------------------------------
! did it work?
!------------------------------------------------------------------------------
USE ($out_file)
SHOW DATA





At 04:22 AM 1/20/2005, you wrote:
Dear Ferret users,

I download several netcdf files from NCEP/NCAR reanalysis daily surface
pressure data, i.e.,
pres.sfc.1948.nc, pres.sfc.1948.nc, ..., pres.sfc.2005.nc. I would be
most grateful if you can let me know how to concatenate them into a
single "pres.sfc.1948.2005.nc".

Best regards,

Yun Li

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dr. Yun Li
Senior Research Scientist
CSIRO Mathematical and Information Sciences
Leeuwin Centre, 65 Brockway Road, Floreat, WA 6014, Australia
Postal Address:  CSIRO Mathematical and Information Sciences
                         Private Bag 5, Wembley, WA 6913, Australia
Phone: +61 8 9333 6388 Fax: +61 8 9333 6121
URL: http://www.cmis.csiro.au/Yun.Li/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rob Scott
Research Associate
Institute for Geophysics
University of Texas at Austin
4412 Spicewood Springs Rd.
Building 600
Austin, TX
78759

Office: +1-512-471-0375

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement