hello! I' m almost new about plato fortran. I try to write a code about discrete fourier transform. My data is made of ten values(Data is at the bottom of page). When I run it, I get error 112 at the second do loop. Please help me. Thank you for your interest.
complex y(0:100),yc dimension x(0:100),amp(0:100),phase(0:100),FRQ(0:100),b(0:100) data pi/3.1415927/ read(,) NN N=NN-1 open(3,file='veri.dat',status='old') read(3,2) (x(i),b(i), i=0,NN-1) 2 Format (f5.3,2X,F6.3) write(,5) (x(i),b(i), i=0,NN-1) 5 Format(F5.3,3X,F6.3) dt=1.0 df=1./nndt do 88 k=0,NN (SECOND LOOP BEGINS) do 89 i=0,N yc=cmplx(0,-2pikdfi) 89 y(k)=y(k)+ b(i)exp(yc) y(k)=y(k)/NN write(,) y(k) 88 CONTINUE DO 30 i=0,N FRQ(i)=idf amp(i)=cabs(y(i)) phase(i)=atan2(-aimag(y(i)),real(y(i))) write(,) amp(i),phase(i) 30 CONTINUE end program
time amplitude 0.000 1.000 1.000 2.000 2.000 3.000 3.000 2.000 4.000 0.000 5.000 -0.500 6.000 -1.000 7.000 0.000 8.000 1.000 9.000 0.500[/url][/list][/list]