dsyev_rel Subroutine

private pure subroutine dsyev_rel(matrix, eig_vecr, eig_val)

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), dimension(:,:) :: matrix
real(kind=rk), intent(out), dimension(:,:), allocatable :: eig_vecr
real(kind=rk), intent(out), dimension(:), allocatable :: eig_val

Called by

proc~~dsyev_rel~~CalledByGraph proc~dsyev_rel foreig::dsyev_rel proc~eig_rel foreig::eig_rel proc~eig_rel->proc~dsyev_rel interface~eig foreig::eig interface~eig->proc~eig_rel program~benchmark benchmark program~benchmark->interface~eig program~test1 test1 program~test1->interface~eig

Source Code

   pure subroutine dsyev_rel(matrix, eig_vecr, eig_val)
      real(rk), dimension(:,:),              intent(in)  :: matrix
      real(rk), dimension(:,:), allocatable, intent(out) :: eig_vecr
      real(rk), dimension(:),   allocatable, intent(out) :: eig_val
      real(rk), dimension(:),   allocatable              :: work
      real(rk), dimension(size(matrix,1),size(matrix,1)) :: A
      integer                                            :: lwork, m, info
      real(rk)                                           :: work1(1)

      interface
         pure subroutine dsyev(fjobz, fuplo, fn, fA, flda, fw, fwork, flwork, finfo)
            import rk
            character, intent(in)    :: fjobz, fuplo
            integer,   intent(in)    :: fn
            integer,   intent(in)    :: flda
            integer,   intent(in)    :: flwork
            integer,   intent(out)   :: finfo
            real(rk),  intent(inout) :: fA(flda,*)
            real(rk),  intent(out)   :: fw(*)
            real(rk),  intent(out)   :: fwork(*)
         end subroutine
      end interface

      m = size(matrix,1)
      A = matrix

      call dsyev('V', 'U', m, A, m, eig_val, work1, -1, info)
      lwork = nint(work1(1))
      allocate(work(lwork))

      allocate(eig_vecr(m,m), eig_val(m))

      call dsyev('V', 'U', m, A, m, eig_val, work, lwork, info)

      eig_vecr = A

      deallocate(work)
   end subroutine dsyev_rel