Skip to content

Commit

Permalink
fix issue with REST_OPTION=end
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Apr 1, 2024
1 parent 545fd9f commit 44cb901
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 823 deletions.
12 changes: 11 additions & 1 deletion cesm/driver/esm_time_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module esm_time_mod
use ESMF , only : ESMF_TimeInterval, ESMF_TimeIntervalSet, ESMF_TimeIntervalGet
use ESMF , only : ESMF_SUCCESS, ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_FAILURE, ESMF_LOGMSG_ERROR
use ESMF , only : ESMF_VM, ESMF_VMGet, ESMF_VMBroadcast
use ESMF , only : ESMF_VMAllReduce, ESMF_REDUCE_MAX
use ESMF , only : ESMF_VMAllReduce, ESMF_REDUCE_MAX, ESMF_ClockGetAlarm
use ESMF , only : ESMF_LOGMSG_INFO, ESMF_FAILURE, ESMF_GridCompIsPetLocal
use ESMF , only : operator(<), operator(/=), operator(+)
use ESMF , only : operator(-), operator(*) , operator(>=)
Expand Down Expand Up @@ -42,6 +42,7 @@ module esm_time_mod
optMonthly = "monthly" , &
optYearly = "yearly" , &
optDate = "date" , &
optEnd = "end" , &
optGLCCouplingPeriod = "glc_coupling_period"

! Module data
Expand Down Expand Up @@ -505,6 +506,15 @@ subroutine esm_time_alarmInit( clock, alarm, option, &
if (ChkErr(rc,__LINE__,u_FILE_u)) return
update_nextalarm = .true.

case (optEnd)
call ESMF_TimeIntervalSet(AlarmInterval, yy=9999, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call ESMF_ClockGetAlarm(clock, "alarm_stop", alarm, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call ESMF_AlarmGet(alarm, ringTime=NextAlarm, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
update_nextalarm = .false.

case default
call ESMF_LogWrite(subname//'unknown option '//trim(option), ESMF_LOGMSG_ERROR)
rc = ESMF_FAILURE
Expand Down
Loading

0 comments on commit 44cb901

Please sign in to comment.