Commit 5c609a1b authored by Andreas Marek's avatar Andreas Marek

Make solve_tridi also public, since needed by FHI-aims

The subroutine solve_tridi has NOT been shifted from the private
module "elpa1_compute" to the public module elpa1_auxilliary.

Instead, a wrapper function solve_tride has been introduced, which
calls (via Fortran module association) the private function.

This does what it is supposed to do, but should be cleaned up at
some time. Public functions (interfaces) should be implemented in
a public module
parent abb604fa
......@@ -107,7 +107,7 @@ module ELPA1
!> \brief get_elpa_row_col_comms: old, deprecated Fortran function to create the MPI communicators for ELPA. Better use "elpa_get_communicators"
!> \detail
!> \details
!> The interface and variable definition is the same as in "elpa_get_communicators"
!> \param mpi_comm_global Global communicator for the calculations (in)
!>
......@@ -125,7 +125,7 @@ module ELPA1
!> \brief solve_evp_real: old, deprecated Fortran function to solve the real eigenvalue problem with 1-stage solver. Better use "solve_evp_real_1stage"
!>
!> \detail
!> \details
!> The interface and variable definition is the same as in "elpa_solve_evp_real_1stage"
! Parameters
!
......@@ -166,7 +166,7 @@ module ELPA1
!> \brief solve_evp_complex: old, deprecated Fortran function to solve the complex eigenvalue problem with 1-stage solver. Better use "solve_evp_complex_1stage"
!>
!> \detail
!> \details
!> The interface and variable definition is the same as in "elpa_solve_evp_complex_1stage"
! Parameters
!
......
......@@ -65,10 +65,12 @@ module elpa1_auxiliary
public :: cholesky_real !< Cholesky factorization of a real matrix
public :: cholesky_complex !< Cholesky factorization of a complex matrix
public :: solve_tridi !< Solve tridiagonal eigensystem with divide and conquer method
contains
!> \brief cholesky_real: Cholesky factorization of a real symmetric matrix
!> \detail
!> \details
!>
!> \param na Order of matrix
!> \param a(lda,matrixCols) Distributed matrix which should be factorized.
......@@ -276,7 +278,7 @@ module elpa1_auxiliary
end subroutine cholesky_real
!> \brief invert_trm_real: Inverts a upper triangular matrix
!> \detail
!> \details
!> \param na Order of matrix
!> \param a(lda,matrixCols) Distributed matrix which should be inverted
!> Distribution is like in Scalapack.
......@@ -432,7 +434,7 @@ module elpa1_auxiliary
end subroutine invert_trm_real
!> \brief cholesky_complex: Cholesky factorization of a complex hermitian matrix
!> \detail
!> \details
!> \param na Order of matrix
!> \param a(lda,matrixCols) Distributed matrix which should be factorized.
!> Distribution is like in Scalapack.
......@@ -638,7 +640,7 @@ module elpa1_auxiliary
end subroutine cholesky_complex
!> \brief invert_trm_complex: Inverts a complex upper triangular matrix
!> \detail
!> \details
!> \param na Order of matrix
!> \param a(lda,matrixCols) Distributed matrix which should be inverted
!> Distribution is like in Scalapack.
......@@ -797,7 +799,7 @@ module elpa1_auxiliary
!> B is a (na,ncb) matrix
!> C is a (na,ncb) matrix where optionally only the upper or lower
!> triangle may be computed
!> \detail
!> \details
!> \param uplo_a 'U' if A is upper triangular
!> 'L' if A is lower triangular
......@@ -1041,7 +1043,7 @@ module elpa1_auxiliary
!> B is a (na,ncb) matrix
!> C is a (na,ncb) matrix where optionally only the upper or lower
!> triangle may be computed
!> \detail
!> \details
!>
!> \param uplo_a 'U' if A is upper triangular
!> 'L' if A is lower triangular
......@@ -1280,5 +1282,44 @@ module elpa1_auxiliary
end subroutine mult_ah_b_complex
!> \brief solve_tridi: Solve tridiagonal eigensystem with divide and conquer method
!> \details
!>
!> \param na Matrix dimension
!> \param nev number of eigenvalues/vectors to be computed
!> \param d array d(na) on input diagonal elements of tridiagonal matrix, on
!> output the eigenvalues in ascending order
!> \param e array e(na) on input subdiagonal elements of matrix, on exit destroyed
!> \param q on exit : matrix q(ldq,matrixCols) contains the eigenvectors
!> \param ldq leading dimension of matrix q
!> \param nblk blocksize of cyclic distribution, must be the same in both directions!
!> \param matrixCols columns of matrix q
!> \param mpi_comm_rows MPI communicator for rows
!> \param mpi_comm_cols MPI communicator for columns
!> \param wantDebug logical, give more debug information if .true.
!> \result success logical, .true. on success, else .false.
function solve_tridi(na, nev, d, e, q, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, wantDebug) result(success)
use elpa1_compute, solve_tridi_private => solve_tridi
use precision
implicit none
integer(kind=ik) :: na, nev, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols
real(kind=rk) :: d(na), e(na)
#ifdef DESPERATELY_WANT_ASSUMED_SIZE
real(kind=rk) :: q(ldq,*)
#else
real(kind=rk) :: q(ldq,matrixCols)
#endif
logical, intent(in) :: wantDebug
logical :: success
success = .false.
call solve_tridi_private(na, nev, d, e, q, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, wantDebug, success)
end function
end module elpa1_auxiliary
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment