program slowft c Fourier Transform c time (x) in atomic units implicit none real*8 t,y,wmin,wmax,delw,arg,pi,w integer*4 n,nw,iw,iargc character*80 st,fi,fo real*8,allocatable::s(:),c(:) pi=4.0d0*atan(1.0d0) if(iargc().ne.5)then write(6,*)'Usage wmin wmax delw ' else call getarg(1,st) read(st,*)wmin call getarg(2,st) read(st,*)wmax call getarg(3,st) read(st,*)delw call getarg(4,fi) call getarg(5,fo) nw=NINT((wmax-wmin)/delw)+1 allocate(s(nw),c(nw)) do 4 iw=1,nw s(iw)=0.0d0 4 c(iw)=0.0d0 n=0 open(9,file=fi) 1 read(9,*,end=99,err=99)t,y c atomic units to fs t=t/41.3413745758d0 w=wmin-delw do 2 iw=1,nw w=w+delw arg=2.0d0*pi*w*t*3.0d10*1.0d-15 s(iw)=s(iw)+y*sin(arg) 2 c(iw)=c(iw)+y*cos(arg) n=n+1 goto 1 99 close(9) write(6,*)n,' points' if(n.gt.0)then open(9,file=fo) w=wmin-delw do 3 iw=1,nw w=w+delw 3 write(9,900)w,s(iw)**2+c(iw)**2 900 format(2g15.6) close(9) endif endif end