Index: /TOOLS/ConsoGENCMIP6/bin/conso_gencmip6.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/conso_gencmip6.py	(revision 2436)
+++ /TOOLS/ConsoGENCMIP6/bin/conso_gencmip6.py	(revision 2437)
@@ -22,9 +22,12 @@
 def get_storedir(login):
 
+  print("get_storedir")
+
   command = ["ccc_home", "-A", "-u", login]
   try :
     res = subprocess.check_output(command)
+    print("res", res)
   except Exception as rc:
-    print(rc)
+    print("exception", rc)
     res = None
 
@@ -134,5 +137,5 @@
 
 ########################################
-def write_bilan(filename, today, total, ureal, utheo):
+def write_bilan(filename, today, total, ureal, utheo, run_mean, pen_mean, run_std, pen_std):
   """
   Conso totale par jour
@@ -142,15 +145,24 @@
   """
 
-  title_str  = "{:10s} {:12s} {:11s} {:11s}\n".format(
+  title_str  = "{:10s} {:12s} {:11s} {:11s} {:13s} {:13s} {:13s} {:13s}\n".format(
                  "date",
                  "conso(hours)",
                  "real_use(%)",
                  "theo_use(%)",
-               )
-  result_str = "{:%Y-%m-%d} {:12.2f} {:11.2f} {:11.2f}\n".format(
+                 "running(core)",
+                 "pending(core)",
+                 "run_std(core)",
+                 "pen_std(core)",
+               )
+  str_fmt = "{:%Y-%m-%d} {:12.2f} {:11.2f} {:11.2f} {:13.2f} {:13.2f} {:13.2f} {:13.2f}\n"
+  result_str = str_fmt.format(
                  today,
                  total,
                  ureal,
                  utheo,
+                 run_mean,
+                 pen_mean,
+                 run_std,
+                 pen_std,
                )
 
@@ -285,9 +297,9 @@
 
 ########################################
-def save_files(OUT, today):
+def save_files(file_list, today):
 
   if not args.dryrun:
     suffix = "{:%Y%m%d}".format(today)
-    for filename in OUT.itervalues():
+    for filename in file_list:
       filein  = os.path.join(DIR["DATA"], filename)
       if os.path.isfile(filein):
@@ -349,6 +361,53 @@
   # 2- Conso totale par jour
   # ------------------------
+
   if args.verbose:
     print("=> write_bilan")
+
+  file_jobs = get_last_file(
+      DIR["SAVEDATA"],
+      "{}_{:%Y%m%d}".format(OUT["JOBS"], today)
+  )
+  if args.verbose:
+    print(file_jobs)
+
+  run_mean = np.nan
+  pen_mean = np.nan
+  run_std  = np.nan
+  pen_std  = np.nan
+
+  if file_jobs:
+    try:
+      data = np.genfromtxt(
+        file_jobs,
+        skip_header=1,
+        converters={
+          0: string_to_datetime,
+          1: int,
+          2: int,
+        },
+        missing_values="nan",
+      )
+    except Exception as rc:
+      print("Problem with file {} :\n{}".format(file_jobs, rc))
+      exit(1)
+
+    if len(data) == 24:
+      run_mean = np.nanmean(
+          np.array([run for _, run, _ in data])
+      )
+      pen_mean = np.nanmean(
+          np.array([pen for _, _, pen in data])
+      )
+
+      run_std = np.nanstd(
+          np.array([run for _, run, _ in data])
+      )
+      pen_std = np.nanstd(
+          np.array([pen for _, _, pen in data])
+      )
+
+  if args.verbose:
+    print(run_mean, pen_mean, run_std, pen_std)
 
   write_bilan(
@@ -357,5 +416,9 @@
     total,
     ureal,
-    utheo
+    utheo,
+    run_mean,
+    pen_mean,
+    run_std,
+    pen_std,
   )
 
@@ -379,7 +442,6 @@
     print("=> write_store")
 
-  # if where_we_run() == "curie":
-  #   write_store(os.path.join(DIR["DATA"], OUT["STORE"]))
-  write_store(os.path.join(DIR["DATA"], OUT["STORE"]), today, logins)
+  if where_we_run() == "curie":
+    write_store(os.path.join(DIR["DATA"], OUT["STORE"]), today, logins)
 
   # Save files (on WORKDIR)
@@ -388,5 +450,14 @@
     print("=> Save files")
   if not args.dryrun:
-    save_files(OUT, today)
+    file_list = [
+        OUT["PARAM"],
+        OUT["BILAN"],
+        OUT["UTHEO"],
+        OUT["LOGIN"],
+        OUT["STORE"],
+        OUT["CCCMP"],
+    ]
+
+    save_files(file_list, today)
 
   exit(0)
Index: /TOOLS/ConsoGENCMIP6/bin/gencmip6.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/gencmip6.py	(revision 2436)
+++ /TOOLS/ConsoGENCMIP6/bin/gencmip6.py	(revision 2437)
@@ -11,4 +11,5 @@
 import glob
 import shutil
+import subprocess
 import datetime as dt
 import numpy as np
@@ -26,6 +27,19 @@
     return
 
-  fileout = os.path.join(DIR["DODS"], os.path.basename(filein))
+  basefile = os.path.basename(filein)
+
+  fileout = os.path.join(DIR["DODS"], basefile)
+  filepng = os.path.join(DIR["DODS"], "img", basefile.split(".")[0] + ".png")
+
+  #Â Copy file
   shutil.copy(filein, fileout)
+
+  # Convert it to png for web page
+  command = ["convert", "-density", "200", fileout, filepng]
+
+  try :
+    subprocess.call(command)
+  except Exception as rc :
+    print("Error in convert for {}:\n{}".format(fileout, rc))
 
   return
Index: /TOOLS/ConsoGENCMIP6/bin/gencmip6_path.py.init
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/gencmip6_path.py.init	(revision 2436)
+++ /TOOLS/ConsoGENCMIP6/bin/gencmip6_path.py.init	(revision 2437)
@@ -13,5 +13,5 @@
 
 
-ROOT_DIR = os.getcwd()
+ROOT_DIR = os.path.join(os.environ["HOME"], "ConsoGENCMIP6")
 
 # Common paths
@@ -20,5 +20,5 @@
   "ROOT": ROOT_DIR,
   "DATA": os.path.join(ROOT_DIR, "output"),
-  "SAVE": os.path.join(ROOT_DIR, "save"),
+  "SAVE": os.path.join(os.environ["CCCWORKDIR"], "ConsoGENCMIP6"),
   "PLOT": os.path.join(ROOT_DIR, "plot"),
   "DODS": None,
@@ -42,5 +42,6 @@
   "LOGIN": "OUT_CONSO_LOGIN",
   "STORE": "OUT_CONSO_STORE",
-  "CCCMP": "ccc_myproject.dat"
+  "CCCMP": "ccc_myproject.dat",
+  "JOBS":  "OUT_JOBS_PENDING",
 }
 
