GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
inrgcm.f
Go to the documentation of this file.
1 SUBROUTINE inrgcm()
2C**********************************************************************
3C
4C SUBROUTINE INRGCM()
5C INitialize Random number Generator CoMmon
6C
7C
8C Function
9C
10C
11C Initializes common area for random number generator. This saves
12C the nuisance of a BLOCK DATA routine and the difficulty of
13C assuring that the routine is loaded with the other routines.
14C
15C**********************************************************************
16C .. Parameters ..
17 INTEGER*4 numg
18 parameter(numg=32)
19C ..
20C .. Scalars in Common ..
21 INTEGER*4 a1,a1vw,a1w,a2,a2vw,a2w,m1,m2
22C ..
23C .. Arrays in Common ..
24 INTEGER*4 cg1(numg),cg2(numg),ig1(numg),ig2(numg),lg1(numg),
25 + lg2(numg)
26 LOGICAL qanti(numg)
27C ..
28C .. Local Scalars ..
29 INTEGER*4 i
30 LOGICAL qdum
31C ..
32C .. External Functions ..
33 LOGICAL qrgnsn
34 EXTERNAL qrgnsn
35C ..
36C .. Common blocks ..
37 COMMON /globe/m1,m2,a1,a2,a1w,a2w,a1vw,a2vw,ig1,ig2,lg1,lg2,cg1,
38 + cg2,qanti
39C ..
40C .. Save statement ..
41 SAVE /globe/
42C ..
43C .. Executable Statements ..
44C V=20; W=30;
45C
46C A1W = MOD(A1**(2**W),M1) A2W = MOD(A2**(2**W),M2)
47C A1VW = MOD(A1**(2**(V+W)),M1) A2VW = MOD(A2**(2**(V+W)),M2)
48C
49C If V or W is changed A1W, A2W, A1VW, and A2VW need to be recomputed.
50C An efficient way to precompute a**(2*j) MOD m is to start with
51C a and square it j times modulo m using the function MLTMOD.
52C
53 m1 = 2147483563
54 m2 = 2147483399
55 a1 = 40014
56 a2 = 40692
57 a1w = 1033780774
58 a2w = 1494757890
59 a1vw = 2082007225
60 a2vw = 784306273
61 DO 10,i = 1,numg
62 qanti(i) = .false.
63 10 CONTINUE
64C
65C Tell the world that common has been initialized
66C
67 qdum = qrgnsn(.true.)
68 RETURN
69
70 END
subroutine inrgcm()
Definition inrgcm.f:2