Concatenating netcdf files

From: Timothy Wynne <Timothy.Wynne_at_nyahnyahspammersnyahnyah>
Date: Wed May 12 2010 - 11:04:31 MDT

Hello,
I have 2 files that have the same variables and attributes.
I would like to concatenate them to make one file.
Is there a simple way to do this in NCL?

I have tried the attached script that i tried to write using 2 examples
from the website.
Thank you,
Tim

all_files = systemfunc("ls /projects/oil_spill/test/*cast*.nc")
fall=addfiles(all_files, "r")
ListSetType(fall, "cat")

lon = fall[:] ->lon
printVarSummary(lon)

lat = fall[:] ->lat
printVarSummary(lat)

water_u =fall[:] ->water_u
printVarSummary(water_u)

water_v =fall[:] ->water_v
printVarSummary(water_v)

time =fall[:] ->time
printVarSummary(time)

;=====================================================================

       ncdf = addfile("simple.nc" ,"c") ; open output netCDF file
    ; make time and UNLIMITED dimension ; recommended for most applications
       filedimdef(ncdf,"time",-1,True)
   ; output variables directly
      ncdf->time = time ; 4D
      ncdf->lat=lat
      ncdf->lon=lon
      ncdf->water_u=water_u
      ncdf->water_v=water_v

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed May 12 11:04:35 2010

This archive was generated by hypermail 2.1.8 : Thu May 13 2010 - 10:03:00 MDT