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 展开
 我来答
若以下回答无法解决问题,邀请你更新回答
走爱貌4
2017-05-22 · TA获得超过161个赞
知道小有建树答主
回答量:290
采纳率:0%
帮助的人:59.3万
展开全部
更改使用(1)显式结构形参数组,(2)定结构形参数组
1) 显式结构形参数组:
subroutine subr(n,array)
integer:: n
real:: array(n)
2) 定结构形参数组
subroutine subr(array)
real:: array(:)
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式