SMOKE-v4.8.1


SMOKE官网下载的安装包需要使用Intel编译器!
由于此次安装使用了gcc,导致不断出错(最后也不知道怎么去改…)
若改为Intel(ifort)会简单很多!
这篇文章可以说是踩坑经历吧… …

一些有用的链接

或许能解决bug的官方论坛:CMAS FORUM
SMOKEv4.8.1官方用户手册
GitHub下载

SMOKE目录结构

SMOKE主目录结构
在这里插入图片描述
脚本描述/Assigns文件目录结构

安装及编译过程(踩坑)

就按照官网的用户手册试一下吧。
官方用户手册
SMOKE下载地址:https://github.com/CEMPD/SMOKE/tags

1.下载

在这里插入图片描述
根据下载的文件包来看,官网使用的编译器为ifort

2.安装

  1. 把下载的文件放在同一目录下,此处放置在/home/xqm/SMOKE
  2. 设置环境变量
vim ~/.cshrc
setenv SMK_HOME /home/xqm/SMOKE/SMOKE_INST
source ~/.cshrc
  1. mkdir -p $SMK_HOME创建SMK_HOME所指目录(若不存在时)
setenv SMK_HOME /home/xqm/SMOKE/SMOKE_INST
cd /home/xqm/SMOKE
source smoke_install_v481.csh

安装完成:
在这里插入图片描述
可看到有提示:

NOTE: AUTO_DELETE script setting is not set. Default is N to not delete I/O API intermediate and output files

于是设置:setenv AUTO_DELETE N

3.source Assigns

——The first thing before running the nctox test case,: invoke the Assigns file

执行(invoke) Assigns文件后,所有SMOKE脚本(scripts)都放置在 $SMKROOT/scripts/run
(即 $SCRIPTS/run)目录下

cd $SMK_HOME/subsys/smoke/assigns
# invoke默认Assigns文件
source ASSIGNS.nctox.cmaq.cb05_soa.us12-nc

4.运行SMOKE_nctox实例

(前提必要步骤:Invoking the Assigns file,见上文)
根据官方的话,SMOKE下载后无需编译就可直接运行SMOKE nctox case.
以下指令可执行处理基准年的固定区域、生物成因、非道路移动和点排放的脚本:

cd $SCRIPTS/run #(change to the run scripts directory)
smk_area_nctox.csh #(invoke the stationary area run script)
smk_bg_nctox.csh #(invoke the BEIS3 biogenic run script)
smk_nonroad_nctox.csh #(invoke the nonroad mobile run script)
smk_point_nctox.csh #(invoke the point run script)
smk_rateperdistance_nctox.csh #(invoke the MOVES mobile sources on-roadway rate-per-distance (RPD) run script for all processes)
smk_ratepervehicle_nctox.csh #(invoke the MOVES mobile sources off-network rate-per-vehicle (RPV) run script)
smk_rateperprofile_nctox.csh #(invoke the MOVES mobile sources off-network rate-per-profile (RPP) run script)
smk_rateperhour_nctox.csh #(invoke the MOVES mobile sources off-network rate-per-hour (RPH) run script)
smk_mrgall_nctox.csh #(invoke the all-sources merge script)

但是,不出所料地报错了

[xqm@centos7 run]# ./smk_area_nctox.csh
/bin/rm: No match.
/bin/rm: No match.
Running part 1...
/home/xqm/SMOKE/SMOKE_INST/subsys/smoke/Linux2_x86_64gfort/smkinven: error while loading shared libraries: libiomp5.so: cannot open shared object file: No such file or 
0.000u 0.001s 0:00.00 0.0%	0+0k 0+0io 0pf+0w
/home/xqm/SMOKE/SMOKE_INST/subsys/smoke/Linux2_x86_64gfort/spcmat: error while loading shared libraries: libiomp5.so: cannot open shared object file: No such file or di
0.000u 0.000s 0:00.00 0.0%	0+0k 0+0io 0pf+0w
/home/xqm/SMOKE/SMOKE_INST/subsys/smoke/Linux2_x86_64gfort/grdmat: error while loading shared libraries: libiomp5.so: cannot open shared object file: No such file or di
0.000u 0.000s 0:00.00 0.0%	0+0k 0+0io 0pf+0w
/home/xqm/SMOKE/SMOKE_INST/subsys/smoke/Linux2_x86_64gfort/smkreport: error while loading shared libraries: libiomp5.so: cannot open shared object file: No such file or
0.000u 0.001s 0:00.00 0.0%	0+0k 0+0io 0pf+0w
Running part 2, for 20050710 ...
Running part 4, for 20050710...
/home/xqm/SMOKE/SMOKE_INST/subsys/smoke/Linux2_x86_64gfort/temporal: error while loading shared libraries: libiomp5.so: cannot open shared object file: No such file or 
0.000u 0.001s 0:00.00 0.0%	0+0k 0+0io 0pf+0w
/home/xqm/SMOKE/SMOKE_INST/subsys/smoke/Linux2_x86_64gfort/smkmerge: error while loading shared libraries: libiomp5.so: cannot open shared object file: No such file or 
0.000u 0.000s 0:00.00 0.0%	0+0k 0+0io 0pf+0w
/home/xqm/SMOKE/SMOKE_INST/subsys/smoke/Linux2_x86_64gfort/smkreport: error while loading shared libraries: libiomp5.so: cannot open shared object file: No such file or
0.000u 0.000s 0:00.00 0.0%	0+0k 0+0io 0pf+0w

