1 !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
4 ! Copyright (C) 1995-2004, Scientific Computing Division,
5 ! University Corporation for Atmospheric Research
6 ! Licensed under the GNU General Public License (GPL)
8 ! Authors: Paul N. Swarztrauber and Richard A. Valent
10 ! $Id: costf1.f,v 1.2 2004/06/15 21:14:57 rodney Exp $
12 !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
14 SUBROUTINE COSTF1(N,INC,X,WSAVE,WORK,IER)
15 REAL X(INC,*) ,WSAVE(*)
22 101 X1H = X(1,1)+X(1,2)
23 X(1,2) = .5*(X(1,1)-X(1,2))
26 102 IF (N .GT. 3) GO TO 103
29 X(1,2) = .5*(X(1,1)-X(1,3))
30 X(1,1) = .25*(X1P3+TX2)
31 X(1,3) = .25*(X1P3-TX2)
33 103 DSUM = X(1,1)-X(1,N)
34 X(1,1) = X(1,1)+X(1,N)
39 DSUM = DSUM+WSAVE(KC)*T2
45 IF (MODN .EQ. 0) GO TO 124
46 X(1,NS2+1) = X(1,NS2+1)+X(1,NS2+1)
47 124 LENX = INC*(NM1-1) + 1
48 LNSV = NM1 + INT(LOG(REAL(NM1))) + 4
51 CALL RFFT1F(NM1,INC,X,LENX,WSAVE(N+1),LNSV,WORK, &
55 CALL XERFFT ('COSTF1',-5)
61 IF(MOD(NM1,2) .NE. 0) GO TO 30
62 X(1,NM1) = X(1,NM1)+X(1,NM1)
69 IF (MODN .NE. 0) GO TO 117
71 117 X(1,1) = .5*X(1,1)