Commit 427f57c1 authored by Gregor Michalicek's avatar Gregor Michalicek

Eliminate gpt array in more hybrid functionals code

parent 94e67b0b
......@@ -153,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,lapw%gvec(:,:,jsp),mpi,irank2,&
CALL symm_hf(kpts,nk,sym,dimension,hybdat,eig_irr,atoms,hybrid,cell,lapw,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")
......@@ -259,7 +259,7 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
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)
CALL symmetrizeh(atoms,kpts%bkf(:,nk),dimension,jsp,lapw,sym,hybdat%kveclo_eig,cell,nsymop,psym,v_x)
WRITE(1232,'(a,i7)') 'kpoint: ', nk
DO i = 1, v_x%matsize1
......
......@@ -15,16 +15,9 @@
CONTAINS
SUBROUTINE symm_hf(kpts,nk,sym,&
& dimension,hybdat,eig_irr,&
& atoms,hybrid,cell,&
& lapw,jsp,&
& gpt,&
& mpi,irank2,&
& nsymop,psym,nkpt_EIBZ,n_q,parent,&
& symop,degenerat,pointer_EIBZ,maxndb,nddb,&
& nsest,indx_sest,rep_c )
SUBROUTINE symm_hf(kpts,nk,sym,dimension,hybdat,eig_irr,atoms,hybrid,cell,&
lapw,jsp,mpi,irank2,nsymop,psym,nkpt_EIBZ,n_q,parent,&
symop,degenerat,pointer_EIBZ,maxndb,nddb,nsest,indx_sest,rep_c)
USE m_constants
USE m_util ,ONLY: modulo1,intgrf,intgrf_init
......@@ -54,7 +47,6 @@
INTEGER,INTENT(OUT) :: maxndb,nddb
! - arrays -
INTEGER,INTENT(IN) :: gpt(3,lapw%nv(jsp))
INTEGER,INTENT(OUT) :: parent(kpts%nkptf)
INTEGER,INTENT(OUT) :: symop(kpts%nkptf)
INTEGER,INTENT(INOUT) :: degenerat(hybrid%ne_eig(nk))
......@@ -299,30 +291,21 @@
call read_z(z,nk)
ALLOCATE(rep_d(maxndb,nddb,nsymop),stat=ok )
IF( ok .ne. 0) STOP 'symm: failure allocation rep_v'
IF(ok.NE.0) STOP 'symm: failure allocation rep_v'
call olappw%alloc(z%l_real,lapw%nv(jsp),lapw%nv(jsp))
ALLOCATE( olapmt(hybrid%maxindx,hybrid%maxindx,0:atoms%lmaxd,atoms%ntype),stat=ok)
IF( ok .ne. 0) STOP 'symm: failure allocation olapmt'
IF(ok.NE.0) STOP 'symm: failure allocation olapmt'
olapmt = 0
CALL wfolap_init (olappw,olapmt,gpt,&
& atoms,hybrid,&
& cell,&
& hybdat%bas1,hybdat%bas2)
CALL wfolap_init(olappw,olapmt,lapw%gvec(:,:,jsp),atoms,hybrid,cell,hybdat%bas1,hybdat%bas2)
ALLOCATE( cmthlp(hybrid%maxlmindx,atoms%nat,maxndb), cpwhlp(lapw%nv(jsp),maxndb),&
& stat= ok )
IF( ok .ne. 0 ) STOP 'symm: failure allocation cmthlp/cpwhlp'
ALLOCATE(cmthlp(hybrid%maxlmindx,atoms%nat,maxndb), cpwhlp(lapw%nv(jsp),maxndb),stat= ok )
IF(ok.NE.0) STOP 'symm: failure allocation cmthlp/cpwhlp'
DO isym=1,nsymop
iop= psym(isym)
ic = 0
DO i=1,hybrid%nbands(nk)
ndb = degenerat(i)
......@@ -330,14 +313,9 @@
ic = ic + 1
cmthlp = 0
cpwhlp = 0
CALL waveftrafo_symm( &
& cmthlp(:,:,:ndb),cpwhlp(:,:ndb),cmt,z%l_real,z%data_r,z%data_c,&
& i,ndb,nk,iop,atoms,&
& hybrid,kpts,&
& sym,&
& jsp,dimension,&
& cell,gpt,lapw )
CALL waveftrafo_symm(cmthlp(:,:,:ndb),cpwhlp(:,:ndb),cmt,z%l_real,z%data_r,z%data_c,&
i,ndb,nk,iop,atoms,hybrid,kpts,sym,jsp,dimension,cell,lapw)
DO iband = 1,ndb
carr1 = cmt(iband+i-1,:,:)
......
......@@ -10,7 +10,7 @@ MODULE m_symmetrizeh
CONTAINS
SUBROUTINE symmetrizeh(atoms,bk,DIMENSION,jsp,lapw,gpt,sym,kveclo,cell,nsymop,psym,hmat)
SUBROUTINE symmetrizeh(atoms,bk,DIMENSION,jsp,lapw,sym,kveclo,cell,nsymop,psym,hmat)
USE m_constants
USE m_types
......@@ -28,7 +28,6 @@ SUBROUTINE symmetrizeh(atoms,bk,DIMENSION,jsp,lapw,gpt,sym,kveclo,cell,nsymop,ps
INTEGER, INTENT(IN) :: nsymop, jsp
! arrays
INTEGER, INTENT(IN) :: gpt(:,:)!(3,lapw%nv)
INTEGER, INTENT(IN) :: kveclo(atoms%nlotot)
INTEGER, INTENT(IN) :: psym(nsymop)
REAL, INTENT(IN) :: bk(3)
......@@ -135,23 +134,23 @@ SUBROUTINE symmetrizeh(atoms,bk,DIMENSION,jsp,lapw,gpt,sym,kveclo,cell,nsymop,ps
DO igpt = 1, lapw%nv(jsp)
!rotate G vector corresponding to isym
gpthlp = MATMUL(rrot(:,:,isym),gpt(:,igpt)) + g
gpthlp = MATMUL(rrot(:,:,isym),lapw%gvec(:,igpt,jsp)) + g
! determine number of gpthlp
nrgpt = 0
DO i = 1, lapw%nv(jsp)
IF(MAXVAL( ABS( gpthlp - gpt(:,i) ) ) .LE. 1E-06) THEN
IF(MAXVAL( ABS( gpthlp - lapw%gvec(:,i,jsp) ) ) .LE. 1E-06) THEN
nrgpt = i
EXIT
END IF
END DO
IF(nrgpt.EQ.0) THEN
PRINT *,igpt
PRINT *,gpt(:,igpt)
PRINT *,lapw%gvec(:,igpt,jsp)
PRINT *,gpthlp
PRINT *,g
PRINT *,bk
DO i=1,lapw%nv(jsp)
WRITE(6,*) i,gpt(:,i)
WRITE(6,*) i,lapw%gvec(:,i,jsp)
ENDDO
STOP 'symmetrizeh_new: rotated G point not found'
END IF
......@@ -244,7 +243,7 @@ SUBROUTINE symmetrizeh(atoms,bk,DIMENSION,jsp,lapw,gpt,sym,kveclo,cell,nsymop,ps
ilotot = ilotot + 1
l_lo(ilotot) = l
itype_lo(ilotot) = itype
gpt_lo(:,ilotot) = gpt(:,kveclo(ilotot))
gpt_lo(:,ilotot) = lapw%gvec(:,kveclo(ilotot),jsp)
END DO
END DO
END IF
......
......@@ -8,10 +8,9 @@
CONTAINS
SUBROUTINE waveftrafo_symm( &
& cmt_out,z_out,cmt,l_real,z_r,z_c,bandi,ndb,&
& nk,iop,atoms, hybrid,kpts, sym,&
& jsp,dimension, cell,gpt,lapw )
SUBROUTINE waveftrafo_symm(cmt_out,z_out,cmt,l_real,z_r,z_c,bandi,ndb,&
nk,iop,atoms,hybrid,kpts,sym,&
jsp,dimension,cell,lapw)
USE m_constants
USE m_util ,ONLY: modulo1
......@@ -32,8 +31,6 @@
INTEGER,INTENT(IN) :: bandi,iop
! - arrays -
INTEGER,INTENT(IN) :: gpt(3,lapw%nv(jsp))
COMPLEX,INTENT(IN) :: cmt(dimension%neigd,hybrid%maxlmindx,atoms%nat)
LOGICAL,INTENT(IN) :: l_real
REAL,INTENT(IN) :: z_r(dimension%nbasfcn,dimension%neigd)
......@@ -129,11 +126,11 @@
z_out = 0
DO igpt = 1,lapw%nv(jsp)
g = matmul( invrrot,gpt(:,igpt)+g1 )
g = matmul( invrrot,lapw%gvec(:,igpt,jsp)+g1 )
!determine number of g
igpt1 = 0
DO i = 1,lapw%nv(jsp)
IF ( maxval( abs( g - gpt(:,i) ) ) .le. 1E-06 ) THEN
IF ( maxval( abs( g - lapw%gvec(:,i,jsp) ) ) .le. 1E-06 ) THEN
igpt1 = i
EXIT
END IF
......@@ -141,7 +138,7 @@
IF ( igpt1 .eq. 0 ) THEN
STOP 'wavetrafo_symm: rotated G vector not found'
END IF
cdum = exp( tpiimg*dotprod(rkpt+gpt(:,igpt),trans(:)) )
cdum = exp( tpiimg*dotprod(rkpt+lapw%gvec(:,igpt,jsp),trans(:)) )
if (l_real) THEN
z_out(igpt,1:ndb) = cdum * z_r(igpt1,bandi:bandi+ndb-1)
else
......
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