Commit 1569cf4f authored by Gregor Michalicek's avatar Gregor Michalicek

Correct the record index for the acces to the z.mat file everywhere

Note1: There are entries for every k point in the full BZ.
Note2: The storage has to be performed spin-dependent because the access
       is performed at different places in different spin loops independent
       of the "storage spin loop".
parent b2abfc3f
...@@ -106,7 +106,7 @@ CONTAINS ...@@ -106,7 +106,7 @@ CONTAINS
CALL z%init(olap%l_real, nbasfcn, dimension%neigd) CALL z%init(olap%l_real, nbasfcn, dimension%neigd)
CALL read_z(z, kpts%nkpt*(jsp - 1) + nk) CALL read_z(z, kpts%nkptf*(jsp - 1) + nk)
! calculate exchange contribution of current k-point nk to total energy (te_hfex) ! calculate exchange contribution of current k-point nk to total energy (te_hfex)
! in the case of a spin-unpolarized calculation the factor 2 is added in eigen.F90 ! in the case of a spin-unpolarized calculation the factor 2 is added in eigen.F90
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
ALLOCATE (carr2(maxval(hybrid%nbands), (atoms%lmaxd + 1)**2)) ALLOCATE (carr2(maxval(hybrid%nbands), (atoms%lmaxd + 1)**2))
ALLOCATE (carr3(maxval(hybrid%nbands), (atoms%lmaxd + 1)**2)) ALLOCATE (carr3(maxval(hybrid%nbands), (atoms%lmaxd + 1)**2))
DO ikpt = 1, nkpti DO ikpt = 1, nkpti
call read_z(z(ikpt), ikpt) call read_z(z(ikpt), kpts%nkptf*(jsp - 1) + ikpt)
END DO END DO
iatom = 0 iatom = 0
......
...@@ -273,7 +273,7 @@ CONTAINS ...@@ -273,7 +273,7 @@ CONTAINS
ELSE ELSE
zhlp%data_c = zmat(ikpt0)%data_c zhlp%data_c = zmat(ikpt0)%data_c
END IF END IF
CALL write_z(zhlp, ikpt0) CALL write_z(zhlp, kpts%nkptf*(jsp - 1) + ikpt0)
! generate wavefunctions coefficients at all k-points from ! generate wavefunctions coefficients at all k-points from
! irreducible k-points ! irreducible k-points
...@@ -286,7 +286,7 @@ CONTAINS ...@@ -286,7 +286,7 @@ CONTAINS
hybrid%nbands(ikpt0), cell, lapw(ikpt0), lapw(ikpt), .true.) hybrid%nbands(ikpt0), cell, lapw(ikpt0), lapw(ikpt), .true.)
CALL write_cmt(cmthlp, ikpt) CALL write_cmt(cmthlp, ikpt)
CALL write_z(zhlp, ikpt) CALL write_z(zhlp, kpts%nkptf*(jsp - 1) + ikpt)
END IF END IF
END DO !ikpt END DO !ikpt
END DO !ikpt0 END DO !ikpt0
......
...@@ -191,7 +191,7 @@ CONTAINS ...@@ -191,7 +191,7 @@ CONTAINS
IF (dimension%neigd < hybrid%nbands(nk)) STOP " mhsfock: neigd < nbands(nk) ;trafo from wavefunctions to APW requires at least nbands(nk)" IF (dimension%neigd < hybrid%nbands(nk)) STOP " mhsfock: neigd < nbands(nk) ;trafo from wavefunctions to APW requires at least nbands(nk)"
call z%init(olap%l_real, nbasfcn, dimension%neigd) call z%init(olap%l_real, nbasfcn, dimension%neigd)
call read_z(z, kpts%nkpt*(jsp - 1) + nk) call read_z(z, kpts%nkptf*(jsp - 1) + nk)
z%matsize2 = hybrid%nbands(nk) ! reduce "visible matsize" for the following computations z%matsize2 = hybrid%nbands(nk) ! reduce "visible matsize" for the following computations
call olap%multiply(z, trafo) call olap%multiply(z, trafo)
......
...@@ -105,7 +105,7 @@ MODULE m_kp_perturbation ...@@ -105,7 +105,7 @@ MODULE m_kp_perturbation
! read in z coefficient from direct access file z at k-point nk ! read in z coefficient from direct access file z at k-point nk
call read_z(z, nk) call read_z(z, kpts%nkptf*(jsp - 1) + nk)
! construct local orbital consisting of radial function times spherical harmonic ! construct local orbital consisting of radial function times spherical harmonic
! where the radial function vanishes on the MT sphere boundary ! where the radial function vanishes on the MT sphere boundary
...@@ -841,7 +841,7 @@ MODULE m_kp_perturbation ...@@ -841,7 +841,7 @@ MODULE m_kp_perturbation
! read in z coefficients from direct access file z at kpoint nk ! read in z coefficients from direct access file z at kpoint nk
call read_z(z, nk) call read_z(z, kpts%nkptf*(jsp - 1) + nk)
!CALL intgrf_init(atoms%ntype,atoms%jmtd,atoms%jri,atoms%dx,atoms%rmsh,hybdat%gridf) !CALL intgrf_init(atoms%ntype,atoms%jmtd,atoms%jri,atoms%dx,atoms%rmsh,hybdat%gridf)
......
...@@ -275,7 +275,7 @@ CONTAINS ...@@ -275,7 +275,7 @@ CONTAINS
! read in cmt and z at current k-point (nk) ! read in cmt and z at current k-point (nk)
CALL read_cmt(cmt, nk) CALL read_cmt(cmt, nk)
call read_z(z, nk) call read_z(z, kpts%nkptf*(jsp - 1) + nk)
ALLOCATE (rep_d(maxndb, nddb, nsymop), stat=ok) ALLOCATE (rep_d(maxndb, nddb, nsymop), stat=ok)
IF (ok /= 0) STOP 'symm: failure allocation rep_v' IF (ok /= 0) STOP 'symm: failure allocation rep_v'
......
...@@ -126,8 +126,8 @@ CONTAINS ...@@ -126,8 +126,8 @@ CONTAINS
nbasfcn = MERGE(lapw_nkqpt%nv(1) + lapw_nkqpt%nv(2) + 2*atoms%nlotot, lapw_nkqpt%nv(1) + atoms%nlotot, noco%l_noco) nbasfcn = MERGE(lapw_nkqpt%nv(1) + lapw_nkqpt%nv(2) + 2*atoms%nlotot, lapw_nkqpt%nv(1) + atoms%nlotot, noco%l_noco)
call z_kqpt%alloc(.false., nbasfcn, dimension%neigd) call z_kqpt%alloc(.false., nbasfcn, dimension%neigd)
call read_z(z_nk, nk) call read_z(z_nk, kpts%nkptf*(jsp - 1) + nk)
call read_z(z_kqpt, nkqpt) call read_z(z_kqpt, kpts%nkptf*(jsp - 1) + nkqpt)
! read in cmt coefficients from direct access file cmt ! read in cmt coefficients from direct access file cmt
call read_cmt(cmt_nk, nk) call read_cmt(cmt_nk, nk)
...@@ -388,8 +388,8 @@ CONTAINS ...@@ -388,8 +388,8 @@ CONTAINS
nbasfcn = MERGE(lapw_nkqpt%nv(1) + lapw_nkqpt%nv(2) + 2*atoms%nlotot, lapw_nkqpt%nv(1) + atoms%nlotot, noco%l_noco) nbasfcn = MERGE(lapw_nkqpt%nv(1) + lapw_nkqpt%nv(2) + 2*atoms%nlotot, lapw_nkqpt%nv(1) + atoms%nlotot, noco%l_noco)
call z_kqpt%alloc(.true., nbasfcn, dimension%neigd) call z_kqpt%alloc(.true., nbasfcn, dimension%neigd)
call read_z(z_nk, nk) call read_z(z_nk, kpts%nkptf*(jsp - 1) + nk)
call read_z(z_kqpt, nkqpt) call read_z(z_kqpt, kpts%nkptf*(jsp - 1) + nkqpt)
DO igpt = 1, hybrid%ngptm(iq) DO igpt = 1, hybrid%ngptm(iq)
igptp = hybrid%pgptm(igpt, iq) igptp = hybrid%pgptm(igpt, iq)
...@@ -1317,8 +1317,8 @@ CONTAINS ...@@ -1317,8 +1317,8 @@ CONTAINS
! read in z at k-point nk and nkqpt ! read in z at k-point nk and nkqpt
call timestart("read_z") call timestart("read_z")
CALL read_z(z_nk, nk) CALL read_z(z_nk, kpts%nkptf*(jsp - 1) + nk)
call read_z(z_kqpt, nkqpt) call read_z(z_kqpt, kpts%nkptf*(jsp - 1) + nkqpt)
call timestop("read_z") call timestop("read_z")
g(1) = maxval(abs(lapw%k1(:lapw%nv(jsp), jsp))) & g(1) = maxval(abs(lapw%k1(:lapw%nv(jsp), jsp))) &
...@@ -2328,8 +2328,8 @@ CONTAINS ...@@ -2328,8 +2328,8 @@ CONTAINS
! read in z at k-point nk and nkqpt ! read in z at k-point nk and nkqpt
call timestart("read_z") call timestart("read_z")
call read_z(z_nk, nk) call read_z(z_nk, kpts%nkptf*(jsp - 1) + nk)
call read_z(z_kqpt, nkqpt) call read_z(z_kqpt, kpts%nkptf*(jsp - 1) + nkqpt)
call timestop("read_z") call timestop("read_z")
g(1) = maxval(abs(lapw%k1(:lapw%nv(jsp), jsp))) & g(1) = maxval(abs(lapw%k1(:lapw%nv(jsp), jsp))) &
......
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