Index: /TOOLS/ConsoGENCMIP6/bin/plot_bilan.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/plot_bilan.py	(revision 2436)
+++ /TOOLS/ConsoGENCMIP6/bin/plot_bilan.py	(revision 2437)
@@ -18,5 +18,5 @@
 
 ########################################
-class BilanDict(dict):
+class DataDict(dict):
   #---------------------------------------
   def __init__(self):
@@ -45,25 +45,44 @@
         filein,
         skip_header=1,
-        converters={0: string_to_date,
-                    1: string_to_float,
-                    2: string_to_percent,
-                    3: string_to_percent},
+        converters={
+          0: string_to_date,
+          1: string_to_float,
+          2: string_to_percent,
+          3: string_to_percent,
+          4: string_to_float,
+          5: string_to_float,
+          6: string_to_float,
+          7: string_to_float,
+        },
         missing_values="nan",
       )
-    except:
-      print("Empty file {}".format(filein))
+    except Exception as rc:
+      print("Empty file {}:\n{}".format(filein, rc))
       exit(1)
 
-    for date, conso, real_use, theo_use in data:
+    for date, conso, real_use, theo_use, \
+        run_mean, pen_mean, run_std, pen_std in data:
       if date in self:
-        self.add_item(date, conso, real_use, theo_use)
+        self.add_item(
+          date,
+          conso,
+          real_use,
+          theo_use,
+          run_mean,
+          pen_mean,
+          run_std,
+          pen_std,
+        )
         self[date].fill()
 
   #---------------------------------------
   def add_item(self, date, conso=np.nan,
-               real_use=np.nan, theo_use=np.nan):
-    """
-    """
-    self[date] = Conso(date, conso, real_use, theo_use)
+               real_use=np.nan, theo_use=np.nan,
+               run_mean=np.nan, pen_mean=np.nan,
+               run_std=np.nan, pen_std=np.nan):
+    """
+    """
+    self[date] = Conso(date, conso, real_use, theo_use,
+                       run_mean, pen_mean, run_std, pen_std)
 
   #---------------------------------------
@@ -136,5 +155,7 @@
   #---------------------------------------
   def __init__(self, date, conso=np.nan,
-               real_use=np.nan, theo_use=np.nan):
+               real_use=np.nan, theo_use=np.nan,
+               run_mean=np.nan, pen_mean=np.nan,
+               run_std=np.nan, pen_std=np.nan):
     self.date     = date
     self.conso    = conso
@@ -142,4 +163,8 @@
     self.theo_use = theo_use
     self.theo_equ = np.nan
+    self.run_mean = run_mean
+    self.pen_mean = pen_mean
+    self.run_std  = run_std
+    self.pen_std  = pen_std
     self.filled   = False
 
@@ -167,19 +192,18 @@
 
 ########################################
-def plot_data(ax_conso, ax_theo, xcoord, xlabels,
-              consos, conso_per_day, theo_uses, real_uses, theo_equs):
+def plot_data(ax_conso, ax_theo, xcoord, dates,
+              consos, theo_uses, real_uses, theo_equs,
+              run_mean, pen_mean, run_std, pen_std):
   """
   """
+  line_style = "-"
   if args.full:
-    line_style = "-"
+    line_width = 0.05
+  else:
+    # line_style = "+-"
     line_width = 0.1
-  else:
-    line_style = "+-"
-    line_width = 0.2
-
-  ax_conso.bar(xcoord, consos, align="center", color="linen",
+
+  ax_conso.bar(xcoord, consos, width=1, align="center", color="linen",
                linewidth=line_width, label="conso (heures)")
-  ax_conso.axhline(y=conso_per_day, color="blue", alpha=0.5,
-                   label="conso journaliÃšre idÃ©ale (heures)")
 
   ax_theo.plot(xcoord, theo_equs, "--",
@@ -188,14 +212,14 @@
   ax_theo.plot(xcoord, theo_uses, line_style, color="firebrick",
                linewidth=1, markersize=8,
-               # solid_capstyle="round", solid_joinstyle="round",
+               solid_capstyle="round", solid_joinstyle="round",
                label="conso thÃ©orique (%)")
   ax_theo.plot(xcoord, real_uses, line_style, color="forestgreen",
                linewidth=1, markersize=8,
-               # solid_capstyle="round", solid_joinstyle="round",
+               solid_capstyle="round", solid_joinstyle="round",
                label="conso rÃ©elle (%)")
 
 
 ########################################
-def plot_config(ax_conso, ax_theo, xcoord, xlabels, ymax, title, conso_per_day):
+def plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day):
   """
   """
@@ -203,4 +227,9 @@
   # -------------------
   # 1) Range
+  if args.max:
+    ymax = gencmip6.alloc
+  else:
+    ymax = np.nanmax(consos) + np.nanmax(consos)*.1
+
   xmin, xmax = xcoord[0]-1, xcoord[-1]+1
   ax_conso.set_xlim(xmin, xmax)
@@ -209,11 +238,21 @@
 
   # 2) Ticks labels
-  inc_label = 7 if nb_items > 37 else 1
+  (date_beg, date_end) = (dates[0], dates[-1])
+  date_fmt = "{:%d-%m}"
+
+  if date_end - date_beg > dt.timedelta(weeks=9):
+    maj_xticks = [x for x, d in zip(xcoord, dates)
+                     if d.weekday() == 0]
+    maj_xlabs  = [date_fmt.format(d) for d in dates
+                     if d.weekday() == 0]
+  else:
+    maj_xticks = [x for x, d in zip(xcoord, dates)]
+    maj_xlabs  = [date_fmt.format(d) for d in dates]
+
   ax_conso.ticklabel_format(axis="y", style="sci", scilimits=(0, 0))
+
   ax_conso.set_xticks(xcoord, minor=True)
-  ax_conso.set_xticks(xcoord[::inc_label], minor=False)
-  ax_conso.set_xticklabels(
-    xlabels[::inc_label], rotation="45", size="x-small"
-  )
+  ax_conso.set_xticks(maj_xticks, minor=False)
+  ax_conso.set_xticklabels(maj_xlabs, rotation="vertical", size="x-small")
 
   yticks = list(ax_conso.get_yticks())
@@ -221,40 +260,36 @@
   ax_conso.set_yticks(yticks)
 
+  ax_conso.axhline(y=conso_per_day, color="blue", alpha=0.5,
+                   label="conso journaliÃšre idÃ©ale (heures)")
+
+  for x, d in zip(xcoord, dates):
+    if d.weekday() == 0 and d.hour == 0:
+      ax_conso.axvline(x=x, color="black", alpha=0.5,
+                       linewidth=0.5, linestyle=":")
+
   # 3) Define axes title
-  ax_conso.set_ylabel("heures", fontweight="bold")
-  ax_theo.set_ylabel("%", fontweight="bold")
+  for ax, label in (
+    (ax_conso, "heures"),
+    (ax_theo, "%"),
+  ):
+    ax.set_ylabel(label, fontweight="bold")
+    ax.tick_params(axis="y", labelsize="small")
+
+  # 4) Define plot size
+  fig.subplots_adjust(
+    left=0.08,
+    bottom=0.09,
+    right=0.93,
+    top=0.93,
+  )
 
   # ... Main title and legend ...
   # -----------------------------
-  ax_conso.set_title(title, fontweight="bold", size="large")
-  ax_theo.legend(loc="upper right", fontsize="x-small", frameon=False)
-  ax_conso.legend(loc="upper left", fontsize="x-small", frameon=False)
-
-
-# ########################################
-# 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)
+  fig.suptitle(title, fontweight="bold", size="large")
+  for ax, loc in (
+    (ax_conso, "upper left"),
+    (ax_theo, "upper right"),
+  ):
+    ax.legend(loc=loc, fontsize="x-small", frameon=False)
 
 
@@ -327,9 +362,9 @@
   gencmip6.get_date_init(file_utheo)
 
-  # .. Fill in conso data ..
-  # ========================
+  # .. Fill in data ..
+  # ==================
   # ... Initialization ...
   # ----------------------
-  bilan = BilanDict()
+  bilan = DataDict()
   bilan.init_range(gencmip6.date_init, gencmip6.deadline)
   # ... Extract data from file ...
@@ -356,6 +391,6 @@
 
   xcoord    = np.linspace(1, nb_items, num=nb_items)
-  xlabels   = ["{:%d-%m}".format(item.date)
-               for item in selected_items]
+  dates   = [item.date for item in selected_items]
+
   cumul     = np.array([item.conso for item in selected_items],
                         dtype=float)
@@ -374,4 +409,13 @@
                        dtype=float)
 
