PROGRAM test
!   IMPLICIT NONE
   USE MKL_DFTI
   REAL(KIND = DFTI_DPKP), DIMENSION(201) :: x,y,z
   COMPLEX(KIND = DFTI_DPKP), DIMENSION(201) ::x1, y1
   INTEGER :: i, status
   TYPE(DFTI_DESCRIPTOR), POINTER :: plan
   plan => null()
DO i=1,201
   x(i) = REAL(i-101)/100
   y(i)= 5*SIN(2*x(i))
END DO 

OPEN(9, file='text.txt', form = 'FORMATTED')
WRITE(9,*) 'Y values'
WRITE(9,*) y
status = dfti_create_descriptor_1d(plan, DFTI_DOUBLE, DFTI_COMPLEX, 1, 200)
status = dfti_commit_descriptor_external(plan)
DO i=1,201
status = dfti_compute_forward_dz(plan, y(i), y1(i)) 
!Using the(desc,xreinout,ximinout) argument format
ENDDO
status = dfti_free_descriptor_external(plan) 
WRITE(9,*) 'Y1 Values'
WRITE(9,*) y1
WRITE(9,*) 'Y values - After Transform'                     
WRITE(9,*) y 

END PROGRAM test
