Rename *ll* and *ul* to ll and ul in in-interval
[maxima.git] / share / fftpack5 / fortran / cmf3kf.f
blobb3815327a60544c1555cd76b06419cb92e0505b2
1 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3 C FFTPACK 5.0
5 C Authors: Paul N. Swarztrauber and Richard A. Valent
7 C $Id$
9 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
11 SUBROUTINE CMF3KF (LOT,IDO,L1,NA,CC,IM1,IN1,CH,IM2,IN2,WA)
12 REAL CC(2,IN1,L1,IDO,3),CH(2,IN2,L1,3,IDO),WA(IDO,2,2)
13 DATA TAUR,TAUI /-.5,-.866025403784439/
15 M1D = (LOT-1)*IM1+1
16 M2S = 1-IM2
17 IF (IDO .GT. 1) GO TO 102
18 SN = 1./REAL(3*L1)
19 IF (NA .EQ. 1) GO TO 106
20 DO 101 K=1,L1
21 DO 101 M1=1,M1D,IM1
22 TR2 = CC(1,M1,K,1,2)+CC(1,M1,K,1,3)
23 CR2 = CC(1,M1,K,1,1)+TAUR*TR2
24 CC(1,M1,K,1,1) = SN*(CC(1,M1,K,1,1)+TR2)
25 TI2 = CC(2,M1,K,1,2)+CC(2,M1,K,1,3)
26 CI2 = CC(2,M1,K,1,1)+TAUR*TI2
27 CC(2,M1,K,1,1) = SN*(CC(2,M1,K,1,1)+TI2)
28 CR3 = TAUI*(CC(1,M1,K,1,2)-CC(1,M1,K,1,3))
29 CI3 = TAUI*(CC(2,M1,K,1,2)-CC(2,M1,K,1,3))
30 CC(1,M1,K,1,2) = SN*(CR2-CI3)
31 CC(1,M1,K,1,3) = SN*(CR2+CI3)
32 CC(2,M1,K,1,2) = SN*(CI2+CR3)
33 CC(2,M1,K,1,3) = SN*(CI2-CR3)
34 101 CONTINUE
35 RETURN
36 106 DO 107 K=1,L1
37 M2 = M2S
38 DO 107 M1=1,M1D,IM1
39 M2 = M2+IM2
40 TR2 = CC(1,M1,K,1,2)+CC(1,M1,K,1,3)
41 CR2 = CC(1,M1,K,1,1)+TAUR*TR2
42 CH(1,M2,K,1,1) = SN*(CC(1,M1,K,1,1)+TR2)
43 TI2 = CC(2,M1,K,1,2)+CC(2,M1,K,1,3)
44 CI2 = CC(2,M1,K,1,1)+TAUR*TI2
45 CH(2,M2,K,1,1) = SN*(CC(2,M1,K,1,1)+TI2)
46 CR3 = TAUI*(CC(1,M1,K,1,2)-CC(1,M1,K,1,3))
47 CI3 = TAUI*(CC(2,M1,K,1,2)-CC(2,M1,K,1,3))
48 CH(1,M2,K,2,1) = SN*(CR2-CI3)
49 CH(1,M2,K,3,1) = SN*(CR2+CI3)
50 CH(2,M2,K,2,1) = SN*(CI2+CR3)
51 CH(2,M2,K,3,1) = SN*(CI2-CR3)
52 107 CONTINUE
53 RETURN
54 102 DO 103 K=1,L1
55 M2 = M2S
56 DO 103 M1=1,M1D,IM1
57 M2 = M2+IM2
58 TR2 = CC(1,M1,K,1,2)+CC(1,M1,K,1,3)
59 CR2 = CC(1,M1,K,1,1)+TAUR*TR2
60 CH(1,M2,K,1,1) = CC(1,M1,K,1,1)+TR2
61 TI2 = CC(2,M1,K,1,2)+CC(2,M1,K,1,3)
62 CI2 = CC(2,M1,K,1,1)+TAUR*TI2
63 CH(2,M2,K,1,1) = CC(2,M1,K,1,1)+TI2
64 CR3 = TAUI*(CC(1,M1,K,1,2)-CC(1,M1,K,1,3))
65 CI3 = TAUI*(CC(2,M1,K,1,2)-CC(2,M1,K,1,3))
66 CH(1,M2,K,2,1) = CR2-CI3
67 CH(1,M2,K,3,1) = CR2+CI3
68 CH(2,M2,K,2,1) = CI2+CR3
69 CH(2,M2,K,3,1) = CI2-CR3
70 103 CONTINUE
71 DO 105 I=2,IDO
72 DO 104 K=1,L1
73 M2 = M2S
74 DO 104 M1=1,M1D,IM1
75 M2 = M2+IM2
76 TR2 = CC(1,M1,K,I,2)+CC(1,M1,K,I,3)
77 CR2 = CC(1,M1,K,I,1)+TAUR*TR2
78 CH(1,M2,K,1,I) = CC(1,M1,K,I,1)+TR2
79 TI2 = CC(2,M1,K,I,2)+CC(2,M1,K,I,3)
80 CI2 = CC(2,M1,K,I,1)+TAUR*TI2
81 CH(2,M2,K,1,I) = CC(2,M1,K,I,1)+TI2
82 CR3 = TAUI*(CC(1,M1,K,I,2)-CC(1,M1,K,I,3))
83 CI3 = TAUI*(CC(2,M1,K,I,2)-CC(2,M1,K,I,3))
84 DR2 = CR2-CI3
85 DR3 = CR2+CI3
86 DI2 = CI2+CR3
87 DI3 = CI2-CR3
88 CH(2,M2,K,2,I) = WA(I,1,1)*DI2-WA(I,1,2)*DR2
89 CH(1,M2,K,2,I) = WA(I,1,1)*DR2+WA(I,1,2)*DI2
90 CH(2,M2,K,3,I) = WA(I,2,1)*DI3-WA(I,2,2)*DR3
91 CH(1,M2,K,3,I) = WA(I,2,1)*DR3+WA(I,2,2)*DI3
92 104 CONTINUE
93 105 CONTINUE
94 RETURN
95 END