ESM1.6 Read start date and time from restart file#48
Conversation
| if (jobnum == 1 ) then | ||
| time = 0.0 !NOTE, the first job must be set back to 0 and | ||
| idate = idate_save !idate back to the 'initial' value, in any case | ||
| runtime0 = 0.0 |
There was a problem hiding this comment.
I still need to think through what exactly happens with jobnum=1 after these changes
There was a problem hiding this comment.
We don't have a supported usecase for jobnum = 1 , so its not critical
There was a problem hiding this comment.
Maybe we should make a seperate issue to investigate this ? Basically to check there are no traps with having jobnum = 1 and runtype = initial trying to have the same meaning.
There was a problem hiding this comment.
Yeah good idea. I've added an issue here
eb4c26e to
5a701c7
Compare
| if (jobnum == 1 ) then | ||
| time = 0.0 !NOTE, the first job must be set back to 0 and | ||
| idate = idate_save !idate back to the 'initial' value, in any case | ||
| runtime0 = 0.0 |
There was a problem hiding this comment.
We don't have a supported usecase for jobnum = 1 , so its not critical
Co-authored-by: Anton Steketee <79179784+anton-seaice@users.noreply.github.com>
|
Update on the testing: I've done several 3 month runs starting at different years, (787 non leap, 792 leap, and 9999) with the changes in f9c3978, and also without the changes from this PR. The restart files at the end are identical, apart from the I think the initialisation of Similarly, the ice history files have identical times and data, apart from the With the old code, Looking into why this might differ. |
|
Printing Old: New: The second call to calendar differs between the two. I believe this comes from this call to cice5/drivers/access/CICE_InitMod.F90 Lines 364 to 369 in 0bd0131 In the old code, cice5/drivers/access/CICE_InitMod.F90 Line 193 in 0bd0131 Meanwhile in the new code, cice5/drivers/access/CICE_InitMod.F90 Line 215 in 0bd0131 If replace the calendar call after the restart is read we end up with identical cice5/drivers/access/CICE_InitMod.F90 Lines 180 to 215 in 0bd0131 |
|
Does frz_onset work if you don't start on Jan 1 ? (I guess it depends what the definition is supposed to be).
Are the new ones correct now and the old ones were wrong ? |
In theory it shouldn't work – Lines 1500 to 1509 in 0bd0131 However in practice, it looks like The cice5/drivers/access/CICE_InitMod.F90 Lines 139 to 140 in 0bd0131 and so uses the day-of-year yday calculated by init_calendar. init_calendar calculates yday from istep0 in the namelist, and does not yet have access to the data from the restart file. The calculation looks a bit off, and seems to set yday=1 independent of the value of istep0.
E.g. If I set Both the new code and the old code will be using the same value of |
|
The difference in cice5/drivers/access/CICE_InitMod.F90 Lines 364 to 369 in 0bd0131 As mentioned above, the I've added a namelist parameter to the new code cice5/drivers/access/CICE_InitMod.F90 Line 372 in eb23387 In the old code, we can control the Note that anything set by this call will be correctly reset shortly after in the next cice5/drivers/access/CICE_InitMod.F90 Line 214 in eb23387 I've run the (old, new) code with ( I ran short 1 day runs for each pair, saving the instantaneous All the runs with ( |
|
Since both the old and new code have the same behaviour, where the values of I'm wondering whether the following would make sense?
|
I think both ? We should either fix this or consider disabling the diagnostic(s) if we don't need it. |
|
Apologies for the sidetracks! I think this one's ready for review now. To summarise the changes:
Summary of testing:
|
|
A payu branch for testing these changes is here: https://github.com/ACCESS-NRI/payu/tree/cice5-resdate-update |
|
Example error message: |
anton-seaice
left a comment
There was a problem hiding this comment.
This looks good! - just waiting for #51
That looks great, thanks for getting it in! |
anton-seaice
left a comment
There was a problem hiding this comment.
Thanks @blimlim - we might need another approver again ? :)



Opening a draft for discussion.
From #25.
The coupled driver currently initialises the calendar from information in the coupling namelist
input_ice.nml. Specifically frominidate(the run start date),init_date(the experiment initialisation date), andruntime0, the seconds betweeninit_dateandinidate. This also requires offloading calculations to payu, which recalculate information already stored in the restart file.This PR initialises the calendar from information in the restart files, since they contain all the information required to setup the calendar (specifically the experiment start date, and
time, the seconds sinceinit_date). It also hard codes theinit_dateto00010101, which is used as the time origin in the history files.Testing to follow