subroutine ESMF_HConfigFileLoad(hconfig, filename, keywordEnforcer, doc, rc)
!
! !ARGUMENTS:
type(ESMF_HConfig), intent(in) :: hconfig
character(len=*), intent(in) :: filename
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
integer, intent(in), optional :: doc
integer, intent(out), optional :: rc
!
! !DESCRIPTION:
! Load YAML file into {\tt hconfig}.
!
! The arguments are:
! \begin{description}
! \item[hconfig]
! {\tt ESMF\_HConfig} object.
! \item[filename]
! Name of the YAML file to be loaded.
! \item[{[doc]}]
! The doc index inside the file. If specified, only this single document
! is loaded from file, resulting in a single document {\tt hconfig} object.
! Defaults to {\em all} docs.
! \item[{[rc]}]
! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
! \end{description}
!
!EOP
!------------------------------------------------------------------------------
integer :: localrc ! local return code
! 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(ESMF_HConfigGetInit, hconfig, rc)
! Call into the C++ interface, which will sort out optional arguments.
call c_ESMC_HConfigFileLoad(hconfig, filename, doc, localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
! return successfully
if (present(rc)) rc = ESMF_SUCCESS
end subroutine ESMF_HConfigFileLoad