Re: netCDF file

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue, 21 Feb 2006 15:31:42 -0700 (MST)

>hi everybody
>Is it possible to convert netCDF file format to grib or ascii file format.
>if it is, how can I convert

grib ... no

ascii ... yes [but why ... ascii results in large files]

You must provide more information before advice can be provided.

=============================================
ncdf = addfile ("foo.nc","r") ; netCDF file to be read

names = getfilevarnames(ncdf) ; names of variables contained in file
print (names) ; pointed to by "ncdf"

do i = 0, dimsizes(names)-1
   filo = "./foo_"+ names(i)+ ".asc"
   system ("/bin/rm " + filo) ; remove any pre-existing file
   print("writing ascii->" + names(i))
   
   asciiwrite (filo, ncdf->$names(i)$ )
;..... or (better).....
   opt = True
   opt_at_fout = filo
   matrix_write (ncdf->$names(i)$, "10f10.2", opt)
end do

==========================================

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Feb 21 2006 - 15:31:42 MST

This archive was generated by hypermail 2.2.0 : Thu Feb 23 2006 - 09:24:07 MST