all. i'm writing relatively simple program iterates through list of data , returns peak values school project.
here's code far:
program fortran_project_1 implicit none integer::cnt,cnt1, integer:: peaks=5 real, dimension(360):: time,impulse real, allocatable :: impulselist(:) integer, dimension(360)::interval character(len=150)::clean,header clean='c:\users\user\desktop\fortran_project_1\ir_clean.txt' print *, clean open (unit=1,file=clean) cnt1=1,4 read (1,*) header end cnt=1,443 read(1,*) interval(cnt),time(cnt),impulse(cnt) end print *, 'choose amount of peaks find' read *, peaks deallocate (impulselist) allocate (impulselist(peaks)) = 1, cnt if (impulse(i)>impulse(i+1) .and. impulse(i)>impulse(i-1)) peaks = peaks - 1 impulselist(peaks) = impulse(i) end if if (peaks < 1) exit end if end close (1) print *, impulselist end program fortran_project_1
anyways, when running , inputting amount of peaks user wants find, console totally blank. prints clean variable , query that's all. should do?
thank
edit: console output:
c:\users\user\desktop\fortran_project_1\ir_clean.txt
choose amount of peaks find
[input]
it strange nothing happens. should error message.
array impulselist
not allocated , calling deallocate(impulselist)
. not allowed , should diagnosed compiler , should complain when code running.
Comments
Post a Comment