subroutine ESMF_TraceGridCompPhaseEpilogueExit(comp, rc)
! !ARGUMENTS:
type(ESMF_GridComp), intent(in) :: comp
integer, intent(out), optional :: rc
!
!EOPI
!-------------------------------------------------------------------------------
! locals
integer :: vmid
integer :: baseid
type(ESMF_Method_Flag) :: method
integer :: method_enum
integer :: phase
if (present(rc)) rc = ESMF_SUCCESS
call ESMF_TraceGetCompID(comp, vmid, baseid, rc=rc)
if (ESMF_LogFoundError(rc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
call ESMF_GridCompGet(comp, currentMethod=method, &
currentPhase=phase, rc=rc)
if (ESMF_LogFoundError(rc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
method_enum = ESMF_TraceMethodToEnum(method)
call c_esmftrace_phase_epilogue_exit(vmid, baseid, method_enum, phase, rc)
if (ESMF_LogFoundError(rc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
end subroutine ESMF_TraceGridCompPhaseEpilogueExit