ESMF_DistGridConnectionGet Subroutine

public subroutine ESMF_DistGridConnectionGet(connection, keywordEnforcer, tileIndexA, tileIndexB, dimCount, positionVector, orientationVector, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_DistGridConnection), intent(in) :: connection
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
integer, intent(out), optional :: tileIndexA
integer, intent(out), optional :: tileIndexB
integer, intent(out), optional :: dimCount
integer, intent(out), optional :: positionVector(:)
integer, intent(out), optional :: orientationVector(:)
integer, intent(out), optional :: rc

Calls

proc~~esmf_distgridconnectionget~~CallsGraph proc~esmf_distgridconnectionget ESMF_DistGridConnectionGet proc~esmf_distgridconnectiongetinit ESMF_DistGridConnectionGetInit proc~esmf_distgridconnectionget->proc~esmf_distgridconnectiongetinit proc~esmf_imerrs ESMF_IMErrS proc~esmf_distgridconnectionget->proc~esmf_imerrs proc~esmf_logseterror ESMF_LogSetError proc~esmf_distgridconnectionget->proc~esmf_logseterror proc~esmf_initcheckshallow ESMF_InitCheckShallow proc~esmf_imerrs->proc~esmf_initcheckshallow proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_imerrs->proc~esmf_logfounderror esmf_breakpoint esmf_breakpoint proc~esmf_logseterror->esmf_breakpoint proc~esmf_logrc2msg ESMF_LogRc2Msg proc~esmf_logseterror->proc~esmf_logrc2msg proc~esmf_logwrite ESMF_LogWrite proc~esmf_logseterror->proc~esmf_logwrite proc~esmf_logfounderror->esmf_breakpoint proc~esmf_logfounderror->proc~esmf_logrc2msg 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_distgridconnectionget~~CalledByGraph proc~esmf_distgridconnectionget ESMF_DistGridConnectionGet proc~esmf_gridcreatefrmgrid ESMF_GridCreateFrmGrid proc~esmf_gridcreatefrmgrid->proc~esmf_distgridconnectionget program~esmf_distgridcreategetutest ESMF_DistGridCreateGetUTest program~esmf_distgridcreategetutest->proc~esmf_distgridconnectionget proc~esmf_gridcreatefrmgridcoord ESMF_GridCreateFrmGridCoord proc~esmf_gridcreatefrmgridcoord->proc~esmf_gridcreatefrmgrid

Source Code

  subroutine ESMF_DistGridConnectionGet(connection, keywordEnforcer, &
    tileIndexA, tileIndexB, dimCount, positionVector, orientationVector, rc)
!
! !ARGUMENTS:
    type(ESMF_DistGridConnection), intent(in)            :: connection
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
    integer,                       intent(out), optional :: tileIndexA
    integer,                       intent(out), optional :: tileIndexB
    integer,                       intent(out), optional :: dimCount
    integer,                       intent(out), optional :: positionVector(:)
    integer,                       intent(out), optional :: orientationVector(:)
    integer,                       intent(out), optional :: rc
!
! !DESCRIPTION:
!   \label{api:DistGridConnectionGet}
!   Get connection parameters from an {\tt ESMF\_DistGridConnection} object.
!   This interface provides access to all variables required to create a new
!   connection using the {\tt ESMF\_DistGridConnectionSet()} method.
!
!   The arguments are:
!   \begin{description}
!   \item[connection]
!     DistGridConnection object.
!   \item[{[tileIndexA]}]
!     Index of one of the two connected tiles.
!   \item[{[tileIndexB]}]
!     Index of the other connected tile.
!   \item[{[dimCount]}]
!     Number of dimensions of {\tt positionVector}.
!   \item[{[positionVector]}]
!     Position of tile B's minIndex with respect to tile A's minIndex.
!     This array's size should be at least equal to {\tt dimCount}.
!   \item[{[orientationVector]}]
!     Lists which dimension of tile A is associated to which dimension of
!     tile B. Negative index values may be used to indicate a reversal
!     in index orientation. Should be at least of size {\tt dimCount}.
!   \item[{[rc]}]
!     Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!   \end{description}
!
!EOP
!------------------------------------------------------------------------------
    integer :: localrc      ! local return code
    integer :: localdimCount

    ! initialize return code; assume routine not implemented
    localrc = ESMF_RC_NOT_IMPL
    if (present(rc)) rc = ESMF_RC_NOT_IMPL

    ! ensure connection is valid
ESMF_INIT_CHECK_SHALLOW_SHORT(ESMF_DistGridConnectionGetInit, connection, rc)

    ! check if connection contains any elements
    localdimCount = (connection % elementCount - 2)/2

    if (localdimCount <= 0) then
      call ESMF_LogSetError(rcToCheck=ESMF_RC_OBJ_BAD, &
        msg="Insufficient number of elements found.", &
        ESMF_CONTEXT, rcToReturn=rc)
      return
    end if

    ! get conected tiles
    if (present(tileIndexA)) tileIndexA = connection % connection(1)
    if (present(tileIndexB)) tileIndexB = connection % connection(2)

    if (present(dimCount)) dimCount = localdimCount

    if (present(positionVector)) then
      if (size(positionVector) < localdimCount) then
        call ESMF_LogSetError(rcToCheck=ESMC_RC_ARG_SIZE, &
          msg="Size of positionVector array smaller than number of dimensions.", &
          ESMF_CONTEXT, rcToReturn=rc)
        return
      end if
      positionVector = 0
      positionVector(1:localdimCount) = &
        connection % connection(3:2+localdimCount)
    end if

    if (present(orientationVector)) then
      if (size(orientationVector) < localdimCount) then
        call ESMF_LogSetError(rcToCheck=ESMC_RC_ARG_SIZE, &
          msg="Size of orientationVector array smaller than number of dimensions.", &
          ESMF_CONTEXT, rcToReturn=rc)
        return
      end if
      orientationVector = 0
      orientationVector(1:localdimCount) = &
        connection % connection(3+localdimCount:2+2*localdimCount)
    end if

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

  end subroutine ESMF_DistGridConnectionGet