主题:读入文件老是出错,请指教啊
读入文件老是出错,请指教啊,下面是读入文件的子程序
*This program is called by main program
[size=5]subroutine parainput[/size]
& (n_parameter,n_measureddata,n_unknowns,order_inversedpara,
& order_knownpara,x0_unknowns,known_parameter,
& u_measured,x_lower,x_upper,esp,esp1)
implicit real*8 (a-h,o-z)
integer n_parameter,n_measureddata,n_unknowns
integer,dimension(n_unknowns):rder_inversedpara
integer,dimension(n_parameter-n_unknowns):rder_knownpara
real*8 alpha,esp,esp1
real*8,dimension(n_measureddata)::u_measured
real*8,dimension(n_unknowns)::x0_unknowns
real*8,dimension(n_parameter-n_unknowns)::known_parameter
real*8,dimension(n_unknowns)::x_lower,x_upper
*******************************
*******************************
*******************************
open
&(1,FILE='d:\inverse\input1.dat')
read(1,*)order_inversedpara
if(n_parameter-n_unknowns>0)then
read(1,*)order_knownpara
end if
read(1,*)x0_unknowns
if(n_parameter-n_unknowns>0)then
read(1,*)known_parameter
end if
read(1,*)u_measured
do i=1,n_unknowns
read(1,*)x_lower(i),x_upper(i)
end do
read(1,*)esp
read(1,*)esp1
*******************************
*******************************
*******************************
close(1)
end
编译没有错误和警告,但是运行后老是出现
[color=FF0000]forrl:severe (24):end-of-file during read,unite1 d:\inverse\input1.dat[/color],
以下是我的输入文件input.dat
1,2
3,4,5,6,7,8,9
56500,21080
21080,0.45,0.45,0.45,28500,28500,28500
0.2098,0.2098,0.2849,0.1863,0.1863
22600
56500
22600
56500
请各位大侠指教下,谢谢。
*This program is called by main program
[size=5]subroutine parainput[/size]
& (n_parameter,n_measureddata,n_unknowns,order_inversedpara,
& order_knownpara,x0_unknowns,known_parameter,
& u_measured,x_lower,x_upper,esp,esp1)
implicit real*8 (a-h,o-z)
integer n_parameter,n_measureddata,n_unknowns
integer,dimension(n_unknowns):rder_inversedpara
integer,dimension(n_parameter-n_unknowns):rder_knownpara
real*8 alpha,esp,esp1
real*8,dimension(n_measureddata)::u_measured
real*8,dimension(n_unknowns)::x0_unknowns
real*8,dimension(n_parameter-n_unknowns)::known_parameter
real*8,dimension(n_unknowns)::x_lower,x_upper
*******************************
*******************************
*******************************
open
&(1,FILE='d:\inverse\input1.dat')
read(1,*)order_inversedpara
if(n_parameter-n_unknowns>0)then
read(1,*)order_knownpara
end if
read(1,*)x0_unknowns
if(n_parameter-n_unknowns>0)then
read(1,*)known_parameter
end if
read(1,*)u_measured
do i=1,n_unknowns
read(1,*)x_lower(i),x_upper(i)
end do
read(1,*)esp
read(1,*)esp1
*******************************
*******************************
*******************************
close(1)
end
编译没有错误和警告,但是运行后老是出现
[color=FF0000]forrl:severe (24):end-of-file during read,unite1 d:\inverse\input1.dat[/color],
以下是我的输入文件input.dat
1,2
3,4,5,6,7,8,9
56500,21080
21080,0.45,0.45,0.45,28500,28500,28500
0.2098,0.2098,0.2849,0.1863,0.1863
22600
56500
22600
56500
请各位大侠指教下,谢谢。