Intel编译器下WRF安装指南
intel编译器很给力!一个多小时就搞定编译WRF和WPS
1、 虚拟机上安装Fedora14i386
比较简单,这里略去。[建议:虚拟内存2G]
2、 安装需要的包
² 安装gFortran
#yum install compat-gcc-34-g77
#ln -s /usr/lib/libg2c.so.0 /usr/lib/libg2c.so
#ln -s /usr/lib/libgfortran.so.3 /usr/lib/libgfortran.a
² 安装:libstdc++,包含libstdc++.so.5库,是intel编译器必须的。
#yum install libstdc++.so.5
² 安装 jasper-1.900.1
a) #unzip jasper-1.900.1.zip
b) #./configure --prefix=/usr/local/jasper
c) #make
d) #make install
² 安装netcdf-4.0.tar.gz[注意:编译netcdf,网络必须是通的,否则make all[64位check]测试不通过]
a) #tar –zxvf netcdf-4.0.tar.gz
b) #./configure --prefix=/usr/local/netcdf4
c) #make all
d) #make check ;64位不需要
e) #make install
² 安装 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
² 安装 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
² 安装ncl
#mkdir /usr/local/ ncarg
#cp ./ ncl_ncarg-5.2.1.Linux_i686_nodap_gcc432.tar.gz /usr/home/local/ncarg
#cd /usr/home/local/ncarg
#tar -zxvf ncl_ncarg-5.2.1.Linux_i686_nodap_gcc432.tar
说明:缺什么库,就用yum安装什么库。但是不建议用yum命令安装netcdf和ncl。
3、 安装Intel编译器[电驴上有,可下载,学习完毕,记着删除]:
² 安装Intel C编译器:
[Intel.C...编译器].TLF-SOFT-Intel.C.Plus.Plus.Compiler.Professional.v11.1.046.LINUX-SPYRAL.iso
安装步骤参照SPYRAL目录下install-cpp-linux.txt:
Launch the setup.
When asked, select the "Alternative activation" option.
Use the included license file.
² 安装Intel Fortran编译器:
[Intel.Fortran.编译器Linux专业版].TLF-SOFT-Intel.Fortran.Compiler.Professional.v11.1.046.LINUX-SPYRAL.iso
安装步骤参照SPYRAL目录下install-cpp-linux.txt:
Launch the setup.
When asked, select the "Alternative activation" option.
Use the included license file.
4、 环境变量
/etc/profile文件添加
export INTEL_COMPILER_TOPDIR="/opt/intel/Compiler/11.1/046" export NETCDF=/usr/local/netcdf4 export NCARG=/usr/local/ncarg export NCARG_ROOT=/usr/local/ncarg export PATH=/opt/intel/Compiler/11.1/046/bin:/opt/intel/Compiler/11.1/046/bin/ia32:/opt/intel/Compiler/11.1/046/include:/opt/intel/Compiler/11.1/046/lib/ia32:$NETCDF/lib:$NETCDF/include:$NCARG/bin:$NCARG/lib:$NCARG/include:/usr/local/libpng /include:/usr/local/libpng /bin:$PATH export WRFIO_NCD_LARGE_FILE_SUPPORT=1 export JASPERLIB=/usr/local/jasper/lib export JASPERINC=/usr/local/jasper/include export INCLUDE=/usr/include:$INCLUDE |
5、 安装 WRFV3
² 解压缩:
#gzip -cd WRFV3.1.1.TAR.gz | tar -xf –
² 运行命令:
#/opt/intel/Compiler/11.1/046/bin/ia32/ifortvars_ia32.sh
#/opt/intel/Compiler/11.1/046/bin/ia32/iccvars_ia32.sh
#cd WRFV3
² 运行环境设置
#export NETCDF=/usr/local/netcdf4
#export JASPERLIB=/usr/local/jasper/lib
#export JASPERINC=/usr/local/jasper/include
#export LD_LIBRARY_PATH="/usr/lib/:${LD_LIBRARY_PATH}"
#export INCLUDE="/usr/include/:${INCLUDE}"
#export WRFIO_NCD_LARGE_FILE_SUPPORT=1
#export DM_FC=mpiifort
#export DM_CC=mpiicc
² 配置:
#./configure --prefix=/opt/WRFV3-mpi
[注意:运行./ compile报错,则执行:#yum install tcsh]
编译选项,请酌情选择,如:选择11,选择默认回车。
² 编译
#mkdir ./buildlog ;编译日志目录
#./compile em_b_wave &> ./buildlog/em_b_wave
#./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
² 检查:
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
WRF编译完毕!
6、 安装WPSV3.1.1.TAR.gz
² 解压缩:
#gzip -cd WPSV3.1.1.TAR.gz | tar -xf –
² 配置
#cd WPS
#./configure
选择Intel编译器的选项,如:选11,然后选默认。
² 修改配置文件后才可以编译
#gedit ./configure.wps文件修改如下行:
COMPRESSION_LIBS = -L/usr/local/jasper/lib -ljasper / -L/usr/local/libpng/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
NCARG_LIBS = -L/usr/local/ncarg/lib -lncarg -lncarg_gks -lncarg_c / -L/usr/lib -lX11 / -L/usr/lib -lgfortran |
² 执行编译
#./compile &>/home/wrf/logger.txt
² 检查:
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
7、 安装其它包的说明:
² 安装wrfplus
需要修改configure.wrf文件,
FCOPTIM = -O3 -switch fe_use_rtl_arg_copy_inout -mP2OPT_vec_xform_level=103
以免出现:internal threshold was exceeded错误。
² 安装OBSGRID.tar.gz
修改configure.oa文件
NETCDF_LIBS = -L${NETCDF}/lib -lnetcdf -L/usr/lib –lgfortran
² 安装RIP4.tar.gz
修改configure.rip文件
NCARGLIBS = -L/usr/local/ncarg/lib -lncarg -lcgm -lncarg_gks -lncarg_c /
-L/usr/lib -lX11 -lm /
-L/usr/lib -lgfortran