Commit 80b73f85 authored by Gregor Michalicek's avatar Gregor Michalicek

Remove debug output from eigen_soc/alineso.F90

parent 40cf503c
...@@ -6,10 +6,8 @@ MODULE m_alineso ...@@ -6,10 +6,8 @@ MODULE m_alineso
! Eigenvalues and vectors (eig_so and zso) are returned ! Eigenvalues and vectors (eig_so and zso) are returned
!---------------------------------------------------------------------- !----------------------------------------------------------------------
CONTAINS CONTAINS
SUBROUTINE alineso(eig_id,lapw,& SUBROUTINE alineso(eig_id,lapw,mpi,DIMENSION,atoms,sym,kpts,input,noco,&
mpi,DIMENSION,atoms,sym,kpts,& cell,oneD, nk, usdus,rsoc,nsize,nmat, eig_so,zso)
input,noco,cell,oneD, nk, usdus,rsoc,&
nsize,nmat, eig_so,zso)
#include"cpp_double.h" #include"cpp_double.h"
USE m_types USE m_types
...@@ -99,16 +97,12 @@ CONTAINS ...@@ -99,16 +97,12 @@ CONTAINS
zso(:,:,:)= CMPLX(0.,0.) zso(:,:,:)= CMPLX(0.,0.)
DO jsp = 1,input%jspins DO jsp = 1,input%jspins
CALL read_eig(& CALL read_eig(eig_id,nk,jsp, neig=ne,eig=eig(:,jsp))
eig_id,nk,jsp, neig=ne,eig=eig(:,jsp))
IF (judft_was_argument("-debugtime")) THEN IF (judft_was_argument("-debugtime")) THEN
WRITE(6,*) "Non-SOC ev for nk,jsp:",nk,jsp WRITE(6,*) "Non-SOC ev for nk,jsp:",nk,jsp
WRITE(6,"(6(f10.6,1x))") eig(:ne,jsp) WRITE(6,"(6(f10.6,1x))") eig(:ne,jsp)
ENDIF ENDIF
CALL read_eig(& CALL read_eig(eig_id,nk,jsp,n_start=1,n_end=ne,zmat=zmat(jsp))
eig_id,nk,jsp,&
n_start=1,n_end=ne,&
zmat=zmat(jsp))
! write(*,*) 'process',irank,' reads ',nk ! write(*,*) 'process',irank,' reads ',nk
...@@ -156,50 +150,36 @@ CONTAINS ...@@ -156,50 +150,36 @@ CONTAINS
nat_stop = atoms%nat nat_stop = atoms%nat
ENDIF ENDIF
nat_l = nat_stop - nat_start + 1 nat_l = nat_stop - nat_start + 1
!
! set up A and B coefficients ! set up A and B coefficients
! ALLOCATE (ahelp(atoms%lmaxd*(atoms%lmaxd+2),nat_l,DIMENSION%neigd,input%jspins))
ALLOCATE ( ahelp(atoms%lmaxd*(atoms%lmaxd+2),nat_l,DIMENSION%neigd,input%jspins) ) ALLOCATE (bhelp(atoms%lmaxd*(atoms%lmaxd+2),nat_l,DIMENSION%neigd,input%jspins))
ALLOCATE ( bhelp(atoms%lmaxd*(atoms%lmaxd+2),nat_l,DIMENSION%neigd,input%jspins) ) ALLOCATE (chelp(-atoms%llod :atoms%llod, DIMENSION%neigd,atoms%nlod,nat_l,input%jspins))
ALLOCATE ( chelp(-atoms%llod :atoms%llod, DIMENSION%neigd,atoms%nlod,nat_l,input%jspins) )
CALL timestart("alineso SOC: -help") CALL timestart("alineso SOC: -help")
write(*,*) nat_start,nat_stop,nat_l CALL hsohelp(DIMENSION,atoms,sym,input,lapw,nsz,cell,zmat,usdus,&
CALL hsohelp(& zso,noco,oneD,nat_start,nat_stop,nat_l,ahelp,bhelp,chelp)
& DIMENSION,atoms,sym,&
& input,lapw,nsz,&
& cell,&
& zmat,usdus,&
& zso,noco,oneD,&
& nat_start,nat_stop,nat_l,&
& ahelp,bhelp,chelp)
CALL timestop("alineso SOC: -help") CALL timestop("alineso SOC: -help")
!
! set up hamilton matrix ! set up hamilton matrix
!
CALL timestart("alineso SOC: -ham") CALL timestart("alineso SOC: -ham")
#ifdef CPP_MPI #ifdef CPP_MPI
CALL MPI_BARRIER(mpi%MPI_COMM,ierr) CALL MPI_BARRIER(mpi%MPI_COMM,ierr)
#endif #endif
ALLOCATE ( hsomtx(DIMENSION%neigd,DIMENSION%neigd,2,2) ) ALLOCATE (hsomtx(DIMENSION%neigd,DIMENSION%neigd,2,2))
CALL hsoham(atoms,noco,input,nsz,dimension%neigd,chelp,rsoc,ahelp,bhelp,& CALL hsoham(atoms,noco,input,nsz,dimension%neigd,chelp,rsoc,ahelp,bhelp,&
nat_start,nat_stop,mpi%n_rank,mpi%n_size,mpi%SUB_COMM,& nat_start,nat_stop,mpi%n_rank,mpi%n_size,mpi%SUB_COMM,hsomtx)
hsomtx) DEALLOCATE (ahelp,bhelp,chelp)
write(*,*) 'after hsoham'
DEALLOCATE ( ahelp,bhelp,chelp )
CALL timestop("alineso SOC: -ham") CALL timestop("alineso SOC: -ham")
IF (mpi%n_rank==0) THEN IF (mpi%n_rank==0) THEN
!
! add e.v. on diagonal ! add e.v. on diagonal
!
! write(*,*) '!!!!!!!!!!! remove SOC !!!!!!!!!!!!!!' ! write(*,*) '!!!!!!!!!!! remove SOC !!!!!!!!!!!!!!'
! hsomtx = 0 !!!!!!!!!!!! ! hsomtx = 0 !!!!!!!!!!!!
DO jsp = 1,input%jspins DO jsp = 1,input%jspins
DO i = 1,nsz(jsp) DO i = 1,nsz(jsp)
hsomtx(i,i,jsp,jsp) = hsomtx(i,i,jsp,jsp) +& hsomtx(i,i,jsp,jsp) = hsomtx(i,i,jsp,jsp) + CMPLX(eig(i,jsp),0.)
& CMPLX(eig(i,jsp),0.)
IF (input%jspins.EQ.1) THEN IF (input%jspins.EQ.1) THEN
hsomtx(i,i,2,2) = hsomtx(i,i,2,2) +& hsomtx(i,i,2,2) = hsomtx(i,i,2,2) + CMPLX(eig(i,jsp),0.)
& CMPLX(eig(i,jsp),0.)
ENDIF ENDIF
ENDDO ENDDO
ENDDO ENDDO
...@@ -207,34 +187,33 @@ CONTAINS ...@@ -207,34 +187,33 @@ CONTAINS
! !
! resort H-matrix ! resort H-matrix
! !
ALLOCATE ( hso(2*DIMENSION%neigd,2*DIMENSION%neigd) ) ALLOCATE (hso(2*DIMENSION%neigd,2*DIMENSION%neigd))
DO jsp = 1,2 DO jsp = 1,2
DO jsp1 = 1,2 DO jsp1 = 1,2
IF (jsp.EQ.1) nn = 0 IF (jsp.EQ.1) nn = 0
IF (jsp1.EQ.1) nn1 = 0 IF (jsp1.EQ.1) nn1 = 0
IF (jsp.EQ.2) nn = nsz(1) IF (jsp.EQ.2) nn = nsz(1)
IF (jsp1.EQ.2) nn1 = nsz(1) IF (jsp1.EQ.2) nn1 = nsz(1)
!
!write(3333,'(2i3,4e15.8)') jsp,jsp1,hsomtx(jsp,jsp1,8,8),hsomtx(jsp,jsp1,32,109) !write(3333,'(2i3,4e15.8)') jsp,jsp1,hsomtx(jsp,jsp1,8,8),hsomtx(jsp,jsp1,32,109)
DO i = 1,nsz(jsp) DO i = 1,nsz(jsp)
DO j = 1,nsz(jsp1) DO j = 1,nsz(jsp1)
hso(i+nn,j+nn1) = hsomtx(i,j,jsp,jsp1) hso(i+nn,j+nn1) = hsomtx(i,j,jsp,jsp1)
ENDDO ENDDO
ENDDO ENDDO
!
ENDDO ENDDO
ENDDO ENDDO
DEALLOCATE ( hsomtx ) DEALLOCATE (hsomtx)
! !
! add Sigma-vxc (QSGW) ! add Sigma-vxc (QSGW)
! !
IF( l_qsgw ) THEN IF(l_qsgw) THEN
nbas = lapw%nv(1) + atoms%nlotot nbas = lapw%nv(1) + atoms%nlotot
WRITE(*,'(A,I3,A,I5,A)') 'Read fleur.qsgw (',nk,',',nbas,')' WRITE(*,'(A,I3,A,I5,A)') 'Read fleur.qsgw (',nk,',',nbas,')'
IF( input%jspins .EQ. 2 ) STOP 'alineso: GW+noco not implemented.' IF( input%jspins .EQ. 2 ) STOP 'alineso: GW+noco not implemented.'
ALLOCATE ( sigma_xc(2*nsz(1),2*nsz(1)) ) ALLOCATE (sigma_xc(2*nsz(1),2*nsz(1)))
ALLOCATE ( sigma_xc_apw(nbas,nbas) ) ALLOCATE (sigma_xc_apw(nbas,nbas))
INQUIRE(667,opened=l_open) INQUIRE(667,opened=l_open)
IF( .NOT.l_open ) THEN IF( .NOT.l_open ) THEN
IF( nk.NE.1 ) STOP 'unit 667 not opened but not at 1st k' IF( nk.NE.1 ) STOP 'unit 667 not opened but not at 1st k'
...@@ -260,12 +239,12 @@ CONTAINS ...@@ -260,12 +239,12 @@ CONTAINS
j = nsz(1) * (jsp2-1) + 1 ; j1 = nsz(1) * jsp2 j = nsz(1) * (jsp2-1) + 1 ; j1 = nsz(1) * jsp2
if (l_real) THEN if (l_real) THEN
sigma_xc(i:i1,j:j1) = & sigma_xc(i:i1,j:j1) = &
& MATMUL ( TRANSPOSE(zmat(1)%data_r(:nbas,:)) ,& MATMUL ( TRANSPOSE(zmat(1)%data_r(:nbas,:)) ,&
& MATMUL ( sigma_xc_apw, zmat(1)%data_r(:nbas,:) ) ) MATMUL ( sigma_xc_apw, zmat(1)%data_r(:nbas,:) ) )
else else
sigma_xc(i:i1,j:j1) = & sigma_xc(i:i1,j:j1) = &
& MATMUL ( CONJG(TRANSPOSE(zmat(1)%data_c(:nbas,:))) ,& MATMUL ( CONJG(TRANSPOSE(zmat(1)%data_c(:nbas,:))) ,&
& MATMUL ( sigma_xc_apw, zmat(1)%data_c(:nbas,:) ) ) MATMUL ( sigma_xc_apw, zmat(1)%data_c(:nbas,:) ) )
endif endif
hso(i:i1,j:j1) = hso(i:i1,j:j1) + CONJG(sigma_xc(i:i1,j:j1)) hso(i:i1,j:j1) = hso(i:i1,j:j1) + CONJG(sigma_xc(i:i1,j:j1))
IF(jsp1.NE.jsp2) THEN IF(jsp1.NE.jsp2) THEN
...@@ -274,7 +253,7 @@ else ...@@ -274,7 +253,7 @@ else
ENDIF ENDIF
ENDDO ENDDO
ENDDO ENDDO
DEALLOCATE ( sigma_xc_apw ) DEALLOCATE (sigma_xc_apw)
ENDIF ENDIF
! !
...@@ -285,29 +264,25 @@ else ...@@ -285,29 +264,25 @@ else
CALL timestart("alineso SOC: -diag") CALL timestart("alineso SOC: -diag")
ALLOCATE ( cwork(idim_c),rwork(idim_r) ) ALLOCATE (cwork(idim_c),rwork(idim_r))
IF (input%eonly) THEN IF (input%eonly) THEN
vectors= 'N' vectors= 'N'
ELSE ELSE
vectors= 'V' vectors= 'V'
ENDIF ENDIF
CALL CPP_LAPACK_cheev(vectors,'U',nsize,& CALL CPP_LAPACK_cheev(vectors,'U',nsize,hso,2*DIMENSION%neigd,eig_so,&
& hso,2*DIMENSION%neigd,& cwork, idim_c, rwork, info)
& eig_so,&
& cwork, idim_c, rwork, &
& info)
IF (info.NE.0) WRITE (6,FMT=8000) info IF (info.NE.0) WRITE (6,FMT=8000) info
8000 FORMAT (' AFTER CPP_LAPACK_cheev: info=',i4) 8000 FORMAT (' AFTER CPP_LAPACK_cheev: info=',i4)
CALL timestop("alineso SOC: -diag") CALL timestop("alineso SOC: -diag")
DEALLOCATE ( cwork,rwork ) DEALLOCATE (cwork,rwork)
IF (input%eonly) THEN IF (input%eonly) THEN
IF(l_socvec) CALL juDFT_error& IF(l_socvec) CALL juDFT_error("EONLY set. Vectors not calculated.",calledby ="alineso")
& ("EONLY set. Vectors not calculated.",calledby ="alineso")
ELSE ELSE
ALLOCATE ( zhelp2(DIMENSION%neigd,2*DIMENSION%neigd) ) ALLOCATE (zhelp2(DIMENSION%neigd,2*DIMENSION%neigd))
! !
! proj. back to G - space: old eigenvector 'z' to new one 'Z' ! proj. back to G - space: old eigenvector 'z' to new one 'Z'
! + ! +
...@@ -354,11 +329,11 @@ else ...@@ -354,11 +329,11 @@ else
& MATMUL ( sigma_xc , CONJG(hso(:nn,:nn)) ) ) & MATMUL ( sigma_xc , CONJG(hso(:nn,:nn)) ) )
WRITE(1014) nn WRITE(1014) nn
WRITE(1014) ((sigma_xc(i,j),i=1,j),j=1,nn) WRITE(1014) ((sigma_xc(i,j),i=1,j),j=1,nn)
DEALLOCATE ( sigma_xc ) DEALLOCATE (sigma_xc)
ENDIF ENDIF
ENDIF ENDIF
DEALLOCATE ( zhelp2 ) DEALLOCATE (zhelp2)
ENDIF ! (.NOT.input%eonly) ENDIF ! (.NOT.input%eonly)
DEALLOCATE ( hso ) DEALLOCATE ( hso )
......
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