subroutine ESMF_AlarmGet(alarm, keywordEnforcer, &
clock, ringTime, prevRingTime, ringInterval, stopTime, ringDuration, &
ringTimeStepCount, timeStepRingingCount, ringBegin, ringEnd, &
refTime, ringing, ringingOnPrevTimeStep, enabled, sticky, name, rc)
! !ARGUMENTS:
type(ESMF_Alarm), intent(in) :: alarm
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
type(ESMF_Clock), intent(out), optional :: clock
type(ESMF_Time), intent(out), optional :: ringTime
type(ESMF_Time), intent(out), optional :: prevRingTime
type(ESMF_TimeInterval), intent(out), optional :: ringInterval
type(ESMF_Time), intent(out), optional :: stopTime
type(ESMF_TimeInterval), intent(out), optional :: ringDuration
integer, intent(out), optional :: ringTimeStepCount
integer, intent(out), optional :: timeStepRingingCount
type(ESMF_Time), intent(out), optional :: ringBegin
type(ESMF_Time), intent(out), optional :: ringEnd
type(ESMF_Time), intent(out), optional :: refTime
logical, intent(out), optional :: ringing
logical, intent(out), optional :: ringingOnPrevTimeStep
logical, intent(out), optional :: enabled
logical, intent(out), optional :: sticky
character (len=*), intent(out), optional :: name
integer, intent(out), optional :: rc
!
! !STATUS:
! \begin{itemize}
! \item\apiStatusCompatibleVersion{5.2.0r}
! \end{itemize}
!
! !DESCRIPTION:
! Gets one or more of an {\tt ESMF\_Alarm}'s properties.
!
! The arguments are:
! \begin{description}
! \item[alarm]
! The object instance to query.
! \item[{[clock]}]
! The associated clock.
! \item[{[ringTime]}]
! The ring time for a one-shot alarm or the next repeating alarm.
! \item[{[prevRingTime]}]
! The previous ring time.
! \item[{[ringInterval]}]
! The ring interval for repeating (interval) alarms.
! \item[{[stopTime]}]
! The stop time for repeating (interval) alarms.
! \item[{[ringDuration]}]
! The ring duration. Mutually exclusive with
! ringTimeStepCount (see below).
! \item[{[ringTimeStepCount]}]
! The number of time steps comprising the ring duration. Mutually
! exclusive with ringDuration (see above).
! \item[{[timeStepRingingCount]}]
! The number of time steps for which the alarm has been ringing thus
! far. Used internally for tracking ringTimeStepCount ring
! durations (see above). Mutually exclusive with ringBegin
! (see below). Increments in {\tt ESMF\_DIRECTION\_FORWARD} and
! decrements in {\tt ESMF\_DIRECTION\_REVERSE};
! see Section~\ref{sec:Clock}.
! \item[{[ringBegin]}]
! The time when the alarm began ringing. Used internally for tracking
! ringDuration (see above). Mutually exclusive with
! timeStepRingingCount (see above).
! \item[{[ringEnd]}]
! \begin{sloppypar}
! The time when the alarm ended ringing. Used internally for
! re-ringing alarm in {\tt ESMF\_DIRECTION\_REVERSE}.
! \end{sloppypar}
! \item[{[refTime]}]
! The reference (i.e. base) time for an interval alarm.
! \item[{[ringing]}]
! The current ringing state.
! See also {\tt ESMF\_AlarmRingerOn()}, {\tt ESMF\_AlarmRingerOff()}.
! \item[{[ringingOnPrevTimeStep]}]
! \begin{sloppypar}
! The ringing state upon the previous time step. Same as
! {\tt ESMF\_AlarmWasPrevRinging()}.
! \end{sloppypar}
! \item[{[enabled]}]
! The enabled state.
! See also {\tt ESMF\_AlarmEnable()}, {\tt ESMF\_AlarmDisable()}.
! \item[{[sticky]}]
! The sticky state.
! See also {\tt ESMF\_AlarmSticky()}, {\tt ESMF\_AlarmNotSticky()}.
! \item[{[name]}]
! The name of this alarm.
! \item[{[rc]}]
! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
! \end{description}
!EOP
! !REQUIREMENTS:
! TMG4.1, TMG4.7
! temp name for C++ to fill
character (len=ESMF_MAXSTR) :: tempName
! initialize name lengths to zero for non-existent name
integer :: nameLen
integer :: tempNameLen
integer :: localrc ! local return code
nameLen = 0
tempNameLen = 0
! Assume failure until success
if (present(rc)) rc = ESMF_RC_NOT_IMPL
localrc = ESMF_RC_NOT_IMPL
! check input
ESMF_INIT_CHECK_DEEP(ESMF_AlarmGetInit,alarm,rc)
! get length of given name for C++ validation
if (present(name)) then
nameLen = len(name)
end if
! invoke C to C++ entry point
call c_ESMC_AlarmGet(alarm, nameLen, tempNameLen, tempName, clock, &
ringTime, prevRingTime, ringInterval, stopTime, &
ringDuration, ringTimeStepCount, &
timeStepRingingCount, ringBegin, ringEnd, refTime, &
ringing, ringingOnPrevTimeStep, enabled, sticky, localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
! copy temp name back to given name to restore native Fortran
! storage style
if (present(name)) then
name = tempName(1:tempNameLen)
endif
! mark outputs as successfully initialized
call ESMF_ClockSetInitCreated(clock)
call ESMF_TimeInit(ringTime)
call ESMF_TimeInit(prevRingTime)
call ESMF_TimeIntervalInit(ringInterval)
call ESMF_TimeInit(stopTime)
call ESMF_TimeIntervalInit(ringDuration)
call ESMF_TimeInit(ringBegin)
call ESMF_TimeInit(ringEnd)
call ESMF_TimeInit(refTime)
! Return success
if (present(rc)) rc = ESMF_SUCCESS
end subroutine ESMF_AlarmGet