program hello
use lapack95
Real*8:: arr1(2,2)
Integer:: info
Real*8:: value(2)
Real*8, allocatable:: works(:)
Integer:: lworks
!
value = 1.
arr1(1,1) = 2.08333333339971
arr1(2,2) = 3.08333333342553
arr1(1,2) = 2.50000000007744
arr1(2,1) = 2.50000000007744
lworks = -1
allocate(works(10))
print *, value
call dsyev("V", "U", 2, arr1, 2, value, works, lworks, info)
print*, value
deallocate(works)
end program hello
program hello
use lapack95
Real*8:: arr1(2,2)
Integer:: info
Real*8:: value(2)
Real*8, allocatable:: works(:)
Integer:: lworks
!
value = 1.
arr1(1,1) = 2.08333333339971
arr1(2,2) = 3.08333333342553
arr1(1,2) = 2.50000000007744
arr1(2,1) = 2.50000000007744
lworks = 10
allocate(works(10))
call dsyev("V", "U", 2, arr1, 2, value, works, lworks, info)
!call syev(arr1,value)
print*, value
deallocate(works)
pause
end program hello
捕获.PNG (78.27 KB, 下载次数: 175)
li913 发表于 2020-6-19 01:04
两种方案,1、增大lworks,比如 10;
2、用f95接口,call syev(arr1,value)
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |