cosqi.f 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. *DECK COSQI
  2. SUBROUTINE COSQI (N, WSAVE)
  3. C***BEGIN PROLOGUE COSQI
  4. C***PURPOSE Initialize a work array for COSQF and COSQB.
  5. C***LIBRARY SLATEC (FFTPACK)
  6. C***CATEGORY J1A3
  7. C***TYPE SINGLE PRECISION (COSQI-S)
  8. C***KEYWORDS COSINE FOURIER TRANSFORM, FFTPACK
  9. C***AUTHOR Swarztrauber, P. N., (NCAR)
  10. C***DESCRIPTION
  11. C
  12. C Subroutine COSQI initializes the work array WSAVE which is used in
  13. C both COSQF1 and COSQB1. The prime factorization of N together with
  14. C a tabulation of the trigonometric functions are computed and
  15. C stored in WSAVE.
  16. C
  17. C Input Parameter
  18. C
  19. C N the length of the array to be transformed. The method
  20. C is most efficient when N is a product of small primes.
  21. C
  22. C Output Parameter
  23. C
  24. C WSAVE a work array which must be dimensioned at least 3*N+15.
  25. C The same work array can be used for both COSQF1 and COSQB1
  26. C as long as N remains unchanged. Different WSAVE arrays
  27. C are required for different values of N. The contents of
  28. C WSAVE must not be changed between calls of COSQF1 or COSQB1.
  29. C
  30. C***REFERENCES P. N. Swarztrauber, Vectorizing the FFTs, in Parallel
  31. C Computations (G. Rodrigue, ed.), Academic Press,
  32. C 1982, pp. 51-83.
  33. C***ROUTINES CALLED RFFTI
  34. C***REVISION HISTORY (YYMMDD)
  35. C 790601 DATE WRITTEN
  36. C 830401 Modified to use SLATEC library source file format.
  37. C 860115 Modified by Ron Boisvert to adhere to Fortran 77 by
  38. C (a) changing dummy array size declarations (1) to (*),
  39. C (b) changing references to intrinsic function FLOAT
  40. C to REAL, and
  41. C (c) changing definition of variable PIH by using
  42. C FORTRAN intrinsic function ATAN instead of a DATA
  43. C statement.
  44. C 881128 Modified by Dick Valent to meet prologue standards.
  45. C 890531 Changed all specific intrinsics to generic. (WRB)
  46. C 890531 REVISION DATE from Version 3.2
  47. C 891214 Prologue converted to Version 4.0 format. (BAB)
  48. C 920501 Reformatted the REFERENCES section. (WRB)
  49. C***END PROLOGUE COSQI
  50. DIMENSION WSAVE(*)
  51. C***FIRST EXECUTABLE STATEMENT COSQI
  52. PIH = 2.*ATAN(1.)
  53. DT = PIH/N
  54. FK = 0.
  55. DO 101 K=1,N
  56. FK = FK+1.
  57. WSAVE(K) = COS(FK*DT)
  58. 101 CONTINUE
  59. CALL RFFTI (N,WSAVE(N+1))
  60. RETURN
  61. END