爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 9004|回复: 1

记录一下WRF的安装过程(mac, 20201026)

[复制链接]
发表于 2020-10-26 19:39:41 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

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


密码修改失败请联系微信:mofangbao
发表于 2022-9-3 12:12:14 | 显示全部楼层
你好,我安装好netcdfc之后,安装netcdf-fortran出现了这个问题,不知道楼主遇到过吗
configure: error: Fortran could not compile .f90 files
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表