program TEST_RNPSSN C Author: Glen Cowan C Date: 7-OCT-1997 C Test program for CERNLIB routine RNPSSN (V136) for generating C Poisson distributed numbers. C Must be linked with the CERN Program Library (including PACKLIB for C HBOOK histogram routines). 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 ierror integer istat integer lun integer n real nu c Initialize HBOOK, open histogram file, book histograms. call HLIMIT (hsize) lun = 20 outfile = 'test_rnpssn.his' call HROPEN (lun, 'histog', outfile, 'N', 1024, istat) if (istat .ne. 0) write (*, *) 'HROPEN error, istat = ', istat call HBOOK1 (1, 'Poisson n', 100, -0.5, 99.5, 0.) C Generate 10000 values and enter into histogram. write (*, *) 'enter Poisson mean nu' read (*, *) nu do i = 1, 10000 call RNPSSN (nu, n, ierror) call HF1 (1, FLOAT(n), 1.) end do c Store histogram and close. call HROUT (0, icycle, ' ') call HREND ('histog') stop END