surfdat_h.F90

路径

LMDZ.MARS\libf\phymars\surfdat_h.F90

所属目录 / 模块

libf/phymars

文件定位

surfdat_h.F90 定义 surfdat_h,是 Mars physics 中地表共享状态的集中声明模块。它保存裸地反照率、地表位势、粗糙度、次网格地形统计、水冰帽标志、地表 tracer、坡面温度/发射率/热容/导热通量、山顶地形和极冠参数,并提供按 ngrid,nq,nslope 分配和释放这些 allocatable 数组的例程。

定义的符号

符号 类型 行号 作用
surfdat_h module 1 地表共享状态模块。
ini_surfdat_h subroutine 61 分配完整地表状态数组,包括单坡面和坡面维度变量。
end_surfdat_h subroutine 95 逐项检查并释放完整地表状态数组。
ini_surfdat_h_slope_var subroutine 125 只分配依赖 nslope 的地表状态数组。
end_surfdat_h_slope_var subroutine 141 只释放依赖 nslope 的地表状态数组。

依赖的模块

本文件不 use 其他模块。维度全部由调用方通过 ngrid,nq,nslope 传入。

调用的关键例程

被调用例程 所在模块 / 来源 调用位置 作用
allocate Fortran intrinsic 行 68-88、132-138 分配地表共享数组。
allocated / deallocate Fortran intrinsic 行 101-120、147-153 防御性释放已分配数组。

主要被调用点

调用方 源码位置 调用 用途
phys_state_var_init_mod.F90 行 39、132-133 end_surfdat_h; ini_surfdat_h(ngrid,nq,nslope) 按当前物理网格、tracer 数和坡面数重建地表状态数组。
dynphy_lonlat/phymars/newstart.F 行 29-32、1832-1833 end_surfdat_h_slope_var; ini_surfdat_h_slope_var(ngridmx,nqtot,nslope_new) newstart 改变坡面维度时只重分配 slope-var 数组。
dyn1d/init_testphys1d_mod.F90 行 16-18、505-506 end_surfdat_h_slope_var; ini_surfdat_h_slope_var(1,nq,nslope) 1D 初始化中按最终坡面数重建坡面地表数组。

输入

输入 来源 类型 / 维度 单位 含义
ngrid 调用方 integer scalar columns 物理列数;用于第一维。
nq 调用方 integer scalar tracers tracer 数;用于 qsurf(ngrid,nq,nslope)
nslope 调用方 integer scalar slopes 次网格坡面数;用于坡面维度数组。

输出

输出 去向 类型 / 维度 单位 含义
albedodat, phisfi, z0, zmea/zstd/zsig/zgam/zthe 多个物理模块 allocatable (ngrid) 混合 裸地反照率、地表位势、粗糙度和次网格地形统计。
watercaptag, dryness 水循环/地表交换模块 allocatable (ngrid) logical / scalar 水冰帽标记和地表水冰 sublimation dryness 系数。
qsurf, tsurf, watercap, perennial_co2ice, emis, capcal, fluxgrd 地表能量和 tracer 流程 allocatable (ngrid,nq,nslope)(ngrid,nslope) 混合 坡面地表 tracer、温度、冰量、发射率、热容和导热通量。
hmons, summit, base, alpha_hmons, hsummit, contains_mons 山顶地形/尘暴流程 allocatable (ngrid) 混合 亚格点山顶地形及面积分数。

共享状态与副作用

surfdat_h 本身就是共享状态模块。多数变量带 !$OMP THREADPRIVATE,说明 OpenMP 线程各有一份模块状态;分配、释放和赋值顺序必须与物理初始化流程一致。分配例程只分配数组,不初始化物理数值;实际填充值来自 phyetat0_mod.F90surfini_mod.F90topmons_mod.F90、配置读取和 restart 读取等流程。

核心逻辑

  1. 模块头部声明地表静态参数、allocatable 数组和 OMP threadprivate 属性。
  2. ini_surfdat_hngrid,nq,nslope 分配所有 allocatable 地表数组。
  3. end_surfdat_h 对每个完整数组执行 if (allocated(...)) deallocate(...)
  4. ini_surfdat_h_slope_var 只分配 qsurf/tsurf/watercap/perennial_co2ice/emis/capcal/fluxgrd
  5. end_surfdat_h_slope_var 只释放同一组坡面维度数组,供 1D/newstart 改坡面数时复用。

伪代码

ini_surfdat_h(ngrid,nq,nslope):
    allocate all one-dimensional surface arrays over ngrid
    allocate qsurf over ngrid,nq,nslope
    allocate slope-dependent surface arrays over ngrid,nslope
    allocate mountain/topography arrays over ngrid

end_surfdat_h():
    for each allocatable array:
        if allocated, deallocate it

参与的主题流程

主题 参与方式
物理状态初始化 phys_state_var_init 先释放再分配本模块数组,建立后续物理流程共享状态。
地表 / 水循环 surfini, vdifc, soilwater, waterice_tifeedback 等读取或写入 watercaptag/dryness/qsurf/watercap/tsurf
地形重力波 calldrag_noro 读取 zstd/zsig/zgam/zthe 作为次网格地形输入。
山顶地形尘流 topmons_modrocketduststorm_mod 读取或写入 hmons/summit/base/alpha_hmons/contains_mons
地表辐射参数 albedocaps, co2snow, co2condens, tabfi 等使用反照率、发射率、冰粒半径和粗糙度参数。

写法特点

复现要点

待确认

相关页面