+  run_mean = np.array([item.run_mean for item in selected_items],
+                       dtype=float)
+  pen_mean = np.array([item.pen_mean for item in selected_items],
+                       dtype=float)
+  run_std  = np.array([item.run_std for item in selected_items],
+                       dtype=float)
+  pen_std  = np.array([item.pen_std for item in selected_items],
+                       dtype=float)
+
   # .. Plot stuff ..
   # ================
@@ -382,14 +426,10 @@
   # ... Plot data ...
   # -----------------
-  plot_data(ax_conso, ax_theo, xcoord, xlabels,
-            consos, conso_per_day, theo_uses, real_uses, theo_equs)
+  plot_data(ax_conso, ax_theo, xcoord, dates,
+            consos, theo_uses, real_uses, theo_equs,
+            run_mean, pen_mean, run_std, pen_std)
 
   # ... Tweak figure ...
   # --------------------
-  if args.max:
-    ymax = gencmip6.alloc
-  else:
-    ymax = np.nanmax(consos) + np.nanmax(consos)*.1
-
   title = "Consommation {}\n({:%d/%m/%Y} - {:%d/%m/%Y})".format(
     gencmip6.project.upper(),
@@ -398,5 +438,5 @@
   )
 
-  plot_config(ax_conso, ax_theo, xcoord, xlabels, ymax, title, conso_per_day)
+  plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day)
 
   # ... Save figure ...
