phyredem.F90

路径

LMDZ.MARS\libf\phymars\phyredem.F90

所属目录 / 模块

libf/phymars

文件定位

phyredem.F90 是物理 start/restart 文件写出模块。它通过 iostartopen_restartphyput_varput_fieldclose_restartphy 创建或追加 startfi.nc/restartfi.nc 物理状态文件:physdem0 写控制表、网格和静态地表字段;physdem1 写带时间的表面、土壤、tracer、尘埃、云分数、重力波、吸附、古气候和 tracer 质量修正状态。

读入端对应 phyetat0_mod。复现一次 restart 续跑时,phyredem 写出的字段名、是否带时间轴、以及哪些开关控制字段存在,都会决定下一次 phyetat0 能恢复哪些物理记忆。

定义的符号

符号 类型 行号 作用
phyredem module 1 物理 start/restart 写出模块
physdem0 subroutine 9 创建物理文件并写 time-independent 控制表、网格、地表和坡面字段
physdem1 subroutine 194 写 time-dependent 物理状态、tracer、土壤、尘埃、GW、古气候和质量修正字段

依赖的模块

use 模块 only 列表 用途 待确认
comsoil_h inertiedat, volcapa, mlayer physdem0 写土壤深度和控制表土壤热容量;inertiedat 在源码中未直接使用 inertiedat unused
geometry_mod cell_area 写物理格点面积 -
surfdat_h zmea, zstd, zsig, zgam, zthe, z0_default, albedice, emisice, emissiv, iceradius, dtemisice, phisfi, z0, hmons, summit, base, watercaptag 写地表、次网格地形、水冰标签和控制表极冠/粗糙度参数 -
dimradmars_mod tauvis 写控制表平均可见光学厚度 -
iostart open_restartphy, close_restartphy, put_var, put_field, length, ldscrpt, ndscrpt 创建/打开物理 restart 文件并写变量/字段 -
mod_grid_phy_lmdz klon_glo 写控制表物理网格总列数 -
planete_h aphelie, emin_turb, lmixmin, obliquit, peri_day, periheli, year_day 写控制表行星轨道和边界层参数 -
comcstfi_h g, mugaz, omeg, rad, rcp 写控制表物理常数 -
time_phylmdz_mod daysec 写控制表 sol 长度 -
comslope_mod nslope 声明坡面维度并写坡面分布 -
tracer_mod noms, igcm_co, igcm_o2, igcm_h2, igcm_ho2, igcm_h2o2, igcm_n2, igcm_ar, igcm_he 按 tracer 名称写地表 tracer,按索引写质量修正标量 -
nonoro_gwd_ran_mod du_nonoro_gwd, dv_nonoro_gwd 写非地形随机重力波记忆 tendency -
compute_dtau_mod dtau 写尘埃光学厚度情景差值 -
dust_rad_adjust_mod dust_rad_adjust_prev, dust_rad_adjust_next 写尘埃辐射调整前后状态 -
dust_param_mod dustscaling_mode 控制是否写尘埃辐射调整字段 -
comsoil_h flux_geo, adsorption_soil, igcm_h2o_vap_soil, igcm_h2o_ice_soil, igcm_h2o_vap_ads 写地热通量和可选吸附土壤水字段 -
paleoclimate_mod paleoclimate, h2oice_depth, co2ice_depth, coef_ssdif 控制并写古气候地下冰字段 源码中 paleoclimateuse 两次
tracer_mass_fixer_dyn_mod call_mass_fixer_dyn, mass_predyn 写 8 个大气成分的前一步全局质量标量 -
callkeys_mod calltherm, dustinjection, calllott_nonoro, CLFvarying 控制 wstardtau、非地形 GW 和云分数字段是否写出 -

调用的关键例程

被调用例程 所在模块 / 文件 调用位置 作用
open_restartphy iostart.F90 87, 248 创建或打开目标 startfi.nc / restartfi.nc
put_var iostart.F90 139, 142, 145, 184, 252, 398-419 写控制表、描述符、土壤深度、坡面 bin 边界、Time 和质量修正标量
put_field iostart.F90 多处 写网格、地表、土壤、tracer、尘埃、GW、古气候等数组字段
close_restartphy iostart.F90 188, 424 关闭目标 NetCDF 文件

输入

输入 来源 类型/维度 单位 含义
filename 调用方 character - 待创建或追加的物理文件,常见为 restartfi.ncstartfi.nc
lonfi, latfi physdem0 调用方 real(ngrid) degrees 物理格点经纬度
nsoil, ngrid, nlay, nq, nqsoil 调用方 integer - 土壤层、物理格点、垂直层、tracer 和土壤 tracer 数量
phystep 调用方 real s 物理时间步;physdem0 写入控制表,physdem1 声明但未直接使用
day_ini, time 调用方 real sol / sol fraction 初始日期和当前时间;physdem1 首先写 Time
airefi physdem0 调用方 real(ngrid) m^2 传入网格面积;源码实际写 geometry_mod::cell_area 而非该实参
alb, ith physdem0 调用方 real(ngrid), real(ngrid,nsoil) - / SI 裸地反照率和当代土壤热惯量
def_slope, subslope_dist physdem0 调用方 real(nslope+1), real(ngrid,nslope) - 坡面 bin 边界和次网格坡面分布
tsurf, tsoil, inertiesoil, albedo, emis, q2, qsurf, qsoil physdem1 调用方 arrays 混合 当前物理状态、表面/土壤/tracer 状态
tauscaling, totcloudfrac, wstar, watercap, perennial_co2ice physdem1 调用方 arrays 混合 尘埃缩放、云分数、热羽流速度、水冰库和常年 CO2 冰

