    PROGRAM nag_rand_contin_ex03

      ! 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)
      REAL (wp), PARAMETER :: a = 1.0_wp
      REAL (wp), PARAMETER :: b = 1.5_wp
      CHARACTER (*), PARAMETER :: fmt = '(/1x,a/(1X, 8F8.4))'
      ! .. Local Scalars ..
      INTEGER :: k
      REAL (wp) :: x
      TYPE (nag_seed_wp) :: seed
      ! .. Local Arrays ..
      REAL (wp) :: v(r)
      ! .. Executable Statements ..
      WRITE (nag_std_out,*) 'Example Program Results for nag_rand_contin_ex03'

      ! Generating a scalar result from a uniform distribution (0,1)

      k = 0

      CALL nag_rand_seed_set(seed,k)

      x = nag_rand_uniform(seed)
      WRITE (nag_std_out,fmt) &
       'A scalar result from a uniform distribution (0,1)', x

      ! Generating  an array-valued result from a uniform
      ! distribution (0,1)

      k = 0

      CALL nag_rand_seed_set(seed,k)

      v = nag_rand_uniform(seed,r)

      WRITE (nag_std_out,fmt) &
       'An array-valued result from a uniform distribution (0,1)', v

      ! Generating  a scalar result from a uniform distribution (a,b)

      k = 0

      CALL nag_rand_seed_set(seed,k)

      x = nag_rand_uniform(seed,a,b)

      WRITE (nag_std_out,fmt) &
       'A scalar result from a uniform distribution (a,b)', x

      ! Generating an array-valued result from a uniform
      ! distribution (a,b)

      k = 0

      CALL nag_rand_seed_set(seed,k)

      v = nag_rand_uniform(seed,a,b,r)

      WRITE (nag_std_out,fmt) &
       'An array-valued result from a uniform distribution (a,b)', v

    END PROGRAM nag_rand_contin_ex03
