Skip to content

How to Check Bit for Bit Results with Restart Capability

weiwangncar edited this page Apr 19, 2021 · 22 revisions

One essential requirement for any new physical schemes and packages of WRF is that the results of a restart run with the new packages must be bit-wise identical to that of a single run starting from the model initial time. The method to verify the bit-for-bit results are described as follows.

Conduct a single run that covers at least 1-hour integration period starting from the model initial time and write restart files at 30 min interval.

Below is a sample settings of &time_control in namelist.input:

&time_control
run_days = 0,
run_hours = 1,
run_minutes = 0,
start_year = 2017, 2017,
start_month = 02, 02,
start_day = 01, 01,
start_hour = 00, 00,
start_minutes = 00, 00,
end_year = 2017, 2017,
end_month = 02, 02,
end_day = 01, 01,
end_hour = 01, 01,
history_interval = 60, 60,
frames_per_outfile. = 1, 1,
restart = .false.,
restart_interval = 30,

Using the above settings, the model is initialized at 2017-02-01_00 and run for 1-hour period. History output file wrfout_d01_2017-02-01_01:00:00 and restart files wrfrst_d01_2017-02-01_30:00:00 and wrfrst_d01_2017-02-01_00:00:00 will be produced. Rename the wrfout file as wrfout_d01_2017-02-01_01:00:00.initial_run

Conduct a restart run from the first restart time to produce history output file at the same time as in the initial run:

Modify the above &time_control as below:

&time_control
run_days = 0,
run_hours = 0,
run_minutes = 30,
run_seconds = 0,
start_year = 2017, 2017,
start_month = 02, 02,
start_day = 01, 01,
start_hour = 00, 00,
start_minute = 30, 30,
end_year = 2017, 2017,
end_month = 02, 02,
end_day = 01, 01,
end_hour = 01, 01,
end_minute = 00, 00,
history_interval = 60, 60,
frames_per_outfile = 1, 1,
restart = .true.,
restart_interval = 30,

Then rerun the case to produce wrfout_d01_2017-02-01_01:00:00 again, which can be renamed as wrfout_d01_2017-02-01_01:00:00.restart.

Verify bit-wise identical results

This is done by using utility diffwrf created in WRF/external/io_netcdf/ directory when WRF is compiled:
path-to-above-dir/diffwrf wrfout_ d01_2017-02-01_01:00:00.initial_run wrfout_ d01_2017-02-01_01:00:00.restart

This command should yield the following output if no difference is found between the two output files:

Just plot F
Diffing wrfout_d01_2017-02-01_01:00:00.initial_run wrfout_d01_2017-02-01_01:00:00.restart
Next Time 2017-02-01_01:00:00
Field Ndifs Dims RMS (1) RMS (2) DIGITS RMSE pntwise max

This result confirms that the two files are bit-wise identical.

What to do if restart output is not bit-wise identical to the original run?

The first thing to check is to make sure if any new state variables added need to be in the restart file. Also make sure that variables should not be initialized at the time of restart. If this doesn’t fix the problem, the next thing to do is to rerun the restart exercise to produce model output at every model time step. When comparing model outputs one time-step after the restart, it can narrow down the variables that first appears different which in turn may provide some clue to the problem. To output model at every time step just after the first restart time in the above example, one can set the following to reduce model output, assuming model time step is 1 min or 60 sec:

history_interval = 1, 1,
history_begin_m = 30, 30,