param_v4_h.F90
快速理解
它做什么: 热层 EUV/化学/电离路径的共享状态模块,集中声明光谱维度/查找表/反应速率/产损缓存。
基本过程: 纯声明模块 → 由 param_read/param_read_e107/chemthermos_readini/jthermcalc* 写入 → 由 paramfoto_compact 消费。
关键结果: jfotsout/rcoef/crscabsi2/fluxtop 等共享数组。
路径
LMDZ.MARS\libf\aeronomars\param_v4_h.F90
所属目录/模块
libf\aeronomars
文件定位
param_v4_h.F90 定义 param_v4_h,是热层 EUV、E107 光吸收、热层化学和电离效率路径共享的状态模块。它集中声明光谱区间数、吸收体数、热层柱含量/光吸收查找表、E107 年表、解离/电离效率、反应速率系数、光解输出数组,以及 paramfoto_compact 写入的大批物种产生/损失/最小时间尺度缓存。
本文件自身不读外部文件、不调用其他例程;实际数据由 param_read、param_read_e107、chemthermos_readini、jthermcalc* 和 paramfoto_compact 等例程写入或消费。physiq_mod.F 在 callthermos 初始化分支调用本模块的 fill_data_thermos 与 allocate_param_thermos(nlayer)。
定义的符号
| 符号 | 类型 | 行号 | 作用 |
|---|---|---|---|
param_v4_h |
module | 1(END MODULE 440) |
热层参数、查找表、反应速率和产损数组共享状态模块 |
ninter,nabs,nz2,ninter2 |
integer parameters | 5-8 | EUV 光谱区间、吸收体、查表高度和旧版 16 区间维度 |
kboltzman,n_avog,gg,masa,radio |
real*8 parameters | 9-13 | 热层计算使用的物理常数;jthermcalc_util 和 physiq_mod 读取其中部分常数 |
nreact,tapas |
integer parameters | 14-15 | 热层化学反应数和固定表层数;nreact=93 控制产损矩阵第二维 |
crscabsi2,c1_16,c17_24...c36,jabsifotsintpar |
real module arrays | 17-31 | 吸收截面、柱含量聚合表和光吸收/透过率查找表 |
e107,date_e107,e107_tab,coefit0...coefit4 |
real module arrays/scalar | 32-36 | E107 标量、669 行年表和 E107 拟合系数 |
rcoef |
real*8 module array | 45 | 61 个热层反应的 3 项 Arrhenius 系数;由 chemthermos_readini 写入、paramfoto_compact 消费 |
efdis*,efion* |
real module arrays | 50-62 | 解离效率、电离效率和电离通道分支比 |
jfotsout,jdistot,jdistot_b,jion |
REAL,SAVE,ALLOCATABLE arrays |
65-69 | 光吸收、总解离和电离输出缓存;显式 THREADPRIVATE |
P*,L*,*tot,tmin* arrays |
REAL*8,SAVE,ALLOCATABLE arrays |
73-208 | 热层化学物种产生项、损失项、总产损和最小时间尺度缓存;显式 THREADPRIVATE |
fill_data_thermos |
subroutine | 219(END SUBROUTINE 287) |
填入内置吸收截面、代表波长和 CO2 截面表 |
allocate_param_thermos |
subroutine | 289(END SUBROUTINE 438) |
按 nlayer 分配光解、电离和热层化学产损数组 |
依赖的模块
| use 模块 | only 列表 | 用途 | 待确认 |
|---|---|---|---|
| 无 | - | 本模块不 use 其他模块 |
- |
调用的关键例程
| 被调用例程 | 所在模块/文件 | 调用位置 | 作用 |
|---|---|---|---|
| 无 | - | - | fill_data_thermos 和 allocate_param_thermos 只做数组赋值/分配,不调用外部例程 |
allocate |
Fortran intrinsic | 296-436 | 分配本模块的 allocatable 共享数组 |
输入
| 输入 | 来源 | 类型/维度 | 单位 | 含义 |
|---|---|---|---|---|
nlayer |
调用方 physiq_mod |
integer scalar | - | 物理垂直层数,决定所有热层缓存数组第一/第三维 |
fill_data_thermos 无哑元输入,使用源码内硬编码数据。
输出
| 输出 | 去向 | 类型/维度 | 单位 | 含义 |
|---|---|---|---|---|
crscabsi2 |
jthermcalc*/EUV 计算路径 |
real (nabs,16) |
cm2(按注释 cross section) | 13 个吸收体中部分物种在 16 个短波区间上的吸收截面 |
freccen |
hrtherm | real (ninter) |
nm(按代表波长语义) | 36 个 EUV 代表波长,hrtherm 用于加热率归一化 |
co2crsc195,co2crsc295 |
E107/光吸收计算路径 | real (9) |
cm2 | CO2 在 195 K 与 295 K 下的截面表 |
jfotsout,jdistot,jdistot_b,jion |
jthermcalc*、hrtherm、热层化学路径 |
allocatable arrays | mixed | 光吸收、解离和电离缓存 |
P*,L*,*tot,tmin* arrays |
paramfoto_compact 和 chemthermos |
allocatable arrays | mixed | 物种反应源项、损失项、总量和时间尺度缓存 |
共享状态与副作用
fill_data_thermos写入模块级数组crscabsi2、freccen、co2crsc195、co2crsc295;不分配内存、不做 I/O。allocate_param_thermos(nlayer)分配jfotsout(ninter,nabs,nlayer)、jdistot(nabs,nlayer)、jdistot_b(nabs,nlayer)、jion(nabs,nlayer,4),以及全部P*/L*/*tot/tmin*数组。jfotsout/jdistot/jdistot_b/jion和全部产损/时间尺度 allocatable 数组都有SAVE,并通过!$OMP THREADPRIVATE声明为线程私有。rcoef(61,3)是普通real*8module array;源码中未对rcoef写SAVE或THREADPRIVATE。它的生命周期是模块作用域,OpenMP 线程私有语义未在本文件显式声明。- 本模块没有 deallocate 例程;释放策略不在本文件中体现。
核心逻辑
- 静态参数声明:定义光谱、吸收体、查表高度、反应数和常数等维度/物理参数。
- 声明共享查表与运行状态:包括柱含量表、E107 表、效率表、反应速率系数、光解输出和产损缓存。
- 标注线程私有缓存:光解输出数组和热层化学产损/时间尺度 allocatable 数组均设为
THREADPRIVATE。 fill_data_thermos内置填表:写入部分crscabsi2(species,1:16),设置freccen(1:36)为3.4 ... 600.,并填入 195 K/295 K CO2 截面。allocate_param_thermos(nlayer)分配运行缓存:先分配光解/电离输出,再按nlayer,nreact或nlayer分配所有物种源汇和最小时间尺度数组。
伪代码
module param_v4_h:
declare dimensions/constants
declare EUV/E107 lookup arrays, reaction rates and efficiency arrays
declare allocatable photochemical output arrays as SAVE THREADPRIVATE
declare allocatable production/loss/tmin arrays as SAVE THREADPRIVATE
fill_data_thermos():
set selected crscabsi2(absorber,1:16) hard-coded cross sections
set freccen(1:36) representative wavelengths
set co2crsc195(1:9) and co2crsc295(1:9)
allocate_param_thermos(nlayer):
allocate jdistot, jdistot_b, jion, jfotsout using nabs/ninter/nlayer
for every thermal species:
allocate Pspecies(nlayer,nreact), Lspecies(nlayer,nreact)
allocate Pspecies_tot(nlayer), Lspecies_tot(nlayer), tminspecies(nlayer)
参与的主题流程
| 主题 | 参与方式 |
|---|---|
| 热层初始化 | physiq_mod 在 callthermos 初始化段调用 fill_data_thermos 和 allocate_param_thermos(nlayer) |
| E107/EUV 参数读取 | param_read_e107 和 param_read 写入本模块表格、效率和年表数组 |
| 热层 EUV 加热 | hrtherm 读取 ninter/nabs/jfotsout/fluxtop/freccen,其中 freccen 由本模块内置填表 |
| 热层化学反应速率 | chemthermos_readini 写入 rcoef(61,3);paramfoto_compact 消费并写 ch2..ch87 与产损数组 |
写法特点
.F90自由格式模块,但保留旧式real*8和大量全局共享状态。- 数据与状态混合在同一模块:既有常数/查表,也有随
nlayer分配的运行缓存。 - 大量数组只在本文件声明,实际写入/读取分散在多个
.F/.F90文件中;复现时必须沿 use/call 链追踪。 - 线程私有仅覆盖 allocatable 光解和产损缓存;
rcoef、静态查表和效率数组不是显式THREADPRIVATE。
复现要点
- 调用
param_read_e107或jthermcalc_e107前,当前physiq_mod初始化顺序先调用fill_data_thermos和allocate_param_thermos(nlayer);缺少分配会导致jfotsout等数组不可用。 freccen由fill_data_thermos中 36 个硬编码代表波长组成;hrtherm 的jergs公式直接除以它。rcoef维度固定为61,3,与chemthermos_reactionrates.def和chemthermos_readini的do i=1,61绑定。nreact=93大于rcoef的 61 个配置反应;产损数组第二维按 93 分配,不能用rcoef行数替代。- 本文件没有释放例程;重复初始化或动态改变
nlayer的复现程序需自行处理已分配数组。
待确认
tapas=42在当前核验路径中的具体使用位置尚未展开。jdistot_b与jdistot的物理差异需结合paramfoto_compact或jthermcalc*调用路径确认。- 静态表数组(如
c1_16、coefit*、efdis*)未显式SAVE/THREADPRIVATE;并行复现需按 Fortran module 变量和 MPI 广播路径理解其可见性。
相关页面
- param_read_e107:当前热层初始化使用的 E107 参数读取路径,写入本模块大量数组。
- param_read:旧版
param_v5读取路径,也写入本模块数组。 - chemthermos_readini:读取
chemthermos_reactionrates.def到rcoef(61,3)。 - hrtherm:读取
jfotsout/fluxtop/freccen计算 EUV 光吸收加热率。 - physiq_mod:调用
fill_data_thermos、allocate_param_thermos和param_read_e107的初始化入口。 - jthermcalc_e107_mod.F:被调方文件页,写入
jfotsout。 - paramfoto_compact:消费本模块的热层化学速率、光解输出和产损数组。