ESMF_DistGridDestroy Subroutine

public subroutine ESMF_DistGridDestroy(distgrid, keywordEnforcer, noGarbage, rc)

Arguments

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

Calls

proc~~esmf_distgriddestroy~~CallsGraph proc~esmf_distgriddestroy ESMF_DistGridDestroy c_esmc_distgriddestroy c_esmc_distgriddestroy proc~esmf_distgriddestroy->c_esmc_distgriddestroy proc~esmf_distgridgetinit ESMF_DistGridGetInit proc~esmf_distgriddestroy->proc~esmf_distgridgetinit proc~esmf_imerr ESMF_IMErr proc~esmf_distgriddestroy->proc~esmf_imerr proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_distgriddestroy->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

array_redist_testwESMF_DistGridDestroy
w
check_coordSys_convert_EM_filew
w
check_mesh_from_cart_3x3_EM_filew
w
check_mesh_from_sph_3D_EM_filew
w
check_mesh_from_sph_3D_UG_filew
w
check_mesh_from_sph_3x3_EM_filew
w
check_mesh_from_sph_3x3_SC_filew
w
check_mesh_from_sph_3x3_UG_filew
w
check_mesh_from_sph_pb_EM_filew
w
check_mesh_from_sph_pb_si_EM_filew
w
check_mesh_from_sph_pb_UG_filew
w
check_mesh_node_redist_from_filew
w
check_mesh_sph_1DeC_EM_filew
w
compFinalw
w
compFinalw
w
compFinalw
w
ESMF_ArrayArbHaloExw
w
ESMF_ArrayArbIdxSMMUTestw
w
ESMF_ArrayBundleCreateUTestw
w
ESMF_ArrayBundleExw
w
ESMF_ArrayBundleHaloExw
w
ESMF_ArrayBundleIOUTestw
w
ESMF_ArrayCommNBExw
w
ESMF_ArrayCreateGetUTestw
w
ESMF_ArrayDataUTestw
w
ESMF_ArrayExw
w
ESMF_ArrayFarrayExw
w
ESMF_ArrayFarrayHaloExw
w
ESMF_ArrayHaloExw
w
ESMF_ArrayHaloUTestw
w
ESMF_ArrayInfoUTestw
w
ESMF_ArrayIOUTestw
w
ESMF_ArrayLarrayExw
w
ESMF_ArrayRedistExw
w
ESMF_ArrayRedistUTestw
w
ESMF_ArrayScatterGatherArbExw
w
ESMF_ArrayScatterGatherExw
w
ESMF_ArrayScatterUTestw
w
ESMF_ArraySparseMatMulExw
w
ESMF_AttributeProfileUTestw
w
ESMF_DistGridCreateGetUTestw
w
ESMF_DistGridExw
w
ESMF_FieldExw
w
ESMF_FieldIOUTestw
w
ESMF_FieldRepDimExw
w
ESMF_GridArbitraryUTestw
w
ESMF_GridCoordUTestw
w
ESMF_GridCreateCubedSphereRegw
w
ESMF_GridCreateExw
w
ESMF_GridCreateExw
w
ESMF_GridCreateMosaicRegw
w
ESMF_GridCreateUTestw
w
ESMF_GridItemUTestw
w
ESMF_InfoCacheUTestw
w
ESMF_InfoGetFromHostExw
w
ESMF_InfoProfileUTestw
w
ESMF_InfoSyncUTestw
w
ESMF_LocStreamCreateUTestw
w
ESMF_LocStreamDestructw
w
ESMF_MeshExw
w
ESMF_MeshUTestw
w
ESMF_OutputWeightFilew
w
ESMF_RHandleVMEpochExw
w
ESMF_XGridDestroyw
w
field_redist_testw
w
field_regrid_testw
w
FieldBundleHaloExw
w
FieldBundleRedistExw
w
FieldBundleSMMExw
w
FieldHaloExw
w
FieldRedistExw
w
FieldSMMExw
w
finalw
w
gatherRedistFracFieldMeshw
w
myFinalInFortranw
w
NUOPC_FactorsWritew
w
test2d_generic_sctptrw
w
test3d_generic_repdimw
w
test3d_generic_repdim_sctw
w
test3d_generic_sctptrw
w
test7d1w
w
test7d2w
w
test7d2_genericw
w
test7d2_generic_fptrw
w
test7d3_genericw
w
test7d3_generic_fptrw
w
test7d3_generic_repdimw
w
test7d3_generic_repdim_sctw
w
test7d4_genericw
w
test7d_genericw
w
test_allrep1w
w
test_allrep2w
w
test_gather_1dw
w
test_gather_2dw
w
test_gather_3dw
w
test_mesh_create_from_med_EM_filew
w
test_mesh_create_gt_1localdew
w
test_regrid2TileDGw
w
test_regrid2TileDGw
w
test_smmw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w
user_finalw
w

Source Code

  subroutine ESMF_DistGridDestroy(distgrid, keywordEnforcer, noGarbage, rc)
!
! !ARGUMENTS:
    type(ESMF_DistGrid), intent(inout)          :: distgrid
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\_DistGrid}, releasing the resources associated
!   with the object.
!
!   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[distgrid] 
!      {\tt ESMF\_DistGrid} 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; assume routine not implemented
    localrc = ESMF_RC_NOT_IMPL
    if (present(rc)) rc = ESMF_RC_NOT_IMPL

    ! Check init status of arguments
    ESMF_INIT_CHECK_DEEP(ESMF_DistGridGetInit, distgrid, rc)
    
    ! Set default flags
    opt_noGarbage = ESMF_FALSE
    if (present(noGarbage)) opt_noGarbage = noGarbage

    ! Call into the C++ interface, which will sort out optional arguments.
    call c_ESMC_DistGridDestroy(distgrid, opt_noGarbage, localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return
 
    ! Mark this DistGrid as invalid
    distgrid%this = ESMF_NULL_POINTER

    ! Set init code
    ESMF_INIT_SET_DELETED(distgrid)
 
    ! return successfully
    if (present(rc)) rc = ESMF_SUCCESS
 
  end subroutine ESMF_DistGridDestroy