From ef072b407aa1ff1eb4b208a9e3ca0b06c62cec2b Mon Sep 17 00:00:00 2001
From: Robert Izzard <r.izzard@surrey.ac.uk>
Date: Sun, 1 Dec 2019 19:34:43 +0000
Subject: [PATCH] removed RLOF timestep modulator

---
 src/binary_c_parameters.h           |  7 ++-----
 src/binary_c_structures.h           |  4 ----
 src/logging/log_every_timestep.c    | 13 -------------
 src/setup/cmd_line_args.h           |  9 ---------
 src/setup/cmd_line_macros.h         |  6 ------
 src/setup/set_default_preferences.c |  3 ---
 src/zfuncs/tbgbf.c                  | 14 +++++++-------
 tbse                                |  1 -
 8 files changed, 9 insertions(+), 48 deletions(-)

diff --git a/src/binary_c_parameters.h b/src/binary_c_parameters.h
index 9de8b52d3..dcb91df12 100644
--- a/src/binary_c_parameters.h
+++ b/src/binary_c_parameters.h
@@ -578,13 +578,10 @@
 #define DTFAC_DEFAULT 1.0
 
 /*
- * Enable timestep modulation: if this is on then the global timestep 
- * is multiplied by stardata->preferences->timestep_modulator except
- * during RLOF when the minimum of the timestep_modulator and 
- * RLOF_timestep_modulator is used
+ * Enable timestep modulation
  */
 #define TIMESTEP_MODULATION
-//#define RLOF_TIMESTEP_MODULATION
+
 
 /*
  * Enable these to reduce the timestep when R approaches R_lobe (roche_radius)
diff --git a/src/binary_c_structures.h b/src/binary_c_structures.h
index cf1bf1765..1f01472ea 100644
--- a/src/binary_c_structures.h
+++ b/src/binary_c_structures.h
@@ -663,10 +663,6 @@ struct preferences_t {
 #ifdef TIMESTEP_MODULATION
     double timestep_modulator;
 #endif//TIMESTEP_MODULATION
-
-#ifdef RLOF_TIMESTEP_MODULATION
-    double RLOF_timestep_modulator;
-#endif//RLOF_TIMESTEP_MODULATION
     
 #ifdef RLOF_MDOT_MODULATION
     double RLOF_mdot_factor;
diff --git a/src/logging/log_every_timestep.c b/src/logging/log_every_timestep.c
index 8ed96f655..af24773ff 100644
--- a/src/logging/log_every_timestep.c
+++ b/src/logging/log_every_timestep.c
@@ -2663,18 +2663,6 @@ void log_every_timestep(struct stardata_t * RESTRICT const stardata)
         }
     }
 
-    if(0)
-    {
-        /*
-         * Deliberately fill the Printf buffer
-         */
-        unsigned int i;
-        for(i=0;i<10000;i++)
-        {
-            Printf("HELLO WORLD ");    
-        }
-        Printf("\n");
-    }
     /*
      * Clear the binary_c printf buffer here, if required
      */
@@ -2684,5 +2672,4 @@ void log_every_timestep(struct stardata_t * RESTRICT const stardata)
         Clear_printf_buffer;
     }
 
-
 }