Index: /TOOLS/ConsoGENCMIP6/bin/plot_bilan_jobs.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/plot_bilan_jobs.py	(revision 2437)
+++ /TOOLS/ConsoGENCMIP6/bin/plot_bilan_jobs.py	(revision 2437)
@@ -0,0 +1,485 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# this must come first
+from __future__ import print_function, unicode_literals, division
+
+# standard library imports
+from argparse import ArgumentParser
+import os
+import os.path
+import datetime as dt
+import numpy as np
+
+# Application library imports
+from gencmip6 import *
+from gencmip6_path import *
+
+
+########################################
+class DataDict(dict):
+  #---------------------------------------
+  def __init__(self):
+    self = {}
+
+  #---------------------------------------
+  def init_range(self, date_beg, date_end, inc=1):
+    """
+    """
+    delta = date_end - date_beg
+
+    (deb, fin) = (0, delta.days+1)
+
+    dates = (date_beg + dt.timedelta(days=i)
+             for i in xrange(deb, fin, inc))
+
+    for date in dates:
+      self.add_item(date)
+
+  #---------------------------------------
+  def fill_data(self, filein):
+    """
+    """
+    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,
+          4: string_to_float,
+          5: string_to_float,
+          6: string_to_float,
+          7: string_to_float,
+        },
+        missing_values="nan",
+      )
+    except Exception as rc:
+      print("Empty file {}:\n{}".format(filein, rc))
+      exit(1)
+
+    for date, conso, real_use, theo_use, \
+        run_mean, pen_mean, run_std, pen_std in data:
+      if date in self:
+        self.add_item(
+          date,
+          conso,
+          real_use,
+          theo_use,
+          run_mean,
+          pen_mean,
+          run_std,
+          pen_std,
+        )
+        self[date].fill()
+
+  #---------------------------------------
+  def add_item(self, date, conso=np.nan,
+               real_use=np.nan, theo_use=np.nan,
+               run_mean=np.nan, pen_mean=np.nan,
+               run_std=np.nan, pen_std=np.nan):
+    """
+    """
+    self[date] = Conso(date, conso, real_use, theo_use,
+                       run_mean, pen_mean, run_std, pen_std)
+
+  #---------------------------------------
+  def theo_equation(self):
+    """
+    """
+    (dates, theo_uses) = \
+      zip(*((item.date, item.theo_use)
+            for item in self.get_items_in_full_range()))
+
+    (idx_min, idx_max) = \
+        (np.nanargmin(theo_uses), np.nanargmax(theo_uses))
+
+    x1 = dates[idx_min].timetuple().tm_yday
+    x2 = dates[idx_max].timetuple().tm_yday
+
+    y1 = theo_uses[idx_min]
+    y2 = theo_uses[idx_max]
+
+    m = np.array([
+      [x1, 1.],
+      [x2, 1.]
+    ], dtype="float")
+    n = np.array([
+      y1,
+      y2
+    ], dtype="float")
+
+    try:
+      (a, b) = np.linalg.solve(m, n)
+    except np.linalg.linalg.LinAlgError:
+      (a, b) = (None, None)
+
+    if a and b:
+      for date in dates:
+        self[date].theo_equ = date.timetuple().tm_yday*a + b
+
+  #---------------------------------------
+  def get_items_in_range(self, date_beg, date_end, inc=1):
+    """
+    """
+    items = (item for item in self.itervalues()
+                   if item.date >= date_beg and
+                      item.date <= date_end)
+    items = sorted(items, key=lambda item: item.date)
+
+    return items[::inc]
+
+  #---------------------------------------
+  def get_items_in_full_range(self, inc=1):
+    """
+    """
+    items = (item for item in self.itervalues())
+    items = sorted(items, key=lambda item: item.date)
+
+    return items[::inc]
+
+  #---------------------------------------
+  def get_items(self, inc=1):
+    """
+    """
+    items = (item for item in self.itervalues()
+                   if item.isfilled())
+    items = sorted(items, key=lambda item: item.date)
+
+    return items[::inc]
+
+
+class Conso(object):
+  #---------------------------------------
+  def __init__(self, date, conso=np.nan,
+               real_use=np.nan, theo_use=np.nan,
+               run_mean=np.nan, pen_mean=np.nan,
+               run_std=np.nan, pen_std=np.nan):
+    self.date     = date
+    self.conso    = conso
+    self.real_use = real_use
+    self.theo_use = theo_use
+    self.theo_equ = np.nan
+    self.run_mean = run_mean
+    self.pen_mean = pen_mean
+    self.run_std  = run_std
+    self.pen_std  = pen_std
+    self.filled   = False
+
+  #---------------------------------------
+  def __repr__(self):
+    return "{:.2f} ({:.2%})".format(self.conso, self.real_use)
+
+  #---------------------------------------
+  def isfilled(self):
+    return self.filled
+
+  #---------------------------------------
+  def fill(self):
+    self.filled = True
+
+
+########################################
+def plot_init():
+  paper_size  = np.array([29.7, 21.0])
+  fig, (ax_conso, ax_jobs) = plt.subplots(
+    nrows=2,
+    ncols=1,
+    sharex=True,
+    squeeze=True,
+    figsize=(paper_size/2.54)
+  )
+  ax_theo = ax_conso.twinx()
+
+  return fig, ax_conso, ax_theo, ax_jobs
+
+
+########################################
+def plot_data(ax_conso, ax_theo, ax_jobs, xcoord, dates,
+              consos, theo_uses, real_uses, theo_equs,
+              run_mean, pen_mean, run_std, pen_std):
+  """
+  """
+  line_style = "-"
+  if args.full:
+    line_width = 0.05
+  else:
+    # line_style = "+-"
+    line_width = 0.1
+
+  ax_conso.bar(xcoord, consos, width=1, align="center", color="linen",
+               linewidth=line_width, label="conso (heures)")
+
+  ax_theo.plot(xcoord, theo_equs, "--",
+               color="firebrick", linewidth=0.5,
+               solid_capstyle="round", solid_joinstyle="round")
+  ax_theo.plot(xcoord, theo_uses, line_style, color="firebrick",
+               linewidth=1, markersize=8,
+               solid_capstyle="round", solid_joinstyle="round",
+               label="conso thÃ©orique (%)")
+  ax_theo.plot(xcoord, real_uses, line_style, color="forestgreen",
+               linewidth=1, markersize=8,
+               solid_capstyle="round", solid_joinstyle="round",
+               label="conso rÃ©elle (%)")
+
+  line_width = 0.
+  width = 1.05
+
+  ax_jobs.bar(xcoord, run_mean, width=width, align="center",
+              # yerr=run_std/2, ecolor="green",
+              color="lightgreen", linewidth=line_width, antialiased=True,
+              label="jobs running")
+  ax_jobs.bar(xcoord, pen_mean, bottom=run_mean, width=width, align="center",
+              # yerr=pen_std/2, ecolor="darkred",
+              color="indianred", linewidth=line_width, antialiased=True,
+              label="jobs pending")
+
+
+########################################
+def plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day):
+  """
+  """
+  # ... Config axes ...
+  # -------------------
+  # 1) Range
+  # if args.max:
+  #   ymax = gencmip6.alloc
+  # else:
+  #   ymax = np.nanmax(consos) + np.nanmax(consos)*.1
+
+  xmin, xmax = xcoord[0]-1, xcoord[-1]+1
+  ax_conso.set_xlim(xmin, xmax)
+  # ax_conso.set_ylim(0., ymax)
+  ax_theo.set_ylim(0., 100)
+
+  # 2) Ticks labels
+  (date_beg, date_end) = (dates[0], dates[-1])
+  date_fmt = "{:%d-%m}"
+
+  if date_end - date_beg > dt.timedelta(weeks=9):
+    maj_xticks = [x for x, d in zip(xcoord, dates)
+                     if d.weekday() == 0]
+    maj_xlabs  = [date_fmt.format(d) for d in dates
+                     if d.weekday() == 0]
+  else:
+    maj_xticks = [x for x, d in zip(xcoord, dates)]
+    maj_xlabs  = [date_fmt.format(d) for d in dates]
+
+  ax_conso.ticklabel_format(axis="y", style="sci", scilimits=(0, 0))
+
+  ax_jobs.set_xticks(xcoord, minor=True)
+  ax_jobs.set_xticks(maj_xticks, minor=False)
+  ax_jobs.set_xticklabels(maj_xlabs, rotation="vertical", size="x-small")
+
+  for ax, y, label in (
+    (ax_conso, conso_per_day, "heures"),
+    (ax_jobs, conso_per_day / 24, "cÅurs"),
+  ):
+    yticks = list(ax.get_yticks())
+    yticks.append(y)
+    ax.set_yticks(yticks)
+    ax.axhline(y=y, color="blue", alpha=0.5,
+               label="conso journaliÃšre\nidÃ©ale ({})".format(label))
+
+  for x, d in zip(xcoord, dates):
+    if d.weekday() == 0 and d.hour == 0:
+      for ax in (ax_conso, ax_jobs):
+        ax.axvline(x=x, color="black", alpha=0.5,
+                   linewidth=0.5, linestyle=":")
+
+  # 3) Define axes title
+  for ax, label in (
+    (ax_conso, "heures"),
+    (ax_theo, "%"),
+    (ax_jobs, "cÅurs"),
+  ):
+    ax.set_ylabel(label, fontweight="bold")
+    ax.tick_params(axis="y", labelsize="small")
+
+  # 4) Define plot size
+  fig.subplots_adjust(
+    left=0.08,
+    bottom=0.09,
+    right=0.93,
+    top=0.93,
+    hspace=0.1,
+    wspace=0.1,
+  )
+
+  # ... Main title and legend ...
+  # -----------------------------
+  fig.suptitle(title, fontweight="bold", size="large")
+  for ax, loc in (
+    (ax_conso, "upper left"),
+    (ax_theo, "upper right"),
+    (ax_jobs, "upper left"),
+  ):
+    ax.legend(loc=loc, fontsize="x-small", frameon=False)
+
+
+########################################
+def get_arguments():
+  parser = ArgumentParser()
+  parser.add_argument("-v", "--verbose", action="store_true",
+                      help="verbose mode")
+  parser.add_argument("-f", "--full", action="store_true",
+                      help="plot the whole period")
+  parser.add_argument("-i", "--increment", action="store",
+                      type=int, default=1, dest="inc",
+                      help="sampling increment")
+  parser.add_argument("-r", "--range", action="store", nargs=2,
+                      type=string_to_date,
+                      help="date range: ssaa-mm-jj ssaa-mm-jj")
+  parser.add_argument("-m", "--max", action="store_true",
+                      help="plot with y_max = allocation")
+  parser.add_argument("-s", "--show", action="store_true",
+                      help="interactive mode")
+  parser.add_argument("-d", "--dods", action="store_true",
+                      help="copy output on dods")
+
+  return parser.parse_args()
+
+
+########################################
+if __name__ == '__main__':
+
+  # .. Initialization ..
+  # ====================
+  # ... Command line arguments ...
+  # ------------------------------
+  args = get_arguments()
+  if args.verbose:
+    print(args)
+
+  # ... Turn interactive mode off ...
+  # ---------------------------------
+  if not args.show:
+    import matplotlib
+    matplotlib.use('Agg')
+
+  import matplotlib.pyplot as plt
+  # from matplotlib.backends.backend_pdf import PdfPages
+
+  if not args.show:
+    plt.ioff()
+
+  # ... Files and directories ...
+  # -----------------------------
+  (file_param, file_utheo, file_data) = \
+      get_input_files(DIR["SAVEDATA"],
+                      [OUT["PARAM"], OUT["UTHEO"], OUT["BILAN"]])
+
+  img_name = "bilan_jobs"
+  today = os.path.basename(file_param).strip(OUT["PARAM"])
+
+  if args.verbose:
+    print(file_param)
+    print(file_utheo)
+    print(file_data)
+    print(img_name)
+    print(today)
+
+  # .. Get project info ..
+  # ======================
+  gencmip6 = Project()
+  gencmip6.fill_data(file_param)
+  gencmip6.get_date_init(file_utheo)
+
+  # .. Fill in data ..
+  # ==================
+  # ... Initialization ...
+  # ----------------------
+  bilan = DataDict()
+  bilan.init_range(gencmip6.date_init, gencmip6.deadline)
+  # ... Extract data from file ...
+  # ------------------------------
+  bilan.fill_data(file_data)
+  # ... Compute theoratical use from known data  ...
+  # ------------------------------------------------
+  bilan.theo_equation()
+
+  # .. Extract data depending on C.L. arguments ..
+  # ==============================================
+  if args.full:
+    selected_items = bilan.get_items_in_full_range(args.inc)
+  elif args.range:
+    selected_items = bilan.get_items_in_range(
+      args.range[0], args.range[1], args.inc
+    )
+  else:
+    selected_items = bilan.get_items(args.inc)
+
+  # .. Compute data to be plotted ..
+  # ================================
+  nb_items = len(selected_items)
+
+  xcoord    = np.linspace(1, nb_items, num=nb_items)
+  dates   = [item.date for item in selected_items]
+
+  cumul     = np.array([item.conso for item in selected_items],
+                        dtype=float)
+  consos    = []
+  consos.append(cumul[0])
+  consos[1:nb_items] = cumul[1:nb_items] - cumul[0:nb_items-1]
+  consos    = np.array(consos, dtype=float)
+
+  conso_per_day = gencmip6.alloc / gencmip6.days
+
+  theo_uses = np.array([100.*item.theo_use for item in selected_items],
+                       dtype=float)
+  real_uses = np.array([100.*item.real_use for item in selected_items],
+                       dtype=float)
+  theo_equs = np.array([100.*item.theo_equ for item in selected_items],
+                       dtype=float)
+
+  run_mean = np.array([item.run_mean for item in selected_items],
+                       dtype=float)
+  pen_mean = np.array([item.pen_mean for item in selected_items],
+                       dtype=float)
+  run_std  = np.array([item.run_std for item in selected_items],
+                       dtype=float)
+  pen_std  = np.array([item.pen_std for item in selected_items],
+                       dtype=float)
+
+  # .. Plot stuff ..
+  # ================
+  # ... Initialize figure ...
+  # -------------------------
+  (fig, ax_conso, ax_theo, ax_jobs) = plot_init()
+
+  # ... Plot data ...
+  # -----------------
+  plot_data(ax_conso, ax_theo, ax_jobs, xcoord, dates,
+            consos, theo_uses, real_uses, theo_equs,
+            run_mean, pen_mean, run_std, pen_std)
+
+  # ... Tweak figure ...
+  # --------------------
+  title = "Consommation {}\n({:%d/%m/%Y} - {:%d/%m/%Y})".format(
+    gencmip6.project.upper(),
+    gencmip6.date_init,
+    gencmip6.deadline
+  )
+
+  plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day)
+
+  # ... Save figure ...
+  # -------------------
+  img_in  = os.path.join(DIR["PLOT"], "{}.pdf".format(img_name))
+  img_out = os.path.join(DIR["SAVEPLOT"],
+                         "{}_{}.pdf".format(img_name, today))
+
+  plot_save(img_in, img_out, title)
+
+  # ... Publish figure on dods ...
+  # ------------------------------
+  if args.dods:
+    dods_cp(img_in)
+
+  if args.show:
+    plt.show()
+
+  exit(0)
+
Index: /TOOLS/ConsoGENCMIP6/bin/plot_jobs.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/plot_jobs.py	(revision 2436)
+++ /TOOLS/ConsoGENCMIP6/bin/plot_jobs.py	(revision 2437)
@@ -18,5 +18,5 @@
 
 ########################################
