我有以下子程序:
SUBROUTINE UNITARYEVOLUTION(X,Z)
IMPLICIT NONE
COMPLEX(KIND = DBL), DIMENSION(DIMMAT,1), INTENT(IN) :: X
COMPLEX(KIND = DBL),DIMENSION(DIMMAT,1),INTENT(OUT)::Z
COMPLEX(KIND = DBL), DIMENSION(DIMSYS,DIMSYS) :: TEMP1
COMPLEX(KIND = DBL), DIMENSION(DIMSYS,DIMSYS) :: TEMP2
COMPLEX(KIND = DBL), DIMENSION(DIMSYS,DIMSYS) :: TEMP3
COMPLEX(KIND = DBL), DIMENSION(DIMSYS,DIMSYS) :: TEMP4
COMPLEX(KIND = DBL), DIMENSION(DIMSYS,DIMSYS) :: TEMP5
COMPLEX(KIND = DBL), DIMENSION(DIMSYS,DIMSYS) :: TEMP6
COMPLEX(KIND = DBL), DIMENSION(DIMSYS,DIMSYS) :: TEMP7
COMPLEX(KIND = DBL), DIMENSION(DIMSYS,DIMSYS) :: TEMP8
COMPLEX(KIND = DBL), DIMENSION(DIMSYS,DIMSYS) :: UNITARY
COMPLEX(KIND = DBL), DIMENSION(DIMSYS,DIMSYS) :: UNITARYCONJ
REAL(KIND = DBL) :: T
INTEGER :: E,F,G,H,I,J
REAL(KIND = DBL) :: ALPHA = SQRT(2.0D0**2.0D0 + 2.0D0**2.0D0)
TEMP1 = COS((ALPHA*T)/2)*ID
TEMP2 = SIN((ALPHA*T)/2)*(ENERGYGAP/ALPHA)*SIGMAZ
TEMP3 = SIN((ALPHA*T)/2)*(DELTA/ALPHA)*SIGMAX
TEMP4 = TEMP2 + TEMP3
UNITARY = TEMP1 - IMU*TEMP4
UNITARYCONJ = TEMP1 + IMU*TEMP4
DO E = 1, DIMMAT
CALL INDEXCONVERTER(E,F,G)
TEMP5(F,G) = X(E,1)
END DO
TEMP6 = matmul(UNITARYCONJ,TEMP5)
TEMP7 = matmul(TEMP6,UNITARY)
DO H = 1, DIMSYS
DO I = 1, DIMSYS
CALL INVERSE(H,I,J)
TEMP8(J,1) = TEMP7(H,I)
END DO
END DO
Z = TEMP8
END SUBROUTINE UNITARYEVOLUTION
当我使用命令
使用下一个子程序来调用它时CALL UNITARYEVOLUTION(X,Z)
我收到以下错误:
Program received signal SIGABRT: Process abort signal.
Backtrace for this error:
#0 0xFFFFFFFFFFFFFFFF
#1 0xFFFFFFFFFFFFFFFF
#2 0xFFFFFFFFFFFFFFFF
#3 0xFFFFFFFFFFFFFFFF
#4 0xFFFFFFFFFFFFFFFF
#5 0xFFFFFFFFFFFFFFFF
#6 0xFFFFFFFFFFFFFFFF
#7 0xFFFFFFFFFFFFFFFF
#8 0xFFFFFFFFFFFFFFFF
#9 0xFFFFFFFFFFFFFFFF
#10 0xFFFFFFFFFFFFFFFF
#11 0xFFFFFFFFFFFFFFFF
Aborted (core dumped)
代码编译正确,但是当我执行./a.exe
命令时,我得到了这些错误。可能的错误来源?
当我删除CALL UNITARYEVOLUTION(X,Z),
时,所有内容都会正确编译。
修改
当我使用gfortran
运行-Wall -fcheck=all,
时,我收到了错误
Nonconforming tab character at (1) [-Wtabs]
几乎代码中的每一行。
答案 0 :(得分:-1)
Nonconforming tab character at (1) [-Wtabs]
指的是您在代码中插入的de标签。 Fortran不会将标签识别为空白。
尝试使用-Wtabs
选项进行编译,或者只是删除标签并改为填空。