ESMF_ConfigPrint Subroutine

public subroutine ESMF_ConfigPrint(config, keywordEnforcer, unit, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Config), intent(in) :: config
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
integer, intent(in), optional :: unit
integer, intent(out), optional :: rc

Source Code

    subroutine ESMF_ConfigPrint(config, keywordEnforcer, unit, rc)

! !ARGUMENTS:
      type(ESMF_Config), intent(in)  :: config
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
      integer, optional, intent(in)  :: unit
      integer, optional, intent(out) :: rc
!
!
! !DESCRIPTION:
!   Write content of input {\tt ESMF\_Config} object to unit {\tt unit}.
!   If {\tt unit} not provided, writes to standard output.
!
!   The arguments are:
!   \begin{description}
!     \item[config]
!       The input {\tt ESMF\_Config} object.
!     \item[{[unit]}]
!       Output unit. Defaults to {\tt stdout}.
!     \item [{[rc]}]
!       Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!   \end{description}
!
!EOP -------------------------------------------------------------------

      integer   :: iounit
      integer   :: lbeg, lend

      ! Standard output unit
      integer, parameter :: stdout = 6

      ! Initialize return code; assume routine not implemented
      if ( present (rc) ) then
        rc = ESMF_RC_NOT_IMPL
      endif

      iounit = stdout
      if (present(unit)) iounit = unit

      lbeg = 2
      lend = index_( config % cptr % buffer(lbeg:config % cptr % nbuf), EOL )
      do while (lend >= lbeg .and. lend < config % cptr % nbuf)
        write(iounit, "(a)") trim(config % cptr % buffer(lbeg:lend))
        lbeg = lend + 2
        lend = lend + &
          index_( config % cptr % buffer(lbeg:config % cptr % nbuf), EOL )
      end do

      if (present(rc)) rc = ESMF_SUCCESS

    end subroutine ESMF_ConfigPrint