论坛相似的问题:Error when I using SMOKE
由于本身编译环境(gcc)造成。建议改为Intel。

5.编译

Unless you are planning to modify the SMOKE source codes, DO NOT try to compile the codes; use the precompiled binary Linux executables provided by the CMAS Center. Also, if the precompiled executables are not compatible with your OS platform, you will need to compile SMOKE for your system. The SMOKE compile scripts are configured to use a Linux C-shell environment, and are not designed for Windows or Mac operating systems. Using SMOKE on operating systems other than Linux is not supported by CMAS. The following steps will help get you set up to compile SMOKE.
——CMAS

——————下面是根据官网(徒劳地)修改了一些配置和(依然报错的)编译,但步骤是对的———————————

安装SMOKE后,首先下载IO/API并建立连接

  1. 在/SMOKE/SMOKE_INST/subsys/目录下下载ioapi
git clone https://github.com/cjcoats/ioapi-3.2
  1. 复制Makefile文件
    git clone之后的ioapi和m3tools目录下是没有Makefile这个文件的,
    所以需要利用这两个目录下面的Makefile.*进行复制一下
cd ioapi-3.2/ioapi
cp Makefile.nocpl Makefile
cd ../m3tools
cp Makefile.nocpl Makefile
cd ../
cp Makefile.template Makefile
  1. 修改配置文件属性
vim Makefile
 BIN        = Linux2_x86_64gfort
 BASEDIR    = ${PWD}	#{PWD}当前工作目录,此处为/ioapi-3.2
 INSTALL    = ${SMK_HOME}/subsys/ioapi-3.2 # 安装目录根目录,用于“make install“,libioapi.a和可执行工具将安装在$(INSTALL)/$(BIN)中
 LIBINST    = $(INSTALL)/$(BIN) # 覆盖libioapi.a的$(INSTALL)/$(BIN)
 BININST    = $(INSTALL)/$(BIN) # 覆盖M3TOOLS executables的$(INSTALL)/$(BIN)
 CPLMODE    = nocpl
 IOAPIDEFS  =
 PVMINCL    =
 NCFLIBS    = -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz
# 保存退出
  1. 创建BIN目录,并把libnetcdf.a libnetcdff.a复制到BIN目录下
    在~/.cshrc中setenv BIN Linux2_x86_64gfort 添加环境变量
# 在/home/xqm/SMOKE/SMOKE_INST/subsys/ioapi-3.2目录下
setenv BIN Linux2_x86_64gfort
mkdir $BIN
cd $BIN
cp /usr/local/netcdf/lib/lib* ./
  1. 回到ioapi-3.2目录并编译
cd ..
make configure
make
  1. 检查是否成功
 cd Linux2_x86_64gfort
 # 分别输入以下命令,查看是否有相应文件,有则成功
 ls *.mod
 ls libioapi.a
  1. 将ioapi的源码目录和库文件连接到SMOKE
