surfini_mod.F90

路径

LMDZ.MARS\libf\phymars\surfini_mod.F90

所属目录 / 模块

libf/phymars

文件定位

surfini_mod.F90 负责初始化永久水冰帽标记 watercaptag 和地表水冰蒸发 dryness 系数。主例程 surfini 根据 callkeys_mod::water 和模块变量 icelocationmode 选择水冰分布来源:surface.nc 热惯量、预定义分辨率、经纬度逻辑、可移植 64x48 手工边界、startfi.nc 已存标签,或 inertiedat 第一层。它在非 mesoscale 并行路径中先把纬度、经度、watercaptaginertiedat gather 到全局网格,在 master 上判定后再 scatter 回本地物理列。

定义的符号

符号 类型 行号 作用
surfini_mod module 1 封装水冰帽初始化逻辑和 icelocationmode
icelocationmode integer module variable 14 控制水冰帽定位方式,默认 5
surfini subroutine 22 初始化 watercaptagdryness,并按模式更新水冰帽分布。
locate_watercaptag subroutine 517 用 120 个手工经纬度网格边界为任意分辨率定位水冰帽。

依赖的模块

use 模块 only 列表 用途 待确认
ioipsl_getin_p_mod getin_p 读取 icedryness -
netcdf 全模块 打开并读取 surface.nc -
tracer_mod nqmx, noms qsurf tracer 维度和名称上下文。 -
geometry_mod longitude, latitude, cell_area 经纬度判定和诊断。 -
surfdat_h watercaptag, frost_albedo_threshold, albedo_h2o_cap, inert_h2o_ice, albedodat, albedice, dryness 读取/写入水冰帽、反照率和 dryness 共享状态。 frost_albedo_threshold, inert_h2o_ice, albedice 在本文件读取路径需后续细查是否只为接口历史保留。
mod_grid_phy_lmdz klon_glo, nbp_lon, nbp_lat 全局物理列数和经纬网格维度。 -
mod_phys_lmdz_para is_master, gather, scatter 并行全局判定和本地回填。 -
comsoil_h inertiedat, nsoilmx 模式 6 用热惯量首层判定水冰。 -
comcstfi_h pi 经纬度弧度/角度换算。 -
datafile_mod datadir 定位 surface.nc -
callkeys_mod water 控制是否初始化水循环水冰帽。 -

调用的关键例程

被调用例程 所在模块 / 文件 调用位置 作用
getin_p ioipsl_getin_p_mod 行 167 读取 icedryness,默认 1。
gather / scatter mod_phys_lmdz_para 行 177-180、506-507 非 mesoscale 并行路径中全局收集和回填 dryness/watercaptag
nf90_open, nf90_inq_varid, nf90_get_var, nf90_close NetCDF 行 212-235 模式 1 从 surface.nc 读取 thermal 场。
abort_physic 物理错误处理 行 214、223、231、379、480 缺文件、缺变量、未知分辨率或错误模式时终止。
locate_watercaptag 本文件 行 448 模式 4 用手工边界定位水冰帽。

输入

输入 来源 类型 / 维度 单位 含义
ngrid 调用方 integer scalar columns 本地物理列数。
nslope 调用方 integer scalar slopes 坡面数;用于遍历 qsurf
qsurf surfdat_h / 调用方 real (ngrid,nqmx,nslope), inout kg m-2 地表 tracer 储量;mesoscale 分支会置零。
icelocationmode 模块变量 / phyetat0_mod integer - 水冰帽定位方式。
water callkeys_mod logical - 若为假,非 mesoscale 路径把 watercaptag(:)=.false.

输出

输出 去向 类型 / 维度 单位 含义
watercaptag surfdat_h logical (ngrid) - 永久水冰帽标记。
dryness surfdat_h real (ngrid) - 地表水冰蒸发 dryness 系数。
albedodat surfdat_h real (ngrid) - mesoscale 水冰 outlier 分支会改为 albedo_h2o_cap

共享状态与副作用

surfinisurfdat_h::watercaptagdryness,在 mesoscale 分支还会改写 qsurf 和部分 albedodat。非 mesoscale 模式 1 读取外部 NetCDF 文件 datadir/surface.nc 中的 thermal 变量;多个错误路径调用 abort_physic。例程还向标准输出打印模式、dryness、冰帽位置和错误提示。

核心逻辑

  1. 若是 mesoscale 编译分支,逐格按纬度和反照率 outlier 条件设置 watercaptag/dryness/albedodat,并把 qsurf 置零。
  2. 非 mesoscale 且 water=.true. 时,读取 icedryness,初始化 dryness(:)
  3. gather 纬度、经度、watercaptaginertiedat 到全局数组。
  4. master 根据 icelocationmode 执行 1-6 的分支逻辑。
  5. master 打印水冰帽位置,随后 scatter dryness_glowatercaptag_glo 回本地。
  6. water=.false.,设置 watercaptag(:)=.false.

伪代码

if MESOSCALE:
    build simple watercaptag from latitude and albedodat
else:
    if water:
        icedryness = getin_p("icedryness", default=1)
        gather latitude, longitude, watercaptag, inertiedat
        if is_master:
            select icelocationmode:
                1: read surface.nc thermal and preserve area by latitude bins
                2: use hard-coded 32x24 or 64x48 index lists
                3: use latitude/longitude logical rules
                4: call locate_watercaptag
                5: keep startfi.nc watercaptag
                6: use inertiedat first soil layer in northern hemisphere
        scatter dryness and watercaptag
    else:
        watercaptag = false

参与的主题流程

主题 参与方式
水循环 决定永久水冰帽位置,影响地表升华、霜/冰反照率和水 tracer 地表库。
初始状态 / restart phyetat0_mod 在缺少 watercaptag 时把 icelocationmode 切到 4;模式 5 直接使用 startfi 数据。
1D / archive 工具 start2archivephysiq 都可调用 surfinilect_start_archive 读取 locate_watercaptag

写法特点

复现要点

待确认

相关页面