-class BilanDict(dict):
+class DataDict(dict):
   #---------------------------------------
   def __init__(self):
@@ -27,9 +27,11 @@
     """
     """
-    delta = date_end - date_beg
-
-    (deb, fin) = (0, delta.days+1)
-
-    dates = (date_beg + dt.timedelta(days=i)
+    # delta = date_end - date_beg
+    # delta = delta + dt.timedelta(days=1)
+    delta = date_end - date_beg + dt.timedelta(days=1)
+
+    (deb, fin) = (0, int(delta.total_seconds() / 3600))
+
+    dates = (date_beg + dt.timedelta(hours=i)
              for i in xrange(deb, fin, inc))
 
@@ -38,67 +40,72 @@
 
   #---------------------------------------
-  def fill_data(self, filein):
-    """
-    """
-    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:
-      if date in self:
-        self.add_item(date, conso, real_use, theo_use)
+  def fill_data(self, file_list):
+    """
+    """
+    for filein in sorted(file_list):
+      try:
+        data = np.genfromtxt(
+          filein,
+          skip_header=1,
+          converters={
+            0: string_to_datetime,
+            1: int,
+            2: int,
+          },
+          missing_values="nan",
+        )
+      except Exception as rc:
+        print("Problem with file {} :\n{}".format(filein, rc))
+        exit(1)
+
+      if len(data) == 24:
+        run_mean = np.nanmean(
+            np.array([run for _, run, _ in data])
+        )
+        pen_mean = np.nanmean(
+            np.array([pen for _, _, pen in data])
+        )
+        run_std = np.nanstd(
+            np.array([run for _, run, _ in data])
+        )
+        pen_std = np.nanstd(
+            np.array([pen for _, _, pen in data])
+        )
+      else:
+        run_mean = np.nan
+        pen_mean = np.nan
+        run_std  = np.nan
+        pen_std  = np.nan
+
+      for date, run, pen in data:
+        if date.hour == 0:
+          self.add_item(
+            date,
+            run,
+            pen,
+            run_mean,
+            pen_mean,
+            run_std,
+            pen_std
+          )
+        else:
+          self.add_item(date, run, pen)
         self[date].fill()
 
   #---------------------------------------
-  def add_item(self, date, conso=np.nan,
-               real_use=np.nan, theo_use=np.nan):
-    """
-    """
-    self[date] = Conso(date, conso, real_use, theo_use)
-
-  #---------------------------------------
-  def theo_equation(self):
-    """
-    """
-    (dates, theo_uses) = \
-      zip(*((item.date, item.theo_use)
-            for item in self.get_items_in_full_range()))
-
-    (idx_min, idx_max) = \
-        (np.nanargmin(theo_uses), np.nanargmax(theo_uses))
-
-    x1 = dates[idx_min].timetuple().tm_yday
-    x2 = dates[idx_max].timetuple().tm_yday
-
-    y1 = theo_uses[idx_min]
-    y2 = theo_uses[idx_max]
-
-    m = np.array([
-      [x1, 1.],
-      [x2, 1.]
-    ], dtype="float")
-    n = np.array([
-      y1,
-      y2
-    ], dtype="float")
-
-    try:
-      (a, b) = np.linalg.solve(m, n)
-    except np.linalg.linalg.LinAlgError:
-      (a, b) = (None, None)
-
-    if a and b:
-      for date in dates:
-        self[date].theo_equ = date.timetuple().tm_yday*a + b
+  def add_item(self, date, run=np.nan, pen=np.nan,
+               run_mean=np.nan, pen_mean=np.nan,
+               run_std=np.nan, pen_std=np.nan):
+    """
+    """
+    self[date] = Conso(
+      date,
+      run,
+      pen,
+      run_mean,
+      pen_mean,
+      run_std,
+      pen_std
+    )
 
   #---------------------------------------
@@ -117,5 +124,6 @@
     """
     """
-    items = (item for item in self.itervalues())
+    items = (item for item in self.itervalues()
+                   if item.date.hour == 0)
     items = sorted(items, key=lambda item: item.date)
 
@@ -135,16 +143,27 @@
 class Conso(object):
   #---------------------------------------
-  def __init__(self, date, conso=np.nan,
-               real_use=np.nan, theo_use=np.nan):
+  def __init__(self, date, run=np.nan, pen=np.nan,
+               run_mean=np.nan, pen_mean=np.nan,
+               run_std=np.nan, pen_std=np.nan):
+
     self.date     = date
-    self.conso    = conso
-    self.real_use = real_use
-    self.theo_use = theo_use
-    self.theo_equ = np.nan
+    self.run      = run
+    self.pen      = pen
+    self.run_mean = run_mean
+    self.pen_mean = pen_mean
+    self.run_std  = run_std
+    self.pen_std  = pen_std
     self.filled   = False
 
   #---------------------------------------
   def __repr__(self):
-    return "{:.2f} ({:.2%})".format(self.conso, self.real_use)
+    return "R{:.0f} ({:.0f}/{:.0f}) P{:.0f} ({:.0f}/{:.0f})".format(
+      self.run,
+      self.run_mean,
+      self.run_std,
+      self.pen,
+      self.pen_mean,
+      self.pen_std,
+    )
 
   #---------------------------------------
@@ -166,20 +185,22 @@
 
 ########################################
-def plot_data(ax, xcoord, xlabels, run_jobs, pen_jobs, conso_per_day):
+def plot_data(ax, xcoord, dates, run_jobs, pen_jobs, run_std, pen_std):
   """
   """
   line_width = 0.
-
-  ax.bar(xcoord, run_jobs, align="center", color="lightgreen",
-         linewidth=line_width, label="jobs running")
-  ax.bar(xcoord, pen_jobs, bottom=run_jobs, align="center",
-         color="indianred", linewidth=line_width, label="jobs pending")
-
-  ax.axhline(y=conso_per_day, color="blue", alpha=0.5,
-             label="conso journaliÃšre idÃ©ale")
-
-
-########################################
-def plot_config(ax, xcoord, xlabels, title, conso_per_day):
+  width = 1.05
+
+  ax.bar(xcoord, run_jobs, width=width, yerr=run_std/2.,
+         linewidth=line_width, align="center",
+         color="lightgreen", ecolor="green", antialiased=True,
+         label="jobs running")
+  ax.bar(xcoord, pen_jobs, bottom=run_jobs, width=width,
+         linewidth=line_width, align="center",
+         color="indianred", antialiased=True,
+         label="jobs pending")
+
+
+########################################
+def plot_config(fig, ax, xcoord, dates, title, conso_per_day):
   """
   """
@@ -189,16 +210,24 @@
   xmin, xmax = xcoord[0]-1, xcoord[-1]+1
   ax.set_xlim(xmin, xmax)
-  # ax.set_ylim(0., ymax)
 
   # 2) Ticks labels
-  # inc_label = 12
-  # ax.ticklabel_format(axis="y", style="sci", scilimits=(0, 0))
-  xcoord_maj = [x for x, l in zip(xcoord, xlabels)
-                   if l.hour == 0 or l.hour == 12]
-  xlabels_maj = ["{:%d-%m %Hh}".format(l) for l in xlabels
-                 if l.hour == 0 or l.hour == 12]
+  (date_beg, date_end) = (dates[0], dates[-1])
+
+  if date_end - date_beg > dt.timedelta(weeks=9):
+    date_fmt = "{:%d-%m}"
+    maj_xticks = [x for x, d in zip(xcoord, dates)
+                     if d.weekday() == 0 and d.hour == 0]
+    maj_xlabs  = [date_fmt.format(d) for d in dates
+                     if d.weekday() == 0 and d.hour == 0]
+  else:
+    date_fmt = "{:%d-%m %Hh}"
+    maj_xticks = [x for x, d in zip(xcoord, dates)
+                     if d.hour == 0 or d.hour == 12]
+    maj_xlabs  = [date_fmt.format(d) for d in dates
+                     if d.hour == 0 or d.hour == 12]
+
   ax.set_xticks(xcoord, minor=True)
-  ax.set_xticks(xcoord_maj, minor=False)
-  ax.set_xticklabels(xlabels_maj, rotation="vertical", size="x-small")
+  ax.set_xticks(maj_xticks, minor=False)
+  ax.set_xticklabels(maj_xlabs, rotation="vertical", size="x-small")
 
   yticks = list(ax.get_yticks())
@@ -206,11 +235,27 @@
   ax.set_yticks(yticks)
 
+  ax.axhline(y=conso_per_day, color="blue", alpha=0.5,
+             label="conso journaliÃšre idÃ©ale")
+
+  for x, d in zip(xcoord, dates):
+    if d.weekday() == 0 and d.hour == 0:
+      ax.axvline(x=x, color="black", linewidth=1., linestyle=":")
+
   # 3) Define axes title
   ax.set_ylabel("cÅurs", fontweight="bold")
+  ax.tick_params(axis="y", labelsize="small")
+
+  # 4) Define plot size
+  fig.subplots_adjust(
+    left=0.08,
+    bottom=0.09,
+    right=0.93,
+    top=0.93,
+  )
 
   # ... Main title and legend ...
   # -----------------------------
-  ax.set_title(title, fontweight="bold", size="large")
-  ax.legend(loc="best", fontsize="x-small", frameon=False)
+  fig.suptitle(title, fontweight="bold", size="large")
+  ax.legend(loc="upper right", fontsize="x-small", frameon=False)
 
 
@@ -220,4 +265,12 @@
   parser.add_argument("-v", "--verbose", action="store_true",
                       help="verbose mode")
+  parser.add_argument("-f", "--full", action="store_true",
+                      help="plot the whole period")
+  parser.add_argument("-i", "--increment", action="store",
+                      type=int, default=1, dest="inc",
+                      help="sampling increment")
+  parser.add_argument("-r", "--range", action="store", nargs=2,
+                      type=string_to_date,
+                      help="date range: ssaa-mm-jj ssaa-mm-jj")
   parser.add_argument("-s", "--show", action="store_true",
                       help="interactive mode")
@@ -256,4 +309,7 @@
       get_input_files(DIR["SAVEDATA"], [OUT["PARAM"], OUT["UTHEO"]])
 
+  file_list = glob.glob(os.path.join(DIR["SAVEDATA"],
+                                     "OUT_JOBS_PENDING_*"))
+
   img_name = "jobs"
   today = os.path.basename(file_param).strip(OUT["PARAM"])
@@ -262,34 +318,7 @@
     print(file_param)
     print(file_utheo)
-    # print(file_data)
+    print(file_list)
+    print(img_name)
     print(today)
-    print(img_name)
-
-  file_list = glob.glob(os.path.join(DIR["SAVEDATA"],
-                                     "OUT_JOBS_PENDING_*"))
-
-  fg_first = True
-
-  for filein in sorted(file_list):
-    try:
-      data = np.genfromtxt(
-        filein,
-        skip_header=1,
-        converters={
-          0: string_to_datetime,
-          1: int,
-          2: int,
-        },
-        missing_values="nan",
-      )
-    except Exception as rc:
-      print("Problem with file {} :\n{}".format(filein, rc))
-      exit(1)
-
-    if fg_first:
-      fg_first = False
-      full_data = data
-    else:
-      full_data = np.append(full_data, values=data)
 
   # .. Get project info ..
@@ -299,61 +328,66 @@
   gencmip6.get_date_init(file_utheo)
 
-  # .. Fill in conso data ..
-  # ========================
-  # # ... Initialization ...
-  # # ----------------------
-  # bilan = BilanDict()
-  # bilan.init_range(gencmip6.date_init, gencmip6.deadline)
-  # # ... Extract data from file ...
-  # # ------------------------------
-  # bilan.fill_data(file_data)
+  # .. Fill in data ..
+  # ==================
+  # ... Initialization ...
+  # ----------------------
+  bilan = DataDict()
+  bilan.init_range(gencmip6.date_init, gencmip6.deadline)
+
+  # ... Extract data from file ...
+  # ------------------------------
+  bilan.fill_data(file_list)
+
   # # ... Compute theoratical use from known data  ...
   # # ------------------------------------------------
   # bilan.theo_equation()
 
-  # # .. Extract data depending on C.L. arguments ..
-  # # ==============================================
-  # if args.full:
-  #   selected_items = bilan.get_items_in_full_range(args.inc)
-  # elif args.range:
-  #   selected_items = bilan.get_items_in_range(
-  #     args.range[0], args.range[1], args.inc
-  #   )
-  # else:
-  #   selected_items = bilan.get_items(args.inc)
+  # .. Extract data depending on C.L. arguments ..
+  # ==============================================
+  if args.full:
+    selected_items = bilan.get_items_in_full_range(args.inc)
+  elif args.range:
+    selected_items = bilan.get_items_in_range(
+      args.range[0], args.range[1], args.inc
+    )
+  else:
+    selected_items = bilan.get_items(args.inc)
 
   # .. Compute data to be plotted ..
   # ================================
-  # nb_items = len(selected_items)
-  nb_items = full_data.size
+  nb_items = len(selected_items)
 
   xcoord   = np.linspace(1, nb_items, num=nb_items)
-  if full_data.size > 1:
-    xlabels  = np.array([date for date, run, pen in full_data])
-    run_jobs = np.array([run for date, run, pen in full_data],
-                          dtype=int)
-    pen_jobs = np.array([pen for date, run, pen in full_data],
-                          dtype=int)
+  dates  = [item.date for item in selected_items]
+
+  if args.full:
+    run_jobs = np.array([item.run_mean for item in selected_items],
+                         dtype=float)
+    pen_jobs = np.array([item.pen_mean for item in selected_items],
+                         dtype=float)
+    run_std  = np.array([item.run_std for item in selected_items],
+                         dtype=float)
+    pen_std  = np.array([item.pen_std for item in selected_items],
+                         dtype=float)
   else:
-    xlabels , run_jobs, pen_jobs = full_data.tolist()
-    xlabels = list(xlabels)
-    run_jobs = list(run_jobs )
-    pen_jobs = list(pen_jobs )
-
-  # cumul     = np.array([item.conso for item in selected_items],
-  #                       dtype=float)
-  # consos    = []
-  # consos.append(cumul[0])
-  # consos[1:nb_items] = cumul[1:nb_items] - cumul[0:nb_items-1]
-  # consos    = np.array(consos, dtype=float)
+    run_jobs = np.array([item.run for item in selected_items],
+                         dtype=float)
+    pen_jobs = np.array([item.pen for item in selected_items],
+                         dtype=float)
+    run_std  = np.nan
+    pen_std  = np.nan
+
+  if args.verbose:
+    for i in selected_items:
+      if not np.isnan(i.run_mean):
+        print(
+          "{} {:13.2f} {:13.2f} {:13.2f} {:13.2f}".format(
+           i.date,
+           i.run_mean, i.pen_mean,
+           i.run_std, i.pen_std
+          )
+        )
 
   conso_per_day = gencmip6.alloc / (gencmip6.days * 24.)
-
-  # theo_uses = np.array([100.*item.theo_use for item in selected_items],
-  #                      dtype=float)
-  # real_uses = np.array([100.*item.real_use for item in selected_items],
-  #                      dtype=float)
-  # theo_equs = np.array([100.*item.theo_equ for item in selected_items],
-  #                      dtype=float)
 
   # .. Plot stuff ..
@@ -365,5 +399,5 @@
   # ... Plot data ...
   # -----------------
-  plot_data(ax, xcoord, xlabels, run_jobs, pen_jobs, conso_per_day)
+  plot_data(ax, xcoord, dates, run_jobs, pen_jobs, run_std, pen_std)
 
   # # ... Tweak figure ...
@@ -380,5 +414,5 @@
   )
 
