GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
getcgn.f
Go to the documentation of this file.
1  SUBROUTINE getcgn(g)
2  INTEGER*4 g
3 C**********************************************************************
4 C
5 C SUBROUTINE GETCGN(G)
6 C Get GeNerator
7 C
8 C Returns in G the number of the current random number generator
9 C
10 C
11 C Arguments
12 C
13 C
14 C G <-- Number of the current random number generator (1..32)
15 C INTEGER G
16 C
17 C**********************************************************************
18 C
19  INTEGER*4 curntg,numg
20  SAVE curntg
21  parameter(numg=32)
22  DATA curntg/1/
23 C
24  g = curntg
25  RETURN
26 
27  entry setcgn(g)
28 C**********************************************************************
29 C
30 C SUBROUTINE SETCGN( G )
31 C Set GeNerator
32 C
33 C Sets the current generator to G. All references to a generat
34 C are to the current generator.
35 C
36 C
37 C Arguments
38 C
39 C
40 C G --> Number of the current random number generator (1..32)
41 C INTEGER G
42 C
43 C**********************************************************************
44 C
45 C Abort if generator number out of range
46 C
47  IF (.NOT. (g.LT.0.OR.g.GT.numg)) GO TO 10
48  WRITE (*,*) ' Generator number out of range in SETCGN:',
49  + ' Legal range is 1 to ',numg,' -- ABORT!'
50  CALL xstopx (' Generator number out of range in SETCGN')
51 
52  10 curntg = g
53  RETURN
54 
55  END
subroutine getcgn(g)
Definition: getcgn.f:2