1 | !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
---|
2 | ! C |
---|
3 | !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
---|
4 | ! |
---|
5 | ! File: cmf5kf.f |
---|
6 | ! |
---|
7 | ! Library: FFTPACK 5.0 |
---|
8 | ! |
---|
9 | ! Authors: Paul N. Swarztrauber and Richard A. Valent |
---|
10 | ! National Center for Atmospheric Research |
---|
11 | ! PO 3000, Boulder, Colorado |
---|
12 | ! |
---|
13 | ! Date: Wed Mar 29 18:31:13 MST 1995 |
---|
14 | ! |
---|
15 | ! Description: Lower-level auxiliary routine |
---|
16 | ! |
---|
17 | SUBROUTINE CMF5KF (LOT,IDO,L1,NA,CC,IM1,IN1,CH,IM2,IN2,WA) |
---|
18 | REAL CC(2,IN1,L1,IDO,5),CH(2,IN2,L1,5,IDO),WA(IDO,4,2) |
---|
19 | DATA TR11,TI11,TR12,TI12 /.3090169943749474,-.9510565162951536, & |
---|
20 | &-.8090169943749474,-.5877852522924731/ |
---|
21 | ! |
---|
22 | ! FFTPACK 5.0 auxiliary routine |
---|
23 | ! |
---|
24 | M1D = (LOT-1)*IM1+1 |
---|
25 | M2S = 1-IM2 |
---|
26 | IF (IDO .GT. 1) GO TO 102 |
---|
27 | SN = 1./REAL(5*L1) |
---|
28 | IF (NA .EQ. 1) GO TO 106 |
---|
29 | DO 101 K=1,L1 |
---|
30 | DO 101 M1=1,M1D,IM1 |
---|
31 | TI5 = CC(2,M1,K,1,2)-CC(2,M1,K,1,5) |
---|
32 | TI2 = CC(2,M1,K,1,2)+CC(2,M1,K,1,5) |
---|
33 | TI4 = CC(2,M1,K,1,3)-CC(2,M1,K,1,4) |
---|
34 | TI3 = CC(2,M1,K,1,3)+CC(2,M1,K,1,4) |
---|
35 | TR5 = CC(1,M1,K,1,2)-CC(1,M1,K,1,5) |
---|
36 | TR2 = CC(1,M1,K,1,2)+CC(1,M1,K,1,5) |
---|
37 | TR4 = CC(1,M1,K,1,3)-CC(1,M1,K,1,4) |
---|
38 | TR3 = CC(1,M1,K,1,3)+CC(1,M1,K,1,4) |
---|
39 | CHOLD1 = SN*(CC(1,M1,K,1,1)+TR2+TR3) |
---|
40 | CHOLD2 = SN*(CC(2,M1,K,1,1)+TI2+TI3) |
---|
41 | CR2 = CC(1,M1,K,1,1)+TR11*TR2+TR12*TR3 |
---|
42 | CI2 = CC(2,M1,K,1,1)+TR11*TI2+TR12*TI3 |
---|
43 | CR3 = CC(1,M1,K,1,1)+TR12*TR2+TR11*TR3 |
---|
44 | CI3 = CC(2,M1,K,1,1)+TR12*TI2+TR11*TI3 |
---|
45 | CC(1,M1,K,1,1) = CHOLD1 |
---|
46 | CC(2,M1,K,1,1) = CHOLD2 |
---|
47 | CR5 = TI11*TR5+TI12*TR4 |
---|
48 | CI5 = TI11*TI5+TI12*TI4 |
---|
49 | CR4 = TI12*TR5-TI11*TR4 |
---|
50 | CI4 = TI12*TI5-TI11*TI4 |
---|
51 | CC(1,M1,K,1,2) = SN*(CR2-CI5) |
---|
52 | CC(1,M1,K,1,5) = SN*(CR2+CI5) |
---|
53 | CC(2,M1,K,1,2) = SN*(CI2+CR5) |
---|
54 | CC(2,M1,K,1,3) = SN*(CI3+CR4) |
---|
55 | CC(1,M1,K,1,3) = SN*(CR3-CI4) |
---|
56 | CC(1,M1,K,1,4) = SN*(CR3+CI4) |
---|
57 | CC(2,M1,K,1,4) = SN*(CI3-CR4) |
---|
58 | CC(2,M1,K,1,5) = SN*(CI2-CR5) |
---|
59 | 101 CONTINUE |
---|
60 | RETURN |
---|
61 | 106 DO 107 K=1,L1 |
---|
62 | M2 = M2S |
---|
63 | DO 107 M1=1,M1D,IM1 |
---|
64 | M2 = M2+IM2 |
---|
65 | TI5 = CC(2,M1,K,1,2)-CC(2,M1,K,1,5) |
---|
66 | TI2 = CC(2,M1,K,1,2)+CC(2,M1,K,1,5) |
---|
67 | TI4 = CC(2,M1,K,1,3)-CC(2,M1,K,1,4) |
---|
68 | TI3 = CC(2,M1,K,1,3)+CC(2,M1,K,1,4) |
---|
69 | TR5 = CC(1,M1,K,1,2)-CC(1,M1,K,1,5) |
---|
70 | TR2 = CC(1,M1,K,1,2)+CC(1,M1,K,1,5) |
---|
71 | TR4 = CC(1,M1,K,1,3)-CC(1,M1,K,1,4) |
---|
72 | TR3 = CC(1,M1,K,1,3)+CC(1,M1,K,1,4) |
---|
73 | CH(1,M2,K,1,1) = SN*(CC(1,M1,K,1,1)+TR2+TR3) |
---|
74 | CH(2,M2,K,1,1) = SN*(CC(2,M1,K,1,1)+TI2+TI3) |
---|
75 | CR2 = CC(1,M1,K,1,1)+TR11*TR2+TR12*TR3 |
---|
76 | CI2 = CC(2,M1,K,1,1)+TR11*TI2+TR12*TI3 |
---|
77 | CR3 = CC(1,M1,K,1,1)+TR12*TR2+TR11*TR3 |
---|
78 | CI3 = CC(2,M1,K,1,1)+TR12*TI2+TR11*TI3 |
---|
79 | CR5 = TI11*TR5+TI12*TR4 |
---|
80 | CI5 = TI11*TI5+TI12*TI4 |
---|
81 | CR4 = TI12*TR5-TI11*TR4 |
---|
82 | CI4 = TI12*TI5-TI11*TI4 |
---|
83 | CH(1,M2,K,2,1) = SN*(CR2-CI5) |
---|
84 | CH(1,M2,K,5,1) = SN*(CR2+CI5) |
---|
85 | CH(2,M2,K,2,1) = SN*(CI2+CR5) |
---|
86 | CH(2,M2,K,3,1) = SN*(CI3+CR4) |
---|
87 | CH(1,M2,K,3,1) = SN*(CR3-CI4) |
---|
88 | CH(1,M2,K,4,1) = SN*(CR3+CI4) |
---|
89 | CH(2,M2,K,4,1) = SN*(CI3-CR4) |
---|
90 | CH(2,M2,K,5,1) = SN*(CI2-CR5) |
---|
91 | 107 CONTINUE |
---|
92 | RETURN |
---|
93 | 102 DO 103 K=1,L1 |
---|
94 | M2 = M2S |
---|
95 | DO 103 M1=1,M1D,IM1 |
---|
96 | M2 = M2+IM2 |
---|
97 | TI5 = CC(2,M1,K,1,2)-CC(2,M1,K,1,5) |
---|
98 | TI2 = CC(2,M1,K,1,2)+CC(2,M1,K,1,5) |
---|
99 | TI4 = CC(2,M1,K,1,3)-CC(2,M1,K,1,4) |
---|
100 | TI3 = CC(2,M1,K,1,3)+CC(2,M1,K,1,4) |
---|
101 | TR5 = CC(1,M1,K,1,2)-CC(1,M1,K,1,5) |
---|
102 | TR2 = CC(1,M1,K,1,2)+CC(1,M1,K,1,5) |
---|
103 | TR4 = CC(1,M1,K,1,3)-CC(1,M1,K,1,4) |
---|
104 | TR3 = CC(1,M1,K,1,3)+CC(1,M1,K,1,4) |
---|
105 | CH(1,M2,K,1,1) = CC(1,M1,K,1,1)+TR2+TR3 |
---|
106 | CH(2,M2,K,1,1) = CC(2,M1,K,1,1)+TI2+TI3 |
---|
107 | CR2 = CC(1,M1,K,1,1)+TR11*TR2+TR12*TR3 |
---|
108 | CI2 = CC(2,M1,K,1,1)+TR11*TI2+TR12*TI3 |
---|
109 | CR3 = CC(1,M1,K,1,1)+TR12*TR2+TR11*TR3 |
---|
110 | CI3 = CC(2,M1,K,1,1)+TR12*TI2+TR11*TI3 |
---|
111 | CR5 = TI11*TR5+TI12*TR4 |
---|
112 | CI5 = TI11*TI5+TI12*TI4 |
---|
113 | CR4 = TI12*TR5-TI11*TR4 |
---|
114 | CI4 = TI12*TI5-TI11*TI4 |
---|
115 | CH(1,M2,K,2,1) = CR2-CI5 |
---|
116 | CH(1,M2,K,5,1) = CR2+CI5 |
---|
117 | CH(2,M2,K,2,1) = CI2+CR5 |
---|
118 | CH(2,M2,K,3,1) = CI3+CR4 |
---|
119 | CH(1,M2,K,3,1) = CR3-CI4 |
---|
120 | CH(1,M2,K,4,1) = CR3+CI4 |
---|
121 | CH(2,M2,K,4,1) = CI3-CR4 |
---|
122 | CH(2,M2,K,5,1) = CI2-CR5 |
---|
123 | 103 CONTINUE |
---|
124 | DO 105 I=2,IDO |
---|
125 | DO 104 K=1,L1 |
---|
126 | M2 = M2S |
---|
127 | DO 104 M1=1,M1D,IM1 |
---|
128 | M2 = M2+IM2 |
---|
129 | TI5 = CC(2,M1,K,I,2)-CC(2,M1,K,I,5) |
---|
130 | TI2 = CC(2,M1,K,I,2)+CC(2,M1,K,I,5) |
---|
131 | TI4 = CC(2,M1,K,I,3)-CC(2,M1,K,I,4) |
---|
132 | TI3 = CC(2,M1,K,I,3)+CC(2,M1,K,I,4) |
---|
133 | TR5 = CC(1,M1,K,I,2)-CC(1,M1,K,I,5) |
---|
134 | TR2 = CC(1,M1,K,I,2)+CC(1,M1,K,I,5) |
---|
135 | TR4 = CC(1,M1,K,I,3)-CC(1,M1,K,I,4) |
---|
136 | TR3 = CC(1,M1,K,I,3)+CC(1,M1,K,I,4) |
---|
137 | CH(1,M2,K,1,I) = CC(1,M1,K,I,1)+TR2+TR3 |
---|
138 | CH(2,M2,K,1,I) = CC(2,M1,K,I,1)+TI2+TI3 |
---|
139 | CR2 = CC(1,M1,K,I,1)+TR11*TR2+TR12*TR3 |
---|
140 | CI2 = CC(2,M1,K,I,1)+TR11*TI2+TR12*TI3 |
---|
141 | CR3 = CC(1,M1,K,I,1)+TR12*TR2+TR11*TR3 |
---|
142 | CI3 = CC(2,M1,K,I,1)+TR12*TI2+TR11*TI3 |
---|
143 | CR5 = TI11*TR5+TI12*TR4 |
---|
144 | CI5 = TI11*TI5+TI12*TI4 |
---|
145 | CR4 = TI12*TR5-TI11*TR4 |
---|
146 | CI4 = TI12*TI5-TI11*TI4 |
---|
147 | DR3 = CR3-CI4 |
---|
148 | DR4 = CR3+CI4 |
---|
149 | DI3 = CI3+CR4 |
---|
150 | DI4 = CI3-CR4 |
---|
151 | DR5 = CR2+CI5 |
---|
152 | DR2 = CR2-CI5 |
---|
153 | DI5 = CI2-CR5 |
---|
154 | DI2 = CI2+CR5 |
---|
155 | CH(1,M2,K,2,I) = WA(I,1,1)*DR2+WA(I,1,2)*DI2 |
---|
156 | CH(2,M2,K,2,I) = WA(I,1,1)*DI2-WA(I,1,2)*DR2 |
---|
157 | CH(1,M2,K,3,I) = WA(I,2,1)*DR3+WA(I,2,2)*DI3 |
---|
158 | CH(2,M2,K,3,I) = WA(I,2,1)*DI3-WA(I,2,2)*DR3 |
---|
159 | CH(1,M2,K,4,I) = WA(I,3,1)*DR4+WA(I,3,2)*DI4 |
---|
160 | CH(2,M2,K,4,I) = WA(I,3,1)*DI4-WA(I,3,2)*DR4 |
---|
161 | CH(1,M2,K,5,I) = WA(I,4,1)*DR5+WA(I,4,2)*DI5 |
---|
162 | CH(2,M2,K,5,I) = WA(I,4,1)*DI5-WA(I,4,2)*DR5 |
---|
163 | 104 CONTINUE |
---|
164 | 105 END DO |
---|
165 | RETURN |
---|
166 | END |
---|