diff --git a/model/src/wav_comp_nuopc.F90 b/model/src/wav_comp_nuopc.F90 index f6b98f297..544b40817 100644 --- a/model/src/wav_comp_nuopc.F90 +++ b/model/src/wav_comp_nuopc.F90 @@ -56,7 +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 + use shr_is_restart_fh_mod , only : init_is_restart_fh, is_restart_fh, is_restart_fh_type #endif use constants , only : is_esmf_component @@ -90,6 +90,7 @@ module wav_comp_nuopc logical :: cesmcoupled = .true. !< logical to indicate CESM use case #else logical :: cesmcoupled = .false. !< logical to indicate non-CESM use case + type(is_restart_fh_type) :: restartfh_info ! For flexible restarts in UFS #endif integer, allocatable :: tend(:,:) !< the ending time of ModelAdvance when !! run with multigrid=true @@ -1127,6 +1128,7 @@ subroutine ModelAdvance(gcomp, rc) type(ESMF_Time) :: currTime, nextTime, startTime, stopTime integer :: yy,mm,dd,hh,ss integer :: imod + logical :: write_restartfh !integer :: shrlogunit ! original log unit and level character(ESMF_MAXSTR) :: msgString character(len=*),parameter :: subname = '(wav_comp_nuopc:ModelAdvance) ' @@ -1221,7 +1223,7 @@ subroutine ModelAdvance(gcomp, rc) rstwr = .false. endif #ifndef W3_CESMCOUPLED - write_restartfh = is_restart_fh(clock) + call is_restart_fh(clock, restartfh_info, write_restartfh) if (write_restartfh) rstwr = .true. #endif @@ -1371,7 +1373,7 @@ subroutine ModelSetRunClock(gcomp, rc) #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) + call init_is_restart_fh(mcurrTime, dt_cpl, root_task, restartfh_info) #endif end if