diff --git a/model/src/wav_comp_nuopc.F90 b/model/src/wav_comp_nuopc.F90 index 4280b3b14..f6b98f297 100644 --- a/model/src/wav_comp_nuopc.F90 +++ b/model/src/wav_comp_nuopc.F90 @@ -56,6 +56,7 @@ module wav_comp_nuopc use wmmdatmd , only : nmpscr use w3updtmd , only : w3uini use w3adatmd , only : flcold, fliwnd + use shr_is_restart_fh_mod , only : init_is_restart_fh, is_restart_fh, write_restartfh #endif use constants , only : is_esmf_component @@ -1219,6 +1220,10 @@ subroutine ModelAdvance(gcomp, rc) else rstwr = .false. endif +#ifndef W3_CESMCOUPLED + write_restartfh = is_restart_fh(clock) + if (write_restartfh) rstwr = .true. +#endif ! Determine if time to write ww3 history files call ESMF_ClockGetAlarm(clock, alarmname='alarm_history', alarm=alarm, rc=rc) @@ -1295,7 +1300,7 @@ subroutine ModelSetRunClock(gcomp, rc) integer :: history_ymd ! History date (YYYYMMDD) type(ESMF_ALARM) :: history_alarm character(len=128) :: name - integer :: alarmcount + integer :: alarmcount, dt_cpl character(len=*),parameter :: subname=trim(modName)//':(ModelSetRunClock) ' !------------------------------------------------------------------------------- @@ -1363,6 +1368,12 @@ subroutine ModelSetRunClock(gcomp, rc) call ESMF_AlarmSet(restart_alarm, clock=mclock, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return +#ifndef W3_CESMCOUPLED + call ESMF_TimeIntervalGet( dtimestep, s=dt_cpl, rc=rc ) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + call init_is_restart_fh(mcurrTime, dt_cpl, root_task) +#endif + end if !----------------