    PROGRAM nag_mat_norm_ex02

      ! Example Program Text for nag_mat_norm
      ! NAG fl90, Release 4. NAG Copyright 2000.

      ! .. Use Statements ..
      USE nag_examples_io, ONLY : nag_std_in, nag_std_out
      USE nag_mat_norm, ONLY : nag_gen_bnd_mat_norm
      ! .. Implicit None Statement ..
      IMPLICIT NONE
      ! .. Intrinsic Functions ..
      INTRINSIC KIND, MAX, MIN
      ! .. Parameters ..
      INTEGER, PARAMETER :: wp = KIND(1.0D0)
      ! .. Local Scalars ..
      INTEGER :: i, j, kl, ku, n
      ! .. Local Arrays ..
      REAL (wp), ALLOCATABLE :: a(:,:)
      ! .. Executable Statements ..
      WRITE (nag_std_out,*) 'Example Program Results for nag_mat_norm_ex02'

      READ (nag_std_in,*)          ! Skip heading in data file
      READ (nag_std_in,*) n, kl, ku

      ALLOCATE (a(kl+ku+1,n))      ! Allocate storage

      DO i = 1, n
        READ (nag_std_in,*) (a(ku+1+i-j,j),j=MAX(1,i-kl),MIN(i+ku,n))
      END DO

      WRITE (nag_std_out,*)
      WRITE (nag_std_out,'(1X,a23,2x,f7.3)') 'One-norm of (A) =', &
       nag_gen_bnd_mat_norm(a,ku)
      WRITE (nag_std_out,'(1X,a23,2x,f7.3)') 'Infinity Norm of (A) =', &
       nag_gen_bnd_mat_norm(a,ku,norm='i')
      WRITE (nag_std_out,'(1X,a23,2x,f7.3)') 'Frobenius Norm of (A) =', &
       nag_gen_bnd_mat_norm(a,ku,norm='f')
      WRITE (nag_std_out,'(1X,a23,2x,f7.3)') 'MAX(ABS(A(i,j))) =', &
       nag_gen_bnd_mat_norm(a,ku,norm='m')

      DEALLOCATE (a)               ! Deallocate storage

    END PROGRAM nag_mat_norm_ex02
