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