0
我有一个简单的Fortran代码,并且出现一个错误,我找不到解决方案。有谁知道如何解决这一问题?Gfortran做循环if语句错误
subroutine sort(A,A_done,N,P)
! Sort a real array by algebraically increasing value and return the permutation that
! rearranges the array
implicit none
Integer N, TEMP1, K, L, P(N), TEMP2
real(8), dimension(:) :: A_done
real(8), dimension(:) :: A
DO K=1, N-1
DO L=K+1, N
if A(K)>A(L)
TEMP1=A(K)
TEMP2=P(K)
A(K)=A(L)
P(K)=P(L)
A(L)=TEMP1
P(L)=TEMP2
end if
END DO
END DO
A_done=A
RETURN
END
gfortran -Wall -Werror -fbounds检查-w -L -lm -o模拟readinput.for noutfile.for mean.for covariance.for correlation.for rperm.for simmain.for sort.for 在文件sort.for:13
if A(K)>A(L)
1
错误:在(1) 不可分类的语句在文件sort.for:20
end if
1
错误:期待END在(1)DO语句化妆:* [模拟]错误1
感谢您的帮助
对不起,关于这一点,我想到另一种语言,那里你知道,'如果其他'模式。 – fedvasu 2013-04-03 21:33:42
那么,我假设你看了一个语言手册,了解if块的正确语法。它告诉你什么? – eriktous 2013-04-03 22:32:52