nextsimhub / nextsimdg

neXtSIM_DG : next generation sea-ice model with DG
https://nextsim-dg.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
10 stars 13 forks source link

Default the initial 'lastOutputTime' to the model start time. #600

Closed timspainNERSC closed 3 days ago

timspainNERSC commented 3 days ago

Default the initial 'lastOutputTime' to the model start time.

Fixes #599

Change Description

Changed the logic for setting the initial value of ConfigOutput::lastOutputTime. If no configuration was given for the key ConfigOutput.start then a default value should be used. This was previous the TimePoint equivalent to the ISO date string "0-01-01T00:00:00Z". However, this caused output to not trigger, for reasons that are no longer important. The time of the last output represents the time from which to start outputting diagnostic data with the given period.

The logic for setting lastOutputTime is (as a result of this PR):

  1. Use the date value at ConfigOutput::start
  2. if that is not set, use the value at model.start
  3. if that is not set (the start date is the date of the restart file), ingest that start date at DevStep::start().

Documentation Impact

The inline help for the ConfigOutput class already states that the default value of ConfigOutput.start is model.start. So the impact is that the code now matches the doumentation.