1
我想在Fortran90中運行代碼的一小段snipett,並得到一個while語句的未分類的語句錯誤。我在網上查找,無法找到爲什麼這會發生一段時間的聲明。這是我收到的錯誤:Fortran90未分類的聲明雖然循環
Test.f90:11.4:
while (R < MinimumEnergy) do
1
Error: Unclassifiable statement at (1)
Test.f90:15.8:
while (f < R) do
1
Error: Unclassifiable statement at (1)
Test.f90:19.11:
enddo
1
Error: Expecting END PROGRAM statement at (1)
Test.f90:23.7:
enddo
1
Error: Expecting END PROGRAM statement at (1)
這裏是我的代碼:
program FD_Number
REAL :: MinimumEnergy = 4.5;
REAL :: a = -9;
REAL :: b = 9;
REAL R, randomN, f
REAL :: FD
FD(R) = (1 + exp(R))**(-1)
R = 0;
while (R < MinimumEnergy) do
R = 999999;
f = FD(a + (b - a)*R);
while (f < R) do
call random_number(randomN)
f = FD(a + (b - a)*randomN);
call random_number(R)
enddo
R = a + (b - a)*R;
f = FD(R);
enddo
print *, f
end