Commit 94e67b0b authored by Gregor Michalicek's avatar Gregor Michalicek

Eliminate gpt array in hybrid/hsfock.F90

parent adc83c64
......@@ -98,7 +98,6 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
REAL :: a_ex
! local arrays
INTEGER :: gpt(3,lapw%nv(jsp))
INTEGER :: degenerat(hybrid%ne_eig(nk))
INTEGER :: nsest(hybrid%nbands(nk)),indx_sest(hybrid%nbands(nk),hybrid%nbands(nk))
......@@ -125,11 +124,6 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
! initialize weighting factor for HF exchange part
a_ex=xcpot%get_exchange_weight()
! write k1,k2,k3 in gpt
DO i=1,lapw%nv(jsp)
gpt(:,i) = (/lapw%k1(i,jsp),lapw%k2(i,jsp),lapw%k3(i,jsp)/)
END DO
! read in lower triangle part of overlap matrix from direct acces file olap
nbasfcn = MERGE(lapw%nv(1)+lapw%nv(2)+2*atoms%nlotot,lapw%nv(1)+atoms%nlotot,noco%l_noco)
call olap%alloc(sym%invs,nbasfcn)
......@@ -159,7 +153,7 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
IF( ok .ne. 0 ) STOP 'mhsfock: failure allocation parent/symop'
parent = 0 ; symop = 0
CALL symm_hf(kpts,nk,sym,dimension,hybdat,eig_irr,atoms,hybrid,cell,lapw,jsp,gpt,mpi,irank2,&
CALL symm_hf(kpts,nk,sym,dimension,hybdat,eig_irr,atoms,hybrid,cell,lapw,jsp,lapw%gvec(:,:,jsp),mpi,irank2,&
nsymop,psym,nkpt_EIBZ,n_q,parent,symop,degenerat,pointer_EIBZ,maxndb,nddb,nsest,indx_sest,rep_c)
CALL timestop("symm_hf")
......@@ -183,6 +177,17 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
DEALLOCATE (rep_c)
CALL timestop("valence exchange calculation")
WRITE(1224,'(a,i7)') 'kpoint: ', nk
DO i = 1, ex%matsize1
DO j = 1, i
IF (ex%l_real) THEN
WRITE(1224,'(2i7,2f15.8)') i, j, ex%data_r(j,i) !ex%data_r(i,j), ex%data_r(j,i)
ELSE
WRITE(1224,'(2i7,4f15.8)') i, j, ex%data_c(j,i) !ex%data_c(i,j), ex%data_c(j,i)
ENDIF
END DO
END DO
CALL timestart("core exchange calculation")
! do the rest of the calculation only on master
IF (irank2 /= 0) RETURN
......@@ -227,12 +232,45 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
ENDDO
ENDDO
WRITE(1225,'(a,i7)') 'kpoint: ', nk
DO i = 1, ex%matsize1
DO j = 1, i
IF (ex%l_real) THEN
WRITE(1225,'(2i7,2f15.8)') i, j, ex%data_r(i,j), ex%data_r(j,i)
ELSE
WRITE(1225,'(2i7,4f15.8)') i, j, ex%data_c(i,j), ex%data_c(j,i)
ENDIF
END DO
END DO
CALL ex%multiply(invtrafo,tmp)
CALL trafo%multiply(tmp,v_x)
CALL timestop("time for performing T^-1*mat_ex*T^-1*")
CALL symmetrizeh(atoms,kpts%bkf(:,nk),dimension,jsp,lapw,gpt,sym,hybdat%kveclo_eig,cell,nsymop,psym,v_x)
WRITE(1231,'(a,i7)') 'kpoint: ', nk
DO i = 1, v_x%matsize1
DO j = 1, i
IF (v_x%l_real) THEN
WRITE(1231,'(2i7,1f15.8)') i, j, v_x%data_r(i,j)
ELSE
WRITE(1231,'(2i7,2f15.8)') i, j, v_x%data_c(i,j)
ENDIF
END DO
END DO
CALL symmetrizeh(atoms,kpts%bkf(:,nk),dimension,jsp,lapw,lapw%gvec(:,:,jsp),sym,hybdat%kveclo_eig,cell,nsymop,psym,v_x)
WRITE(1232,'(a,i7)') 'kpoint: ', nk
DO i = 1, v_x%matsize1
DO j = 1, i
IF (v_x%l_real) THEN
WRITE(1232,'(2i7,1f15.8)') i, j, v_x%data_r(j,i) ! Note the different indices in comparison to points above. This is wanted!
ELSE
WRITE(1232,'(2i7,2f15.8)') i, j, v_x%data_c(j,i) ! Note the different indices in comparison to points above. This is wanted!
ENDIF
END DO
END DO
CALL write_v_x(v_x,kpts%nkpt*(jsp-1) + nk)
END IF ! hybrid%l_calhf
......
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