From 94ca6774fdbf804b7b221c7c68e040be06bcd884 Mon Sep 17 00:00:00 2001
From: James Willis <james.s.willis@durham.ac.uk>
Date: Tue, 3 Apr 2018 22:07:30 +0800
Subject: [PATCH] Find next structure finding step when using delta t.

---
 examples/EAGLE_6/eagle_6.yml | 2 +-
 src/engine.c                 | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/examples/EAGLE_6/eagle_6.yml b/examples/EAGLE_6/eagle_6.yml
index 093f82ada7..65d9c094ac 100644
--- a/examples/EAGLE_6/eagle_6.yml
+++ b/examples/EAGLE_6/eagle_6.yml
@@ -43,7 +43,7 @@ TimeIntegration:
 # Parameters governing the snapshots
 Snapshots:
   basename:            eagle # Common part of the name of output files
-  time_first:          1.    # Time of the first output (in internal units)
+  time_first:          0.    # Time of the first output (in internal units)
   delta_time:          1e-3  # Time difference between consecutive outputs (in internal units)
   compression:         4
 
diff --git a/src/engine.c b/src/engine.c
index e9660d6e20..b974447277 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -4534,7 +4534,7 @@ void engine_step(struct engine *e) {
     velociraptor_invoke(e);
     
     /* ... and find the next output time */
-    engine_compute_next_stf_time(e);
+    if(e->stf_output_time_format == 1) engine_compute_next_stf_time(e);
     
     e->run_stf = 0;
   }
@@ -5642,8 +5642,10 @@ void engine_config(int restart, struct engine *e,
         e->timeFirstSnapshot, e->time_begin);
 
   /* Find the time of the first stf output */
-  engine_compute_next_stf_time(e);
-  message("Next STF step will be: %lld", e->ti_nextSTF);
+  if(e->stf_output_time_format == 1) { 
+    engine_compute_next_stf_time(e);
+    message("Next STF step will be: %lld", e->ti_nextSTF);
+  }
 
   /* Find the time of the first output */
   engine_compute_next_snapshot_time(e);
-- 
GitLab