Index: LMDZ6/branches/Amaury_dev/libf/filtrez/acc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/acc.f90	(revision 5106)
+++ 	(revision )
@@ -1,22 +1,0 @@
-
-! $Header$
-
-  SUBROUTINE acc(vec,d,im)
-    implicit none
-    integer :: im
-    real :: vec(im,im),d(im)
-    integer :: i,j
-    real ::sum
-    real,external :: ssum
-    do j=1,im
-      do i=1,im
-        d(i)=vec(i,j)*vec(i,j)
-      enddo
-      sum=ssum(im,d,1)
-      sum=sqrt(sum)
-      do i=1,im
-        vec(i,j)=vec(i,j)/sum
-      enddo
-    enddo
-    return
-end subroutine acc
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/eigen.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/eigen.f90	(revision 5106)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/eigen.f90	(revision 5107)
@@ -1,4 +1,3 @@
-
-! $Header$
+! Amaury: code de <=2004 utilisé nulle part, pas de trace dans la recherche TRAC
 
 SUBROUTINE eigen( e,d)
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/eigen_sort.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/eigen_sort.f90	(revision 5106)
+++ 	(revision )
@@ -1,32 +1,0 @@
-
-! $Header$
-
-    SUBROUTINE eigen_sort(d,v,n,np)
-      INTEGER :: n,np
-      REAL :: d(np),v(np,np)
-      INTEGER :: i,j,k
-      REAL :: p
-
-   DO i=1,n-1
-      k=i
-      p=d(i)
-    DO j=i+1,n
-       IF(d(j)>=p) THEN
-        k=j
-        p=d(j)
-       ENDIF
-    ENDDO
-
-    IF(k/=i) THEN
-      d(k)=d(i)
-      d(i)=p
-     DO j=1,n
-      p=v(j,i)
-      v(j,i)=v(j,k)
-      v(j,k)=p
-     ENDDO
-    ENDIF
-   ENDDO
-
-    RETURN
-END SUBROUTINE eigen_sort
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/inifgn.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/inifgn.f90	(revision 5106)
+++ 	(revision )
@@ -1,99 +1,0 @@
-! $Header: /home/cvsroot/LMDZ4/libf/filtrez/inifgn.F,v 1.1.1.1 2004-05-19 12:53:09 lmdzadmin Exp $
-
-SUBROUTINE inifgn(dv)
-  !
-  !    ...  H.Upadyaya , O.Sharma  ...
-  !
-  USE lmdz_coefils, ONLY: sddv, sddu, unsddu, unsddv, eignfnv, eignfnu
-  IMPLICIT NONE
-  !
-  include "dimensions.h"
-  include "paramet.h"
-  include "comgeom.h"
-  !
-  REAL :: vec(iim, iim), vec1(iim, iim)
-  REAL :: dlonu(iim), dlonv(iim)
-  REAL :: du(iim), dv(iim), d(iim)
-  REAL :: pi
-  INTEGER :: i, j, k, imm1, nrot
-  EXTERNAL SSUM, acc, eigen, jacobi
-  REAL :: SSUM
-  !
-
-  imm1 = iim - 1
-  pi = 2. * ASIN(1.)
-  !
-  DO i = 1, iim
-    dlonu(i) = xprimu(i)
-    dlonv(i) = xprimv(i)
-  END DO
-
-  DO i = 1, iim
-    sddv(i) = SQRT(dlonv(i))
-    sddu(i) = SQRT(dlonu(i))
-    unsddu(i) = 1. / sddu(i)
-    unsddv(i) = 1. / sddv(i)
-  END DO
-  !
-  DO j = 1, iim
-    DO i = 1, iim
-      vec(i, j) = 0.
-      vec1(i, j) = 0.
-      eignfnv(i, j) = 0.
-      eignfnu(i, j) = 0.
-    END DO
-  END DO
-  !
-  !
-  eignfnv(1, 1) = -1.
-  eignfnv(iim, 1) = 1.
-  DO i = 1, imm1
-    eignfnv(i + 1, i + 1) = -1.
-    eignfnv(i, i + 1) = 1.
-  END DO
-  DO j = 1, iim
-    DO i = 1, iim
-      eignfnv(i, j) = eignfnv(i, j) / (sddu(i) * sddv(j))
-    END DO
-  END DO
-  DO j = 1, iim
-    DO i = 1, iim
-      eignfnu(i, j) = -eignfnv(j, i)
-    END DO
-  END DO
-  !
-  DO j = 1, iim
-    DO i = 1, iim
-      vec (i, j) = 0.0
-      vec1(i, j) = 0.0
-      DO k = 1, iim
-        vec (i, j) = vec(i, j) + eignfnu(i, k) * eignfnv(k, j)
-        vec1(i, j) = vec1(i, j) + eignfnv(i, k) * eignfnu(k, j)
-      ENDDO
-    ENDDO
-  ENDDO
-
-  !
-  CALL jacobi(vec, iim, iim, dv, eignfnv, nrot)
-  CALL acc(eignfnv, d, iim)
-  CALL eigen_sort(dv, eignfnv, iim, iim)
-  !
-  CALL jacobi(vec1, iim, iim, du, eignfnu, nrot)
-  CALL acc(eignfnu, d, iim)
-  CALL eigen_sort(du, eignfnu, iim, iim)
-
-  !c   ancienne version avec appels IMSL
-  !
-  ! CALL MXM(eignfnu,iim,eignfnv,iim,vec,iim)
-  ! CALL MXM(eignfnv,iim,eignfnu,iim,vec1,iim)
-  !     CALL EVCSF(iim,vec,iim,dv,eignfnv,iim)
-  ! CALL acc(eignfnv,d,iim)
-  ! CALL eigen(eignfnv,dv)
-  !
-  ! CALL EVCSF(iim,vec1,iim,du,eignfnu,iim)
-  ! CALL acc(eignfnu,d,iim)
-  ! CALL eigen(eignfnu,du)
-
-  RETURN
-END SUBROUTINE inifgn
-
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/jacobi.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/jacobi.F90	(revision 5106)
+++ 	(revision )
@@ -1,106 +1,0 @@
-
-! $Id$
-
-      SUBROUTINE JACOBI(A,N,NP,D,V,NROT)
-      implicit none
-! Arguments:
-      integer,intent(in) :: N
-      integer,intent(in) :: NP
-      integer,intent(out) :: NROT
-      real,intent(inout) :: A(NP,NP)
-      real,intent(out) :: D(NP)
-      real,intent(out) :: V(NP,NP)
-
-! local variables:
-      integer :: IP,IQ,I,J
-      real :: SM,TRESH,G,H,T,THETA,C,S,TAU
-      real :: B(N)
-      real :: Z(N)
-      
-      DO IP=1,N
-        DO IQ=1,N
-          V(IP,IQ)=0.
-        ENDDO
-        V(IP,IP)=1.
-      ENDDO
-      DO IP=1,N
-        B(IP)=A(IP,IP)
-        D(IP)=B(IP)
-        Z(IP)=0.
-      ENDDO
-      NROT=0
-      DO I=1,50 ! 50? I suspect this should be NP
-                !     but convergence is fast enough anyway
-        SM=0.
-        DO IP=1,N-1
-          DO IQ=IP+1,N
-            SM=SM+ABS(A(IP,IQ))
-          ENDDO
-        ENDDO
-        IF(SM==0.)RETURN
-        IF(I<4)THEN
-          TRESH=0.2*SM/N**2
-        ELSE
-          TRESH=0.
-        ENDIF
-        DO IP=1,N-1
-          DO IQ=IP+1,N
-            G=100.*ABS(A(IP,IQ))
-            IF((I>4).AND.(ABS(D(IP))+G==ABS(D(IP))) &
-               .AND.(ABS(D(IQ))+G==ABS(D(IQ))))THEN
-              A(IP,IQ)=0.
-            ELSE IF(ABS(A(IP,IQ))>TRESH)THEN
-              H=D(IQ)-D(IP)
-              IF(ABS(H)+G==ABS(H))THEN
-                T=A(IP,IQ)/H
-              ELSE
-                THETA=0.5*H/A(IP,IQ)
-                T=1./(ABS(THETA)+SQRT(1.+THETA**2))
-                IF(THETA<0.)T=-T
-              ENDIF
-              C=1./SQRT(1+T**2)
-              S=T*C
-              TAU=S/(1.+C)
-              H=T*A(IP,IQ)
-              Z(IP)=Z(IP)-H
-              Z(IQ)=Z(IQ)+H
-              D(IP)=D(IP)-H
-              D(IQ)=D(IQ)+H
-              A(IP,IQ)=0.
-              DO J=1,IP-1
-                G=A(J,IP)
-                H=A(J,IQ)
-                A(J,IP)=G-S*(H+G*TAU)
-                A(J,IQ)=H+S*(G-H*TAU)
-             ENDDO
-              DO J=IP+1,IQ-1
-                G=A(IP,J)
-                H=A(J,IQ)
-                A(IP,J)=G-S*(H+G*TAU)
-                A(J,IQ)=H+S*(G-H*TAU)
-              ENDDO
-              DO J=IQ+1,N
-                G=A(IP,J)
-                H=A(IQ,J)
-                A(IP,J)=G-S*(H+G*TAU)
-                A(IQ,J)=H+S*(G-H*TAU)
-              ENDDO
-              DO J=1,N
-                G=V(J,IP)
-                H=V(J,IQ)
-                V(J,IP)=G-S*(H+G*TAU)
-                V(J,IQ)=H+S*(G-H*TAU)
-              ENDDO
-              NROT=NROT+1
-            ENDIF
-          ENDDO
-        ENDDO
-        DO IP=1,N
-          B(IP)=B(IP)+Z(IP)
-          D(IP)=B(IP)
-          Z(IP)=0.
-        ENDDO
-      ENDDO ! of DO I=1,50
-      STOP 'Jacobi: 50 iterations should never happen'
-
-      END SUBROUTINE JACOBI
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft.F90	(revision 5107)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft.F90	(revision 5107)
@@ -0,0 +1,17 @@
+MODULE lmdz_fft
+
+#ifdef FFT_MATHKEISAN
+  USE lmdz_fft_mathkeisan
+#else
+#ifdef FFT_FFTW
+  USE lmdz_fft_fftw
+#else
+#ifdef FFT_MKL
+  USE lmdz_fft_mkl
+#else
+  USE lmdz_fft_wrapper
+#endif
+#endif
+#endif
+
+END MODULE lmdz_fft
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft_fftw.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft_fftw.F90	(revision 5107)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft_fftw.F90	(revision 5107)
@@ -0,0 +1,113 @@
+
+! $Id$
+
+MODULE lmdz_fft_fftw
+
+#ifdef FFT_FFTW
+
+  REAL, SAVE                   :: scale_factor
+  INTEGER, SAVE                :: vsize
+  INTEGER, PARAMETER           :: inc=1
+  
+  INTEGER*8, ALLOCATABLE, DIMENSION(:), SAVE :: plan_forward
+  INTEGER*8, ALLOCATABLE, DIMENSION(:), SAVE :: plan_backward
+  
+CONTAINS
+  
+  SUBROUTINE Init_fft(iim,nvectmax)
+  IMPLICIT NONE
+#include <fftw3.f>
+    INTEGER :: iim
+    INTEGER :: nvectmax
+
+    INTEGER :: itmp
+
+    INTEGER               :: rank
+    INTEGER               :: howmany
+    INTEGER               :: istride, idist
+    INTEGER               :: ostride, odist
+    INTEGER, DIMENSION(1) :: n_array, inembed, onembed
+
+    REAL,    DIMENSION(iim+1,nvectmax) :: dbidon
+    COMPLEX, DIMENSION(iim/2+1,nvectmax) :: cbidon
+
+    vsize = iim
+    scale_factor = 1./SQRT(1.*vsize)
+
+    dbidon = 0
+    cbidon = 0
+
+    ALLOCATE(plan_forward(nvectmax))
+    ALLOCATE(plan_backward(nvectmax))
+    
+    WRITE(*,*)"!---------------------!"
+    WRITE(*,*)"!                     !"
+    WRITE(*,*)"! INITIALISATION FFTW !"
+    WRITE(*,*)"!                     !"
+    WRITE(*,*)"!---------------------!"
+    
+! On initialise tous les plans 
+    DO itmp = 1, nvectmax
+       rank       = 1
+       n_array(1) = iim
+       howmany    = itmp
+       inembed(1) = iim + 1 ; onembed(1) = iim/2 + 1
+       istride    = 1       ; ostride    = 1
+       idist      = iim + 1 ; odist      = iim/2 + 1
+
+       CALL dfftw_plan_many_dft_r2c(plan_forward(itmp), rank, n_array, howmany, &
+   dbidon, inembed, istride, idist, &
+   cbidon, onembed, ostride, odist, &
+   FFTW_ESTIMATE)
+
+       rank       = 1
+       n_array(1) = iim
+       howmany    = itmp
+       inembed(1) = iim/2 + 1 ; onembed(1) = iim + 1
+       istride    = 1         ; ostride    = 1
+       idist      = iim/2 + 1 ; odist      = iim + 1
+       CALL dfftw_plan_many_dft_c2r(plan_backward(itmp), rank, n_array, howmany, &
+   cbidon, inembed, istride, idist, &
+   dbidon, onembed, ostride, odist, &
+   FFTW_ESTIMATE)
+
+    ENDDO
+
+    WRITE(*,*)"!-------------------------!"
+    WRITE(*,*)"!                         !"
+    WRITE(*,*)"! FIN INITIALISATION FFTW !"
+    WRITE(*,*)"!                         !"
+    WRITE(*,*)"!-------------------------!"
+
+  END SUBROUTINE Init_fft
+  
+  
+  SUBROUTINE fft_forward(vect,TF_vect,nb_vect)
+    IMPLICIT NONE
+#include <fftw3.f>
+    INTEGER,INTENT(IN)     :: nb_vect
+    REAL,INTENT(IN)        :: vect(vsize+inc,nb_vect)
+    COMPLEX,INTENT(OUT) :: TF_vect(vsize/2+1,nb_vect)
+
+    CALL dfftw_execute_dft_r2c(plan_forward(nb_vect),vect,TF_vect)
+
+    TF_vect = scale_factor * TF_vect
+
+  END SUBROUTINE fft_forward
+  
+  SUBROUTINE fft_backward(TF_vect,vect,nb_vect)
+    IMPLICIT NONE
+#include <fftw3.f>
+    INTEGER,INTENT(IN)     :: nb_vect
+    REAL,INTENT(OUT)       :: vect(vsize+inc,nb_vect)
+    COMPLEX,INTENT(IN ) :: TF_vect(vsize/2+1,nb_vect)
+
+    CALL dfftw_execute_dft_c2r(plan_backward(nb_vect),TF_vect,vect)
+
+    vect = scale_factor * vect
+
+  END SUBROUTINE fft_backward
+
+#endif
+  
+END MODULE lmdz_fft_fftw
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft_mathkeisan.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft_mathkeisan.F90	(revision 5107)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft_mathkeisan.F90	(revision 5107)
@@ -0,0 +1,67 @@
+MODULE lmdz_fft_mathkeisan
+#ifdef FFT_MATHKEISAN
+
+  REAL,SAVE,ALLOCATABLE    :: Table_forward(:)
+  REAL,SAVE,ALLOCATABLE    :: Table_backward(:)
+  REAL,SAVE                :: scale_factor
+  INTEGER,SAVE             :: vsize
+  INTEGER,PARAMETER        :: inc=2
+
+CONTAINS
+  
+  SUBROUTINE Init_fft(iim,nb_vect_max)
+  IMPLICIT NONE
+    INTEGER :: iim
+    INTEGER :: nb_vect_max
+    REAL    :: rtmp=1.
+    COMPLEX :: ctmp
+    INTEGER :: itmp=1
+    INTEGER :: isign=0
+    INTEGER :: ierr
+    
+    vsize=iim
+    scale_factor=1./SQRT(1.*vsize)
+    ALLOCATE(Table_forward(2*vsize+64))
+    ALLOCATE(Table_backward(2*vsize+64))
+    
+    CALL DZFFTM(isign,vsize,itmp,scale_factor,rtmp,vsize+inc,ctmp,vsize/2+1,table_forward,rtmp,ierr)
+    
+    CALL ZDFFTM(isign,vsize,itmp,scale_factor,ctmp,vsize/2+1,rtmp,vsize+inc,table_backward,rtmp,ierr)
+
+    
+  END SUBROUTINE Init_fft
+  
+  
+  SUBROUTINE fft_forward(vect,TF_vect,nb_vect)
+    IMPLICIT NONE
+    INTEGER,INTENT(IN)  :: nb_vect
+    REAL,INTENT(IN)     :: vect(vsize+inc,nb_vect)
+    COMPLEX,INTENT(OUT) :: TF_vect(vsize/2+1,nb_vect)
+    REAL                :: work(4*vsize*nb_vect)
+    INTEGER             :: ierr
+    INTEGER, PARAMETER :: isign=-1
+    
+    work=0
+    CALL DZFFTM(isign,vsize,nb_vect,scale_factor,vect,vsize+inc,TF_vect,vsize/2+1,table_forward,work,ierr)
+  
+  END SUBROUTINE fft_forward
+  
+  SUBROUTINE fft_backward(TF_vect,vect,nb_vect)
+    IMPLICIT NONE
+    INTEGER,INTENT(IN)  :: nb_vect
+    REAL,INTENT(OUT)    :: vect(vsize+inc,nb_vect)
+    COMPLEX,INTENT(IN ) :: TF_vect(vsize/2+1,nb_vect)
+    REAL                :: work(4*vsize*nb_vect)
+    INTEGER             :: ierr
+    INTEGER, PARAMETER :: isign=1
+    
+    work(:)=0
+    CALL ZDFFTM(isign,vsize,nb_vect,scale_factor,TF_vect,vsize/2+1,vect,vsize+inc,table_backward,work,ierr)
+  
+  END SUBROUTINE fft_backward
+
+#endif
+  
+END MODULE lmdz_fft_mathkeisan
+
+
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft_mkl.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft_mkl.F90	(revision 5107)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft_mkl.F90	(revision 5107)
@@ -0,0 +1,128 @@
+MODULE lmdz_fft_mkl
+#ifdef FFT_MKL
+
+  USE lmdz_mkl_dfti
+  
+  REAL,SAVE                :: scale_factor
+  INTEGER,SAVE             :: vsize
+  INTEGER,PARAMETER        :: inc=1
+ 
+!  TYPE FFT_HANDLE
+!    TYPE(DFTI_DESCRIPTOR), POINTER :: Pt
+!    LOGICAL :: IsAllocated
+!  END TYPE FFT_HANDLE
+  
+!  TYPE(FFT_HANDLE),SAVE,ALLOCATABLE :: Forward_Handle(:)
+!  TYPE(FFT_HANDLE),SAVE,ALLOCATABLE :: Backward_Handle(:)
+!!$OMP THREADPRIVATE(Forward_Handle,Backward_Handle)  
+  
+CONTAINS
+  
+  SUBROUTINE Init_fft(iim,nb_vect_max)
+    IMPLICIT NONE
+    INTEGER :: iim
+    INTEGER :: nb_vect_max
+    REAL    :: rtmp=1.
+    COMPLEX :: ctmp
+    INTEGER :: itmp=1
+    INTEGER :: isign=0
+    INTEGER :: ierr
+    
+    vsize=iim
+    scale_factor=1./SQRT(1.*vsize)
+!    ALLOCATE(Forward_Handle(nb_vect_max))
+!    ALLOCATE(Backward_Handle(nb_vect_max))
+    
+!    Forward_Handle(:)%IsAllocated=.FALSE.
+!    Backward_Handle(:)%IsAllocated=.FALSE.
+    
+!    ALLOCATE(Table_forward(2*vsize+64))
+!    ALLOCATE(Table_backward(2*vsize+64))
+
+!    CALL DZFFTM(isign,vsize,itmp,scale_factor,rtmp,vsize+inc,ctmp,vsize/2+1,table_forward,rtmp,ierr)
+
+!    CALL ZDFFTM(isign,vsize,itmp,scale_factor,ctmp,vsize/2+1,rtmp,vsize+inc,table_backward,rtmp,ierr)
+
+!    ierr = DftiCreateDescriptor( FFT_Handle, DFTI_DOUBLE, DFTI_REAL, 1, vsize )
+!    ierr = DftiSetValue(FFT_Handle,DFTI_NUMBER_OF_TRANSFORMS,nb_vect)
+!    ierr = DftiSetValue(FFT_Handle,DFTI_FORWARD_SCALE,scale_factor)
+!    ierr = DftiSetValue(FFT_Handle,DFTI_BACKWARD_SCALE,scale_factor)
+!    ierr = DftiSetValue(FFT_Handle,DFTI_PLACEMENT,DFTI_NOT_INPLACE)
+!    ierr = DftiSetValue(Desc_Handle, DFTI_INPUT_DISTANCE, vsize+inc)
+!    ierr = DftiSetValue(Desc_Handle, DFTI_OUTPUT_DISTANCE, vsize)
+!    ierr = DftiCommitDescriptor( FFT_HANDLE )
+
+  END SUBROUTINE Init_fft
+  
+  
+  SUBROUTINE fft_forward(vect,TF_vect,nb_vect)
+    IMPLICIT NONE
+    INTEGER,INTENT(IN)  :: nb_vect
+    REAL,INTENT(IN)     :: vect((vsize+inc)*nb_vect)
+    COMPLEX,INTENT(OUT) :: TF_vect((vsize/2+1)*nb_vect)
+    REAL                :: work(4*vsize*nb_vect)
+    INTEGER             :: ierr
+    INTEGER, PARAMETER :: isign=-1
+    REAL               :: vect_out((vsize+inc)*nb_vect)
+    TYPE(DFTI_DESCRIPTOR), POINTER :: FFT_Handle
+    
+!    IF ( .NOT. Forward_handle(nb_vect)%IsAllocated) THEN
+      ierr = DftiCreateDescriptor( FFT_Handle, DFTI_DOUBLE, DFTI_REAL, 1, vsize )
+      ierr = DftiSetValue(FFT_Handle,DFTI_NUMBER_OF_TRANSFORMS,nb_vect)
+      ierr = DftiSetValue(FFT_Handle,DFTI_FORWARD_SCALE,scale_factor)
+      ierr = DftiSetValue(FFT_Handle,DFTI_BACKWARD_SCALE,scale_factor)
+      ierr = DftiSetValue(FFT_Handle,DFTI_PLACEMENT,DFTI_NOT_INPLACE)
+      ierr = DftiSetValue(FFT_Handle, DFTI_INPUT_DISTANCE, vsize+inc)
+      ierr = DftiSetValue(FFT_Handle, DFTI_OUTPUT_DISTANCE, (vsize/2+1)*2)
+      ierr = DftiCommitDescriptor( FFT_Handle )
+!      Forward_handle(nb_vect)%IsAllocated=.TRUE.
+!    ENDIF
+    
+    ierr = DftiComputeForward( FFT_Handle, vect, TF_vect )
+
+    ierr = DftiFreeDescriptor( FFT_Handle )
+
+!    ierr = DftiCreateDescriptor( FFT_Handle, DFTI_DOUBLE, DFTI_REAL, 1, vsize )
+!    ierr = DftiSetValue(FFT_Handle,DFTI_NUMBER_OF_TRANSFORMS,nb_vect)
+!    ierr = DftiSetValue(FFT_Handle,DFTI_FORWARD_SCALE,scale_factor)
+!    ierr = DftiSetValue(FFT_Handle,DFTI_BACKWARD_SCALE,scale_factor)
+!    ierr = DftiSetValue(FFT_Handle,DFTI_PLACEMENT,DFTI_NOT_INPLACE)
+!    ierr = DftiSetValue(FFT_HANDLE, DFTI_INPUT_DISTANCE, vsize/2+1)
+!    ierr = DftiSetValue(FFT_HANDLE, DFTI_OUTPUT_DISTANCE, vsize+inc)
+!    ierr = DftiCommitDescriptor( FFT_HANDLE )
+!    ierr = DftiComputeBackward( FFT_HANDLE, TF_vect, vect_out )
+!    ierr = DftiFreeDescriptor( FFT_HANDLE )
+
+!    CALL DZFFTM(isign,vsize,nb_vect,scale_factor,vect,vsize+inc,TF_vect,vsize/2+1,table_forward,work,ierr)
+  
+  END SUBROUTINE fft_forward
+  
+  SUBROUTINE fft_backward(TF_vect,vect,nb_vect)
+    IMPLICIT NONE
+    INTEGER,INTENT(IN)  :: nb_vect
+    REAL,INTENT(OUT)    :: vect((vsize+inc)*nb_vect)
+    COMPLEX,INTENT(IN ) :: TF_vect((vsize/2+1)*nb_vect)
+    REAL                :: work(4*vsize*nb_vect)
+    INTEGER             :: ierr
+    INTEGER, PARAMETER :: isign=1
+    TYPE(DFTI_DESCRIPTOR),POINTER :: FFT_Handle
+!    CALL ZDFFTM(isign,vsize,nb_vect,scale_factor,TF_vect,vsize/2+1,vect,vsize+inc,table_backward,work,ierr)
+!    IF ( .NOT. Backward_handle(nb_vect)%IsAllocated) THEN
+      ierr = DftiCreateDescriptor( FFT_Handle, DFTI_DOUBLE, DFTI_REAL, 1, vsize )
+      ierr = DftiSetValue(FFT_Handle,DFTI_NUMBER_OF_TRANSFORMS,nb_vect)
+      ierr = DftiSetValue(FFT_Handle,DFTI_FORWARD_SCALE,scale_factor)
+      ierr = DftiSetValue(FFT_Handle,DFTI_BACKWARD_SCALE,scale_factor)
+      ierr = DftiSetValue(FFT_Handle,DFTI_PLACEMENT,DFTI_NOT_INPLACE)
+      ierr = DftiSetValue(FFT_Handle, DFTI_INPUT_DISTANCE,  (vsize/2+1)*2)
+      ierr = DftiSetValue(FFT_Handle, DFTI_OUTPUT_DISTANCE, vsize+inc)
+      ierr = DftiCommitDescriptor( FFT_Handle )
+!      Backward_handle(nb_vect)%IsAllocated=.TRUE.
+!    ENDIF
+    ierr = DftiComputeBackward( FFT_Handle, TF_vect, vect )
+    ierr = DftiFreeDescriptor( FFT_Handle)
+  
+  END SUBROUTINE fft_backward
+
+#endif
+  
+END MODULE lmdz_fft_mkl
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft_wrapper.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft_wrapper.f90	(revision 5107)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft_wrapper.f90	(revision 5107)
@@ -0,0 +1,40 @@
+MODULE lmdz_fft_wrapper
+
+  INTEGER,SAVE             :: vsize
+  INTEGER,PARAMETER        :: inc=1
+
+CONTAINS
+  
+  SUBROUTINE Init_fft(iim,nb)
+  IMPLICIT NONE
+    INTEGER :: iim
+    INTEGER :: nb
+    
+    print *, "wrapper fft : une FFT doit etre specifiee a l'aide d'une clee CPP, sinon utiliser le filtre classique"
+    stop 1
+  END SUBROUTINE Init_fft
+  
+  
+  SUBROUTINE fft_forward(vect,TF_vect,nb_vect)
+    IMPLICIT NONE
+    INTEGER,INTENT(IN)  :: nb_vect
+    REAL,INTENT(IN)     :: vect(vsize+inc,nb_vect)
+    COMPLEX,INTENT(INOUT) :: TF_vect(vsize/2+1,nb_vect)
+    
+    print *, "wrapper fft : une FFT doit etre specifiee a l'aide d'une clee CPP, sinon utiliser le filtre classique"
+    stop 1
+    
+  END SUBROUTINE fft_forward
+  
+  SUBROUTINE fft_backward(TF_vect,vect,nb_vect)
+    IMPLICIT NONE
+    INTEGER,INTENT(IN)  :: nb_vect
+    REAL,INTENT(INOUT)    :: vect(vsize+inc,nb_vect)
+    COMPLEX,INTENT(IN ) :: TF_vect(vsize/2+1,nb_vect)
+  
+    print *, "wrapper fft : une FFT doit etre specifiee a l'aide d'une clee CPP, sinon utiliser le filtre classique"
+    stop 1
+    
+  END SUBROUTINE fft_backward
+  
+END MODULE lmdz_fft_wrapper
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_filtreg.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_filtreg.F90	(revision 5106)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_filtreg.F90	(revision 5107)
@@ -325,4 +325,256 @@
   END SUBROUTINE filtreg
 
