ESMF_XGridGeomBaseDestroy Subroutine

public subroutine ESMF_XGridGeomBaseDestroy(gridbase, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_XGridGeomBase) :: gridbase
integer, intent(out), optional :: rc

Source Code

      subroutine ESMF_XGridGeomBaseDestroy(gridbase, rc)
!
! !ARGUMENTS:
      type(ESMF_XGridGeomBase) :: gridbase
      integer, intent(out), optional :: rc
!
! !DESCRIPTION:
!   Destroys an {\tt ESMF\_GridBase} object. This call does not destroy wrapped
!   Grid, or other Grid objects.
!
!     The arguments are:
!     \begin{description}
!     \item[gridbase]
!          {\tt ESMF\_XGridGeomBase} to be destroyed.
!     \item[{[rc]}]
!          Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!     \end{description}
!
!EOPI

    ! Initialize return code; assume failure until success is certain
    if (present(rc)) rc = ESMF_RC_NOT_IMPL

    ! Check init status of arguments
    ESMF_INIT_CHECK_DEEP(ESMF_XGridGeomBaseGetInit, gridbase, rc)

    ! do _not_ deallocate/nullify GeomBase memory here because ESMF
    ! garbage collection will handle cleaning up GeomBase allocations

    ! Set init code
    ESMF_INIT_SET_DELETED(gridbase)

    ! Return successfully
    if (present(rc)) rc = ESMF_SUCCESS

 end subroutine ESMF_XGridGeomBaseDestroy