回 帖 发 新 帖 刷新版面

主题:[讨论]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


请教大虾解决方案。    

回复列表 (共7个回复)

沙发

还没到调试的环节呢,这是链接时出错,egi是IMSL里的吧,为何要注释掉use imsl呢?你用的是高版本的IMSL?

板凳


是的。我的imsl版本较高。请问问题何在呀?
谢谢!

3 楼

先确保能正确调用IMSL吧.

4 楼

64位啊。。。
你的IMSL是64位的不?

5 楼


谢谢各位。问题已经解决了[em1]

6 楼

lz应该把解决方法说一下,以方便后来者搜索时参考。
如果解决了而都不说how to,那么论坛的人气会越来越低。

7 楼


设置好搜索路径,在程序中正确调用函数,就可以了 
  

我来回复

您尚未登录,请登录后再回复。点此登录或注册