- 积分
- 2027
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-9-13
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
###记录一下自己安装WRF的过程
基本情况:
macOS Catalina10.15.4
WRF4.2.1 https://github.com/wrf-model/WRF/releases
WPS 4.2 https://github.com/wrf-model/WPS/releases
netcdf https://www.unidata.ucar.edu/downloads/netcdf/
mpich-3.3.2 https://www.mpich.org/
zlib-1.2.11 http://www.zlib.net/
libpng-1.6.37 http://www.libpng.org/pub/png/libpng.html
jasper-1.900.1 https://www.ece.uvic.ca/~frodo/jasper/#download
指南 https://www2.mmm.ucar.edu/wrf/On ... lation_tutorial.php
论坛 https://forum.mmm.ucar.edu/phpBB3/index.php
因为官方指南上的版本有点古老了,所以实际操作起来会遇到一些问题,下面记录下我的流程
###0.环境变量
csh
setenv DIR 你的路径/Build_WRF/LIBRARIES
setenv CC gcc
setenv CXX g++
setenv FC gfortran
setenv FCFLAGS -m64
setenv F77 gfortran
setenv FFLAGS -m64
setenv JASPERLIB $DIR/grib2/lib
setenv JASPERINC $DIR/grib2/include
setenv LDFLAGS -L$DIR/grib2/lib
setenv CPPFLAGS -I$DIR/grib2/include
setenv PATH "$DIR/netcdf/bin:$PATH"
setenv NETCDF $DIR/netcdf
setenv PATH "$DIR/mpich/bin:$PATH"
###1.netcdf
netcdf依赖hdf5,可以homebrew直接安装
新版的netcdf是分开的,因此需要先安装netcdf-c-4.7.4(正常安装),再安装netcdf-fortran-4.5.3,(./configure --prefix=$DIR/netcdf --disable-dap --disable-netcdf-4 --disable-shared CPPFLAGS=-I/$DIR/netcdf/include LDFLAGS=-L/$DIR/netcdf/lib)
###2.mpich-zlib-libpng-jasper
正常安装,jasper的新版不太一样,我使用了指南中的1.900.1版本
###3.WRF
./configure基于gcc-gfortan,smpar模式
./compile基于em_real模式,存在类似报错:
Fatal Error: Cannot open module file 'module_mp_fast_sbm.mod' for reading at (1): No such file or directory
解决方法:ln -s /usr/local/bin/gcc-9 /usr/local/bin/gcc (在/usr/local/bin中创建链接gcc 指向gcc-9)
###4.WPS
./configure 基于gcc-gfortan serial
./compile只生成ungrib.exe
解决方法:./configure 后修改configure.wps中
WRF_LIB = -L$(WRF_DIR)/external/io_grib1 -lio_grib1 \
-L$(WRF_DIR)/external/io_grib_share -lio_grib_share \
-L$(WRF_DIR)/external/io_int -lwrfio_int \
-L$(WRF_DIR)/external/io_netcdf -lwrfio_nf \
-L$(NETCDF)/lib -lnetcdff -lnetcdf -lgomp
|
|