ESMF_ArrayBundleGetListAll Subroutine

private subroutine ESMF_ArrayBundleGetListAll(arraybundle, keywordEnforcer, itemorderflag, arrayCount, arrayList, arrayNameList, name, vm, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_ArrayBundle), intent(in) :: arraybundle
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
type(ESMF_ItemOrder_Flag), intent(in), optional :: itemorderflag
integer, intent(out), optional :: arrayCount
type(ESMF_Array), intent(out), optional :: arrayList(:)
character(len=*), intent(out), optional :: arrayNameList(:)
character(len=*), intent(out), optional :: name
type(ESMF_VM), intent(out), optional :: vm
integer, intent(out), optional :: rc

Calls

proc~~esmf_arraybundlegetlistall~~CallsGraph proc~esmf_arraybundlegetlistall ESMF_ArrayBundleGetListAll c_esmc_arraybundlegetlistall c_esmc_arraybundlegetlistall proc~esmf_arraybundlegetlistall->c_esmc_arraybundlegetlistall c_esmc_getvm c_esmc_getvm proc~esmf_arraybundlegetlistall->c_esmc_getvm esmf_arraysetinitcreated esmf_arraysetinitcreated proc~esmf_arraybundlegetlistall->esmf_arraysetinitcreated esmf_arraysetthis esmf_arraysetthis proc~esmf_arraybundlegetlistall->esmf_arraysetthis interface~c_esmc_getname c_ESMC_GetName proc~esmf_arraybundlegetlistall->interface~c_esmc_getname proc~esmf_arraybundlegetinit ESMF_ArrayBundleGetInit proc~esmf_arraybundlegetlistall->proc~esmf_arraybundlegetinit proc~esmf_imerr ESMF_IMErr proc~esmf_arraybundlegetlistall->proc~esmf_imerr proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_arraybundlegetlistall->proc~esmf_logfounderror proc~esmf_vmsetinitcreated ESMF_VMSetInitCreated proc~esmf_arraybundlegetlistall->proc~esmf_vmsetinitcreated 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_arraybundlegetlistall~~CalledByGraph proc~esmf_arraybundlegetlistall ESMF_ArrayBundleGetListAll interface~esmf_arraybundleget ESMF_ArrayBundleGet interface~esmf_arraybundleget->proc~esmf_arraybundlegetlistall proc~esmf_namedaliasarraybundle ESMF_NamedAliasArrayBundle proc~esmf_namedaliasarraybundle->interface~esmf_arraybundleget proc~esmf_stateitemget ESMF_StateItemGet proc~esmf_stateitemget->interface~esmf_arraybundleget proc~esmf_statereconcileisnoop ESMF_StateReconcileIsNoop proc~esmf_statereconcileisnoop->interface~esmf_arraybundleget proc~fillmembersarraybundle ESMF_InfoDescribe%fillMembersArrayBundle proc~fillmembersarraybundle->interface~esmf_arraybundleget proc~testarraybundlenamedalias TestArrayBundleNamedAlias proc~testarraybundlenamedalias->interface~esmf_arraybundleget proc~updatewitharraybundle ESMF_InfoDescribe%updateWithArrayBundle proc~updatewitharraybundle->interface~esmf_arraybundleget proc~user_final~47 user_final proc~user_final~47->interface~esmf_arraybundleget proc~user_final~92 user_final proc~user_final~92->interface~esmf_arraybundleget proc~user_run~47 user_run proc~user_run~47->interface~esmf_arraybundleget proc~user_run~92 user_run proc~user_run~92->interface~esmf_arraybundleget program~esmf_arraybundlecreateutest ESMF_ArrayBundleCreateUTest program~esmf_arraybundlecreateutest->interface~esmf_arraybundleget program~esmf_arraybundleex ESMF_ArrayBundleEx program~esmf_arraybundleex->interface~esmf_arraybundleget interface~esmf_namedalias ESMF_NamedAlias interface~esmf_namedalias->proc~esmf_namedaliasarraybundle none~fillmembers ESMF_InfoDescribe%FillMembers none~fillmembers->proc~fillmembersarraybundle none~update ESMF_InfoDescribe%Update none~update->proc~updatewitharraybundle proc~esmf_containeraddreplacesil ESMF_ContainerAddReplaceSIL proc~esmf_containeraddreplacesil->proc~esmf_stateitemget proc~esmf_containeraddsil ESMF_ContainerAddSIL proc~esmf_containeraddsil->proc~esmf_stateitemget proc~esmf_containerreplacesil ESMF_ContainerReplaceSIL proc~esmf_containerreplacesil->proc~esmf_stateitemget proc~esmf_reconcilezappedproxies ESMF_ReconcileZappedProxies proc~esmf_reconcilezappedproxies->proc~esmf_stateitemget proc~esmf_reconcilezapproxies ESMF_ReconcileZapProxies proc~esmf_reconcilezapproxies->proc~esmf_stateitemget proc~esmf_statereconcile ESMF_StateReconcile proc~esmf_statereconcile->proc~esmf_statereconcileisnoop program~esmf_namedaliasutest ESMF_NamedAliasUTest program~esmf_namedaliasutest->proc~testarraybundlenamedalias

Source Code

    subroutine ESMF_ArrayBundleGetListAll(arraybundle, keywordEnforcer, &
      itemorderflag, arrayCount, arrayList, arrayNameList, name, vm, rc)
