subroutine ESMF_IOAddArray(io, array, keywordEnforcer, &
variableName, convention, purpose, rc)
! !ARGUMENTS:
type(ESMF_IO), intent(in) :: io
type(ESMF_Array), intent(in) :: array
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
character(*), intent(in), optional :: variableName
character(*), intent(in), optional :: convention
character(*), intent(in), optional :: purpose
integer, intent(out), optional :: rc
! !DESCRIPTION:
! Gets one or more of the properties of an {\tt ESMF\_IO} object.
!
! The arguments are:
! \begin{description}
! \item[io]
! The {\tt ESMF\_IO} object instance to modify
! \item[array]
! The {\tt ESMF\_Array} object to add to io's element list
! \item[{[variableName]}]
! Optional variableName to attach to this array for I/O purposes
! \item[{[convention]}]
! Optional convention - AttPack for attribute and dimension names and values
! \item[{[purpose]}]
! Optional purpose - AttPack for attribute and dimension names and values
! \item[{[rc]}]
! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
! \end{description}
!
!EOPI
integer :: localrc ! local return code
integer :: len_varName ! name length or 0
! Assume failure until success
if (present(rc)) rc = ESMF_RC_NOT_IMPL
localrc = ESMF_RC_NOT_IMPL
! invoke C to C++ entry point
if (present(variableName)) then
len_varName = len_trim(variableName)
else
len_varName = 0
endif
call c_ESMC_IOAddArray(io, array, &
variableName, len_varName, &
convention, purpose, &
localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
! Return success
if (present(rc)) rc = ESMF_SUCCESS
end subroutine ESMF_IOAddArray