    PROGRAM x04ccfe

!      X04CCF Example Program Text

!      Mark 23 Release. NAG Copyright 2011.

!      .. Use Statements ..
       USE nag_library, ONLY : nag_wp, x04ccf
!      .. Implicit None Statement ..
       IMPLICIT NONE
!      .. Parameters ..
       INTEGER, PARAMETER              :: nmax = 5, nout = 6
       INTEGER, PARAMETER              :: la = (nmax*(nmax+1))/2
!      .. Local Scalars ..
       INTEGER                         :: i, ifail
!      .. Local Arrays ..
       REAL (KIND=nag_wp)              :: a(la)
!      .. Intrinsic Functions ..
       INTRINSIC                          real
!      .. Executable Statements ..
       WRITE (nout,*) 'X04CCF Example Program Results'

       WRITE (nout,*)
       FLUSH (nout)

!      Generate an array of data

       DO i = 1, la
          a(i) = real(i,kind=nag_wp)
       END DO

!      Print order (nmax-1) lower triangular matrix

       ifail = 0
       CALL x04ccf('Lower','Unit',nmax-1,a,'Example 1:',ifail)

       WRITE (nout,*)
       FLUSH (nout)

!      Print order nmax upper triangular matrix

       ifail = 0
       CALL x04ccf('Upper','Non-unit',nmax,a,'Example 2:',ifail)

    END PROGRAM x04ccfe
