VIC offers the possibility to restart using a model state file that is either created by the user or saved from a previous model run. This makes it possible to run a long spin-up period once and then restart the model with a reasonable initial state. This is particularly convenient when doing calibration runs or sensitivity studies.
However, the VIC model state file only contains information about the state variables that are internal to the VIC model. Because routing is performed as a post-processor, the VIC model state file does not store information about the routing process. As a result, the routed runoff from a VIC model run that is restarted from a state file is underpredicted compared to a VIC model run that is properly spun-up (for example by throwing away the first n years of the simulation).
In the following plot the solid, black line is a long continued run. As part of this run a state file was saved at the beginning of 1978. The dashed, red line is a shorter run that was restarted using the state file. Note the difference in the routed runoff during the first month.
This startup effect will disappear after a few months (depending on the travel time in the routing network), when the routing arrays are properly "filled". Conceptually the problem is that the river channels are started empty, because no state file is stored for the routing arrays.
The solution is relatively straightforward. Just use the runoff files (input to the routing model) from your base run (the one that produced the state file) to extend your restarted run backwards into time. How much you need to extend your runs backwards into time depends on the travel time in your routing network, but two or three months should be sufficient. You can also just prepend a whole year to the beginning of your routing file, just to be sure. This will "fill your channels" and the routed flows of the runs with the state file will be the same as a longer, continuous run.
In the following plot the VIC model runs were the same as before, but the runoff for 1977 was prepended to the beginning of the runoff files for the restarted run. Note that the difference in the first month disappears and that the outputs are indistinguishable.
No special code is needed to implement this solution. You can strip a spinup year out of the routing files and save them to another directory using awk. You can then loop over all the files that are produced by your rerun and prepend the files that you saved.
For example (all capitals are variables you have to replace by your values) :
To extract the one year you want and write it to another directory
> foreach file (BASERUN_FILE*)
foreach? awk ' { if ($1 == YEAR) print $0 } ' $file >! STATEDIR/YEAR_$file
foreach? end
To prepend the files to your restarted run:
> foreach file (RESTART_FILE*)
foreach? cat STATEDIR/YEAR_$file >! junk
foreach? cat $file >> junk
foreach? mv junk $file
foreach? end
Do not forget to change your routing setup file to reflect the extra records you prepend to your input files.