    PROGRAM nag_rand_contin_ex01

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

      ! .. Use Statements ..
      USE nag_examples_io, ONLY : nag_std_out
      USE nag_rand_contin, ONLY : nag_rand_uniform, nag_rand_seed_set, &
       nag_seed_wp => nag_seed_dp
      ! .. Implicit None Statement ..
      IMPLICIT NONE
      ! .. Intrinsic Functions ..
      INTRINSIC KIND
      ! .. Parameters ..
      INTEGER, PARAMETER :: r = 5
      INTEGER, PARAMETER :: wp = KIND(1.0D0)
      CHARACTER (*), PARAMETER :: fmt = '(1X,8F8.4)'
      ! .. Local Scalars ..
      INTEGER :: i, k
      TYPE (nag_seed_wp) :: seed
      ! .. Local Arrays ..
      REAL (wp) :: x(r), y(r), z(r)
      ! .. Executable Statements ..
      WRITE (nag_std_out,*) 'Example Program Results for nag_rand_contin_ex01'
      WRITE (nag_std_out,*)

      ! repeatable sequence of random numbers

      WRITE (nag_std_out,*) &
       'repeatable sequence of random numbers from a uniform distribution'
      WRITE (nag_std_out,*) 'using array-valued function'

      k = 0

      CALL nag_rand_seed_set(seed,k)

      x = nag_rand_uniform(seed,r)
      WRITE (nag_std_out,fmt) x
      WRITE (nag_std_out,*)

      WRITE (nag_std_out,*) 'the same sequence using scalar-valued function'

      k = 0

      CALL nag_rand_seed_set(seed,k)

      DO i = 1, r
        y(i) = nag_rand_uniform(seed)
      END DO
      WRITE (nag_std_out,fmt) y
      WRITE (nag_std_out,*)

      ! non-repeatable sequence of random numbers

      WRITE (nag_std_out,*) 'non-repeatable sequence of random &
       &numbers from a uniform distribution'

      CALL nag_rand_seed_set(seed)

      z = nag_rand_uniform(seed,r)
      WRITE (nag_std_out,fmt) z

    END PROGRAM nag_rand_contin_ex01
