Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
fleur
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
55
Issues
55
List
Boards
Labels
Milestones
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
fleur
fleur
Commits
3d62903b
Commit
3d62903b
authored
Aug 22, 2018
by
Gregor Michalicek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct matrix sizes at numerous places in hybrid functionals code
parent
b051de0b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
21 deletions
+41
-21
eigen/eigen.F90
eigen/eigen.F90
+1
-1
hybrid/add_Vnonlocal.F90
hybrid/add_Vnonlocal.F90
+12
-9
hybrid/checkolap.F90
hybrid/checkolap.F90
+4
-2
hybrid/exchange_val_hf.F90
hybrid/exchange_val_hf.F90
+18
-4
hybrid/gen_wavf.F90
hybrid/gen_wavf.F90
+2
-2
hybrid/hsfock.F90
hybrid/hsfock.F90
+4
-3
No files found.
eigen/eigen.F90
View file @
3d62903b
...
...
@@ -152,7 +152,7 @@ CONTAINS
PRINT
*
,
"TODO"
! STOP "TODO"
PRINT
*
,
"BASIS:"
,
lapw
%
nv
(
jsp
),
atoms
%
nlotot
IF
(
hybrid
%
l_addhf
)
CALL
add_Vnonlocal
(
nk
,
hybrid
,
dimension
,
kpts
,
jsp
,
results
,
xcpot
,
hmat
)
IF
(
hybrid
%
l_addhf
)
CALL
add_Vnonlocal
(
nk
,
lapw
,
atoms
,
hybrid
,
dimension
,
kpts
,
jsp
,
results
,
xcpot
,
noco
,
hmat
)
IF
(
hybrid
%
l_subvxc
)
THEN
CALL
subvxc
(
lapw
,
kpts
%
bk
(:,
nk
),
DIMENSION
,
input
,
jsp
,
v
%
mt
(:,
0
,:,:),
atoms
,
ud
,
hybrid
,
enpara
%
el0
,
enpara
%
ello0
,&
...
...
hybrid/add_Vnonlocal.F90
View file @
3d62903b
...
...
@@ -42,7 +42,7 @@ MODULE m_add_vnonlocal
! c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
CONTAINS
SUBROUTINE
add_vnonlocal
(
nk
,
hybrid
,
dimension
,
kpts
,
jsp
,
results
,
xcpot
,
hmat
)
SUBROUTINE
add_vnonlocal
(
nk
,
lapw
,
atoms
,
hybrid
,
dimension
,
kpts
,
jsp
,
results
,
xcpot
,
noco
,
hmat
)
USE
m_symm_hf
,
ONLY
:
symm_hf
USE
m_util
,
ONLY
:
intgrf
,
intgrf_init
...
...
@@ -61,22 +61,25 @@ MODULE m_add_vnonlocal
TYPE
(
t_dimension
),
INTENT
(
IN
)
::
dimension
TYPE
(
t_hybrid
),
INTENT
(
INOUT
)
::
hybrid
TYPE
(
t_kpts
),
INTENT
(
IN
)
::
kpts
TYPE
(
t_lapw
),
INTENT
(
IN
)
::
lapw
TYPE
(
t_atoms
),
INTENT
(
IN
)
::
atoms
TYPE
(
t_noco
),
INTENT
(
IN
)
::
noco
TYPE
(
t_mat
),
INTENT
(
INOUT
)
::
hmat
INTEGER
,
INTENT
(
IN
)
::
jsp
INTEGER
,
INTENT
(
IN
)
::
nk
! local scalars
INTEGER
::
n
,
nn
,
iband
INTEGER
::
n
,
nn
,
iband
,
nbasfcn
REAL
::
a_ex
TYPE
(
t_mat
)
::
olap
,
tmp
,
v_x
,
z
COMPLEX
::
exch
(
dimension
%
neigd
,
dimension
%
neigd
)
! initialize weighting factor for HF exchange part
a_ex
=
xcpot
%
get_exchange_weight
()
v_x
%
l_real
=
hmat
%
l_real
v_x
%
matsize1
=
dimension
%
nbasfcn
nbasfcn
=
MERGE
(
lapw
%
nv
(
1
)
+
lapw
%
nv
(
2
)
+2
*
atoms
%
nlotot
,
lapw
%
nv
(
1
)
+
atoms
%
nlotot
,
noco
%
l_noco
)
CALL
v_x
%
init
(
hmat
%
l_real
,
nbasfcn
,
nbasfcn
)
CALL
read_v_x
(
v_x
,
kpts
%
nkpt
*
(
jsp
-1
)
+
nk
)
! add non-local x-potential to the hamiltonian hmat
...
...
@@ -101,12 +104,12 @@ MODULE m_add_vnonlocal
END
IF
! read in lower triangle part of overlap matrix from direct acces file olap
CALL
olap
%
alloc
(
hmat
%
l_real
,
dimension
%
nbasfcn
)
CALL
olap
%
init
(
hmat
%
l_real
,
nbasfcn
,
nbasfcn
)
CALL
read_olap
(
olap
,
kpts
%
nkpt
*
(
jsp
-1
)
+
nk
)
IF
(
.NOT.
olap
%
l_real
)
olap
%
data_c
=
conjg
(
olap
%
data_c
)
CALL
z
%
alloc
(
olap
%
l_real
,
dimension
%
nbasfcn
,
dimension
%
neigd
)
CALL
z
%
init
(
olap
%
l_real
,
nbasfcn
,
dimension
%
neigd
)
CALL
read_z
(
z
,
nk
)
!what about spin?
WRITE
(
*
,
*
)
'What about spin (in add_Vnonlocal)?'
...
...
hybrid/checkolap.F90
View file @
3d62903b
...
...
@@ -44,7 +44,7 @@
INTEGER
::
j
,
m
INTEGER
::
l
INTEGER
::
lm
,
lm1
INTEGER
::
n
,
nred
INTEGER
::
n
,
nred
,
nbasfcn
REAL
::
rdum
,
rdum1
REAL
::
qnorm
...
...
@@ -79,7 +79,9 @@
ALLOCATE
(
z
(
nkpti
))
DO
ikpt
=
1
,
nkpti
call
z
(
ikpt
)
%
alloc
(
sym
%
invs
,
dimension
%
nbasfcn
,
dimension
%
neigd
)
CALL
lapw
%
init
(
input
,
noco
,
kpts
,
atoms
,
sym
,
ikpt
,
cell
,
sym
%
zrfs
)
nbasfcn
=
MERGE
(
lapw
%
nv
(
1
)
+
lapw
%
nv
(
2
)
+2
*
atoms
%
nlotot
,
lapw
%
nv
(
1
)
+
atoms
%
nlotot
,
noco
%
l_noco
)
call
z
(
ikpt
)
%
alloc
(
sym
%
invs
,
nbasfcn
,
dimension
%
neigd
)
ENDDO
IF
(
mpi
%
irank
==
0
)
WRITE
(
6
,
'(//A)'
)
'### checkolap ###'
...
...
hybrid/exchange_val_hf.F90
View file @
3d62903b
...
...
@@ -276,8 +276,8 @@ SUBROUTINE exchange_valence_hf(nk,kpts,nkpt_EIBZ,sym,atoms,hybrid,cell,dimension
IF
(
mat_ex
%
l_real
)
THEN
#ifdef CPP_IRAPPROX
CALL
wavefproducts_inv
(
1
,
hybdat
,
dimension
,
jsp
,
atoms
,
lapw
,
obsolete
,
kpts
,
nk
,
ikpt0
,&
mnobd
,
hybrid
,
parent
,
cell
,
sym
,
nkqpt
,
cprod_vv
)
CALL
wavefproducts_inv
(
1
,
hybdat
,
dimension
,
input
,
jsp
,
atoms
,
lapw
,
obsolete
,
kpts
,
nk
,
ikpt0
,&
mnobd
,
hybrid
,
parent
,
cell
,
sym
,
n
oco
,
n
kqpt
,
cprod_vv
)
#else
CALL
wavefproducts_inv5
(
1
,
hybrid
%
nbands
(
nk
),
ibando
,
ibando
+
psize
-1
,
dimension
,
input
,
jsp
,
atoms
,&
lapw
,
kpts
,
nk
,
ikpt0
,
hybdat
,
mnobd
,
hybrid
,
parent
,
cell
,
hybrid
%
nbasp
,
sym
,&
...
...
@@ -285,8 +285,8 @@ SUBROUTINE exchange_valence_hf(nk,kpts,nkpt_EIBZ,sym,atoms,hybrid,cell,dimension
#endif
ELSE
#ifdef CPP_IRAPPROX
CALL
wavefproducts_noinv
(
1
,
hybdat
,
nk
,
ikpt0
,
dimension
,
jsp
,
cell
,
atoms
,
hybrid
,
kpts
,
mnobd
,
lapw
,
sym
,
nkqpt
,
cprod_vv
)
CALL
wavefproducts_noinv
(
1
,
hybdat
,
nk
,
ikpt0
,
dimension
,
input
,
jsp
,
cell
,
atoms
,
hybrid
,
kpts
,
mnobd
,
lapw
,
sym
,
n
oco
,
n
kqpt
,
cprod_vv
)
#else
CALL
wavefproducts_noinv5
(
1
,
hybrid
%
nbands
(
nk
),
ibando
,
ibando
+
psize
-1
,
nk
,
ikpt0
,
dimension
,
input
,
jsp
,&
!jsp,&
cell
,
atoms
,
hybrid
,
hybdat
,
kpts
,
mnobd
,
lapw
,
sym
,
hybrid
%
nbasp
,
noco
,
nkqpt
,
cprod_vv_c
)
...
...
@@ -374,6 +374,13 @@ SUBROUTINE exchange_valence_hf(nk,kpts,nkpt_EIBZ,sym,atoms,hybrid,cell,dimension
END
DO
!ibando
END
DO
!ikpt
! WRITE(7001,'(a,i7)') 'nk: ', nk
! DO n1=1,hybrid%nbands(nk)
! DO n2=1,n1
! WRITE(7001,'(2i7,2f15.8)') n2, n1, exch_vv(n2,n1)
! END DO
! END DO
! add contribution of the gamma point to the different cases (exch_vv,exch_cv,exch_cc)
! valence-valence-valence-valence exchange
...
...
@@ -487,6 +494,13 @@ SUBROUTINE exchange_valence_hf(nk,kpts,nkpt_EIBZ,sym,atoms,hybrid,cell,dimension
calledby
=
'exchange_val_hf.F90'
)
END
IF
! WRITE(7000,'(a,i7)') 'nk: ', nk
! DO n1=1,hybrid%nbands(nk)
! DO n2=1,n1
! WRITE(7000,'(2i7,2f15.8)') n2, n1, exch_vv(n2,n1)
! END DO
! END DO
! write exch_vv in mat_ex
CALL
mat_ex
%
alloc
(
matsize1
=
hybrid
%
nbands
(
nk
))
IF
(
mat_ex
%
l_real
)
THEN
...
...
hybrid/gen_wavf.F90
View file @
3d62903b
...
...
@@ -283,7 +283,7 @@ CONTAINS
! write cmt at irreducible k-points in direct-access file cmt
CALL
write_cmt
(
cmt
,
ikpt0
)
CALL
zhlp
%
alloc
(
zmat
(
1
)
%
l_real
,
zmat
(
1
)
%
matsize1
,
zmat
(
1
)
%
matsize2
)
CALL
zhlp
%
alloc
(
zmat
(
ikpt0
)
%
l_real
,
zmat
(
ikpt0
)
%
matsize1
,
zmat
(
ikpt0
)
%
matsize2
)
IF
(
zhlp
%
l_real
)
THEN
zhlp
%
data_r
=
zmat
(
ikpt0
)
%
data_r
...
...
@@ -294,7 +294,7 @@ CONTAINS
! generate wavefunctions coefficients at all k-points from
! irreducible k-points
DO
ikpt
=
1
,
kpts
%
nkptf
IF
((
kpts
%
bkp
(
ikpt
)
.EQ.
ikpt0
)
.AND.
(
ikpt0
.NE.
ikpt
))
THEN
iop
=
kpts
%
bksym
(
ikpt
)
...
...
hybrid/hsfock.F90
View file @
3d62903b
...
...
@@ -89,7 +89,7 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
INTEGER
::
ikpt
,
ikpt0
INTEGER
::
irec
INTEGER
::
irecl_olap
,
irecl_z
,
irecl_vx
INTEGER
::
maxndb
INTEGER
::
maxndb
,
nbasfcn
INTEGER
::
nddb
INTEGER
::
nsymop
INTEGER
::
nkpt_EIBZ
...
...
@@ -131,7 +131,8 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
END
DO
! read in lower triangle part of overlap matrix from direct acces file olap
call
olap
%
alloc
(
sym
%
invs
,
dimension
%
nbasfcn
)
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
)
call
read_olap
(
olap
,
kpts
%
nkpt
*
(
jsp
-1
)
+
nk
)
if
(
.not.
olap
%
l_real
)
olap
%
data_c
=
conjg
(
olap
%
data_c
)
...
...
@@ -193,7 +194,7 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
IF
(
dimension
%
neigd
.LT.
hybrid
%
nbands
(
nk
))
STOP
'mhsfock: neigd < nbands(nk) ; '
&
'trafo from wavefunctions to APW requires at least nbands(nk) '
call
z
%
alloc
(
olap
%
l_real
,
dimension
%
nbasfcn
,
dimension
%
neigd
)
call
z
%
alloc
(
olap
%
l_real
,
nbasfcn
,
dimension
%
neigd
)
call
read_z
(
z
,
nk
)
!what about spin?
! calculate trafo
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment