step 1:
First of we need to install GRADS
http://grads.iges.org/grads/downloads.html
From the above link we can get the source.
In Ubuntu $ sudo apt-get install grads
step 2:
From the below site we can download the grib2ctl.pl perl source code
http://www.cpc.ncep.noaa.gov/products/wesley/grib2ctl.html
Look in the bottom of the page.
Try to open all the above links in firefox not in chrome.
Download that grib2ctl.pl source code from here ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib.scripts/grib2ctl.pl use firefox.
save that file as grib2ctl.pl .
step 3:
Go to the below link to download the wgrib c code
http://www.cpc.ncep.noaa.gov/products/wesley/wgrib.html
From here you can download the wgrib.c source code ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/wgrib.c use firefox.
save it as wgrib.c.
$ gcc wgrib.c -o wgrib
We are generating the wgrib object file.
$ sudo cp wgrib /usr/local/bin/
We are moving that binary wgrib file in to the system path /usr/loca/bin
step 4:
Now open the grib2ctl.pl file,
- Look for the line:
$wgrib=’wgrib’;
and change it to point to your copy of wgrib. For example,
$wgrib=’/usr/local/bin/wgrib’; - (Optional) Look for the line:
$pdef_dir=’/usr/local/lib/grads’;and change it to point to your grads directory. In the future, some unviewable grids (ex. thinned grids, native eta) will be handled by interpolation files. - Don’t forget to make the program executable (chmod 755 grib2ctl.pl) and put it on your PATH. i.e $ sudo cp grib2ctl.pl /usr/local/bin/
Thats it … !
Now you can access the grib2ctl.pl from the bash shell (terminal) itself.
Try the following usage of grib2ctl with your analysis and forecasting binary grib files.
Usage
For analyses:
$ grib2ctl.pl grib_file >grib_file.ctl
$ gribmap -i grib_file.ctl -0 <– this is a zero
$ grads
Landscape mode? (no for portrait):ga-> open grib_file.ctl
For forecasts:
$ grib2ctl.pl -verf grib_file >grib_file.ctl
$ gribmap -i grib_file.ctl$ grads
Landscape mode? (no for portrait):
ga-> open grib_file.ctl