ESMF_ArrayBundleDestroy Subroutine

public subroutine ESMF_ArrayBundleDestroy(arraybundle, keywordEnforcer, noGarbage, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_ArrayBundle), intent(inout) :: arraybundle
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
logical, intent(in), optional :: noGarbage
integer, intent(out), optional :: rc

Calls

proc~~esmf_arraybundledestroy~~CallsGraph proc~esmf_arraybundledestroy ESMF_ArrayBundleDestroy c_esmc_arraybundledestroy c_esmc_arraybundledestroy proc~esmf_arraybundledestroy->c_esmc_arraybundledestroy proc~esmf_arraybundlegetinit ESMF_ArrayBundleGetInit proc~esmf_arraybundledestroy->proc~esmf_arraybundlegetinit proc~esmf_imerr ESMF_IMErr proc~esmf_arraybundledestroy->proc~esmf_imerr proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_arraybundledestroy->proc~esmf_logfounderror proc~esmf_imerr->proc~esmf_logfounderror proc~esmf_initcheckdeep ESMF_InitCheckDeep proc~esmf_imerr->proc~esmf_initcheckdeep esmf_breakpoint esmf_breakpoint proc~esmf_logfounderror->esmf_breakpoint proc~esmf_logrc2msg ESMF_LogRc2Msg proc~esmf_logfounderror->proc~esmf_logrc2msg proc~esmf_logwrite ESMF_LogWrite proc~esmf_logfounderror->proc~esmf_logwrite c_esmc_loggeterrormsg c_esmc_loggeterrormsg proc~esmf_logrc2msg->c_esmc_loggeterrormsg c_esmc_vmwtime c_esmc_vmwtime proc~esmf_logwrite->c_esmc_vmwtime proc~esmf_logclose ESMF_LogClose proc~esmf_logwrite->proc~esmf_logclose proc~esmf_logflush ESMF_LogFlush proc~esmf_logwrite->proc~esmf_logflush proc~esmf_logopenfile ESMF_LogOpenFile proc~esmf_logwrite->proc~esmf_logopenfile proc~esmf_utiliounitflush ESMF_UtilIOUnitFlush proc~esmf_logwrite->proc~esmf_utiliounitflush proc~esmf_utilstring2array ESMF_UtilString2Array proc~esmf_logwrite->proc~esmf_utilstring2array proc~esmf_logclose->proc~esmf_logflush proc~esmf_logflush->proc~esmf_utiliounitflush proc~esmf_utilarray2string ESMF_UtilArray2String proc~esmf_logflush->proc~esmf_utilarray2string proc~esmf_logopenfile->proc~esmf_utiliounitflush proc~esmf_utiliounitget ESMF_UtilIOUnitGet proc~esmf_logopenfile->proc~esmf_utiliounitget

Called by

proc~~esmf_arraybundledestroy~~CalledByGraph proc~esmf_arraybundledestroy ESMF_ArrayBundleDestroy proc~esmf_gridcreatecopyfromnewdg ESMF_GridCreateCopyFromNewDG proc~esmf_gridcreatecopyfromnewdg->proc~esmf_arraybundledestroy proc~esmf_gridredist ESMF_GridRedist proc~esmf_gridredist->proc~esmf_arraybundledestroy proc~esmf_locstreamcreatefromnewdg ESMF_LocStreamCreateFromNewDG proc~esmf_locstreamcreatefromnewdg->proc~esmf_arraybundledestroy proc~esmf_reconcilezappedproxies ESMF_ReconcileZappedProxies proc~esmf_reconcilezappedproxies->proc~esmf_arraybundledestroy proc~testarraybundlenamedalias TestArrayBundleNamedAlias proc~testarraybundlenamedalias->proc~esmf_arraybundledestroy proc~user_final~47 user_final proc~user_final~47->proc~esmf_arraybundledestroy proc~user_final~92 user_final proc~user_final~92->proc~esmf_arraybundledestroy proc~x_comp_grid_diag x_comp_grid_diag proc~x_comp_grid_diag->proc~esmf_arraybundledestroy program~esmf_arraybundlecreateutest ESMF_ArrayBundleCreateUTest program~esmf_arraybundlecreateutest->proc~esmf_arraybundledestroy program~esmf_arraybundleex ESMF_ArrayBundleEx program~esmf_arraybundleex->proc~esmf_arraybundledestroy program~esmf_arraybundlehaloex ESMF_ArrayBundleHaloEx program~esmf_arraybundlehaloex->proc~esmf_arraybundledestroy program~esmf_arraybundleioutest ESMF_ArrayBundleIOUTest program~esmf_arraybundleioutest->proc~esmf_arraybundledestroy program~esmf_arraybundleredistutest ESMF_ArrayBundleRedistUTest program~esmf_arraybundleredistutest->proc~esmf_arraybundledestroy program~esmf_infosyncutest ESMF_InfoSyncUTest program~esmf_infosyncutest->proc~esmf_arraybundledestroy interface~esmf_gridcreate ESMF_GridCreate interface~esmf_gridcreate->proc~esmf_gridcreatecopyfromnewdg interface~esmf_locstreamcreate ESMF_LocStreamCreate interface~esmf_locstreamcreate->proc~esmf_locstreamcreatefromnewdg proc~esmf_gridcreatefrmncfile ESMF_GridCreateFrmNCFile proc~esmf_gridcreatefrmncfile->proc~esmf_gridcreatecopyfromnewdg proc~esmf_gridcreatefrmncfiledg ESMF_GridCreateFrmNCFileDG proc~esmf_gridcreatefrmncfiledg->proc~esmf_gridcreatecopyfromnewdg proc~esmf_locstreamcreatepetlist ESMF_LocStreamCreatePetList proc~esmf_locstreamcreatepetlist->proc~esmf_locstreamcreatefromnewdg proc~esmf_statereconcile_driver ESMF_StateReconcile_driver proc~esmf_statereconcile_driver->proc~esmf_reconcilezappedproxies proc~realize Realize proc~realize->proc~x_comp_grid_diag program~esmf_gridcreateutest ESMF_GridCreateUTest program~esmf_gridcreateutest->proc~esmf_gridredist program~esmf_namedaliasutest ESMF_NamedAliasUTest program~esmf_namedaliasutest->proc~testarraybundlenamedalias

