ESMF_IODestroy Subroutine

public subroutine ESMF_IODestroy(io, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_IO) :: io
integer, intent(out), optional :: rc

Source Code

  subroutine ESMF_IODestroy(io, rc)
!
! !ARGUMENTS:
    type(ESMF_IO)                  :: io
    integer, intent(out), optional :: rc
!     
! !DESCRIPTION:
!     Releases resources associated with this {\tt ESMF\_IO} object.
!     This includes deleting the {\tt ESMF\_IO} object itself.
!
!     The arguments are:
!     \begin{description}
!     \item[io]
!       Destroy contents of this {\tt ESMF\_IO} object.
!     \item[[rc]]
!       Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!     \end{description}
!
!EOPI

    integer :: localrc                        ! local return code

    ! Assume failure until success
    if (present(rc)) rc = ESMF_RC_NOT_IMPL
    localrc = ESMF_RC_NOT_IMPL

!   invoke C to C++ entry point
    call c_ESMC_IODestroy(io, localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
         ESMF_CONTEXT, rcToReturn=rc)) then 
      write(*,*)" c_ESMC_IODestroy failed"
      return
    endif

    ! Return success
    if (present(rc)) rc = localrc
  end subroutine ESMF_IODestroy