# [1] Create symbolic link to the IOAPI source code directory (ioapi) to the $SMK_HOME/subsys/ioapi/ioapi/ directory.
# [2] Create symbolic link to the IOAPI libioapi.a library file and utility programs (datshift, jul2greg, greg2jul and so on) to the $SMK_HOME/subsys/ioapi/Linux2_x86_64ifort/ directory.
[xqm@centos7 assigns]\# ln -s /home/xqm/SMOKE/SMOKE_INST/subsys/ioapi-3.2/ioapi $SMK_HOME/subsys/ioapi-3.2/ioapi
[xqm@centos7 assigns]\# ln -s /home/xqm/SMOKE/SMOKE_INST/subsys/ioapi-3.2/${BIN} $SMK_HOME/subsys/ioapi-3.2/${BIN}
# 进入assign目录下
cd $SMK_HOME/subsys/smoke/assigns
# 备份一份配置文件并改为自己的名字
cp ASSIGNS.nctox.cmaq.cb05_soa.us12-nc my_assigns
# 编辑配置文件(步骤4.4.1 Change Assigns file to set scenario names, grid names, and other case-specific configuration information)
vim ASSIGNS.nctox.cmaq.cb05_soa.us12-nc
# 以下是修改内容,变量名应根据具体案例修改,比如4.4.1所述8个主要变量名的设置

## Determine operating system for compiling SMOKE
#  Set executable format, makeing allownces for 64-bit archtecnture
#  example: Linux2_x86_64ifort (Intel), Linux2_x86_64pg (Portland group), Linux2_x86_64gfort (gfortran)...
#
   setenv BIN    Linux2_x86_64gfort    # Intel Fortran 64-bit compiler

# 可能要注意这里的路径是否正确
   ## User-defined I/O directory settings
   setenv SMK_SUBSYS  $SMK_HOME/subsys              # SMOKE subsystem dir
   setenv SMKROOT     $SMK_SUBSYS/smoke             # System root dir
   setenv SMKDAT      $SMK_HOME/data                # Data root dir
   setenv ASSIGNS     $SMKROOT/assigns              # smoke assigns files
   setenv IOAPIDIR    $SMK_SUBSYS/ioapi-3.2/$BIN        # IOAPI directory

在安装了适当的库和编译选项之后,source ASSIGNS.nctox.cmaq.cb05_soa.us12-nc生效,以确保正确地配置了系统。
现在应该可以编译SMOKE程序了。

编译SMOKE

# 进入$SMKOOT/src/目录
cd $SMKOOT/src/
make
# 运行Makeall脚本后,检查$SMK_BIN目录中的可执行文件。

编译完成后,可继续 运行测试用例

但是,报错…

[xqm@centos7 src]# make
cd /home/xqm/SMOKE/SMOKE_INST/subsys/smoke/src/../Linux2_x86_64gfort;  gfortran -I/home/xqm/SMOKE/SMOKE_INST/subsys/ioapi-3.2/ioapi/fixed_src -I/home/xqm/SMOKE/SMOKE_INST/subsys/smoke/src/inc -I/home/xqm/SMOKE/SMOKE_INST/subsys/ioapi-3.2/Linux2_x86_64gfort                 -extend-source 132 -zero                          -O3 -ffast-math -funroll-loops -m64   -DAUTO_ARRAYS=1 -DF90=1 -DFLDMN=1 -DFSTR_L=int -DIOAPI_NO_STDOUT=1 -DNEED_ARGS=1 -c /home/xqm/SMOKE/SMOKE_INST/subsys/smoke/src/emmod/modar2pt.f
gfortran: error: 132: No such file or directory
make: *** [modar2pt.o] Error 1

大概率是编译器问题
官方论坛并没有给出使用gcc编译器如何修改的解答,以下是一些解答回复
回答一

As long as you are running SMOKE on Linux OS, you do not need to compile SMOKE but use the precompiled executables you downloded as a package. 
Please go throught the SMOKE user’s guide Chapter 12:
https://www.cmascenter.org/smoke/documentation/4.6/html/ch12.html
If you can run any of program using the run scripts priveded with the package, you do not need to compile SMOKE.

网友错误

$ grep ERROR *
smkinven.area.nctox.log: Value for SMK_MAXERROR: 100
smkmerge.area.nctox.20050710.us12-nc.log: *** ERROR ABORT in subroutine MRGVNAMS
smkmerge.area.nctox.20050710.us12-nc.log: ERROR: Variable descriptions do not contain proper separator in spec matrix.
smkreport.area.temporal.nctox.2005191.log: ERROR: Speciation joiner “~” is not found for speciation va riable 1

回复:

