conf_gcm.F90
路径
LMDZ.COMMON-6.3\LMDZ.COMMON\libf\dyn3d\conf_gcm.F90
所属目录/模块
LMDZ.COMMON\libf\dyn3d
文件定位
conf_gcm.F90 定义 SUBROUTINE conf_gcm(tapedef, etatinit),是串行动力运行配置读取中心。它通过 getin 为 control_mod、logic_mod、comconst_mod、serre_mod、sponge_mod 和 temps_mod 中的控制变量设置默认值和用户覆盖值,并在 etatinit 分支中处理 zoom 参数的一致性。
Mars 运行参与度
必经/条件经过:COMMON `dyn3d/gcm.F90` 和 MARS `phymars/nogcm.F90` 都调用 `conf_gcm(99,.TRUE.)` 读取 run.def 参数;当前 COMMON 源码已删除 `dyn3d/nogcm.F90`。
定义的符号
| 符号 |
类型 |
行号 |
作用 |
conf_gcm |
subroutine |
4 |
读取运行控制、物理/动力开关、耗散、sponge、zoom 和输出参数。 |
依赖的模块
| use 模块 |
only 列表 |
用途 |
待确认 |
IOIPSL 或 ioipsl_getincom |
- |
提供 getin。 |
取决于 CPP_IOIPSL。 |
control_mod |
多个控制变量 |
写入日期、步长、输出、tracer、planet_type、restart 等控制状态。 |
- |
infotrac |
type_trac |
设置 tracer 系统类型。 |
- |
assert_m |
assert |
检查 vert_prof_dissip、dzoomx/dzoomy 合法性。 |
- |
sponge_mod |
callsponge, mode_sponge, nsponge, tetasponge |
读取 sponge 配置。 |
- |
comconst_mod |
dissip/top-bound/ngroup 等 |
写耗散、顶边界和 pole grouping 参数。 |
- |
logic_mod |
tidal, purmats, ok_guide, read_start, iflag_phys, iflag_trac, ok_strato, ok_gradsfile, ok_limit, ok_etat0, moyzon_*, fxyhypb, ysinus, read_orop |
写主流程逻辑开关。 |
- |
serre_mod |
clon, clat, grossismx, grossismy, dzoomx, dzoomy, alphax, alphay, taux, tauy |
写 zoom 和网格映射参数。 |
- |
temps_mod |
calend |
写日历类型。 |
- |
调用的关键例程
| 被调用例程 |
所在模块/文件 |
调用位置 |
作用 |
getin |
IOIPSL/getin |
多处 |
读取每个配置键的用户覆盖值。 |
assert |
assert_m |
587, 897, 906 |
断言耗散 profile 和 zoom 范围。 |
stop/STOP 1 |
Fortran 运行时 |
多处 |
遇到互斥 sponge、非法 FFT、zoom 不一致时停止。 |
输入
| 输入 |
来源 |
类型/维度 |
单位 |
含义 |
tapedef |
调用参数 |
integer |
- |
旧式配置单元号;本实现主要通过 getin 读取。 |
etatinit |
调用参数 |
logical |
- |
为 true 时初始化 zoom 参数;false 时与 start 文件读入值比较。 |
run.def 等 getin 数据源 |
运行目录 |
文本配置 |
- |
用户配置覆盖来源。 |
输出
| 输出 |
去向 |
类型/维度 |
单位 |
含义 |
control_mod 变量 |
模块全局状态 |
多种 |
多种 |
nday/day_step/iphysiq/read_start/planet_type 等。 |
logic_mod 变量 |
模块全局状态 |
logical/integer |
- |
iflag_phys/ok_guide/purmats/read_orop 等开关。 |
comconst_mod 耗散和顶边界变量 |
模块全局状态 |
real/integer |
秒、Pa、km 等 |
耗散时间、sponge 和 top boundary 参数。 |
serre_mod zoom 变量 |
模块全局状态 |
real/logical |
度或无量纲 |
zoom 中心、放大率、形状和分支。 |
lunout/lmdz.out |
输出单元或文件 |
文本 |
- |
运行配置摘要。 |
共享状态与副作用
本例程集中写大量 module 全局变量;如果 lunout 不是 5 或 6,会打开 lmdz.out;会打印完整配置摘要;互斥 sponge、非法 FFT、zoom 与 start 不一致等会 STOP。
核心逻辑
- 设置并读取
lunout/prt_level。
- 读取日期、日历、运行长度、动力步长、物理步长、输出频率和 restart 选项。
- 读取耗散、顶边界和 sponge 参数,并检查两套 sponge 不可同时使用。
- 按
planet_type 设置行星相关默认值:例如 Titan tidal、Mars vert_prof_dissip=1。
- 读取
purmats/ok_guide/read_start/iflag_phys/iphysiq/cpofT/iflag_trac 等主开关。
- 读取 tracer、INCA、dyn output、filter、strato、limit/etat0/orography 开关。
- 在
etatinit=.false. 时,将 run.def zoom 参数与已读 start 状态比较;不一致即停止。
- 在
etatinit=.true. 时,直接设置 zoom 参数并计算 alphax/alphay。
- 打印配置摘要。
伪代码
initialize lunout and print level
for each run-control key:
set default
getin(key, variable)
configure dissipation, top boundary, sponge
configure planet-specific defaults
configure physics, tracers, outputs, filters
if not etatinit:
compare run.def zoom values with start-file values
else:
initialize zoom values from run.def/defaults
print all effective configuration values
参与的主题流程
| 主题 |
参与方式 |
| dynamics-time-integration |
提供 day_step/iperiod/purmats/ndynstep 等时间推进控制。 |
| restart-io |
提供 read_start/raz_date/timestart/ecritstart 等 restart 控制。 |
| transport-advection |
提供 iflag_trac/iapp_tracvl/force_conserv_tracer。 |
| dynphys-interface |
提供 iflag_phys/iphysiq/nsplit_phys。 |
写法特点
大量 Config Key/Desc/Def/Help 注释与 getin 调用成对出现,可作为自动生成配置说明的源材料。etatinit 分支保留了早期 defrun 注释语义,但实现已转为 getin。
复现要点
idissip 是旧 Mars/Generic 参数,会先写 dissip_period,随后 dissip_period 键可覆盖它。
use_filtre_fft 在 conf_gcm 内若为 true 会 STOP 1,入口程序也会再次拒绝串行 FFT filter。
- Mars 默认
vert_prof_dissip=1,其他非 Earth 行星默认 0。
iflag_top_bound>=1 与 callsponge=.true. 互斥。
待确认
tapedef 参数在当前 getin 路径中是否仍有实际作用,源码内未见直接读取。
cpofT 的 Mars 默认值为 false;实际 Mars 配置是否覆盖需运行配置确认。
相关页面