Hi
I am new to NCL so I hope someone can answer to this question easily or
direct me to appropriate online documentation.
I am converting grib data to netCDF using following script (from
http://www.ncl.ucar.edu/Applications/griball.shtml). I would like to
know how to suppress verbose (it prints out all the variables in grib
files).
begin
;***********************************************
; get variable names from grib file
;***********************************************
grib_in =*addfile* <http://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml>(infilename,"r")
names =*getfilevarnames* <http://www.ncl.ucar.edu/Document/Functions/Built-in/getfilevarnames.shtml>(grib_in); extract all variable names
;***********************************************
; create output netcdf file
;***********************************************
*system* <http://www.ncl.ucar.edu/Document/Functions/Built-in/system.shtml>("rm out.nc") ; remove any pre-existing file
ncdf_out =*addfile* <http://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml>("out.nc" ,"c") ; create output netCDF file
;***********************************************
; loop through variables and output each to netcdf
;***********************************************
do i = 0,*dimsizes* <http://www.ncl.ucar.edu/Document/Functions/Built-in/dimsizes.shtml>(names)-1
ncdf_out->$names(i)$ = grib_in->$names(i)$
end do
end
and type in terminal like
>> ncl 'infilename="/file/location/data.grb"' grb2nc.ncl
Thanks,
Naoki
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Mar 6 14:11:37 2012
This archive was generated by hypermail 2.1.8 : Tue Mar 13 2012 - 14:00:14 MDT