CTSM icon indicating copy to clipboard operation
CTSM copied to clipboard

Rethink/cleanup FATES hybrid logic

Open samsrabin opened this issue 10 months ago • 1 comments

I was expecting the top part of this logical block to also exclude hybrid runs along with branch runs. Is a hybrid run equivalent to is_restart()=.true. ?

For future work I feel like we should clean some of this logic up, I cobbled a lot of this together many years ago when I did not have a good sense of restart options. But my take is that our decision making on how to restart fates (ie cold or from pre-existing vegetation structure in a restart file) really comes down to if it is a startup, branch or hybrid. The finidat string is less straight forward to use here in decide what part of the initialization sequence to use. My understanding is that the finidat should have a meaningful file path only in the latter two scenarios (branch and hybrid), so its better to use the switches that are the root of deciding these things rather variables like finidat that are "downstream" of them. Does that make sense? Again, I'd like to make an issue of this and flag it for future work and not complicate this PR.

Originally posted by @rgknox in https://github.com/ESCOMP/CTSM/pull/2955#discussion_r1958527470

Some clarifications from @ekluzek:

  • is_restart() will be true for branch and continue (so NOT hybrid and startup)
  • Yes, finidat is usually set even when it isn't needed, so can't be relied upon to determine the run-type
  • is_restart(), is_first_step(), and is_first_restart_step() are what should be used to determine these things

samsrabin avatar Mar 07 '25 17:03 samsrabin

I was looking at FATES things and noticed this one. Some clarification here:

  • is_restart() will be true for branch and continue (so NOT hybrid and startup)
  • Yes, finidat is usually set even when it isn't needed, so can't be relied upon to determine the run-type
  • is_restart(), is_first_step(), and is_first_restart_step() are what should be used to determine these things

I'll add these notes to the top.

ekluzek avatar Jun 12 '25 18:06 ekluzek