Skip to content

Implement dump last in ESM1.6 driver#38

Merged
blimlim merged 2 commits intoaccess-esm1.6from
esm1.6-dump-last
Jun 4, 2025
Merged

Implement dump last in ESM1.6 driver#38
blimlim merged 2 commits intoaccess-esm1.6from
esm1.6-dump-last

Conversation

@blimlim
Copy link
Copy Markdown
Collaborator

@blimlim blimlim commented Jun 4, 2025

Closes #37

This PR modifies the dump_last implementation for the ESM1.6 driver. Rather than checking against npt (not used in ESM1.6), it sets write_restart = 1 in the last timestep of the control loop.

Testing

To check whether it's writing restarts at the correct times with the correct data, I ran 3 simulations with dump_last=.true.:

  • A 1 month simulation with dumpfreq='y'
  • A 3 month simulation with dumpfreq='y'
  • A 5 day simulation with dumpfreq='m'
    In each case, dump_last would be responsible for writing the restart at the end of the run.

And 3 runs with dump_last=.false. for comparison:

  • A 1 month simulation with dumpfreq='m'
  • A 3 month simulation with dumpfreq='m'
  • A 5 day simulation with dumpfreq='d'
    The standard date-based checks would be responsible for writing the final restarts for these runs.

In each case, the end of run restart files match:

> nccmp -dg dump_last_1M/archive/restart000/ice/iced.0786-02-01-00000.nc standard_1M/archive/restart000/ice/iced.0786-02-01-00000.nc 

> nccmp -dg dump_last_1M/archive/restart000/ice/mice.nc standard_1M/archive/restart000/ice/mice.nc

> nccmp -dg dump_last_3M/archive/restart000/ice/iced.0786-04-01-00000.nc standard_3M/archive/restart000/ice/iced.0786-04-01-00000.nc 

> nccmp -dg dump_last_3M/archive/restart000/ice/mice.nc standard_3M/archive/restart000/ice/mice.nc

> nccmp -dg dump_last_5D/archive/restart000/ice/iced.0786-01-06-00000.nc standard_5D/archive/restart000/ice/iced.0786-01-06-00000.nc 

> nccmp -dg dump_last_5D/archive/restart000/ice/mice.nc standard_5D/archive/restart000/ice/mice.nc

The coupler restart files also match for each pair of runs.

@blimlim blimlim requested a review from anton-seaice June 4, 2025 00:41
Comment thread source/ice_calendar.F90
write(il_out,*) '(calendar) idate = ', idate
#endif
if (istep >= npt+1) stop_now = 1
if (istep == npt .and. dump_last) write_restart = 1 ! last timestep
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to remove this line ?

Maybe put this in a #ifndef ACCESS to make this easier to merge with master in the future ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I've added this in d87c459

Copy link
Copy Markdown
Collaborator

@anton-seaice anton-seaice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good - thanks @blimlim

@blimlim blimlim merged commit 5471bbf into access-esm1.6 Jun 4, 2025
4 checks passed
@blimlim blimlim deleted the esm1.6-dump-last branch June 4, 2025 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants