sinti.f 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. *DECK SINTI
  2. SUBROUTINE SINTI (N, WSAVE)
  3. C***BEGIN PROLOGUE SINTI
  4. C***PURPOSE Initialize a work array for SINT.
  5. C***LIBRARY SLATEC (FFTPACK)
  6. C***CATEGORY J1A3
  7. C***TYPE SINGLE PRECISION (SINTI-S)
  8. C***KEYWORDS FFTPACK, FOURIER TRANSFORM
  9. C***AUTHOR Swarztrauber, P. N., (NCAR)
  10. C***DESCRIPTION
  11. C
  12. C Subroutine SINTI initializes the array WSAVE which is used in
  13. C subroutine SINT. 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 sequence to be transformed. The method
  20. C is most efficient when N+1 is a product of small primes.
  21. C
  22. C Output Parameter
  23. C
  24. C WSAVE a work array with at least INT(3.5*N+16) locations.
  25. C Different WSAVE arrays are required for different values
  26. C of N. The contents of WSAVE must not be changed between
  27. C calls of SINT.
  28. C
  29. C***REFERENCES P. N. Swarztrauber, Vectorizing the FFTs, in Parallel
  30. C Computations (G. Rodrigue, ed.), Academic Press,
  31. C 1982, pp. 51-83.
  32. C***ROUTINES CALLED RFFTI
  33. C***REVISION HISTORY (YYMMDD)
  34. C 790601 DATE WRITTEN
  35. C 830401 Modified to use SLATEC library source file format.
  36. C 860115 Modified by Ron Boisvert to adhere to Fortran 77 by
  37. C (a) changing dummy array size declarations (1) to (*),
  38. C (b) changing references to intrinsic function FLOAT
  39. C to REAL, and
  40. C (c) changing definition of variable PI by using
  41. C FORTRAN intrinsic function ATAN instead of a DATA
  42. C statement.
  43. C 881128 Modified by Dick Valent to meet prologue standards.
  44. C 890531 Changed all specific intrinsics to generic. (WRB)
  45. C 890531 REVISION DATE from Version 3.2
  46. C 891214 Prologue converted to Version 4.0 format. (BAB)
  47. C 920501 Reformatted the REFERENCES section. (WRB)
  48. C***END PROLOGUE SINTI
  49. DIMENSION WSAVE(*)
  50. C***FIRST EXECUTABLE STATEMENT SINTI
  51. IF (N .LE. 1) RETURN
  52. PI = 4.*ATAN(1.)
  53. NP1 = N+1
  54. NS2 = N/2
  55. DT = PI/NP1
  56. KS = N+2
  57. KF = KS+NS2-1
  58. FK = 0.
  59. DO 101 K=KS,KF
  60. FK = FK+1.
  61. WSAVE(K) = 2.*SIN(FK*DT)
  62. 101 CONTINUE
  63. CALL RFFTI (NP1,WSAVE(KF+1))
  64. RETURN
  65. END