ESMF_ClockDestroy Subroutine

public subroutine ESMF_ClockDestroy(clock, keywordEnforcer, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Clock), intent(inout) :: clock
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
integer, intent(out), optional :: rc

Source Code

      subroutine ESMF_ClockDestroy(clock, keywordEnforcer, rc)
!
! !ARGUMENTS:
      type(ESMF_Clock), intent(inout)          :: clock
      type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
      integer,          intent(out),  optional :: rc
!
!
! !STATUS:
! \begin{itemize}
! \item\apiStatusCompatibleVersion{5.2.0r}
! \end{itemize}
!
! !DESCRIPTION:
!     \begin{sloppypar}
!     Releases resources associated with this {\tt ESMF\_Clock}.  This releases
!     the list of associated {\tt ESMF\_Alarm}s (pointers), but not the
!     {\tt ESMF\_Alarm}s themselves; the user must explicitly call
!     {\tt ESMF\_AlarmDestroy()} on each {\tt ESMF\_Alarm} to release its
!     resources.  {\tt ESMF\_ClockDestroy()} and corresponding
!     {\tt ESMF\_AlarmDestroy()}s can be called in either order.
!     \end{sloppypar}
!
!     \begin{sloppypar}
!     If {\tt ESMF\_ClockDestroy()} is called before {\tt ESMF\_AlarmDestroy()},
!     any {\tt ESMF\_Alarm}s that were in the {\tt ESMF\_Clock}'s list will
!     no longer be associated with any {\tt ESMF\_Clock}.  If desired,
!     these "orphaned" {\tt ESMF\_Alarm}s can be associated with a different
!     {\tt ESMF\_Clock} via a call to {\tt ESMF\_AlarmSet(...clock=...)}.
!     \end{sloppypar}
!
!     The arguments are:
!     \begin{description}
!     \item[clock]
!       Release resources associated with this {\tt ESMF\_Clock} and mark the
!       object as invalid.  It is an error to pass this object into any other
!       routines after being destroyed.
!     \item[[rc]]
!       Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!     \end{description}
!
!EOP
! !REQUIREMENTS:
      integer :: localrc                        ! local return code

      ! Assume failure until success
      if (present(rc)) rc = ESMF_RC_NOT_IMPL
      localrc = ESMF_RC_NOT_IMPL

      ! check input
      ESMF_INIT_CHECK_DEEP(ESMF_ClockGetInit,clock,rc)

      ! invoke C to C++ entry point
      call c_ESMC_ClockDestroy(clock, localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, rcToReturn=rc)) then
        ! Don't bail out until Delete
        write(*,*)" c_ESMC_ClockDestroy fails"
      endif

      ! mark output as successfully deleted
      call ESMF_ClockSetInitDeleted(clock)

      ! Return success
      if (present(rc)) rc = localrc
      end subroutine ESMF_ClockDestroy