NCEPLIBS-sp  2.3.3
spffte.f
Go to the documentation of this file.
1 C> @file
2 C>
3 C> Perform multiple fast fourier transforms
4 C> @author IREDELL @date 96-02-20
5 
6 C> This subprogram performs multiple fast fourier transforms
7 C> between complex amplitudes in fourier space and real values
8 C> in cyclic physical space.
9 C> Subprogram SPFFTE must be invoked first with IDIR=0
10 C> to initialize trigonemetric data. use subprogram SPFFT1
11 C> to perform an fft without previous initialization.
12 C> This version invokes the ibm essl fft.
13 C>
14 C> PROGRAM HISTORY LOG:
15 C> - 1998-12-18 IREDELL
16 C> - 2012-11-12 MIRVIS -fixing hard-wired types problem on Intel/Linux
17 C>
18 C> @param IMAX - INTEGER NUMBER OF VALUES IN THE CYCLIC PHYSICAL SPACE
19 C> (SEE LIMITATIONS ON IMAX IN REMARKS BELOW.)
20 C> @param INCW - INTEGER FIRST DIMENSION OF THE COMPLEX AMPLITUDE ARRAY
21 C> (INCW >= IMAX/2+1)
22 C> @param INCG - INTEGER FIRST DIMENSION OF THE REAL VALUE ARRAY
23 C> (INCG >= IMAX)
24 C> @param KMAX - INTEGER NUMBER OF TRANSFORMS TO PERFORM
25 C> @param[out] W - COMPLEX(INCW,KMAX) COMPLEX AMPLITUDES IF IDIR>0
26 C> @param[out] G - REAL(INCG,KMAX) REAL VALUES IF IDIR<0
27 C> @param IDIR - INTEGER DIRECTION FLAG
28 C> - IDIR=0 TO INITIALIZE TRIGONOMETRIC DATA
29 C> - IDIR>0 TO TRANSFORM FROM FOURIER TO PHYSICAL SPACE
30 C> - IDIR<0 TO TRANSFORM FROM PHYSICAL TO FOURIER SPACE
31 C> @param[out] AFFT REAL(8) (50000+4*IMAX) AUXILIARY ARRAY IF IDIR<>0
32 C>
33 C> SUBPROGRAMS CALLED:
34 C> -scrft() IBM ESSL COMPLEX TO REAL FOURIER TRANSFORM
35 C> -dcrft() IBM ESSL COMPLEX TO REAL FOURIER TRANSFORM
36 C> -srcft() IBM ESSL REAL TO COMPLEX FOURIER TRANSFORM
37 C> -drcft() IBM ESSL REAL TO COMPLEX FOURIER TRANSFORM
38 C>
39 C> @note The restrictions on IMAX are that it must be a multiple
40 C> of 1 to 25 factors of two, up to 2 factors of three,
41 C> and up to 1 factor of five, seven and eleven.
42 C>
43 C> If IDIR=0, then W and G need not contain any valid data.
44 C> The other parameters must be supplied and cannot change
45 C> in succeeding calls until the next time it is called with IDIR=0.
46 C>
47 C> This subprogram is thread-safe.
48 C>
49  SUBROUTINE spffte(IMAX,INCW,INCG,KMAX,W,G,IDIR,AFFT)
50  IMPLICIT NONE
51  INTEGER,INTENT(IN):: IMAX,INCW,INCG,KMAX,IDIR
52  REAL,INTENT(INOUT):: W(2*INCW,KMAX)
53  REAL,INTENT(INOUT):: G(INCG,KMAX)
54  REAL(8),INTENT(INOUT):: AFFT(50000+4*IMAX)
55  INTEGER:: INIT,INC2X,INC2Y,N,M,ISIGN,NAUX1,NAUX2,NAUX3
56 C ==EM== ^(4)
57  REAL:: SCALE
58  REAL(8):: AUX2(20000+2*IMAX),AUX3
59  INTEGER:: IACR,IARC
60 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
61  naux1=25000+2*imax
62  naux2=20000+2*imax
63  naux3=1
64  iacr=1
65  iarc=1+naux1
66 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
67 C INITIALIZATION.
68 C FILL AUXILIARY ARRAYS WITH TRIGONOMETRIC DATA
69  SELECT CASE(idir)
70  CASE(0)
71  init=1
72  inc2x=incw
73  inc2y=incg
74  n=imax
75  m=kmax
76  isign=-1
77  scale=1.
78  IF(digits(1.).LT.digits(1._8)) THEN
79  CALL scrft(init,w,inc2x,g,inc2y,n,m,isign,scale,
80  & afft(iacr),naux1,aux2,naux2,aux3,naux3)
81  ELSE
82  CALL dcrft(init,w,inc2x,g,inc2y,n,m,isign,scale,
83  & afft(iacr),naux1,aux2,naux2)
84  ENDIF
85  init=1
86  inc2x=incg
87  inc2y=incw
88  n=imax
89  m=kmax
90  isign=+1
91  scale=1./imax
92  IF(digits(1.).LT.digits(1._8)) THEN
93  CALL srcft(init,g,inc2x,w,inc2y,n,m,isign,scale,
94  & afft(iarc),naux1,aux2,naux2,aux3,naux3)
95  ELSE
96  CALL drcft(init,g,inc2x,w,inc2y,n,m,isign,scale,
97  & afft(iarc),naux1,aux2,naux2)
98  ENDIF
99 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
100 C FOURIER TO PHYSICAL TRANSFORM.
101  CASE(1:)
102  init=0
103  inc2x=incw
104  inc2y=incg
105  n=imax
106  m=kmax
107  isign=-1
108  scale=1.
109  IF(digits(1.).LT.digits(1._8)) THEN
110  CALL scrft(init,w,inc2x,g,inc2y,n,m,isign,scale,
111  & afft(iacr),naux1,aux2,naux2,aux3,naux3)
112  ELSE
113  CALL dcrft(init,w,inc2x,g,inc2y,n,m,isign,scale,
114  & afft(iacr),naux1,aux2,naux2)
115  ENDIF
116 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
117 C PHYSICAL TO FOURIER TRANSFORM.
118  CASE(:-1)
119  init=0
120  inc2x=incg
121  inc2y=incw
122  n=imax
123  m=kmax
124  isign=+1
125  scale=1./imax
126  IF(digits(1.).LT.digits(1._8)) THEN
127  CALL srcft(init,g,inc2x,w,inc2y,n,m,isign,scale,
128  & afft(iarc),naux1,aux2,naux2,aux3,naux3)
129  ELSE
130  CALL drcft(init,g,inc2x,w,inc2y,n,m,isign,scale,
131  & afft(iarc),naux1,aux2,naux2)
132  ENDIF
133  END SELECT
134  END SUBROUTINE
spffte
subroutine spffte(IMAX, INCW, INCG, KMAX, W, G, IDIR, AFFT)
This subprogram performs multiple fast fourier transforms between complex amplitudes in fourier space...
Definition: spffte.f:50