From aa80c0e9d028ba918e0175c8943de2e6c25860f8 Mon Sep 17 00:00:00 2001
From: Antoine Cyril David Hoffmann <ahoffman@spcpc606.epfl.ch>
Date: Thu, 27 May 2021 16:45:14 +0200
Subject: [PATCH] Risk of wrong adress when DK CO is used

---
 src/collision_mod.F90 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/collision_mod.F90 b/src/collision_mod.F90
index 9bc9ade9..85d69116 100644
--- a/src/collision_mod.F90
+++ b/src/collision_mod.F90
@@ -450,7 +450,11 @@ CONTAINS
         Ciipj__kp(:,:,ikp) = 0._dp
       ELSE
         ! Kperp value in string format
-        write(kperp_string,'(f6.4)') kparray(ikp)
+        IF (CO .GT. 0) THEN
+          write(kperp_string,'(f6.4)') kparray(ikp)
+        ELSE
+          write(kperp_string,'(f6.4)') 0._dp
+        ENDIF
         !!!!!!!!!!!! Electron matrices !!!!!!!!!!!!
         ! get the self electron colision matrix
         ! Allocate space for storing full collision matrix
-- 
GitLab