ESMF_ArrayBundleCreate Function

public function ESMF_ArrayBundleCreate(keywordEnforcer, arrayList, multiflag, relaxedflag, name, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
type(ESMF_Array), intent(in), optional :: arrayList(:)
logical, intent(in), optional :: multiflag
logical, intent(in), optional :: relaxedflag
character(len=*), intent(in), optional :: name
integer, intent(out), optional :: rc

Return Value type(ESMF_ArrayBundle)


Calls

proc~~esmf_arraybundlecreate~~CallsGraph proc~esmf_arraybundlecreate ESMF_ArrayBundleCreate c_esmc_arraybundlecreate c_esmc_arraybundlecreate proc~esmf_arraybundlecreate->c_esmc_arraybundlecreate esmf_arraygetinit esmf_arraygetinit proc~esmf_arraybundlecreate->esmf_arraygetinit esmf_arraygetthis esmf_arraygetthis proc~esmf_arraybundlecreate->esmf_arraygetthis proc~esmf_imerr ESMF_IMErr proc~esmf_arraybundlecreate->proc~esmf_imerr proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_arraybundlecreate->proc~esmf_logfounderror 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_arraybundlecreate~~CalledByGraph proc~esmf_arraybundlecreate ESMF_ArrayBundleCreate proc~createarrays createArrays proc~createarrays->proc~esmf_arraybundlecreate proc~esmf_gridcreatecopyfromnewdg ESMF_GridCreateCopyFromNewDG proc~esmf_gridcreatecopyfromnewdg->proc~esmf_arraybundlecreate proc~esmf_gridredist ESMF_GridRedist proc~esmf_gridredist->proc~esmf_arraybundlecreate proc~esmf_locstreamcreatefromnewdg ESMF_LocStreamCreateFromNewDG proc~esmf_locstreamcreatefromnewdg->proc~esmf_arraybundlecreate proc~testarraybundlenamedalias TestArrayBundleNamedAlias proc~testarraybundlenamedalias->proc~esmf_arraybundlecreate proc~user_init~45 user_init proc~user_init~45->proc~esmf_arraybundlecreate proc~user_init~88 user_init proc~user_init~88->proc~esmf_arraybundlecreate proc~x_comp_grid_diag x_comp_grid_diag proc~x_comp_grid_diag->proc~esmf_arraybundlecreate program~esmf_arraybundlecreateutest ESMF_ArrayBundleCreateUTest program~esmf_arraybundlecreateutest->proc~esmf_arraybundlecreate program~esmf_arraybundleex ESMF_ArrayBundleEx program~esmf_arraybundleex->proc~esmf_arraybundlecreate program~esmf_arraybundlehaloex ESMF_ArrayBundleHaloEx program~esmf_arraybundlehaloex->proc~esmf_arraybundlecreate program~esmf_arraybundleioutest ESMF_ArrayBundleIOUTest program~esmf_arraybundleioutest->proc~esmf_arraybundlecreate program~esmf_arraybundleredistutest ESMF_ArrayBundleRedistUTest program~esmf_arraybundleredistutest->proc~esmf_arraybundlecreate program~esmf_infosyncutest ESMF_InfoSyncUTest program~esmf_infosyncutest->proc~esmf_arraybundlecreate interface~esmf_gridcreate ESMF_GridCreate interface~esmf_gridcreate->proc~esmf_gridcreatecopyfromnewdg interface~esmf_locstreamcreate ESMF_LocStreamCreate interface~esmf_locstreamcreate->proc~esmf_locstreamcreatefromnewdg proc~esmf_gridcreatefrmncfile ESMF_GridCreateFrmNCFile proc~esmf_gridcreatefrmncfile->proc~esmf_gridcreatecopyfromnewdg proc~esmf_gridcreatefrmncfiledg ESMF_GridCreateFrmNCFileDG proc~esmf_gridcreatefrmncfiledg->proc~esmf_gridcreatecopyfromnewdg proc~esmf_locstreamcreatepetlist ESMF_LocStreamCreatePetList proc~esmf_locstreamcreatepetlist->proc~esmf_locstreamcreatefromnewdg proc~realize Realize proc~realize->proc~x_comp_grid_diag program~esmf_gridcreateutest ESMF_GridCreateUTest program~esmf_gridcreateutest->proc~esmf_gridredist program~esmf_namedaliasutest ESMF_NamedAliasUTest program~esmf_namedaliasutest->proc~testarraybundlenamedalias

Source Code

  function ESMF_ArrayBundleCreate(keywordEnforcer, arrayList, multiflag, &
    relaxedflag, name, rc)
!         
! !RETURN VALUE:
    type(ESMF_ArrayBundle) :: ESMF_ArrayBundleCreate
!
! !ARGUMENTS:
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
    type(ESMF_Array), intent(in),  optional :: arrayList(:)
    logical,          intent(in),  optional :: multiflag
    logical,          intent(in),  optional :: relaxedflag
    character(len=*), intent(in),  optional :: name
    integer,          intent(out), optional :: rc
!
! !STATUS:
! \begin{itemize}
! \item\apiStatusCompatibleVersion{5.2.0r}
! \end{itemize}
!
! !DESCRIPTION:
!   Create an {\tt ESMF\_ArrayBundle} object from a list of existing Arrays.
!
!   The creation of an ArrayBundle leaves the bundled Arrays unchanged, they
!   remain valid individual objects. An ArrayBundle is a light weight container
!   of Array references. The actual data remains in place, there are no
!   data movements or duplications associated with the creation of an 
!   ArrayBundle.
!
!   \begin{description}
!   \item [{[arrayList]}]
!     List of {\tt ESMF\_Array} objects to be bundled.
!   \item [{[multiflag]}]
!     A setting of {\tt .true.} allows multiple items with the same name
!     to be added to {\tt arraybundle}. For {\tt .false.} added items must
!     have unique names. The default setting is {\tt .false.}.
!   \item [{[relaxedflag]}]
!     A setting of {\tt .true.} indicates a relaxed definition of "add"
!     under {\tt multiflag=.false.} mode, where it is {\em not} an error if 
!     {\tt arrayList} contains items with names that are also found in 
!     {\tt arraybundle}. The {\tt arraybundle} is left unchanged for these items.
!     For {\tt .false.} this is treated as an error condition. 
!     The default setting is {\tt .false.}.
!   \item [{[name]}]
!     Name of the created {\tt ESMF\_ArrayBundle}. A default name is generated
!     if not specified.
!   \item [{[rc]}]
!     Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!   \end{description}
!
!EOP
!------------------------------------------------------------------------------
    integer                 :: localrc    ! local return code
    type(ESMF_ArrayBundle)  :: arraybundle! opaque pointer to ESMCI class
    integer                 :: arrayCount, i
    type(ESMF_Pointer), allocatable :: arrayPointerList(:)
    integer                       :: len_name
    type(ESMF_Logical)            :: multiflagArg
    type(ESMF_Logical)            :: relaxedflagArg

    ! Initialize return code
    if (present(rc)) rc = ESMF_RC_NOT_IMPL
    localrc = ESMF_RC_NOT_IMPL
    
    ! invalidate return value
    arraybundle%this = ESMF_NULL_POINTER
    ESMF_ArrayBundleCreate = arraybundle

    ! Determine the number of ArrayList elements
    if (present(arrayList)) then
      arrayCount = size(arrayList)
    else
      arrayCount = 0
    endif

    ! Check init status of arguments
    do i=1, arrayCount
      ESMF_INIT_CHECK_DEEP(ESMF_ArrayGetInit, arrayList(i), rc)
    enddo
    
    if (present(multiflag)) then
      multiflagArg = multiflag
    else
      multiflagArg = ESMF_FALSE
    endif
    
    if (present(relaxedflag)) then
      relaxedflagArg = relaxedflag
    else
      relaxedflagArg = ESMF_FALSE
    endif

    ! Copy C++ pointers of deep objects into a simple ESMF_Pointer array
    ! This is necessary in order to strip off the F90 init check members
    ! when passing into C++
    allocate(arrayPointerList(arrayCount))
    do i=1, arrayCount
      call ESMF_ArrayGetThis(arrayList(i), arrayPointerList(i), localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, rcToReturn=rc)) return
    enddo
    
    ! Call into the C++ interface, which will sort out optional arguments
    ! Optional name argument requires separate calls into C++
    if (present(name)) then
      len_name = len(name)
      call c_ESMC_ArrayBundleCreate(arraybundle, arrayPointerList, &
        arrayCount, multiflagArg, relaxedflagArg, name, len_name, localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, rcToReturn=rc)) return
    else
      len_name = 0
      call c_ESMC_ArrayBundleCreate(arraybundle, arrayPointerList, &
        arrayCount, multiflagArg, relaxedflagArg, "", len_name, localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, rcToReturn=rc)) return
    endif    

    ! Garbage collection
    deallocate(arrayPointerList)

    ! Set return value
    ESMF_ArrayBundleCreate = arraybundle

    ! Set init code
    ESMF_INIT_SET_CREATED(ESMF_ArrayBundleCreate)
 
    ! Return successfully
    if (present(rc)) rc = ESMF_SUCCESS
    
  end function ESMF_ArrayBundleCreate