From 1ebc334a7daca0081343caa63495ac536292eb87 Mon Sep 17 00:00:00 2001 From: Gregor Michalicek Date: Thu, 8 Mar 2018 11:34:45 +0100 Subject: [PATCH] Correct indexing of lapw%index_lo array in slomat and hlomat --- eigen/hlomat.F90 | 8 ++++---- eigen/slomat.F90 | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/eigen/hlomat.F90 b/eigen/hlomat.F90 index 5af5375c..7bf1e2bd 100644 --- a/eigen/hlomat.F90 +++ b/eigen/hlomat.F90 @@ -125,7 +125,7 @@ CONTAINS END DO !+t3e DO nkvec = 1,invsfct* (2*l+1) - locol= lapw%nv(iintsp)+lapw%index_lo(lo,ntyp)+nkvec !this is the column of the matrix + locol= lapw%nv(iintsp)+lapw%index_lo(lo,na)+nkvec !this is the column of the matrix IF (MOD(locol-1,mpi%n_size).EQ.mpi%n_rank) THEN locol=(locol-1)/mpi%n_size+1 !this is the column in local storage !-t3e @@ -172,7 +172,7 @@ CONTAINS !---> calculate the hamiltonian matrix elements with other !---> local orbitals at the same atom and with itself DO nkvec = 1,invsfct* (2*l+1) - locol = lapw%nv(iintsp)+lapw%index_lo(lo,ntyp)+nkvec !this is the column of the matrix + locol = lapw%nv(iintsp)+lapw%index_lo(lo,na)+nkvec !this is the column of the matrix IF (MOD(locol-1,mpi%n_size).EQ.mpi%n_rank) THEN locol=(locol-1)/mpi%n_size+1 !this is the column in local storage !-t3e @@ -181,7 +181,7 @@ CONTAINS DO lop = 1, (lo-1) lp = atoms%llo(lop,ntyp) DO nkvecp = 1,invsfct* (2*lp+1) - lorow=lapw%nv(jintsp)+lapw%index_lo(lop,ntyp)+nkvecp + lorow=lapw%nv(jintsp)+lapw%index_lo(lop,na)+nkvecp DO m = -l,l lm = l* (l+1) + m DO mp = -lp,lp @@ -239,7 +239,7 @@ CONTAINS !---> calculate the hamiltonian matrix elements of one local !---> orbital with itself DO nkvecp = 1,nkvec - lorow=lapw%nv(jintsp)+lapw%index_lo(lop,ntyp)+nkvecp + lorow=lapw%nv(jintsp)+lapw%index_lo(lop,na)+nkvecp DO m = -l,l lm = l* (l+1) + m DO mp = -l,l diff --git a/eigen/slomat.F90 b/eigen/slomat.F90 index 5f5ef73d..6d8d32c9 100644 --- a/eigen/slomat.F90 +++ b/eigen/slomat.F90 @@ -82,7 +82,7 @@ CONTAINS clo1(lo)* clo1(lo) ) DO nkvec = 1,invsfct* (2*l+1) !Each LO can have several functions !+t3e - locol = lapw%nv(iintsp)+lapw%index_lo(lo,ntyp)+nkvec !this is the column of the matrix + locol = lapw%nv(iintsp)+lapw%index_lo(lo,na)+nkvec !this is the column of the matrix IF (MOD(locol-1,mpi%n_size).EQ.mpi%n_rank) THEN locol=(locol-1)/mpi%n_size+1 !this is the column in local storage !-t3e @@ -119,7 +119,7 @@ CONTAINS clo1(lo)*ud%uloulopn(lop,lo,ntyp,isp))) DO nkvecp = 1,invsfct* (2*lp+1) kp = lapw%kvec(nkvecp,lop,ntyp) - lorow=lapw%nv(jintsp)+lapw%index_lo(lop,ntyp)+nkvecp + lorow=lapw%nv(jintsp)+lapw%index_lo(lop,na)+nkvecp dotp = dot_PRODUCT(lapw%gk(:,k,iintsp),lapw%gk(:,kp,jintsp)) IF (smat%l_real) THEN smat%data_r(lorow,locol) =smat%data_r(lorow,locol)+chi*invsfct*fact3*legpol(l,dotp)* & @@ -136,7 +136,7 @@ CONTAINS !---> orbital with itself DO nkvecp = 1,nkvec kp = lapw%kvec(nkvecp,lo,ntyp) - lorow=lapw%nv(jintsp)+lapw%index_lo(lo,ntyp)+nkvecp + lorow=lapw%nv(jintsp)+lapw%index_lo(lo,na)+nkvecp dotp = dot_PRODUCT(lapw%gk(:,k,iintsp),lapw%gk(:,kp,jintsp)) IF (smat%l_real) THEN smat%data_r(lorow,locol) = smat%data_r(lorow,locol) + chi*invsfct*fact1*legpol(l,dotp) *& -- GitLab