subroutine ESMF_TraceCplCompPhaseEnter(comp, rc)
! !ARGUMENTS:
type(ESMF_CplComp), 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_CplCompGet(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_enter(vmid, baseid, method_enum, phase, rc)
if (ESMF_LogFoundError(rc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
end subroutine ESMF_TraceCplCompPhaseEnter