62 IF (n.LT.0)
CALL xstopx (
'N < 0 in GENMUL')
63 IF (ncat.LE.1)
CALL xstopx (
'NCAT <= 1 in GENMUL')
66 IF (p(i).LT.0.0)
CALL xstopx (
'Some P(i) < 0 in GENMUL')
67 IF (p(i).GT.1.0)
CALL xstopx (
'Some P(i) > 1 in GENMUL')
70 IF (ptot.GT.0.99999)
CALL xstopx (
'Sum of P(i) > 1 in GENMUL')
80 DO 30,icat = 1,ncat - 1
82 ix(icat) = ignbin(ntot,prob)
83 ntot = ntot - ix(icat)
subroutine genmul(n, p, ncat, ix)