misc 总览

路径

LMDZ.COMMON-6.3\LMDZ.COMMON\libf\misc

职责

libf/misc 收纳 COMMON 中跨动力、物理和工具程序复用的辅助代码:NetCDF95 wrapper、IOIPSL/getin 兼容实现、重网格和插值、PCHIP/spline、runtime option、tracer parser、字符串工具、job walltime helper、通用数值 helper、气象/坐标/日期工具、排序和断言基础。Mars archive utility 的 NetCDF 文件读写主要是 Mars 侧直接 NF_* API,不等价于 COMMON netcdf95 wrapper 调用。

Mars 运行参与度:必经条件经过 混合。Mars 物理通过 phy_common/ioipsl_getin_p_mod.F90 调用 getin_p,在无 IOIPSL 时落到本目录 ioipsl_getincom.F90;Mars/COMMON 动力和工具链也会经由 new_unit_mnetcdf95q_satpres2levformcoord 等 helper。

目录内容

分组 代表文件 作用
NetCDF95 wrapper netcdf95-wrappers.md, Mars utility NetCDF 边界 封装 nf90_* open/define/read/write/attribute 操作,统一可选 ncerrhandle_err;Mars utility 页记录这些 wrapper 与 Mars 侧 NF_* archive 读写的边界。
IOIPSL/getin ioipsl-getin-system.md, ioipsl_getincom.md, ioipsl-local-support.md 提供 getin fallback、字符串解析、错误级别和并行 getin_p 调度说明;ioipsl_getincom.F90 主文件页展开文件来源、key 表和 typed parser。
Runtime option program-options.md, job.md 命令行 option parser、--version--auto-exit 和调度系统 walltime 查询。
Tracer/string parser readTracFiles_mod.md, strings_mod.md 当前 tracer/isotope 文件解析、phase/metadata 数据库和通用字符串工具。
重网格/插值 regridding-interpolation.md 1D/3D 线性重采样、保守重采样和 binary hunt/locate helper。
PCHIP/spline pchip-spline.md SLATEC PCHIP 单调 cubic Hermite 插值、导数构造和 F90 包装。
数值 helper numerical-helpers.md Van Leer slope limiter、三次多项式系数、NetCDF simple wrapper 和 arithmetic progression。
大气坐标 helper atmospheric-coordinate-helpers.md 饱和比湿、压力层插值、GrADS 坐标格式和 Julian date。
基础工具 utility-foundation.md quicksort/insertion sort、assert/assert_eq、Numerical Recipes kind 常量。
输出 helper write-field-debug.md, wxios 旧式 debug 写场、物理列 gather dump 和 XIOS context/domain/field helper;XIOS 临时 dump 另见 phy_common 组页。

关键调用关系

复现要点

  1. getin_pphy_common/ioipsl_getin_p_mod.F90 使用 is_master 调用 getin,然后广播结果;复现并行配置读取必须保留 master-read/bcast 顺序。
  2. NetCDF95 wrapper 的模式是:调用 nf90_*,若调用方提供 ncerr 则返回错误码,否则调用 handle_err 终止。
  3. 重网格和 slope helper 假设坐标数组有序;保守重采样还假设源/目标 cell bounds 可逐段推进。

待确认

相关页面