-  plot_config(ax, xcoord, xlabels, title, conso_per_day)
+  plot_config(fig, ax, xcoord, dates, title, conso_per_day)
 
   # ... Save figure ...
Index: /TOOLS/ConsoGENCMIP6/bin/plot_store.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/plot_store.py	(revision 2436)
+++ /TOOLS/ConsoGENCMIP6/bin/plot_store.py	(revision 2437)
@@ -53,5 +53,5 @@
       )
     except:
-      print("Empty file {}".format(filein))
+      print("Empty file {}, nothing to plot".format(filein))
       exit(1)
 
Index: /TOOLS/ConsoGENCMIP6/bin/run_pen_v2.sh
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/run_pen_v2.sh	(revision 2436)
+++ /TOOLS/ConsoGENCMIP6/bin/run_pen_v2.sh	(revision 2437)
@@ -61,6 +61,6 @@
 # Files and directories
 # =====================
-LOCAL_DIR="/ccc/cont003/home/dsm/p86ipsl/ConsoGENCMIP6/output"
-SAVE_DIR="/ccc/work/cont003/dsm/p86ipsl/ConsoGENCMIP6/data"
+LOCAL_DIR="${HOME}/ConsoGENCMIP6/output"
+SAVE_DIR="${CCCWORKDIR}/ConsoGENCMIP6/data"
 
 if ( ${fg_dry} ) ; then
