diff --git a/generic/MAPL_Generic.F90 b/generic/MAPL_Generic.F90 index b9fb5f3d5b01..618179636cd1 100644 --- a/generic/MAPL_Generic.F90 +++ b/generic/MAPL_Generic.F90 @@ -1302,6 +1302,7 @@ subroutine handle_clock_and_main_alarm(clock, unusable, rc) type(ESMF_Clock), intent(in) :: clock class(KeywordEnforcer), optional, intent(in) :: unusable integer, optional, intent(out) :: rc + character(len=3) :: alarm_ring_at_0 STATE%CLOCK = CLOCK call ESMF_ClockGet(CLOCK, TIMESTEP = DELT, __RC__) @@ -1360,8 +1361,15 @@ subroutine handle_clock_and_main_alarm(clock, unusable, rc) ringTime = ringTime - (INT((ringTime - currTime)/TIMEINT)+1)*TIMEINT end if - ringTime = ringTime-TSTEP ! we back off current time with clock's dt since - ! we advance the clock AFTER run method + call MAPL_GetResource (STATE, alarm_ring_at_0, label='ALARM_RING_AT_0:', & + default="NO", __RC__ ) + + ! we back off current time with clock's dt since + ! we advance the clock AFTER run metho + ! if the alarm ring at 0, we don't back off the time. + if (alarm_ring_at_0 == "NO") then + ringTime = ringTime-TSTEP + endif ! make sure that ringTime is not in the past do while (ringTime < currTime)