subroutine ESMF_ClockGetNextTime(clock, nextTime, keywordEnforcer, &
timeStep, rc)
! !ARGUMENTS:
type(ESMF_Clock), intent(in) :: clock
type(ESMF_Time), intent(out) :: nextTime
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:
! Calculates what the next time of the {\tt clock} will be, based on
! the {\tt clock}'s current time step or an optionally passed-in
! {\tt timeStep}.
!
! The arguments are:
! \begin{description}
! \item[clock]
! The object instance for which to get the next time.
! \item[nextTime]
! The resulting {\tt ESMF\_Clock}'s next time.
! \item[{[timeStep]}]
! The time step interval to use instead of the clock's.
! \item[{[rc]}]
! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
! \end{description}
!
!EOP
! !REQUIREMENTS:
! TMGx.x, CCSM
integer :: localrc ! local return code
! Assume failure until success
if (present(rc)) rc = ESMF_RC_NOT_IMPL
localrc = ESMF_RC_NOT_IMPL
! check inputs
ESMF_INIT_CHECK_DEEP(ESMF_ClockGetInit,clock,rc)
ESMF_INIT_CHECK_SHALLOW(ESMF_TimeIntervalGetInit,timeStep,rc)
! invoke C to C++ entry point
call c_ESMC_ClockGetNextTime(clock, nextTime, timeStep, localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
! mark output as successfully initialized
call ESMF_TimeInit(nextTime)
! Return success
if (present(rc)) rc = ESMF_SUCCESS
end subroutine ESMF_ClockGetNextTime