-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdftcode.f90
More file actions
33 lines (21 loc) · 723 Bytes
/
Copy pathdftcode.f90
File metadata and controls
33 lines (21 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
program dft
use mtmodules
implicit none
character(len=100):: infile
integer:: ifile,xcol,ycol,outfile, dftfile
real(8), allocatable :: x(:), y(:), omega(:), fre(:), fim(:)
integer:: ij, jk, ik
call getarg(1,infile) !! get the input file name
!! set the columns to analyze
write(*,*) 'Which is the column for the x?'
read(*,*) xcol
write(*,*) 'Which is the column for the y?'
read(*,*) ycol
write(*,*) ''
call reading2list(infile,xcol,ycol,x,y)
call compute_dft(x, y, omega, fre, fim)
open(newunit=dftfile, file='salida_dft_file')
do ij=1,size(omega)
write(dftfile,*) omega(ij)/(two*pi),omega(ij), fre(ij),fim(ij),fre(ij)**2.+fim(ij)**2.
end do
end program dft