************************************************************************
      SUBROUTINE FTSMPR(N,IT,T)
 
      IMPLICIT REAL  (A-H,O-Z)
      DIMENSION IT(5),T(0:N-1,12)

      DATA PI/3.1415926535897932385D0/

      CALL FTRLPR(N,IT,T)
 
      N2=N*2
      N4=N*4
 
      DO 10 I=0,N-1
      T(I,5)=COS(2*PI*(2*I+1)/N4)
      T(I,6)=SIN(2*PI*(2*I+1)/N4)
      T(I,7)=COS(PI*I/N2)
      T(I,8)=SIN(PI*I/N2)
      T(I,9)=SIN(PI*(4*I+1)/N4)
      T(I,10)=SIN(PI*(4*I+3)/N4)
      T(I,11)=1/T(I,9)
      T(I,12)=1/T(I,10)
   10 CONTINUE
 
      END
************************************************************************
      SUBROUTINE FTSMMN(X,Y,M,N,IT,T,ISN)
 
      IMPLICIT REAL  (A-H,O-Z)
      DIMENSION IT(5),T(0:N-1,12)
      DIMENSION X(M,0:2*N-1),Y(M,0:N-1,2)
 
      N2=N*2

      IF(ISN.EQ.1) THEN
 
      DO 10 J=0,N-1
      J1=2*J
      J2=N2-1-J1
      J3=2*J+1
      J4=N2-1-J3
      DO 10 I=1,M
      Y(I,J,1)=-(X(I,J1)-X(I,J2))+2*T(J,9 )*(X(I,J1)+X(I,J2))
      Y(I,J,2)=-(X(I,J3)-X(I,J4))+2*T(J,10)*(X(I,J3)+X(I,J4))
   10 CONTINUE

      CALL FTRLFW(Y,X,M,N,N,IT,T)
 
      DO 20 I=1,M
      X(I,0)=0.5D0*Y(I,0,1)
      X(I,2*N-1)=-Y(I,0,2)
   20 CONTINUE
 
      DO 30 J=1,N-1
      DO 30 I=1,M
      X(I,2*J-1)=T(J,7)*Y(I,J,2)-T(J,8)*Y(I,J,1)
      X(I,2*J)=X(I,2*J-2)+T(J,7)*Y(I,J,1)+T(J,8)*Y(I,J,2)
   30 CONTINUE

      ELSE

      DO 40 I=1,M
      Y(I,0,1)=2*X(I,0)
      Y(I,0,2)=-X(I,2*N-1)
   40 CONTINUE
 
      DO 50 J=1,N-1
      DO 50 I=1,M
      Y(I,J,1)=(X(I,2*J)-X(I,2*J-2))*T(J,7)-T(J,8)*X(I,2*J-1)
      Y(I,J,2)=(X(I,2*J)-X(I,2*J-2))*T(J,8)+T(J,7)*X(I,2*J-1)
   50 CONTINUE
      
      CALL FTRLBW(Y,X,M,N,N,IT,T)

      DO 60 J=0,N-1
      DO 60 I=1,M
      X(I,2*J  )=-0.25D0*(Y(I,J,1)-Y(I,N-1-J,2))
     &          +0.125D0*(Y(I,J,1)+Y(I,N-1-J,2))*T(J,11)
      X(I,2*J+1)=-0.25D0*(Y(I,J,2)-Y(I,N-1-J,1))
     &          +0.125D0*(Y(I,J,2)+Y(I,N-1-J,1))*T(J,12)
   60 CONTINUE
      
      END IF

      END
