中山大学大气科学系
刘一鸣 (liuyming@mail2.sysu.edu.cn)
樊琦 (eesfq@mail.sysu.edu.cn)
本说明适用于在ubuntu(位)linux系统中安装WRFv3.4.1并行版本,内容包括WRF的安装、运行以及可视化。选取了珠江三角洲从2004年4月5日00时到4月6日00时共24小时的模拟个例。蓝色部分为下载地址或参考网址,红色部分为在终端输入的命令(“$”为普通用户bash命令提示符,“#”为超级用户bash命令提示符,命令提示符只作提示作用,并不需要输入),深蓝色斜体部分为在文件中修改的代码,紫色部分为在终端上显示的计算机提示。“HOME”是环境变量,表示用户对应的主目录,超级用户和普通用户的主目录并不一样。在环境变量前加“$”表示调用该环境变量,如“$HOME”。本说明重在操作,如需了解理论的部分则需要参考WRF的用户手册,下载网址为:
http://www.mmm.ucar.edu/wrf/users/supports/tutorial.html
在安装之前,首先要在主目录下解压wrfdata.tar.gz:
$ cd $HOME
$ tar -zxvf wrfdata.tar.gz
结果在主目录下生成wrfdata文件夹,里面包含了安装所需要的压缩包。
1. 下载并解压WRF安装包
1.1 WRF压缩包下载
需要下载的压缩包包括WRFV3.4.1.TAR.gz,WPSV3.4.1.TAR.gz,jasper-1.701.0.tar.gz,libpng-1.2.12.tar.gz,zlib-1.2.3.tar.gz,ARWpost_V3.tar.gz和geog.tar.gz(地形数据)。下载网址为:
http://www.mmm.ucar.edu/wrf/users/download/get_sources.html
1.2 解压压缩包
$ cd $HOME
$ mkdir WRFv3.4.1 (WRF3.4.1主目录)
$ cd WRFv3.4.1
$ tar -zxvf $HOME/wrfdata/WRF/WRFV3.4.1.TAR.gz
解压后在WRFv3.4.1目录下生成文件夹WRFV3
$ tar -zxvf $HOME/wrfdata/WRF/WPSV3.4.1.TAR.gz
解压后在WRFv3.4.1目录下生成文件夹WPS
2. 安装gfortran、g++、等必要的软件或工具
$ cd $HOME/wrfdata/packages
$ sudo dpkg -i *
输入密码后等待一段时间即可安装成功
3. 安装intel编译器
安装分为icc安装包和fortran安装包,可到intel官方网站免费下载,下载网址为:
http://software.intel.com/en-us/non-commercial-software-development
激活需要序列号,icc安装包是l_ccompxe_2011.11.339.tgz,ifort安装包是l_fcompxe_2011.11.339.tgz,默认安装路径为/opt/intel。(序列号对应为本说明提供的安装包)
3.1登录超级用户
intel编译器的安装需要在超级用户权限下完成,在安装前登录超级用户:
$ sudo su
输入密码后按Enter即可登录超级用户,命令提示符变为“#”,此时超级用户仍为bash命令环境
3.2 安装icc
# mkdir /usr/INTEL
# cd /usr/INTEL
# tar -zxvf /home/user/wrfdata/INTEL/l_ccompxe_2011.11.339.tgz user为普通用户用户名
# cd l_ccompxe_2011.11.339
# ./install.sh
请务必根据英文提示输入命令来进行安装,安装路径设为默认的。如果通过输入序列号来激活,序列号为N5D5-59XJ7FC2,需要连接网络。如果通过输入序列号文件来激活,则不需要联网,序列号文件是/home/user/wrfdata/INTEL/NCOM_L_CMP_CPP_N5D5-59XJ7FC2.lic。(user为普通用户用户名)
3.3 安装ifort
# cd /usr/INTEL
# tar -zxvf /home/user/wrfdata/INTEL/l_fcompxe_2011.11.339.tgz user为普通用户用户名
# cd l_fcompxe_2011.11.339/
# ./install.sh
请务必根据英文提示输入命令来进行安装,安装路径设为默认的。如果通过输入序列号来激活,序列号为NR2M-9D5C5CB5,需要连接网络。如果通过输入序列号文件来激活,则不需要联网,序列号文件是/home/user/wrfdata/INTEL/NCOM_L_CMP_FOR_NR2M-9FMJTRW4.lic。(user为普通用户用户名)
3.4 设置超级用户环境变量
# gedit $HOME/.bashrc
添加下面的语句:
source /opt/intel/composer_xe_2011_sp1.11.339/bin/compilervars.sh intel
# source $HOME/.bashrc
退出超级用户:
# exit
终端的命令提示符变回“$”,即普通用户bash环境
3.5设置普通用户环境变量
$ gedit $HOME/.bashrc
添加下面的语句:
source /opt/intel/composer_xe_2011_sp1.11.339/bin/compilervars.sh intel
$ source $HOME/.bashrc
参考网站: http://software.intel.com/en-us/articles/using-intel-compilers-for-linux-with-ubuntu/
4、安装MPICH2
MPICH2版本为1.2.1p1,安装包为mpich2-1.2.1p1.tar.gz,下载网址:
http://www.mpich.org/static/downloads/1.2.1p1/
4.1登录超级用户
MPICH2的安装需要在超级用户权限下完成,在安装前登录超级用户:
$ sudo su
输入密码后按Enter即可登录超级用户,命令提示符变为“#”,此时超级用户仍为bash命令环境
4.2解压安装包
# cd /usr
# tar -zxvf /home/user/wrfdata/MPICH2/mpich2-1.2.1p1.tar.gz user为普通用户用户名
解压后在/usr路径下生成文件夹mpich2-1.2.1p1
4.3编译
# cd /usr/mpich2-1.2.1p1
# ./configure --prefix=/usr/mpich2
设置/usr/mpich2为安装路径
4.4安装
# make
# make install
4.5 退回到普通用户
# exit
终端的命令提示符变回“$”,即普通用户bash环境
4.6新建文件.mpd.conf文件
$ cd $HOME
$ touch .mpd.conf
$ chmod 600 .mpd.conf
$ gedit .mpd.conf
在文件中输入:
MPD_SECRETWORD=mr45-j9z
4.7 设置环境变量
$ gedit $HOME/.bashrc
添加下面的语句:
export MPICH2=/usr/mpich2
export PATH=$MPICH2/bin:$PATH
$ source $HOME/.bashrc
安装完成后在终端输入which mpif90后会显示mpif90所示的位置/usr/mpich2/bin/mpif90
4.8 打开mpd
$ mpd &
每次开机需要并行计算都要打开mpd,“&”符号表示命令在后台运行。
5. 安装netcdf
安装包可到官方网站下载,成功运行的版本为4.0,安装包是netcdf-4.0.tar.gz
下载网址:
ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.0.tar.gz
5.1 解压压缩包
$ cd $HOME
$ tar -zxvf $HOME/wrfdata/WRF/netcdf-4.0.tar.gz
5.2 编译congifure
$ cd $HOME/netcdf-4.0
$ ./configure CC='icc' CXX='icpc' CFLAGS='-O3 -xHost -ip -no-prec-div -static-intel' CXXFLAGS='-O3 -xHost -ip -no-prec-div -static-intel' F77='ifort' FC='ifort' F90='ifort' FFLAGS='-O3 -xHost -ip -no-prec-div -static-intel' CPP='icc -E' CXXCPP='icpc -E' --prefix=$HOME/netcdf
$ make
5.3 安装
$ make install
安装完成后在主目录生成文件夹netcdf
5.4 设置环境变量
$ gedit $HOME/.bashrc
在文件后添加语句:
export NETCDF=$HOME/netcdf
export PATH=$NETCDF/bin:$PATH
$ source $HOME/.bashrc
参考网址:
http://www.intel.com/support/performancetools/sb/CS-027812.htm
6. 安装NCARG
安装包下载网址为http://www.earthsystemgrid.org/search?Type=Software,安装包为ncl_ncarg-6.0.0.Linux_Debian_x86__gcc445.tar.gz
6.1 解压压缩包
$ cd $HOME
$ mkdir ncarg
$ cd $HOME/ncarg
$ tar -zxvf $HOME/wrfdata/WRF/ncl_ncarg-6.0.0.Linux_Debian_x86__gcc445.tar.gz (这两行是连在一起的,实际为同一行)
6.2 创建.hluresfile文件
$ gedit $HOME/.hluresfile
添加下面的内容:
!=========================================
! This is a sample .hluresfile. It should
! go in your home directory.
!
! Comments for ".res" files are preceded by a "!".
! Remember quotations are not used in .res files.
! White background/black foreground, these are the default in V6.1.0
*wkForegroundColor : (/0.,0.,0./)
*wkBackgroundColor : (/1.,1.,1./)
! Have a favorite colormap that you use for everything? You can
! make it your default here (note the name is NOT in quotes).
!
! In Version 6.1.0, the default is "ncl_default":
! http://www.ncl.ucar.edu/Document/Graphics/ColorTables/ncl_default.shtml
!
! For all available color maps, see
! http://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml
*wkColorMap : BlueWhiteOrangeRed
! Font - this is the default in V6.1.0.
! Use times-roman to get the pre-V6.1.0 default.
*Font : helvetica
! Function code - this is the default in V6.1.0.
! Use ':' to get the pre-V6.1.0 default.
*TextFuncCode : ~
! Make default X11 window larger (the default is 500x500)
*wkWidth : 800
*wkHeight : 800
! Increase the default (16mb) contour memory.
! The default is 100000000.
! For example, if you have gridded data that
! is larger than 500 x 500, you may need this.
! *wsMaximumSize: 300000000
!==========================================
修改文件权限:
$ chmod 600 $HOME/.hluresfile
6.3 设置环境变量
$ gedit $HOME/.bashrc
在文件后添加语句:
export NCARG_ROOT=$HOME/ncarg
export PATH=$NCARG_ROOT/bin:$PATH
export DISPLAY=:0.0
$ source $HOME/.bashrc
参考网址:
http://www.ncl.ucar.edu/Document/Graphics/hlures.shtml
http://www.ncl.ucar.edu/Download/install.shtml#CopyHLURESFILE
7. 安装lib for wps
为了更好的使WPS模块支持GRIB2数据格式文件,需要安装三个library,他们是jasper、libpng和zlib。
7.1 安装jasper
$ cd $HOME
$ tar -zxvf $HOME/wrfdata/WRF/jasper-1.701.0.tar.gz
解压后生成目录jasper-1.701.0
$ cd jasper-1.701.0
$ ./configure --prefix=$HOME/jasper
设置$HOME/jasper为安装路径
$ make
$ make install
安装完成后在主目录$HOME下生成文件夹jasper
7.4 安装libpng
$ cd $HOME
$ tar -zxvf $HOME/wrfdata/WRF/libpng-1.2.12.tar.gz
解压后生成目录libpng-1.2.12
$ cd libpng-1.2.12
$ ./configure --prefix=$HOME/libpng
设置$HOME/libpng为安装路径
$ make
$ make install
安装完成后在主目录$HOME下生成文件夹libpng
7.5 安装zlib
$ cd $HOME
$ tar -zxvf $HOME/wrfdata/WRF/zlib-1.2.3.tar.gz
解压后生成目录zlib-1.2.3
$ cd zlib-1.2.3
$ ./configure --prefix=$HOME/zlib
设置$HOME/zlib为安装路径
$ make
$ make install
安装完成后在主目录$HOME下生成文件夹zlib
8. 设置环境变量
$ gedit $HOME/.bashrc
在文件后添加语句:
export WRF_EM_CORE=1 (指定编译WRFV3)
ulimit -s unlimited (使WRF使用计算机资源不受)
$ source $HOME/.bashrc
9. 安装WRFV3
9.1 编译
$ cd $HOME/WRFv3.4.1/WRFV3
$ ./configure
------------------------------------------------------------------------
Please select from among the following supported platforms.
1. Linux x86_, PGI compiler with gcc (serial)
2. Linux x86_, PGI compiler with gcc (smpar)
3. Linux x86_, PGI compiler with gcc (dmpar)
4. Linux x86_, PGI compiler with gcc (dm+sm)
5. Linux x86_, PGI compiler with pgcc, SGI MPT (serial)
6. Linux x86_, PGI compiler with pgcc, SGI MPT (smpar)
7. Linux x86_, PGI compiler with pgcc, SGI MPT (dmpar)
8. Linux x86_, PGI compiler with pgcc, SGI MPT (dm+sm)
9. Linux x86_, PGI accelerator compiler with gcc (serial)
10. Linux x86_, PGI accelerator compiler with gcc (smpar)
11. Linux x86_, PGI accelerator compiler with gcc (dmpar)
12. Linux x86_, PGI accelerator compiler with gcc (dm+sm)
13. Linux x86_ i486 i586 i686, ifort compiler with icc (serial)
14. Linux x86_ i486 i586 i686, ifort compiler with icc (smpar)
15. Linux x86_ i486 i586 i686, ifort compiler with icc (dmpar)
16. Linux x86_ i486 i586 i686, ifort compiler with icc (dm+sm)
17. Linux x86_ i486 i586 i686, ifort compiler with icc, SGI MPT (serial)
18. Linux x86_ i486 i586 i686, ifort compiler with icc, SGI MPT (smpar)
19. Linux x86_ i486 i586 i686, ifort compiler with icc, SGI MPT (dmpar)
20. Linux x86_ i486 i586 i686, ifort compiler with icc, SGI MPT (dm+sm)
21. Linux i486 i586 i686 x86_, PathScale compiler with pathcc (serial)
22. Linux i486 i586 i686 x86_, PathScale compiler with pathcc (dmpar)
23. x86_ Linux, gfortran compiler with gcc (serial)
24. x86_ Linux, gfortran compiler with gcc (smpar)
25. x86_ Linux, gfortran compiler with gcc (dmpar)
26. x86_ Linux, gfortran compiler with gcc (dm+sm)
27. Cray XT CLE/Linux x86_, PGI compiler with gcc (serial)
28. Cray XT CLE/Linux x86_, PGI compiler with gcc (smpar)
29. Cray XT CLE/Linux x86_, PGI compiler with gcc (dmpar)
30. Cray XT CLE/Linux x86_, PGI compiler with gcc (dm+sm)
31. Cray XT CLE/Linux x86_, Cray CCE compiler with gcc (serial)
32. Cray XT CLE/Linux x86_, Cray CCE compiler with gcc (smpar)
33. Cray XT CLE/Linux x86_, Cray CCE compiler with gcc (dmpar)
34. Cray XT CLE/Linux x86_, Cray CCE compiler with gcc (dm+sm)
Enter selection [1-34] : 15
------------------------------------------------------------------------
Compile for nesting? (1=basic, 2=preset moves, 3=vortex following) [default 1]: 1
请根据提示选择编译器和是否进行网格嵌套,这里选择的是并行版本的intel编译器和嵌套网格,分别对应15和1。该步骤完成后会生成configure.wrf。
9.2 安装
$ ./compile em_real >& compile.log
安装时间较久,请耐心等待。结束后检查compile.log文件里面有没有出错信息,结果会在$HOME/WRFv3.4.1/WRFV3/test/em_real、$HOME/WRFv3.4.1/WRFV3/run和$HOME/WRFv3.4.1/WRFV3/main的路径中生成执行文件real.exe和wrf.exe(如果显示红色表明未安装成功)
10. 安装WPS
10.1 编译
$ cd $HOME/WRFv3.4.1/WPS
$ ./configure
1. Linux x86_, PGI compiler (serial)
2. Linux x86_, PGI compiler (serial_NO_GRIB2)
3. Linux x86_, PGI compiler (dmpar)
4. Linux x86_, PGI compiler (dmpar_NO_GRIB2)
5. Linux x86_, PGI compiler, SGI MPT (serial)
6. Linux x86_, PGI compiler, SGI MPT (serial_NO_GRIB2)
7. Linux x86_, PGI compiler, SGI MPT (dmpar)
8. Linux x86_, PGI compiler, SGI MPT (dmpar_NO_GRIB2)
9. Linux x86_, IA and Opteron (serial)
10. Linux x86_, IA and Opteron (serial_NO_GRIB2)
11. Linux x86_, IA and Opteron (dmpar)
12. Linux x86_, IA and Opteron (dmpar_NO_GRIB2)
13. Linux x86_, Intel compiler (serial)
14. Linux x86_, Intel compiler (serial_NO_GRIB2)
15. Linux x86_, Intel compiler (dmpar)
16. Linux x86_, Intel compiler (dmpar_NO_GRIB2)
17. Linux x86_ g95 compiler (serial)
18. Linux x86_ g95 compiler (serial_NO_GRIB2)
19. Linux x86_ g95 compiler (dmpar)
20. Linux x86_ g95 compiler (dmpar_NO_GRIB2)
21. Cray XT/XE Linux x86_ (Opteron), PGI compiler 5.2 or higher (serial)
22. Cray XT/XE Linux x86_ (Opteron), PGI compiler 5.2 or higher (serial_NO_GRIB2)
23. Cray XT/XE Linux x86_ (Opteron), PGI compiler 5.2 or higher (dmpar)
24. Cray XT/XE Linux x86_ (Opteron), PGI compiler 5.2 or higher (dmpar_NO_GRIB2)
25. Cray XT/XE Linux x86_ (Opteron), Cray CCE compiler 7.0 or higher (dmpar)
26. Cray XT/XE Linux x86_ (Opteron), Cray CCE compiler 7.0 or higher (dmpar_NO_GRIB2)
Enter selection [1-26] : 13
请根据提示选择编译器,这里选择的是单机版本的intel编译器,不需要并行,编号13。结果在当前目录生成configure.wps文件
10.2 修改configure.wps
$ gedit configure.wps
修改下面的语句:
NCARG_LIBS = -L$(NCARG_ROOT)/lib -lncarg -lncarg_gks -lncarg_c \
-L/usr/X11R6/lib -lX11 \
-L/usr/lib/gcc/x86_-linux-gnu/4.4 -lgfortran
COMPRESSION_LIBS = -L${HOME}/jasper/lib -ljasper \
-L${HOME}/libpng/lib -lpng \
-L${HOME}/zlib/lib -lz
COMPRESSION_INC = -I${HOME}/jasper/include \
-I${HOME}/libpng/include \
-I${HOME}/zlib/include
注意文件中有两处设置COMPRESSION_LIB和COMPRESSION_INC变量的地方,这里修改的变量位于“# Settings for Linux x86_, Intel compiler”这个语句后面
10.3 编译WPS
$ ./compile >& compile.log
检查compile.log文件里面有没有出错信息,编译完成后在当前文件夹生成geogrid.exe, ungrid.exe 和 metgrid.exe三个执行文件
11. 运行geogrid.exe
11.1 解压数据文件
$ cd $HOME/WRFv3.4.1/WPS
$ tar -zxvf $HOME/wrfdata/WRF/geog/10m/geog.tar.gz
结果在当前目录新建了文件夹geog。
在使用课室电脑的时候可能会遇到磁盘空间不足的问题,所里这里用的地形数据是10m分辨率的,文件较小。完整的地形数据在$HOME/wrfdata/WRF/geog/all目录里面
11.2 修改namelist.wps文件
$ gedit namelist.wps
修改文件:
max_dom = 3,
start_date = '2004-04-05_00:00:00','2004-04-05_00:00:00','2004-04-05_00:00:00',
end_date = '2004-04-06_00:00:00','2004-04-06_00:00:00','2004-04-06_00:00:00',
parent_id = 1, 1, 2,
parent_grid_ratio = 1, 3, 3,
i_parent_start = 1, 19, 29,
j_parent_start = 1, 15, 13,
e_we = 65, 91, 124,
e_sn = 49, 61, 97,
geog_data_res = '10m','10m','10m',
dx = 36000,
dy = 36000,
ref_lat = 23.0,
ref_lon = 113.0,
truelat1 = 30.0,
truelat2 = 60.0,
stand_lon = 113.0,
geog_data_path = './geog'
11.3 运行
运行geogrid.exe
$ ./geogrid.exe
运行完成后在当前目录生成对应每一套网格的以geo_em开头的文件
还可以查看设置后网格的嵌套情况:
$ ./util/plotgrids.exe
在当前目录生成文件gmeta
$ idt gmeta
出现图形窗口,用鼠标点击“>”即可查看网格范围
12. 运行ungrib.exe
12.1 链接Vtable文件
$ cd $HOME/WRFv3.4.1/WPS
$ ln -sf ungrib/Variable_Tables/Vtable.GFS Vtable
链接后在当前文件夹生成链接文件Vtable
12.2 准备fnl数据
模式所需要的数据是来自NCEP的fnl每6个小时一次的GRIB1或GRIB2格式的数据文件,下载网址是:
http://rda.ucar.edu/datasets/ds083.2/
下载需要注册。本操作已提供需要用到的fnl数据。
$ cd $HOME
$ mkdir fnl
新建fnl文件夹,把fnl数据解压到里面
$ tar -zxvf $HOME/wrfdata/WRF/fnl.tar.gz
把fnl文件链接到WPS文件夹
$ cd $HOME/WRFv3.4.1/WPS
$ ./link_grib.csh $HOME/fnl/fnl_2004040*
12.3 运行
$ ./ungrib.exe
运行成功后在当前文件夹生成对应每个时间点的以FILE开头的文件
13. 运行metgrid.exe
$ cd $HOME/WRFv3.4.1/WPS
直接输入命令:
$ ./metgrid.exe
运行成功后在当前文件夹生成对应每个网格、每个时间点的以met_em开头的文件
14. 运行real.exe和wrf.exe
14.1 链接metgrid.exe生成的文件
$ cd $HOME/WRFv3.4.1/WRFV3/test/em_real
把WPS的输出文件链接过来
$ ln -sf $HOME/WRFv3.4.1/WPS/met_em.d0* .
注意别忘了命令后面的空格和一点,这一点表示的是当前文件夹
14.2 修改namelist.input文件
$ gedit namelist.input
修改文件:
run_hours = 24,
start_year = 2004, 2004, 2004,
start_month = 04, 04, 04,
start_day = 05, 05, 05,
start_hour = 00, 00, 00,
start_minute = 00, 00, 00,
start_second = 00, 00, 00,
end_year = 2004, 2004, 2004,
end_month = 04, 04, 04,
end_day = 06, 06, 06,
end_hour = 00, 00, 00,
end_minute = 00, 00, 00,
end_second = 00, 00, 00,
history_interval = 60, 60, 60,
max_dom = 3,
e_we = 65, 91, 124,
e_sn = 49, 61, 97,
num_metgrid_soil_levels = 2,
dx = 36000, 12000, 4000,
dy = 36000, 12000, 4000,
i_parent_start = 1, 19, 29,
j_parent_start = 1, 15, 13,
14.3 运行real
$ ./real.exe
运行real没必要用到并行,运行成功后在当前文件夹生成边界场文件wrfbdy_d01和初始场文件wrfinput_d01,wrfinput_d02,wrfinput_d03,分别对应三重嵌套. 如果出错可以通过查看以rsl.error或rsl.out开头的文件来了解。
14.4 运行wrf
$ mpiexec –n 4 ./wrf.exe
-n是并行计算mpiexec命令的选项,用于设置并行计算所用的计算机核数,这里是4个核。运行成功后会生成netcdf格式的输出文件wrfout_d01,wrfout_d02和wrfout_d03. 如果出错可以通过查看以rsl.error或rsl.out开头的文件来了解。
15. 可视化
实现wrfout的可视化有很多软件,如grads、MATLAB、NCL和IDL等,其中应用较为普及的是grads。Grads无法直接读取wrfout文件,因此需要ARWpost模块进行转换。
15.1 解压并安装ARWpost
$ cd $HOME/WRFv3.4.1
$ tar -zxvf $HOME/wrfdata/WRF/ARWpost_V3.tar.gz
解压完成后在当前目录生成文件夹ARWpost
15.2 编译
$ cd $HOME/WRFv3.4.1/ARWpost
$ ./configure
Please select from among the following supported platforms.
1. PC Linux i486 i586 i686 x86_, PGI compiler
2. PC Linux i486 i586 i686 x86_, Intel compiler
3. PC Linux i486 i586 i686 x86_, gfortran compiler
Enter selection [1-3] : 2
------------------------------------------------------------------------
Configuration successful. To build the ARWpost, type: compile
------------------------------------------------------------------------
15.3 安装
$ ./compile
运行完成后在当前目录生成执行文件ARWpost.exe
15.4 修改namelist.ARWpost
$ gedit namelist.ARWpost
修改文件:
start_date = '2004-04-05_00:00:00',
end_date = '2004-04-06_00:00:00',
interval_seconds = 3600,
input_root_name = '$HOME/WRFv3.4.1/WRFV3/test/em_real/wrfout_d01_2004-04-05_00:00:00' (wrfout文件路径)
15.5 运行ARWpost
$ ./ARWpost.exe
运行成功后生成ctl文件和dat文件,grads可以直接画图。
16. 可视化
Grads画图需要两个文件,一个是dat文件,存放数据;另一个是ctl文件,描述dat文件的数据存放格式。
16.1 安装grads
16.1.1 能上网
$ sudo apt-get install grads
输入密码后即可完成下载和安装。
16.1.2 不能上网
先到网站下载grads安装包,然后手动安装,下载网址:http://packages.ubuntu.com/lucid/amd/grads/
$ sudo dpkg -i $HOME/wrfdata/grads_2.0.a7.1-3_amd.deb
16.2 运行grads
$ grads
输入命令后会提示选择纵向绘图窗口还是横向绘图窗口,选择后会出现绘图窗口,终端命令符变为“ga->“。
16.3 打开ctl文件
ga-> open /home/user/WRFv3.4.1/ARWpost/test.ctl user为普通用户用户名
输入后会在终端窗口提示数据文件的信息
16.4 简单画图
设置第2个时间点:
ga-> set t 2
设置从地面向高层第2个高度层:
ga-> set lev 2
画u风速的水平分布
ga-> d u
在绘图窗口即可看到u风速的等值线图
把绘图窗口清空
ga-> c
退出grads软件
ga-> quit下载本文