!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
处收到一条错误消息,我无法修复。 任何帮助,不胜感激。Fortran编译错误764嵌套错误
Compile error: error 764 - Nesting error - the block IF construct on line 4079 has not been terminated
线4079:
700 if (time>1500) then
缩进你的代码。你所有的'if'语句都有相应的'endif's吗? – Ross
您应该使用缩进来更好地查看代码的结构。很有可能你错过了“结束”或类似的事情。 –
非常感谢......如果(时间> 1500),计算Pcow_positive时间= 0 r1 = R 700然后转到950 else else if' –