program TEST_RANDOM c Author: Glen Cowan c Date: 4-OCT-1997 c Test program for random number generator and histogram software. c Must be linked with RANDOM and with the HBOOK routines (part of c PACKLIB in the CERN program library). implicit NONE c Needed for HBOOK routines integer hsize parameter (hsize = 100000) integer hmemor (hsize) common /pawc/ hmemor c Local variables character*80 outfile integer i integer icycle integer istat integer lun integer seed real RANDOM real x c Initialize HBOOK, open histogram file, book histograms call HLIMIT (hsize) lun = 20 outfile = 'test_random.his' call HROPEN (lun, 'histog', outfile, 'N', 1024, istat) if (istat .ne. 0) write (*, *) 'HROPEN error, istat = ', istat call HBOOK1 (1, 'uniform', 100, 0., 1., 0.) C Generate 10000 random values and enter into histogram seed = 12345 do i = 1, 1000000 x = RANDOM (seed) call HF1 (1, x, 1.) end do c Store histogram and close call HROUT (0, icycle, ' ') call HREND ('histog') stop END