ESMF_ClockCreateCopy Function

private function ESMF_ClockCreateCopy(clock, keywordEnforcer, rc)

Arguments

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

Return Value type(ESMF_Clock)


Source Code

      function ESMF_ClockCreateCopy(clock, keywordEnforcer, rc)

! !RETURN VALUE:
      type(ESMF_Clock) :: ESMF_ClockCreateCopy

! !ARGUMENTS:
      type(ESMF_Clock), intent(in)            :: 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:
!     Creates a deep copy of a given {\tt ESMF\_Clock}, but does not copy its
!     list of {\tt ESMF\_Alarm}s (pointers), since an {\tt ESMF\_Alarm} can only
!     be associated with one {\tt ESMF\_Clock}.  Hence, the returned
!     {\tt ESMF\_Clock} copy has no associated {\tt ESMF\_Alarm}s, the same as
!     with a newly created {\tt ESMF\_Clock}.  If desired, new
!     {\tt ESMF\_Alarm}s must be created and associated with this copied
!     {\tt ESMF\_Clock} via {\tt ESMF\_AlarmCreate()}, or existing
!     {\tt ESMF\_Alarm}s must be re-associated with this copied
!     {\tt ESMF\_Clock} via {\tt ESMF\_AlarmSet(...clock=...)}.
!
!     The arguments are:
!     \begin{description}
!     \item[clock]
!        The {\tt ESMF\_Clock} to copy.
!     \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 to copy clock
      call c_ESMC_ClockCreateCopy(ESMF_ClockCreateCopy, clock, localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, rcToReturn=rc)) return

      ! mark output as successfully initialized
      call ESMF_ClockSetInitCreated(ESMF_ClockCreateCopy)

      ! Return success
      if (present(rc)) rc = ESMF_SUCCESS
      end function ESMF_ClockCreateCopy