From e38cf9e472f08b8b60589b8a1e49d2748a0daf6c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Olav=20M=C3=B8yner?= <olav.moyner@gmail.com>
Date: Wed, 7 Feb 2024 12:03:54 +0100
Subject: [PATCH] Fix to transmissibility finite test

---
 src/utils.jl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/utils.jl b/src/utils.jl
index 025f5a70..becd74d3 100644
--- a/src/utils.jl
+++ b/src/utils.jl
@@ -1135,8 +1135,10 @@ function reservoir_transmissibility(d::DataDomain; version = :xyz)
     end
     bad_count = 0
     for (i, T_hf_i) in enumerate(T_hf)
-        bad_count += !isfinite(T_hf_i)
-        T_hf[i] = 0.0
+        if !isfinite(T_hf_i)
+            bad_count += 1
+            T_hf[i] = 0.0
+        end
     end
     if bad_count > 0
         tran_tot = length(T_hf)