1 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
5 C Authors: Paul N. Swarztrauber and Richard A. Valent
9 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
11 SUBROUTINE COSTF1
(N
,INC
,X
,WSAVE
,WORK
,IER
)
12 REAL X
(INC
,*) ,WSAVE
(*)
19 101 X1H
= X
(1,1)+X
(1,2)
20 X
(1,2) = .5*(X
(1,1)-X
(1,2))
23 102 IF (N
.GT
. 3) GO TO 103
26 X
(1,2) = .5*(X
(1,1)-X
(1,3))
27 X
(1,1) = .25*(X1P3
+TX2
)
28 X
(1,3) = .25*(X1P3
-TX2
)
30 103 DSUM
= X
(1,1)-X
(1,N
)
31 X
(1,1) = X
(1,1)+X
(1,N
)
36 DSUM
= DSUM
+WSAVE
(KC
)*T2
42 IF (MODN
.EQ
. 0) GO TO 124
43 X
(1,NS2
+1) = X
(1,NS2
+1)+X
(1,NS2
+1)
44 124 LENX
= INC*
(NM1
-1) + 1
45 LNSV
= NM1
+ INT
(LOG
(REAL(NM1
))/LOG
(2.)) + 4
48 CALL RFFT1F
(NM1
,INC
,X
,LENX
,WSAVE
(N
+1),LNSV
,WORK
,
52 CALL XERFFT
('COSTF1',-5)
58 IF(MOD
(NM1
,2) .NE
. 0) GO TO 30
59 X
(1,NM1
) = X
(1,NM1
)+X
(1,NM1
)
66 IF (MODN
.NE
. 0) GO TO 117
68 117 X
(1,1) = .5*X
(1,1)