Fortran Coder

标题: debug显示写入位置冲突 [打印本页]

作者: huhelong    时间: 2024-7-9 17:40
标题: debug显示写入位置冲突
debug显示和运行显示见图片,不知道如何解决了
[Fortran] 纯文本查看 复制代码
program dggevexample
implicit none
integer,parameter ::n=3
real*8 :: a(n,n),b(n,n),alpha(n),beta(n)
real*8 :: vl(n,n),vr(n,n)
integer ::lda,ldb,ldvl,ldvr,lwork,info
real*8,allocatable :: work(:)
!Initialize input matrices a and b
a=reshape((/1.0,2.0,3.0,2.0,4.0,5.0,3.8,5.8,6.0/),[n,n])
b=reshape((/1.0,0.0,0.0,0.0,2.6,0.0,0.0,0.0,3.0/),[n,n])
!Set leading dimensions for input matrices
lda =n
ldb =n
!Allocate workspace
lwork = 4*n
allocate(work(lwork))
!Call DGGEV to compute eigenvalues and eigenvectors
call dggev('v','v',n,a,lda,b,ldb, alpha, beta,vl,ldvl,vr,ldvr,work,lwork,info)
!Print results

if(info.eq.0.d0)then
  
write(*,*)'Eigenvalues:'
write(*,'(3f10.6)')alpha
write(*,*)'Eigenvectors:'
write(*,'(3f10.6)') vl(:,1),vl(:,2),vl(:,3)
else
write(*,*)'Error in DGGEV:',info
end if
!Deallocate workspace
deallocate(work)
end program dggevexample

微信截图_20240709173802.png (105.57 KB, 下载次数: 45)

运行窗口

运行窗口

微信截图_20240709173747.png (181.12 KB, 下载次数: 51)

debug错误显示

debug错误显示

作者: li913    时间: 2024-7-9 20:44
dggev需要17个参数,你给了16个。
作者: huhelong    时间: 2024-8-2 11:11
谢谢您的指导,问题已解决




欢迎光临 Fortran Coder (http://bbs.fcode.cn/) Powered by Discuz! X3.2