| 
 
	积分711贡献 精华在线时间 小时注册时间2013-8-9最后登录1970-1-1 
 | 
 
| 
本帖最后由 Legendary 于 2021-9-23 12:51 编辑
x
登录后查看更多精彩内容~您需要 登录 才可以下载或查看,没有帐号?立即注册 
  
 PREP_CHEM_SOURCES是一个常见的排放源文件制作工具。这个模块可以利用全球排放源数据制作出:1. GOCART背景场排放文件; 2. 生物质燃烧排放文件; 3. 人为源排放文件。
 每次重新安装运行WRF-Chem时,PREP_CHEM_SOURCES永远是耗时最长,最让人头疼的一部分。现整理操作步骤如下:
 0. 选择PREP_CHEM_SOURCES_1.3 和1.5 最终都能编译出 prep_chem_sources_RADM_WRF_FIM_.exe
 下载并解压PREP_CHEM_SRC_1.X 到你需要的路径。
 
 1. 安装新的netcdf。在/PREP_CEHEM_SRC_1.X/路径下安装新的netcdf(不是之前安装WRF时已经用过的netcdf。版本netcdf4.0是可行的。不可安装netcdf-c-4.x.x 或者netcdf-fortran-4.x.x)。
 安装方法:
 首先在PREP_CHEM_SRC.1.X 路径下下载netcdf4.0
 wget https://src.fedoraproject.org/re ... c/netcdf-4.0.tar.gz
 解压后得到netcdf-4.0文件夹。进入该文件夹。
 ./configure FC=gfortran CC=gcc CXX=g++ --prefix=/xx/xx/PREP_CHEM_SRC_1.X/netcdf
 make
 make isntall
 得到/xx/xx/PREP_CHEM_SRC_1.x/netcdf  里面是/bin /lib /include 等常用文件夹。
 
 Unzip the file:
 tar -xvf hdf5-1.8.16.tar
 Go to the directory hdf5-1.8.13 created in the process of unpacking.
 cd hdf5-1.8.16
 For the configuration process of the library, use the command:
 FC=gfortran F77=gfortran F90=gfortran CC=gcc CXX=g++ ./configure--prefix=/xx/xx/PREP_CHEM_SRC_1.X/hdf5  --disable-shared -enable-fortran
 make
 make install
 
 于是你得到[size=13.3333px]/xx/xx/PREP_CHEM_SRC_1.X/hdf5目录,里面是/bin /lib /include 等常用文件夹。
 
 3. 编译prep_chem_sources_RADM_WRF_FIM_.exe
 进入/xx/xx/PREP_CHEM_SRC_1.X/bin/build
 vim include.mk.gfortran.wrf
 NETCDF=/xx/xx/PREP_CHEM_SRC_1.X/netcdf
 HDF5=/xx/xx/PREP_CHEM_SRC_1.X/hdf5
 HDF5_LIB=-L$(HDF5)/lib -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5 -lz -ldl
 make OPT=gfortran.wrf CHEM=RADM_WRF_FIM >&compile.log
 
 一切正常的话你会在/bin 目录下的到exe文件啦!撒花撒花!
 
 3.1 常见报错:
 make之后如果出现任何错误,重新make之前,都要删除该文件夹下已经编译出的.o 和.mod 文件。
 如果报错提示缺失netcdf.mod, 可行的解决方法是
 find | grep netcdf.mod
 找到一个netcdf.mod 将其ln -s  /x/x/netcdf.mod /xx/xx/xx/缺失的路径
 
 make OPT error:Error: Function 'setor' at (1) has no IMPLICIT type
 
   edgar_emissions.f90解决方案: After investigating the issue for a while, I reached to this solution which is a modification of one of the FORTRAN source codes:
 
 Go to the directory "src" and edit the source code "edgar_emissions.f90" with "vi" editor.
 
 Consider these lines (form 840 to 845):在短的变量名称后面加空格,直至所有变量都跟“ALGUICULTURE”一样长。保存,删除.o 和.mod,重新make。
 参考(https://forum.wrfforum.com/viewtopic.php?f=39&t=9199)
 总结:
 老老实实地重新在PREP_CHEM_SRC_1.3/1.5 目录下安装一遍netcdf和hdf5是关键。
 
 
 
 
 
 | 
 |