1 | !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
---|
2 | ! |
---|
3 | ! FFTPACK 5.0 |
---|
4 | ! |
---|
5 | ! Authors: Paul N. Swarztrauber and Richard A. Valent |
---|
6 | ! |
---|
7 | ! $Id: xercon.f,v 1.2 2004/06/15 21:29:20 rodney Exp $ |
---|
8 | ! |
---|
9 | !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
---|
10 | |
---|
11 | LOGICAL FUNCTION XERCON (INC,JUMP,N,LOT) |
---|
12 | INTEGER INC, JUMP, N, LOT |
---|
13 | INTEGER I, J, JNEW, LCM |
---|
14 | ! |
---|
15 | ! Definition: positive integers INC, JUMP, N and LOT are consistent |
---|
16 | ! ---------- |
---|
17 | ! if I1*INC + J1*JUMP = I2*INC + J2*JUMP for I1,I2 < N and J1,J2 |
---|
18 | ! < LOT implies I1=I2 and J1=J2. |
---|
19 | ! |
---|
20 | ! For multiple FFTs to execute correctly, input parameters INC, |
---|
21 | ! JUMP, N and LOT must be consistent ... otherwise at least one |
---|
22 | ! array element mistakenly is transformed more than once. |
---|
23 | ! |
---|
24 | ! XERCON = .TRUE. if and only if INC, JUMP, N and LOT are |
---|
25 | ! consistent. |
---|
26 | ! |
---|
27 | ! ------------------------------------------------------------------ |
---|
28 | ! |
---|
29 | ! Compute I = greatest common divisor (INC, JUMP) |
---|
30 | ! |
---|
31 | I = INC |
---|
32 | J = JUMP |
---|
33 | 10 CONTINUE |
---|
34 | IF (J .NE. 0) THEN |
---|
35 | JNEW = MOD(I,J) |
---|
36 | I = J |
---|
37 | J = JNEW |
---|
38 | GO TO 10 |
---|
39 | ENDIF |
---|
40 | ! |
---|
41 | ! Compute LCM = least common multiple (INC, JUMP) |
---|
42 | ! |
---|
43 | LCM = (INC*JUMP)/I |
---|
44 | ! |
---|
45 | ! Check consistency of INC, JUMP, N, LOT |
---|
46 | ! |
---|
47 | IF (LCM .LE. (N-1)*INC .AND. LCM .LE. (LOT-1)*JUMP) THEN |
---|
48 | XERCON = .FALSE. |
---|
49 | ELSE |
---|
50 | XERCON = .TRUE. |
---|
51 | ENDIF |
---|
52 | ! |
---|
53 | RETURN |
---|
54 | END |
---|