Skip to content

Commit 5471bbf

Browse files
authored
Merge pull request #38 from ACCESS-NRI/esm1.6-dump-last
Implement dump last in ESM1.6 driver
2 parents bbf2892 + d87c459 commit 5471bbf

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

drivers/access/CICE_RunMod.F90

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ subroutine CICE_Run
4848
use ice_calendar, only: istep, istep1, time, dt, stop_now, calendar
4949
use ice_forcing, only: get_forcing_atmo, get_forcing_ocn
5050
#ifdef ACCESS
51-
use ice_calendar, only: month, mday, istep, istep1, time, dt, stop_now, calendar
51+
use ice_calendar, only: month, mday, istep, istep1, time, dt, stop_now, calendar, &
52+
write_restart, dump_last
5253
use ice_restart_driver, only: dumpfile !temporary debug
5354
#endif
5455
use ice_flux, only: init_flux_atm, init_flux_ocn
@@ -135,6 +136,11 @@ subroutine CICE_Run
135136
! ' calling dumpfile at icpl_ai, itap, time_sec, idate = ', icpl_ai, itap, time_sec, idate
136137
! call dumpfile
137138
!endif
139+
140+
! Write restart on final timestep
141+
if (dump_last .and. (itap == num_ice_ai) .and. (icpl_ai == num_cpl_ai)) then
142+
write_restart = 1
143+
endif
138144

139145
!*** ice "update" ***!
140146
call ice_step

source/ice_calendar.F90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,9 @@ subroutine calendar(ttime)
296296
write(il_out,*) '(calendar) idate = ', idate
297297
#endif
298298
if (istep >= npt+1) stop_now = 1
299+
#ifndef ACCESS
299300
if (istep == npt .and. dump_last) write_restart = 1 ! last timestep
301+
#endif
300302
if (nyr /= nyrp) new_year = .true.
301303
if (month /= monthp) new_month = .true.
302304
if (mday /= mdayp) new_day = .true.

0 commit comments

Comments
 (0)