    PROGRAM nag_quad_util_ex02
      ! Example Program Text for nag_quad_util
      ! NAG fl90, Release 4. NAG Copyright 2000.
      ! .. Use Statements ..
      USE nag_examples_io, ONLY : nag_std_out
      USE nag_quad_util, ONLY : nag_quad_gs_wt_absc
      ! .. Implicit None Statement ..
      IMPLICIT NONE
      ! .. Intrinsic Functions ..
      INTRINSIC KIND
      ! .. Parameters ..
      INTEGER, PARAMETER :: n = 7
      INTEGER, PARAMETER :: wp = KIND(1.0D0)
      ! .. Local Scalars ..
      INTEGER :: j, rule
      REAL (wp) :: a, b, c, d
      ! .. Local Arrays ..
      REAL (wp) :: wt(n), x(n)
      ! .. Executable Statements ..

      WRITE (nag_std_out,*) 'Example Program Results for nag_quad_util_ex02'
      a = -1.0_wp
      b = 1.0_wp
      c = 1.0_wp
      d = 1.0_wp
      rule = 1

      CALL nag_quad_gs_wt_absc(rule,a,b,wt,x,c=c,d=d)

      WRITE (nag_std_out,*)
      WRITE (nag_std_out,'(1X,A,I3,A)') 'Jacobi formula,', n, &
       ' points - normal weights'
      WRITE (nag_std_out,*)
      WRITE (nag_std_out,'(6X,A,8X,A)') 'Abscissae', 'Weights'
      WRITE (nag_std_out,*)
      WRITE (nag_std_out,'(2F15.5)') (x(j),wt(j),j=1,n)
      WRITE (nag_std_out,*)
      rule = -1

      CALL nag_quad_gs_wt_absc(rule,a,b,wt,x,c=c,d=d)

      WRITE (nag_std_out,*)
      WRITE (nag_std_out,'(1X,A,I3,A)') 'Jacobi formula,', n, &
       ' points - adjusted weights'
      WRITE (nag_std_out,*)
      WRITE (nag_std_out,'(6X,A,4X,A)') 'Abscissae', 'Adjusted Weights'
      WRITE (nag_std_out,*)
      WRITE (nag_std_out,'(2F15.5)') (x(j),wt(j),j=1,n)
    END PROGRAM nag_quad_util_ex02
