function ESMF_AlarmWillRingNext(alarm, keywordEnforcer, timeStep, rc)
!
! !RETURN VALUE:
logical :: ESMF_AlarmWillRingNext
! !ARGUMENTS:
type(ESMF_Alarm), intent(in) :: alarm
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
type(ESMF_TimeInterval), intent(in), optional :: timeStep
integer, intent(out), optional :: rc
!
! !STATUS:
! \begin{itemize}
! \item\apiStatusCompatibleVersion{5.2.0r}
! \end{itemize}
!
! !DESCRIPTION:
! Check if {\tt ESMF\_Alarm} will ring on the next clock timestep, either
! the current clock timestep or a passed-in timestep.
!
! See also method
! {\tt ESMF\_ClockGetAlarmList(clock, ESMF\_ALARMLIST\_NEXTRINGING, ...)}
! to get a list of all alarms belonging to a {\tt ESMF\_Clock} that will
! ring on the next time step.
!
! The arguments are:
! \begin{description}
! \item[alarm]
! The alarm to check for next ringing state.
! \item[{[timeStep]}]
! Optional timestep to use instead of the clock's.
! \item[{[rc]}]
! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
! \end{description}
!EOP
! !REQUIREMENTS:
! TMG4.4
integer :: localrc ! local return code
! Assume failure until success
if (present(rc)) rc = ESMF_RC_NOT_IMPL
localrc = ESMF_RC_NOT_IMPL
! Initialize output value in case of error
ESMF_AlarmWillRingNext = .false.
! check inputs
ESMF_INIT_CHECK_DEEP(ESMF_AlarmGetInit,alarm,rc)
ESMF_INIT_CHECK_SHALLOW(ESMF_TimeIntervalGetInit,timeStep,rc)
! invoke C to C++ entry point
call c_ESMC_AlarmWillRingNext(alarm, timeStep, &
ESMF_AlarmWillRingNext, localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
! Return success
if (present(rc)) rc = ESMF_SUCCESS
end function ESMF_AlarmWillRingNext