defrun_new.F

路径

LMDZ.MARS\libf\dynphy_lonlat\phymars\defrun_new.F

所属目录/模块

libf/dynphy_lonlat/phymars

文件定位

GCM 运行参数配置文件读取器。defrun_new 打开并解析 run.def,将时间步进、耗散参数、网格缩放(zoom)、海绵层、物理过程频率和起始输出等控制参数写入 control_mod/logic_mod/serre_mod/sponge_mod 等公共模块变量,供后续动力-物理循环使用。仅在非并行(#ifndef CPP_PARA)模式下编译。

定义的符号

符号 类型 行号 作用
defrun_new subroutine 1 读取 run.def 运行参数

依赖的模块

use 模块 only 列表 用途 待确认
ioipsl_getincom getin run.def 读取键值对
sponge_mod callsponge, nsponge, mode_sponge, tetasponge 海绵层控制参数
control_mod ndynstep, day_step, iperiod, iconser, dissip_period, iphysiq, anneeref, ecritstart, timestart, nday_r 运行控制参数
logic_mod hybrid, purmats, fxyhypb, ysinus, iflag_phys 逻辑开关
serre_mod clon, clat, grossismx, grossismy, dzoomx, dzoomy, alphax, alphay, taux, tauy 网格缩放(zoom)参数

INCLUDE 头文件

头文件 用途
dimensions.h 网格维度参数
paramet.h 物理参数
comdissnew.h 耗散参数公共块(lstardis/nitergdiv/nitergrot/niterh/tetagdiv/tetagrot/tetatemp/coefdis
iniprint.h 输出单元 lunout

调用的关键例程

被调用例程 所在模块/文件 调用位置 作用
getin ioipsl_getincom 多处 run.def 文件读取各配置键值

输入

输入 来源 类型/维度 单位 含义
tapedef 调用方 INTEGER run.def 文件使用的 Fortran 单元号(通常 99)
etatinit 调用方 LOGICAL .true. 表示由 newstart 调用(初始化模式),.false. 表示由 GCM 主循环调用(一致性校验模式)

输出

本例程无显式输出参数,所有配置值通过 USE 关联的模块变量传出。

共享状态与副作用

通过 USE 模块变量大量写入:

核心逻辑

  1. 初始化:设 anneeref=0(火星无参考年),打开 run.def 验证存在性后关闭(后续 getin 自行打开),配置 lunout 输出单元。
  2. 时间步进参数:依次读取 nday(默认 1 天)、ndynstep(若 > 0 则覆盖 nday)、day_step(默认 960 步/天)、iperiod(Matsuno 周期,默认 5 步,须整除 day_step)、iconser(控制输出周期,默认 120 步)。
  3. 耗散参数dissip_period(默认 5 步)、lstardis(star 算子,默认 .true.)、nitergdiv/nitergrot/niterh(迭代次数,默认 1/2/2)、tetagdiv/tetagrot/tetatemp(耗散时标,默认 4000/5000/5000 s)、coefdis(默认 0)。
  4. 积分方案hybrid(混合坐标,默认 .true.)、purmats(纯 Matsuno,默认 .false.)、iflag_phys(物理开关,默认 1)、iphysiq(物理周期,默认 20 步,须整除 day_step)。
  5. 起始输出timestart(起始日期,默认 -9999)、ecritstart(start.nc 写出频率,须为 iphysiq 倍数)。
  6. Zoom 参数etatinit 分支):
    • GCM 模式(.false.:读取 zoom 参数并与 start 文件中已有值做一致性校验,不一致则 STOP
    • 初始化模式(.true.:直接读取 clon(默认 63°)、clat(默认 0°)、grossismx/grossismy(默认 1.0)、fxyhypb(默认 .false.)、dzooomx/dzooomy(默认 0)、taux/tauy(默认 2.0),并从 grossismx 计算 alphax = 1 - 1/grossismx
  7. 海绵层callsponge(默认 .true.)、nsponge(默认 3 层)、mode_sponge(默认 2)、tetasponge(默认 30000 s)。
  8. 后处理ysinus=.false.(火星固定正则网格);无 zoom 时强制 fxyhypb=.false.,有 zoom 时须 fxyhypb=.true. 否则 STOP

伪代码

SUBROUTINE defrun_new(tapedef, etatinit)
  anneeref ← 0
  OPEN run.def → verify exists → CLOSE
  configure lunout

  -- 时间步进 --
  getin nday, ndynstep, day_step, iperiod, iconser

  -- 耗散 --
  getin dissip_period, lstardis, nitergdiv, nitergrot, niterh
  getin tetagdiv, tetagrot, tetatemp, coefdis

  -- 积分方案 --
  getin hybrid, purmats, iflag_phys, iphysiq

  -- 起始输出 --
  getin timestart, ecritstart

  -- Zoom(分支)--
  IF .NOT.etatinit THEN  ! GCM 模式
    getin clon/clat/grossismx/grossismy/fxyhypb/dzoomx/dzoomy/taux/tauy
    校验与 start 文件一致
  ELSE  ! 初始化模式
    getin 同上,直接赋值
    alphax ← 1 - 1/grossismx
    alphay ← 1 - 1/grossismy
  ENDIF

  -- 海绵层 --
  getin callsponge, nsponge, mode_sponge, tetasponge

  ysinus ← .false.
  IF no zoom THEN fxyhypb ← .false.
  IF zoom AND NOT fxyhypb THEN STOP
END SUBROUTINE

参与的主题流程

主题 参与方式
GCM 运行配置 run.def 读取全部运行参数,驱动整个模拟流程
网格缩放(Zoom) 读取并校验 zoom 参数,控制网格加密区域

写法特点

复现要点

待确认

相关页面