
fortran程序出现运行错误,请问怎么修改?
求助大神,这是一个画能带图的程序,但是运行中出现断点,请问怎么解决。错误和程序如下integerNline,N!nlinethenumberofhighsymetryli...
求助大神,这是一个画能带图的程序,但是运行中出现断点,请问怎么解决。错误和程序如下integer Nline,N!nline the number of high symetry lines! N the number of K-points alone the symetry linesreal*8,allocatable:: Kstart(:,:),Kend(:,:)real*8 K1(3),K2(3),dk(3)real*8,allocatable:: KP(:,:),Ktot(:,:)real*8 pireal*8 E,klengthpi=4.0*atan(1.0)open(1,file="KPOINTS")open(2,file="eigen.dat")read(1,*)Nline,Nallocate(Kstart(nline,3),Kend(nline,3),Ktot(Nline*N,3),Kp(N,3)) kpi=0 ! index for kpointsdo i=1,Nline ! line read(1,*)Kstart(i,:) read(1,*)Kend(i,:) read(1,*) k1=kstart(i,:) K2=Kend(i,:) call kproduce(k1,k2,n,KP) do j=1,N kpi=kpi+1 Ktot(kpi,:)=Kp(j,:) !write(*,*)ktot(kpi,:) enddoenddo !kpointsktot=ktot*pi dk=0 do kpi=1,N*nline call eigen(ktot(kpi,:),E) if(kpi==1)then klength=0 else dk=ktot(kpi,:)-ktot(kpi-1,:) ! write(*,*)dk klength=klength+sqrt(dk(1)*dk(1)+dk(2)*dk(2)+dk(3)*dk(3)) endif write(2,*)klength,E enddo deallocate(Kstart,kend,ktot,kp) close(1) close(2) endsubroutine Kproduce(Kstart,Kend,N,KP)!this subroutine produce N k-points along line Kstart-Kendreal*8 kstart(3), Kend(3)integer Nreal*8 KP(N,3)real*8 deltaK(3)KP=0deltaK=(Kend-Kstart)/(N-1)do i=1,NKP(i,:)=Kstart+deltaK*(i-1)enddoreturnendsubroutine EIGEN(KP,E)!this subroutine give the energy value for a given k-pointreal*8 KP(3)real*8 EE=-(cos(KP(1))+cos(KP(2))+cos(KP(3)))returnend
展开
若以下回答无法解决问题,邀请你更新回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询