calltherm_interface_mod.F90
路径
LMDZ.MARS\libf\phymars\calltherm_interface_mod.F90
所属目录 / 模块
libf\phymars
文件定位
calltherm_interface_mod.F90 定义 Martian thermal plume model 的 physiq 接口层。它不直接求解完整热羽流结构,而是在 physiq_mod.F 的主物理时间步中,当 callkeys_mod:calltherm 为真且 turb_mod:turb_resolved 为假时,准备热羽流输入场、把物理时间步拆成 comtherm_h:nsplit_thermals 个子步长、调用 thermcell_main_mars 计算热羽流温度/CO2 耦合演化,再用 thermcell_dqup 对风、非 CO2 tracer 和可选 TKE 做被动上升输送。
该接口还负责单位约定:thermcell_main_mars 的温度和 CO2 tracer 结果在子步长累计阶段以整步增量保存,写回 physiq 前温度和 CO2 tracer 要除以 ptimestep 变成 tendency;而 thermcell_dqup 返回的风、非 CO2 tracer 和 TKE 已是导数形式。最后,本例程把扩散热通量和热羽流热通量合并,更新 hfmax 和 wstar,供下一物理时间步的 surface-layer gustiness 使用。
定义的符号
| 符号 |
类型 |
行号 |
作用 |
calltherm_interface_mod |
module |
1 |
封装热羽流模型和 physiq 之间的接口 |
calltherm_interface |
subroutine |
43 |
准备输入场、执行热羽流子步长、输出热羽流 tendency 和 wstar 诊断 |
依赖的模块
| use 模块 |
only 列表 |
用途 |
待确认 |
comtherm_h |
未限制 |
读取 nsplit_thermals、qtransport_thermals、dtke_thermals 等热羽流编译期参数 |
- |
tracer_mod |
nqmx, noms |
源码声明了依赖,但本文件可见逻辑中未直接使用这两个符号 |
待确认:该 use 是否为历史遗留或保留接口 |
comcstfi_h |
r, g, cpp |
用于层质量、密度、热通量和自由对流速度尺度计算 |
- |
thermcell_main_mars_mod |
thermcell_main_mars |
每个热羽流子步长内求热羽流主体结构和温度/CO2 演化 |
- |
thermcell_dqup_mod |
thermcell_dqup |
在质量通量已知后,对被动变量做热羽流上升输送 |
- |
调用的关键例程
| 被调用例程 |
所在模块 / 文件 |
调用位置 |
作用 |
thermcell_main_mars |
thermcell_main_mars_mod / thermcell_main_mars.F90 |
行 232-242 |
在每个 zdt 子步长内计算热羽流高度、质量通量、卷入/脱离、温度增量、CO2 tracer 增量和诊断通量 |
thermcell_dqup |
thermcell_dqup_mod / thermcell_dqup.F90 |
行 315-318 |
用平均质量通量输送 u,返回 d_u_ajs |
thermcell_dqup |
thermcell_dqup_mod / thermcell_dqup.F90 |
行 321-324 |
用平均质量通量输送 v,返回 d_v_ajs |
thermcell_dqup |
thermcell_dqup_mod / thermcell_dqup.F90 |
行 331-334 |
对非 CO2 tracer 做被动输送,返回 d_q_ajs(:,:,iq) |
thermcell_dqup |
thermcell_dqup_mod / thermcell_dqup.F90 |
行 340-344 |
在 dtke_thermals 为真时输送层平均 TKE |
输入
| 输入 |
来源 |
类型/维度 |
单位 |
含义 |
ngrid, nlayer, nq |
physiq |
integer scalar |
- |
物理网格点数、垂直层数和 tracer 数 |
igcm_co2 |
physiq / tracer 初始化 |
integer scalar |
- |
CO2 tracer 在 pq 中的索引;0 表示没有 CO2 tracer |
zzlev, zzlay |
physiq 几何场 |
real (ngrid,nlayer+1) / (ngrid,nlayer) |
m |
层界面和层中心高度 |
ptimestep |
physiq |
real scalar |
s |
物理时间步长 |
pu, pv, pt, pq |
physiq 状态场 |
real arrays |
m/s, K, kg/kg |
热羽流调用前的风、温度和 tracer 混合比 |
pdu, pdv, pdt, pdq |
之前物理过程累计 tendency |
real arrays |
m/s/s, K/s, kg/kg/s |
热羽流之前已计算出的风、温度、tracer tendency |
q2 |
湍流/PBL 状态 |
real (ngrid,nlayer+1) |
model units |
界面 TKE;仅 dtke_thermals 为真时参与 |
pplay, pplev, pphi |
physiq 压力/位势高度场 |
real arrays |
Pa, m2/s2 |
层中心压力、层界面压力和位势高度 |
zpopsk |
physiq |
real (ngrid,nlayer) |
- |
Exner-like 因子 (pplay/ps) ** (r/cp) |
pdhdif |
垂直扩散过程 |
real (ngrid,nlayer) |
K/s |
扩散方案的位温 tendency,用于 hfmax/wstar |
sensibFlux |
surface layer scheme |
real (ngrid) |
W/m2 |
地表感热通量,换算后并入扩散热通量积分 |
输出
| 输出 |
去向 |
类型/维度 |
单位 |
含义 |
pdu_th, pdv_th |
physiq 累加到 pdu/pdv |
real (ngrid,nlayer) |
m/s/s |
热羽流对水平风的 tendency |
pdt_th |
physiq 累加到 pdt |
real (ngrid,nlayer) |
K/s |
热羽流对温度的 tendency |
pdq_th |
physiq 累加到 pdq |
real (ngrid,nlayer,nq) |
kg/kg/s |
热羽流对 tracer 的 tendency |
lmax, zmaxth |
turb_mod/诊断 |
integer (ngrid), real (ngrid) |
layer index, m |
热羽流到达层号和插值高度 |
pbl_dtke |
PBL/TKE tendency |
real (ngrid,nlayer+1) |
model units/s |
可选热羽流 TKE tendency;默认 dtke_thermals=.false. 时为 0 |
hfmax |
turb_mod:hfmax_th / 诊断 |
real (ngrid) |
K m/s |
扩散和热羽流合并后的最大热通量诊断 |
wstar |
turb_mod:wstar / 下一时间步 surface layer |
real (ngrid) |
m/s |
自由对流速度尺度 |
共享状态与副作用
- 本例程读取
comtherm_h 的编译期参数;其中 GCM 默认 nsplit_thermals=10,qtransport_thermals=.true.,dtke_thermals=.false.。
- 本例程读取
comcstfi_h 中的 r、g、cpp,但不写入该模块。
- 本例程没有
SAVE 状态、没有文件 I/O,也不直接写 NetCDF;所有结果通过 intent(out) 参数返回给 physiq。
physiq_mod.F 在 calltherm .and. .not.turb_resolved 时调用本接口;若 calltherm 为假或 turbulence-resolved 路径启用,physiq 将 wstar 和 hfmax_th 清零。
conf_phys.F 中 calltherm 默认 .false.;源码禁止 calltherm 与 calladj 同时开启,并在 calltherm 开启但 callyamada4 或 callrichsl 未开启时打印强建议。
核心逻辑
- 将所有热羽流输出、诊断和累计数组清零,包括
pdu_th、pdv_th、pdt_th、pdq_th、pbl_dtke、fm_therm、entr_therm、detr_therm、heatFlux、zmaxth。
- 用热羽流之前已经累计的 tendency 构造输入状态:
zu = pu + pdu * ptimestep
zv = pv + pdv * ptimestep
zt = pt + pdt * ptimestep
- 若
qtransport_thermals 为真,pq_therm = pq + pdq * ptimestep
- 若
dtke_thermals 为真,把界面 TKE q2(:,l) 和 q2(:,l+1) 平均成层中心 q2_therm(:,l)。
- 令
zdt = ptimestep / nsplit_thermals,循环 isplit=1..nsplit_thermals 调用 thermcell_main_mars。每个子步长返回的热羽流高度、质量通量、卷入/脱离、热通量、浮力和垂直速度诊断按 fact=1/nsplit_thermals 做时间平均。
- 子步长内温度增量
d_t_the 乘以 ptimestep*fact 后累计到 d_t_ajs,并立即加回 zt 作为下一子步长输入;若存在 CO2 tracer,d_q_the(:,:,igcm_co2) 也按相同方式转成整步增量、累计并加回 pq_therm(:,:,igcm_co2)。
- 子步长结束后,按
masse=(pplev(:,l)-pplev(:,l+1))/g 计算层质量,用 fm_therm(l)-fm_therm(l+1)+entr_therm(l) 重算 detrmod。若 detrmod<0,源码通过减少 entr_therm 并把 detrmod 置零来避免负 detrainment。
- 以固定
ndt=10 调用 thermcell_dqup 输送 u、v、非 CO2 tracer 和可选 TKE。该例程内部再把 ptimestep 分成 ndt 个输送子步长,最后返回导数。
- 将输出写回:
pdu_th/pdv_th 直接取 d_u_ajs/d_v_ajs;非 CO2 pdq_th 直接取 d_q_ajs;CO2 pdq_th 由于累计的是整步 delta q,需要除以 ptimestep;pdt_th 由 d_t_ajs/ptimestep 得到。
- 用扩散位温 tendency、感热通量、热羽流温度 tendency 和热羽流底部热通量计算
hfmax,再按 wstar=(g*zmaxth*hfmax/pbl_teta)**(1/3) 更新自由对流速度尺度;若当前 zmax 不大于 0,则 wstar=0。
伪代码
calltherm_interface(...):
zero all thermals tendencies and diagnostics
zu = pu + pdu * ptimestep
zv = pv + pdv * ptimestep
zt = pt + pdt * ptimestep
if qtransport_thermals:
pq_therm = pq + pdq * ptimestep
if dtke_thermals:
q2_therm(l) = 0.5 * (q2(l) + q2(l+1))
zdt = ptimestep / nsplit_thermals
for each thermal substep:
thermcell_main_mars(..., zdt, zu, zv, zt, pq_therm, q2_therm, ...)
average mass fluxes, entrainment/detrainment, plume height, diagnostics
accumulate temperature delta into d_t_ajs
if CO2 tracer exists:
accumulate CO2 delta into d_q_ajs(:,:,igcm_co2)
update zt and CO2 tracer for next substep
masse = layer pressure thickness / g
detrmod = fm(l) - fm(l+1) + entr(l)
clip negative detrmod by reducing entrainment
thermcell_dqup(..., zu, d_u_ajs, ndt=10, limz)
thermcell_dqup(..., zv, d_v_ajs, ndt=10, limz)
for each non-CO2 tracer:
thermcell_dqup(..., pq_therm(:,:,iq), d_q_ajs(:,:,iq), ndt=10, limz)
if dtke_thermals:
thermcell_dqup(..., q2_therm, dq2_therm, ndt=10, limz)
pdu_th = d_u_ajs
pdv_th = d_v_ajs
pdt_th = d_t_ajs / ptimestep
pdq_th(non-CO2) = d_q_ajs
pdq_th(CO2) = d_q_ajs / ptimestep
pbl_dtke = layer/interface average of dq2_therm when enabled
combine diffusion heat flux and thermal heat flux
hfmax = max(wtth + wtdif)
wstar = cubic_root(g * zmaxth * hfmax / pbl_teta) if zmax > 0 else 0
参与的主题流程
| 主题 |
参与方式 |
主物理时间步 physiq |
physiq_mod.F 在 calltherm .and. .not.turb_resolved 条件下调用本接口,并把返回的热羽流 tendency 累加进全局 tendency |
| 边界层 / 对流 |
位于垂直扩散、surface layer 和重力波拖曳之后,负责热羽流对 PBL 中温度、动量和 tracer 的混合 |
| 配置系统 |
calltherm 控制是否进入该路径;calladj 不能与 calltherm 同开;源码建议搭配 callyamada4 和 callrichsl |
| 诊断输出 |
physiq 后续将 hfmax_th 和 wstar 作为统计/输出字段写出 |
写法特点
- 本文件是自由格式
.F90 模块,但仍使用 LMD 历史风格的长参数列表和 continuation。
thermcell_main_mars 负责热羽流主动变量的子步长演化;thermcell_dqup 负责质量通量已知后的被动输送,两者在本接口中分阶段耦合。
- CO2 tracer 被特殊处理:CO2 会影响
thermcell_main_mars 的极夜混合逻辑,因此它在主子步长循环中和温度一起更新;非 CO2 tracer 则后处理为被动输送。
limz 由 thermcell_main_mars 返回,后续输出和 thermcell_dqup 都只填到 limz;初始化保证未覆盖层保持 0。
wstar 明确滞后一时间步影响 surface layer,因为源码注释说明 surface layer 和 diffusion 在 thermals 之前调用。
复现要点
- 开启路径需要
callphys.def 或默认配置链中 calltherm=.true.;但 conf_phys.F 默认 calltherm=.false.。
- 不要同时开启
calltherm 和 calladj;源码会通过 abort_physic 中止。
- 若复现 thermal plume 方案,
comtherm_h 中 nsplit_thermals 是编译期参数,不是运行时 getin_p 参数;GCM 默认 10,MESOSCALE 默认 4。
qtransport_thermals=.true. 时才输出 tracer tendency;当前源码默认开启。
dtke_thermals=.false. 是当前默认,且注释标明仍为实验性质;复现实验若打开它,需要同时检查 q2 的层界面/层中心转换。
- CO2 tracer 的
pdq_th 单位转换不同于非 CO2 tracer:CO2 子步长累计的是 delta q,输出前必须除以 ptimestep。
wstar 和 hfmax 是下一时间步 surface layer gustiness 的反馈量,不应理解为同一时间步已经影响了本次 surface-atmosphere exchange。
待确认
tracer_mod, only: nqmx,noms 在本文件可见逻辑中未直接使用;待确认是否为历史接口保留。
pbl_teta 取 MINLOC(abs(dteta(ig,1:lmax(ig)))),若某格点 lmax(ig)=0 的 Fortran 切片行为和运行时保护需要结合编译器/上游 thermcell_main_mars 保证确认;源码随后仅用 zmax>0 控制 wstar,但 pbl_teta 赋值循环未显式跳过 lmax=0。
相关页面