ESMF_VMBroadcastR8 Subroutine

private subroutine ESMF_VMBroadcastR8(vm, bcstData, count, rootPet, keywordEnforcer, syncflag, commhandle, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_VM), intent(in) :: vm
real(kind=ESMF_KIND_R8), intent(inout), target :: bcstData(:)
integer, intent(in) :: count
integer, intent(in) :: rootPet
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
type(ESMF_Sync_Flag), intent(in), optional :: syncflag
type(ESMF_CommHandle), intent(out), optional :: commhandle
integer, intent(out), optional :: rc

Calls

proc~~esmf_vmbroadcastr8~~CallsGraph proc~esmf_vmbroadcastr8 ESMF_VMBroadcastR8 interface~c_esmc_vmbroadcast c_ESMC_VMBroadcast proc~esmf_vmbroadcastr8->interface~c_esmc_vmbroadcast interface~c_esmc_vmbroadcastnb c_ESMC_VMBroadcastNB proc~esmf_vmbroadcastr8->interface~c_esmc_vmbroadcastnb proc~esmf_imerr ESMF_IMErr proc~esmf_vmbroadcastr8->proc~esmf_imerr proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_vmbroadcastr8->proc~esmf_logfounderror proc~esmf_vmgetinit ESMF_VMGetInit proc~esmf_vmbroadcastr8->proc~esmf_vmgetinit proc~esmf_imerr->proc~esmf_logfounderror proc~esmf_initcheckdeep ESMF_InitCheckDeep proc~esmf_imerr->proc~esmf_initcheckdeep 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

proc~~esmf_vmbroadcastr8~~CalledByGraph proc~esmf_vmbroadcastr8 ESMF_VMBroadcastR8 interface~esmf_vmbroadcast ESMF_VMBroadcast interface~esmf_vmbroadcast->proc~esmf_vmbroadcastr8 proc~esmf_frameworkinternalinit ESMF_FrameworkInternalInit proc~esmf_frameworkinternalinit->interface~esmf_vmbroadcast proc~esmf_gridcreatefrmncfiledg ESMF_GridCreateFrmNCFileDG proc~esmf_gridcreatefrmncfiledg->interface~esmf_vmbroadcast proc~esmf_outputweightfile ESMF_OutputWeightFile proc~esmf_outputweightfile->interface~esmf_vmbroadcast proc~esmf_reconcilesinglecompcase ESMF_ReconcileSingleCompCase proc~esmf_reconcilesinglecompcase->interface~esmf_vmbroadcast proc~esmf_statereconcile ESMF_StateReconcile proc~esmf_statereconcile->interface~esmf_vmbroadcast proc~ioread2d IORead2D proc~ioread2d->interface~esmf_vmbroadcast proc~nuopc_updatefieldlist NUOPC_UpdateFieldList proc~nuopc_updatefieldlist->interface~esmf_vmbroadcast program~esmf_regridapp ESMF_RegridApp program~esmf_regridapp->interface~esmf_vmbroadcast program~esmf_regridweightgenapp ESMF_RegridWeightGenApp program~esmf_regridweightgenapp->interface~esmf_vmbroadcast program~esmf_test_harness esmf_test_harness program~esmf_test_harness->interface~esmf_vmbroadcast program~esmf_vmbroadcastutest ESMF_VMBroadcastUTest program~esmf_vmbroadcastutest->interface~esmf_vmbroadcast

Source Code

  subroutine ESMF_VMBroadcastR8(vm, bcstData, count, rootPet, &
    keywordEnforcer, syncflag, commhandle, rc)
!
! !ARGUMENTS:
    type(ESMF_VM),              intent(in)            :: vm
    real(ESMF_KIND_R8), target, intent(inout)         :: bcstData(:)
    integer,                    intent(in)            :: count
    integer,                    intent(in)            :: rootPet
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
    type(ESMF_Sync_Flag),       intent(in),  optional :: syncflag
    type(ESMF_CommHandle),      intent(out), optional :: commhandle
    integer,                    intent(out), optional :: rc
!         
!EOPI
!------------------------------------------------------------------------------
    integer                 :: localrc      ! local return code
    integer                 :: size
    logical                 :: blocking
    type(ESMF_CommHandle)   :: localcommhandle

    ! initialize return code; assume routine not implemented
    localrc = ESMF_RC_NOT_IMPL
    if (present(rc)) rc = ESMF_RC_NOT_IMPL
    ! Check init status of arguments
    ESMF_INIT_CHECK_DEEP(ESMF_VMGetInit, vm, rc)

    ! Initialize commhandle to an invalid pointer
    if (present(commhandle)) commhandle%this = ESMF_NULL_POINTER

    ! Decide whether this is blocking or non-blocking
    blocking = .true. !default is blocking
    if (present(syncflag)) then
      if (syncflag == ESMF_SYNC_NONBLOCKING) blocking = .false. ! non-blocking
    endif
    
    if (count > 0) then
      size = count * 8 ! 8 bytes
      ! Call into the C++ interface.
      if (blocking) then
        call c_ESMC_VMBroadcast(vm, bcstData, size, rootPet, localrc)
        if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return
      else
        call c_ESMC_VMBroadcastNB(vm, bcstData, size, rootPet, localcommhandle, &
          localrc)
        if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return
        ! Check if we need to pass back the commhandle
        if (present(commhandle)) then
          commhandle = localcommhandle  ! copy the commhandle pointer back
          ! Set init code
          ESMF_INIT_SET_CREATED(commhandle)
        endif
      endif
    endif

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

  end subroutine ESMF_VMBroadcastR8