主题:[讨论]64位ivf中程序调试的新问题
程序如下:
program main
! use IMSL
use linear_operators
implicit none
real, parameter::pi=3.14159265
complex, parameter:: fi=(0.0, 1.0)
real t,f,w
complex, allocatable:: h0(:, :)
real, allocatable:: eigenvalue(:) !特征值的矩阵
integer :: i, n ,j
n = 4
allocate(h0(4*n,4*n))
allocate(eigenvalue(4*n))
w = 0.2
t = 1.0
f = 0.25
call hmatr(h0, n)
open(1,file='h0.txt')
do i=1,4*n
do j=1,4*n
write(1,*) h0(j,i)
end do
end do
eigenvalue=eig(h0)
do i=1,4*n
write(*,"('eigenvalue=',f10.7)")eigenvalue(i)
! write(*,"('eigenvector=['3(f5.2'')']')")eigenvector(:,i)
end do
! stop
close(1)
contains
subroutine hmatr(h0,n)
integer n
complex h0(:,:)
integer:: j,n0
complex:: c(4,4),a(4,4),b(4,4)
h0=0.0
a=0.0
b=0.0
a(1, 4)=t
b(4,1)=t
c=0.0
do n0=1,2*n-1,2
c(1,1)=w
c(2, 1) = t*exp(fi*(-pi+2.0*pi/3.0*f*(1.5*n0+0.25)))
c(1, 2) = t*exp(-fi*(-pi+2.0*pi/3.0*f*(1.5*n0+0.25)))
c(2, 2) = w
c(2, 3) = t
c(3, 2) = t
c(3, 3) = w
c(3, 4) = t*exp(fi*(-pi+2.0*pi/3.0*f*(1.5*(n0+1)+0.25)))
c(4, 3) = t*exp(-fi*(-pi+2.0*pi/3.0*f*(1.5*(n0+1)+0.25)))
c(4, 4) = w
j=2*n0-1
i=2*n0-1
do j=1,4*n-3,4
h0(j:j+3,j:j+3)=c
if(j==1) then
h0(j:j+3,j+4:j+7)=b
h0(j:j+3,4*n-3:4*n)=a
else if(j>=5.and.j<4*n-3) then
h0(j:j+3,j+4:j+7)=b
h0(j:j+3,j-4:j-1)=a
else
h0(4*n-3:4*n,1:4)=b
h0(j:j+3,j-4:j-1)=a
end if
end do
end do
end subroutine hmatr
end program main
编译可以通过,但调试时问题如下:
error LNK2019: unresolved external symbol EIG_INT_mp_C_MAT_EIG referenced in function MAIN__
我的电脑配置如下:处理器:Intel(R) Core i7 CPU 920
内存:6.00GB
系统:win7 x64
编译器配置:VS2008 ,IVF11.1.038
请教大虾解决方案。
program main
! use IMSL
use linear_operators
implicit none
real, parameter::pi=3.14159265
complex, parameter:: fi=(0.0, 1.0)
real t,f,w
complex, allocatable:: h0(:, :)
real, allocatable:: eigenvalue(:) !特征值的矩阵
integer :: i, n ,j
n = 4
allocate(h0(4*n,4*n))
allocate(eigenvalue(4*n))
w = 0.2
t = 1.0
f = 0.25
call hmatr(h0, n)
open(1,file='h0.txt')
do i=1,4*n
do j=1,4*n
write(1,*) h0(j,i)
end do
end do
eigenvalue=eig(h0)
do i=1,4*n
write(*,"('eigenvalue=',f10.7)")eigenvalue(i)
! write(*,"('eigenvector=['3(f5.2'')']')")eigenvector(:,i)
end do
! stop
close(1)
contains
subroutine hmatr(h0,n)
integer n
complex h0(:,:)
integer:: j,n0
complex:: c(4,4),a(4,4),b(4,4)
h0=0.0
a=0.0
b=0.0
a(1, 4)=t
b(4,1)=t
c=0.0
do n0=1,2*n-1,2
c(1,1)=w
c(2, 1) = t*exp(fi*(-pi+2.0*pi/3.0*f*(1.5*n0+0.25)))
c(1, 2) = t*exp(-fi*(-pi+2.0*pi/3.0*f*(1.5*n0+0.25)))
c(2, 2) = w
c(2, 3) = t
c(3, 2) = t
c(3, 3) = w
c(3, 4) = t*exp(fi*(-pi+2.0*pi/3.0*f*(1.5*(n0+1)+0.25)))
c(4, 3) = t*exp(-fi*(-pi+2.0*pi/3.0*f*(1.5*(n0+1)+0.25)))
c(4, 4) = w
j=2*n0-1
i=2*n0-1
do j=1,4*n-3,4
h0(j:j+3,j:j+3)=c
if(j==1) then
h0(j:j+3,j+4:j+7)=b
h0(j:j+3,4*n-3:4*n)=a
else if(j>=5.and.j<4*n-3) then
h0(j:j+3,j+4:j+7)=b
h0(j:j+3,j-4:j-1)=a
else
h0(4*n-3:4*n,1:4)=b
h0(j:j+3,j-4:j-1)=a
end if
end do
end do
end subroutine hmatr
end program main
编译可以通过,但调试时问题如下:
error LNK2019: unresolved external symbol EIG_INT_mp_C_MAT_EIG referenced in function MAIN__
我的电脑配置如下:处理器:Intel(R) Core i7 CPU 920
内存:6.00GB
系统:win7 x64
编译器配置:VS2008 ,IVF11.1.038
请教大虾解决方案。