Skip to content

Commit

Permalink
Implement restart_fh in wav_comp_nuopc.F90
Browse files Browse the repository at this point in the history
  • Loading branch information
NickSzapiro-NOAA authored Nov 14, 2024
1 parent 821cf9d commit f4d5d47
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion model/src/wav_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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) '

!-------------------------------------------------------------------------------
Expand Down Expand Up @@ -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

!----------------
Expand Down

0 comments on commit f4d5d47

Please sign in to comment.