在 WRF(Weather Research and Forecasting Model)中,restart 文件通常用于模拟过程中的时间序列模拟。通过保存模拟过程中的某个时间点的状态信息,可以在模拟中断后重新开始而不必从头开始计算,从而节省时间和计算资源。要使用 WRF 的 restart 功能,通常需要执行以下步骤:
在 WRF 模拟运行过程中定期保存 restart 文件,以便在需要时重新加载状态信息。
在需要重启模拟时,修改 WRF 的配置文件,指定加载之前保存的 restart 文件。
重新运行 WRF 模拟,并指定加载之前保存的 restart 文件作为初始状态。这样 WRF 就会从保存的状态信息开始模拟,而不必重新初始化。
Step 1: 首先是产生restart文件,主要涉及namelist.input文件中restart_interval和restart参数,如下图所示:此时除了会生成wrfout文件,也会生成wrfrst文件(时间间隔1小时),用于重启动。
restart = .false., &首次运行不开启restart_interval = 60, &重新启动输出文件间隔(分钟)
&time_control
run_days = 0,
run_hours = 0,
run_minutes = 0,
run_seconds = 0,
start_year = 2015, 2000, 2000,
start_month = 02, 01, 01,
start_day = 14, 24, 24,
start_hour = 06, 12, 12,
end_year = 2015, 2000, 2000,
end_month = 02, 01, 01,
end_day = 14, 25, 25,
end_hour = 12, 12, 12,
interval_seconds = 21600
input_from_file = .true.,.true.,.true.,
history_interval = 60, 60, 60,
frames_per_outfile = 1, 1000, 1000,
restart = .false.,
restart_interval = 60,
io_form_history = 2
io_form_restart = 2
io_form_input = 2
io_form_boundary = 2
Step 2: 需要重启模拟时,修改 WRF 的namelist.input文件,指定加载之前保存的 wrfrst 文件。相关参数修改为:重新运行wrf.exe。
start_year = 2015, & 重新运行的开始时间start_month = 02, start_day = 14, start_hour = 06, restart = .true., &重启动开启。
&time_control
run_days = 0,
run_hours = 0,
run_minutes = 0,
run_seconds = 0,
start_year = 2015, 2000, 2000,
start_month = 02, 01, 01,
start_day = 14, 24, 24,
start_hour = 06, 12, 12,
end_year = 2015, 2000, 2000,
end_month = 02, 01, 01,
end_day = 14, 25, 25,
end_hour = 12, 12, 12,
interval_seconds = 21600
input_from_file = .true.,.true.,.true.,
history_interval = 60, 60, 60,
frames_per_outfile = 1, 1000, 1000,
restart = .true.,
restart_interval = 60,
io_form_history = 2
io_form_restart = 2
io_form_input = 2
io_form_boundary = 2
除此之外,在time_control模块中,重启动时还涉及两个参数:
(1)override_restart_timers = .false.,
如果在restart的时候中更改了历史记录和重新启动间隔,累积性的变量会产生一些问题。此时,将override_restart_timers = .true.则总体归结起来就是,一个wrfout文件最后的时间点减去第一个时间点就是变量累积的量,不同wrfout文件计时起点不同,不能混淆。如果为false,则与连续run没有区别。
(2)write_hist_at_0h_rst = .false.,false: 在重新启动的初始时间不会生成初始时刻文件(防止此时删除原始历史文件)。true: 在重新启动的初始时间会生成初始时刻文件,替换原始历史输出文件。