subroutine ESMF_TraceGetCplCompID(comp, vmid, baseid, rc)
! !ARGUMENTS:
type(ESMF_CplComp), intent(in) :: comp
integer, intent(out) :: vmid
integer, intent(out) :: baseid
integer, intent(out), optional :: rc
!
!EOPI
!-------------------------------------------------------------------------------
! local
type(ESMF_VM) :: vm
type(ESMF_VMId) :: vmIdObj
if (present(rc)) rc = ESMF_SUCCESS
call ESMF_BaseGetID(comp%compp%base, baseid, rc=rc)
if (ESMF_LogFoundError(rc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
call ESMF_CplCompGet(comp, vm=vm, rc=rc)
if (ESMF_LogFoundError(rc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
call ESMF_VMGetVMId(vm=vm, vmId=vmIdObj, rc=rc)
if (ESMF_LogFoundError(rc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
call c_esmftrace_mapvmid(vmIdObj, vmid, rc)
if (ESMF_LogFoundError(rc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
end subroutine ESMF_TraceGetCplCompID