Index: /TOOLS/ConsoGENCMIP6/bin/gencmip6.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/gencmip6.py	(revision 2426)
+++ /TOOLS/ConsoGENCMIP6/bin/gencmip6.py	(revision 2427)
@@ -96,4 +96,51 @@
   os.chdir(current_dir)
   return res
+
+
+########################################
+def get_input_files(dir_data, file_list):
+  """
+  """
+  res = []
+
+  for filename in file_list:
+    res.append(get_last_file(dir_data, filename))
+
+  if None in res:
+    print("\nMissing one or more input files, we stop.")
+    for f_in, f_out in zip(file_list, res):
+      print("=> {}: {}".format(f_in, f_out))
+    exit(1)
+
+  return res
+
+
+########################################
+def plot_save(img_in, img_out, title):
+  """
+  """
+  from matplotlib.backends.backend_pdf import PdfPages
+
+  dpi = 200.
+
+  # img_in  = os.path.join(DIR["PLOT"], "{}.pdf".format(img_name))
+
+  with PdfPages(img_in) as pdf:
+    pdf.savefig(dpi=dpi)
+
+    # pdf file's metadata
+    d = pdf.infodict()
+    d["Title"]   = title
+    d["Author"]  = os.path.basename(__file__)
+    # d["Subject"] = "Time spent over specific commands during create_ts \
+    #                 jobs at IDRIS and four configurations at TGCC"
+    # d["Keywords"] = "bench create_ts TGCC IDRIS ncrcat"
+    # d["CreationDate"] = dt.datetime(2009, 11, 13)
+    # d["ModDate"] = dt.datetime.today()
+
+  if os.path.isdir(DIR["SAVEPLOT"]):
+    # img_out = os.path.join(DIR["SAVEPLOT"],
+    #                        "{}_{}.pdf".format(img_name, suffix))
+    shutil.copy(img_in, img_out)
 
 
Index: /TOOLS/ConsoGENCMIP6/bin/plot_bilan.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/plot_bilan.py	(revision 2426)
+++ /TOOLS/ConsoGENCMIP6/bin/plot_bilan.py	(revision 2427)
@@ -39,13 +39,19 @@
   #---------------------------------------
   def fill_data(self, filein):
-    data = np.genfromtxt(
-      filein,
-      skip_header=1,
-      converters={0: string_to_date,
-                  1: string_to_float,
-                  2: string_to_percent,
-                  3: string_to_percent},
-      missing_values="nan",
-    )
+    """
+    """
+    try:
+      data = np.genfromtxt(
+        filein,
+        skip_header=1,
+        converters={0: string_to_date,
+                    1: string_to_float,
+                    2: string_to_percent,
+                    3: string_to_percent},
+        missing_values="nan",
+      )
+    except:
+      print("Empty file {}".format(filein))
+      exit(1)
 
     for date, conso, real_use, theo_use in data:
@@ -226,22 +232,29 @@
 
 
-########################################
-def plot_save(img_name):
-  """
-  """
-  dpi = 200.
-
-  with PdfPages(img_name) as pdf:
-    pdf.savefig(dpi=dpi)
-
-    # pdf file's metadata
-    d = pdf.infodict()
-    d["Title"]   = "Conso GENCMIP6"
-    d["Author"]  = "plot_bilan.py"
-    # d["Subject"] = "Time spent over specific commands during create_ts \
-    #                 jobs at IDRIS and four configurations at TGCC"
-    # d["Keywords"] = "bench create_ts TGCC IDRIS ncrcat"
-    # d["CreationDate"] = dt.datetime(2009, 11, 13)
-    # d["ModDate"] = dt.datetime.today()
+# ########################################
+# def plot_save(img_name, titre):
+#   """
+#   """
+#   dpi = 200.
+
+#   img_in  = os.path.join(DIR["PLOT"], "{}.pdf".format(img_name))
+
+#   with PdfPages(img_in) as pdf:
+#     pdf.savefig(dpi=dpi)
+
+#     # pdf file's metadata
+#     d = pdf.infodict()
+#     d["Title"]   = titre
+#     d["Author"]  = os.path.basename(__file__)
+#     # d["Subject"] = "Time spent over specific commands during create_ts \
+#     #                 jobs at IDRIS and four configurations at TGCC"
+#     # d["Keywords"] = "bench create_ts TGCC IDRIS ncrcat"
+#     # d["CreationDate"] = dt.datetime(2009, 11, 13)
+#     # d["ModDate"] = dt.datetime.today()
+
+#   if os.path.isdir(DIR["SAVEPLOT"]):
+#     img_out = os.path.join(DIR["SAVEPLOT"],
+#                            "{}_{}.pdf".format(img_name, today))
+#     shutil.copy(img_in, img_out)
 
 
@@ -287,5 +300,5 @@
 
   import matplotlib.pyplot as plt
-  from matplotlib.backends.backend_pdf import PdfPages
+  # from matplotlib.backends.backend_pdf import PdfPages
 
   if not args.show:
@@ -294,16 +307,7 @@
   # ... Files and directories ...
   # -----------------------------
-  file_param = get_last_file(DIR["SAVEDATA"], OUT["PARAM"])
-  file_utheo = get_last_file(DIR["SAVEDATA"], OUT["UTHEO"])
-  file_bilan = get_last_file(DIR["SAVEDATA"], OUT["BILAN"])
-
-  if file_param is None or \
-     file_utheo is None or \
-     file_bilan is None:
-    print("Missing one or more input files, we stop.")
-    print("=> PARAM: {}\n=> UTHEO: {}\n=> BILAN: {}".format(
-              file_param, file_utheo, file_bilan)
-          )
-    exit(1)
+  (file_param, file_utheo, file_data) = \
+      get_input_files(DIR["SAVEDATA"],
+                      [OUT["PARAM"], OUT["UTHEO"], OUT["BILAN"]])
 
   img_name = "bilan"
@@ -313,9 +317,7 @@
     print(file_param)
     print(file_utheo)
-    print(file_bilan)
+    print(file_data)
     print(img_name)
     print(today)
-    print(DIR)
-    print(OUT)
 
   # .. Get project info ..
@@ -333,5 +335,5 @@
   # ... Extract data from file ...
   # ------------------------------
-  bilan.fill_data(file_bilan)
+  bilan.fill_data(file_data)
   # ... Compute theoratical use from known data  ...
   # ------------------------------------------------
@@ -401,11 +403,9 @@
   # ... Save figure ...
   # -------------------
-  # plot_save(os.path.join(DIR["PLOT"], img_name))
   img_in  = os.path.join(DIR["PLOT"], "{}.pdf".format(img_name))
-  plot_save(img_in)
-  if os.path.isdir(DIR["SAVEPLOT"]):
-    img_out = os.path.join(DIR["SAVEPLOT"],
-                           "{}_{}.pdf".format(img_name, today))
-    shutil.copy(img_in, img_out)
+  img_out = os.path.join(DIR["SAVEPLOT"],
+                         "{}_{}.pdf".format(img_name, today))
+
+  plot_save(img_in, img_out, "Conso GENCMIP6")
 
   # ... Publish figure on dods ...
Index: /TOOLS/ConsoGENCMIP6/bin/plot_login.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/plot_login.py	(revision 2426)
+++ /TOOLS/ConsoGENCMIP6/bin/plot_login.py	(revision 2427)
@@ -10,6 +10,4 @@
 import os.path
 import numpy as np
-# import matplotlib.pyplot as plt
-# from matplotlib.backends.backend_pdf import PdfPages
 
 # Application library imports
@@ -26,11 +24,17 @@
   #---------------------------------------
   def fill_data(self, filein):
-    data = np.genfromtxt(
-      filein,
-      skip_header=1,
-      converters={0: string_to_date,
-                  1: str},
-      missing_values="nan",
-    )
+    """
+    """
+    try:
+      data = np.genfromtxt(
+        filein,
+        skip_header=1,
+        converters={0: string_to_date,
+                    1: str},
+        missing_values="nan",
+      )
+    except:
+      print("Empty file {}".format(filein))
+      exit(1)
 
     for date, login, conso in data:
@@ -87,7 +91,4 @@
   """
   """
-  print(ycoord)
-  print(consos)
-
   ax.barh(ycoord, consos, align="center", color="linen",
           linewidth=0.2, label="conso (heures)")
