Program d05bwfe

!     D05BWF Example Program Text

!     Mark 26.1 Release. NAG Copyright 2017.

!     .. Use Statements ..
      Use nag_library, Only: d05bwf, nag_wp
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter               :: iorder = 4, nomg = 10, nout = 6
      Integer, Parameter               :: nwt = iorder
      Integer, Parameter               :: ldsw = nomg + iorder - 1
!     .. Local Scalars ..
      Integer                          :: ifail, lensw, n
!     .. Local Arrays ..
      Real (Kind=nag_wp)               :: omega(nomg), sw(ldsw,nwt)
!     .. Executable Statements ..
      Write (nout,*) 'D05BWF Example Program Results'

      ifail = 0
      Call d05bwf('BDF',iorder,omega,nomg,lensw,sw,ldsw,nwt,ifail)

      Write (nout,*)
      Write (nout,*) 'The convolution weights'
      Write (nout,*)

      Do n = 1, nomg
        Write (nout,99999) n - 1, omega(n)
      End Do

      Write (nout,*)
      Write (nout,*) 'The weights W'
      Write (nout,*)

      Do n = 1, lensw
        Write (nout,99999) n, sw(n,1:nwt)
      End Do

99999 Format (1X,I3,4X,6F10.4)
    End Program d05bwfe