ESMF_IsProxy Function

public function ESMF_IsProxy(base, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Base), intent(in), optional :: base
integer, intent(out), optional :: rc

Return Value logical


Source Code

  function ESMF_IsProxy(base, rc) 
!
! !RETURN VALUE:
    logical :: ESMF_IsProxy   
!
! !ARGUMENTS:
    type(ESMF_Base), intent(in),  optional :: base
    integer,         intent(out), optional :: rc
!
! !DESCRIPTION:
!      Access proxyflag and return true/false accordingly
!
!     The arguments are:
!     \begin{description}
!     \item [{[base]}]
!           Base object.
!     \item [{[rc]}]
!           Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!     \end{description}
!
!EOPI
    integer             :: localrc
    type(ESMF_Logical)  :: isProxy

    ! Initialize
    localrc = ESMF_RC_NOT_IMPL
    rc = ESMF_RC_NOT_IMPL

    ESMF_IsProxy = .false. ! initialize
    
    if (.not.present(base)) then
      call ESMF_LogSetError(rcToCheck=ESMF_RC_ARG_INCOMP, &
        msg="Base object must be present.", &
        ESMF_CONTEXT, rcToReturn=rc)
      return
    else
      call c_ESMC_IsProxy(base, isProxy, localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, rcToReturn=rc)) return
      ESMF_IsProxy = isProxy
    endif

    ! Return successfully
    rc = ESMF_SUCCESS

  end function ESMF_IsProxy