ESMF_SciCompSet Subroutine

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

Arguments

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

Source Code

  subroutine ESMF_SciCompSet(scicomp, keywordEnforcer, name, rc)
!
! !ARGUMENTS:
    type(ESMF_SciComp), intent(inout)          :: scicomp
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
    character(len=*),    intent(in),  optional :: name
    integer,             intent(out), optional :: rc
!
! !DESCRIPTION:
! Sets or resets information about an {\tt ESMF\_SciComp}.
!
! The arguments are:
! \begin{description}
! \item[scicomp]
!   {\tt ESMF\_SciComp} to change.
! \item[{[name]}]
!   Set 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

    ! 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,rc)

    if (scicomp%isNamedAlias .and. present(name)) then
      ! set NamedAlias name
      scicomp%name = trim(name)
      ! call Comp method (without name)
      call ESMF_CompSet(scicomp%compp, rc=localrc)
      if (ESMF_LogFoundError(localrc, &
        ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, rcToReturn=rc)) return
    else
      ! call Comp method
      call ESMF_CompSet(scicomp%compp, name=name, rc=localrc)
      if (ESMF_LogFoundError(localrc, &
        ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, rcToReturn=rc)) return
    endif

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