我使用Lapack95
来计算一些特征值问题。我成功地从主程序中调用了必要的子程序。但是,当我尝试从模块调用它时,它会发出错误:
通用'la_syevd''
没有特定的子程序
显然,这表明我没有从我正在开发的新模块中加载适当的模块,但实际情况并非如此。你知道这里发生了什么吗?这在某处是一个愚蠢的错误,但我看不到它。
更具体地说,重现问题的最小例子如下所示。
module EOF
use F95_LAPACK, only: LA_SYEVD !! this does not seem to load the interface here, but it does in the main program ?!
implicit none
contains
subroutine diagonalise(a, eigenvectors, eigenvalues)
real, dimension(:,:), intent(in) :: a
real, dimension(size(a,2),size(a,2)), intent(out) :: eigenvectors
real, dimension(size(a,2)), intent(out) :: eigenvalues
integer :: info
call la_syevd(a=a, w=eigenvectors, jobz='V', info=info) !!! THIS CALL DOES NOT WORK
end subroutine
end module EOF
program mkeof
use F95_LAPACK, only: LA_SYEVD
use EOF
implicit none
integer :: i, j, info
real, allocatable :: a(:,:), w(:)
allocate(a(5,5), w(5))
call random_number(a)
call la_syevd(a=a, w=w, jobz='V', info=info) !!! THIS CALL WORKS
print*, 'END'
end program mkeof