+  SUBROUTINE inifgn(dv)
+    !
+    !    ...  H.Upadyaya , O.Sharma  ...
+    !
+    USE lmdz_coefils, ONLY: sddv, sddu, unsddu, unsddv, eignfnv, eignfnu
+    IMPLICIT NONE
+    !
+    include "dimensions.h"
+    include "paramet.h"
+    include "comgeom.h"
+    !
+    REAL :: vec(iim, iim), vec1(iim, iim)
+    REAL :: dlonu(iim), dlonv(iim)
+    REAL :: du(iim), dv(iim), d(iim)
+    REAL :: pi
+    INTEGER :: i, j, k, imm1, nrot
+    EXTERNAL SSUM
+    REAL :: SSUM
+    !
+
+    imm1 = iim - 1
+    pi = 2. * ASIN(1.)
+    !
+    DO i = 1, iim
+      dlonu(i) = xprimu(i)
+      dlonv(i) = xprimv(i)
+    END DO
+
+    DO i = 1, iim
+      sddv(i) = SQRT(dlonv(i))
+      sddu(i) = SQRT(dlonu(i))
+      unsddu(i) = 1. / sddu(i)
+      unsddv(i) = 1. / sddv(i)
+    END DO
+    !
+    DO j = 1, iim
+      DO i = 1, iim
+        vec(i, j) = 0.
+        vec1(i, j) = 0.
+        eignfnv(i, j) = 0.
+        eignfnu(i, j) = 0.
+      END DO
+    END DO
+    !
+    !
+    eignfnv(1, 1) = -1.
+    eignfnv(iim, 1) = 1.
+    DO i = 1, imm1
+      eignfnv(i + 1, i + 1) = -1.
+      eignfnv(i, i + 1) = 1.
+    END DO
+    DO j = 1, iim
+      DO i = 1, iim
+        eignfnv(i, j) = eignfnv(i, j) / (sddu(i) * sddv(j))
+      END DO
+    END DO
+    DO j = 1, iim
+      DO i = 1, iim
+        eignfnu(i, j) = -eignfnv(j, i)
+      END DO
+    END DO
+    !
+    DO j = 1, iim
+      DO i = 1, iim
+        vec (i, j) = 0.0
+        vec1(i, j) = 0.0
+        DO k = 1, iim
+          vec (i, j) = vec(i, j) + eignfnu(i, k) * eignfnv(k, j)
+          vec1(i, j) = vec1(i, j) + eignfnv(i, k) * eignfnu(k, j)
+        ENDDO
+      ENDDO
+    ENDDO
+
+    !
+    CALL jacobi(vec, iim, iim, dv, eignfnv, nrot)
+    CALL acc(eignfnv, d, iim)
+    CALL eigen_sort(dv, eignfnv, iim, iim)
+    !
+    CALL jacobi(vec1, iim, iim, du, eignfnu, nrot)
+    CALL acc(eignfnu, d, iim)
+    CALL eigen_sort(du, eignfnu, iim, iim)
+
+    !c   ancienne version avec appels IMSL
+    !
+    ! CALL MXM(eignfnu,iim,eignfnv,iim,vec,iim)
+    ! CALL MXM(eignfnv,iim,eignfnu,iim,vec1,iim)
+    !     CALL EVCSF(iim,vec,iim,dv,eignfnv,iim)
+    ! CALL acc(eignfnv,d,iim)
+    ! CALL eigen(eignfnv,dv)
+    !
+    ! CALL EVCSF(iim,vec1,iim,du,eignfnu,iim)
+    ! CALL acc(eignfnu,d,iim)
+    ! CALL eigen(eignfnu,du)
+
+    RETURN
+  END SUBROUTINE inifgn
+
+  SUBROUTINE JACOBI(A, N, NP, D, V, NROT)
+    implicit none
+    ! Arguments:
+    integer, intent(in) :: N
+    integer, intent(in) :: NP
+    integer, intent(out) :: NROT
+    real, intent(inout) :: A(NP, NP)
+    real, intent(out) :: D(NP)
+    real, intent(out) :: V(NP, NP)
+
+    ! local variables:
+    integer :: IP, IQ, I, J
+    real :: SM, TRESH, G, H, T, THETA, C, S, TAU
+    real :: B(N)
+    real :: Z(N)
+
+    DO IP = 1, N
+      DO IQ = 1, N
+        V(IP, IQ) = 0.
+      ENDDO
+      V(IP, IP) = 1.
+    ENDDO
+    DO IP = 1, N
+      B(IP) = A(IP, IP)
+      D(IP) = B(IP)
+      Z(IP) = 0.
+    ENDDO
+    NROT = 0
+    DO I = 1, 50 ! 50? I suspect this should be NP
+      !     but convergence is fast enough anyway
+      SM = 0.
+      DO IP = 1, N - 1
+        DO IQ = IP + 1, N
+          SM = SM + ABS(A(IP, IQ))
+        ENDDO
+      ENDDO
+      IF(SM==0.)RETURN
+      IF(I<4)THEN
+        TRESH = 0.2 * SM / N**2
+      ELSE
+        TRESH = 0.
+      ENDIF
+      DO IP = 1, N - 1
+        DO IQ = IP + 1, N
+          G = 100. * ABS(A(IP, IQ))
+          IF((I>4).AND.(ABS(D(IP)) + G==ABS(D(IP))) &
+                  .AND.(ABS(D(IQ)) + G==ABS(D(IQ))))THEN
+            A(IP, IQ) = 0.
+          ELSE IF(ABS(A(IP, IQ))>TRESH)THEN
+            H = D(IQ) - D(IP)
+            IF(ABS(H) + G==ABS(H))THEN
+              T = A(IP, IQ) / H
+            ELSE
+              THETA = 0.5 * H / A(IP, IQ)
+              T = 1. / (ABS(THETA) + SQRT(1. + THETA**2))
+              IF(THETA<0.)T = -T
+            ENDIF
+            C = 1. / SQRT(1 + T**2)
+            S = T * C
+            TAU = S / (1. + C)
+            H = T * A(IP, IQ)
+            Z(IP) = Z(IP) - H
+            Z(IQ) = Z(IQ) + H
+            D(IP) = D(IP) - H
+            D(IQ) = D(IQ) + H
+            A(IP, IQ) = 0.
+            DO J = 1, IP - 1
+              G = A(J, IP)
+              H = A(J, IQ)
+              A(J, IP) = G - S * (H + G * TAU)
+              A(J, IQ) = H + S * (G - H * TAU)
+            ENDDO
+            DO J = IP + 1, IQ - 1
+              G = A(IP, J)
+              H = A(J, IQ)
+              A(IP, J) = G - S * (H + G * TAU)
+              A(J, IQ) = H + S * (G - H * TAU)
+            ENDDO
+            DO J = IQ + 1, N
+              G = A(IP, J)
+              H = A(IQ, J)
+              A(IP, J) = G - S * (H + G * TAU)
+              A(IQ, J) = H + S * (G - H * TAU)
+            ENDDO
+            DO J = 1, N
+              G = V(J, IP)
+              H = V(J, IQ)
+              V(J, IP) = G - S * (H + G * TAU)
+              V(J, IQ) = H + S * (G - H * TAU)
+            ENDDO
+            NROT = NROT + 1
+          ENDIF
+        ENDDO
+      ENDDO
+      DO IP = 1, N
+        B(IP) = B(IP) + Z(IP)
+        D(IP) = B(IP)
+        Z(IP) = 0.
+      ENDDO
+    ENDDO ! of DO I=1,50
+    STOP 'Jacobi: 50 iterations should never happen'
+
+  END SUBROUTINE JACOBI
+
+  SUBROUTINE eigen_sort(d, v, n, np)
+    INTEGER :: n, np
+    REAL :: d(np), v(np, np)
+    INTEGER :: i, j, k
+    REAL :: p
+
+    DO i = 1, n - 1
+      k = i
+      p = d(i)
+      DO j = i + 1, n
+        IF(d(j)>=p) THEN
+          k = j
+          p = d(j)
+        ENDIF
+      ENDDO
+
+      IF(k/=i) THEN
+        d(k) = d(i)
+        d(i) = p
+        DO j = 1, n
+          p = v(j, i)
+          v(j, i) = v(j, k)
+          v(j, k) = p
+        ENDDO
+      ENDIF
+    ENDDO
+
+    RETURN
+  END SUBROUTINE eigen_sort
+
+  SUBROUTINE acc(vec, d, im)
+    implicit none
+    integer :: im
+    real :: vec(im, im), d(im)
+    integer :: i, j
+    real :: sum
+    real, external :: ssum
+    do j = 1, im
+      do i = 1, im
+        d(i) = vec(i, j) * vec(i, j)
+      enddo
+      sum = ssum(im, d, 1)
+      sum = sqrt(sum)
+      do i = 1, im
+        vec(i, j) = vec(i, j) / sum
+      enddo
+    enddo
+    return
+  end subroutine acc
+
+
   SUBROUTINE inifilr
 #ifdef CPP_PARA
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_mkl_dft_type.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_mkl_dft_type.f90	(revision 5107)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_mkl_dft_type.f90	(revision 5107)
@@ -0,0 +1,227 @@
+!*****************************************************************************
+! Copyright(C) 2002-2011 Intel Corporation. All Rights Reserved.
+
+! The source code, information  and  material ("Material") contained herein is
+! owned  by Intel Corporation or its suppliers or licensors, and title to such
+! Material remains  with Intel Corporation  or its suppliers or licensors. The
+! Material  contains proprietary information  of  Intel or  its  suppliers and
+! licensors. The  Material is protected by worldwide copyright laws and treaty
+! provisions. No  part  of  the  Material  may  be  used,  copied, reproduced,
+! modified, published, uploaded, posted, transmitted, distributed or disclosed
+! in any way  without Intel's  prior  express written  permission. No  license
+! under  any patent, copyright  or  other intellectual property rights  in the
+! Material  is  granted  to  or  conferred  upon  you,  either  expressly,  by
+! implication, inducement,  estoppel or  otherwise.  Any  license  under  such
+! intellectual  property  rights must  be express  and  approved  by  Intel in
+! writing.
+
+! *Third Party trademarks are the property of their respective owners.
+
+! Unless otherwise  agreed  by Intel  in writing, you may not remove  or alter
+! this  notice or  any other notice embedded  in Materials by Intel or Intel's
+! suppliers or licensors in any way.
+
+!*****************************************************************************
+! Content:
+!    Intel(R) Math Kernel Library (MKL)
+!    Discrete Fourier Transform Interface (DFTI)
+!*****************************************************************************
+
+MODULE lmdz_mkl_dft_type
+
+  TYPE, PUBLIC :: DFTI_DESCRIPTOR
+     PRIVATE
+     INTEGER :: dontuse
+     ! Structure of this type is not used in Fortran code
+     ! the pointer to this type is used only
+  END TYPE DFTI_DESCRIPTOR
+
+  !======================================================================
+  ! These real type kind parameters are not for direct use
+  !======================================================================
+
+  INTEGER, PARAMETER :: DFTI_SPKP = SELECTED_REAL_KIND(6,37)
+  INTEGER, PARAMETER :: DFTI_DPKP = SELECTED_REAL_KIND(15,307)
+
+  !======================================================================
+  ! Descriptor configuration parameters [default values in brackets]
+  !======================================================================
+
+  ! Domain for forward transform. No default value
+  INTEGER, PARAMETER :: DFTI_FORWARD_DOMAIN = 0
+
+  ! Dimensionality, or rank. No default value
+  INTEGER, PARAMETER :: DFTI_DIMENSION = 1
+
+  ! Length(s) of transform. No default value
+  INTEGER, PARAMETER :: DFTI_LENGTHS = 2
+
+  ! Floating point precision. No default value
+  INTEGER, PARAMETER :: DFTI_PRECISION = 3
+
+  ! Scale factor for forward transform [1.0]
+  INTEGER, PARAMETER :: DFTI_FORWARD_SCALE = 4
+
+  ! Scale factor for backward transform [1.0]
+  INTEGER, PARAMETER :: DFTI_BACKWARD_SCALE = 5
+
+  ! Exponent sign for forward transform [DFTI_NEGATIVE]
+  ! INTEGER, PARAMETER :: DFTI_FORWARD_SIGN = 6 ! NOT IMPLEMENTED
+
+  ! Number of data sets to be transformed [1]
+  INTEGER, PARAMETER :: DFTI_NUMBER_OF_TRANSFORMS = 7
+
+  ! Storage of finite complex-valued sequences in complex domain
+  ! [DFTI_COMPLEX_COMPLEX]
+  INTEGER, PARAMETER :: DFTI_COMPLEX_STORAGE = 8
+
+  ! Storage of finite real-valued sequences in real domain
+  ! [DFTI_REAL_REAL]
+  INTEGER, PARAMETER :: DFTI_REAL_STORAGE = 9
+
+  ! Storage of finite complex-valued sequences in conjugate-even
+  ! domain [DFTI_COMPLEX_REAL]
+  INTEGER, PARAMETER :: DFTI_CONJUGATE_EVEN_STORAGE = 10
+
+  ! Placement of result [DFTI_INPLACE]
+  INTEGER, PARAMETER :: DFTI_PLACEMENT = 11
+
+  ! Generalized strides for input data layout
+  ! [tigth, col-major for Fortran]
+  INTEGER, PARAMETER :: DFTI_INPUT_STRIDES = 12
+
+  ! Generalized strides for output data layout
+  ! [tigth, col-major for Fortran]
+  INTEGER, PARAMETER :: DFTI_OUTPUT_STRIDES = 13
+
+  ! Distance between first input elements for multiple transforms [0]
+  INTEGER, PARAMETER :: DFTI_INPUT_DISTANCE = 14
+
+  ! Distance between first output elements for multiple transforms [0]
+  INTEGER, PARAMETER :: DFTI_OUTPUT_DISTANCE = 15
+
+  ! Effort spent in initialization [DFTI_MEDIUM]
+  ! INTEGER, PARAMETER :: DFTI_INITIALIZATION_EFFORT = 16 ! NOT IMPLEMENTED
+
+  ! Use of workspace during computation [DFTI_ALLOW]
+  INTEGER, PARAMETER :: DFTI_WORKSPACE = 17
+
+  ! Ordering of the result [DFTI_ORDERED]
+  INTEGER, PARAMETER :: DFTI_ORDERING = 18
+
+  ! Possible transposition of result [DFTI_NONE]
+  INTEGER, PARAMETER :: DFTI_TRANSPOSE = 19
+
+  ! User-settable descriptor name [""]
+  INTEGER, PARAMETER :: DFTI_DESCRIPTOR_NAME = 20
+
+  ! Packing format for DFTI_COMPLEX_REAL storage of finite
+  ! conjugate-even sequences [DFTI_CCS_FORMAT]
+  INTEGER, PARAMETER :: DFTI_PACKED_FORMAT = 21
+
+  ! Commit status of the descriptor. Read-only parameter
+  INTEGER, PARAMETER :: DFTI_COMMIT_STATUS = 22
+
+  ! Version string for this DFTI implementation. Read-only parameter
+  INTEGER, PARAMETER :: DFTI_VERSION = 23
+
+  ! Ordering of the forward transform. Read-only parameter
+  ! INTEGER, PARAMETER :: DFTI_FORWARD_ORDERING = 24 ! NOT IMPLEMENTED
+
+  ! Ordering of the backward transform. Read-only parameter
+  ! INTEGER, PARAMETER :: DFTI_BACKWARD_ORDERING = 25 ! NOT IMPLEMENTED
+
+  ! Number of user threads that share the descriptor [1]
+  INTEGER, PARAMETER :: DFTI_NUMBER_OF_USER_THREADS = 26
+
+  !======================================================================
+  ! Values of the descriptor configuration parameters
+  !======================================================================
+
+  ! DFTI_COMMIT_STATUS
+  INTEGER, PARAMETER :: DFTI_COMMITTED = 30
+  INTEGER, PARAMETER :: DFTI_UNCOMMITTED = 31
+
+  ! DFTI_FORWARD_DOMAIN
+  INTEGER, PARAMETER :: DFTI_COMPLEX = 32
+  INTEGER, PARAMETER :: DFTI_REAL = 33
+  ! INTEGER, PARAMETER :: DFTI_CONJUGATE_EVEN = 34 ! NOT IMPLEMENTED
+
+  ! DFTI_PRECISION
+  INTEGER, PARAMETER :: DFTI_SINGLE = 35
+  INTEGER, PARAMETER :: DFTI_DOUBLE = 36
+
+  ! DFTI_PRECISION for reduced size of statically linked application.
+  ! Recommended use: modify statement 'USE lmdz_mkl_dfti' in your program,
+  ! so that it reads as either of:
+  ! USE lmdz_mkl_dfti, FORGET=>DFTI_SINGLE, DFTI_SINGLE=>DFTI_SINGLE_R
+  ! USE lmdz_mkl_dfti, FORGET=>DFTI_DOUBLE, DFTI_DOUBLE=>DFTI_DOUBLE_R
+  ! where word 'FORGET' can be any name not used in the program.
+  REAL(DFTI_SPKP), PARAMETER :: DFTI_SINGLE_R = 35
+  REAL(DFTI_DPKP), PARAMETER :: DFTI_DOUBLE_R = 36
+
+  ! DFTI_FORWARD_SIGN
+  ! INTEGER, PARAMETER :: DFTI_NEGATIVE = 37 ! NOT IMPLEMENTED
+  ! INTEGER, PARAMETER :: DFTI_POSITIVE = 38 ! NOT IMPLEMENTED
+
+  ! DFTI_COMPLEX_STORAGE and DFTI_CONJUGATE_EVEN_STORAGE
+  INTEGER, PARAMETER :: DFTI_COMPLEX_COMPLEX = 39
+  INTEGER, PARAMETER :: DFTI_COMPLEX_REAL = 40
+
+  ! DFTI_REAL_STORAGE
+  INTEGER, PARAMETER :: DFTI_REAL_COMPLEX = 41
+  INTEGER, PARAMETER :: DFTI_REAL_REAL = 42
+
+  ! DFTI_PLACEMENT
+  INTEGER, PARAMETER :: DFTI_INPLACE = 43 ! Result overwrites input
+  INTEGER, PARAMETER :: DFTI_NOT_INPLACE  = 44 ! Have another place for result
+
+  ! DFTI_INITIALIZATION_EFFORT
+  ! INTEGER, PARAMETER :: DFTI_LOW = 45 ! NOT IMPLEMENTED
+  ! INTEGER, PARAMETER :: DFTI_MEDIUM = 46 ! NOT IMPLEMENTED
+  ! INTEGER, PARAMETER :: DFTI_HIGH = 47 ! NOT IMPLEMENTED
+
+  ! DFTI_ORDERING
+  INTEGER, PARAMETER :: DFTI_ORDERED = 48
+  INTEGER, PARAMETER :: DFTI_BACKWARD_SCRAMBLED = 49
+  ! INTEGER, PARAMETER :: DFTI_FORWARD_SCRAMBLED  = 50 ! NOT IMPLEMENTED
+
+  ! Allow/avoid certain usages
+  INTEGER, PARAMETER :: DFTI_ALLOW = 51 ! Allow transposition or workspace
+  INTEGER, PARAMETER :: DFTI_AVOID = 52 ! Avoid auxiliary storage
+  INTEGER, PARAMETER :: DFTI_NONE = 53
+
+  ! DFTI_PACKED_FORMAT
+  ! (for storing congugate-even finite sequence in real array)
+  INTEGER, PARAMETER :: DFTI_CCS_FORMAT = 54  ! Complex conjugate-symmetric
+  INTEGER, PARAMETER :: DFTI_PACK_FORMAT = 55 ! Pack format for real DFT
+  INTEGER, PARAMETER :: DFTI_PERM_FORMAT = 56 ! Perm format for real DFT
+  INTEGER, PARAMETER :: DFTI_CCE_FORMAT = 57  ! Complex conjugate-even
+
+  !======================================================================
+  ! Error classes
+  !======================================================================
+  INTEGER, PARAMETER :: DFTI_NO_ERROR = 0
+  INTEGER, PARAMETER :: DFTI_MEMORY_ERROR = 1
+  INTEGER, PARAMETER :: DFTI_INVALID_CONFIGURATION = 2
+  INTEGER, PARAMETER :: DFTI_INCONSISTENT_CONFIGURATION = 3
+  INTEGER, PARAMETER :: DFTI_MULTITHREADED_ERROR = 4
+  INTEGER, PARAMETER :: DFTI_BAD_DESCRIPTOR = 5
+  INTEGER, PARAMETER :: DFTI_UNIMPLEMENTED = 6
+  INTEGER, PARAMETER :: DFTI_MKL_INTERNAL_ERROR = 7
+  INTEGER, PARAMETER :: DFTI_NUMBER_OF_THREADS_ERROR = 8
+  INTEGER, PARAMETER :: DFTI_1D_LENGTH_EXCEEDS_INT32 = 9
+
+  ! Maximum length of error string
+  INTEGER, PARAMETER :: DFTI_MAX_MESSAGE_LENGTH = 80
+
+  ! Maximum length of user-settable descriptor name
+  INTEGER, PARAMETER :: DFTI_MAX_NAME_LENGTH = 10
+
+  ! Maximum length of MKL version string
+  INTEGER, PARAMETER :: DFTI_VERSION_LENGTH = 198
+
+  ! (deprecated parameter)
+  INTEGER, PARAMETER :: DFTI_ERROR_CLASS = 60
+
+END MODULE lmdz_mkl_dft_type
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_mkl_dfti.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_mkl_dfti.f90	(revision 5107)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_mkl_dfti.f90	(revision 5107)
@@ -0,0 +1,528 @@
+!*****************************************************************************
+! Copyright(C) 2002-2011 Intel Corporation. All Rights Reserved.
+
+! The source code, information  and  material ("Material") contained herein is
+! owned  by Intel Corporation or its suppliers or licensors, and title to such
+! Material remains  with Intel Corporation  or its suppliers or licensors. The
+! Material  contains proprietary information  of  Intel or  its  suppliers and
+! licensors. The  Material is protected by worldwide copyright laws and treaty
+! provisions. No  part  of  the  Material  may  be  used,  copied, reproduced,
+! modified, published, uploaded, posted, transmitted, distributed or disclosed
+! in any way  without Intel's  prior  express written  permission. No  license
+! under  any patent, copyright  or  other intellectual property rights  in the
+! Material  is  granted  to  or  conferred  upon  you,  either  expressly,  by
+! implication, inducement,  estoppel or  otherwise.  Any  license  under  such
+! intellectual  property  rights must  be express  and  approved  by  Intel in
+! writing.
+
+! *Third Party trademarks are the property of their respective owners.
+
+! Unless otherwise  agreed  by Intel  in writing, you may not remove  or alter
+! this  notice or  any other notice embedded  in Materials by Intel or Intel's
+! suppliers or licensors in any way.
+
+!*****************************************************************************
+! Content:
+!    Intel(R) Math Kernel Library (MKL)
+!    Discrete Fourier Transform Interface (DFTI)
+!*****************************************************************************
+
+
+MODULE lmdz_mkl_dfti
+
+  USE lmdz_mkl_dft_type
+
+  INTERFACE DftiCreateDescriptor
+
+     FUNCTION dfti_create_descriptor_1d(desc, precision, domain, dim, length)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_create_descriptor_1d
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_create_descriptor_1d
+       INTEGER dfti_create_descriptor_1d
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       INTEGER, INTENT(IN) :: precision
+       INTEGER, INTENT(IN) :: domain
+       INTEGER, INTENT(IN) :: dim, length
+     END FUNCTION dfti_create_descriptor_1d
+
+     FUNCTION dfti_create_descriptor_highd(desc, precision, domain, dim,length)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_create_descriptor_highd
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_create_descriptor_highd
+       INTEGER dfti_create_descriptor_highd
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       INTEGER, INTENT(IN) :: precision
+       INTEGER, INTENT(IN) :: domain
+       INTEGER, INTENT(IN) :: dim
+       INTEGER, INTENT(IN), DIMENSION(*) :: length
+     END FUNCTION dfti_create_descriptor_highd
+
+     FUNCTION dfti_create_descriptor_s_1d(desc, s, dom, one, dim)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_create_descriptor_s_1d
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_create_descriptor_s_1d
+       INTEGER dfti_create_descriptor_s_1d
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_SPKP), INTENT(IN) :: s
+       INTEGER, INTENT(IN) :: dom
+       INTEGER, INTENT(IN) :: one
+       INTEGER, INTENT(IN) :: dim
+     END FUNCTION dfti_create_descriptor_s_1d
+
+     FUNCTION dfti_create_descriptor_s_md(desc, s, dom, many, dims)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_create_descriptor_s_md
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_create_descriptor_s_md
+       INTEGER dfti_create_descriptor_s_md
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_SPKP), INTENT(IN) :: s
+       INTEGER, INTENT(IN) :: dom
+       INTEGER, INTENT(IN) :: many
+       INTEGER, INTENT(IN), DIMENSION(*) :: dims
+     END FUNCTION dfti_create_descriptor_s_md
+
+     FUNCTION dfti_create_descriptor_d_1d(desc, d, dom, one, dim)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_create_descriptor_d_1d
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_create_descriptor_d_1d
+       INTEGER dfti_create_descriptor_d_1d
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_DPKP), INTENT(IN) :: d
+       INTEGER, INTENT(IN) :: dom
+       INTEGER, INTENT(IN) :: one
+       INTEGER, INTENT(IN) :: dim
+     END FUNCTION dfti_create_descriptor_d_1d
+
+     FUNCTION dfti_create_descriptor_d_md(desc, d, dom, many, dims)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_create_descriptor_d_md
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_create_descriptor_d_md
+       INTEGER dfti_create_descriptor_d_md
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_DPKP), INTENT(IN) :: d
+       INTEGER, INTENT(IN) :: dom
+       INTEGER, INTENT(IN) :: many
+       INTEGER, INTENT(IN), DIMENSION(*) :: dims
+     END FUNCTION dfti_create_descriptor_d_md
+
+  END INTERFACE
+
+  INTERFACE DftiCopyDescriptor
+
+     FUNCTION dfti_copy_descriptor_external(desc, new_desc)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_copy_descriptor_external
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_copy_descriptor_external
+       INTEGER dfti_copy_descriptor_external
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       TYPE(DFTI_DESCRIPTOR), POINTER :: new_desc
+     END FUNCTION dfti_copy_descriptor_external
+
+  END INTERFACE
+
+  INTERFACE DftiCommitDescriptor
+
+     FUNCTION dfti_commit_descriptor_external(desc)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_commit_descriptor_external
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_commit_descriptor_external
+       INTEGER dfti_commit_descriptor_external
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+     END FUNCTION dfti_commit_descriptor_external
+
+  END INTERFACE
+
+  INTERFACE DftiSetValue
+
+     FUNCTION dfti_set_value_intval(desc, OptName, IntVal)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_set_value_intval
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_set_value_intval
+       INTEGER dfti_set_value_intval
+       INTEGER, INTENT(IN) :: OptName
+       INTEGER, INTENT(IN) :: IntVal
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+     END FUNCTION dfti_set_value_intval
+
+     FUNCTION dfti_set_value_sglval(desc, OptName, sglval)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_set_value_sglval
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_set_value_sglval
+       INTEGER dfti_set_value_sglval
+       INTEGER, INTENT(IN) :: OptName
+       REAL(DFTI_SPKP), INTENT(IN) :: sglval
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+     END FUNCTION dfti_set_value_sglval
+
+     FUNCTION dfti_set_value_dblval(desc, OptName, DblVal)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_set_value_dblval
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_set_value_dblval
+       INTEGER dfti_set_value_dblval
+       INTEGER, INTENT(IN) :: OptName
+       REAL(DFTI_DPKP), INTENT(IN) :: DblVal
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+     END FUNCTION dfti_set_value_dblval
+
+     FUNCTION dfti_set_value_intvec(desc, OptName, IntVec)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_set_value_intvec
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_set_value_intvec
+       INTEGER dfti_set_value_intvec
+       INTEGER, INTENT(IN) :: OptName
+       INTEGER, INTENT(IN), DIMENSION(*) :: IntVec
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+     END FUNCTION dfti_set_value_intvec
+
+     FUNCTION dfti_set_value_chars(desc, OptName, Chars)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_set_value_chars
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_set_value_chars
+       INTEGER dfti_set_value_chars
+       INTEGER, INTENT(IN) :: OptName
+       CHARACTER(*), INTENT(IN) :: Chars
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+     END FUNCTION dfti_set_value_chars
+
+  END INTERFACE
+
+  INTERFACE DftiGetValue
+
+     FUNCTION dfti_get_value_intval(desc, OptName, IntVal)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_get_value_intval
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_get_value_intval
+       INTEGER dfti_get_value_intval
+       INTEGER, INTENT(IN) :: OptName
+       INTEGER, INTENT(OUT) :: IntVal
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+     END FUNCTION dfti_get_value_intval
+
+     FUNCTION dfti_get_value_sglval(desc, OptName, sglval)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_get_value_sglval
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_get_value_sglval
+       INTEGER dfti_get_value_sglval
+       INTEGER, INTENT(IN) :: OptName
+       REAL(DFTI_SPKP), INTENT(OUT) :: sglval
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+     END FUNCTION dfti_get_value_sglval
+
+     FUNCTION dfti_get_value_dblval(desc, OptName, DblVal)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_get_value_dblval
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_get_value_dblval
+       INTEGER dfti_get_value_dblval
+       INTEGER, INTENT(IN) :: OptName
+       REAL(DFTI_DPKP), INTENT(OUT) :: DblVal
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+     END FUNCTION dfti_get_value_dblval
+
+     FUNCTION dfti_get_value_intvec(desc, OptName, IntVec)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_get_value_intvec
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_get_value_intvec
+       INTEGER dfti_get_value_intvec
+       INTEGER, INTENT(IN) :: OptName
+       INTEGER, INTENT(OUT), DIMENSION(*) :: IntVec
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+     END FUNCTION dfti_get_value_intvec
+
+     FUNCTION dfti_get_value_chars(desc, OptName, Chars)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_get_value_chars
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_get_value_chars
+       INTEGER dfti_get_value_chars
+       INTEGER, INTENT(IN) :: OptName
+       CHARACTER(*), INTENT(OUT) :: Chars
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+     END FUNCTION dfti_get_value_chars
+
+  END INTERFACE
+
+  INTERFACE DftiComputeForward
+
+     FUNCTION dfti_compute_forward_s(desc,sSrcDst)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_forward_s
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_s
+       INTEGER dfti_compute_forward_s
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_SPKP), INTENT(INOUT), DIMENSION(*) :: sSrcDst
+     END FUNCTION dfti_compute_forward_s
+
+     FUNCTION dfti_compute_forward_c(desc,cSrcDst)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_forward_c
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_c
+       INTEGER dfti_compute_forward_c
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       COMPLEX(DFTI_SPKP), INTENT(INOUT), DIMENSION(*) :: cSrcDst
+     END FUNCTION dfti_compute_forward_c
+
+     FUNCTION dfti_compute_forward_ss(desc,sSrcDstRe,sSrcDstIm)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_forward_ss
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_ss
+       INTEGER dfti_compute_forward_ss
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_SPKP), DIMENSION(*) :: sSrcDstRe
+       REAL(DFTI_SPKP), DIMENSION(*) :: sSrcDstIm
+     END FUNCTION dfti_compute_forward_ss
+
+     FUNCTION dfti_compute_forward_sc(desc,sSrc,cDst)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_forward_sc
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_sc
+       INTEGER dfti_compute_forward_sc
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_SPKP), INTENT(IN), DIMENSION(*) :: sSrc
+       COMPLEX(DFTI_SPKP), INTENT(OUT), DIMENSION(*) :: cDst
+     END FUNCTION dfti_compute_forward_sc
+
+     FUNCTION dfti_compute_forward_cc(desc,cSrc,cDst)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_forward_cc
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_cc
+       INTEGER dfti_compute_forward_cc
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       COMPLEX(DFTI_SPKP), INTENT(IN), DIMENSION(*) :: cSrc
+       COMPLEX(DFTI_SPKP), INTENT(OUT), DIMENSION(*) :: cDst
+     END FUNCTION dfti_compute_forward_cc
+
+     FUNCTION dfti_compute_forward_ssss(desc,sSrcRe,sSrcIm,sDstRe,sDstIm)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_forward_ssss
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_ssss
+       INTEGER dfti_compute_forward_ssss
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_SPKP), INTENT(IN), DIMENSION(*) :: sSrcRe
+       REAL(DFTI_SPKP), INTENT(IN), DIMENSION(*) :: sSrcIm
+       REAL(DFTI_SPKP), INTENT(OUT), DIMENSION(*) :: sDstRe
+       REAL(DFTI_SPKP), INTENT(OUT), DIMENSION(*) :: sDstIm
+     END FUNCTION dfti_compute_forward_ssss
+
+     FUNCTION dfti_compute_forward_d(desc,dSrcDst)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_forward_d
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_d
+       INTEGER dfti_compute_forward_d
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_DPKP), INTENT(INOUT), DIMENSION(*) :: dSrcDst
+     END FUNCTION dfti_compute_forward_d
+
+     FUNCTION dfti_compute_forward_z(desc,zSrcDst)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_forward_z
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_z
+       INTEGER dfti_compute_forward_z
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       COMPLEX(DFTI_DPKP), INTENT(INOUT), DIMENSION(*) :: zSrcDst
+     END FUNCTION dfti_compute_forward_z
+
+     FUNCTION dfti_compute_forward_dd(desc,dSrcDstRe,dSrcDstIm)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_forward_dd
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_dd
+       INTEGER dfti_compute_forward_dd
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_DPKP), DIMENSION(*) :: dSrcDstRe
+       REAL(DFTI_DPKP), DIMENSION(*) :: dSrcDstIm
+     END FUNCTION dfti_compute_forward_dd
+
+     FUNCTION dfti_compute_forward_dz(desc,dSrc,zDst)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_forward_dz
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_dz
+       INTEGER dfti_compute_forward_dz
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_DPKP), INTENT(IN), DIMENSION(*) :: dSrc
+       COMPLEX(DFTI_DPKP), INTENT(OUT), DIMENSION(*) :: zDst
+     END FUNCTION dfti_compute_forward_dz
+
+     FUNCTION dfti_compute_forward_zz(desc,zSrc,zDst)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_forward_zz
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_zz
+       INTEGER dfti_compute_forward_zz
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       COMPLEX(DFTI_DPKP), INTENT(IN), DIMENSION(*) :: zSrc
+       COMPLEX(DFTI_DPKP), INTENT(OUT), DIMENSION(*) :: zDst
+     END FUNCTION dfti_compute_forward_zz
+
+     FUNCTION dfti_compute_forward_dddd(desc,dSrcRe,dSrcIm,dDstRe,dDstIm)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_forward_dddd
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_dddd
+       INTEGER dfti_compute_forward_dddd
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_DPKP), INTENT(IN), DIMENSION(*) :: dSrcRe
+       REAL(DFTI_DPKP), INTENT(IN), DIMENSION(*) :: dSrcIm
+       REAL(DFTI_DPKP), INTENT(OUT), DIMENSION(*) :: dDstRe
+       REAL(DFTI_DPKP), INTENT(OUT), DIMENSION(*) :: dDstIm
+     END FUNCTION dfti_compute_forward_dddd
+
+  END INTERFACE DftiComputeForward
+
+  INTERFACE DftiComputeBackward
+
+     FUNCTION dfti_compute_backward_s(desc,sSrcDst)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_backward_s
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_s
+       INTEGER dfti_compute_backward_s
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_SPKP), INTENT(INOUT), DIMENSION(*) :: sSrcDst
+     END FUNCTION dfti_compute_backward_s
+
+     FUNCTION dfti_compute_backward_c(desc,cSrcDst)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_backward_c
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_c
+       INTEGER dfti_compute_backward_c
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       COMPLEX(DFTI_SPKP), INTENT(INOUT), DIMENSION(*) :: cSrcDst
+     END FUNCTION dfti_compute_backward_c
+
+     FUNCTION dfti_compute_backward_ss(desc,sSrcDstRe,sSrcDstIm)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_backward_ss
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_ss
+       INTEGER dfti_compute_backward_ss
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_SPKP), DIMENSION(*) :: sSrcDstRe
+       REAL(DFTI_SPKP), DIMENSION(*) :: sSrcDstIm
+     END FUNCTION dfti_compute_backward_ss
+
+     FUNCTION dfti_compute_backward_cs(desc,cSrc,sDst)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_backward_cs
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_cs
+       INTEGER dfti_compute_backward_cs
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       COMPLEX(DFTI_SPKP), INTENT(IN), DIMENSION(*) :: cSrc
+       REAL(DFTI_SPKP), INTENT(OUT), DIMENSION(*) :: sDst
+     END FUNCTION dfti_compute_backward_cs
+
+     FUNCTION dfti_compute_backward_cc(desc,cSrc,cDst)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_backward_cc
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_cc
+       INTEGER dfti_compute_backward_cc
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       COMPLEX(DFTI_SPKP), INTENT(IN), DIMENSION(*) :: cSrc
+       COMPLEX(DFTI_SPKP), INTENT(OUT), DIMENSION(*) :: cDst
+     END FUNCTION dfti_compute_backward_cc
+
+     FUNCTION dfti_compute_backward_ssss(desc,sSrcRe,sSrcIm,sDstRe,sDstIm)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_backward_ssss
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_ssss
+       INTEGER dfti_compute_backward_ssss
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_SPKP), INTENT(IN), DIMENSION(*) :: sSrcRe
+       REAL(DFTI_SPKP), INTENT(IN), DIMENSION(*) :: sSrcIm
+       REAL(DFTI_SPKP), INTENT(OUT), DIMENSION(*) :: sDstRe
+       REAL(DFTI_SPKP), INTENT(OUT), DIMENSION(*) :: sDstIm
+     END FUNCTION dfti_compute_backward_ssss
+
+     FUNCTION dfti_compute_backward_d(desc,dSrcDst)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_backward_d
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_d
+       INTEGER dfti_compute_backward_d
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_DPKP), INTENT(INOUT), DIMENSION(*) :: dSrcDst
+     END FUNCTION dfti_compute_backward_d
+
+     FUNCTION dfti_compute_backward_z(desc,zSrcDst)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_backward_z
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_z
+       INTEGER dfti_compute_backward_z
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       COMPLEX(DFTI_DPKP), INTENT(INOUT), DIMENSION(*) :: zSrcDst
+     END FUNCTION dfti_compute_backward_z
+
+     FUNCTION dfti_compute_backward_dd(desc,dSrcDstRe,dSrcDstIm)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_backward_dd
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_dd
+       INTEGER dfti_compute_backward_dd
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_DPKP), DIMENSION(*) :: dSrcDstRe
+       REAL(DFTI_DPKP), DIMENSION(*) :: dSrcDstIm
+     END FUNCTION dfti_compute_backward_dd
+
+     FUNCTION dfti_compute_backward_zd(desc,zSrc,dDst)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_backward_zd
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_zd
+       INTEGER dfti_compute_backward_zd
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       COMPLEX(DFTI_DPKP), INTENT(IN), DIMENSION(*) :: zSrc
+       REAL(DFTI_DPKP), INTENT(OUT), DIMENSION(*) :: dDst
+     END FUNCTION dfti_compute_backward_zd
+
+     FUNCTION dfti_compute_backward_zz(desc,zSrc,zDst)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_backward_zz
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_zz
+       INTEGER dfti_compute_backward_zz
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       COMPLEX(DFTI_DPKP), INTENT(IN), DIMENSION(*) :: zSrc
+       COMPLEX(DFTI_DPKP), INTENT(OUT), DIMENSION(*) :: zDst
+     END FUNCTION dfti_compute_backward_zz
+
+     FUNCTION dfti_compute_backward_dddd(desc,dSrcRe,dSrcIm,dDstRe,dDstIm)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_compute_backward_dddd
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_dddd
+       INTEGER dfti_compute_backward_dddd
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+       REAL(DFTI_DPKP), INTENT(IN), DIMENSION(*) :: dSrcRe
+       REAL(DFTI_DPKP), INTENT(IN), DIMENSION(*) :: dSrcIm
+       REAL(DFTI_DPKP), INTENT(OUT), DIMENSION(*) :: dDstRe
+       REAL(DFTI_DPKP), INTENT(OUT), DIMENSION(*) :: dDstIm
+     END FUNCTION dfti_compute_backward_dddd
+
+  END INTERFACE DftiComputeBackward
+
+  INTERFACE DftiFreeDescriptor
+
+     FUNCTION dfti_free_descriptor_external(desc)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_free_descriptor_external
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_free_descriptor_external
+       INTEGER dfti_free_descriptor_external
+       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
+     END FUNCTION dfti_free_descriptor_external
+
+  END INTERFACE
+
+  INTERFACE DftiErrorClass
+
+     FUNCTION dfti_error_class_external(Status, ErrorClass)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_error_class_external
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_error_class_external
+       LOGICAL dfti_error_class_external
+       INTEGER, INTENT(IN) :: Status
+       INTEGER, INTENT(IN) :: ErrorClass
+     END FUNCTION dfti_error_class_external
+
+  END INTERFACE
+
+  INTERFACE DftiErrorMessage
+
+     FUNCTION dfti_error_message_external(Status)
+       USE lmdz_mkl_dft_type
+       !DEC$ ATTRIBUTES C :: dfti_error_message_external
+       !DEC$ ATTRIBUTES REFERENCE :: dfti_error_message_external
+       CHARACTER(LEN=DFTI_MAX_MESSAGE_LENGTH) :: dfti_error_message_external
+       INTEGER, INTENT(IN) :: Status
+     END FUNCTION dfti_error_message_external
+
+  END INTERFACE
+
+END MODULE lmdz_mkl_dfti
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_timer_filtre.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_timer_filtre.f90	(revision 5107)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_timer_filtre.f90	(revision 5107)
@@ -0,0 +1,33 @@
+MODULE lmdz_timer_filtre
+  IMPLICIT NONE
+  PRIVATE
+  REAL :: time
+  REAL :: Last_time
+  PUBLIC :: Init_timer, start_timer, stop_timer, Print_filtre_timer
+CONTAINS
+
+  SUBROUTINE Init_timer
+    time = 0
+    Last_time = 0
+  END SUBROUTINE Init_timer
+
+  SUBROUTINE Start_timer
+
+    CALL cpu_time(last_time)
+
+  END SUBROUTINE start_timer
+
+
+  SUBROUTINE stop_timer
+    REAL :: T
+
+    CALL cpu_time(t)
+    Time = Time + t - last_time
+
+  END SUBROUTINE stop_timer
+
+  SUBROUTINE Print_filtre_timer
+    PRINT *, "Temps CPU passe dans le filtre :", Time
+  END SUBROUTINE  Print_filtre_timer
+
+END MODULE lmdz_timer_filtre
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/mkl_dft_type.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/mkl_dft_type.f90	(revision 5106)
+++ 	(revision )
@@ -1,227 +1,0 @@
-!*****************************************************************************
-! Copyright(C) 2002-2011 Intel Corporation. All Rights Reserved.
-
-! The source code, information  and  material ("Material") contained herein is
-! owned  by Intel Corporation or its suppliers or licensors, and title to such
-! Material remains  with Intel Corporation  or its suppliers or licensors. The
-! Material  contains proprietary information  of  Intel or  its  suppliers and
-! licensors. The  Material is protected by worldwide copyright laws and treaty
-! provisions. No  part  of  the  Material  may  be  used,  copied, reproduced,
-! modified, published, uploaded, posted, transmitted, distributed or disclosed
-! in any way  without Intel's  prior  express written  permission. No  license
-! under  any patent, copyright  or  other intellectual property rights  in the
-! Material  is  granted  to  or  conferred  upon  you,  either  expressly,  by
-! implication, inducement,  estoppel or  otherwise.  Any  license  under  such
-! intellectual  property  rights must  be express  and  approved  by  Intel in
-! writing.
-
-! *Third Party trademarks are the property of their respective owners.
-
-! Unless otherwise  agreed  by Intel  in writing, you may not remove  or alter
-! this  notice or  any other notice embedded  in Materials by Intel or Intel's
-! suppliers or licensors in any way.
-
-!*****************************************************************************
-! Content:
-!    Intel(R) Math Kernel Library (MKL)
-!    Discrete Fourier Transform Interface (DFTI)
-!*****************************************************************************
-
-MODULE MKL_DFT_TYPE
-
-  TYPE, PUBLIC :: DFTI_DESCRIPTOR
-     PRIVATE
-     INTEGER :: dontuse
-     ! Structure of this type is not used in Fortran code
-     ! the pointer to this type is used only
-  END TYPE DFTI_DESCRIPTOR
-
-  !======================================================================
-  ! These real type kind parameters are not for direct use
-  !======================================================================
-
-  INTEGER, PARAMETER :: DFTI_SPKP = SELECTED_REAL_KIND(6,37)
-  INTEGER, PARAMETER :: DFTI_DPKP = SELECTED_REAL_KIND(15,307)
-
-  !======================================================================
-  ! Descriptor configuration parameters [default values in brackets]
-  !======================================================================
-
-  ! Domain for forward transform. No default value
-  INTEGER, PARAMETER :: DFTI_FORWARD_DOMAIN = 0
-
-  ! Dimensionality, or rank. No default value
-  INTEGER, PARAMETER :: DFTI_DIMENSION = 1
-
-  ! Length(s) of transform. No default value
-  INTEGER, PARAMETER :: DFTI_LENGTHS = 2
-
-  ! Floating point precision. No default value
-  INTEGER, PARAMETER :: DFTI_PRECISION = 3
-
-  ! Scale factor for forward transform [1.0]
-  INTEGER, PARAMETER :: DFTI_FORWARD_SCALE = 4
-
-  ! Scale factor for backward transform [1.0]
-  INTEGER, PARAMETER :: DFTI_BACKWARD_SCALE = 5
-
-  ! Exponent sign for forward transform [DFTI_NEGATIVE]
-  ! INTEGER, PARAMETER :: DFTI_FORWARD_SIGN = 6 ! NOT IMPLEMENTED
-
-  ! Number of data sets to be transformed [1]
-  INTEGER, PARAMETER :: DFTI_NUMBER_OF_TRANSFORMS = 7
-
-  ! Storage of finite complex-valued sequences in complex domain
-  ! [DFTI_COMPLEX_COMPLEX]
-  INTEGER, PARAMETER :: DFTI_COMPLEX_STORAGE = 8
-
-  ! Storage of finite real-valued sequences in real domain
-  ! [DFTI_REAL_REAL]
-  INTEGER, PARAMETER :: DFTI_REAL_STORAGE = 9
-
-  ! Storage of finite complex-valued sequences in conjugate-even
-  ! domain [DFTI_COMPLEX_REAL]
-  INTEGER, PARAMETER :: DFTI_CONJUGATE_EVEN_STORAGE = 10
-
-  ! Placement of result [DFTI_INPLACE]
-  INTEGER, PARAMETER :: DFTI_PLACEMENT = 11
-
-  ! Generalized strides for input data layout
-  ! [tigth, col-major for Fortran]
-  INTEGER, PARAMETER :: DFTI_INPUT_STRIDES = 12
-
-  ! Generalized strides for output data layout
-  ! [tigth, col-major for Fortran]
-  INTEGER, PARAMETER :: DFTI_OUTPUT_STRIDES = 13
-
-  ! Distance between first input elements for multiple transforms [0]
-  INTEGER, PARAMETER :: DFTI_INPUT_DISTANCE = 14
-
-  ! Distance between first output elements for multiple transforms [0]
-  INTEGER, PARAMETER :: DFTI_OUTPUT_DISTANCE = 15
-
-  ! Effort spent in initialization [DFTI_MEDIUM]
-  ! INTEGER, PARAMETER :: DFTI_INITIALIZATION_EFFORT = 16 ! NOT IMPLEMENTED
-
-  ! Use of workspace during computation [DFTI_ALLOW]
-  INTEGER, PARAMETER :: DFTI_WORKSPACE = 17
-
-  ! Ordering of the result [DFTI_ORDERED]
-  INTEGER, PARAMETER :: DFTI_ORDERING = 18
-
-  ! Possible transposition of result [DFTI_NONE]
-  INTEGER, PARAMETER :: DFTI_TRANSPOSE = 19
-
-  ! User-settable descriptor name [""]
-  INTEGER, PARAMETER :: DFTI_DESCRIPTOR_NAME = 20
-
-  ! Packing format for DFTI_COMPLEX_REAL storage of finite
-  ! conjugate-even sequences [DFTI_CCS_FORMAT]
-  INTEGER, PARAMETER :: DFTI_PACKED_FORMAT = 21
-
-  ! Commit status of the descriptor. Read-only parameter
-  INTEGER, PARAMETER :: DFTI_COMMIT_STATUS = 22
-
-  ! Version string for this DFTI implementation. Read-only parameter
-  INTEGER, PARAMETER :: DFTI_VERSION = 23
-
-  ! Ordering of the forward transform. Read-only parameter
-  ! INTEGER, PARAMETER :: DFTI_FORWARD_ORDERING = 24 ! NOT IMPLEMENTED
-
-  ! Ordering of the backward transform. Read-only parameter
-  ! INTEGER, PARAMETER :: DFTI_BACKWARD_ORDERING = 25 ! NOT IMPLEMENTED
-
-  ! Number of user threads that share the descriptor [1]
-  INTEGER, PARAMETER :: DFTI_NUMBER_OF_USER_THREADS = 26
-
-  !======================================================================
-  ! Values of the descriptor configuration parameters
-  !======================================================================
-
-  ! DFTI_COMMIT_STATUS
-  INTEGER, PARAMETER :: DFTI_COMMITTED = 30
-  INTEGER, PARAMETER :: DFTI_UNCOMMITTED = 31
-
-  ! DFTI_FORWARD_DOMAIN
-  INTEGER, PARAMETER :: DFTI_COMPLEX = 32
-  INTEGER, PARAMETER :: DFTI_REAL = 33
-  ! INTEGER, PARAMETER :: DFTI_CONJUGATE_EVEN = 34 ! NOT IMPLEMENTED
-
-  ! DFTI_PRECISION
-  INTEGER, PARAMETER :: DFTI_SINGLE = 35
-  INTEGER, PARAMETER :: DFTI_DOUBLE = 36
-
-  ! DFTI_PRECISION for reduced size of statically linked application.
-  ! Recommended use: modify statement 'USE MKL_DFTI' in your program,
-  ! so that it reads as either of:
-  ! USE MKL_DFTI, FORGET=>DFTI_SINGLE, DFTI_SINGLE=>DFTI_SINGLE_R
-  ! USE MKL_DFTI, FORGET=>DFTI_DOUBLE, DFTI_DOUBLE=>DFTI_DOUBLE_R
-  ! where word 'FORGET' can be any name not used in the program.
-  REAL(DFTI_SPKP), PARAMETER :: DFTI_SINGLE_R = 35
-  REAL(DFTI_DPKP), PARAMETER :: DFTI_DOUBLE_R = 36
-
-  ! DFTI_FORWARD_SIGN
-  ! INTEGER, PARAMETER :: DFTI_NEGATIVE = 37 ! NOT IMPLEMENTED
-  ! INTEGER, PARAMETER :: DFTI_POSITIVE = 38 ! NOT IMPLEMENTED
-
-  ! DFTI_COMPLEX_STORAGE and DFTI_CONJUGATE_EVEN_STORAGE
-  INTEGER, PARAMETER :: DFTI_COMPLEX_COMPLEX = 39
-  INTEGER, PARAMETER :: DFTI_COMPLEX_REAL = 40
-
-  ! DFTI_REAL_STORAGE
-  INTEGER, PARAMETER :: DFTI_REAL_COMPLEX = 41
-  INTEGER, PARAMETER :: DFTI_REAL_REAL = 42
-
-  ! DFTI_PLACEMENT
-  INTEGER, PARAMETER :: DFTI_INPLACE = 43 ! Result overwrites input
-  INTEGER, PARAMETER :: DFTI_NOT_INPLACE  = 44 ! Have another place for result
-
-  ! DFTI_INITIALIZATION_EFFORT
-  ! INTEGER, PARAMETER :: DFTI_LOW = 45 ! NOT IMPLEMENTED
-  ! INTEGER, PARAMETER :: DFTI_MEDIUM = 46 ! NOT IMPLEMENTED
-  ! INTEGER, PARAMETER :: DFTI_HIGH = 47 ! NOT IMPLEMENTED
-
-  ! DFTI_ORDERING
-  INTEGER, PARAMETER :: DFTI_ORDERED = 48
-  INTEGER, PARAMETER :: DFTI_BACKWARD_SCRAMBLED = 49
-  ! INTEGER, PARAMETER :: DFTI_FORWARD_SCRAMBLED  = 50 ! NOT IMPLEMENTED
-
-  ! Allow/avoid certain usages
-  INTEGER, PARAMETER :: DFTI_ALLOW = 51 ! Allow transposition or workspace
-  INTEGER, PARAMETER :: DFTI_AVOID = 52 ! Avoid auxiliary storage
-  INTEGER, PARAMETER :: DFTI_NONE = 53
-
-  ! DFTI_PACKED_FORMAT
-  ! (for storing congugate-even finite sequence in real array)
-  INTEGER, PARAMETER :: DFTI_CCS_FORMAT = 54  ! Complex conjugate-symmetric
-  INTEGER, PARAMETER :: DFTI_PACK_FORMAT = 55 ! Pack format for real DFT
-  INTEGER, PARAMETER :: DFTI_PERM_FORMAT = 56 ! Perm format for real DFT
-  INTEGER, PARAMETER :: DFTI_CCE_FORMAT = 57  ! Complex conjugate-even
-
-  !======================================================================
-  ! Error classes
-  !======================================================================
-  INTEGER, PARAMETER :: DFTI_NO_ERROR = 0
-  INTEGER, PARAMETER :: DFTI_MEMORY_ERROR = 1
-  INTEGER, PARAMETER :: DFTI_INVALID_CONFIGURATION = 2
-  INTEGER, PARAMETER :: DFTI_INCONSISTENT_CONFIGURATION = 3
-  INTEGER, PARAMETER :: DFTI_MULTITHREADED_ERROR = 4
-  INTEGER, PARAMETER :: DFTI_BAD_DESCRIPTOR = 5
-  INTEGER, PARAMETER :: DFTI_UNIMPLEMENTED = 6
-  INTEGER, PARAMETER :: DFTI_MKL_INTERNAL_ERROR = 7
-  INTEGER, PARAMETER :: DFTI_NUMBER_OF_THREADS_ERROR = 8
-  INTEGER, PARAMETER :: DFTI_1D_LENGTH_EXCEEDS_INT32 = 9
-
-  ! Maximum length of error string
-  INTEGER, PARAMETER :: DFTI_MAX_MESSAGE_LENGTH = 80
-
-  ! Maximum length of user-settable descriptor name
-  INTEGER, PARAMETER :: DFTI_MAX_NAME_LENGTH = 10
-
-  ! Maximum length of MKL version string
-  INTEGER, PARAMETER :: DFTI_VERSION_LENGTH = 198
-
-  ! (deprecated parameter)
-  INTEGER, PARAMETER :: DFTI_ERROR_CLASS = 60
-
-END MODULE MKL_DFT_TYPE
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/mkl_dfti.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/mkl_dfti.f90	(revision 5106)
+++ 	(revision )
@@ -1,528 +1,0 @@
-!*****************************************************************************
-! Copyright(C) 2002-2011 Intel Corporation. All Rights Reserved.
-
-! The source code, information  and  material ("Material") contained herein is
-! owned  by Intel Corporation or its suppliers or licensors, and title to such
-! Material remains  with Intel Corporation  or its suppliers or licensors. The
-! Material  contains proprietary information  of  Intel or  its  suppliers and
-! licensors. The  Material is protected by worldwide copyright laws and treaty
-! provisions. No  part  of  the  Material  may  be  used,  copied, reproduced,
-! modified, published, uploaded, posted, transmitted, distributed or disclosed
-! in any way  without Intel's  prior  express written  permission. No  license
-! under  any patent, copyright  or  other intellectual property rights  in the
-! Material  is  granted  to  or  conferred  upon  you,  either  expressly,  by
-! implication, inducement,  estoppel or  otherwise.  Any  license  under  such
-! intellectual  property  rights must  be express  and  approved  by  Intel in
-! writing.
-
-! *Third Party trademarks are the property of their respective owners.
-
-! Unless otherwise  agreed  by Intel  in writing, you may not remove  or alter
-! this  notice or  any other notice embedded  in Materials by Intel or Intel's
-! suppliers or licensors in any way.
-
-!*****************************************************************************
-! Content:
-!    Intel(R) Math Kernel Library (MKL)
-!    Discrete Fourier Transform Interface (DFTI)
-!*****************************************************************************
-
-
-MODULE MKL_DFTI
-
-  USE MKL_DFT_TYPE
-
-  INTERFACE DftiCreateDescriptor
-
-     FUNCTION dfti_create_descriptor_1d(desc, precision, domain, dim, length)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_create_descriptor_1d
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_create_descriptor_1d
-       INTEGER dfti_create_descriptor_1d
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       INTEGER, INTENT(IN) :: precision
-       INTEGER, INTENT(IN) :: domain
-       INTEGER, INTENT(IN) :: dim, length
-     END FUNCTION dfti_create_descriptor_1d
-
-     FUNCTION dfti_create_descriptor_highd(desc, precision, domain, dim,length)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_create_descriptor_highd
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_create_descriptor_highd
-       INTEGER dfti_create_descriptor_highd
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       INTEGER, INTENT(IN) :: precision
-       INTEGER, INTENT(IN) :: domain
-       INTEGER, INTENT(IN) :: dim
-       INTEGER, INTENT(IN), DIMENSION(*) :: length
-     END FUNCTION dfti_create_descriptor_highd
-
-     FUNCTION dfti_create_descriptor_s_1d(desc, s, dom, one, dim)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_create_descriptor_s_1d
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_create_descriptor_s_1d
-       INTEGER dfti_create_descriptor_s_1d
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_SPKP), INTENT(IN) :: s
-       INTEGER, INTENT(IN) :: dom
-       INTEGER, INTENT(IN) :: one
-       INTEGER, INTENT(IN) :: dim
-     END FUNCTION dfti_create_descriptor_s_1d
-
-     FUNCTION dfti_create_descriptor_s_md(desc, s, dom, many, dims)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_create_descriptor_s_md
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_create_descriptor_s_md
-       INTEGER dfti_create_descriptor_s_md
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_SPKP), INTENT(IN) :: s
-       INTEGER, INTENT(IN) :: dom
-       INTEGER, INTENT(IN) :: many
-       INTEGER, INTENT(IN), DIMENSION(*) :: dims
-     END FUNCTION dfti_create_descriptor_s_md
-
-     FUNCTION dfti_create_descriptor_d_1d(desc, d, dom, one, dim)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_create_descriptor_d_1d
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_create_descriptor_d_1d
-       INTEGER dfti_create_descriptor_d_1d
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_DPKP), INTENT(IN) :: d
-       INTEGER, INTENT(IN) :: dom
-       INTEGER, INTENT(IN) :: one
-       INTEGER, INTENT(IN) :: dim
-     END FUNCTION dfti_create_descriptor_d_1d
-
-     FUNCTION dfti_create_descriptor_d_md(desc, d, dom, many, dims)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_create_descriptor_d_md
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_create_descriptor_d_md
-       INTEGER dfti_create_descriptor_d_md
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_DPKP), INTENT(IN) :: d
-       INTEGER, INTENT(IN) :: dom
-       INTEGER, INTENT(IN) :: many
-       INTEGER, INTENT(IN), DIMENSION(*) :: dims
-     END FUNCTION dfti_create_descriptor_d_md
-
-  END INTERFACE
-
-  INTERFACE DftiCopyDescriptor
-
-     FUNCTION dfti_copy_descriptor_external(desc, new_desc)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_copy_descriptor_external
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_copy_descriptor_external
-       INTEGER dfti_copy_descriptor_external
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       TYPE(DFTI_DESCRIPTOR), POINTER :: new_desc
-     END FUNCTION dfti_copy_descriptor_external
-
-  END INTERFACE
-
-  INTERFACE DftiCommitDescriptor
-
-     FUNCTION dfti_commit_descriptor_external(desc)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_commit_descriptor_external
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_commit_descriptor_external
-       INTEGER dfti_commit_descriptor_external
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-     END FUNCTION dfti_commit_descriptor_external
-
-  END INTERFACE
-
-  INTERFACE DftiSetValue
-
-     FUNCTION dfti_set_value_intval(desc, OptName, IntVal)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_set_value_intval
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_set_value_intval
-       INTEGER dfti_set_value_intval
-       INTEGER, INTENT(IN) :: OptName
-       INTEGER, INTENT(IN) :: IntVal
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-     END FUNCTION dfti_set_value_intval
-
-     FUNCTION dfti_set_value_sglval(desc, OptName, sglval)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_set_value_sglval
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_set_value_sglval
-       INTEGER dfti_set_value_sglval
-       INTEGER, INTENT(IN) :: OptName
-       REAL(DFTI_SPKP), INTENT(IN) :: sglval
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-     END FUNCTION dfti_set_value_sglval
-
-     FUNCTION dfti_set_value_dblval(desc, OptName, DblVal)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_set_value_dblval
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_set_value_dblval
-       INTEGER dfti_set_value_dblval
-       INTEGER, INTENT(IN) :: OptName
-       REAL(DFTI_DPKP), INTENT(IN) :: DblVal
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-     END FUNCTION dfti_set_value_dblval
-
-     FUNCTION dfti_set_value_intvec(desc, OptName, IntVec)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_set_value_intvec
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_set_value_intvec
-       INTEGER dfti_set_value_intvec
-       INTEGER, INTENT(IN) :: OptName
-       INTEGER, INTENT(IN), DIMENSION(*) :: IntVec
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-     END FUNCTION dfti_set_value_intvec
-
-     FUNCTION dfti_set_value_chars(desc, OptName, Chars)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_set_value_chars
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_set_value_chars
-       INTEGER dfti_set_value_chars
-       INTEGER, INTENT(IN) :: OptName
-       CHARACTER(*), INTENT(IN) :: Chars
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-     END FUNCTION dfti_set_value_chars
-
-  END INTERFACE
-
-  INTERFACE DftiGetValue
-
-     FUNCTION dfti_get_value_intval(desc, OptName, IntVal)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_get_value_intval
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_get_value_intval
-       INTEGER dfti_get_value_intval
-       INTEGER, INTENT(IN) :: OptName
-       INTEGER, INTENT(OUT) :: IntVal
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-     END FUNCTION dfti_get_value_intval
-
-     FUNCTION dfti_get_value_sglval(desc, OptName, sglval)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_get_value_sglval
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_get_value_sglval
-       INTEGER dfti_get_value_sglval
-       INTEGER, INTENT(IN) :: OptName
-       REAL(DFTI_SPKP), INTENT(OUT) :: sglval
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-     END FUNCTION dfti_get_value_sglval
-
-     FUNCTION dfti_get_value_dblval(desc, OptName, DblVal)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_get_value_dblval
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_get_value_dblval
-       INTEGER dfti_get_value_dblval
-       INTEGER, INTENT(IN) :: OptName
-       REAL(DFTI_DPKP), INTENT(OUT) :: DblVal
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-     END FUNCTION dfti_get_value_dblval
-
-     FUNCTION dfti_get_value_intvec(desc, OptName, IntVec)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_get_value_intvec
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_get_value_intvec
-       INTEGER dfti_get_value_intvec
-       INTEGER, INTENT(IN) :: OptName
-       INTEGER, INTENT(OUT), DIMENSION(*) :: IntVec
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-     END FUNCTION dfti_get_value_intvec
-
-     FUNCTION dfti_get_value_chars(desc, OptName, Chars)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_get_value_chars
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_get_value_chars
-       INTEGER dfti_get_value_chars
-       INTEGER, INTENT(IN) :: OptName
-       CHARACTER(*), INTENT(OUT) :: Chars
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-     END FUNCTION dfti_get_value_chars
-
-  END INTERFACE
-
-  INTERFACE DftiComputeForward
-
-     FUNCTION dfti_compute_forward_s(desc,sSrcDst)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_forward_s
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_s
-       INTEGER dfti_compute_forward_s
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_SPKP), INTENT(INOUT), DIMENSION(*) :: sSrcDst
-     END FUNCTION dfti_compute_forward_s
-
-     FUNCTION dfti_compute_forward_c(desc,cSrcDst)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_forward_c
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_c
-       INTEGER dfti_compute_forward_c
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       COMPLEX(DFTI_SPKP), INTENT(INOUT), DIMENSION(*) :: cSrcDst
-     END FUNCTION dfti_compute_forward_c
-
-     FUNCTION dfti_compute_forward_ss(desc,sSrcDstRe,sSrcDstIm)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_forward_ss
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_ss
-       INTEGER dfti_compute_forward_ss
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_SPKP), DIMENSION(*) :: sSrcDstRe
-       REAL(DFTI_SPKP), DIMENSION(*) :: sSrcDstIm
-     END FUNCTION dfti_compute_forward_ss
-
-     FUNCTION dfti_compute_forward_sc(desc,sSrc,cDst)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_forward_sc
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_sc
-       INTEGER dfti_compute_forward_sc
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_SPKP), INTENT(IN), DIMENSION(*) :: sSrc
-       COMPLEX(DFTI_SPKP), INTENT(OUT), DIMENSION(*) :: cDst
-     END FUNCTION dfti_compute_forward_sc
-
-     FUNCTION dfti_compute_forward_cc(desc,cSrc,cDst)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_forward_cc
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_cc
-       INTEGER dfti_compute_forward_cc
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       COMPLEX(DFTI_SPKP), INTENT(IN), DIMENSION(*) :: cSrc
-       COMPLEX(DFTI_SPKP), INTENT(OUT), DIMENSION(*) :: cDst
-     END FUNCTION dfti_compute_forward_cc
-
-     FUNCTION dfti_compute_forward_ssss(desc,sSrcRe,sSrcIm,sDstRe,sDstIm)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_forward_ssss
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_ssss
-       INTEGER dfti_compute_forward_ssss
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_SPKP), INTENT(IN), DIMENSION(*) :: sSrcRe
-       REAL(DFTI_SPKP), INTENT(IN), DIMENSION(*) :: sSrcIm
-       REAL(DFTI_SPKP), INTENT(OUT), DIMENSION(*) :: sDstRe
-       REAL(DFTI_SPKP), INTENT(OUT), DIMENSION(*) :: sDstIm
-     END FUNCTION dfti_compute_forward_ssss
-
-     FUNCTION dfti_compute_forward_d(desc,dSrcDst)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_forward_d
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_d
-       INTEGER dfti_compute_forward_d
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_DPKP), INTENT(INOUT), DIMENSION(*) :: dSrcDst
-     END FUNCTION dfti_compute_forward_d
-
-     FUNCTION dfti_compute_forward_z(desc,zSrcDst)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_forward_z
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_z
-       INTEGER dfti_compute_forward_z
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       COMPLEX(DFTI_DPKP), INTENT(INOUT), DIMENSION(*) :: zSrcDst
-     END FUNCTION dfti_compute_forward_z
-
-     FUNCTION dfti_compute_forward_dd(desc,dSrcDstRe,dSrcDstIm)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_forward_dd
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_dd
-       INTEGER dfti_compute_forward_dd
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_DPKP), DIMENSION(*) :: dSrcDstRe
-       REAL(DFTI_DPKP), DIMENSION(*) :: dSrcDstIm
-     END FUNCTION dfti_compute_forward_dd
-
-     FUNCTION dfti_compute_forward_dz(desc,dSrc,zDst)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_forward_dz
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_dz
-       INTEGER dfti_compute_forward_dz
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_DPKP), INTENT(IN), DIMENSION(*) :: dSrc
-       COMPLEX(DFTI_DPKP), INTENT(OUT), DIMENSION(*) :: zDst
-     END FUNCTION dfti_compute_forward_dz
-
-     FUNCTION dfti_compute_forward_zz(desc,zSrc,zDst)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_forward_zz
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_zz
-       INTEGER dfti_compute_forward_zz
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       COMPLEX(DFTI_DPKP), INTENT(IN), DIMENSION(*) :: zSrc
-       COMPLEX(DFTI_DPKP), INTENT(OUT), DIMENSION(*) :: zDst
-     END FUNCTION dfti_compute_forward_zz
-
-     FUNCTION dfti_compute_forward_dddd(desc,dSrcRe,dSrcIm,dDstRe,dDstIm)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_forward_dddd
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_forward_dddd
-       INTEGER dfti_compute_forward_dddd
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_DPKP), INTENT(IN), DIMENSION(*) :: dSrcRe
-       REAL(DFTI_DPKP), INTENT(IN), DIMENSION(*) :: dSrcIm
-       REAL(DFTI_DPKP), INTENT(OUT), DIMENSION(*) :: dDstRe
-       REAL(DFTI_DPKP), INTENT(OUT), DIMENSION(*) :: dDstIm
-     END FUNCTION dfti_compute_forward_dddd
-
-  END INTERFACE DftiComputeForward
-
-  INTERFACE DftiComputeBackward
-
-     FUNCTION dfti_compute_backward_s(desc,sSrcDst)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_backward_s
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_s
-       INTEGER dfti_compute_backward_s
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_SPKP), INTENT(INOUT), DIMENSION(*) :: sSrcDst
-     END FUNCTION dfti_compute_backward_s
-
-     FUNCTION dfti_compute_backward_c(desc,cSrcDst)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_backward_c
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_c
-       INTEGER dfti_compute_backward_c
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       COMPLEX(DFTI_SPKP), INTENT(INOUT), DIMENSION(*) :: cSrcDst
-     END FUNCTION dfti_compute_backward_c
-
-     FUNCTION dfti_compute_backward_ss(desc,sSrcDstRe,sSrcDstIm)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_backward_ss
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_ss
-       INTEGER dfti_compute_backward_ss
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_SPKP), DIMENSION(*) :: sSrcDstRe
-       REAL(DFTI_SPKP), DIMENSION(*) :: sSrcDstIm
-     END FUNCTION dfti_compute_backward_ss
-
-     FUNCTION dfti_compute_backward_cs(desc,cSrc,sDst)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_backward_cs
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_cs
-       INTEGER dfti_compute_backward_cs
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       COMPLEX(DFTI_SPKP), INTENT(IN), DIMENSION(*) :: cSrc
-       REAL(DFTI_SPKP), INTENT(OUT), DIMENSION(*) :: sDst
-     END FUNCTION dfti_compute_backward_cs
-
-     FUNCTION dfti_compute_backward_cc(desc,cSrc,cDst)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_backward_cc
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_cc
-       INTEGER dfti_compute_backward_cc
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       COMPLEX(DFTI_SPKP), INTENT(IN), DIMENSION(*) :: cSrc
-       COMPLEX(DFTI_SPKP), INTENT(OUT), DIMENSION(*) :: cDst
-     END FUNCTION dfti_compute_backward_cc
-
-     FUNCTION dfti_compute_backward_ssss(desc,sSrcRe,sSrcIm,sDstRe,sDstIm)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_backward_ssss
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_ssss
-       INTEGER dfti_compute_backward_ssss
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_SPKP), INTENT(IN), DIMENSION(*) :: sSrcRe
-       REAL(DFTI_SPKP), INTENT(IN), DIMENSION(*) :: sSrcIm
-       REAL(DFTI_SPKP), INTENT(OUT), DIMENSION(*) :: sDstRe
-       REAL(DFTI_SPKP), INTENT(OUT), DIMENSION(*) :: sDstIm
-     END FUNCTION dfti_compute_backward_ssss
-
-     FUNCTION dfti_compute_backward_d(desc,dSrcDst)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_backward_d
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_d
-       INTEGER dfti_compute_backward_d
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_DPKP), INTENT(INOUT), DIMENSION(*) :: dSrcDst
-     END FUNCTION dfti_compute_backward_d
-
-     FUNCTION dfti_compute_backward_z(desc,zSrcDst)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_backward_z
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_z
-       INTEGER dfti_compute_backward_z
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       COMPLEX(DFTI_DPKP), INTENT(INOUT), DIMENSION(*) :: zSrcDst
-     END FUNCTION dfti_compute_backward_z
-
-     FUNCTION dfti_compute_backward_dd(desc,dSrcDstRe,dSrcDstIm)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_backward_dd
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_dd
-       INTEGER dfti_compute_backward_dd
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_DPKP), DIMENSION(*) :: dSrcDstRe
-       REAL(DFTI_DPKP), DIMENSION(*) :: dSrcDstIm
-     END FUNCTION dfti_compute_backward_dd
-
-     FUNCTION dfti_compute_backward_zd(desc,zSrc,dDst)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_backward_zd
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_zd
-       INTEGER dfti_compute_backward_zd
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       COMPLEX(DFTI_DPKP), INTENT(IN), DIMENSION(*) :: zSrc
-       REAL(DFTI_DPKP), INTENT(OUT), DIMENSION(*) :: dDst
-     END FUNCTION dfti_compute_backward_zd
-
-     FUNCTION dfti_compute_backward_zz(desc,zSrc,zDst)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_backward_zz
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_zz
-       INTEGER dfti_compute_backward_zz
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       COMPLEX(DFTI_DPKP), INTENT(IN), DIMENSION(*) :: zSrc
-       COMPLEX(DFTI_DPKP), INTENT(OUT), DIMENSION(*) :: zDst
-     END FUNCTION dfti_compute_backward_zz
-
-     FUNCTION dfti_compute_backward_dddd(desc,dSrcRe,dSrcIm,dDstRe,dDstIm)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_compute_backward_dddd
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_compute_backward_dddd
-       INTEGER dfti_compute_backward_dddd
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-       REAL(DFTI_DPKP), INTENT(IN), DIMENSION(*) :: dSrcRe
-       REAL(DFTI_DPKP), INTENT(IN), DIMENSION(*) :: dSrcIm
-       REAL(DFTI_DPKP), INTENT(OUT), DIMENSION(*) :: dDstRe
-       REAL(DFTI_DPKP), INTENT(OUT), DIMENSION(*) :: dDstIm
-     END FUNCTION dfti_compute_backward_dddd
-
-  END INTERFACE DftiComputeBackward
-
-  INTERFACE DftiFreeDescriptor
-
-     FUNCTION dfti_free_descriptor_external(desc)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_free_descriptor_external
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_free_descriptor_external
-       INTEGER dfti_free_descriptor_external
-       TYPE(DFTI_DESCRIPTOR), POINTER :: desc
-     END FUNCTION dfti_free_descriptor_external
-
-  END INTERFACE
-
-  INTERFACE DftiErrorClass
-
-     FUNCTION dfti_error_class_external(Status, ErrorClass)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_error_class_external
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_error_class_external
-       LOGICAL dfti_error_class_external
-       INTEGER, INTENT(IN) :: Status
-       INTEGER, INTENT(IN) :: ErrorClass
-     END FUNCTION dfti_error_class_external
-
-  END INTERFACE
-
-  INTERFACE DftiErrorMessage
-
-     FUNCTION dfti_error_message_external(Status)
-       USE MKL_DFT_TYPE
-       !DEC$ ATTRIBUTES C :: dfti_error_message_external
-       !DEC$ ATTRIBUTES REFERENCE :: dfti_error_message_external
-       CHARACTER(LEN=DFTI_MAX_MESSAGE_LENGTH) :: dfti_error_message_external
-       INTEGER, INTENT(IN) :: Status
-     END FUNCTION dfti_error_message_external
-
-  END INTERFACE
-
-END MODULE MKL_DFTI
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/mod_fft.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/mod_fft.F90	(revision 5106)
+++ 	(revision )
@@ -1,17 +1,0 @@
-MODULE mod_fft
-
-#ifdef FFT_MATHKEISAN
-  USE mod_fft_mathkeisan
-#else
-#ifdef FFT_FFTW
-  USE mod_fft_fftw
-#else
-#ifdef FFT_MKL
-  USE mod_fft_mkl
-#else
-  USE mod_fft_wrapper
-#endif
-#endif
-#endif
-
-END MODULE mod_fft
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/mod_fft_fftw.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/mod_fft_fftw.F90	(revision 5106)
+++ 	(revision )
@@ -1,113 +1,0 @@
-
-! $Id$
-
-MODULE mod_fft_fftw
-
-#ifdef FFT_FFTW
-
-  REAL, SAVE                   :: scale_factor
-  INTEGER, SAVE                :: vsize
-  INTEGER, PARAMETER           :: inc=1
-  
-  INTEGER*8, ALLOCATABLE, DIMENSION(:), SAVE :: plan_forward
-  INTEGER*8, ALLOCATABLE, DIMENSION(:), SAVE :: plan_backward
-  
-CONTAINS
-  
-  SUBROUTINE Init_fft(iim,nvectmax)
-  IMPLICIT NONE
-#include <fftw3.f>
-    INTEGER :: iim
-    INTEGER :: nvectmax
-
-    INTEGER :: itmp
-
-    INTEGER               :: rank
-    INTEGER               :: howmany
-    INTEGER               :: istride, idist
-    INTEGER               :: ostride, odist
-    INTEGER, DIMENSION(1) :: n_array, inembed, onembed
-
-    REAL,    DIMENSION(iim+1,nvectmax) :: dbidon
-    COMPLEX, DIMENSION(iim/2+1,nvectmax) :: cbidon
-
-    vsize = iim
-    scale_factor = 1./SQRT(1.*vsize)
-
-    dbidon = 0
-    cbidon = 0
-
-    ALLOCATE(plan_forward(nvectmax))
-    ALLOCATE(plan_backward(nvectmax))
-    
-    WRITE(*,*)"!---------------------!"
-    WRITE(*,*)"!                     !"
-    WRITE(*,*)"! INITIALISATION FFTW !"
-    WRITE(*,*)"!                     !"
-    WRITE(*,*)"!---------------------!"
-    
-! On initialise tous les plans 
-    DO itmp = 1, nvectmax
-       rank       = 1
-       n_array(1) = iim
-       howmany    = itmp
-       inembed(1) = iim + 1 ; onembed(1) = iim/2 + 1
-       istride    = 1       ; ostride    = 1
-       idist      = iim + 1 ; odist      = iim/2 + 1
-
-       CALL dfftw_plan_many_dft_r2c(plan_forward(itmp), rank, n_array, howmany, &
-   dbidon, inembed, istride, idist, &
-   cbidon, onembed, ostride, odist, &
-   FFTW_ESTIMATE)
-
-       rank       = 1
-       n_array(1) = iim
-       howmany    = itmp
-       inembed(1) = iim/2 + 1 ; onembed(1) = iim + 1
-       istride    = 1         ; ostride    = 1
-       idist      = iim/2 + 1 ; odist      = iim + 1
-       CALL dfftw_plan_many_dft_c2r(plan_backward(itmp), rank, n_array, howmany, &
-   cbidon, inembed, istride, idist, &
-   dbidon, onembed, ostride, odist, &
-   FFTW_ESTIMATE)
-
-    ENDDO
-
-    WRITE(*,*)"!-------------------------!"
-    WRITE(*,*)"!                         !"
-    WRITE(*,*)"! FIN INITIALISATION FFTW !"
-    WRITE(*,*)"!                         !"
-    WRITE(*,*)"!-------------------------!"
-
-  END SUBROUTINE Init_fft
-  
-  
-  SUBROUTINE fft_forward(vect,TF_vect,nb_vect)
-    IMPLICIT NONE
-#include <fftw3.f>
-    INTEGER,INTENT(IN)     :: nb_vect
-    REAL,INTENT(IN)        :: vect(vsize+inc,nb_vect)
-    COMPLEX,INTENT(OUT) :: TF_vect(vsize/2+1,nb_vect)
-
-    CALL dfftw_execute_dft_r2c(plan_forward(nb_vect),vect,TF_vect)
-
-    TF_vect = scale_factor * TF_vect
-
-  END SUBROUTINE fft_forward
-  
-  SUBROUTINE fft_backward(TF_vect,vect,nb_vect)
-    IMPLICIT NONE
-#include <fftw3.f>
-    INTEGER,INTENT(IN)     :: nb_vect
-    REAL,INTENT(OUT)       :: vect(vsize+inc,nb_vect)
-    COMPLEX,INTENT(IN ) :: TF_vect(vsize/2+1,nb_vect)
-
-    CALL dfftw_execute_dft_c2r(plan_backward(nb_vect),TF_vect,vect)
-
-    vect = scale_factor * vect
-
-  END SUBROUTINE fft_backward
-
-#endif
-  
-END MODULE mod_fft_fftw
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/mod_fft_mathkeisan.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/mod_fft_mathkeisan.F90	(revision 5106)
+++ 	(revision )
@@ -1,67 +1,0 @@
-MODULE mod_fft_mathkeisan
-#ifdef FFT_MATHKEISAN
-
-  REAL,SAVE,ALLOCATABLE    :: Table_forward(:)
-  REAL,SAVE,ALLOCATABLE    :: Table_backward(:)
-  REAL,SAVE                :: scale_factor
-  INTEGER,SAVE             :: vsize
-  INTEGER,PARAMETER        :: inc=2
-
-CONTAINS
-  
-  SUBROUTINE Init_fft(iim,nb_vect_max)
-  IMPLICIT NONE
-    INTEGER :: iim
-    INTEGER :: nb_vect_max
-    REAL    :: rtmp=1.
-    COMPLEX :: ctmp
-    INTEGER :: itmp=1
-    INTEGER :: isign=0
-    INTEGER :: ierr
-    
-    vsize=iim
-    scale_factor=1./SQRT(1.*vsize)
-    ALLOCATE(Table_forward(2*vsize+64))
-    ALLOCATE(Table_backward(2*vsize+64))
-    
-    CALL DZFFTM(isign,vsize,itmp,scale_factor,rtmp,vsize+inc,ctmp,vsize/2+1,table_forward,rtmp,ierr)
-    
-    CALL ZDFFTM(isign,vsize,itmp,scale_factor,ctmp,vsize/2+1,rtmp,vsize+inc,table_backward,rtmp,ierr)
-
-    
-  END SUBROUTINE Init_fft
-  
-  
-  SUBROUTINE fft_forward(vect,TF_vect,nb_vect)
-    IMPLICIT NONE
-    INTEGER,INTENT(IN)  :: nb_vect
-    REAL,INTENT(IN)     :: vect(vsize+inc,nb_vect)
-    COMPLEX,INTENT(OUT) :: TF_vect(vsize/2+1,nb_vect)
-    REAL                :: work(4*vsize*nb_vect)
-    INTEGER             :: ierr
-    INTEGER, PARAMETER :: isign=-1
-    
-    work=0
-    CALL DZFFTM(isign,vsize,nb_vect,scale_factor,vect,vsize+inc,TF_vect,vsize/2+1,table_forward,work,ierr)
-  
-  END SUBROUTINE fft_forward
-  
-  SUBROUTINE fft_backward(TF_vect,vect,nb_vect)
-    IMPLICIT NONE
-    INTEGER,INTENT(IN)  :: nb_vect
-    REAL,INTENT(OUT)    :: vect(vsize+inc,nb_vect)
-    COMPLEX,INTENT(IN ) :: TF_vect(vsize/2+1,nb_vect)
-    REAL                :: work(4*vsize*nb_vect)
-    INTEGER             :: ierr
-    INTEGER, PARAMETER :: isign=1
-    
-    work(:)=0
-    CALL ZDFFTM(isign,vsize,nb_vect,scale_factor,TF_vect,vsize/2+1,vect,vsize+inc,table_backward,work,ierr)
-  
-  END SUBROUTINE fft_backward
-
-#endif
-  
-END MODULE mod_fft_mathkeisan
-
-
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/mod_fft_mkl.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/mod_fft_mkl.F90	(revision 5106)
+++ 	(revision )
@@ -1,128 +1,0 @@
-MODULE mod_fft_mkl
-#ifdef FFT_MKL
-
-  USE MKL_DFTI
-  
-  REAL,SAVE                :: scale_factor
-  INTEGER,SAVE             :: vsize
-  INTEGER,PARAMETER        :: inc=1
- 
-!  TYPE FFT_HANDLE
-!    TYPE(DFTI_DESCRIPTOR), POINTER :: Pt
-!    LOGICAL :: IsAllocated
-!  END TYPE FFT_HANDLE
-  
-!  TYPE(FFT_HANDLE),SAVE,ALLOCATABLE :: Forward_Handle(:)
-!  TYPE(FFT_HANDLE),SAVE,ALLOCATABLE :: Backward_Handle(:)
-!!$OMP THREADPRIVATE(Forward_Handle,Backward_Handle)  
-  
-CONTAINS
-  
-  SUBROUTINE Init_fft(iim,nb_vect_max)
-    IMPLICIT NONE
-    INTEGER :: iim
-    INTEGER :: nb_vect_max
-    REAL    :: rtmp=1.
-    COMPLEX :: ctmp
-    INTEGER :: itmp=1
-    INTEGER :: isign=0
-    INTEGER :: ierr
-    
-    vsize=iim
-    scale_factor=1./SQRT(1.*vsize)
-!    ALLOCATE(Forward_Handle(nb_vect_max))
-!    ALLOCATE(Backward_Handle(nb_vect_max))
-    
-!    Forward_Handle(:)%IsAllocated=.FALSE.
-!    Backward_Handle(:)%IsAllocated=.FALSE.
-    
-!    ALLOCATE(Table_forward(2*vsize+64))
-!    ALLOCATE(Table_backward(2*vsize+64))
-
-!    CALL DZFFTM(isign,vsize,itmp,scale_factor,rtmp,vsize+inc,ctmp,vsize/2+1,table_forward,rtmp,ierr)
-
-!    CALL ZDFFTM(isign,vsize,itmp,scale_factor,ctmp,vsize/2+1,rtmp,vsize+inc,table_backward,rtmp,ierr)
-
-!    ierr = DftiCreateDescriptor( FFT_Handle, DFTI_DOUBLE, DFTI_REAL, 1, vsize )
-!    ierr = DftiSetValue(FFT_Handle,DFTI_NUMBER_OF_TRANSFORMS,nb_vect)
-!    ierr = DftiSetValue(FFT_Handle,DFTI_FORWARD_SCALE,scale_factor)
-!    ierr = DftiSetValue(FFT_Handle,DFTI_BACKWARD_SCALE,scale_factor)
-!    ierr = DftiSetValue(FFT_Handle,DFTI_PLACEMENT,DFTI_NOT_INPLACE)
-!    ierr = DftiSetValue(Desc_Handle, DFTI_INPUT_DISTANCE, vsize+inc)
-!    ierr = DftiSetValue(Desc_Handle, DFTI_OUTPUT_DISTANCE, vsize)
-!    ierr = DftiCommitDescriptor( FFT_HANDLE )
-
-  END SUBROUTINE Init_fft
-  
-  
-  SUBROUTINE fft_forward(vect,TF_vect,nb_vect)
-    IMPLICIT NONE
-    INTEGER,INTENT(IN)  :: nb_vect
-    REAL,INTENT(IN)     :: vect((vsize+inc)*nb_vect)
-    COMPLEX,INTENT(OUT) :: TF_vect((vsize/2+1)*nb_vect)
-    REAL                :: work(4*vsize*nb_vect)
-    INTEGER             :: ierr
-    INTEGER, PARAMETER :: isign=-1
-    REAL               :: vect_out((vsize+inc)*nb_vect)
-    TYPE(DFTI_DESCRIPTOR), POINTER :: FFT_Handle
-    
-!    IF ( .NOT. Forward_handle(nb_vect)%IsAllocated) THEN
-      ierr = DftiCreateDescriptor( FFT_Handle, DFTI_DOUBLE, DFTI_REAL, 1, vsize )
-      ierr = DftiSetValue(FFT_Handle,DFTI_NUMBER_OF_TRANSFORMS,nb_vect)
-      ierr = DftiSetValue(FFT_Handle,DFTI_FORWARD_SCALE,scale_factor)
-      ierr = DftiSetValue(FFT_Handle,DFTI_BACKWARD_SCALE,scale_factor)
-      ierr = DftiSetValue(FFT_Handle,DFTI_PLACEMENT,DFTI_NOT_INPLACE)
-      ierr = DftiSetValue(FFT_Handle, DFTI_INPUT_DISTANCE, vsize+inc)
-      ierr = DftiSetValue(FFT_Handle, DFTI_OUTPUT_DISTANCE, (vsize/2+1)*2)
-      ierr = DftiCommitDescriptor( FFT_Handle )
-!      Forward_handle(nb_vect)%IsAllocated=.TRUE.
-!    ENDIF
-    
-    ierr = DftiComputeForward( FFT_Handle, vect, TF_vect )
-
-    ierr = DftiFreeDescriptor( FFT_Handle )
-
-!    ierr = DftiCreateDescriptor( FFT_Handle, DFTI_DOUBLE, DFTI_REAL, 1, vsize )
-!    ierr = DftiSetValue(FFT_Handle,DFTI_NUMBER_OF_TRANSFORMS,nb_vect)
-!    ierr = DftiSetValue(FFT_Handle,DFTI_FORWARD_SCALE,scale_factor)
-!    ierr = DftiSetValue(FFT_Handle,DFTI_BACKWARD_SCALE,scale_factor)
-!    ierr = DftiSetValue(FFT_Handle,DFTI_PLACEMENT,DFTI_NOT_INPLACE)
-!    ierr = DftiSetValue(FFT_HANDLE, DFTI_INPUT_DISTANCE, vsize/2+1)
-!    ierr = DftiSetValue(FFT_HANDLE, DFTI_OUTPUT_DISTANCE, vsize+inc)
-!    ierr = DftiCommitDescriptor( FFT_HANDLE )
-!    ierr = DftiComputeBackward( FFT_HANDLE, TF_vect, vect_out )
-!    ierr = DftiFreeDescriptor( FFT_HANDLE )
-
-!    CALL DZFFTM(isign,vsize,nb_vect,scale_factor,vect,vsize+inc,TF_vect,vsize/2+1,table_forward,work,ierr)
-  
-  END SUBROUTINE fft_forward
-  
-  SUBROUTINE fft_backward(TF_vect,vect,nb_vect)
-    IMPLICIT NONE
-    INTEGER,INTENT(IN)  :: nb_vect
-    REAL,INTENT(OUT)    :: vect((vsize+inc)*nb_vect)
-    COMPLEX,INTENT(IN ) :: TF_vect((vsize/2+1)*nb_vect)
-    REAL                :: work(4*vsize*nb_vect)
-    INTEGER             :: ierr
-    INTEGER, PARAMETER :: isign=1
-    TYPE(DFTI_DESCRIPTOR),POINTER :: FFT_Handle
-!    CALL ZDFFTM(isign,vsize,nb_vect,scale_factor,TF_vect,vsize/2+1,vect,vsize+inc,table_backward,work,ierr)
-!    IF ( .NOT. Backward_handle(nb_vect)%IsAllocated) THEN
-      ierr = DftiCreateDescriptor( FFT_Handle, DFTI_DOUBLE, DFTI_REAL, 1, vsize )
-      ierr = DftiSetValue(FFT_Handle,DFTI_NUMBER_OF_TRANSFORMS,nb_vect)
-      ierr = DftiSetValue(FFT_Handle,DFTI_FORWARD_SCALE,scale_factor)
-      ierr = DftiSetValue(FFT_Handle,DFTI_BACKWARD_SCALE,scale_factor)
-      ierr = DftiSetValue(FFT_Handle,DFTI_PLACEMENT,DFTI_NOT_INPLACE)
-      ierr = DftiSetValue(FFT_Handle, DFTI_INPUT_DISTANCE,  (vsize/2+1)*2)
-      ierr = DftiSetValue(FFT_Handle, DFTI_OUTPUT_DISTANCE, vsize+inc)
-      ierr = DftiCommitDescriptor( FFT_Handle )
-!      Backward_handle(nb_vect)%IsAllocated=.TRUE.
-!    ENDIF
-    ierr = DftiComputeBackward( FFT_Handle, TF_vect, vect )
-    ierr = DftiFreeDescriptor( FFT_Handle)
-  
-  END SUBROUTINE fft_backward
-
-#endif
-  
-END MODULE mod_fft_mkl
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/mod_fft_wrapper.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/mod_fft_wrapper.f90	(revision 5106)
+++ 	(revision )
@@ -1,40 +1,0 @@
-MODULE mod_fft_wrapper
-
-  INTEGER,SAVE             :: vsize
-  INTEGER,PARAMETER        :: inc=1
-
-CONTAINS
-  
-  SUBROUTINE Init_fft(iim,nb)
-  IMPLICIT NONE
-    INTEGER :: iim
-    INTEGER :: nb
-    
-    print *, "wrapper fft : une FFT doit etre specifiee a l'aide d'une clee CPP, sinon utiliser le filtre classique"
-    stop 1
-  END SUBROUTINE Init_fft
-  
-  
-  SUBROUTINE fft_forward(vect,TF_vect,nb_vect)
-    IMPLICIT NONE
-    INTEGER,INTENT(IN)  :: nb_vect
-    REAL,INTENT(IN)     :: vect(vsize+inc,nb_vect)
-    COMPLEX,INTENT(INOUT) :: TF_vect(vsize/2+1,nb_vect)
-    
-    print *, "wrapper fft : une FFT doit etre specifiee a l'aide d'une clee CPP, sinon utiliser le filtre classique"
-    stop 1
-    
-  END SUBROUTINE fft_forward
-  
-  SUBROUTINE fft_backward(TF_vect,vect,nb_vect)
-    IMPLICIT NONE
-    INTEGER,INTENT(IN)  :: nb_vect
-    REAL,INTENT(INOUT)    :: vect(vsize+inc,nb_vect)
-    COMPLEX,INTENT(IN ) :: TF_vect(vsize/2+1,nb_vect)
-  
-    print *, "wrapper fft : une FFT doit etre specifiee a l'aide d'une clee CPP, sinon utiliser le filtre classique"
-    stop 1
-    
-  END SUBROUTINE fft_backward
-  
-END MODULE mod_fft_wrapper
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/mod_filtre_fft.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/mod_filtre_fft.F90	(revision 5106)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/mod_filtre_fft.F90	(revision 5107)
@@ -12,5 +12,5 @@
   
   SUBROUTINE Init_filtre_fft(coeffu,modfrstu,jfiltnu,jfiltsu,coeffv,modfrstv,jfiltnv,jfiltsv)
