ESMF_GridDestroy Subroutine

public subroutine ESMF_GridDestroy(grid, keywordEnforcer, noGarbage, rc)

Arguments

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

Calls

proc~~esmf_griddestroy~~CallsGraph proc~esmf_griddestroy ESMF_GridDestroy c_esmc_griddestroy c_esmc_griddestroy proc~esmf_griddestroy->c_esmc_griddestroy proc~esmf_gridgetinit ESMF_GridGetInit proc~esmf_griddestroy->proc~esmf_gridgetinit proc~esmf_imerr ESMF_IMErr proc~esmf_griddestroy->proc~esmf_imerr proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_griddestroy->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

Arb2ArbBunReDistwESMF_GridDestroy
w
Arb2ArbFldReDistw
w
atmos_finalw
w
atmos_finalw
w
Blk2ArbBunRedistw
w
Blk2ArbFldRedistw
w
Blk2BlkBunRedistw
w
Blk2BlkFldRedistw
w
bundle_test1_genericw
w
ESMF_AttributeUtilUTestw
w
ESMF_FieldArbGridUTestw
w
ESMF_FieldArgGridExw
w
ESMF_FieldBundleCreateExw
w
ESMF_FieldBundleIOUTestw
w
ESMF_FieldCommExw
w
ESMF_FieldCreateExw
w
ESMF_FieldDestructGeomw
w
ESMF_FieldExw
w
ESMF_FieldHaloUTestw
w
ESMF_FieldIOUTestw
w
ESMF_FieldRedistArbUTestw
w
ESMF_FieldRegridExw
w
ESMF_FieldRegridExw
w
ESMF_FieldRepDimExw
w
ESMF_FieldSphereRegridExw
w
ESMF_GeomUTestw
w
ESMF_GridArbitraryUTestw
w
ESMF_GridCoordUTestw
w
ESMF_GridCreateCubedSphereRegw
w
ESMF_GridCreateExw
w
ESMF_GridCreateExw
w
ESMF_GridCreateFrmNCFilew
w
ESMF_GridCreateFrmNCFileDGw
w
ESMF_GridCreateMosaicRegw
w
ESMF_GridCreateUTestw
w
ESMF_GridItemUTestw
w
ESMF_GridToMeshUTestw
w
ESMF_InfoCacheUTestw
w
ESMF_InfoSyncUTestw
w
ESMF_IOCompUTestw
w
ESMF_LocStreamExw
w
ESMF_RHandleDynamicMaskingExw
w
ESMF_RHandleReusabilityExw
w
ESMF_XGridExw
w
ESMF_XGridSparseMatExw
w
field_redist_testw
w
field_regrid_testw
w
FieldBundleHaloExw
w
FieldBundleRedistExw
w
FieldBundleSMMExw
w
FieldHaloExw
w
FieldRedistw
w
FieldRedistExw
w
FieldSMMExw
w
Finalizew
w
Finalizew
w
Finalizew
w
Finalizew
w
InitializeIPDv05p5w
w
land_finalw
w
land_finalw
w
ModelFinalizew
w
ocean_finalw
w
test2aw
w
test2a_bigarrayw
w
test2a_failw
w
test2a_getw
w
test2a_isallocw
w
test2bw
w
test2cw
w
test2dw
w
test2d_failw
w
test2d_genericw
w
test2d_generic_sctptrw
w
test2ew
w
test2e_failw
w
test2e_genericw
w
test2e_ugbw
w
test2e_ugb_bigarrayw
w
test2e_ugb_failw
w
test2f_genericw
w
test3w
w
test3aw
w
test3a2_fptrw
w
test3a_fptrw
w
test3bw
w
test3b_failw
w
test3cw
w
test3dw
w
test3d_genericw
w
test3d_generic_repdimw
w
test3d_generic_repdim_sctw
w
test3d_generic_sctptrw
w
test3ew
w
test3fw
w
test3gw
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_1_width_DE_GtoMw
w
test_3Dcartcsrvregridwmasksw
w
test_allrep1w
w
test_allrep2w
w
test_bilinear_regrid_csgridw
w
test_bilinear_regrid_csgrid_sph_radw
w
test_bilinear_regrid_csmeshw
w
test_bilinear_regrid_csmosaicw
w
test_cart_bilinear_xgridw
w
test_cartcsrvregridwmasksw
w
test_cartcsrvregridwmasksw
w
test_comp_geomw
w
test_conserve_regrid_csgridw
w
test_conserve_regrid_csmeshw
w
test_conserve_regrid_csmosaicw
w
test_CSGridToGridw
w
test_CSGridToGrid_2ndw
w
test_CSGridToGridWMasksw
w
test_csrvregridw
w
test_csrvregridwmasksw
w
test_csrvregridwmasksUserAreaw
w
test_DTOSGridToGridSph3Dw
w
test_extrap_creep_nrst_dw
w
test_extrap_nrst_dw
w
test_field_createw
w
test_FieldEmptyResetw
w
test_geomw
w
test_geom_comp_tkrw
w
test_geom_tkrw
w
test_globalindexw
w
test_GridToGridw
w
test_localglobalboundsw
w
test_locstreambkgw
w
test_locstreambkgndaw
w
test_locstreambkgsphw
w
test_MasksAndUserAreaw
w
test_mesh_dual_w_bilinearw
w
test_MOAB_GtoMw
w
test_nearest_regrid_csgridw
w
test_nearest_regrid_csmeshw
w
test_patch_regrid_csgridw
w
test_patch_regrid_csmeshw
w
test_pointlist_from_grid_nomaskw
w
test_pointlist_from_grid_wmaskw
w
test_regrid0WidthDEsw
w
test_regrid180vs360w
w
test_regrid2TileDGw
w
test_regrid2TileDGw
w
test_regrid2xgw
w
test_regrid2xg_clipw
w
test_regrid2xg_containw
w
test_regrid2xg_halfw
w
test_regrid2xg_onlinew
w
test_regrid2xgSphw
w
test_regrid2xgSphw
w
test_regrid3Dw
w
test_regrid3D_DTOSw
w
test_regrid3D_STODw
w
test_regrid_extrap_creepw
w
test_regrid_extrap_near_npntsw
w
test_regrid_extrap_nearstodw
w
test_regrid_gridufrmw
w
test_regrid_nanw
w
test_regrid_snanw
w
test_regrid_store_from_filew
w
test_regrid_transposew
w
test_regrid_w_gtomw
w
test_regridAllDstMaskw
w
test_regridCnrw
w
test_regridDELOCALw
w
test_regridDGSphw
w
test_regridDstMaskw
w
test_regridEdgew
w
test_regridExtraFieldDimw
w
test_regridGridToGMLw
w
test_regridGridToGridSph3Dw
w
test_regridGridToLocStream3dw
w
test_regridGridToLocStreamLocCntw
w
test_regridGridToLocStreamRegDistw
w
test_regridGridToMeshw
w
test_regridIrregw
w
test_regridMatrixw
w
test_regridMatrixFactorw
w
test_regridMeshSph3x3ToGridw
w
test_regridMeshToGridw
w
test_regridMeshToGrid3Dw
w
test_regridMeshToGridSph3Dw
w
test_regridNearestLocStreamToGridw
w
test_regridPartialVMw
w
test_regridPHMeshToGridw
w
test_regridR4w
w
test_regridSMMArbGridw
w
test_regridSphDstMaskw
w
test_regridSphGCw
w
test_regridSphNearestw
w
test_regridSphNearestDToSw
w
test_regridSphPoleAllAvgw
w
test_regridSphPoleNonew
w
test_regridSphPoleNpntAvgw
w
test_regridSphPoleTeethw
w
test_regridSphSrcMaskw
w
test_regridSrcMaskw
w
test_regridSwitchedIndicesw
w
test_regridSwitchedIndicesIIw
w
test_regridTetMeshToGrid3Dw
w
test_regridxgw
w
test_regridxg_constw
w
test_side_and_elem_infow
w
test_slicingw
w
test_sph_bilinear_xgridw
w
test_sph_csrv_w_frac_normw
w
test_sph_vec_blnr_csG_to_llGw
w
test_sph_vec_blnr_csG_to_llG_pw
w
test_sph_vec_blnr_identicalw
w
test_STODGridToGridSph3Dw
w
test_unmappedDstListw
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
userm1_finalw
w
userm1_finalw
w
userm1_finalw
w
userm1_finalw
w
userm1_initw
w

