chemthermos_readini.F

路径

LMDZ.MARS\libf\aeronomars\chemthermos_readini.F

所属目录/模块

libf\aeronomars

文件定位

chemthermos_readini.F 定义 chemthermos_readini_mod,提供唯一例程 chemthermos_readini:从运行目录下的 chemthermos_reactionrates.def 读取 61 个热层气相化学反应的 Arrhenius 速率常数参数,填入共享模块 param_v4_h::rcoef(61,3)。该例程由 calchim_mod 在 firstcall、if(.not.unichim) 条件下调用一次;rcoef 随后被 paramfoto_compact 取用,按 k=rcoef(i,1)*(T/300)^rcoef(i,2)*exp(rcoef(i,3)/T) 计算 ch2..ch87 各反应速率。

反应逐项含义、文献来源与文件格式详见参考页 reaction-rates;本页只从源码视角记录读取例程的 use/call/输入输出/副作用。

定义的符号

符号 类型 行号 作用
chemthermos_readini_mod module 1(END MODULE 40) 包装反应速率读取例程的模块
chemthermos_readini subroutine 7(END SUBROUTINE 38) 读取 chemthermos_reactionrates.def 填充 param_v4_h::rcoef

依赖的模块

use 模块 only 列表 用途 待确认
param_v4_h rcoef 写入反应速率系数数组 rcoef(61,3)real*8,定义于 param_v4_h.F90:45 param_v4_hrcoef 为普通 module array,未显式声明 SAVE/THREADPRIVATE

调用的关键例程

被调用例程 所在模块/文件 调用位置 作用
abort_physic LMDZ 物理工具(本例程 use 列表未显式声明其模块) 34 文件缺失时中止运行
open / read / close Fortran intrinsic 19 / 22–26 / 31 读取格式化反应速率文件
write Fortran intrinsic 33 文件缺失时打印空行提示

输入

chemthermos_readini 无哑元参数,输入来自文件:

输入 来源 类型 含义
chemthermos_reactionrates.def 运行目录(CWD,相对路径) formatted ASCII 61 个反应的 Arrhenius 参数,1 行头 + 每反应 3 行(2 行说明 + 1 行 rc1,rc2,rc3

输出

输出 去向 类型/维度 含义
rcoef param_v4_h 模块变量;使用方 paramfoto_compact real*8 (61,3) 反应速率系数:(,1)=A、(,2)=B 温度指数、(,3)=C 活化温度

共享状态与副作用

核心逻辑

  1. open(unit=10,file='chemthermos_reactionrates.def',status='old',iostat=ierr)(第 19–20 行)。
  2. ierr==0(第 21 行):
    • read(10,*) 跳过文件头(第 22 行);
    • do i=1,61(第 23–30 行):两次 read(10,*) 跳过该反应的方程与文献说明行,再 read(10,*) rc1,rc2,rc3 读数据行,赋值 rcoef(i,1:3)=rc1,rc2,rc3
    • close(10)(第 31 行)。
  3. 否则(第 32–36 行):write(*,*) 打印空行,call abort_physic("chemthermos_readini",'Cannot find file chemthermos_reactionrates.def',1)

伪代码

chemthermos_readini():
  open unit=10, file='chemthermos_reactionrates.def', status='old', iostat=ierr
  if ierr == 0:
    read(10,*)                       # skip header
    for i = 1..61:
      read(10,*)                     # skip reaction equation line
      read(10,*)                     # skip source/literature line
      read(10,*) rc1, rc2, rc3
      rcoef(i,1)=rc1; rcoef(i,2)=rc2; rcoef(i,3)=rc3
    close(10)
  else:
    write(*,*)
    call abort_physic("chemthermos_readini", "Cannot find file ...", 1)

参与的主题流程

主题 参与方式
热层化学 / 光化学 calchim_mod firstcall(if(.not.unichim))调用,载入反应速率;paramfoto_compact 消费 rcoef 计算 ch2..ch87chemthermos 化学源汇

写法特点

复现要点

待确认

相关页面