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