From c9b0e5dd361dcb486b1a88c37b0d1eb2ed28a83d Mon Sep 17 00:00:00 2001
From: Alexei Borissov <dc-bori1@cosma-a.pri.cosma7.alces.network>
Date: Mon, 25 Feb 2019 17:18:32 +0000
Subject: [PATCH] fixed compilation errors

---
 .../isolated_galaxy.yml                       |  2 +-
 src/runner.c                                  |  5 +++--
 src/stars/EAGLE/stars.h                       | 21 -------------------
 3 files changed, 4 insertions(+), 24 deletions(-)

diff --git a/examples/IsolatedGalaxy/IsolatedGalaxy_starformation/isolated_galaxy.yml b/examples/IsolatedGalaxy/IsolatedGalaxy_starformation/isolated_galaxy.yml
index e4bea67340..1bf7689b99 100644
--- a/examples/IsolatedGalaxy/IsolatedGalaxy_starformation/isolated_galaxy.yml
+++ b/examples/IsolatedGalaxy/IsolatedGalaxy_starformation/isolated_galaxy.yml
@@ -35,7 +35,7 @@ Statistics:
 
 # Parameters related to the initial conditions
 InitialConditions:
-  file_name:               lowres8.hdf5 # The file to read
+  file_name:               fid.hdf5 # The file to read
   periodic:                0    # Are we running with periodic ICs?
   stars_smoothing_length:  0.5
   
diff --git a/src/runner.c b/src/runner.c
index 1095e0cb86..65a6705966 100644
--- a/src/runner.c
+++ b/src/runner.c
@@ -133,6 +133,7 @@ void runner_do_stars_ghost(struct runner *r, struct cell *c, int timer) {
 
   struct spart *restrict sparts = c->stars.parts;
   const struct engine *e = r->e;
+  const int with_cosmology = (e->policy & engine_policy_cosmology);
   const struct cosmology *cosmo = e->cosmology;
   const float stars_h_max = e->hydro_properties->h_max;
   const float stars_h_min = e->hydro_properties->h_min;
@@ -193,11 +194,11 @@ void runner_do_stars_ghost(struct runner *r, struct cell *c, int timer) {
         if (with_cosmology) {
           const integertime_t ti_step = get_integer_timestep(sp->time_bin);
           const integertime_t ti_begin =
-              get_integer_time_begin(ti_current - 1, sp->time_bin);
+              get_integer_time_begin(e->ti_current - 1, sp->time_bin);
           dt = cosmology_get_therm_kick_factor(e->cosmology, ti_begin,
                                                      ti_begin + ti_step);
         } else {
-          dt = get_timestep(sp->time_bin, time_base);
+          dt = get_timestep(sp->time_bin, e->time_base);
         }
 
 #ifdef SWIFT_DEBUG_CHECKS
diff --git a/src/stars/EAGLE/stars.h b/src/stars/EAGLE/stars.h
index 19f6ca75bf..94910f28ea 100644
--- a/src/stars/EAGLE/stars.h
+++ b/src/stars/EAGLE/stars.h
@@ -98,27 +98,6 @@ __attribute__((always_inline)) INLINE static void stars_predict_extra(
   /*   sp->h *= expf(w1); */
 }
 
-/**
- * @brief Predict additional particle fields forward in time when drifting
- *
- * @param p The particle
- * @param dt_drift The drift time-step for positions.
- */
-__attribute__((always_inline)) INLINE static void stars_predict_extra(
-    struct spart *restrict sp, float dt_drift) {
-
-  // Matthieu has it commented out in 646a0f54f6d56e5226b4275f224c1e6e8eb94e78
-  //const float h_inv = 1.f / sp->h;
-
-  ///* Predict smoothing length */
-  //const float w1 = sp->feedback.h_dt * h_inv * dt_drift;
-  //if (fabsf(w1) < 0.2f)
-  //  sp->h *= approx_expf(w1); /* 4th order expansion of exp(w) */
-  //else
-  //  sp->h *= expf(w1);
-
-}
-
 /**
  * @brief Sets the values to be predicted in the drifts to their values at a
  * kick time
-- 
GitLab