From 890f27b239e4b70e80aa552866324118f8dabec5 Mon Sep 17 00:00:00 2001
From: Philipp Ruessmann <p.ruessmann@fz-juelich.de>
Date: Mon, 4 Jul 2022 16:51:06 +0200
Subject: [PATCH] small bugfix in array dimension of a MPI communication

---
 source/KKRhost/tmatimp_newsolver.F90 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/KKRhost/tmatimp_newsolver.F90 b/source/KKRhost/tmatimp_newsolver.F90
index 128506f04..043faf60e 100644
--- a/source/KKRhost/tmatimp_newsolver.F90
+++ b/source/KKRhost/tmatimp_newsolver.F90
@@ -508,7 +508,7 @@ contains
 
       i1 = (korbit+1)*lmmax0d*(korbit+1)*lmmax0d*ihost
       ! Allocation of temp for TMATLL
-      allocate (temp(lmmaxd,lmmaxd,natomimp), stat=i_stat)
+      allocate (temp(lmmaxd,lmmaxd,ihost), stat=i_stat)
       call memocc(i_stat, product(shape(temp))*kind(temp), 'temp', 'tmatimp_newsolver')
       temp = czero
       call mpi_allreduce(tmatll,temp,i1,mpi_double_complex,mpi_sum,mpi_comm_world,ierr)
-- 
GitLab