Find peak in the historgram data file - FORTRAN

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 4K views
gaijin1
Messages
1
Reaction score
0
Hello guys,

I have a file with X Y values (separated by space)

I want to scan the data to find the PEAK in the file. (It will probably be a lowest Y point...)

How do I do this is Fortran?

Thank you,

Alexander
 
Physics news on Phys.org
Seems like...
Code:
OPEN(11,file='inputfile.dat',form='formatted')
DO n=1,nPts
  READ(11,*) x,y
END DO
peak_val = MINVAL(y)
peak_loc = MINLOC(y)
Can you elaborate a little more on this "peak" that you need to find? Do you need to take derivatives?