@@ -119,22 +120,29 @@
 
 
-########################################
-def plot_save(img_name):
-  """
-  """
-  dpi = 200.
-
-  with PdfPages(img_name) as pdf:
-    pdf.savefig(dpi=dpi)
-
-    # pdf file's metadata
-    d = pdf.infodict()
-    d["Title"]   = "Conso GENCMIP6 par login"
-    d["Author"]  = "plot_bilan.py"
-    # d["Subject"] = "Time spent over specific commands during create_ts \
-    #                 jobs at IDRIS and four configurations at TGCC"
-    # d["Keywords"] = "bench create_ts TGCC IDRIS ncrcat"
-    # d["CreationDate"] = dt.datetime(2009, 11, 13)
-    # d["ModDate"] = dt.datetime.today()
+# ########################################
+# def plot_save(img_name):
+#   """
+#   """
+#   dpi = 200.
+
+#   img_in  = os.path.join(DIR["PLOT"], "{}.pdf".format(img_name))
+
+#   with PdfPages(img_in) as pdf:
+#     pdf.savefig(dpi=dpi)
+
+#     # pdf file's metadata
+#     d = pdf.infodict()
+#     d["Title"]   = "Conso GENCMIP6 par login"
+#     d["Author"]  = "plot_bilan.py"
+#     # d["Subject"] = "Time spent over specific commands during create_ts \
+#     #                 jobs at IDRIS and four configurations at TGCC"
+#     # d["Keywords"] = "bench create_ts TGCC IDRIS ncrcat"
+#     # d["CreationDate"] = dt.datetime(2009, 11, 13)
+#     # d["ModDate"] = dt.datetime.today()
+
+#   if os.path.isdir(DIR["SAVEPLOT"]):
+#     img_out = os.path.join(DIR["SAVEPLOT"],
+#                            "{}_{}.pdf".format(img_name, today))
+#     shutil.copy(img_in, img_out)
 
 
@@ -173,5 +181,5 @@
 
   import matplotlib.pyplot as plt
-  from matplotlib.backends.backend_pdf import PdfPages
+  # from matplotlib.backends.backend_pdf import PdfPages
 
   if not args.show:
@@ -180,14 +188,17 @@
   # ... Files and directories ...
   # -----------------------------
-  file_param = get_last_file(DIR["SAVE"], OUT["PARAM"])
-  file_utheo = get_last_file(DIR["SAVE"], OUT["UTHEO"])
-  file_login = get_last_file(DIR["SAVE"], OUT["LOGIN"])
-  img_name = "bilan.pdf"
+  (file_param, file_utheo, file_data) = \
+      get_input_files(DIR["SAVEDATA"],
+                      [OUT["PARAM"], OUT["UTHEO"], OUT["LOGIN"]])
+
+  img_name = "login"
+  today = os.path.basename(file_param).strip(OUT["PARAM"])
 
   if args.verbose:
     print(file_param)
     print(file_utheo)
-    print(file_login)
+    print(file_data)
     print(img_name)
+    print(today)
 
   # .. Get project info ..
@@ -202,5 +213,5 @@
   # ----------------------
   logins = LoginDict()
-  logins.fill_data(file_login)
+  logins.fill_data(file_data)
 
   # .. Extract data depending on C.L. arguments ..
@@ -245,5 +256,5 @@
   # ... Save figure ...
   # -------------------
-  plot_save(os.path.join(DIR["PLOT"], img_name))
+  plot_save(img_name, today, "Conso GENCMIP6 par login")
 
   # ... Publish figure on dods ...
@@ -255,3 +266,3 @@
     plt.show()
 
-  exit()
+  exit(0)
Index: /TOOLS/ConsoGENCMIP6/bin/plot_store.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/plot_store.py	(revision 2426)
+++ /TOOLS/ConsoGENCMIP6/bin/plot_store.py	(revision 2427)
@@ -40,13 +40,19 @@
   #---------------------------------------
   def fill_data(self, filein):
-    data = np.genfromtxt(
-      filein,
-      skip_header=1,
-      converters={0: string_to_date,
-                  1: str,
-                  2: string_to_size_unit,
-                  3: str},
-      missing_values="nan",
-    )
+    """
+    """
+    try:
+      data = np.genfromtxt(
+        filein,
+        skip_header=1,
+        converters={0: string_to_date,
+                    1: str,
+                    2: string_to_size_unit,
+                    3: str},
+        missing_values="nan",
+      )
+    except:
+      print("Empty file {}".format(filein))
+      exit(1)
 
     for date, login, dirsize, dirname in data:
