1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
|
$NetBSD: patch-ag,v 1.1 2008/06/21 19:31:03 joerg Exp $
Reorder some functions to ensure they are defined before used.
--- src/cfft.f.orig 1996-10-19 19:55:37.000000000 +0000
+++ src/cfft.f
@@ -13,42 +13,137 @@
*
- SUBROUTINE CFFTI(N,WSAVE)
+ SUBROUTINE CFFTF1(N,C,CH,WA,IFAC)
CSE
IMPLICIT REAL*8(A-H,O-Z)
-C***BEGIN PROLOGUE CFFTI
-C***DATE WRITTEN 790601 (YYMMDD)
-C***REVISION DATE 830401 (YYMMDD)
-C***CATEGORY NO. J1A2
-C***KEYWORDS FOURIER TRANSFORM
-C***AUTHOR SWARZTRAUBER, P. N., (NCAR)
-CPS
-C***PURPOSE Initialize for CFFTF and CFFTB.
-C***DESCRIPTION
-C
-C Subroutine CFFTI initializes the array WSAVE which is used in
-C both CFFTF and CFFTB. The prime factorization of N together with
-C a tabulation of the trigonometric functions are computed and
-C stored in WSAVE.
-CPE
-CAS
-C Input Parameter
-C
-C N the length of the sequence to be transformed
-C
-C Output Parameter
-C
-C WSAVE a work array which must be dimensioned at least 4*N+15.
-C The same work array can be used for both CFFTF and CFFTB
-C as long as N remains unchanged. Different WSAVE arrays
-C are required for different values of N. The contents of
-C WSAVE must not be changed between calls of CFFTF or CFFTB.
-CAE
-C***REFERENCES (NONE)
-C***ROUTINES CALLED CFFTI1
-C***END PROLOGUE CFFTI
- DIMENSION WSAVE(1)
-C***FIRST EXECUTABLE STATEMENT CFFTI
- IF (N .EQ. 1) RETURN
- IW1 = N+N+1
- IW2 = IW1+N+N
- CALL CFFTI1 (N,WSAVE(IW1),WSAVE(IW2))
+C***BEGIN PROLOGUE CFFTF1
+C***REFER TO CFFTF
+C***ROUTINES CALLED PASSF,PASSF2,PASSF3,PASSF4,PASSF5
+C***END PROLOGUE CFFTF1
+ DIMENSION CH(1) ,C(1) ,WA(1) ,IFAC(2)
+C***FIRST EXECUTABLE STATEMENT CFFTF1
+ NF = IFAC(2)
+ NA = 0
+ L1 = 1
+ IW = 1
+ DO 116 K1=1,NF
+ IP = IFAC(K1+2)
+ L2 = IP*L1
+ IDO = N/L2
+ IDOT = IDO+IDO
+ IDL1 = IDOT*L1
+ IF (IP .NE. 4) GO TO 103
+ IX2 = IW+IDOT
+ IX3 = IX2+IDOT
+ IF (NA .NE. 0) GO TO 101
+ CALL PASSF4 (IDOT,L1,C,CH,WA(IW),WA(IX2),WA(IX3))
+ GO TO 102
+ 101 CALL PASSF4 (IDOT,L1,CH,C,WA(IW),WA(IX2),WA(IX3))
+ 102 NA = 1-NA
+ GO TO 115
+ 103 IF (IP .NE. 2) GO TO 106
+ IF (NA .NE. 0) GO TO 104
+ CALL PASSF2 (IDOT,L1,C,CH,WA(IW))
+ GO TO 105
+ 104 CALL PASSF2 (IDOT,L1,CH,C,WA(IW))
+ 105 NA = 1-NA
+ GO TO 115
+ 106 IF (IP .NE. 3) GO TO 109
+ IX2 = IW+IDOT
+ IF (NA .NE. 0) GO TO 107
+ CALL PASSF3 (IDOT,L1,C,CH,WA(IW),WA(IX2))
+ GO TO 108
+ 107 CALL PASSF3 (IDOT,L1,CH,C,WA(IW),WA(IX2))
+ 108 NA = 1-NA
+ GO TO 115
+ 109 IF (IP .NE. 5) GO TO 112
+ IX2 = IW+IDOT
+ IX3 = IX2+IDOT
+ IX4 = IX3+IDOT
+ IF (NA .NE. 0) GO TO 110
+ CALL PASSF5 (IDOT,L1,C,CH,WA(IW),WA(IX2),WA(IX3),WA(IX4))
+ GO TO 111
+ 110 CALL PASSF5 (IDOT,L1,CH,C,WA(IW),WA(IX2),WA(IX3),WA(IX4))
+ 111 NA = 1-NA
+ GO TO 115
+ 112 IF (NA .NE. 0) GO TO 113
+ CALL PASSF (NAC,IDOT,IP,L1,IDL1,C,C,C,CH,CH,WA(IW))
+ GO TO 114
+ 113 CALL PASSF (NAC,IDOT,IP,L1,IDL1,CH,CH,CH,C,C,WA(IW))
+ 114 IF (NAC .NE. 0) NA = 1-NA
+ 115 L1 = L2
+ IW = IW+(IP-1)*IDOT
+ 116 CONTINUE
+ IF (NA .EQ. 0) RETURN
+ N2 = N+N
+ DO 117 I=1,N2
+ C(I) = CH(I)
+ 117 CONTINUE
+ RETURN
+ END
+*
+ SUBROUTINE CFFTB1(N,C,CH,WA,IFAC)
+CSE
+ IMPLICIT REAL*8(A-H,O-Z)
+C***BEGIN PROLOGUE CFFTB1
+C***REFER TO CFFTB
+C***ROUTINES CALLED PASSB,PASSB2,PASSB3,PASSB4,PASSB5
+C***END PROLOGUE CFFTB1
+ DIMENSION CH(1) ,C(1) ,WA(1) ,IFAC(2)
+C***FIRST EXECUTABLE STATEMENT CFFTB1
+ NF = IFAC(2)
+ NA = 0
+ L1 = 1
+ IW = 1
+ DO 116 K1=1,NF
+ IP = IFAC(K1+2)
+ L2 = IP*L1
+ IDO = N/L2
+ IDOT = IDO+IDO
+ IDL1 = IDOT*L1
+ IF (IP .NE. 4) GO TO 103
+ IX2 = IW+IDOT
+ IX3 = IX2+IDOT
+ IF (NA .NE. 0) GO TO 101
+ CALL PASSB4 (IDOT,L1,C,CH,WA(IW),WA(IX2),WA(IX3))
+ GO TO 102
+ 101 CALL PASSB4 (IDOT,L1,CH,C,WA(IW),WA(IX2),WA(IX3))
+ 102 NA = 1-NA
+ GO TO 115
+ 103 IF (IP .NE. 2) GO TO 106
+ IF (NA .NE. 0) GO TO 104
+ CALL PASSB2 (IDOT,L1,C,CH,WA(IW))
+ GO TO 105
+ 104 CALL PASSB2 (IDOT,L1,CH,C,WA(IW))
+ 105 NA = 1-NA
+ GO TO 115
+ 106 IF (IP .NE. 3) GO TO 109
+ IX2 = IW+IDOT
+ IF (NA .NE. 0) GO TO 107
+ CALL PASSB3 (IDOT,L1,C,CH,WA(IW),WA(IX2))
+ GO TO 108
+ 107 CALL PASSB3 (IDOT,L1,CH,C,WA(IW),WA(IX2))
+ 108 NA = 1-NA
+ GO TO 115
+ 109 IF (IP .NE. 5) GO TO 112
+ IX2 = IW+IDOT
+ IX3 = IX2+IDOT
+ IX4 = IX3+IDOT
+ IF (NA .NE. 0) GO TO 110
+ CALL PASSB5 (IDOT,L1,C,CH,WA(IW),WA(IX2),WA(IX3),WA(IX4))
+ GO TO 111
+ 110 CALL PASSB5 (IDOT,L1,CH,C,WA(IW),WA(IX2),WA(IX3),WA(IX4))
+ 111 NA = 1-NA
+ GO TO 115
+ 112 IF (NA .NE. 0) GO TO 113
+ CALL PASSB (NAC,IDOT,IP,L1,IDL1,C,C,C,CH,CH,WA(IW))
+ GO TO 114
+ 113 CALL PASSB (NAC,IDOT,IP,L1,IDL1,CH,CH,CH,C,C,WA(IW))
+ 114 IF (NAC .NE. 0) NA = 1-NA
+ 115 L1 = L2
+ IW = IW+(IP-1)*IDOT
+ 116 CONTINUE
+ IF (NA .EQ. 0) RETURN
+ N2 = N+N
+ DO 117 I=1,N2
+ C(I) = CH(I)
+ 117 CONTINUE
RETURN
@@ -124,2 +219,45 @@ C***FIRST EXECUTABLE STATEMENT CFFTI1
*
+ SUBROUTINE CFFTI(N,WSAVE)
+CSE
+ IMPLICIT REAL*8(A-H,O-Z)
+C***BEGIN PROLOGUE CFFTI
+C***DATE WRITTEN 790601 (YYMMDD)
+C***REVISION DATE 830401 (YYMMDD)
+C***CATEGORY NO. J1A2
+C***KEYWORDS FOURIER TRANSFORM
+C***AUTHOR SWARZTRAUBER, P. N., (NCAR)
+CPS
+C***PURPOSE Initialize for CFFTF and CFFTB.
+C***DESCRIPTION
+C
+C Subroutine CFFTI initializes the array WSAVE which is used in
+C both CFFTF and CFFTB. The prime factorization of N together with
+C a tabulation of the trigonometric functions are computed and
+C stored in WSAVE.
+CPE
+CAS
+C Input Parameter
+C
+C N the length of the sequence to be transformed
+C
+C Output Parameter
+C
+C WSAVE a work array which must be dimensioned at least 4*N+15.
+C The same work array can be used for both CFFTF and CFFTB
+C as long as N remains unchanged. Different WSAVE arrays
+C are required for different values of N. The contents of
+C WSAVE must not be changed between calls of CFFTF or CFFTB.
+CAE
+C***REFERENCES (NONE)
+C***ROUTINES CALLED CFFTI1
+C***END PROLOGUE CFFTI
+ DIMENSION WSAVE(1)
+C***FIRST EXECUTABLE STATEMENT CFFTI
+ IF (N .EQ. 1) RETURN
+ IW1 = N+N+1
+ IW2 = IW1+N+N
+ CALL CFFTI1 (N,WSAVE(IW1),WSAVE(IW2))
+ RETURN
+ END
+*
SUBROUTINE CFFTF(N,C,WSAVE)
@@ -192,71 +330,2 @@ C***FIRST EXECUTABLE STATEMENT CFFTF
*
- SUBROUTINE CFFTF1(N,C,CH,WA,IFAC)
-CSE
- IMPLICIT REAL*8(A-H,O-Z)
-C***BEGIN PROLOGUE CFFTF1
-C***REFER TO CFFTF
-C***ROUTINES CALLED PASSF,PASSF2,PASSF3,PASSF4,PASSF5
-C***END PROLOGUE CFFTF1
- DIMENSION CH(1) ,C(1) ,WA(1) ,IFAC(2)
-C***FIRST EXECUTABLE STATEMENT CFFTF1
- NF = IFAC(2)
- NA = 0
- L1 = 1
- IW = 1
- DO 116 K1=1,NF
- IP = IFAC(K1+2)
- L2 = IP*L1
- IDO = N/L2
- IDOT = IDO+IDO
- IDL1 = IDOT*L1
- IF (IP .NE. 4) GO TO 103
- IX2 = IW+IDOT
- IX3 = IX2+IDOT
- IF (NA .NE. 0) GO TO 101
- CALL PASSF4 (IDOT,L1,C,CH,WA(IW),WA(IX2),WA(IX3))
- GO TO 102
- 101 CALL PASSF4 (IDOT,L1,CH,C,WA(IW),WA(IX2),WA(IX3))
- 102 NA = 1-NA
- GO TO 115
- 103 IF (IP .NE. 2) GO TO 106
- IF (NA .NE. 0) GO TO 104
- CALL PASSF2 (IDOT,L1,C,CH,WA(IW))
- GO TO 105
- 104 CALL PASSF2 (IDOT,L1,CH,C,WA(IW))
- 105 NA = 1-NA
- GO TO 115
- 106 IF (IP .NE. 3) GO TO 109
- IX2 = IW+IDOT
- IF (NA .NE. 0) GO TO 107
- CALL PASSF3 (IDOT,L1,C,CH,WA(IW),WA(IX2))
- GO TO 108
- 107 CALL PASSF3 (IDOT,L1,CH,C,WA(IW),WA(IX2))
- 108 NA = 1-NA
- GO TO 115
- 109 IF (IP .NE. 5) GO TO 112
- IX2 = IW+IDOT
- IX3 = IX2+IDOT
- IX4 = IX3+IDOT
- IF (NA .NE. 0) GO TO 110
- CALL PASSF5 (IDOT,L1,C,CH,WA(IW),WA(IX2),WA(IX3),WA(IX4))
- GO TO 111
- 110 CALL PASSF5 (IDOT,L1,CH,C,WA(IW),WA(IX2),WA(IX3),WA(IX4))
- 111 NA = 1-NA
- GO TO 115
- 112 IF (NA .NE. 0) GO TO 113
- CALL PASSF (NAC,IDOT,IP,L1,IDL1,C,C,C,CH,CH,WA(IW))
- GO TO 114
- 113 CALL PASSF (NAC,IDOT,IP,L1,IDL1,CH,CH,CH,C,C,WA(IW))
- 114 IF (NAC .NE. 0) NA = 1-NA
- 115 L1 = L2
- IW = IW+(IP-1)*IDOT
- 116 CONTINUE
- IF (NA .EQ. 0) RETURN
- N2 = N+N
- DO 117 I=1,N2
- C(I) = CH(I)
- 117 CONTINUE
- RETURN
- END
-*
SUBROUTINE PASSF(NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA)
@@ -797,71 +866,2 @@ C***FIRST EXECUTABLE STATEMENT CFFTB
*
- SUBROUTINE CFFTB1(N,C,CH,WA,IFAC)
-CSE
- IMPLICIT REAL*8(A-H,O-Z)
-C***BEGIN PROLOGUE CFFTB1
-C***REFER TO CFFTB
-C***ROUTINES CALLED PASSB,PASSB2,PASSB3,PASSB4,PASSB5
-C***END PROLOGUE CFFTB1
- DIMENSION CH(1) ,C(1) ,WA(1) ,IFAC(2)
-C***FIRST EXECUTABLE STATEMENT CFFTB1
- NF = IFAC(2)
- NA = 0
- L1 = 1
- IW = 1
- DO 116 K1=1,NF
- IP = IFAC(K1+2)
- L2 = IP*L1
- IDO = N/L2
- IDOT = IDO+IDO
- IDL1 = IDOT*L1
- IF (IP .NE. 4) GO TO 103
- IX2 = IW+IDOT
- IX3 = IX2+IDOT
- IF (NA .NE. 0) GO TO 101
- CALL PASSB4 (IDOT,L1,C,CH,WA(IW),WA(IX2),WA(IX3))
- GO TO 102
- 101 CALL PASSB4 (IDOT,L1,CH,C,WA(IW),WA(IX2),WA(IX3))
- 102 NA = 1-NA
- GO TO 115
- 103 IF (IP .NE. 2) GO TO 106
- IF (NA .NE. 0) GO TO 104
- CALL PASSB2 (IDOT,L1,C,CH,WA(IW))
- GO TO 105
- 104 CALL PASSB2 (IDOT,L1,CH,C,WA(IW))
- 105 NA = 1-NA
- GO TO 115
- 106 IF (IP .NE. 3) GO TO 109
- IX2 = IW+IDOT
- IF (NA .NE. 0) GO TO 107
- CALL PASSB3 (IDOT,L1,C,CH,WA(IW),WA(IX2))
- GO TO 108
- 107 CALL PASSB3 (IDOT,L1,CH,C,WA(IW),WA(IX2))
- 108 NA = 1-NA
- GO TO 115
- 109 IF (IP .NE. 5) GO TO 112
- IX2 = IW+IDOT
- IX3 = IX2+IDOT
- IX4 = IX3+IDOT
- IF (NA .NE. 0) GO TO 110
- CALL PASSB5 (IDOT,L1,C,CH,WA(IW),WA(IX2),WA(IX3),WA(IX4))
- GO TO 111
- 110 CALL PASSB5 (IDOT,L1,CH,C,WA(IW),WA(IX2),WA(IX3),WA(IX4))
- 111 NA = 1-NA
- GO TO 115
- 112 IF (NA .NE. 0) GO TO 113
- CALL PASSB (NAC,IDOT,IP,L1,IDL1,C,C,C,CH,CH,WA(IW))
- GO TO 114
- 113 CALL PASSB (NAC,IDOT,IP,L1,IDL1,CH,CH,CH,C,C,WA(IW))
- 114 IF (NAC .NE. 0) NA = 1-NA
- 115 L1 = L2
- IW = IW+(IP-1)*IDOT
- 116 CONTINUE
- IF (NA .EQ. 0) RETURN
- N2 = N+N
- DO 117 I=1,N2
- C(I) = CH(I)
- 117 CONTINUE
- RETURN
- END
-*
SUBROUTINE PASSB(NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA)
|