-    USE mod_fft
+    USE lmdz_fft
     IMPLICIT NONE
     include 'dimensions.h'
@@ -115,5 +115,5 @@
   
   SUBROUTINE Filtre_u_fft(vect_inout,nlat,jj_begin,jj_end,nbniv)
-    USE mod_fft
+    USE lmdz_fft
 #ifdef CPP_PARA
     USE parallel_lmdz,ONLY: OMP_CHUNK
@@ -176,5 +176,5 @@
 
   SUBROUTINE Filtre_v_fft(vect_inout,nlat,jj_begin,jj_end,nbniv)
-    USE mod_fft
+    USE lmdz_fft
 #ifdef CPP_PARA
     USE parallel_lmdz,ONLY: OMP_CHUNK
@@ -238,5 +238,5 @@
 
   SUBROUTINE Filtre_inv_fft(vect_inout,nlat,jj_begin,jj_end,nbniv)
-    USE mod_fft
+    USE lmdz_fft
 #ifdef CPP_PARA
     USE parallel_lmdz,ONLY: OMP_CHUNK
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/mod_filtre_fft_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/mod_filtre_fft_loc.F90	(revision 5106)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/mod_filtre_fft_loc.F90	(revision 5107)
@@ -9,5 +9,5 @@
   
   SUBROUTINE Init_filtre_fft(coeffu,modfrstu,jfiltnu,jfiltsu,coeffv,modfrstv,jfiltnv,jfiltsv)
