Commit 1ebc334a by Gregor Michalicek

### Correct indexing of lapw%index_lo array in slomat and hlomat

parent 60c83589
 ... @@ -125,7 +125,7 @@ CONTAINS ... @@ -125,7 +125,7 @@ CONTAINS END DO END DO !+t3e !+t3e DO nkvec = 1,invsfct* (2*l+1) 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 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 locol=(locol-1)/mpi%n_size+1 !this is the column in local storage !-t3e !-t3e ... @@ -172,7 +172,7 @@ CONTAINS ... @@ -172,7 +172,7 @@ CONTAINS !---> calculate the hamiltonian matrix elements with other !---> calculate the hamiltonian matrix elements with other !---> local orbitals at the same atom and with itself !---> local orbitals at the same atom and with itself DO nkvec = 1,invsfct* (2*l+1) 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 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 locol=(locol-1)/mpi%n_size+1 !this is the column in local storage !-t3e !-t3e ... @@ -181,7 +181,7 @@ CONTAINS ... @@ -181,7 +181,7 @@ CONTAINS DO lop = 1, (lo-1) DO lop = 1, (lo-1) lp = atoms%llo(lop,ntyp) lp = atoms%llo(lop,ntyp) DO nkvecp = 1,invsfct* (2*lp+1) 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 DO m = -l,l lm = l* (l+1) + m lm = l* (l+1) + m DO mp = -lp,lp DO mp = -lp,lp ... @@ -239,7 +239,7 @@ CONTAINS ... @@ -239,7 +239,7 @@ CONTAINS !---> calculate the hamiltonian matrix elements of one local !---> calculate the hamiltonian matrix elements of one local !---> orbital with itself !---> orbital with itself DO nkvecp = 1,nkvec 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 DO m = -l,l lm = l* (l+1) + m lm = l* (l+1) + m DO mp = -l,l DO mp = -l,l ... ...
 ... @@ -82,7 +82,7 @@ CONTAINS ... @@ -82,7 +82,7 @@ CONTAINS clo1(lo)* clo1(lo) ) clo1(lo)* clo1(lo) ) DO nkvec = 1,invsfct* (2*l+1) !Each LO can have several functions DO nkvec = 1,invsfct* (2*l+1) !Each LO can have several functions !+t3e !+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 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 locol=(locol-1)/mpi%n_size+1 !this is the column in local storage !-t3e !-t3e ... @@ -119,7 +119,7 @@ CONTAINS ... @@ -119,7 +119,7 @@ CONTAINS clo1(lo)*ud%uloulopn(lop,lo,ntyp,isp))) clo1(lo)*ud%uloulopn(lop,lo,ntyp,isp))) DO nkvecp = 1,invsfct* (2*lp+1) DO nkvecp = 1,invsfct* (2*lp+1) kp = lapw%kvec(nkvecp,lop,ntyp) 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)) dotp = dot_PRODUCT(lapw%gk(:,k,iintsp),lapw%gk(:,kp,jintsp)) IF (smat%l_real) THEN IF (smat%l_real) THEN smat%data_r(lorow,locol) =smat%data_r(lorow,locol)+chi*invsfct*fact3*legpol(l,dotp)* & smat%data_r(lorow,locol) =smat%data_r(lorow,locol)+chi*invsfct*fact3*legpol(l,dotp)* & ... @@ -136,7 +136,7 @@ CONTAINS ... @@ -136,7 +136,7 @@ CONTAINS !---> orbital with itself !---> orbital with itself DO nkvecp = 1,nkvec DO nkvecp = 1,nkvec kp = lapw%kvec(nkvecp,lo,ntyp) 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)) dotp = dot_PRODUCT(lapw%gk(:,k,iintsp),lapw%gk(:,kp,jintsp)) IF (smat%l_real) THEN IF (smat%l_real) THEN smat%data_r(lorow,locol) = smat%data_r(lorow,locol) + chi*invsfct*fact1*legpol(l,dotp) *& smat%data_r(lorow,locol) = smat%data_r(lorow,locol) + chi*invsfct*fact1*legpol(l,dotp) *& ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!