ESMF_IORead Subroutine

public subroutine ESMF_IORead(io, fileName, schemaFileName, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_IO), intent(in) :: io
character(len=*), intent(in), optional :: fileName
character(len=*), intent(in), optional :: schemaFileName
integer, intent(out), optional :: rc

Calls

proc~~esmf_ioread~~CallsGraph proc~esmf_ioread ESMF_IORead c_esmc_io_xmlread c_esmc_io_xmlread proc~esmf_ioread->c_esmc_io_xmlread proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_ioread->proc~esmf_logfounderror 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

Source Code

      subroutine ESMF_IORead(io, fileName, schemaFileName, rc)
!
! TODO derived types, other than <object>, need to be inout?
! !ARGUMENTS:
      type(ESMF_IO),           intent(in)            :: io
      character (len=*),       intent(in),  optional :: fileName
      character (len=*),       intent(in),  optional :: schemaFileName
      integer,                 intent(out), optional :: rc
!   
! !DESCRIPTION:
!     Perform a read on an {\tt ESMF\_IO} object.  Any properties specified
!     will override, but not reset, those previously set on the io object.
!
!     The arguments are:
!     \begin{description}
!     \item[io]
!          The object instance to read.
!     \item[{[fileName]}]
!          The file name to be read from.
!     \item[{[schemaFileName]}]
!          The file name of the schema used to validate fileName.
!     \item[{[rc]}]
!          Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!     \end{description}
!EOPI
! !REQUIREMENTS:
!     IOx.y, IOx.y.z  TODO
!
!     ! initialize fileName length to zero for non-existent name
      integer :: fileNameLen, schemaFileNameLen, localrc
!
!     ! Assume failure until success
      if (present(rc)) rc = ESMF_RC_NOT_IMPL
      localrc = ESMF_RC_NOT_IMPL
!
!     ! check variables  TODO
!     ESMF_INIT_CHECK_DEEP(ESMF_IOGetInit,io,rc)

      fileNameLen = 0
      schemaFileNameLen = 0
!
!     ! get length of given fileName for C++ validation
      if (present(fileName)) then
        fileNameLen = len_trim(fileName)
      end if
      if (present(schemaFileName)) then
        schemaFileNameLen = len_trim(schemaFileName)
      end if

!     invoke C to C++ entry point  TODO
      call c_ESMC_IO_XMLRead(io, fileNameLen, fileName, &
                             schemaFileNameLen, schemaFileName, localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, rcToReturn=rc)) return
!
!     ! Return success
      if (present(rc)) rc = ESMF_SUCCESS
      end subroutine ESMF_IORead