作业帮 > 综合 > 作业

一个fortran程序无法成功运行

来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/07/19 04:55:21
一个fortran程序无法成功运行
subroutine start1(j0,j1,x)
implicit none
real*16 j0,j1,x
real*16 b,c,d,e,f,g
g=3/x
b=x/3
if(x=3)then
c=0.79788456-0.00000077*g-0.00552740*g**2-0.00009512*g**3+0.00137237*g**4-0.00072805*g**5+0.00014476*g**6
d=x-0.78539816-0.04166397*g-0.00003954*g**2+0.00262573*g**3-0.00054125*g**4-0.00029333*g**5+0.00013558*g**6
j0=x**(-0.5)*c*cos(d)
e=0.79788456+0.00000156*g+0.01659667*g**2+0.00017105*g**3-0.00249511*g**4+0.00113653*g**5-0.00020033*g**6
f=x-2.35619449+0.12499612*g+0.00005650*g**2-0.00637879*g**3+0.00074348*g**4+0.00079824*g**5-0.00029166*g**6
j1=x**(-0.5)*e*cos(f)
else
end if
end subroutine
subroutine start2(n,x,j2)
real*16 j0,j1,j2,j3,x
integer n,i
call start1(j0,j1,x)
if(n==0)then
write(*,*) j0
else if(n==1)then
write(*,*) j1
else
do i=2,n
j2=2*(i-1)/x*j1-j0
if(in) then
call start2(n,x,j)
else
call start3(n,x,j)
end if
stop
end subroutine
program main
implicit none
real*16 x1,x2,j1,j2
integer n,p,q
integer,parameter::limit=50*10**3
real,parameter::add=1/10**3
x1=0
x2=add
n=5
q=1
j1=0
j2=0
do p=1,limit
call start(n,x1,j1)
call start(n,x2,j2)
write(*,*) n,x1
if((j10).or.(j1>0.and.j2
一个fortran程序无法成功运行
因为你的 start 函数结束的地方有一个 stop
第一次运行 start 完成以后,程序就结束了,还没到输出语句呢.
如果你是想返回主程序,请使用 return,而不是 stop
stop 会结束整个程序.