REPORTER 22.1
Fortran Program/Script
Fortran program/script
c
character*80 fname,line
integer elemno(5)
real timestep(5)
n=iargc(1)
c
c Read in model name argument
c
call getarg(1,fname)
c
c Open model OTF file
c
open (unit=25, file=fname, status='old')
c
c Scan file for line with the text string
c " 100 smallest timesteps"
c
10 continue
read (25,'(a)',end=900) line
if (line(1:23).eq.' 100 smallest timesteps') then
goto 20
else
goto 10
endif
c
c Read in but ignore next 2 lines of data
c
20 continue
read(25,*)
read(25,*)
c
c Read in the element no. and timestep data
c from the next five lines
c
101 format(i10)
102 format(e23.0)
c
do 30 i=1,5
read (25,'(a)') line
read (line(7:16),101) elemno(i)
read (line(20:42),102) timestep(i)
30 continue
c
c Write out the data as a text output
c
201 format (2x,i9,5x,e11.5)
c
write (*,*) ' Element No. Timestep '
do 40 i=1,5
write (*,201) elemno(i),timestep(i)
40 continue
c
c Also write out the smallest timestep as
c REPORTER variable
c
301 format ('VAR TIMESTEP VALUE="',e11.5,'"')
write(*,301) timestep(1)
goto 999
c
900 write(*,*) 'End of file reached'
c
999 continue
stop
end
c