@@ -106,5 +106,5 @@
 if ( ! ${fg_dry} ) ; then
   Suffix=$( echo ${Today} | sed 's/-//g' )
-  [ -f ${SAVE_DIR}/${OUT_PENDING}_${Suffix} ] || echo "AAAA-MM-DD HH:MM RUN   PENDING" > ${SAVE_DIR}/${OUT_PENDING}_${Suffix}
+  [ -f ${SAVE_DIR}/${OUT_PENDING}_${Suffix} ] || echo "AAAA-MM-DD-HH:MM RUN   PENDING" > ${SAVE_DIR}/${OUT_PENDING}_${Suffix}
   cat ${OUT_PENDING} >>${SAVE_DIR}/${OUT_PENDING}_${Suffix}
   cp ${OUT_TOUSJOBS} ${SAVE_DIR}/${OUT_TOUSJOBS}_${Suffix}
Index: /TOOLS/ConsoGENCMIP6/launch_conso.sh
===================================================================
--- /TOOLS/ConsoGENCMIP6/launch_conso.sh	(revision 2436)
+++ /TOOLS/ConsoGENCMIP6/launch_conso.sh	(revision 2437)
@@ -19,5 +19,5 @@
 # Go to root directory
 # ====================
-cd /ccc/cont003/home/dsm/p86ipsl/ConsoGENCMIP6/
+cd ${HOME}/ConsoGENCMIP6/
 
 # Main script to get data
