There are two remaining things for closed issue #479 :
We are saving two flux variables (energy->LongUnderOut and energy->snow_flux) to state file for exact restart purpose - this is not ideal. Specifically:
energy->LongUnderOut (this is a flux variable whose old value from the last time step is used before being updated in the current time step)
This variable is calculated in "generate_default_states()" when no initial state is specified (so when there is no initial state, LongUnderOut would be calculated first; but when there is an initial state, LongUnderOut remains zero before the first time step calculation).
This variable is currently saved to state file to ensure exact restart [PR #507]. TODO: this is a temporary solution; a better way of handling this flux variable needs to be done (potential solutions: 1) modifying the calculation in vic_run so that the flux variable is always computed before used; 2) computing the flux variable from state variables before vic_run)
energy->snow_flux (this is a flux variable which has the same problem, and is also temporarily saved to state file [PR #507])
Local variables used before initializing (these do not affect restart, but better to be fixed also):
In surface_fluxes(), the local variable ShortUnderIn is used before initialized
In func_surf_energy_bal(), line 662-663, variable fusion is used; but fusion is only initialized if FROZEN_SOIL=TRUE
There are two remaining things for closed issue #479 :
We are saving two flux variables (
energy->LongUnderOut
andenergy->snow_flux
) to state file for exact restart purpose - this is not ideal. Specifically:energy->LongUnderOut
(this is a flux variable whose old value from the last time step is used before being updated in the current time step)This variable is calculated in "generate_default_states()" when no initial state is specified (so when there is no initial state,
LongUnderOut
would be calculated first; but when there is an initial state,LongUnderOut
remains zero before the first time step calculation). This variable is currently saved to state file to ensure exact restart [PR #507]. TODO: this is a temporary solution; a better way of handling this flux variable needs to be done (potential solutions: 1) modifying the calculation invic_run
so that the flux variable is always computed before used; 2) computing the flux variable from state variables beforevic_run
)energy->snow_flux
(this is a flux variable which has the same problem, and is also temporarily saved to state file [PR #507])ShortUnderIn
is used before initializedunc_surf_energy_bal()
, line 662-663, variablefusion
is used; butfusion
is only initialized ifFROZEN_SOIL=TRUE