NAG Library Manual, Mark 27.2
Interfaces:  FL   CL   CPP   AD 

NAG FL Interface Introduction
Example description
    Program f01gafe

!     F01GAF Example Program Text

!     Mark 27.2 Release. NAG Copyright 2021.

!     .. Use Statements ..
      Use nag_library, Only: f01gaf, nag_wp, x04caf
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter               :: nin = 5, nout = 6
!     .. Local Scalars ..
      Real (Kind=nag_wp)               :: t
      Integer                          :: i, ifail, lda, ldb, m, n
!     .. Local Arrays ..
      Real (Kind=nag_wp), Allocatable  :: a(:,:), b(:,:)
!     .. Executable Statements ..
      Write (nout,*) 'F01GAF Example Program Results'
      Write (nout,*)
      Flush (nout)

!     Skip heading in data file
      Read (nin,*)
      Read (nin,*) n, m, t

      lda = n
      ldb = n

      Allocate (a(lda,n))
      Allocate (b(ldb,m))

!     Read A from data file
      Read (nin,*)(a(i,1:n),i=1,n)

!     Read B from data file
      Read (nin,*)(b(i,1:m),i=1,n)

!     Find exp(tA)B
      ifail = 0
      Call f01gaf(n,m,a,lda,b,ldb,t,ifail)

      If (ifail==0) Then
!       Print solution
        ifail = 0
        Call x04caf('G','N',n,m,b,ldb,'exp(tA)B',ifail)
      End If

    End Program f01gafe