- 积分
- 759
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-8-26
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
最近需要在linux系统下运行g2ctl.pl,grib2ctl.pl,找遍论坛里面的安装方法,因为有的帖子比较老了,一直安装失败。在各位的评论回答下找到一个比较详细的安装方法,共同学习下~ http://blog.sina.com.cn/s/blog_b54f78e80101s39m.html
How to install g2ctl.pl and wgrib2 in linux(转载)Dear All,
Now we are going to see how to install wgrib2 and g2ctl in ourlinux machine, for the Grib version 2 data.
step 1:
First of we need to install GRADS
http://cola.gmu.edu/grads/downloads.php
From the above link we can get the source.
In ubuntu we need to install some dependencies,
$ sudo apt-get install libgrib2c-dev libgrib2c0d (to install wgrib2correctly)
$ sudo apt-get install grads (for gribmap)
Note : grads version must be equal or higher than the 2.0.a8 (towork correctly for grib2).
If you are using ubuntu 10.04, then grads may be lower than theabove version.
So download the source of grads version 2.0.a8 or higher.
$ sudo apt-get install libxmu-dev libxmu-headers x11-commonx11-xserver-utils
Extract that downloaded grads source and change directory into thatextracted folder.
$ ./configure
$ make && make install
Now it should be installed in that folder called ‘src’.
You can use this grads, gribmap (inside the src folder of theextracted folder of grads2.0.a8) to use the grib2 version.
$ sudo cp -r src /usr/local/grads2.0.a8
Edit your home .bashrc file, add the following lines.
alias grads=’/usr/local/grads2.0.a8/grads’
alias gribmap=/usr/local/grads2.0.a8/gribmap’
step 2:
From the below site we can download the g2ctl.pl perl sourcecode
http://www.cpc.ncep.noaa.gov/products/wesley/g2ctl.html
Look in the bottom of the page.
Try to open all the above links in firefox not in chrome.
Download that g2ctl.pl source code from hereftp://ftp.cpc.ncep.noaa.gov/wd51we/g2ctl/g2ctl save as g2ctl.pl .If that perl source code has viewed by web page itself means, copythat perl code into one text file, and save that as g2ctl.pl filein your home folder itself.
step 3:
Go to the below link to download the wgrib2 tar file
http://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/
From here you can download the wgrib2.tgz source file in the abovelink.
Go to this section in the above link “Source Code and ComplingHints” .
Download the “wgrib2.tgz” by http way.
After downloaded the wgrib2.tgz file, extract it either by GUI“Extract here” or
$ tar -zxvf wgrib.gz
It should create directory called “grib2″.
Now move this folder into /usr/bin by
$ sudo mv grib2 /usr/bin/
Now go to that directory by
$ cd /usr/bin/grib2
$ sudo make
It takes few minutes to install wgrib2 inside that folderitself.
Note : now our wgrib2 executable path is ”/usr/bin/grib2/wgrib2/wgrib2 “.
step 4:
Now open the g2ctl.pl file,
Look for the line:
$wgrib2=’wgrib2′;
and change it to point to your wgrib2 path. In our case,
$wgrib2=’/usr/bin/grib2/wgrib2/wgrib2′;
Don’t forget to make the program as executable (chmod 755 g2ctl.pl)and put it on your PATH. i.e $ sudo chmod 755 g2ctl.pl and $ sudocp g2ctl.pl /usr/bin/
Thats it … !
Now you can access the g2ctl.pl from the bash shell (terminal)itself.
Try the following usage of g2ctl with your analysis and forecastingbinary grib files.
Usage
For analyses:
$ g2ctl.pl -0 grib2_file >grib2_file.ctl [ here we passed zerooption]
$ gribmap -0 -i grib2_file.ctl [ here we passed zero option]
$ grads
Landscape mode? (no for portrait):
ga-> open grib2_file.ctl
For forecasts:
$ g2ctl.pl grib2_file >grib2_file.ctl
$ gribmap -i grib2_file.ctl
$ grads
Landscape mode? (no for portrait):
ga-> open grib2_file.ctl
The main differences between the syntax of grib2ctl.pl and g2ctl.plare,
For grib version 2 files, we are using g2.ctl.pl script to createctl files. The usage option -0 (zero) are passed for both g2ctl.pland gribmap commands for analysis files and not for forecast filesin the grib version 2.
For grib version 1 files, we are using grib2ctl.pl script to createctl files. The usage option -0 (zero) is passed in gribmap commandfor analysis files and option -verf is passed in grib2ctl.plcommand for forecast files. To know more about grib2ctl.pl script,how to install that and how to use that, click here .
To understand, what is grib and ctl file formate
grib is the one of binary file formate to store the analysis andforecast data in some kind of structured manner.
ctl means control file in ascii formate. we can read it. Both theseformates are usually used in atmospheric and meteorologicaldepartments.
The generated ctl files can be read and visualized by GRADS , CDATand other meteorological softwares.
Both Grads and CDAT are open source software.
More over many other foss applications are available for the samekind of stuff.
Thanks,
Arulalan.T
|
|