!datファイルからたわみを読み込み平均を出すプログラム
implicit real*8(a-h,o-z)
dimension x(500000),y(500000),z(500000)
character filename*128
open(7,file='tawami.dat')
nset=720
ell=0.0
do i2=100,210,10
write(filename, '("hako15-ell", i3.3, ".dat")') i2
ell=ell+2.0
open (8,file=filename)
read (8,'()')
read (8,'()')
read (8,'()')
tawamigoukei=0.0d0
do i=1,nset
read(8,*) n,x(i),y(i),z(i)
tawamigoukei=tawamigoukei+y(i)
end do
tawamiheikin=tawamigoukei/nset
close(8)
write(7,'(1pe13.5,a,1pe13.5)') ell,' ',tawamiheikin
end do
close(7)
end 
