f_esmf_xgridgeombasecolgarbage Subroutine

subroutine f_esmf_xgridgeombasecolgarbage(gb, rc)

Arguments

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

Source Code

  subroutine f_esmf_xgridgeombasecolgarbage(gb, rc)
#undef  ESMF_METHOD
#define ESMF_METHOD "f_esmf_geombasecolgarbage()"
    use ESMF_UtilTypesMod
    use ESMF_LogErrMod
    use ESMF_XGridGeomBaseMod

    implicit none

    type(ESMF_XGridGeomBase)  :: gb
    integer, intent(out) :: rc

    integer :: localrc

    ! initialize return code; assume routine not implemented
    localrc = ESMF_RC_NOT_IMPL
    rc = ESMF_RC_NOT_IMPL

    !print *, "collecting GeomBase garbage"

    ! deallocate actual GeomBaseClass allocation
    if (associated(gb%gbcp)) then
      deallocate(gb%gbcp, stat=localrc)
      if (ESMF_LogFoundAllocError(localrc, msg="Deallocating GeomBase", &
        ESMF_CONTEXT, rcToReturn=rc)) return
    endif
    nullify(gb%gbcp)

    ! return successfully
    rc = ESMF_SUCCESS

  end subroutine f_esmf_xgridgeombasecolgarbage