@@ -26,5 +26,5 @@
 printf "${script}\n"
 echo "--------------------"
-bin/${script}.py
+bin/${script}.py -v
 rc=$?
 if [ ${rc} -ne 0 ] ; then
@@ -42,4 +42,15 @@
 printf "\n${script}\n"
 echo "--------------------"
+bin/${script}.py -fv
+rc=$?
+if [ ${rc} -ne 0 ] ; then
+  echo "${script} terminated abnormally"
+else
+  echo "${script} OK"
+fi
+
+script="plot_bilan_jobs"
+printf "\n${script}\n"
+echo "--------------------"
 bin/${script}.py -fd
 rc=$?
@@ -53,5 +64,5 @@
 printf "\n${script}\n"
 echo "--------------------"
-bin/${script}.py -d
+bin/${script}.py -v
 rc=$?
 if [ ${rc} -ne 0 ] ; then
@@ -64,5 +75,5 @@
 printf "\n${script}\n"
 echo "--------------------"
-bin/${script}.py -d
+bin/${script}.py -v
 rc=$?
 if [ ${rc} -ne 0 ] ; then
Index: /TOOLS/ConsoGENCMIP6/launch_jobs.sh
===================================================================
--- /TOOLS/ConsoGENCMIP6/launch_jobs.sh	(revision 2436)
+++ /TOOLS/ConsoGENCMIP6/launch_jobs.sh	(revision 2437)
@@ -18,5 +18,5 @@
 # Go to root directory
 # ====================
-cd /ccc/cont003/home/dsm/p86ipsl/ConsoGENCMIP6/
+cd ${HOME}/ConsoGENCMIP6/
 
 # Main script to get data