@@ -161,24 +167,4 @@
   plt.figtext(x=0.95, y=0.93, s=tot_label, backgroundcolor="linen",
               ha="right", va="bottom", fontsize="small")
-
-
-########################################
-def plot_save(img_name):
-  """
-  """
-  dpi = 200.
-
-  with PdfPages(img_name) as pdf:
-    pdf.savefig(dpi=dpi)
-
-    # pdf file's metadata
-    d = pdf.infodict()
-    d["Title"]   = "Occupation GENCMIP6 sur STORE par login"
-    d["Author"]  = "plot_bilan.py"
-    # d["Subject"] = "Time spent over specific commands during create_ts \
-    #                 jobs at IDRIS and four configurations at TGCC"
-    # d["Keywords"] = "bench create_ts TGCC IDRIS ncrcat"
-    # d["CreationDate"] = dt.datetime(2009, 11, 13)
-    # d["ModDate"] = dt.datetime.today()
 
 
@@ -220,5 +206,5 @@
 
   import matplotlib.pyplot as plt
-  from matplotlib.backends.backend_pdf import PdfPages
+  # from matplotlib.backends.backend_pdf import PdfPages
 
   if not args.show:
@@ -227,14 +213,17 @@
   # ... Files and directories ...
   # -----------------------------
-  file_param = get_last_file(DIR["SAVE"], OUT["PARAM"])
-  file_utheo = get_last_file(DIR["SAVE"], OUT["UTHEO"])
-  file_store = get_last_file(DIR["SAVE"], OUT["STORE"])
-  img_name = "bilan.pdf"
+  (file_param, file_utheo, file_data) = \
+      get_input_files(DIR["SAVEDATA"],
+                      [OUT["PARAM"], OUT["UTHEO"], OUT["STORE"]])
+
+  img_name = "store"
+  today = os.path.basename(file_param).strip(OUT["PARAM"])
 
   if args.verbose:
     print(file_param)
     print(file_utheo)
-    print(file_store)
+    print(file_data)
     print(img_name)
+    print(today)
 
   # .. Get project info ..
@@ -247,5 +236,5 @@
   # =======================
   stores = StoreDict()
-  stores.fill_data(file_store)
+  stores.fill_data(file_data)
 
   # .. Extract data depending on C.L. arguments ..
@@ -301,5 +290,5 @@
   # ... Save figure ...
   # -------------------
-  plot_save(os.path.join(DIR["PLOT"], img_name))
+  plot_save(img_name, today, "Occupation GENCMIP6 sur STORE par login")
 
   # ... Publish figure on dods ...
@@ -311,3 +300,3 @@
     plt.show()
 
-  exit()
+  exit(0)
Index: /TOOLS/ConsoGENCMIP6/launch_conso.sh
===================================================================
--- /TOOLS/ConsoGENCMIP6/launch_conso.sh	(revision 2426)
+++ /TOOLS/ConsoGENCMIP6/launch_conso.sh	(revision 2427)
@@ -23,5 +23,15 @@
 # Main script to get data
 # =======================
-bin/conso_gencmip6.py
+script="conso_gencmip6"
+printf "${script}\n"
+echo "--------------------"
+bin/${script}.py
+rc=$?
+if [ ${rc} -ne 0 ] ; then
+  echo "${script} terminated abnormally"
+  exit
+else
+  echo "${script} OK"
+fi
 
 # Plot daily consumption
@@ -29,3 +39,36 @@
 # -f : plot the whole period of the project
 # -d : copy plot on dods
-bin/plot_bilan.py -fd
+script="plot_bilan"
+printf "\n${script}\n"
+echo "--------------------"
+bin/${script}.py -fd
+rc=$?
+if [ ${rc} -ne 0 ] ; then
+  echo "${script} terminated abnormally"
+else
+  echo "${script} OK"
+fi
+
+script="plot_login"
+printf "\n${script}\n"
+echo "--------------------"
+bin/${script}.py -d
+rc=$?
+if [ ${rc} -ne 0 ] ; then
+  echo "${script} terminated abnormally"
+else
+  echo "${script} OK"
+fi
+
+script="plot_store"
+printf "\n${script}\n"
+echo "--------------------"
+bin/${script}.py -d
+rc=$?
+if [ ${rc} -ne 0 ] ; then
+  echo "${script} terminated abnormally"
+else
+  echo "${script} OK"
+fi
+
+printf "\nEnd of script OK\n"
