From 437563582eb88b57155076e0a229618b91aa1f34 Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ipsl.fr>
Date: Tue, 24 Sep 2024 17:09:08 +0200
Subject: [PATCH] Flush before calling `subprocess.run`

Else the output of `subprocess.run` comes before the print statements
in the script.
---
 Inst_eddies/inst_eddies_INALT.py.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Inst_eddies/inst_eddies_INALT.py.in b/Inst_eddies/inst_eddies_INALT.py.in
index 1e3acc6d..c8525130 100644
--- a/Inst_eddies/inst_eddies_INALT.py.in
+++ b/Inst_eddies/inst_eddies_INALT.py.in
@@ -105,7 +105,9 @@ if "nc_time" not in inst_eddies_nml["input_ssh_nml"]:
 # First date is out of the loop because we run it without setting
 # leave_trace to False:
 print(
-    "inst_eddies.loop_inst_eddies: Date:", inst_eddies_nml["main_nml"]["date"]
+    "inst_eddies.loop_inst_eddies: Date:",
+    inst_eddies_nml["main_nml"]["date"],
+    flush=True,
 )
 process_1_file(
     inst_eddies_exe,
@@ -126,6 +128,7 @@ for inst_eddies_nml["input_ssh_nml"]["nc_time"] in range(
     print(
         "inst_eddies.loop_inst_eddies: Date:",
         inst_eddies_nml["main_nml"]["date"],
+        flush=True,
     )
 
     process_1_file(
-- 
GitLab