From 03491df71f0b712970cb4039a67bee4f3fe13b2d Mon Sep 17 00:00:00 2001
From: Antoine Hoffmann <antoine.hoffmann@epfl.ch>
Date: Mon, 7 Nov 2022 15:55:37 +0100
Subject: [PATCH] Fixed time profiler that was not initialized properly anymore

---
 src/basic_mod.F90  | 7 ++++---
 src/control.F90    | 3 ++-
 src/ghosts_mod.F90 | 1 +
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/basic_mod.F90 b/src/basic_mod.F90
index 58e15407..ece5f9b1 100644
--- a/src/basic_mod.F90
+++ b/src/basic_mod.F90
@@ -86,9 +86,10 @@ CONTAINS
     READ(lu_in,basic)
 
     !Init cumulative timers
-    tc_rhs       = 0.;tc_adv_field = 0.; tc_poisson  = 0.
-    tc_Sapj      = 0.; tc_diag     = 0.; tc_checkfield = 0.
-
+    tc_rhs       = 0.; tc_adv_field = 0.; tc_poisson    = 0.
+    tc_Sapj      = 0.; tc_diag      = 0.; tc_checkfield = 0.
+    tc_ghost     = 0.; tc_coll      = 0.; tc_process    = 0.
+    tc_clos      = 0.; tc_step      = 0.;
   END SUBROUTINE basic_data
 
 
diff --git a/src/control.F90 b/src/control.F90
index 5c2571da..9420880f 100644
--- a/src/control.F90
+++ b/src/control.F90
@@ -66,7 +66,8 @@ SUBROUTINE control
 
      CALL diagnose(step)
 
-    CALL cpu_time(t1_step); tc_step = tc_step + (t1_step - t0_step)
+    CALL cpu_time(t1_step);
+    tc_step = tc_step + (t1_step - t0_step)
 
   END DO
 
diff --git a/src/ghosts_mod.F90 b/src/ghosts_mod.F90
index 8f0f4365..bea0f5c4 100644
--- a/src/ghosts_mod.F90
+++ b/src/ghosts_mod.F90
@@ -27,6 +27,7 @@ SUBROUTINE update_ghosts_moments
     CALL update_ghosts_z_i
   ENDIF
 
+  CALL cpu_time(t1_ghost)
   tc_ghost = tc_ghost + (t1_ghost - t0_ghost)
 END SUBROUTINE update_ghosts_moments
 
-- 
GitLab