From d8fa94479c31aa9c2408c98b8eaf0c1317855fab Mon Sep 17 00:00:00 2001
From: Robert Izzard <r.izzard@surrey.ac.uk>
Date: Tue, 15 Oct 2019 08:32:41 +0100
Subject: [PATCH] backport error in sign of derivative

---
 src/binary_c_derivatives.h                        | 2 ++
 src/binary_star_functions/limit_accretion_rates.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/binary_c_derivatives.h b/src/binary_c_derivatives.h
index e44e9b395..95837943a 100644
--- a/src/binary_c_derivatives.h
+++ b/src/binary_c_derivatives.h
@@ -148,6 +148,8 @@
         "Central helium",                       \
         "Central carbon",                       \
         "He core mass (no 3DUP)",               \
+        "Number of thermal pulses",             \
+        "Number of thermal pulses since mcmin", \
         "nova H layer mass",                    \
         "Roche radius"                          \
     }
diff --git a/src/binary_star_functions/limit_accretion_rates.c b/src/binary_star_functions/limit_accretion_rates.c
index ee6b3fa39..ead380874 100644
--- a/src/binary_star_functions/limit_accretion_rates.c
+++ b/src/binary_star_functions/limit_accretion_rates.c
@@ -409,7 +409,7 @@ void limit_accretion_rates(struct stardata_t * RESTRICT const stardata)
                                      * Remove all the accreted layer : anything 
                                      * remaining becomes part of the white dwarf.
                                      */
-                                    accretor->derivative[DERIVATIVE_STELLAR_H_LAYER_MASS] -=
+                                    accretor->derivative[DERIVATIVE_STELLAR_H_LAYER_MASS] +=
                                         dm_loss_rate;
                                     
                                     /*
-- 
GitLab