diag_symm_full Subroutine

public subroutine diag_symm_full(mode, n, a, lda, eival, ierr)

Uses

  • proc~~diag_symm_full~~UsesGraph proc~diag_symm_full diag_symm_full module~messages messages proc~diag_symm_full->module~messages comm_IOFILE comm_IOFILE module~messages->comm_IOFILE comm_PAR comm_PAR module~messages->comm_PAR module~io_constants io_constants module~messages->module~io_constants module~precision precision module~messages->module~precision iso_fortran_env iso_fortran_env module~precision->iso_fortran_env

@brief Find eigenvalues and eigenvectors of symmetric matrix in full format @param[in] mode algorithm of diagonalization (not used now) @param[in] n matrix dimension @param[in,out] a matrix to be diagonalized, overwritten by the eigenvectors on the exit @param[in] lda leading dimension of the matrix @param[out] eig eigenvalues @param[out] ierr status

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: mode
integer, intent(in) :: n
real(kind=dp), intent(inout) :: a(*)
integer, intent(in) :: lda
real(kind=dp), intent(out) :: eival(*)
integer, intent(out), optional :: ierr

Calls

proc~~diag_symm_full~~CallsGraph proc~diag_symm_full diag_symm_full dsyev dsyev proc~diag_symm_full->dsyev interface~show_message show_message proc~diag_symm_full->interface~show_message

Called by

proc~~diag_symm_full~~CalledByGraph proc~diag_symm_full diag_symm_full proc~corresponding_orbital_projection corresponding_orbital_projection proc~corresponding_orbital_projection->proc~diag_symm_full proc~get_ab_initio_orbital get_ab_initio_orbital proc~get_ab_initio_orbital->proc~diag_symm_full proc~huckel_guess huckel_guess proc~huckel_guess->proc~diag_symm_full proc~huckel_guess->proc~corresponding_orbital_projection proc~guess_hcore guess_hcore proc~guess_hcore->proc~get_ab_initio_orbital proc~guess_huckel guess_huckel proc~guess_huckel->proc~huckel_guess proc~scf_driver scf_driver proc~scf_driver->proc~get_ab_initio_orbital proc~guess_hcore_c guess_hcore_C proc~guess_hcore_c->proc~guess_hcore proc~guess_huckel_c guess_huckel_C proc~guess_huckel_c->proc~guess_huckel proc~hf_energy hf_energy proc~hf_energy->proc~scf_driver

Source Code

  subroutine diag_symm_full(mode, n, a, lda, eival, ierr)
    use messages, only: show_message, WITH_ABORT, WITHOUT_ABORT
!
    integer, intent(in) :: mode
    integer, intent(in) :: n, lda
    real(dp), intent(inout) :: a(*)
    real(kind=dp), intent(out) :: eival(*)
    integer, optional, intent(out) :: ierr

    integer(blas_int) :: lda_, n_, info, ione, lwork
    integer :: iok
    real(dp), dimension(:), allocatable :: work
    real(dp) :: rwork(1)
    logical :: fatal
    character(16) :: driver

    lda_    = int(lda, kind=blas_int)
    n_      = int(n, kind=blas_int)
    ione    = 1

    fatal = WITH_ABORT
    if (present(ierr)) fatal = WITHOUT_ABORT

    driver = 'DSYEV'
    call dsyev('V', 'U', n_, a, lda_, eival, rwork, -1_blas_int, info)
    lwork = int(nint(rwork(1)), blas_int)
    allocate (work(lwork), stat=iok)
    if (iok /= 0) then
      if (present(ierr)) ierr = iok
      call show_message('Cannot allocate memory', fatal)
      return
    end if
    call dsyev('V', 'U', n_, a, lda_, eival, work, lwork, info)


    if (present(ierr)) ierr = info

    if (info /= 0) then
      call show_message('(A,I0)', &
              trim(driver)//' FAILED! INFO: ', int(info), fatal)
    end if

  end subroutine diag_symm_full