[Fortran] 纯文本查看 复制代码
#LOCAL INTEGER N
#LOCAL INTEGER L
N=$dim
L=$ttd
#LOCAL INTEGER T1 $dim
#LOCAL REAL M $dim
#LOCAL REAL Uk $dim
#LOCAL REAL Ukk $ttd
#LOCAL REAL M1
#LOCAL REAL N1
IF ($CLK>0.9) THEN
DO I=1, N
Uk(I)=$Us1(I)
END DO
DO K=1,N
Ukk(K)=K
Ukk(N+K)=Uk(K)
END DO
IF($Iarm>0) THEN
Hld1=1.0
DO I=1, N
IF ($Ts1(I)==1) THEN
Ukk(N+I)=Ukk(N+I)*Hld1
ENDIF
END DO
DO I=1,N-1
! Flag1=1
DO J=1, N-I
IF (Ukk(N+J)>Ukk(N+J+1)) THEN
M1=Ukk(J+1)
N1=Ukk(N+J+1)
Ukk(J+1)=Ukk(J)
Ukk(J)=M1
Ukk(N+J+1)=Ukk(N+J)
Ukk(N+J)=N1
Flag1=0
ENDIF
END DO
! IF (Flag1==1) THEN
! EXIT
! ENDIF
ENDDO
DO I=1, N
T1(I)=0
ENDDO
DO I=1,$Unum
M(I)=Ukk(I)
T1(M(I))=1
END DO
ENDIF
IF($Iarm<0) THEN
Hld=1.0
DO I=1, N
IF($TS1(I)==1) THEN
Ukk(N+I)=Ukk(N+I)*Hld
ENDIF
END DO
DO I=1, N-1
Flag1=1
DO J=1, N-I
IF (Ukk(N+J)>Ukk(N+J+1)) THEN
M1=Ukk(J+1)
N1=Ukk(N+J+1)
Ukk(J+1)=Ukk(J)
Ukk(J)=M1
Ukk(N+J+1)=Ukk(N+J)
Ukk(N+J)=N1
Flag1=0
ENDIF
END DO
! IF (Flag1==1) THEN
! EXIT
! ENDIF
ENDDO
DO I=1, N
T1(I)=0
ENDDO
DO I=1, $Unum
M(I)=Ukk(N+1-I)
T1(M(I))=1
END DO
ENDIF
DO I=1, N
$TS1(I)=T1(I)
END DO
ENDIF