diff --git a/mediator/med_phases_restart_mod.F90 b/mediator/med_phases_restart_mod.F90 index 6bbdb6b7..b161f6b7 100644 --- a/mediator/med_phases_restart_mod.F90 +++ b/mediator/med_phases_restart_mod.F90 @@ -14,6 +14,9 @@ module med_phases_restart_mod use med_phases_prep_glc_mod , only : FBocnAccum2glc_o, ocnAccum2glc_cnt use med_phases_prep_rof_mod , only : FBlndAccum2rof_l, lndAccum2rof_cnt use pio , only : file_desc_t +#ifndef CESMCOUPLED + use shr_is_restart_fh_mod, only : init_is_restart_fh, is_restart_fh, is_restart_fh_type +#endif implicit none private @@ -23,6 +26,9 @@ module med_phases_restart_mod private :: med_phases_restart_alarm_init logical :: write_restart_at_endofrun = .false. +#ifndef CESMCOUPLED + type(is_restart_fh_type) :: restartfh_info ! For flexible restarts in UFS +#endif logical :: whead(2) = (/.true. , .false./) logical :: wdata(2) = (/.false., .true. /) @@ -115,6 +121,10 @@ subroutine med_phases_restart_alarm_init(gcomp, rc) write(logunit,*) end if +#ifndef CESMCOUPLED + call init_is_restart_fh(mcurrtime, timestep_length,maintask, restartfh_info) +#endif + end subroutine med_phases_restart_alarm_init !=============================================================================== @@ -178,6 +188,7 @@ subroutine med_phases_restart_write(gcomp, rc) real(R8) :: tbnds(2) ! CF1.0 time bounds logical :: isPresent logical :: first_time = .true. + logical :: write_restartfh character(len=*), parameter :: subname='(med_phases_restart_write)' !--------------------------------------- @@ -244,6 +255,11 @@ subroutine med_phases_restart_write(gcomp, rc) endif endif +#ifndef CESMCOUPLED + call is_restart_fh(clock, restartfh_info, write_restartfh) + if (write_restartfh) alarmIsOn = .true. +#endif + if (alarmIsOn) then call ESMF_ClockGet(clock, currtime=currtime, starttime=starttime, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return