ESMF_SciCompGet Subroutine

public subroutine ESMF_SciCompGet(scicomp, keywordEnforcer, name, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_SciComp), intent(in) :: scicomp
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
character(len=*), intent(out), optional :: name
integer, intent(out), optional :: rc

Source Code

  subroutine ESMF_SciCompGet(scicomp, keywordEnforcer, name, rc)
!
! !ARGUMENTS:
    type(ESMF_SciComp),       intent(in)            :: scicomp
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
    character(len=*),         intent(out), optional :: name
    integer,                  intent(out), optional :: rc
!
! !DESCRIPTION:
! Get information about an {\tt ESMF\_SciComp} object.
!  
! The arguments are:
! \begin{description}
! \item[scicomp]
!   The {\tt ESMF\_SciComp} object being queried.
! \item[{[name]}]
!   Return the name of the {\tt ESMF\_SciComp}.
! \item[{[rc]}]
!   Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
! \end{description}
!
!EOP
!------------------------------------------------------------------------------
    integer               :: localrc      ! local return code
    type(ESMF_CompStatus) :: compStatus

    ! initialize return code; assume routine not implemented
    if (present(rc)) rc = ESMF_RC_NOT_IMPL
    localrc = ESMF_RC_NOT_IMPL

    ESMF_INIT_CHECK_DEEP(ESMF_SciCompGetInit,scicomp,localrc)

    ! call Comp method
    call ESMF_CompGet(scicomp%compp, name=name, compStatus=compStatus, &
       rc=localrc)
    if (ESMF_LogFoundError(localrc, &
      ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=localrc)) return

    if (scicomp%isNamedAlias .and. present(name)) then
      ! access NamedAlias name
      name = trim(scicomp%name)
    endif

    ! call Comp method
    call ESMF_CompStatusGet(compStatus, rc = localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=localrc)) return

    ! return successfully
    if (present(rc)) rc = ESMF_SUCCESS
  end subroutine ESMF_SciCompGet