WRF安装过程
1. 在虚拟机VMware上安装Fedora 12 x64操作系统。
2. 安装PGI9.01
a) 电驴上可下载[[顶级编译器].PGI.Workstation.Complete.v9.0.1.LINUX.x64-TBE.7z
b) 在Windows下解压缩。把pgilinux-901.tar.gz复制到虚拟机里。
c) 用su命令切换至root用户。
d) 执行PGI安装:
n # tar –zxvf pgilinux-901.tar.gz
n #./install
n PGI默认安装路径是/opt/pgi /
n 复制pgi_9.0-1_linux64.tar.bz2至/opt/pgi /
n # tar –zxvf pgi_9.0-1_linux64.tar.bz2
n #./ pgi_9.0-1_linux64_patcher ; 运行补丁
n 把license.dat文件复制到/opt/pgi /下。
n #gedit /etc/profile ;添加环境变量
n 在profile文件里添加如下行:
export PGI=/opt/pgi
export PATH=$PGI/linux86-64/9.0-1/bin:$PATH
e) 安装PGI完成。
f) 测试PGI安装是否成功。
n #cd $PGI
n #cd linux86-64/9.0-1/EXAMPLES
n 通过编译这里的例子程序,验证PGI是否安装成功。
2.安装 jasper-1.900.1
a) #unzip jasper-1.900.1.zip
b) #./configure --prefix=/usr/local/jasper
c) #make
d) #make install
3.安装netcdf-4.0.tar.gz[注意:编译netcdf,网络必须是通的,否则make all测试不通过]
a) #tar –zxvf netcdf-4.0.tar.gz
b) #./configure --prefix=/usr/local/netcdf4
c) #make all
d) #make install
4.安装 libpng-1.5.0.tar.gz
a) #tar –zxvf libpng-1.5.0.tar.gz
b) #./configure --prefix=/usr/local/libpng
c) #make
d) #make install
5.安装 zlib-1.2.5.tar.gz
a) #tar –zxvf zlib-1.2.5.tar.gz
b) #./configure --prefix=/usr/local/zlib
c) #make
d) #make install
6.添加/修改环境变量
a) 打开 /etc/profile文件,添加如下内容:
export NETCDF=/usr/local/netcdf4
export NCARG=/usr/local/ncarg
export NCARG_ROOT=/usr/local/ncarg
export PGI=/opt/pgi
export PATH=$PGI/linux86-64/9.0-1/bin:$PGI/linux86-64/9.0-1/include:$PGI/linux86-64/9.0-1/lib:$NETCDF/lib:$NETCDF/include:$NCARG/bin:$NCARG/lib:$NCARG/include:/usr/local/png/include:/usr/local/png/bin:$PATH
export MANPATH=$MANPATH:$PGI/man
export WRFIO_NCD_LARGE_FILE_SUPPORT=1
export JASPERLIB=/usr/local/jasper/lib
export JASPERINC=/usr/local/jasper/include
export INCLUDE=/usr/include:$INCLUDE
保存
b) 运行#source /etc/profile,使环境变量生效.
7.安装 WRFV3.1.1.TAR.gz
a) gzip -cd WRFV3.1.1.TAR.gz | tar -xf –
b) #cd WRFV3
c) #./configure
d) 选择:PGI编译器的选项,因为配置命令将生成使用PGI编译器的脚本。
{PGI选13或14,下一步选1}
e) 创建日志目录 #mkdir ./buildlog
f) 逐个编译:
#./compile em_grav2d_x &> ./buildlog/em_grav2d_x
#./compile em_heldsuarez &> ./buildlog/em_heldsuarez
#./compile em_hill2d_x &> ./buildlog/em_hill2d_x
#./compile em_les &> ./buildlog/em_les
#./compile em_quarter_ss &> ./buildlog/em_quarter_ss
#./compile em_real &> ./buildlog/em_real
#./compile em_seabreeze2d_x &> ./buildlog/em_seabreeze2d_x
#./compile em_squall2d_x &> ./buildlog/em_squall2d_x
#./compile em_squall2d_y &> ./buildlog/em_squall2d_y
g) 检查:
#ls -ls main/*.exe
if you built a real-data case, you should see ndown.exe, real.exe, and wrf.exe
if you built an ideal-data case, you should see ideal.exe and wrf.exe
Building the WRF-Var Code
See details in Chapter 6.
8.安装ncl
a) 下载:ncl_ncarg-5.2.1.Linux_x86_64_nodap_gcc432.tar.gz
b) 复制 ncl_ncarg-5.2.1.Linux_x86_64_nodap_gcc432.tar.gz至 /usr/home/local/ncarg下
c) #tar -zxvf ncl_ncarg-5.2.1.Linux_i686_nodap_gcc432.tar ;完成安装
9.安装gFortran
a) 下载:compat-gcc-34-g77-3.4.6-18.x86_64.rpm 或执行#yum install compat-gcc-34-g77 安装。
b) 建立连接:
#ln -s /usr/lib64/libg2c.so.0 /usr/lib64/libg2c.so
#ln -s /usr/lib64/libblas.so.3 /usr/lib64/libblas.so
#ln -s /usr/lib64/libgfortran.so.3 /usr/lib64/libgfortran.a
10.安装libpng-1.5.0.tar.gz
#tar zxvf libpng-1.5.0.tar.gz
#cd libpng-1.5.0
#./configure --prefix=/usr/local/png
#make
#make install
11.安装zlib-1.2.5.tar.gz
#tar zxvf zlib-1.2.5.tar.gz
#cd zlib-1.2.5
#./configure --prefix=/usr/local/zlib
#make
#make install
12.安装WPSV3.1.1.TAR.gz
a) #gzip -cd WPSV3.1.1.TAR.gz | tar -xf –
b) #cd WPSV3
c) #./configure
d) 选PGI编译器选项如:5或6
e) #gedit ./configure.wps ;修改configure.wps文件:
f) 修改如下条目:
NCARG_LIBS = -L/usr/local/ncarg/lib -lncarg -lncarg_gks -lncarg_c
-L/usr/lib64 -lX11
-L/usr/lib64 -lgfortran
COMPRESSION_LIBS = -L/usr/local/jasper/lib -ljasper
-L/usr/local/png/lib -lpng
-L/usr/local/zlib/lib -lz
COMPRESSION_INC = -I/usr/local/zlib/include
-I/usr/local/jasper/include
-I/usr/local/png/include
保存,关闭gedit.
g) 编译
#./compile &>/home/WPS/log.txt
备注:这里也可以单个文件编译:
如:#./compile plotfmt ; 只生成plotfmt.exe
h) 检查:
#ls -ls *.exe
you should see geogrid.exe, ungrib.exe, and metgrid.exe
#ls -ls util/*.exe
you should see a number of utility executables:
avg_tsfc.exe, g1print.exe,
g2print.exe, mod_levs.exe,
plotfmt.exe, plotgrids.exe,
and rd_intermediate.exe
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/bernardbai/archive/2011/03/04/6224752.aspx