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