WRF(Weather Research Forecast)是由Mesoscale and Microscale Meteorology Division of NCAR以及美国其他气象组织联合开发和支持的大型开源气象预报软件,涵盖了从几十米到几千公里的范围广泛的气象应用;
WPS全称为WRF Pre-processing System,即WRF预处理系统,用来为WRF模型准备输入数据;
1、WRF-4.x系统流程图
2、安装WRF\WPS依赖
# yum -y install m4 jasper-devel libpng-devel libjpeg-turbo-devel # export JASPERLIB=/usr/lib64 # export JASPERINC=/usr/include
GNU 编译、OpenMPI、HDF5、NetCDF等依赖安装
https://www.cnblogs.com/liu-shaobo/p/15339457.html
3、安装WRF
WRF常用的2个程序;
real.exe 气象场的垂直插值、生成初始条件和边界条件、一致性检查;
wrf.exe 模式运行,生成wrfout文件;
# wget https://github.com/wrf-model/WRF/archive/refs/tags/v4.3.tar.gz -O WRF-4.3.tar.gz # tar zxvf WRF-4.3.tar.gz -C /usr/local/ # cd /usr/local/WRF-4.3 # ./configure ------------------------------------------------------------------------ Please select from among the following Linux x86_64 options: 1. (serial) 2. (smpar) 3. (dmpar) 4. (dm+sm) PGI (pgf90/gcc) 5. (serial) 6. (smpar) 7. (dmpar) 8. (dm+sm) PGI (pgf90/pgcc): SGI MPT 9. (serial) 10. (smpar) 11. (dmpar) 12. (dm+sm) PGI (pgf90/gcc): PGI accelerator 13. (serial) 14. (smpar) 15. (dmpar) 16. (dm+sm) INTEL (ifort/icc) 17. (dm+sm) INTEL (ifort/icc): Xeon Phi (MIC architecture) 18. (serial) 19. (smpar) 20. (dmpar) 21. (dm+sm) INTEL (ifort/icc): Xeon (SNB with AVX mods) 22. (serial) 23. (smpar) 24. (dmpar) 25. (dm+sm) INTEL (ifort/icc): SGI MPT 26. (serial) 27. (smpar) 28. (dmpar) 29. (dm+sm) INTEL (ifort/icc): IBM POE 30. (serial) 31. (dmpar) PATHSCALE (pathf90/pathcc) 32. (serial) 33. (smpar) 34. (dmpar) 35. (dm+sm) GNU (gfortran/gcc) 36. (serial) 37. (smpar) 38. (dmpar) 39. (dm+sm) IBM (xlf90_r/cc_r) 40. (serial) 41. (smpar) 42. (dmpar) 43. (dm+sm) PGI (ftn/gcc): Cray XC CLE 44. (serial) 45. (smpar) 46. (dmpar) 47. (dm+sm) CRAY CCE (ftn $(NOOMP)/cc): Cray XE and XC 48. (serial) 49. (smpar) 50. (dmpar) 51. (dm+sm) INTEL (ftn/icc): Cray XC 52. (serial) 53. (smpar) 54. (dmpar) 55. (dm+sm) PGI (pgf90/pgcc) 56. (serial) 57. (smpar) 58. (dmpar) 59. (dm+sm) PGI (pgf90/gcc): -f90=pgf90 60. (serial) 61. (smpar) 62. (dmpar) 63. (dm+sm) PGI (pgf90/pgcc): -f90=pgf90 64. (serial) 65. (smpar) 66. (dmpar) 67. (dm+sm) INTEL (ifort/icc): HSW/BDW 68. (serial) 69. (smpar) 70. (dmpar) 71. (dm+sm) INTEL (ifort/icc): KNL MIC 72. (serial) 73. (smpar) 74. (dmpar) 75. (dm+sm) FUJITSU (frtpx/fccpx): FX10/FX100 SPARC64 IXfx/Xlfx Enter selection [1-75] : 35 ------------------------------------------------------------------------ Compile for nesting? (1=basic, 2=preset moves, 3=vortex following) [default 1]: Configuration successful! ------------------------------------------------------------------------
编译WRF
# ./compile -j 8 em_real
# export WRF_HOME=/usr/local/WRF-4.3
编译完成后会在main目录生成ndown.exe、real.exe、tc.exe、wrf.exe 4个运行程序,并在run目录下产生运行程序的链接文件。
4、安装WPS
WPS(WRF Preprocessing System)是为了真实数据模拟提供输入的前处理过程,包含了3个主要程序:
geogrid.exe 定义模式的模拟域,并将静态地理学数据插值到模式网格。
ungrib.exe 从GRIB格式文件中提取气象场数据。
metgrid.exe 将ungrib.exe提取的气象场数据水平插值到geogrid.exe定义的模拟域网格。
编译WPS
# wget https://github.com/wrf-model/WPS/archive/refs/tags/v4.3.tar.gz -O WPS-4.3.tar.gz # tar zxvf WPS-4.3.tar.gz -C /usr/local/ # cd /usr/local/WPS-4.3 # ./configure ------------------------------------------------------------------------ Please select from among the following supported platforms. 1. Linux x86_64, gfortran (serial) 2. Linux x86_64, gfortran (serial_NO_GRIB2) 3. Linux x86_64, gfortran (dmpar) 4. Linux x86_64, gfortran (dmpar_NO_GRIB2) 5. Linux x86_64, PGI compiler (serial) 6. Linux x86_64, PGI compiler (serial_NO_GRIB2) 7. Linux x86_64, PGI compiler (dmpar) 8. Linux x86_64, PGI compiler (dmpar_NO_GRIB2) 9. Linux x86_64, PGI compiler, SGI MPT (serial) 10. Linux x86_64, PGI compiler, SGI MPT (serial_NO_GRIB2) 11. Linux x86_64, PGI compiler, SGI MPT (dmpar) 12. Linux x86_64, PGI compiler, SGI MPT (dmpar_NO_GRIB2) 13. Linux x86_64, IA64 and Opteron (serial) 14. Linux x86_64, IA64 and Opteron (serial_NO_GRIB2) 15. Linux x86_64, IA64 and Opteron (dmpar) 16. Linux x86_64, IA64 and Opteron (dmpar_NO_GRIB2) 17. Linux x86_64, Intel compiler (serial) 18. Linux x86_64, Intel compiler (serial_NO_GRIB2) 19. Linux x86_64, Intel compiler (dmpar) 20. Linux x86_64, Intel compiler (dmpar_NO_GRIB2) 21. Linux x86_64, Intel compiler, SGI MPT (serial) 22. Linux x86_64, Intel compiler, SGI MPT (serial_NO_GRIB2) 23. Linux x86_64, Intel compiler, SGI MPT (dmpar) 24. Linux x86_64, Intel compiler, SGI MPT (dmpar_NO_GRIB2) 25. Linux x86_64, Intel compiler, IBM POE (serial) 26. Linux x86_64, Intel compiler, IBM POE (serial_NO_GRIB2) 27. Linux x86_64, Intel compiler, IBM POE (dmpar) 28. Linux x86_64, Intel compiler, IBM POE (dmpar_NO_GRIB2) 29. Linux x86_64 g95 compiler (serial) 30. Linux x86_64 g95 compiler (serial_NO_GRIB2) 31. Linux x86_64 g95 compiler (dmpar) 32. Linux x86_64 g95 compiler (dmpar_NO_GRIB2) 33. Cray XE/XC CLE/Linux x86_64, Cray compiler (serial) 34. Cray XE/XC CLE/Linux x86_64, Cray compiler (serial_NO_GRIB2) 35. Cray XE/XC CLE/Linux x86_64, Cray compiler (dmpar) 36. Cray XE/XC CLE/Linux x86_64, Cray compiler (dmpar_NO_GRIB2) 37. Cray XC CLE/Linux x86_64, Intel compiler (serial) 38. Cray XC CLE/Linux x86_64, Intel compiler (serial_NO_GRIB2) 39. Cray XC CLE/Linux x86_64, Intel compiler (dmpar) 40. Cray XC CLE/Linux x86_64, Intel compiler (dmpar_NO_GRIB2) Enter selection [1-40] : 3 ------------------------------------------------------------------------ Configuration successful. To build the WPS, type: compile ------------------------------------------------------------------------
编译WPS
# sed -i '/-lnetcdf$/s/$/ -lgomp -lpthread/g' configure.wps # ./compile > compile.log
编译结束后,在WPS主目录下会生成geogrid.exe、metgrid.exe、ungrib.exe三个可执行程序的链接。
5、设置环境变量
# vim .bashrc ## WRF export WRFIO_NCD_LARGE_FILE_SUPPORT=1 export WRF_DIR=/usr/local/WRF-4.3 export PATH=$WRF_DIR/main:$PATH export PATH=$WRF_DIR/run:$PATH ## WPS export WPS_DIR=/usr/local/WPS-4.3 export PATH=$WPS_DIR:$PATH