!
! !ARGUMENTS:
    type(ESMF_ArrayBundle),    intent(in)            :: arraybundle
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
    type(ESMF_ItemOrder_Flag), intent(in),  optional :: itemorderflag
    integer,                   intent(out), optional :: arrayCount
    type(ESMF_Array),          intent(out), optional :: arrayList(:)
    character(len=*),          intent(out), optional :: arrayNameList(:)
    character(len=*),          intent(out), optional :: name
    type(ESMF_VM),             intent(out), optional :: vm
    integer,                   intent(out), optional :: rc
!
! !STATUS:
! \begin{itemize}
! \item\apiStatusCompatibleVersion{5.2.0r}
! \item\apiStatusModifiedSinceVersion{5.2.0r}
! \begin{description}
! \item[6.1.0] Added argument {\tt itemorderflag}.
!              The new argument gives the user control over the order in which
!              the items are returned.
! \item[8.8.0] Added argument {\tt vm} in order to offer information about the
!              VM on which the ArrayBundle was created.
! \end{description}
! \end{itemize}
!
! !DESCRIPTION:
!   Get general, i.e. not Array name specific information from the ArrayBundle.
!
!   \begin{description}
!   \item [arraybundle]
!     {\tt ESMF\_ArrayBundle} to be queried.
!   \item[{[itemorderflag]}]
!     Specifies the order of the returned items in the {\tt arrayList} and
!     {\tt arrayNameList}.
!     The default is {\tt ESMF\_ITEMORDER\_ABC}.
!     See \ref{const:itemorderflag} for a full list of options.
!   \item [{[arrayCount]}]
!     Upon return holds the number of Arrays bundled in the ArrayBundle.
!   \item [{[arrayList]}]
!     Upon return holds a list of Arrays bundled in {\tt arraybundle}. The
!     argument must be allocated to be at least of size {\tt arrayCount}.
!   \item [{[arrayNameList]}]
!     Upon return holds a list of the names of the Arrays bundled in 
!     {\tt arraybundle}. The argument must be allocated to be at least of
!     size {\tt arrayCount}.
!   \item [{[name]}]
!     Name of the ArrayBundle object.
!   \item [{[vm}]
!     The VM on which the ArrayBundle object was created.
!   \item [{[rc]}]
!     Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!   \end{description}
!
!EOP
!------------------------------------------------------------------------------
    integer                       :: localrc      ! local return code
    integer                       :: opt_arrayCount         ! helper variable
    type(ESMF_Pointer), pointer   :: opt_arrayPtrList(:)    ! helper variable
    integer                       :: len_arrayPtrList       ! helper variable
    integer                       :: i                      ! helper variable
    type(ESMF_ItemOrder_Flag)     :: itemorderflagArg

    ! 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_SHORT(ESMF_ArrayBundleGetInit, arraybundle, rc)
    
    ! Deal with optional itemorderflag argument
    itemorderflagArg = ESMF_ITEMORDER_ABC ! default
    if (present(itemorderflag)) &
      itemorderflagArg = itemorderflag
    
    ! Deal with (optional) array arguments
    len_arrayPtrList = 0
    if (present(arrayList)) then
      len_arrayPtrList = size(arrayList)
    endif
    if (present(arrayNameList)) then
      len_arrayPtrList = max(len_arrayPtrList, size(arrayNameList))
    endif
    if (present(arrayList).or.present(arrayNameList)) then
      allocate(opt_arrayPtrList(len_arrayPtrList))
    else
      allocate(opt_arrayPtrList(1))
    endif

    ! Call into the C++ interface layer
    call c_ESMC_ArrayBundleGetListAll(arraybundle, opt_arrayCount, &
      opt_arrayPtrList, len_arrayPtrList, itemorderflagArg, localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return

    ! fill in arrayCount output variable
    if (present(arrayCount)) then
      arrayCount = opt_arrayCount
    endif

    ! Set init code for deep C++ objects
    if (present(arrayList)) then
      do i=1, min(size(arrayList), opt_arrayCount)
        call ESMF_ArraySetThis(arrayList(i), opt_arrayPtrList(i), rc=localrc)
        if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return
        call ESMF_ArraySetInitCreated(arrayList(i), rc=localrc)
        if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return
      enddo
    endif

    ! Fill arrayNameList
    if (present(arrayNameList)) then
      do i=1, min(size(arrayNameList), opt_arrayCount)
        call c_ESMC_GetName(opt_arrayPtrList(i), arrayNameList(i), localrc)
        if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return
      enddo
    endif

    ! Garbage collection
    deallocate(opt_arrayPtrList)

    ! Special call to get name out of Base class
    if (present(name)) then
      if (arraybundle%isNamedAlias) then
        name = trim(arraybundle%name)
      else
        call c_ESMC_GetName(arraybundle, name, localrc)
        if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return
      endif
    endif

    ! Special call to get vm out of Base class
    if (present(vm)) then
      call c_ESMC_GetVM(arraybundle, vm, localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, rcToReturn=rc)) return
      ! Set init code on the VM object before returning
      call ESMF_VMSetInitCreated(vm, rc=localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, rcToReturn=rc)) return
    endif

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

  end subroutine ESMF_ArrayBundleGetListAll