IF (NMl) 4,4,5 

 4 VE:C( 2 ) = CHAR(l) 

 I MAX ■= 1 

 GO TU 2 5 

 5 M - 1 



12 M = M + M 



IF ( M .LT. M ) G'J TO 12 

 ,M = MAXOI I ,M/2 - 1 ) 



13 I = 1 



IM = I + M 



14 J = I 

 JM = IM 



IHCLD = IND(IM) 



15 JR = I NO! J) 



IF( CHAR(JR) .LT.CHARI IHGLD) ) GO TC 16 



IND(JM) = IND(J) 



JM = J 



J = J - M 



IF ( J .GT. ) GO ro 15 



16 IND(JM) = IHJLI) 

 1=1+1 



IM = I + M 



IF ( IM .LE. N ) GO rn 14 



M = M/2 



IF ( M .GT. ) GO TO 13 



DO 20 J = 1 ,N 

 2C VEC(J-H) = VEC(J) + AaS(CHAR( I N0( J ) ) ) 

 C NOTE 'VEC IS INUFXED PLUS ONE) 



C NOW COMPUTE TRIAL STEP. 



I = 1 

 23 IMAX = INO( N) 

 25 D = VEC(N-H)/ FLOAT (NSAM) 



IF ( D.GT.CHARI I MAX) ) GC TO 30 



IDSAMI I ) = ID(IMAX) 



PP( I ) = 1.0 



1 = 1 + 1 



NSAM = NSAM-1 



N=N-1 



IF ( NSAM .GT. ) GO TO 23 

 D = VEC ( 1 ) 

 TS = 0. 

 TP = 1.0 



RE TURN 

 30 CONTINUE 



C UNIFORM RANDOM NUMBER GENERATOR FOR IBM 36C 



C FOR OTHER CCMPUT ERS , SEE THE FOLLOWING 



C REF: MARSAGLIA AND 3R AY , COMM. ACM U ( 1 1 ) , 75 7- 759 



C GROSENBAUGH, L. R.,COMM. ACM 12(11), 639 



C 



LR = LR«MLR 

 MR = MR*MMR 



JR = 1 + lABSILR) /1677 7216 



SEL = (0.5 + FLOAT(NR(JR) + LR + VR ) *0 . 23 28 30 64 E- 9 ) * D 

 KR = KR*MKR 

 NR(JR) = KR 



C 



C FIND SAMPLE UNITS. 



FNS = FLOAT (NSAM) 



14 