-    USE mod_fft
+    USE lmdz_fft
     IMPLICIT NONE
     include 'dimensions.h'
@@ -105,5 +105,5 @@
   
   SUBROUTINE Filtre_u_fft(vect_inout,jjb,jje,jj_begin,jj_end,nbniv)
-    USE mod_fft
+    USE lmdz_fft
 #ifdef CPP_PARA
     USE parallel_lmdz,ONLY: OMP_CHUNK
@@ -185,5 +185,5 @@
 
   SUBROUTINE Filtre_v_fft(vect_inout,jjb,jje,jj_begin,jj_end,nbniv)
-    USE mod_fft
+    USE lmdz_fft
 #ifdef CPP_PARA
     USE parallel_lmdz,ONLY: OMP_CHUNK
@@ -248,5 +248,5 @@
 
   SUBROUTINE Filtre_inv_fft(vect_inout,jjb,jje,jj_begin,jj_end,nbniv)
-    USE mod_fft
+    USE lmdz_fft
 #ifdef CPP_PARA
     USE parallel_lmdz,ONLY: OMP_CHUNK
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/timer_filtre.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/timer_filtre.f90	(revision 5106)
+++ 	(revision )
@@ -1,33 +1,0 @@
-MODULE timer_filtre
-IMPLICIT NONE
-  PRIVATE
-  REAL :: time
-  REAL :: Last_time
-  PUBLIC :: Init_timer, start_timer, stop_timer, Print_filtre_timer
-CONTAINS
-
- SUBROUTINE Init_timer
-   time=0
-   Last_time=0
- END SUBROUTINE Init_timer
- 
- SUBROUTINE Start_timer
-  
-   CALL cpu_time(last_time)
-
- END SUBROUTINE start_timer
- 
- 
- SUBROUTINE stop_timer
-   REAL :: T 
-   
-   CALL cpu_time(t)
-   Time=Time+t-last_time
- 
-  END SUBROUTINE stop_timer
-  
-  SUBROUTINE Print_filtre_timer
-  PRINT *,"Temps CPU passe dans le filtre :",Time
-  END SUBROUTINE  Print_filtre_timer
-
-END MODULE timer_filtre
