subroutine nvcft2(a,ld,m,n,isens,table,work) implicit none integer ld,m,n real a(0:ld-1,0:n-1) real table(100+2*(m+n)) real work(512*max(m,n)) integer isens integer mm,nn save mm,nn data mm/0/,nn/0/ real scale integer n2 integer j if ( (isens.ne.0) .and. ( (mm.ne.m) .or. (nn.ne.n) ) ) then print *,'Les dimensions ont change' print *,'Il faut reinitialiser les FFT' print *,'Arret immediat' stop end if if (isens.eq.1) then * Preparation du tableau (reconstitution redondance) * 1. Traitement des termes reels a(m,0) = a(1,0) a(1,0) = 0. a(m+1,0) = 0. a(m,n/2) = a(1,n/2) a(1,n/2) = 0. a(m+1,n/2) = 0. * 2. Traitement demi-lignes finales m et m+1 (d'apres d.l. 0 et 1) do j=n/2+1,n-1 a(m,j) = a(0,j) a(m+1,j) = a(1,j) end do * 3. Traitement demi-lignes debut 0,1 m et m+1 (par sym. hermitienne) n2 = n/2-1 CDIR$ IVDEP do j=1,n2 a(0,n-j) = a(0,j) a(1,n-j) = - a(1,j) a(m,j) = a(m,n-j) a(m+1,j) = - a(m+1,n-j) end do * Fin reconstitution call csfft2d(+1,m,n,1.0,a,ld/2,a,ld,table,work,0) else if (isens.eq.-1) then scale = 1. / real(m*n) call scfft2d(-1,m,n,scale,a,ld,a,ld/2,table,work,0) * On compacte * 1. On bouche les trous (a(1,0) et a(1,n/2) contenaient des 0) a(1,0) = a(m,0) a(1,n/2) = a(m,n/2) * 2. On profite lachement de la symetrie hermitienne pour tasser do j=n/2+1,n-1 a(0,j) = a(m ,j) a(1,j) = a(m+1,j) end do else if (isens.eq.0) then call scfft2d( 0,m,n,scale,a,ld,a,ld/2,table,work,0) mm = m nn = n else print *,'Erreur. Valeur de ISENS erronnee : ',isens print *,'Arret immediat' stop end if end