-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exact restart - classic driver #479
Comments
Thanks @jhamman for your comment. Will do, and I'll put in the read and write for energy->Tfoliage also if that sounds OK? |
Yes, that sounds good. Thanks. |
@jhamman I was discussing that with @yixinmao and was thinking that if we're just talking about a small number of fluxes, and they are easily computed from the known states, a quick fix could be to insert a computation of those fluxes into compute_derived_state_vars(). If their computation depends on other fluxes as well as states - e.g., requires running the whole energy balance computation - then perhaps it would be better to save them in the state file. The most labor intensive fix might be to re-order the various computations in surface_fluxes() so that there are no instances of variables being computed from the previous step's fluxes. Depending on how much work that is, it might be do-able for 5.0, or might end up being too much work and be more appropriate for 5.1. I guess we need to take a look and determine how much work is involved in computing these the "right" way, and then decide if we're willing to do that much work for 5.0. I can try to take a look at it over the weekend (i'm out of town right now, so only have a few short windows over the next 4 days in which I can do work). |
My initial thought here is that we shouldn't design around existing mistakes or bugs. In other words, I don't want to put fluxes in the state file. If there are variables being computed from the previous steps fluxes in @yixinmao - can you point us to the lines in |
@tbohn |
@jhamman - |
@jhamman - Whoops sorry hit send too soon... |
As I'm thinking about it, the longwave fluxes should be fairly easy to compute from states at any point. We know how these terms are calculated - The |
@jhamman Right the calculation of |
For now my recommendation is to simply store the small number of fluxes to which this applies as part of the state file and keep this issue open (or reopen a similar one) for 5.1. I think that to ensure exact restarts we need to make sure that the initial guess for these fluxes is the same no matter whether we are continuing a model run or restarting. The easiest fix for that is to include these fluxes in the state file, not as a long-term solution, but to keep moving on VIC 5.0. |
@jhamman We probably want to leave the temporary fix for the two flux variables documented (in this issue or open another issue for it); also the last point - two uninitialized local variables - has not been fixed yet |
@yixinmao: Where are we on this? It's still open even though the milestone has passed. If you want to keep it open, please move the milestone, because this will get lost otherwise. |
@bartnijssen Most of the things on the list here are done, except:
Maybe we could close this issue and open another issue for the above remaining things? |
Yes, @yixinmao - please open a new issue and reference/close this one. |
Most things in this issues are resolved. The remaining things are summarized in a new issue #580 . |
Fix inexact restart for classic driver:
FULL_ENERGY
= TRUE / FALSEFROZEN_SOIL
= TRUE / FALSECARBON
= FALSE (have not tested forCARBON
=TRUE yet)LAKE
=FALSE (have not tested forLAKE
=TRUE yet)Variables to fix:
energy->Tfoliage
(this is a state variable that needs to be saved and read).This variable is calculated in "generate_default_states()" when no initial state is specified.
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)vic_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 Fixed exact restart (temporarily) - classic and image drivers #507])Other changes related to exact restart:
%.16g
vic_def.h
andprint_library_shared.c
Local variables used before initializing (these do not affect restart, but better to be fixed also):
surface_fluxes()
, the local variableShortUnderIn
is used before initializedfunc_surf_energy_bal()
, line 662-663, "_fusion" is used; but "_fusion" is only initialized ifFROZEN_SOIL=TRUE
The text was updated successfully, but these errors were encountered: