ESMF_DistGridSetPLocalDe Subroutine

private subroutine ESMF_DistGridSetPLocalDe(distgrid, localDe, collocation, keywordEnforcer, seqIndexList, seqIndexListI8, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_DistGrid), intent(inout) :: distgrid
integer, intent(in) :: localDe
integer, intent(in), optional :: collocation
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
integer, intent(in), optional, target :: seqIndexList(:)
integer(kind=ESMF_KIND_I8), intent(in), optional, target :: seqIndexListI8(:)
integer, intent(out), optional :: rc

Calls

proc~~esmf_distgridsetplocalde~~CallsGraph proc~esmf_distgridsetplocalde ESMF_DistGridSetPLocalDe c_esmc_distgridsetarbseqindex c_esmc_distgridsetarbseqindex proc~esmf_distgridsetplocalde->c_esmc_distgridsetarbseqindex c_esmc_distgridsetarbseqindexi8 c_esmc_distgridsetarbseqindexi8 proc~esmf_distgridsetplocalde->c_esmc_distgridsetarbseqindexi8 interface~esmf_interarraycreate ESMF_InterArrayCreate proc~esmf_distgridsetplocalde->interface~esmf_interarraycreate proc~esmf_distgridgetinit ESMF_DistGridGetInit proc~esmf_distgridsetplocalde->proc~esmf_distgridgetinit proc~esmf_imerr ESMF_IMErr proc~esmf_distgridsetplocalde->proc~esmf_imerr proc~esmf_interarraydestroy ESMF_InterArrayDestroy proc~esmf_distgridsetplocalde->proc~esmf_interarraydestroy proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_distgridsetplocalde->proc~esmf_logfounderror proc~esmf_logseterror ESMF_LogSetError proc~esmf_distgridsetplocalde->proc~esmf_logseterror proc~esmf_interarraycreateptr ESMF_InterArrayCreatePtr interface~esmf_interarraycreate->proc~esmf_interarraycreateptr proc~esmf_interarraycreatetrg ESMF_InterArrayCreateTrg interface~esmf_interarraycreate->proc~esmf_interarraycreatetrg proc~esmf_imerr->proc~esmf_logfounderror proc~esmf_initcheckdeep ESMF_InitCheckDeep proc~esmf_imerr->proc~esmf_initcheckdeep proc~esmf_logfounddeallocerror ESMF_LogFoundDeallocError proc~esmf_interarraydestroy->proc~esmf_logfounddeallocerror 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 proc~esmf_logseterror->esmf_breakpoint proc~esmf_logseterror->proc~esmf_logrc2msg proc~esmf_logseterror->proc~esmf_logwrite

Called by

proc~~esmf_distgridsetplocalde~~CalledByGraph proc~esmf_distgridsetplocalde ESMF_DistGridSetPLocalDe interface~esmf_distgridset ESMF_DistGridSet interface~esmf_distgridset->proc~esmf_distgridsetplocalde proc~esmf_distgridcreatedbai ESMF_DistGridCreateDBAI proc~esmf_distgridcreatedbai->interface~esmf_distgridset proc~esmf_gridcreate1peridima ESMF_GridCreate1PeriDimA proc~esmf_gridcreate1peridima->interface~esmf_distgridset proc~esmf_gridcreate1peridimi ESMF_GridCreate1PeriDimI proc~esmf_gridcreate1peridimi->interface~esmf_distgridset proc~esmf_gridcreate1peridimr ESMF_GridCreate1PeriDimR proc~esmf_gridcreate1peridimr->interface~esmf_distgridset proc~esmf_gridcreate1peridimufrmb ESMF_GridCreate1PeriDimUfrmB proc~esmf_gridcreate1peridimufrmb->interface~esmf_distgridset proc~esmf_gridcreate2peridima ESMF_GridCreate2PeriDimA proc~esmf_gridcreate2peridima->interface~esmf_distgridset proc~esmf_gridcreate2peridimi ESMF_GridCreate2PeriDimI proc~esmf_gridcreate2peridimi->interface~esmf_distgridset proc~esmf_gridcreate2peridimr ESMF_GridCreate2PeriDimR proc~esmf_gridcreate2peridimr->interface~esmf_distgridset proc~esmf_gridcreatecopyfromreg ESMF_GridCreateCopyFromReg proc~esmf_gridcreatecopyfromreg->interface~esmf_distgridset proc~esmf_gridcreatecubedspherereg ESMF_GridCreateCubedSphereReg proc~esmf_gridcreatecubedspherereg->interface~esmf_distgridset proc~esmf_gridcreatefrmgrid ESMF_GridCreateFrmGrid proc~esmf_gridcreatefrmgrid->interface~esmf_distgridset proc~esmf_gridcreatenoperidima ESMF_GridCreateNoPeriDimA proc~esmf_gridcreatenoperidima->interface~esmf_distgridset proc~esmf_gridcreatenoperidimi ESMF_GridCreateNoPeriDimI proc~esmf_gridcreatenoperidimi->interface~esmf_distgridset proc~esmf_gridcreatenoperidimr ESMF_GridCreateNoPeriDimR proc~esmf_gridcreatenoperidimr->interface~esmf_distgridset proc~esmf_gridcreateshapetilearb ESMF_GridCreateShapeTileArb proc~esmf_gridcreateshapetilearb->interface~esmf_distgridset proc~esmf_gridcreateshapetileirreg ESMF_GridCreateShapeTileIrreg proc~esmf_gridcreateshapetileirreg->interface~esmf_distgridset proc~esmf_gridcreateshapetilereg ESMF_GridCreateShapeTileReg proc~esmf_gridcreateshapetilereg->interface~esmf_distgridset interface~esmf_distgridcreate ESMF_DistGridCreate interface~esmf_distgridcreate->proc~esmf_distgridcreatedbai interface~esmf_gridcreate ESMF_GridCreate interface~esmf_gridcreate->proc~esmf_gridcreatecopyfromreg interface~esmf_gridcreate1peridim ESMF_GridCreate1PeriDim interface~esmf_gridcreate1peridim->proc~esmf_gridcreate1peridima interface~esmf_gridcreate1peridim->proc~esmf_gridcreate1peridimi interface~esmf_gridcreate1peridim->proc~esmf_gridcreate1peridimr interface~esmf_gridcreate1peridimufrm ESMF_GridCreate1PeriDimUfrm interface~esmf_gridcreate1peridimufrm->proc~esmf_gridcreate1peridimufrmb interface~esmf_gridcreate2peridim ESMF_GridCreate2PeriDim interface~esmf_gridcreate2peridim->proc~esmf_gridcreate2peridima interface~esmf_gridcreate2peridim->proc~esmf_gridcreate2peridimi interface~esmf_gridcreate2peridim->proc~esmf_gridcreate2peridimr interface~esmf_gridcreatecubedsphere ESMF_GridCreateCubedSphere interface~esmf_gridcreatecubedsphere->proc~esmf_gridcreatecubedspherereg interface~esmf_gridcreatenoperidim ESMF_GridCreateNoPeriDim interface~esmf_gridcreatenoperidim->proc~esmf_gridcreatenoperidima interface~esmf_gridcreatenoperidim->proc~esmf_gridcreatenoperidimi interface~esmf_gridcreatenoperidim->proc~esmf_gridcreatenoperidimr interface~esmf_gridcreateshapetile ESMF_GridCreateShapeTile interface~esmf_gridcreateshapetile->proc~esmf_gridcreateshapetilearb interface~esmf_gridcreateshapetile->proc~esmf_gridcreateshapetileirreg interface~esmf_gridcreateshapetile->proc~esmf_gridcreateshapetilereg proc~esmf_gridcreatefrmgridcoord ESMF_GridCreateFrmGridCoord proc~esmf_gridcreatefrmgridcoord->proc~esmf_gridcreatefrmgrid

Source Code

  subroutine ESMF_DistGridSetPLocalDe(distgrid, localDe, collocation, &
    keywordEnforcer, seqIndexList, seqIndexListI8, rc)
!
! !ARGUMENTS:
    type(ESMF_DistGrid),      intent(inout)         :: distgrid
    integer,                  intent(in)            :: localDe
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
    integer,                  intent(in),  optional :: collocation
    integer,          target, intent(in),  optional :: seqIndexList(:)
integer(ESMF_KIND_I8),target, intent(in),  optional :: seqIndexListI8(:)
    integer,                  intent(out), optional :: rc
!         
! !DESCRIPTION:
!   Set DistGrid information for a specific local DE.
!
!   The arguments are:
!   \begin{description}
!   \item[distgrid]
!     Queried {\tt ESMF\_DistGrid} object.
!   \item[localDe]
!     Local DE for which information is set. {\tt [0,..,localDeCount-1]}
!   \item[{[collocation]}]
!     Collocation for which information is set. Default to first
!     collocation in {\tt collocation} list.
!   \item[{[seqIndexList]}]
!     Sequence indices for the elements on {\tt localDe}. The {\tt seqIndexList}
!     must provide exactly {\tt elementCountPDe(localDeToDeMap(localDe)} many
!     entries. When this argument is present, the {\tt indexTK} of
!     {\tt distgrid} will be set to {\tt ESMF\_TYPEKIND\_I4}.
!     This argument is mutually exclusive with {\tt seqIndexListI8}. Only one
!     or the other must be provided. An error will be returned otherwise.
!   \item[{[seqIndexListI8]}]
!     Same as {\tt seqIndexList}, but of 64-bit integer kind.
!     When this argument is present, the {\tt indexTK} of
!     {\tt distgrid} will be set to {\tt ESMF\_TYPEKIND\_I8}.
!     This argument is mutually exclusive with {\tt seqIndexList}. Only one
!     or the other must be provided. An error will be returned otherwise.
!   \item[{[rc]}]
!     Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!   \end{description}
!
!EOP
!------------------------------------------------------------------------------
    integer               :: localrc            ! local return code
    type(ESMF_InterArray) :: seqIndexListAux    ! helper variable
    integer               :: collocationAux     ! helper variable

    ! 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_DistGridGetInit, distgrid, rc)
    
    ! deal with optional arguments
    collocationAux = 1  ! default
    if (present(collocation)) collocationAux = collocation

    if (present(seqIndexList) .and. present(seqIndexListI8)) then
      call ESMF_LogSetError(rcToCheck=ESMF_RC_ARG_BAD, &
        msg="Only one of the 'seqIndexList' or 'seqIndexListI8' arguments" //&
          " must be specified at the same time", &
        ESMF_CONTEXT, rcToReturn=rc)
      return
    endif

    if (present(seqIndexList)) then
      ! prepare seqIndexList
      seqIndexListAux = ESMF_InterArrayCreate(seqIndexList, rc=localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, rcToReturn=rc)) return
      ! call into the C++ interface
      call c_ESMC_DistGridSetArbSeqIndex(distgrid, seqIndexListAux, localDe, &
        collocationAux, localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, rcToReturn=rc)) return
    endif
      
    if (present(seqIndexListI8)) then
      ! prepare seqIndexList
      seqIndexListAux = ESMF_InterArrayCreate(farray1DI8=seqIndexListI8, &
        rc=localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, rcToReturn=rc)) return
      ! call into the C++ interface
      call c_ESMC_DistGridSetArbSeqIndexI8(distgrid, seqIndexListAux, localDe, &
        collocationAux, localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, rcToReturn=rc)) return
    endif

    ! garbage collection
    call ESMF_InterArrayDestroy(seqIndexListAux, rc=localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return

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

  end subroutine ESMF_DistGridSetPLocalDe