2 C.----------------------------------------------------------------------
4 C. PHOTOS: PHOton radiation in decays RANdom number generator init
6 C. Purpose: Initialse PHORAN with the user specified seeds in the
7 C. array ISEED. For details see also: F. James CERN DD-
8 C. Report November 1988.
12 C. Output
Parameters: URAN, CRAN, CDRAN, CMRAN, I97, J97
14 C. Author(s): B. van Eijk and F. James Created at: 27/09/89
15 C. Last Update: 22/02/90
17 C.----------------------------------------------------------------------
21 INTEGER I,IS1,IS2,IS3,IS4,IS5,J
23 REAL*8 URAN,CRAN,CDRAN,CMRAN
24 COMMON/PHSEED/ISEED(2),I97,J97,URAN(97),CRAN,CDRAN,CMRAN
26 C-- Check value range of seeds
27 IF ((ISEED(1).LT.0).OR.(ISEED(1).GE.31328)) THEN
29 CALL PHOERR(8,'PHORIN',DATA)
31 IF ((ISEED(2).LT.0).OR.(ISEED(2).GE.30081)) THEN
33 CALL PHOERR(9,'PHORIN',DATA)
36 C-- Calculate Marsaglia and Zaman seeds (by F. James)
37 IS1=MOD(ISEED(1)/177,177)+2
38 IS2=MOD(ISEED(1),177)+2
39 IS3=MOD(ISEED(2)/169,178)+1
45 IS5=MOD (MOD(IS1*IS2,179)*IS3,179)
50 IF (MOD(IS4*IS5,64).GE.32) S=S+T
53 CRAN=362436.D0/16777216.D0
54 CDRAN=7654321.D0/16777216.D0
55 CMRAN=16777213.D0/16777216.D0
61 C.----------------------------------------------------------------------
63 C. PHOTOS: PHOton radiation in decays RANdom number generator based
64 C. on Marsaglia Algorithm
66 C. Purpose: Generate uniformly distributed random numbers between
67 C. 0 and 1. Super
long period: 2**144. See also:
68 C. G. Marsaglia and A. Zaman, FSU-SCR-87-50, for seed mo-
69 C. difications to this version see: F. James DD-Report,
70 C. November 1988. The generator has to be initialized by
77 C. Author(s): B. van Eijk, G. Marsaglia and Created at: 27/09/89
78 C. A. Zaman Last Update: 27/09/89
80 C.----------------------------------------------------------------------
85 REAL*8 URAN,CRAN,CDRAN,CMRAN
86 COMMON/PHSEED/ISEED(2),I97,J97,URAN(97),CRAN,CDRAN,CMRAN
87 10 PHORAN=URAN(I97)-URAN(J97)
88 IF (PHORAN.LT.0.D0) PHORAN=PHORAN+1.D0
95 IF (CRAN.LT.0.D0) CRAN=CRAN+CMRAN
97 IF (PHORAN.LT.0.D0) PHORAN=PHORAN+1.D0
98 IF (PHORAN.LE.0.D0) GOTO 10