Hi Naoki,
Are you aware of "ncl_convert2nc" which allows you to convert GRIB and other supported file formats (HDFEOS, HDF4, etc) to NetCDF on the UNIX command line?
ncl_convert2nc /file/location/data.grb
For more information see:
http://www.ncl.ucar.edu/Document/Tools/ncl_convert2nc.shtml
I don't know why your script below is printing the variables, since you don't have any obvious "print" statements.
What does the output look like?
--Mary
On Mar 6, 2012, at 5:11 PM, Naoki Mizukami wrote:
> 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
> (infilename,"r")
> names =
> getfilevarnames
> (grib_in); extract all variable names
> ;***********************************************
> ; create output netcdf file
> ;***********************************************
>
> system
> ("rm out.nc") ; remove any pre-existing file
> ncdf_out =
> addfile
> ("out.nc" ,"c") ; create output netCDF file
> ;***********************************************
> ; loop through variables and output each to netcdf
> ;***********************************************
> do i = 0,
> dimsizes
> (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
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Mar 7 05:36:03 2012
This archive was generated by hypermail 2.1.8 : Tue Mar 13 2012 - 14:00:14 MDT