Fortran Coder

查看: 94|回复: 1

[求助] debug显示写入位置冲突

[复制链接]

16

帖子

9

主题

0

精华

入门

F 币
74 元
贡献
40 点
发表于 2024-7-9 17:40:47 | 显示全部楼层 |阅读模式
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

运行窗口

运行窗口

debug错误显示

debug错误显示

822

帖子

2

主题

0

精华

大宗师

F 币
3875 元
贡献
2307 点
发表于 2024-7-9 20:44:53 | 显示全部楼层
dggev需要17个参数,你给了16个。
您需要登录后才可以回帖 登录 | 极速注册

本版积分规则

捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )

GMT+8, 2024-7-23 20:38

Powered by Tencent X3.4

© 2013-2024 Tencent

快速回复 返回顶部 返回列表