ESMF_TraceGetGridCompID Subroutine

private subroutine ESMF_TraceGetGridCompID(comp, vmid, baseid, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_GridComp), intent(in) :: comp
integer, intent(out) :: vmid
integer, intent(out) :: baseid
integer, intent(out), optional :: rc

Source Code

  subroutine ESMF_TraceGetGridCompID(comp, vmid, baseid, rc)
! !ARGUMENTS: 
    type(ESMF_GridComp), 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_GridCompGet(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_TraceGetGridCompID