Source Code

      subroutine ESMF_GridDestroy(grid, keywordEnforcer, noGarbage, rc)
!
! !ARGUMENTS:
      type(ESMF_Grid), intent(inout)         :: grid
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\_Grid} object and related internal structures.
! This call does destroy internally created DistGrid and DELayout classes,
! for example those created by {\tt ESMF\_GridCreateShapeTile()}. It also
! destroys internally created coordinate/item Arrays, for example those
! created by {\tt ESMF\_GridAddCoord()}. However, if the user uses an
! externally created class, for example creating an Array and setting it
! using {\tt ESMF\_GridSetCoord()}, then that class is not destroyed by
! this method.
!
!   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[grid]
!      {\tt ESMF\_Grid} 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 failure until success is certain
    localrc = ESMF_RC_NOT_IMPL
    if (present(rc)) rc = ESMF_RC_NOT_IMPL

    ! Check init status of arguments
    ESMF_INIT_CHECK_DEEP(ESMF_GridGetInit, grid, rc)

    ! Set default flags
    opt_noGarbage = ESMF_FALSE
    if (present(noGarbage)) opt_noGarbage = noGarbage

    ! Call F90/C++ interface subroutine
    call c_ESMC_GridDestroy(grid, opt_noGarbage, localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return

    ! Mark this Grid object as invalid
    grid%this = ESMF_NULL_POINTER

    ! Set init code
    ESMF_INIT_SET_DELETED(grid)

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

 end subroutine ESMF_GridDestroy