气象wrf模式内部培训配置资料.ppt
《气象wrf模式内部培训配置资料.ppt》由会员分享,可在线阅读,更多相关《气象wrf模式内部培训配置资料.ppt(82页珍藏版)》请在三一办公上搜索。
1、WRFV2.2.1,万文龙(整理)2008年11月10日CUIT,目录,1 预备知识2 Linux操作系统介绍3 模式简介4 编译器安装5 WRF模块编译6 WPS模块编译7 模式运行8 ARWPOST后处理编译9 WRFDomainWizard10 相关源代码及英文教程下载网业,1 预备知识,常用linux、unix命令:打开终端,可以输入命令,如:cd directory 进入指定路径的工作目录cd.退到上一层目录 ls 显示目录下所有子目录与文件(包括隐藏文件)Vi file_name 浏览和编辑文件gunzip file_name.tar.gz 解压文件(对于.tar.gz文件)tar
2、 xvf file_name.tar 解压文件(对于.tar文件)./configure 连接./compile 编译./install 安装Chmod+x file_name 文件权限设置,#echo$SHELL(查看所用计算机的shell)Bsh设置环境变量命令:例如:NETCDF=/usr/local;export NETCDFCsh设置环境变量命令:例如:setenv NETCDF/usr/local/netcdf,2 Linux操作系统介绍(摘自于百度),Linux操作系统核心最早是由芬兰的Linus Torvalds 1991年8月在芬兰赫尔辛基大学上学时发布的那年Torvals
3、25岁,后来经过众多世界顶尖的软件工程师的不断修改和完善,Linux得以在全球普及开来,在服务器领域及个人桌面版得到越来越多的应用,在嵌入式开发方面更是具有其它操作系统无可比拟的优势,并以每年100%的用户递增数量显示了Linux强大的力量。Linux的是一套免费的32位多人多工的操作系统,运行方式同UNIX系统很像,但Linux系统的稳定性、多工能力与网络功能已是许多商业操作系统无法比拟的,Linux还有一项最大的特色在于源代码完全公开,在符合GNU GPL(General Public License)的原则下,任何人皆可自由取得、散布、甚至修改源代码。,与其它操作系统相比,Linux还具
4、有以下特色:采用阶层式目录结构,文件归类清楚、容易管理 支持多种文件系统,如Ext2FS,ISOFS以及Windows的文件系统FAT16,FAT32,NTFS等具有可移植性,系统核心只有小于10%的源代码采用汇编语言编写,其余均是采用C语言编写,因此具备高度移植性可与其它的操作系统如Windows98/2000/xp等并存于同一台计算机上,现在linux版本很多,应用比较广泛的是redhat以及开源的fedora。本文模式的安装是在redhat企业版5.0为例。NOTES:经陈功同学测试,fedora最新版本(指9版)在超线程奔腾单机上要比redhat运算快1倍;PGI编译使用f95比f90
5、快25%。感谢陈功同学在模式编译运算优化上的试验支持!,3 模式简介,WRF(Weather Research and Forecasting Model)模式是由美国环境预测中心(NCEP),美国国家大气研究中心(NCAR)等美国科研机构中心着手开发的一种统一的中尺度天气预报模式。模式分为ARW(the Advanced Research WRF)和NMM(the Nonhydrostatic Mesoscale Model)两种,即研究用和业务用两种形式,本文介绍的是 ARW WRF。,3.1 模式特点,WRF模式系统具有可移植,易维护,可扩充,高效率,方便等许多特点,将成为改进从云尺度到
6、各种不同天气尺度的重要天气特征预报精度的工具。WRF模式为完全可压缩以及非静力模式,采用F90语言编写。水平方向采用Arakawa C(荒川C)网格点(重点考虑1-10km),垂直方向则采用地形跟随质量坐标。WRF模式在时间积分方面采用三阶或者四阶的Runge-Kutta算法。WRF模式不仅可以用于真实天气的个案模拟,也可以用其包含的模块组作为基本物理过程探讨的理论根据。此外,WRF模式还具有多重嵌套和方便的定位于不同地理位置的能力。,Arakawa-C 特点,运用Arakawa-C 交错格点假设所有3维变量(U,V,和质量)关于这些点是交错格点。对于定义的非交错格点,U格点向上交错了0.5个
7、格点,V格点向右交错了0.5个格点,质量网格分别向上向右交错了0.5个格点。为了便于说明,下面给出一个(XDIM,YDIM)=(4,4)的例子:(+)为根据参数定义的点。(T)为由WRF预报模式提供和输出的质量变量的格点位置。(U)点为由WRF模式提供和输出的U动量变量的格点位置。(V)点为由WRF模式提供和输出的V动量变量的格点位置。这样,如果使用维数(XDIM,YDIM),则模式输出如下:(XDIM-1,YDIM-1)维的质量变量(XDIM,YDIM-1)维的U动量(XDIM-1,YDIM)维的V动量。,3.2 WRF模式流程,出处:Users Guide for Advanced Res
8、earch WRF(ARW)Modeling System Version 2.2,4 编译器安装,Software requirements(软件需求)-Fortran 90 or 95 and c compiler(模式编译语言f90/f95)-perl 5.04 or better-If MPI and OpenMP compilation is desired,it requires MPI or OpenMP libraries-WRF I/O API supports netCDF,PHD5,GriB 1 and GriB 2 formats,hence one of these
9、libraries needs to be available on the computer where you compile and run WRF,安装PGI 设置环境变量 安装NETCDF,WRF模式系统是采用Fortran 90、Fortran 77及c+编译语言进行编译与测试的,所以,运行WRF必须先安装编译软件,目前运用的编译软件主要有PGI和INTEL。本文以PGI(6.0版本)编译器、NETCDF3.6.1为例进行说明。,4.1 PGI6.0安装,(1):把linux86-64文件复制到指定路径下,如/usr/,用命令#tar zxvf linux86-64.tar.gz
10、解压文件(2):编译并安装#cd/usr/linux86-64 进入安装目录#./install 执行安装Do you accept these terms?accept,declineacceptInstall the ACML?y/nnInstallation directory?/usr/pgi/usr/local/pgiCreate an evaluation license?y/nnDo you want the files in the install directory to be read-only?y,nn(3):用root用户把license.dat(在使用期范围的其他版本
11、的license.dat也可以用)复制(cp)到/usr/local/pgi下$cp r/usr/linux86-64/license.dat/usr/local/pgi,4.2 环境变量设置,为了方便,我们可以将环境变量登录到.bashrc(或者.bash_profile)里。下文将PGI以及NETCDF一起设置进去。在根目录root下打开隐藏文件.bash_profile 或着在终端下输入:#vi.bash_profile(一般我们修改在/home/usr/cuit目录里:#cd/home/usr/cuit)出现如下内容:#.bash_profile#Get the aliases and
12、 functionsif-f/.bashrc;then./.bashrc,然后添加如下语句:#User specific environment and startup programsPATH=$PATH:$HOME/binexport PATHunset USERNAME,#set pgi#(设置PGI)export PGI=/usr/local/pgi export PATH=$PGI/linux86/6.0/bin:$PGI/linux86/6.0/include:$PATH export MANPATH=$MANPATH:$PGI/linux86/6.0/man export LM_
13、LICENSE_FILE=$PGI/license.dat#set netcdf#(设置NETCDF)export NETCDF=/usr/local/netcdfexport PATH=$NETCDF/bin:$NETCDF/include:$NETCDF/lib:$NETCDF/man:$PATHexport CC=/usr/bin/gcc export CXX=$PGI/linux86/6.0/bin/pgCC export FC=$PGI/linux86/6.0/bin/pgf90 export F90=$PGI/linux86/6.0/bin/pgf90,然后保存退出,用如下命令#:
14、wq!#source.bash_profile保存完后,注销一次。最后可以用命令whichpgf90来查看pgi是否安装成功。#which pgf90/usr/local/pgi/linux86/6.0/bin/pgf90#pgf90 pgf90-Warning-No files to process显示如上则pgi安装成功,4.3 NETCDF3.6.1安装,NOTES:PGI安装不成功,后面的NETCDF是编译安装不上的!#cd/usr/local#mkdir netcdf#cd.回到usr目录下#cd.回到根目录#cd usr#tar zxvf netcdf.tar.gz#cd netc
15、df-3.6.1/src,#./configure prefix=/usr/local/netcdf 编译并指示安装路径#make check#make install 执行安装此时NETCDF安装完成,环境变量在前一个步骤设置好,注意前面的环境变量里的路径必须与此安装路径相同。,5 WRF(主)模块编译安装,首先在/home/user/cuit下解压WRFV2.2.1.tar.gz文件:#tar zxvf WRFV2.2.1.tar.gz#ls#mv WRFV2.2.1 WRFV2#cd WRFV2下一步就要开始连接然后编译WRF主模块:#./configure(or:configure有的
16、shell命令如此)然后出现如下内容:,checking for perl5.nochecking for perl.found/usr/bin/perl(perl)Will use NETCDF in dir:/usr/local/netcdf-pgiPHDF5 not set in environment.Will configure WRF for use without.-Please select from among the following supported platforms.1.PC Linux i486 i586 i686,PGI compiler(Single-thr
17、eaded,no nesting)2.PC Linux i486 i586 i686,PGI compiler(single threaded,allows nesting usingRSL without MPI)3.PC Linux i486 i586 i686,PGI compiler SM-Parallel(OpenMP,no nesting)4.PC Linux i486 i586 i686,PGI compiler SM-Parallel(OpenMP,allows nestingusing RSL without MPI)5.PC Linux i486 i586 i686,PGI
18、 compiler DM-Parallel(RSL,MPICH,Allowsnesting)6.PC Linux i486 i586 i686,PGI compiler DM-Parallel(RSL_LITE,MPICH,Allowsnesting)7.Intel xeon i686 ia32 Xeon Linux,ifort compiler(single-threaded,nonesting)8.Intel xeon i686 ia32 Xeon Linux,ifort compiler(single threaded,allowsnesting using RSL without MP
19、I)9.Intel xeon i686 ia32 Xeon Linux,ifort compiler(OpenMP)10.Intel xeon i686 ia32 Xeon Linux,ifort compiler SM-Parallel(OpenMP,allowsnesting using RSL without MPI)11.Intel xeon i686 ia32 Xeon Linux,ifort+icc compiler DM-Parallel(RSL,MPICH,allows nesting)12.Intel xeon i686 ia32 Xeon Linux,ifort+gcc c
20、ompiler DM-Parallel(RSL,MPICH,allows nesting)13.PC Linux i486 i586 i686,PGI compiler,ESMF(Single-threaded,ESMFcoupling,no nesting)Enter selection1-13:,我们选择2,使用单机,允许嵌套,但不并行运算:Enter selection 1-13:2-Configuration successful.To build the WRF,type:compile-#./compile 编译安装开始Usage:compile wrf compile wrf i
21、n run dir(Note,noreal.exe,ndown.exe or ideal.exe generated)test cases(see README_test_cases for details):compile em_b_wavecompile em_grav2d_xcompile em_hill2d_xcompile em_quarter_sscompile em_realcompile em_squall2d_xcompile em_squall2d_ycompile h help message,我们选择real模拟,则输入#./compile em_real&compil
22、e.log接下来就等待主模块的编译安装如果编译安装成功,在/home/user/WRFV2/run路径下生成real.exe和wrf.exe可执行文件,在终端上显示为蓝色的即可(红色表示没有安装成功,需重新编译)。若没有编译成功,则输入clean命令再重新安装(未成功,看compile.log里面的报错)#clean a再查找原因重新编译安装,6 WPS编译安装,首先在/home/user/cuit下解压WPSV2.2.1.tar.gz文件:#tar zxvf WRFV2.2.1.tar.gz#ls#cd WPS下一步就要开始连接然后编译WPS模块:#./configure(or:config
23、ure有的shell命令如此)然后出现如下内容:,Will use NETCDF in dir:/usr/local/netcdf-Please select from among the following supported platforms.1.PC Linux i486 i586 i686,PGI compiler serial2.PC Linux i486 i586 i686,PGI compiler serial,NO GRIB23.PC Linux i486 i586 i686,PGI compiler DM parallel 4.PC Linux i486 i586 i686
24、,PGI compiler DM parallel,NO GRIB25.PC Linux i486 i586 i686,Intel compiler serial6.PC Linux i486 i586 i686,Intel compiler serial,NO GRIB27.PC Linux i486 i586 i686,Intel compiler DM parallel8.PC Linux i486 i586 i686,Intel compiler DM parallel,NO GRIB2Enter selection 1-8:,我们选择2(不用grib2格式的资料,若做业务运行,即预报
25、NMM,而非ARW,必须要安装可以使用grib2资料的,大部分业务运行要使用此类数据)Enter selection 1-8:2-Configuration successful.To build the WPS,type:compile-然后下一步就开始编译安装,#./compile&compile.log安装成功后,会在/wrf/WPS路径下生成geogrid.exe,ungrib.exe,metgrid.exe 三个可执行文件(蓝色)。若没有此三个文件,请查看ARWUsersGuideV2.pdf里面有详细的trouble shooting。查看如下:#ls*.exegeogrid.ex
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 气象 wrf 模式 内部 培训 配置 资料
链接地址:https://www.31ppt.com/p-5446215.html