Commit b8770c70 authored by Gregor Michalicek's avatar Gregor Michalicek

Introduce oUnit to files in diagonalization directory

parent bcb6aed1
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
MODULE m_chase_diag MODULE m_chase_diag
#ifdef CPP_CHASE #ifdef CPP_CHASE
USE m_judft USE m_judft
USE m_constants
IMPLICIT NONE IMPLICIT NONE
interface interface
...@@ -212,7 +213,7 @@ CONTAINS ...@@ -212,7 +213,7 @@ CONTAINS
! --> where a' = (l)^-1 * a * (l^t)^-1 and z' = l^t * z ! --> where a' = (l)^-1 * a * (l^t)^-1 and z' = l^t * z
CALL dsygst(1,'U',smat%matsize1,hmat%data_r,SIZE(hmat%data_r,1),smat%data_r,SIZE(smat%data_r,1),info) CALL dsygst(1,'U',smat%matsize1,hmat%data_r,SIZE(hmat%data_r,1),smat%data_r,SIZE(smat%data_r,1),info)
IF (info.NE.0) THEN IF (info.NE.0) THEN
WRITE (6,*) 'Error in dsygst: info =',info WRITE (oUnit,*) 'Error in dsygst: info =',info
CALL juDFT_error("Diagonalization failed",calledby="chase_diag") CALL juDFT_error("Diagonalization failed",calledby="chase_diag")
ENDIF ENDIF
...@@ -240,7 +241,7 @@ CONTAINS ...@@ -240,7 +241,7 @@ CONTAINS
! --> recover the generalized eigenvectors z by solving z' = l^t * z ! --> recover the generalized eigenvectors z by solving z' = l^t * z
CALL dtrtrs('U','N','N',hmat%matsize1,nev,smat%data_r,smat%matsize1,zMatTemp%data_r,zmat%matsize1,info) CALL dtrtrs('U','N','N',hmat%matsize1,nev,smat%data_r,smat%matsize1,zMatTemp%data_r,zmat%matsize1,info)
IF (info.NE.0) THEN IF (info.NE.0) THEN
WRITE (6,*) 'Error in dtrtrs: info =',info WRITE (oUnit,*) 'Error in dtrtrs: info =',info
CALL juDFT_error("Diagonalization failed",calledby="chase_diag") CALL juDFT_error("Diagonalization failed",calledby="chase_diag")
ENDIF ENDIF
...@@ -266,7 +267,7 @@ CONTAINS ...@@ -266,7 +267,7 @@ CONTAINS
! --> where a' = (l)^-1 * a * (l^t)^-1 and z' = l^t * z ! --> where a' = (l)^-1 * a * (l^t)^-1 and z' = l^t * z
CALL zhegst(1,'U',smat%matsize1,hmat%data_c,SIZE(hmat%data_c,1),smat%data_c,SIZE(smat%data_c,1),info) CALL zhegst(1,'U',smat%matsize1,hmat%data_c,SIZE(hmat%data_c,1),smat%data_c,SIZE(smat%data_c,1),info)
IF (info.NE.0) THEN IF (info.NE.0) THEN
WRITE (6,*) 'Error in zhegst: info =',info WRITE (oUnit,*) 'Error in zhegst: info =',info
CALL juDFT_error("Diagonalization failed",calledby="chase_diag") CALL juDFT_error("Diagonalization failed",calledby="chase_diag")
ENDIF ENDIF
...@@ -295,7 +296,7 @@ CONTAINS ...@@ -295,7 +296,7 @@ CONTAINS
! --> recover the generalized eigenvectors z by solving z' = l^t * z ! --> recover the generalized eigenvectors z by solving z' = l^t * z
CALL ztrtrs('U','N','N',hmat%matsize1,nev,smat%data_c,smat%matsize1,zMatTemp%data_c,zmat%matsize1,info) CALL ztrtrs('U','N','N',hmat%matsize1,nev,smat%data_c,smat%matsize1,zMatTemp%data_c,zmat%matsize1,info)
IF (info.NE.0) THEN IF (info.NE.0) THEN
WRITE (6,*) 'Error in ztrtrs: info =',info WRITE (oUnit,*) 'Error in ztrtrs: info =',info
CALL juDFT_error("Diagonalization failed",calledby="chase_diag") CALL juDFT_error("Diagonalization failed",calledby="chase_diag")
ENDIF ENDIF
...@@ -356,7 +357,7 @@ CONTAINS ...@@ -356,7 +357,7 @@ CONTAINS
CALL pdsygst(1,'U',smat%global_size1,hmat%data_r,1,1,hmat%blacsdata%blacs_desc,smat%data_r,1,1,smat%blacsdata%blacs_desc,scale,info) CALL pdsygst(1,'U',smat%global_size1,hmat%data_r,1,1,hmat%blacsdata%blacs_desc,smat%data_r,1,1,smat%blacsdata%blacs_desc,scale,info)
IF (ABS(scale-1)>1E-10) call judft_error("Scale parameter not implemented in chase_diag") IF (ABS(scale-1)>1E-10) call judft_error("Scale parameter not implemented in chase_diag")
IF (info.NE.0) THEN IF (info.NE.0) THEN
WRITE (6,*) 'Error in pdsygst: info =',info WRITE (oUnit,*) 'Error in pdsygst: info =',info
CALL juDFT_error("Diagonalization failed",calledby="chase_diag") CALL juDFT_error("Diagonalization failed",calledby="chase_diag")
ENDIF ENDIF
ELSE ELSE
...@@ -368,7 +369,7 @@ CONTAINS ...@@ -368,7 +369,7 @@ CONTAINS
CALL pzhegst(1,'U',smat%global_size1,hmat%data_c,1,1,smat%blacsdata%blacs_desc,smat%data_c,1,1,smat%blacsdata%blacs_desc,scale,info) CALL pzhegst(1,'U',smat%global_size1,hmat%data_c,1,1,smat%blacsdata%blacs_desc,smat%data_c,1,1,smat%blacsdata%blacs_desc,scale,info)
IF (ABS(scale-1)>1E-10) call judft_error("Scale parameter not implemented in chase_diag") IF (ABS(scale-1)>1E-10) call judft_error("Scale parameter not implemented in chase_diag")
IF (info.NE.0) THEN IF (info.NE.0) THEN
WRITE (6,*) 'Error in pzhegst: info =',info WRITE (oUnit,*) 'Error in pzhegst: info =',info
CALL juDFT_error("Diagonalization failed",calledby="chase_diag") CALL juDFT_error("Diagonalization failed",calledby="chase_diag")
ENDIF ENDIF
END IF END IF
...@@ -425,7 +426,7 @@ CONTAINS ...@@ -425,7 +426,7 @@ CONTAINS
hmat%data_c,1,1,smat%blacsdata%blacs_desc,info) hmat%data_c,1,1,smat%blacsdata%blacs_desc,info)
END IF END IF
IF (info.NE.0) THEN IF (info.NE.0) THEN
WRITE (6,*) 'Error in p?trtrs: info =',info WRITE (oUnit,*) 'Error in p?trtrs: info =',info
CALL juDFT_error("Diagonalization failed",calledby="chase_diag") CALL juDFT_error("Diagonalization failed",calledby="chase_diag")
ENDIF ENDIF
......
...@@ -24,6 +24,7 @@ CONTAINS ...@@ -24,6 +24,7 @@ CONTAINS
! !
#include"cpp_double.h" #include"cpp_double.h"
USE m_juDFT USE m_juDFT
USE m_constants
USE m_types_mpimat USE m_types_mpimat
USE m_types_mat USE m_types_mat
IMPLICIT NONE IMPLICIT NONE
...@@ -203,38 +204,38 @@ CONTAINS ...@@ -203,38 +204,38 @@ CONTAINS
endif endif
CALL timestop("SCALAPACK call") CALL timestop("SCALAPACK call")
IF (ierr .NE. 0) THEN IF (ierr .NE. 0) THEN
!IF (ierr /= 2) WRITE (6,*) myid,' error in pzhegvx/pdsygvx, ierr=',ierr !IF (ierr /= 2) WRITE (oUnit,*) myid,' error in pzhegvx/pdsygvx, ierr=',ierr
!IF (ierr <= 0) WRITE (6,*) myid,' illegal input argument' !IF (ierr <= 0) WRITE (oUnit,*) myid,' illegal input argument'
IF (MOD(ierr,2) /= 0) THEN IF (MOD(ierr,2) /= 0) THEN
!WRITE (6,*) myid,'some eigenvectors failed to converge' !WRITE (oUnit,*) myid,'some eigenvectors failed to converge'
eigs: DO i = 1, ne eigs: DO i = 1, ne
IF (ifail(i) /= 0) THEN IF (ifail(i) /= 0) THEN
!WRITE (6,*) myid,' eigenvector',ifail(i), 'failed to converge' !WRITE (oUnit,*) myid,' eigenvector',ifail(i), 'failed to converge'
ELSE ELSE
EXIT eigs EXIT eigs
ENDIF ENDIF
ENDDO eigs ENDDO eigs
!CALL CPP_flush(6) !CALL CPP_flush(oUnit)
ENDIF ENDIF
IF (MOD(ierr/4,2).NE.0) THEN IF (MOD(ierr/4,2).NE.0) THEN
!WRITE(6,*) myid,' only',num2,' eigenvectors converged' !WRITE(oUnit,*) myid,' only',num2,' eigenvectors converged'
!CALL CPP_flush(6) !CALL CPP_flush(oUnit)
ENDIF ENDIF
IF (MOD(ierr/8,2).NE.0) THEN IF (MOD(ierr/8,2).NE.0) THEN
!WRITE(6,*) myid,' PDSTEBZ failed to compute eigenvalues' !WRITE(oUnit,*) myid,' PDSTEBZ failed to compute eigenvalues'
CALL judft_warn("SCALAPACK failed to solve eigenvalue problem",calledby="scalapack.f90") CALL judft_warn("SCALAPACK failed to solve eigenvalue problem",calledby="scalapack.f90")
ENDIF ENDIF
IF (MOD(ierr/16,2).NE.0) THEN IF (MOD(ierr/16,2).NE.0) THEN
!WRITE(6,*) myid,' B was not positive definite, Cholesky failed at',ifail(1) !WRITE(oUnit,*) myid,' B was not positive definite, Cholesky failed at',ifail(1)
CALL judft_warn("SCALAPACK failed: B was not positive definite",calledby="scalapack.f90") CALL judft_warn("SCALAPACK failed: B was not positive definite",calledby="scalapack.f90")
ENDIF ENDIF
ENDIF ENDIF
IF (num2 < num1) THEN IF (num2 < num1) THEN
!IF (myid ==0) THEN !IF (myid ==0) THEN
WRITE(6,*) 'Not all eigenvalues wanted are found' WRITE(oUnit,*) 'Not all eigenvalues wanted are found'
WRITE(6,*) 'number of eigenvalues/vectors wanted',num1 WRITE(oUnit,*) 'number of eigenvalues/vectors wanted',num1
WRITE(6,*) 'number of eigenvalues/vectors found',num2 WRITE(oUnit,*) 'number of eigenvalues/vectors found',num2
!CALL CPP_flush(6) !CALL CPP_flush(oUnit)
!ENDIF !ENDIF
ENDIF ENDIF
! !
......
...@@ -10,6 +10,7 @@ MODULE m_symmetrize_matrix ...@@ -10,6 +10,7 @@ MODULE m_symmetrize_matrix
CONTAINS CONTAINS
SUBROUTINE symmetrize_matrix(mpi,noco,kpts,nk,hmat,smat) SUBROUTINE symmetrize_matrix(mpi,noco,kpts,nk,hmat,smat)
USE m_types USE m_types
USE m_constants
IMPLICIT NONE IMPLICIT NONE
TYPE(t_mpi),INTENT(IN) :: mpi TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_noco),INTENT(in) :: noco TYPE(t_noco),INTENT(in) :: noco
...@@ -31,7 +32,7 @@ CONTAINS ...@@ -31,7 +32,7 @@ CONTAINS
IF (mpi%irank==0) THEN IF (mpi%irank==0) THEN
PRINT *,"Complex matrix made real" PRINT *,"Complex matrix made real"
WRITE(6,*) "Complex matrix made real" WRITE(oUnit,*) "Complex matrix made real"
END IF END IF
!We are using Gamma point, so matrix should be real !We are using Gamma point, so matrix should be real
......
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