1 subroutine cmf5kf ( lot, ido, l1, na, cc, im1, in1, ch, im2, in2, wa )
3 !*****************************************************************************80
5 !! CMF5KF is an FFTPACK5 auxiliary routine.
8 ! Copyright (C) 1995-2004, Scientific Computing Division,
9 ! University Corporation for Atmospheric Research
23 ! Vectorizing the Fast Fourier Transforms,
24 ! in Parallel Computations,
25 ! edited by G. Rodrigue,
26 ! Academic Press, 1982.
29 ! Fast Fourier Transform Algorithms for Vector Computers,
30 ! Parallel Computing, pages 45-63, 1984.
36 integer ( kind = 4 ) ido
37 integer ( kind = 4 ) in1
38 integer ( kind = 4 ) in2
39 integer ( kind = 4 ) l1
41 real ( kind = 4 ) cc(2,in1,l1,ido,5)
42 real ( kind = 4 ) ch(2,in2,l1,5,ido)
43 real ( kind = 4 ) chold1
44 real ( kind = 4 ) chold2
61 integer ( kind = 4 ) i
62 integer ( kind = 4 ) im1
63 integer ( kind = 4 ) im2
64 integer ( kind = 4 ) k
65 integer ( kind = 4 ) lot
66 integer ( kind = 4 ) m1
67 integer ( kind = 4 ) m1d
68 integer ( kind = 4 ) m2
69 integer ( kind = 4 ) m2s
70 integer ( kind = 4 ) na
76 real ( kind = 4 ), parameter :: ti11 = -0.9510565162951536E+00
77 real ( kind = 4 ), parameter :: ti12 = -0.5877852522924731E+00
82 real ( kind = 4 ), parameter :: tr11 = 0.3090169943749474E+00
83 real ( kind = 4 ), parameter :: tr12 = -0.8090169943749474E+00
84 real ( kind = 4 ) wa(ido,4,2)
86 m1d = ( lot - 1 ) * im1 + 1
95 ti5 = cc(2,m1,k,1,2)-cc(2,m1,k,1,5)
96 ti2 = cc(2,m1,k,1,2)+cc(2,m1,k,1,5)
97 ti4 = cc(2,m1,k,1,3)-cc(2,m1,k,1,4)
98 ti3 = cc(2,m1,k,1,3)+cc(2,m1,k,1,4)
99 tr5 = cc(1,m1,k,1,2)-cc(1,m1,k,1,5)
100 tr2 = cc(1,m1,k,1,2)+cc(1,m1,k,1,5)
101 tr4 = cc(1,m1,k,1,3)-cc(1,m1,k,1,4)
102 tr3 = cc(1,m1,k,1,3)+cc(1,m1,k,1,4)
103 ch(1,m2,k,1,1) = cc(1,m1,k,1,1)+tr2+tr3
104 ch(2,m2,k,1,1) = cc(2,m1,k,1,1)+ti2+ti3
105 cr2 = cc(1,m1,k,1,1)+tr11*tr2+tr12*tr3
106 ci2 = cc(2,m1,k,1,1)+tr11*ti2+tr12*ti3
107 cr3 = cc(1,m1,k,1,1)+tr12*tr2+tr11*tr3
108 ci3 = cc(2,m1,k,1,1)+tr12*ti2+tr11*ti3
109 cr5 = ti11*tr5+ti12*tr4
110 ci5 = ti11*ti5+ti12*ti4
111 cr4 = ti12*tr5-ti11*tr4
112 ci4 = ti12*ti5-ti11*ti4
113 ch(1,m2,k,2,1) = cr2-ci5
114 ch(1,m2,k,5,1) = cr2+ci5
115 ch(2,m2,k,2,1) = ci2+cr5
116 ch(2,m2,k,3,1) = ci3+cr4
117 ch(1,m2,k,3,1) = cr3-ci4
118 ch(1,m2,k,4,1) = cr3+ci4
119 ch(2,m2,k,4,1) = ci3-cr4
120 ch(2,m2,k,5,1) = ci2-cr5
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
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
167 else if ( na == 1 ) then
169 sn = 1.0E+00 / real ( 5 * l1, kind = 4 )
175 ti5 = cc(2,m1,k,1,2)-cc(2,m1,k,1,5)
176 ti2 = cc(2,m1,k,1,2)+cc(2,m1,k,1,5)
177 ti4 = cc(2,m1,k,1,3)-cc(2,m1,k,1,4)
178 ti3 = cc(2,m1,k,1,3)+cc(2,m1,k,1,4)
179 tr5 = cc(1,m1,k,1,2)-cc(1,m1,k,1,5)
180 tr2 = cc(1,m1,k,1,2)+cc(1,m1,k,1,5)
181 tr4 = cc(1,m1,k,1,3)-cc(1,m1,k,1,4)
182 tr3 = cc(1,m1,k,1,3)+cc(1,m1,k,1,4)
183 ch(1,m2,k,1,1) = sn*(cc(1,m1,k,1,1)+tr2+tr3)
184 ch(2,m2,k,1,1) = sn*(cc(2,m1,k,1,1)+ti2+ti3)
185 cr2 = cc(1,m1,k,1,1)+tr11*tr2+tr12*tr3
186 ci2 = cc(2,m1,k,1,1)+tr11*ti2+tr12*ti3
187 cr3 = cc(1,m1,k,1,1)+tr12*tr2+tr11*tr3
188 ci3 = cc(2,m1,k,1,1)+tr12*ti2+tr11*ti3
189 cr5 = ti11*tr5+ti12*tr4
190 ci5 = ti11*ti5+ti12*ti4
191 cr4 = ti12*tr5-ti11*tr4
192 ci4 = ti12*ti5-ti11*ti4
193 ch(1,m2,k,2,1) = sn*(cr2-ci5)
194 ch(1,m2,k,5,1) = sn*(cr2+ci5)
195 ch(2,m2,k,2,1) = sn*(ci2+cr5)
196 ch(2,m2,k,3,1) = sn*(ci3+cr4)
197 ch(1,m2,k,3,1) = sn*(cr3-ci4)
198 ch(1,m2,k,4,1) = sn*(cr3+ci4)
199 ch(2,m2,k,4,1) = sn*(ci3-cr4)
200 ch(2,m2,k,5,1) = sn*(ci2-cr5)
206 sn = 1.0E+00 / real ( 5 * l1, kind = 4 )
211 ti5 = cc(2,m1,k,1,2) - cc(2,m1,k,1,5)
212 ti2 = cc(2,m1,k,1,2) + cc(2,m1,k,1,5)
213 ti4 = cc(2,m1,k,1,3) - cc(2,m1,k,1,4)
214 ti3 = cc(2,m1,k,1,3) + cc(2,m1,k,1,4)
215 tr5 = cc(1,m1,k,1,2) - cc(1,m1,k,1,5)
216 tr2 = cc(1,m1,k,1,2) + cc(1,m1,k,1,5)
217 tr4 = cc(1,m1,k,1,3) - cc(1,m1,k,1,4)
218 tr3 = cc(1,m1,k,1,3) + cc(1,m1,k,1,4)
220 chold1 = sn * ( cc(1,m1,k,1,1) + tr2 + tr3 )
221 chold2 = sn * ( cc(2,m1,k,1,1) + ti2 + ti3 )
223 cr2 = cc(1,m1,k,1,1) + tr11 * tr2 + tr12 * tr3
224 ci2 = cc(2,m1,k,1,1) + tr11 * ti2 + tr12 * ti3
225 cr3 = cc(1,m1,k,1,1) + tr12 * tr2 + tr11 * tr3
226 ci3 = cc(2,m1,k,1,1) + tr12 * ti2 + tr11 * ti3
228 cc(1,m1,k,1,1) = chold1
229 cc(2,m1,k,1,1) = chold2
231 cr5 = ti11 * tr5 + ti12 * tr4
232 ci5 = ti11 * ti5 + ti12 * ti4
233 cr4 = ti12 * tr5 - ti11 * tr4
234 ci4 = ti12 * ti5 - ti11 * ti4
236 cc(1,m1,k,1,2) = sn * ( cr2 - ci5 )
237 cc(1,m1,k,1,5) = sn * ( cr2 + ci5 )
238 cc(2,m1,k,1,2) = sn * ( ci2 + cr5 )
239 cc(2,m1,k,1,3) = sn * ( ci3 + cr4 )
240 cc(1,m1,k,1,3) = sn * ( cr3 - ci4 )
241 cc(1,m1,k,1,4) = sn * ( cr3 + ci4 )
242 cc(2,m1,k,1,4) = sn * ( ci3 - cr4 )
243 cc(2,m1,k,1,5) = sn * ( ci2 - cr5 )