nonoro_gwd_ran_mod.F90
路径
LMDZ.MARS\libf\phymars\nonoro_gwd_ran_mod.F90
所属目录 / 模块
libf\phymars
文件定位
nonoro_gwd_ran_mod.F90 定义 FLott/J. Liu 系列的随机非地形重力波动量拖曳模块 nonoro_gwd_ran_mod。它在 physiq_mod.F 的 calllott_nonoro 分支中先于 nonoro_gwd_mix_mod 调用,按当前温度、风、压力、密度、Brunt-Vaisala 频率和网格面积构造一组离散重力波,沿垂直方向推进 EP flux,并把通量散度转换成纬向和经向风 tendency。
这个文件只计算动量拖曳:d_t 在出口前被置零,d_u 和 d_v 才会回加到 physiq 的 pdu/pdv。跨时间步记忆由 du_nonoro_gwd 和 dv_nonoro_gwd 保存,并通过 phyetat0_mod.F90 / phyredem.F90 从物理重启文件读取和写回。
定义的符号
| 符号 |
类型 |
行号 |
作用 |
nonoro_gwd_ran_mod |
module |
1 |
保存非地形 GW 随机拖曳入口、记忆数组和分配/释放例程 |
du_nonoro_gwd |
allocatable save array |
5 |
纬向风非地形 GW tendency 的 AR(1) 记忆项 |
dv_nonoro_gwd |
allocatable save array |
6 |
经向风非地形 GW tendency 的 AR(1) 记忆项 |
east_gwstress |
allocatable save array |
7 |
东向波应力剖面诊断数组 |
west_gwstress |
allocatable save array |
8 |
西向波应力剖面诊断数组 |
NONORO_GWD_RAN |
subroutine |
14 |
主计算入口,返回 d_u/d_v 动量拖曳 tendency 和 zustr/zvstr 累积应力 |
ini_nonoro_gwd_ran |
subroutine |
486 |
按 ngrid/nlayer 分配模块保存数组 |
end_nonoro_gwd_ran |
subroutine |
502 |
释放模块保存数组 |
依赖的模块
| use 模块 |
only 列表 |
用途 |
待确认 |
comcstfi_h |
g, pi, r |
重力加速度、圆周率和气体常数;用于高度、波数和密度相关计算 |
- |
ioipsl_getin_p_mod |
getin_p |
首次调用时读取 nonoro_gwd_* 调参键 |
- |
vertical_layers_mod |
presnivs |
用参考半层压力确定可复现的发射层 LAUNCH |
- |
geometry_mod |
cell_area |
用水平网格面积约束最小可解析波数 kstar |
- |
write_output_mod |
write_output |
输出 Brunt-Vaisala 频率、EP flux 和 du/dv_nonoro_gwd 诊断 |
- |
调用的关键例程
| 被调用例程 |
所在模块 / 文件 |
调用位置 |
作用 |
getin_p |
ioipsl_getin_p_mod |
167, 170, 176, 179, 182, 185 |
读取 nonoro_gwd_epflux_max/sat/rdiss/kmax/kmin/xlaunch |
abort_physic |
外部物理错误处理例程 |
191, 194 |
当物理时间步超过 24 h 或 nlayer < NW 时中止 |
write_output |
write_output_mod |
274, 443-444, 468-469 |
写出 nonoro_bv、U/V EP flux 和 U/V GW tendency |
ini_nonoro_gwd_ran |
本文件 |
phys_state_var_init_mod.F90:176-177 |
物理状态初始化阶段分配记忆数组 |
end_nonoro_gwd_ran |
本文件 |
phys_state_var_init_mod.F90:176 |
重新分配前释放旧数组 |
NONORO_GWD_RAN |
本文件 |
physiq_mod.F:1776-1783 |
在 calllott_nonoro 为真时计算非地形 GW 动量拖曳 tendency |
输入
| 输入 |
来源 |
类型/维度 |
单位 |
含义 |
ngrid, nlayer |
physiq |
integer scalar |
- |
水平格点数和垂直层数 |
DTIME |
physiq 的 ptimestep |
real scalar |
s |
物理时间步 |
cpnew, rnew |
physiq 当前热力属性 |
real (ngrid,nlayer) |
J kg-1 K-1 |
层内比热和气体常数 |
pp |
physiq 的 zplay |
real (ngrid,nlayer) |
Pa |
全层压力 |
zmax_therm |
physiq 的 zmax_th |
real (ngrid) |
m |
热羽最大高度;当前源码接口保留但未参与计算 |
pt, pu, pv |
physiq 状态 |
real (ngrid,nlayer) |
K, m s-1, m s-1 |
当前温度、纬向风、经向风 |
pdt, pdu, pdv |
physiq 已累计 tendency |
real (ngrid,nlayer) |
K s-1, m s-2, m s-2 |
用 state + DTIME*tendency 构造本方案看到的背景场 |
输出
| 输出 |
去向 |
类型/维度 |
单位 |
含义 |
zustr, zvstr |
physiq 局部数组 zustrhi/zvstrhi |
real (ngrid) |
动量通量量纲 |
垂直积分的 U/V 拖曳应力诊断 |
d_t |
physiq 的 d_t_hin,随后加到 pdt |
real (ngrid,nlayer) |
K s-1 |
接口保留;本文件出口前置零 |
d_u |
physiq 的 d_u_hin,随后加到 pdu |
real (ngrid,nlayer) |
m s-2 |
非地形 GW 对纬向风的拖曳 tendency |
d_v |
physiq 的 d_v_hin,随后加到 pdv |
real (ngrid,nlayer) |
m s-2 |
非地形 GW 对经向风的拖曳 tendency |
du_nonoro_gwd, dv_nonoro_gwd |
模块保存状态 / 重启文件 |
allocatable save arrays |
m s-2 |
AR(1) 平滑后的 U/V tendency 记忆项 |
共享状态与副作用
du_nonoro_gwd、dv_nonoro_gwd、east_gwstress、west_gwstress 声明为 SAVE 并通过 OpenMP THREADPRIVATE 保存线程私有状态。
firstcall、kmax、kmin、epflux_max、xlaunch、sat、rdiss 和 H0 也是 THREADPRIVATE,首次进入主例程时读取配置并缓存。
phyetat0_mod.F90:595-618 会尝试从 startphy_file 读取 du_nonoro_gwd 和 dv_nonoro_gwd;字段缺失或无 startphy 时清零。
phyredem.F90:370-372 在 calllott_nonoro 为真时把 du_nonoro_gwd 和 dv_nonoro_gwd 写入物理重启文件。
- 诊断输出包括
nonoro_bv、nonoro_u_epflux_tot、nonoro_v_epflux_tot、du_nonoro_gwd 和 dv_nonoro_gwd。
核心逻辑
- 首次调用时设置默认调参:
epflux_max=5.E-4、sat=1.5、rdiss=0.07、kmax=1.E-4、kmin=7.E-6、xlaunch=0.6,再用 getin_p 允许运行配置覆盖。
- 检查
DTIME <= DELTAT 且 nlayer >= NW,其中 DELTAT=24*3600,NW=NK*NP*NO=8。
- 用
pt/pu/pv + DTIME*pdt/pdu/pdv 得到本方案使用的当前背景温度和风,再由 rho = pp/(rnew*tt) 计算密度。
- 构造半层压力
PH、参考半层压力 HREF、对数压力高度 ZH、半层风 UH/VH 和 Brunt-Vaisala 频率 BV。
- 用
HREF(LL)/HREF(1) > xlaunch 选择发射层 LAUNCH;用 cell_area 形成 kstar=pi/sqrt(cell_area),并用 max(kmin,kstar) 限制波数下限。
- 对
NW=8 个离散波,使用背景温度和风场的 MOD(...) 派生方位角、水平波数、相速度、内禀频率和发射层 EP flux。这里不是调用随机数发生器,而是用场变量构造可复现的“随机”特征。
- 从
LAUNCH 向上推进 EP flux:每一层同时考虑守恒、rdiss 耗散、内禀频率变号的临界层截断,以及由 sat 控制的饱和上限。
- 在发射层以下几层做通量补偿,使总发射通量在低层闭合。
- 对 U/V EP flux 做垂直差分,换算为
d_u 和 d_v。
- 用
DTIME/DELTAT/REAL(NW) 与上一时间步的 du_nonoro_gwd/dv_nonoro_gwd 做 AR(1) 平滑,更新模块记忆数组,并把 d_t 置零。
- 对
d_u/d_v、密度和层厚积分,得到 zustr/zvstr 诊断应力。
伪代码
if firstcall:
read nonoro_gwd_* parameters
abort if DTIME > 24 h or nlayer < 8
background = state + DTIME * accumulated_tendencies
rho = pressure / (gas_constant * temperature)
build half-level pressure, log-pressure height, half-level winds, BV
LAUNCH = highest reference level with HREF(level) / HREF(surface) > xlaunch
for each wave jw and grid column:
derive azimuth and horizontal wavenumber from MOD(background fields)
derive phase speed and intrinsic frequency
set launch EP flux from epflux_max and local wind magnitude
for level from LAUNCH to model top:
update intrinsic frequency
limit EP flux by dissipation, critical level sign change, and saturation
accumulate zonal and meridional EP flux
close flux below LAUNCH
d_u, d_v = vertical divergence of U/V EP flux
apply AR(1) memory using du_nonoro_gwd and dv_nonoro_gwd
d_t = 0
save updated memory arrays and compute diagnostic stresses
参与的主题流程
| 主题 |
参与方式 |
| 非地形重力波 |
calllott_nonoro 打开后,本文件计算随机非地形 GW 动量拖曳 |
主物理时间步 physiq |
physiq_mod.F:1774-1816 调用本方案并把 d_t_hin/d_u_hin/d_v_hin 累加到 pdt/pdu/pdv |
| GW-induced mixing |
nonoro_gwd_mix_mod 在同一 calllott_nonoro 分支内、且 calljliu_gwimix 为真时接着执行 |
| 重启状态 |
du_nonoro_gwd/dv_nonoro_gwd 由 phyetat0_mod.F90 读取或清零,并由 phyredem.F90 写回 |
写法特点
- 源码用大写入口
NONORO_GWD_RAN,但模块名和初始化/释放例程用小写命名。
- “随机”波特征由
MOD(TT(...), 1.)、MOD(TT(...)**2, 1.) 和 MOD(100*(UU**2+VV**2), 1.) 派生,目的是避免并行分解改变结果。
zmax_therm 仍保留在接口中,但当前主例程没有使用它决定发射层;发射层来自 presnivs 和 xlaunch。
east_gwstress/west_gwstress 在初始化时清零,主例程中用于累加东西向波应力剖面;页面按源码字面记录,未推断其下游消费路径。
复现要点
- 必须设置
calllott_nonoro=.true.,否则 physiq 不会调用本文件;该开关在 conf_phys.F:365-367 默认 .false.。
- 可调键包括
nonoro_gwd_epflux_max、nonoro_gwd_sat、nonoro_gwd_rdiss、nonoro_gwd_kmax、nonoro_gwd_kmin、nonoro_gwd_xlaunch。
nlayer 必须不小于 NW=8,物理时间步不能超过 24 小时,否则 abort_physic 中止。
- 重启可重复性依赖
du_nonoro_gwd/dv_nonoro_gwd 是否从 start/restart 物理文件恢复;缺失时 phyetat0_mod.F90 清零。
- 水平网格面积会改变
kstar,从而改变允许的波数范围;不同网格分辨率不应期待完全一致的 GW forcing。
待确认
east_gwstress 和 west_gwstress 在本文件中维护,但本次检索未发现已写入重启文件或被其他源码文件读取。
zmax_therm 接口参数未参与当前计算;是否为历史热对流发射高度接口需要结合版本历史确认。
abort_physic 未在本文件显式 use,按当前源码字面视为外部可见的物理错误处理例程。
相关页面