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 已是导数形式。最后,本例程把扩散热通量和热羽流热通量合并,更新 hfmaxwstar,供下一物理时间步的 surface-layer gustiness 使用。

定义的符号

符号 类型 行号 作用
calltherm_interface_mod module 1 封装热羽流模型和 physiq 之间的接口
calltherm_interface subroutine 43 准备输入场、执行热羽流子步长、输出热羽流 tendency 和 wstar 诊断

依赖的模块

use 模块 only 列表 用途 待确认
comtherm_h 未限制 读取 nsplit_thermalsqtransport_thermalsdtke_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 自由对流速度尺度

共享状态与副作用

核心逻辑

  1. 将所有热羽流输出、诊断和累计数组清零,包括 pdu_thpdv_thpdt_thpdq_thpbl_dtkefm_thermentr_thermdetr_thermheatFluxzmaxth
  2. 用热羽流之前已经累计的 tendency 构造输入状态:
    • zu = pu + pdu * ptimestep
    • zv = pv + pdv * ptimestep
    • zt = pt + pdt * ptimestep
    • qtransport_thermals 为真,pq_therm = pq + pdq * ptimestep
  3. dtke_thermals 为真,把界面 TKE q2(:,l)q2(:,l+1) 平均成层中心 q2_therm(:,l)
  4. zdt = ptimestep / nsplit_thermals,循环 isplit=1..nsplit_thermals 调用 thermcell_main_mars。每个子步长返回的热羽流高度、质量通量、卷入/脱离、热通量、浮力和垂直速度诊断按 fact=1/nsplit_thermals 做时间平均。
  5. 子步长内温度增量 d_t_the 乘以 ptimestep*fact 后累计到 d_t_ajs,并立即加回 zt 作为下一子步长输入;若存在 CO2 tracer,d_q_the(:,:,igcm_co2) 也按相同方式转成整步增量、累计并加回 pq_therm(:,:,igcm_co2)
  6. 子步长结束后,按 masse=(pplev(:,l)-pplev(:,l+1))/g 计算层质量,用 fm_therm(l)-fm_therm(l+1)+entr_therm(l) 重算 detrmod。若 detrmod<0,源码通过减少 entr_therm 并把 detrmod 置零来避免负 detrainment。
  7. 以固定 ndt=10 调用 thermcell_dqup 输送 uv、非 CO2 tracer 和可选 TKE。该例程内部再把 ptimestep 分成 ndt 个输送子步长,最后返回导数。
  8. 将输出写回:pdu_th/pdv_th 直接取 d_u_ajs/d_v_ajs;非 CO2 pdq_th 直接取 d_q_ajs;CO2 pdq_th 由于累计的是整步 delta q,需要除以 ptimesteppdt_thd_t_ajs/ptimestep 得到。
  9. 用扩散位温 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.Fcalltherm .and. .not.turb_resolved 条件下调用本接口,并把返回的热羽流 tendency 累加进全局 tendency
边界层 / 对流 位于垂直扩散、surface layer 和重力波拖曳之后,负责热羽流对 PBL 中温度、动量和 tracer 的混合
配置系统 calltherm 控制是否进入该路径;calladj 不能与 calltherm 同开;源码建议搭配 callyamada4callrichsl
诊断输出 physiq 后续将 hfmax_thwstar 作为统计/输出字段写出

写法特点

复现要点

待确认

相关页面