diff --git a/src/setup/cmd_line_args.h b/src/setup/cmd_line_args.h
index 396d41e1d..44efa33f1 100644
--- a/src/setup/cmd_line_args.h
+++ b/src/setup/cmd_line_args.h
@@ -2673,15 +2673,6 @@ struct cmd_line_arg_t
         1.0                                                             \
         },                                                              \
 {         /* Roche lobe overflow */                                     \
-    ARG_SECTION_BINARY,                                                 \
-        "RLOF_timestep_modulator",                                      \
-        "Multiplier applied to the timestep during Roche-lobe overflow. Requires RLOF_TIMESTEP_MODULATION.", \
-        ARG_FLOAT ,                                                     \
-        WTTS_USE_DEFAULT,                                               \
-        RLOF_TIMESTEP_MODULATOR_VAR,                                    \
-        1.0                                                             \
-        },                                                              \
-{                                                                       \
     ARG_SECTION_BINARY,                                                 \
         "RLOF_mdot_factor",                                             \
         "Multiplier applied to the mass transfer rate during Roche-lobe overflow. Requires RLOF_MDOT_MODULATION.", \
diff --git a/src/setup/cmd_line_macros.h b/src/setup/cmd_line_macros.h
index cb5aaa3be..3d1704b51 100644
--- a/src/setup/cmd_line_macros.h
+++ b/src/setup/cmd_line_macros.h
@@ -97,12 +97,6 @@
 #define RLOF_F_VAR NULL
 #endif
 
-#ifdef RLOF_TIMESTEP_MODULATION
-#define RLOF_TIMESTEP_MODULATOR_VAR &(stardata->preferences->RLOF_timestep_modulator)
-#else
-#define RLOF_TIMESTEP_MODULATOR_VAR NULL
-#endif
-
 #ifdef RLOF_MDOT_MODULATION
 #define RLOF_MDOT_MODULATOR_VAR &(stardata->preferences->RLOF_mdot_factor)
 #else
diff --git a/src/setup/set_default_preferences.c b/src/setup/set_default_preferences.c
index db65bd791..5543bb7c0 100644
--- a/src/setup/set_default_preferences.c
+++ b/src/setup/set_default_preferences.c
@@ -22,9 +22,6 @@ void set_default_preferences(struct preferences_t * RESTRICT const preferences)
 #ifdef TIMESTEP_MODULATION
     preferences->timestep_modulator=1.0;
 #endif
-#ifdef RLOF_TIMESTEP_MODULATION
-    preferences->RLOF_timestep_modulator=1.0;
-#endif
 #ifdef RLOF_MDOT_MODULATION
     preferences->RLOF_mdot_factor=1.0;
 #endif  
diff --git a/src/zfuncs/tbgbf.c b/src/zfuncs/tbgbf.c
index 017b5561f..4d1add913 100644
--- a/src/zfuncs/tbgbf.c
+++ b/src/zfuncs/tbgbf.c
@@ -26,20 +26,20 @@ double tbgbf(struct stardata_t * stardata,
      */
     if(m>18.0)
     {
-        double x[2]={log10(Z/0.02),log10(m)};
-        double res[1];
+        double parameters[2]={ log10(Z/0.02), log10(m) };
+        double results[1];
         Interpolate(stardata->store->massive_MS_lifetimes,                   
-                    x,
-                    res,
-                    FALSE);
+                    parameters,
+                    results,
+                    FALSE /* TRUE=cache, FALSE=no cache */ );
         
-        res[0]=pow(10.0,res[0]-6.0);
+        results[0]=pow(10.0,results[0]-6.0);
   
         /*
          * Smoothly interpolate
          */
         double f = 1.0/(1.0 + pow(1e-3,m-20.0));
-        return oldage * (1.0-f) + res[0] * f;
+        return oldage * (1.0-f) + results[0] * f;
     }
     else
     {
diff --git a/tbse b/tbse
index 840524255..5d54e38dc 100755
--- a/tbse
+++ b/tbse
@@ -1912,7 +1912,6 @@ $NUCMULTS \
 $HE_IG_EXTRA \
 --rotationally_enhanced_mass_loss $ROTATIONALLY_ENHANCED_MASS_LOSS \
 --rotationally_enhanced_exponent $ROTATIONALLY_ENHANCED_EXPONENT \
---RLOF_timestep_modulator $RLOF_TIMESTEP_MODULATOR \
 --timestep_modulator $TIMESTEP_MODULATOR \
 --RLOF_f $RLOF_f \
 --RLOF_mdot_factor $RLOF_MDOT_FACTOR \
-- 
GitLab