Skip to content

Commit 4764d4d

Browse files
Enable triggering restart writes at any forecast time ("restart_fh") via UFS configuration as for other components (CICE-Consortium#1001)
* No ncat,ntrcr in call icepack_aggregate in ice_prescribed_mod.F90 * Enable writing restarts that can be triggered at any forecast time ("restart_fh") via UFS configuration as for other components Part of ufs-community/ufs-weather-model#2348 * Add 1 more #ifndef CESMCOUPLED to avoid unused variable warning for cesm * #ifndef for dtime here too
1 parent dcba500 commit 4764d4d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ module ice_comp_nuopc
5555
use ice_mesh_mod , only : ice_mesh_init_tlon_tlat_area_hm, ice_mesh_create_scolumn
5656
use ice_prescribed_mod , only : ice_prescribed_init
5757
use ice_scam , only : scol_valid, single_column
58+
#ifndef CESMCOUPLED
59+
use shr_is_restart_fh_mod, only : init_is_restart_fh, is_restart_fh, is_restart_fh_type
60+
#endif
5861

5962
implicit none
6063
private
@@ -96,6 +99,9 @@ module ice_comp_nuopc
9699
logical :: mastertask
97100
logical :: runtimelog = .false.
98101
logical :: restart_eor = .false. !End of run restart flag
102+
#ifndef CESMCOUPLED
103+
type(is_restart_fh_type) :: restartfh_info ! For flexible restarts in UFS
104+
#endif
99105
integer :: start_ymd ! Start date (YYYYMMDD)
100106
integer :: start_tod ! start time of day (s)
101107
integer :: curr_ymd ! Current date (YYYYMMDD)
@@ -1024,6 +1030,9 @@ subroutine ModelAdvance(gcomp, rc)
10241030
character(char_len_long) :: restart_date
10251031
character(char_len_long) :: restart_filename
10261032
logical :: isPresent, isSet
1033+
#ifndef CESMCOUPLED
1034+
logical :: write_restartfh
1035+
#endif
10271036
character(len=*),parameter :: subname=trim(modName)//':(ModelAdvance) '
10281037
character(char_len_long) :: msgString
10291038
!--------------------------------
@@ -1175,6 +1184,11 @@ subroutine ModelAdvance(gcomp, rc)
11751184
endif
11761185
endif
11771186

1187+
#ifndef CESMCOUPLED
1188+
call is_restart_fh(clock, restartfh_info, write_restartfh)
1189+
if (write_restartfh) force_restart_now = .true.
1190+
#endif
1191+
11781192
!--------------------------------
11791193
! Unpack import state
11801194
!--------------------------------
@@ -1292,6 +1306,9 @@ subroutine ModelSetRunClock(gcomp, rc)
12921306
type(ESMF_ALARM) :: stop_alarm
12931307
character(len=128) :: name
12941308
integer :: alarmcount
1309+
#ifndef CESMCOUPLED
1310+
integer :: dtime
1311+
#endif
12951312
character(len=*),parameter :: subname=trim(modName)//':(ModelSetRunClock) '
12961313
!--------------------------------
12971314

@@ -1377,6 +1394,11 @@ subroutine ModelSetRunClock(gcomp, rc)
13771394
call ESMF_AlarmSet(restart_alarm, clock=mclock, rc=rc)
13781395
if (ChkErr(rc,__LINE__,u_FILE_u)) return
13791396

1397+
#ifndef CESMCOUPLED
1398+
call ESMF_TimeIntervalGet( dtimestep, s=dtime, rc=rc )
1399+
if (ChkErr(rc,__LINE__,u_FILE_u)) return
1400+
call init_is_restart_fh(mcurrTime, dtime, my_task == master_task, restartfh_info)
1401+
#endif
13801402
end if
13811403

13821404
!--------------------------------

0 commit comments

Comments
 (0)