From 2540f485784cce9efb58c11804a0e1e1d50f2b7c Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Tue, 26 Jul 2016 13:36:22 +0100
Subject: [PATCH] Read the entropy flag as an array of 6 values

---
 src/parallel_io.c | 4 +++-
 src/serial_io.c   | 4 +++-
 src/single_io.c   | 4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/parallel_io.c b/src/parallel_io.c
index c6bbcdfd39..2f70b470d9 100644
--- a/src/parallel_io.c
+++ b/src/parallel_io.c
@@ -410,7 +410,9 @@ void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units,
   if (h_grp < 0) error("Error while opening file header\n");
 
   /* Read the relevant information and print status */
-  readAttribute(h_grp, "Flag_Entropy_ICs", INT, flag_entropy);
+  int flag_entropy_temp[6];
+  readAttribute(h_grp, "Flag_Entropy_ICs", INT, flag_entropy_temp);
+  *flag_entropy = flag_entropy_temp[0];
   readAttribute(h_grp, "BoxSize", DOUBLE, boxSize);
   readAttribute(h_grp, "NumPart_Total", UINT, numParticles);
   readAttribute(h_grp, "NumPart_Total_HighWord", UINT, numParticles_highWord);
diff --git a/src/serial_io.c b/src/serial_io.c
index 91231e70c6..65f3e4798b 100644
--- a/src/serial_io.c
+++ b/src/serial_io.c
@@ -454,7 +454,9 @@ void read_ic_serial(char* fileName, const struct UnitSystem* internal_units,
     if (h_grp < 0) error("Error while opening file header\n");
 
     /* Read the relevant information and print status */
-    readAttribute(h_grp, "Flag_Entropy_ICs", INT, flag_entropy);
+    int flag_entropy_temp[6];
+    readAttribute(h_grp, "Flag_Entropy_ICs", INT, flag_entropy_temp);
+    *flag_entropy = flag_entropy_temp[0];
     readAttribute(h_grp, "BoxSize", DOUBLE, boxSize);
     readAttribute(h_grp, "NumPart_Total", UINT, numParticles);
     readAttribute(h_grp, "NumPart_Total_HighWord", UINT, numParticles_highWord);
diff --git a/src/single_io.c b/src/single_io.c
index f88f3da5c3..3cc83e852d 100644
--- a/src/single_io.c
+++ b/src/single_io.c
@@ -365,7 +365,9 @@ void read_ic_single(char* fileName, const struct UnitSystem* internal_units,
   if (h_grp < 0) error("Error while opening file header\n");
 
   /* Read the relevant information and print status */
-  readAttribute(h_grp, "Flag_Entropy_ICs", INT, flag_entropy);
+  int flag_entropy_temp[6];
+  readAttribute(h_grp, "Flag_Entropy_ICs", INT, flag_entropy_temp);
+  *flag_entropy = flag_entropy_temp[0];
   readAttribute(h_grp, "BoxSize", DOUBLE, boxSize);
   readAttribute(h_grp, "NumPart_Total", UINT, numParticles);
   readAttribute(h_grp, "NumPart_Total_HighWord", UINT, numParticles_highWord);
-- 
GitLab