subroutine ESMF_InfoGetArrayMeta(info, key, isArray, size, keywordEnforcer, attnestflag, rc)
! !ARGUMENTS:
type(ESMF_Info), intent(in) :: info
character(len=*), intent(in) :: key
logical, intent(out) :: isArray
integer(C_INT), intent(out) :: size
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
type(ESMF_AttNest_Flag), intent(in), optional :: attnestflag
integer, intent(out), optional :: rc
!
! !DESCRIPTION:
! Return a value's array status and size using a \textit{key}.
!
! The arguments are:
! \begin{description}
! \item [info]
! Target \texttt{ESMF\_Info} object.
! \item [key]
! String key to access in \texttt{ESMF\_Info} storage. See section \ref{info_key_format}
! for an overview of the key format.
! \item [isArray]
! Set to \texttt{true} if the target is an array in storage.
! \item [size]
! Set to the size of the target object in storage (i.e. length of the array).
! \item [{[attnestflag]}]
! Setting to \texttt{ESMF\_ATTNEST\_ON} triggers a recursive search for
! \textit{keyParent}. The first instance of the key will be found in the
! hierarchy. Default is \texttt{ESMF\_ATTNEST\_OFF}.
! \item [{[rc]}]
! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
! \end{description}
!EOP
integer :: localrc
integer(C_INT) :: local_is_array
integer(C_INT) :: recursive
localrc = ESMF_FAILURE
if (present(rc)) rc = ESMF_FAILURE
recursive = 0 !false
if (present(attnestflag)) then
if (attnestflag%value==ESMF_ATTNEST_ON%value) recursive = 1 !true
end if
call c_info_get_array_meta(info%ptr, trim(key)//C_NULL_CHAR, local_is_array, size, recursive, &
localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
if (local_is_array == 1) then
isArray = .true.
else
isArray = .false.
end if
if (present(rc)) rc = ESMF_SUCCESS
end subroutine ESMF_InfoGetArrayMeta