From f4d5d479c0d46f13943e4bfe3f6390b13e60060a Mon Sep 17 00:00:00 2001 From: Nicholas Szapiro <149816583+NickSzapiro-NOAA@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:24:13 -0500 Subject: [PATCH] Implement restart_fh in wav_comp_nuopc.F90 --- model/src/wav_comp_nuopc.F90 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 !----------------