输出

输出 去向 类型/维度 单位 含义
controle, controle_descriptor, soildepth 目标 NetCDF 文件 variables 混合 控制表、控制表槽位说明和土壤中层深度
longitude, latitude, area 目标 NetCDF 文件 fields degrees / m^2 物理网格坐标和面积
phisfi, albedodat, ZMEA, ZSTD, ZSIG, ZGAM, ZTHE, hmons, summit, base, z0, watercaptag 目标 NetCDF 文件 fields 混合 静态地表、次网格地形、粗糙度和水冰标签
def_slope, subslope_dist 目标 NetCDF 文件 variable/field - 坡面 bin 边界和坡面分布
Time 目标 NetCDF 文件 scalar/time variable sol 当前写出时间;必须先写以设置 iostart 的时间索引
watercap, perennial_co2ice, tsurf, inertiesoil, tsoil, albedo, emis, q2 目标 NetCDF 文件 time-dependent fields 混合 主要物理表面、土壤和 PBL restart 状态
totcloudfrac, tauscaling, dust_rad_adjust_prev/next, dtau, wstar 目标 NetCDF 文件 conditional fields 混合 云分数、尘埃缩放/调整、尘埃注入记忆和热羽流记忆
surface tracer fields 目标 NetCDF 文件 real(ngrid,nslope) per tracer kg/m^2 或源码定义 地表 tracer 储量;特定 tracer 会跳过或改名
du_nonoro_gwd, dv_nonoro_gwd 目标 NetCDF 文件 arrays tendency 非地形随机 GW 记忆项
flux_geo, h2o_vap_soil, h2o_ice_soil, h2o_vap_ads 目标 NetCDF 文件 fields 混合 地热通量和可选吸附土壤水字段
h2oice_depth, co2ice_depth, coef_ssdif 目标 NetCDF 文件 fields m / - 古气候地下冰和扩散系数字段
mass_predyn_co/o2/h2/ho2/h2o2/n2/ar/he 目标 NetCDF 文件 scalar variables kg 动力 tracer 质量修正的前一步全局质量

共享状态与副作用

核心逻辑

  1. physdem0 打开目标文件,构造长度为 iostart::lengthtab_cntrl 控制表。
  2. 控制表写入网格总点数、垂直层数、初始日/时刻、火星物理常数、行星轨道参数、PBL 参数、极冠反照率/发射率、尘埃平均光学厚度和土壤体积热容量。
  3. physdem0controle_descriptorsoildepth、经纬度、网格面积、地表位势、裸地反照率、次网格地形统计量、土壤热惯量、粗糙度、水冰标签和坡面分布,然后关闭文件。
  4. physdem1 打开目标文件,并首先写 Timeiostart 用该变量推进/设置后续 time-dependent 字段的时间索引。
  5. physdem1 写水冰库、可选常年 CO2 冰、表面温度、土壤热惯量、土壤温度、反照率第一谱段、发射率和 PBL q2
  6. 根据开关写云分数、尘埃缩放、尘埃辐射调整、dtau、热羽流 wstar
  7. 扫描 tracer_mod::noms 找水汽/水冰和 HDO 汽/冰 tracer;随后逐 tracer 写地表 qsurf,但跳过已由其他字段表示或无地表储量意义的 tracer。
  8. 根据开关写非地形随机 GW 记忆、地热通量、吸附土壤水字段、古气候地下冰字段和 tracer 质量修正标量。
  9. 关闭目标文件。

伪代码

physdem0(filename, ...)
  open_restartphy(filename)
  tab_cntrl = 0
  fill tab_cntrl with grid size, date, constants, orbit, PBL, caps, dust, soil
  put_var controle and descriptor
  put_var soildepth
  put_field longitude, latitude, area
  put_field static surface/topography/roughness/water tag fields
  put_var def_slope
  put_field subslope_dist
  close_restartphy

physdem1(filename, ...)
  open_restartphy(filename)
  put_var Time first
  put_field main time-dependent surface and soil states
  if option enabled: put cloud, dust, thermal, GW, adsorption, paleoclimate fields
  for each tracer name:
    skip h2o_vap/hdo_vap when matching ice tracer exists
    skip co2_ice because CO2 ice is included in qsurf(:,igcm_co2)
    put_field surface tracer using trim(name)
  if call_mass_fixer_dyn:
    put_var mass_predyn_* for existing target tracers
  close_restartphy

参与的主题流程

主题 参与方式
物理 restart 输出 restartfi.nc,供下一段运行的 phyetat0_mod 读取
1D startfi 生成 testphys1d.F90 在缺少 start 文件时调用 physdem0/physdem1startfi.nc
newstart 初始场生成 newstart.F 写动力 restart 后调用本模块写物理 restartfi.nc
次网格坡面 def_slopesubslope_dist,供下一次初始化恢复坡面分布
水循环 / HDO watercap、地表 water/HDO tracer 和可选土壤吸附水字段
CO2 循环 / 古气候 perennial_co2ice、CO2 地表 tracer 关系和古气候地下 CO2 冰深度
尘埃循环 tauscaling、可选 dust_rad_adjust_prev/nextdtau
非地形重力波 du_nonoro_gwddv_nonoro_gwd 记忆项
tracer 质量修正 mass_predyn_* 标量,供下一次 phyetat0_mod 恢复质量修正参考值

写法特点

复现要点

待确认

相关页面