Source Code

  subroutine ESMF_ArrayBundleDestroy(arraybundle, keywordEnforcer, noGarbage, rc)
!
! !ARGUMENTS:
    type(ESMF_ArrayBundle), intent(inout)           :: arraybundle
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
    logical,                intent(in),   optional  :: noGarbage
    integer,                intent(out),  optional  :: rc
!         
! !STATUS:
! \begin{itemize}
! \item\apiStatusCompatibleVersion{5.2.0r}
! \item\apiStatusModifiedSinceVersion{5.2.0r}
! \begin{description}
! \item[7.0.0] Added argument {\tt noGarbage}.
!   The argument provides a mechanism to override the default garbage collection
!   mechanism when destroying an ESMF object.
! \end{description}
! \end{itemize}
!
! !DESCRIPTION:
!   Destroys an {\tt ESMF\_ArrayBundle} object. The member Arrays are not
!   touched by this operation and remain valid objects that need to be 
!   destroyed individually if necessary. 
!
!   By default a small remnant of the object is kept in memory in order to 
!   prevent problems with dangling aliases. The default garbage collection
!   mechanism can be overridden with the {\tt noGarbage} argument.
!
! The arguments are:
! \begin{description}
! \item[arraybundle]
!      {\tt ESMF\_ArrayBundle} object to be destroyed.
! \item[{[noGarbage]}]
!      If set to {\tt .TRUE.} the object will be fully destroyed and removed
!      from the ESMF garbage collection system. Note however that under this 
!      condition ESMF cannot protect against accessing the destroyed object 
!      through dangling aliases -- a situation which may lead to hard to debug 
!      application crashes.
! 
!      It is generally recommended to leave the {\tt noGarbage} argument
!      set to {\tt .FALSE.} (the default), and to take advantage of the ESMF 
!      garbage collection system which will prevent problems with dangling
!      aliases or incorrect sequences of destroy calls. However this level of
!      support requires that a small remnant of the object is kept in memory
!      past the destroy call. This can lead to an unexpected increase in memory
!      consumption over the course of execution in applications that use 
!      temporary ESMF objects. For situations where the repeated creation and 
!      destruction of temporary objects leads to memory issues, it is 
!      recommended to call with {\tt noGarbage} set to {\tt .TRUE.}, fully 
!      removing the entire temporary object from memory.
! \item[{[rc]}]
!      Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
! \end{description}
!
!EOP
!------------------------------------------------------------------------------
    integer                 :: localrc        ! local return code
    type(ESMF_Logical)      :: opt_noGarbage  ! helper variable

    ! Initialize return code
    if (present(rc)) rc = ESMF_RC_NOT_IMPL
    localrc = ESMF_RC_NOT_IMPL

    ! Check init status of arguments
    ESMF_INIT_CHECK_DEEP_SHORT(ESMF_ArrayBundleGetInit, arraybundle, rc)
    
    ! Set default flags
    opt_noGarbage = ESMF_FALSE
    if (present(noGarbage)) opt_noGarbage = noGarbage

    ! Call into the C++ interface layer
    call c_ESMC_ArrayBundleDestroy(arraybundle, opt_noGarbage, localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return

    ! Mark this ArrayBundle as invalid
    arraybundle%this = ESMF_NULL_POINTER

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