This issue could be related to the compiler version and compilation flags used for NetCDF and IOAPI. 
We have seen this issue before through gfortran compilers. 
Do you have an access to an intel compiler?
Better yet, have you tried to use the precompiled executables downloaded from CMAS website without the compilation? 
No need to recompile the codes since the SMOKE package already contains the precompiled executables as long as your GLIBC is newer than v2.17.

用户手册目录

  1. 介绍
    1.1. SMOKE简介
    1.2 SMOKE用户
    如何使用用户手册
  2. SMOKE概念
    2.1. 介绍
    2.2. 分配文件及环境变量
    2.3. 排放清单
    2.4. 交叉引用和简介
    2.5. 输入和输出文件类型
    2.6. 建模参数
    2.7. 排放建模的稀疏矩阵方法
    2.8. 区域、生物、移动和点处理摘要
    2.9. 库存进口
    2.10. 临时处理
    2.11. 化学规格处理
    2.12. 空间处理
    2.13. 增长处理
    2.14. 控制处理
    2.15. Elevated-source处理
    2.16. MOVES的移动源处理
    2.17. 生物处理
    2.18. 创建模型就绪排放
    2.19. 使用MOVES查找表创建模型就绪排放
    2.20. 质量保证
  3. SMOKE目录结构
    3.1. 介绍
    3.2. 目录结构
    3.3. 如何更改默认目录结构
  4. 如何使用SMOKE
    4.1. 介绍
    4.2. 测试案例描述
    4.3. 运行烟雾测试案例
    4.4. 如何使用烟雾
  5. SMOKE实用工具
    5.1. 概述
    5.2 MOVES实用程序脚本
    5.3 SMOKE实用程序
  6. SMOKE核心程序
    6.1. 概述
    6.2. Cntlmat
    6.3. Elevpoint
    6.4. Grdmat
    6.5. Grwinven
    6.6. Laypoint
    6.7. Met4moves
    6.8. Movesmrg
    6.9. Mrgelev
    6.10. Mrggrid
    6.11. Mrgpt
    6.12. Normbeis3
    6.13. Smkinven
    6.14. Smkmerge
    6.15. Spcmat
    6.16. Temporal
    6.17. Tmpbeis3
  7. SMOKE质量保证(QA)
    7.1. 介绍
    7.2. Smkreport程序
    7.3. REPCONFIG输入文件
    7.4. Smkreport所创建的报告
    7.5. 质量保证方法
  8. SMOKE输入文件
    8.1. 概述
    8.2. 库存文件
    8.3. 临时分配文件
    8.4. 空间分配文件
    8.5. 化学规格
    8.6. 增长和控制文件
    8.7. 特别合并文件
    8.8. 气象文件
    8.9. 来源特定文件
    8.10. 其他支持文件
  9. SMOKE中间文件
    9.1. 介绍
    9.2. Cntlmat
    9.3. Elevpoint
    9.4. Grdmat
    9.5. Gentpro
    9.6. Grwinven
    9.7. Laypoint
    9.8. Met4moves
    9.9. Movesmrg
    9.10. Normbeis3
    9.11. Smkinven
    9.12. Smkmerge
    9.13. Spcmat
    9.14. Temporal
    9.15. Tmpbeis3
  10. SMOKE输出文件
    10.1. 介绍
    10.2. Cntlmat
    10.3. Elevpoint
    10.4. Mrggrid
    10.5. Smkinven
    10.6. Smkmerge
    10.7. Tmpbeis3
    10.8. Tmpbio
  11. 源代码和包含文件
    11.1. 源代码
    11.2. 包含文件
  12. 下载、安装和编译SMOKE
    12.1. 介绍
    12.2. 下载SMOKE
    12.3. 安装SMOKE
    12.4. 为UNIX编译SMOKE
  13. 附录A:词汇表
  14. 附录B:缩略词

用户手册提供的必要指导

安装SMOKE
第12章,下载,安装和编译SMOKE

编译SMOKE
第12.4节,为UNIX编译SMOKE

运行SMOKE例子
第4.3节,运行SMOKE测试用例

为新的inventory, grid, episode设置并运行SMOKE

准备输入文件
第8章,SMOKE输入文件

决定如何在运行脚本中分配设置(assign settings)

检查SMOKE是否正确运行
第7.5节,质量保证方法

了解SMOKE正在执行的操作

提交问题报告或有关SMOKE的问题

  • 3
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值