From e2a06e57a26139e6bf6b00ed766e78c6093eb390 Mon Sep 17 00:00:00 2001
From: loikki <loic.hausammann@protonmail.ch>
Date: Wed, 18 Mar 2020 14:14:36 +0100
Subject: [PATCH] GEAR: apply unit changes after reading parameters from yaml

---
 src/feedback/GEAR/lifetime.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/feedback/GEAR/lifetime.h b/src/feedback/GEAR/lifetime.h
index 78a7ac16b2..d922129642 100644
--- a/src/feedback/GEAR/lifetime.h
+++ b/src/feedback/GEAR/lifetime.h
@@ -149,9 +149,6 @@ __attribute__((always_inline)) INLINE static void lifetime_read_from_tables(
     lt->constant[i] = tmp[i + 2 * dim];
   }
 
-  /* Change units from yr into Myr */
-  lt->constant[dim - 1] -= 6;
-
   /* Cleanup everything */
   free(tmp);
   h5_close_group(file_id, group_id);
@@ -196,6 +193,11 @@ __attribute__((always_inline)) INLINE static void lifetime_init(
 
   /* overwrite the parameters if found in the params */
   lifetime_read_from_params(lt, params);
+
+  /* Change units from yr into Myr */
+  const int dim = 3;
+  lt->constant[dim - 1] -= 6;
+
 }
 
 /**
-- 
GitLab