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

NAG FL Interface Introduction
Example description
    Program x04ebfe

!     X04EBF Example Program Text

!     Mark 30.2 Release. NAG Copyright 2024.

!     .. Use Statements ..
      Use nag_library, Only: x04ebf
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter               :: nmax = 5, nout = 6
      Integer, Parameter               :: lda = nmax
      Character (7), Parameter         :: clabs(nmax) = (/'Un     ','Deux   ', &
                                          'Trois  ','Quatre ','Cinq   '/)
      Character (7), Parameter         :: rlabs(nmax) = (/'Uno    ','Due    ', &
                                          'Tre    ','Quattro','Cinque '/)
!     .. Local Scalars ..
      Integer                          :: i, ifail, indent, j, ncols
!     .. Local Arrays ..
      Integer                          :: a(lda,nmax)
!     .. Executable Statements ..
      Write (nout,*) 'X04EBF Example Program Results'

      Write (nout,*)
      Flush (nout)

!     Generate an array of data

      Do j = 1, nmax

        Do i = 1, lda
          a(i,j) = 10*i + j
        End Do

      End Do

      ncols = 80
      indent = 0

!     Print 3 by nmax rectangular matrix with default format and integer
!     row and column labels

      ifail = 0
      Call x04ebf('General',' ',3,nmax,a,lda,' ','Example 1:','Integer',rlabs, &
        'Integer',clabs,ncols,indent,ifail)

      Write (nout,*)
      Flush (nout)

!     Print nmax by nmax upper triangular matrix with user-supplied format
!     and row and column labels

      ifail = 0
      Call x04ebf('Upper','Non-unit',nmax,nmax,a,lda,'I8','Example 2:',        &
        'Character',rlabs,'Character',clabs,ncols,indent,ifail)

      Write (nout,*)
      Flush (nout)

!     Print 4 by nmax lower triangular matrix in MATLAB format
!     Row and column labelling is ignored

      ifail = 0
      Call x04ebf('Lower','Non-unit',4,nmax,a,lda,'MATLABI8','A',' ',rlabs,    &
        ' ',clabs,ncols,indent,ifail)

    End Program x04ebfe