C FILE: 'p-seed.f' C --------------------------------------------------------------------- C C Pseudo seeding function for UNIX FORTRAN random number generators C C The integer function SEED returns a redefined sequence of C integers values starting with the number 80486, and then following C the sequence generated by the IRAND function. It can be used to C seed the random number generating functions: IRAND, RAND, and C DRAND. C C E. Lagache, Version - 1.00, January - 1988 C C C C Command Syntax: This function should be called as the C argument to one of the system random C number functions. For example to seed C the function RAND, the following command C should be used: C C MUMBLE = RAND( SEED() ) C C REMEMBER that SEED and RAND (or IRAND or DRAND) C must be declared in your calling routine! C C C Variables used: C OLDSED = Previous value of the SEED function. C C --------------------------------------------------------------------- INTEGER FUNCTION SEED() INTEGER IRAND, OLDSED SAVE OLDSED C Initialize OLDSED so some starting value. DATA OLDSED /80486/ C Generate the next value in the sequence. OLDSED = IRAND(OLDSED) C Copy the value to the function. SEED = OLDSED RETURN END