From 2df59914159d08a3dc3e744820e33034199f57d2 Mon Sep 17 00:00:00 2001
From: MdSD <m.dos.santos.dias@fz-juelich.de>
Date: Wed, 27 Oct 2021 14:53:50 +0200
Subject: [PATCH] fixed array dimensions for potential mixing

---
 source/KKRhost/brydbm.f90 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/source/KKRhost/brydbm.f90 b/source/KKRhost/brydbm.f90
index d9c003893..c7b5e56d3 100644
--- a/source/KKRhost/brydbm.f90
+++ b/source/KKRhost/brydbm.f90
@@ -92,7 +92,11 @@ contains
 
     data mit/1/, zero, one/0.0_dp, 1.0_dp/
 
-    ntird = (irmd*ntperd+(irnsd+1)*(lmpotd-1)*natypd)*nspindd
+    ! write(*,'("irmd=",i8,"  ntperd=",i8,"  irnsd=",i8,"  lmpotd=",i8,"  natypd=",i8,"  nspindd=",i8)') irmd, ntperd, irnsd, lmpotd, natypd, nspindd
+    ! MdSD: old one, works if the radial mesh dimensions are large enough
+    ! ntird = (irmd*ntperd+(irnsd+1)*(lmpotd-1)*natypd)*nspindd
+    ! MdSD: new one
+    ntird = (irmd*ntperd+(irnsd+1)*(lmpotd-1)*natypd)*nspin
 
     allocate (am(2:itdthd-1), bm(2:itdthd-1), fm(ntird), fm1(ntird), g(ntird), sm(ntird), sm1(ntird), vi3(ntird), wit(2:200), ui2(ntird), ui3(ntird), vi2(ntird))
 
-- 
GitLab