ESMF_BaseDestroyWoGarbage Subroutine

public subroutine ESMF_BaseDestroyWoGarbage(base, rc)

Arguments

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

Source Code

  subroutine ESMF_BaseDestroyWoGarbage(base, rc)
!
! !ARGUMENTS:
    type(ESMF_Base)                        :: base                 
    integer,        intent(out),  optional :: rc     

!
! !DESCRIPTION:
!     Release resources held by a Base object.
!
!     \begin{description}
!     \item [base]
!           An {\tt ESMF\_Base} derived type to be deleted.
!     \item [{[rc]}]
!           Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!     \end{description}
!
!EOPI

    logical :: rcpresent                          ! Return code present   
    integer :: localrc
    type(ESMF_Logical)      :: opt_noGarbage  ! helper variable

    ! Initialize return code
    rcpresent = .FALSE.
    if(present(rc)) then
      rcpresent = .TRUE.
      rc = ESMF_RC_NOT_IMPL
    endif

    ! check input parameters
    ESMF_INIT_CHECK_DEEP(ESMF_BaseGetInit,base,rc)

    ! Call into the C++ interface
    call c_ESMC_BaseDestroyWoGarbage(base, localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return

    ! Set init code
    ESMF_INIT_SET_DELETED(base)
 
    ! Return successfully
    if (present(rc)) rc = ESMF_SUCCESS
 
  end subroutine ESMF_BaseDestroyWoGarbage