Re: a.out file



let me look at it.

You see the problem is that if I type a.out then return
filein then return
I got output

however if I type a.out < infile and enter I got problem

........................................................................................
open: No such file or directory
apparent state: unit 10 named "Record Length" 2500 "Points"
-8.80000012e-009 0.0001414063
lately reading sequential formatted external IO
Abort (core dumped)
///////////////////////////////////////////////////////////////////////////////////////////
program t
c
c Author: jason
c
c
c implicit NONE
c
c constants
CHARACTER(LEN=5) :: name,gna,nama2
integer max_s
parameter (max_s = 10000) ! same as in driver prog
c arguments and common blocks

integer npar,iflag
* double precision futil, chi2, par(*), grad(*)
real sum,sy
integer num_points
real x(max_s), y(max_s), dy(max_s), zd(max_s)
common / data_block / num_points, zd, x, y, dy
c local variables
character*80 infile
character*80 line
integer i
integer ios
integer lun,luo
double precision alpha
character*80 outfile1 /'out1.dat'/
character*80 outfile2 /'out2.dat'/
c beginccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c write (*, *) 'enter file name for input data'
read (*, '(a80)') infile
lun = 10
open (unit=lun, file=infile,form='formatted',ACCESS='DIRECT',
+ status='old')
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
i = 0
ios = 0
do while ( ios .eq. 0 )
read (lun, fmt = '(a80)', iostat = ios) line
if (ios .eq. 0 .and.line(1:1) .ne. '"') then
i = i + 1
read (line, *) x(i),y(i)
endif
c endif
end do

close (lun)
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc


do i = 1,125
sy = sy + y(i)
enddo
sy =sy/125.
sum = 0.
do i = 441,900
if (y(i).le.sy) then !This is obtain from doing part c below
sum = sum+.5*abs((y(i)-sy)+(y(i+1)-sy))*(x(i+1)-x(i))
sumi = sumi+.5*abs((y(i)-sy)+(y(i+1)-sy))*((i+1)-(i))
endif
enddo
ccccccccccccccccccccccccccccccccccccccccccccccccccc

write(*,*) 'Record Length= ',zd(1),' Points'
write(*,*) 'Sample Interval= ',zd(2),' s'
write(*,*) 'Trigger Point= ',zd(3),'Samples'
write(*,*) 'Trigger Time= ',zd(4), ' s'
write(*,*) 'Horizontial Offset= ',zd(6), 's'
write(*,*) '--------------------------'
write(*,*) 'ave at far y',sy/125.
write(*,*) 'final sum',sum
write(*,*) '1',x(1),y(1)
write(*,*) '7',x(7),y(7)
write(*,*) '8',x(8),y(8)

END

***************************************************************

.