anchor.diff:        if (IFSET) 20,600,20
   20    MTT=MAX0(M(1),M(2),M(3))-2
         ROOT2=SQRT(2.)
  -      if (MTT-MT) 40,40,30
  -30    IFERR=1
  -      write(6,1000)
  -      stop
  - 1000 format(31H --- ERROR IN FOURIER TRANSFORM  )
  -40    IFERR=0
  +      if (MTT-MT .gt. 0) then
  +        IFERR=1
  +        write(6,1000)
  +        stop
  +1000    format(31H --- ERROR IN FOURIER TRANSFORM  )
  +      end if
  +      IFERR=0
   C     M1=M(1)
   C     M2=M(2)
   C     M3=M(3)
         N1=2**M1
         N2=2**M2
         N3=2**M3
  -      if (IFSET) 50,50,70
  -50    NX=N1*N2*N3
  -      FN=NX
  -      do 60 I=1,NX
  -      A(2*I-1)=A(2*I-1)/FN
  -60    A(2*I)=-A(2*I)/FN
  -70    NP(1)=N1*2
  +      if (IFSET .le. 0) then
  +        NX=N1*N2*N3
  +        FN=NX
  +        do I=1,NX
  +          A(2*I-1)=A(2*I-1)/FN
  +          A(2*I)=-A(2*I)/FN
  +        end do
  +      end if
  +      NP(1)=N1*2
         NP(2)=NP(1)*N2
         NP(3)=NP(2)*N3
         do 330 ID=1,3
  
positive.code: 420   JJD1=NTSQ/N1
        JJ3=1
        J=1
        do 570 JPP3=1,N3VNT
        IPP3=INV(JJ3)
        do 560 JP3=1,MINN3
        go to (430,440), IGO3
  430   IP3=INV(JP3)*N3VNT
        go to 450
  440   IP3=INV(JP3)/NTVN3
  450   I3=(IPP3+IP3)*N2
        JJ2=1
        do 560 JPP2=1,N2VNT
        IPP2=INV(JJ2)+I3
        do 550 JP2=1,MINN2
        go to (460,470), IGO2
  460   IP2=INV(JP2)*N2VNT
        go to 480
  470   IP2=INV(JP2)/NTVN2
  480   I2=(IPP2+IP2)*N1
        JJ1=1
        do 550 JPP1=1,N1VNT
        IPP1=INV(JJ1)+I2
        do 540 JP1=1,MINN1
        go to (490,500), IGO1
  490   IP1=INV(JP1)*N1VNT
        go to 510
  500   IP1=INV(JP1)/NTVN1
  510   I=2*(IPP1+IP1)+1
        if (J-I) 520,530,530
  520   T=A(I)
        A(I)=A(J)
        A(J)=T
        T=A(I+1)
        A(I+1)=A(J+1)
        A(J+1)=T
  530   continue
  540   J=J+2
  550   JJ1=JJ1+JJD1
  560   JJ2=JJ2+JJD2
  570   JJ3=JJ3+JJD3
        if (IFSET) 580,600,600
  580   do 590 I=1,NX
  590   A(2*I)=-A(2*I)
  600   return
        end
  C**********************************************
  
negative.code: C    ****************************************
        subroutine FFT (A,M,INV,S,IFSET,IFERR)
  C* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  C     TODO: Check dimensions on these arrays
        dimension A(1),INV(1),S(1),N(3),M(3),NP(3),W(2),W2(2),W3(2)
        equivalence (N1,N(1)), (N2,N(2)), (N3,N(3))
  
        M1=M(1)
        M2=M(2)
  