dft subroutine

dft subroutine itself works but putting it inside a module requires
work, especially passing allocatable arrays.