!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' –