From 2075abfc5b915c2a40d655e3977b69596cefc445 Mon Sep 17 00:00:00 2001 From: "P.Buhl" Date: Thu, 23 Nov 2017 17:24:49 +0100 Subject: [PATCH] add old commit from frank treating problem: Included lmax into the argument lists of wann_mmk0_sph.f and wann_mmk0_updown_sph.f. Use lmax(n) instead of lmaxd to restrict angular momentum summations. Without this bugfix sometimes NAN pops up in the rspauli.1 file if there is more than one atom type in the unit cell and the lmax of the various atom types are different --- wannier/wann_mmk0_sph.f | 5 +++-- wannier/wannier.F | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/wannier/wann_mmk0_sph.f b/wannier/wann_mmk0_sph.f index 1884a2a1..c8132372 100644 --- a/wannier/wann_mmk0_sph.f +++ b/wannier/wann_mmk0_sph.f @@ -14,7 +14,7 @@ c Y.Mokrousov 15.6.06 c*********************************************************************** CONTAINS SUBROUTINE wann_mmk0_sph( - > llod,noccbd,nlod,natd,ntypd,lmaxd,lmd, + > llod,noccbd,nlod,natd,ntypd,lmaxd,lmax,lmd, > ntype,neq,nlo,llo,acof,bcof,ccof, > ddn,uulon,dulon,uloulopn, = mmn) @@ -23,6 +23,7 @@ c .. scalar arguments .. integer, intent (in) :: llod,nlod,natd,ntypd,lmaxd,lmd integer, intent (in) :: ntype,noccbd c .. array arguments .. + integer, intent (in) :: lmax(:) !(ntypd) integer, intent (in) :: neq(ntypd) integer, intent (in) :: nlo(ntypd),llo(nlod,ntypd) real, intent (in) :: ddn(0:lmaxd,ntypd) @@ -52,7 +53,7 @@ c---> performs summations of the overlaps of the wavefunctions nt1 = 1 do 130 n = 1,ntype nt2 = nt1 + neq(n) - 1 - do 120 l = 0,lmaxd + do 120 l = 0,lmax(n) suma = cmplx(0.,0.) sumb = cmplx(0.,0.) ll1 = l* (l+1) diff --git a/wannier/wannier.F b/wannier/wannier.F index e9a3d802..428b3816 100644 --- a/wannier/wannier.F +++ b/wannier/wannier.F @@ -1611,8 +1611,8 @@ c---> spherical contribution to mmn0-matrix call wann_mmk0_sph( > atoms%llod,noccbd,atoms%nlod,atoms%nat,atoms%ntype, - > atoms%lmaxd,lmd,atoms%ntype,atoms%neq,atoms%nlo, - > atoms%llo,acof(1:noccbd,:,:), + > atoms%lmaxd,atoms%lmax,lmd,atoms%ntype,atoms%neq, + > atoms%nlo,atoms%llo,acof(1:noccbd,:,:), > bcof(1:noccbd,:,:),ccof(:,1:noccbd,:,:), > usdus%ddn(:,:,jspin),usdus%uulon(:,:,jspin), > usdus%dulon(:,:,jspin),usdus%uloulopn, -- GitLab