【发布时间】:2017-04-10 21:33:05
【问题描述】:
!subroutine No.10: to calculate positive capilary pressure required
subroutine Pcow_positive1(sigma_ow,R,alpha,b,teta_ow,Pcow_positive,r1,time)
implicit none
!dummy argument declarations
double precision,intent(in)::sigma_ow
double precision,intent(in)::R
double precision,intent(in)::alpha
double precision,intent(in)::b
double precision,intent(in)::teta_ow
double precision,intent(out)::Pcow_positive
double precision,intent(out)::r1
double precision::omega_eff
double precision::A_eff
double precision::beta
double precision::Pcow
double precision::r2
double precision::error
double precision::error1
double precision::abeta
integer,intent(out)::time
!calculate Pcow_positive
time=0
r1=R
700 if (time>1500) then
goto 950
else
abeta=((b*(sin(alpha)))/(r1))
if (abeta>1.0) then
goto 900
else
end if
beta=asin(abeta)
time=time+1
A_eff=(((R**2.0)/(2.0*tan(alpha))))-(((r1)*(b)*(sin(alpha+beta)))/2.0) &
+(((((r1)**2)*(beta))/2.0))
omega_eff=(((((R)*(1.0/(tan(alpha))))-b)*(cos(teta_ow)))+((r1*beta)))
Pcow=(((sigma_ow)*(omega_eff))/(A_eff))
r2=(sigma_ow)/(Pcow)
error=abs(r2-r1)
error1=abs((sigma_ow/r2)-(sigma_ow/r1))
if (error<=0.01 .or. error1<=0.01) then
goto 800
else
r1=r2
goto 700
end if
800 r1=r2
Pcow_positive=Pcow
goto 1000
900 r1=(b*(sin(alpha)))
Pcow_positive=(sigma_ow)/(r1)
goto 1000
950 r1=(sigma_ow)/(0.0005)
Pcow_positive = 0.0005
1000 end subroutine Pcow_positive1
当我编译代码时,我在end subroutine Pcow_positive1 收到一条错误消息,我无法修复。
非常感谢任何帮助。
编译错误:错误 764 - 嵌套错误 - 第 4079 行的块 IF 构造尚未终止
第 4079 行:
700 if (time>1500) then
【问题讨论】:
-
缩进你的代码。你所有的
if语句都有对应的endifs 吗? -
您应该使用缩进来更好地查看代码的结构。您可能错过了
end if或类似的信息。 -
非常感谢...
!calculate Pcow_positive time=0 r1=R 700 if (time>1500) then goto 950 else end if
标签: fortran gfortran fortran95