ESMF_AlarmCreateCopy Function

private function ESMF_AlarmCreateCopy(alarm, keywordEnforcer, rc)

Arguments

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

Return Value type(ESMF_Alarm)


Source Code

      function ESMF_AlarmCreateCopy(alarm, keywordEnforcer, rc)

! !RETURN VALUE:
      type(ESMF_Alarm) :: ESMF_AlarmCreateCopy

! !ARGUMENTS:
      type(ESMF_Alarm), intent(in)            :: alarm
      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 complete (deep) copy of a given {\tt ESMF\_Alarm}.
!     The returned {\tt ESMF\_Alarm} copy is associated with the same
!     {\tt ESMF\_Clock} as the original {\tt ESMF\_Alarm}.  If desired, use
!     {\tt ESMF\_AlarmSet(...clock=...)} to re-associate the
!     {\tt ESMF\_Alarm} copy with a different {\tt ESMF\_Clock}.
!
!     The arguments are:
!     \begin{description}
!     \item[alarm]
!        The {\tt ESMF\_Alarm} 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_AlarmGetInit,alarm,rc)

      ! invoke C to C++ entry point to copy alarm
      call c_ESMC_AlarmCreateCopy(ESMF_AlarmCreateCopy, alarm, localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, rcToReturn=rc)) return

      ! mark output as successfully initialized
      call ESMF_AlarmSetInitCreated(ESMF_AlarmCreateCopy)

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