* G05TFF Example Program Text * Mark 22 Release. NAG Copyright 2006. * .. Parameters .. INTEGER NOUT PARAMETER (NOUT=6) INTEGER MSEED, MSTATE, N, LR PARAMETER (MSEED=1,MSTATE=633,N=10,LR=1) * .. Local Scalars .. DOUBLE PRECISION A INTEGER GENID, I, IFAIL, LSEED, LSTATE, SUBID * .. Local Arrays .. DOUBLE PRECISION R(LR) INTEGER SEED(MSEED), STATE(MSTATE), X(N) * .. External Subroutines .. EXTERNAL G05KFF, G05TFF * .. Executable Statements .. WRITE (NOUT,*) 'G05TFF Example Program Results' WRITE (NOUT,*) * Set the distribution parameter A A = 0.9999D0 * Initialize the seed SEED(1) = 1762543 * GENID and SUBID identify the base generator GENID = 1 SUBID = 1 * Initialize the generator to a repeatable sequence LSTATE = MSTATE LSEED = MSEED IFAIL = 1 CALL G05KFF(GENID,SUBID,SEED,LSEED,STATE,LSTATE,IFAIL) IF (IFAIL.NE.0) THEN WRITE (NOUT,99998) IFAIL GO TO 20 END IF * Generate the variates * Use MODE=3 because A > 0.95 IFAIL = 1 CALL G05TFF(3,N,A,R,LR,STATE,X,IFAIL) IF (IFAIL.NE.0) THEN WRITE (NOUT,99997) IFAIL GO TO 20 END IF * Display the variates WRITE (NOUT,99999) (X(I),I=1,N) * 20 CONTINUE * 99999 FORMAT (1X,I12) 99998 FORMAT (1X,' ** G05KFF returned with IFAIL = ',I5) 99997 FORMAT (1X,' ** G05TFF returned with IFAIL = ',I5) END