ESMF_VMGetCurrent Subroutine

public subroutine ESMF_VMGetCurrent(vm, keywordEnforcer, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_VM), intent(out) :: vm
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
integer, intent(out), optional :: rc

Calls

proc~~esmf_vmgetcurrent~~CallsGraph proc~esmf_vmgetcurrent ESMF_VMGetCurrent c_esmc_vmgetcurrent c_esmc_vmgetcurrent proc~esmf_vmgetcurrent->c_esmc_vmgetcurrent proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_vmgetcurrent->proc~esmf_logfounderror 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

AttributeUpdateReconcilewESMF_VMGetCurrent
w
BuildUpdatePacketsw
w
consistentComponentAttributesw
w
DetermineSrcDstOverlapw
w
display_flux1Dw
w
display_flux2Dw
w
ESMF_CompConstructw
w
ESMF_CompExecutew
w
ESMF_CompWaitw
w
ESMF_DistGridCreateDBAIw
w
ESMF_DistGridCreateDBAI1Dw
w
ESMF_DistGridCreateDBAI1D1DEw
w
ESMF_DistGridCreateDBAI1D1DEI8w
w
ESMF_DistGridRegDecompSetCubicw
w
ESMF_FieldBundleCreateExw
w
ESMF_FieldCommExw
w
ESMF_FieldExw
w
ESMF_FieldUTestw
w
ESMF_GridCreateCopyFromRegw
w
ESMF_GridCreateCubedSphereIRegw
w
ESMF_GridCreateCubedSphereRegw
w
ESMF_GridCreateDistgridRegw
w
ESMF_GridCreateFrmNCFilew
w
ESMF_GridCreateFrmNCFileDGw
w
ESMF_GridCreateMosaicIRegw
w
ESMF_GridCreateMosaicRegw
w
ESMF_GridCreateShapeTileRegw
w
ESMF_GridMatchw
w
ESMF_GridSetCmmitShapeTileRegw
w
ESMF_GridspecReadStaggerR4w
w
ESMF_GridspecReadStaggerR8w
w
ESMF_GridspecReadTilew
w
ESMF_InfoCacheUTestw
w
ESMF_InfoDescribeUTestw
w
ESMF_InfoSyncUTestw
w
ESMF_InfoUTestw
w
ESMF_LocStreamCreateFromLocalw
w
ESMF_LocStreamCreatePetListw
w
ESMF_LocStreamCreateRegw
w
ESMF_MeshCreateCubedSpherew
w
ESMF_MeshCreateFromScripw
w
ESMF_MeshCreateFromUnstructw
w
ESMF_MeshCreateRedistw
w
ESMF_StateReconcilew
w
ESMF_TestUTestw
w
ESMF_VMBarrierw
w
ESMF_VMEpochEnterw
w
ESMF_VMEpochExitw
w
ESMFIO_Createw
w
ExecuteUpdatePacketsw
w
f_esmf_regridstorefilew
w
FieldBundleHaloExw
w
FieldBundleRedistExw
w
FieldBundleSMMExw
w
FieldHaloExw
w
FieldRedistExw
w
FieldSMMExw
w
flux_exchangew
w
flux_exchangew
w
flux_exchange_sphw
w
flux_exchange_sphw
w
flux_exchange_sph_meshw
w
init_src_sphw
w
InitializeIPDv05p3w
w
mygcomp_runw
w
NUOPC_DriverAddCplCompw
w
NUOPC_FactorsWritew
w
NUOPC_LogIntrow
w
NUOPC_UpdateFieldListw
w
test2d_masking_singlew
w
test3w
w
test3d_masking_globalw
w
test3d_masking_regionalw
w
test4w
w
test5w
w
test6w
w
test7w
w
test8w
w
test_atnas_gridindexw
w
test_gather_1dw
w
test_gather_2dw
w
test_gather_3dw
w
test_localglobalboundsw
w
test_localglobalboundsmeshw
w
test_meshindexw
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_regridSrcHolesw
w
test_regridxgw
w
test_regridxg_constw
w
test_smmw
w
test_vm_currentw
w
test_vm_operatorsw
w
test_xgrid_w_ngon_meshw
w
userm2_setvmw
w
userm2_setvmw
w

Source Code

  subroutine ESMF_VMGetCurrent(vm, keywordEnforcer, rc)
!
! !ARGUMENTS:
    type(ESMF_VM), intent(out)           :: vm
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
    integer,       intent(out), optional :: rc
!
! !STATUS:
! \begin{itemize}
! \item\apiStatusCompatibleVersion{5.2.0r}
! \end{itemize}
!
! !DESCRIPTION:
!   \begin{sloppypar}
!   Get the {\tt ESMF\_VM} object of the current execution context. Calling
!   {\tt ESMF\_VMGetCurrent()} within an ESMF Component, will return the
!   same VM object as
!   {\tt ESMF\_GridCompGet(..., vm=vm, ...)} or
!   {\tt ESMF\_CplCompGet(..., vm=vm, ...)}. 
!   \end{sloppypar}
! 
!   The main purpose of providing {\tt ESMF\_VMGetCurrent()} is to simplify ESMF
!   adoption in legacy code. Specifically, code that uses {\tt MPI\_COMM\_WORLD}
!   deep within its calling tree can easily be modified to use the correct MPI
!   communicator of the current ESMF execution context. The advantage is that
!   these modifications are very local, and do not require wide reaching
!   interface changes in the legacy code to pass down the ESMF component object,
!   or the MPI communicator.
!
!   The use of {\tt ESMF\_VMGetCurrent()} is strongly discouraged in newly
!   written Component code. Instead, the ESMF Component object should be used as
!   the appropriate container of ESMF context information. This object should be
!   passed between the subroutines of a Component, and be queried for any
!   Component specific information.
!
!   Outside of a Component context, i.e. within the driver context, the call
!   to {\tt ESMF\_VMGetCurrent()} is identical to {\tt ESMF\_VMGetGlobal()}.
!
!   The arguments are:
!   \begin{description}
!   \item[vm] 
!     Upon return this holds the {\tt ESMF\_VM} object of the current execution
!     context.
!   \item[{[rc]}] 
!     Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!   \end{description}
!
!EOP
!------------------------------------------------------------------------------
    integer                 :: localrc      ! local return code

    ! initialize return code; assume routine not implemented
    localrc = ESMF_RC_NOT_IMPL
    if (present(rc)) rc = ESMF_RC_NOT_IMPL

    ! Call into the C++ interface.
    call c_ESMC_VMGetCurrent(vm, localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return
      
    ! Set init code
    ESMF_INIT_SET_CREATED(vm)

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

  end subroutine ESMF_VMGetCurrent