PROGRAM nag_rand_contin_ex08 ! 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_normal, 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 TYPE (nag_seed_wp) :: seed ! .. Local Arrays .. REAL (wp) :: x(r) ! .. Executable Statements .. WRITE (nag_std_out,*) 'Example Program Results for nag_rand_contin_ex08' ! Generating a vector of N(a,b) variates using Brent's method k = 0 CALL nag_rand_seed_set(seed,k) x = nag_rand_normal(seed,r,a=a,b=b) WRITE (nag_std_out,fmt) 'An array-valued result from Brent''s method', x ! Generating a vector of N(a,b) variates using Box-Muller's ! method k = 0 CALL nag_rand_seed_set(seed,k) x = nag_rand_normal(seed,r,a=a,b=b,brent=.FALSE.) WRITE (nag_std_out,fmt) & 'An array-valued result from Box-Muller''s method', x END PROGRAM nag_rand_contin_ex08