Index: trunk/tools/model_graphics.bash
===================================================================
--- trunk/tools/model_graphics.bash	(revision 936)
+++ trunk/tools/model_graphics.bash	(revision 937)
@@ -218,4 +218,27 @@
 }
 
+function join_lists() {
+# Function to join lists without repeating values
+#   list1: first list to join
+#   list2: second list to join
+#  $ join_lists 1:2:3:4:5:6:7:8 a:b:3:c:5:6:7:9
+#  1:2:3:4:5:6:7:8:a:b:c:9
+
+  fname='join_lists'
+  list1=$1
+  list2=$2
+
+  ls1s=`echo ${list1} | tr ':' ' '`
+  ls2s=`echo ${list2} | tr ':' ' '`
+
+  newlist=${list1}
+  for ls2 in ${ls2s}; do
+    if ! $(isInlist ${list1} ${ls2}); then
+      newlist=${newlist}':'${ls2}
+    fi
+  done
+
+  echo ${newlist}
+}
 
 # Specific
@@ -772,8 +795,8 @@
 #     diffmap2Dsfc: 2D map of surface differences values of 1 variable
 #     diffmap2Dz: 2D map of 3D differences values of 1 variable
-#     hovmsfc: Hovmoeller diagrams of 1 variable at the surface
+#     shadconthovmsfc: Hovmoeller diagrams of 2 variable at the surface in shadow and the other in contourn
 #     map2Dsfc: 2D map of surface values of 1 variable
 #     map3D: 2D map of 3D values of 1 variable
-#     shadcount2D: 2D map of shadow (1st variable) and countour (2nd variable) [stvar1]#[stvar2]
+#     shadcont2Dsfc: 2D map of shadow (1st variable) and countour (2nd variable) [stvar1]#[stvar2]
 #
 #     ':' separated list of statitsics variable values are given as: [var]|[kind(including combo values)]
@@ -783,4 +806,6 @@
   fname='draw_plot'
 
+  set -x
+
   plot=$1
   odir=$2
@@ -795,4 +820,8 @@
   # Assuming that multiple variables will be separated by '#'
   nvars=`echo ${plotvals} | tr '#' ' ' | wc -w | awk '{print $1}'`
+
+  # Model and experiment
+  mod=`echo ${odir} | tr '/' '\n' | tail -n 2 | head -n 1`
+  exp=`echo ${odir} | tr '/' '\n' | tail -n 1`
 
   figfiles=''
@@ -801,4 +830,5 @@
   figvarparam=''
   varkinds=''
+  vardims=''
   if test ${nvars} -ge 1; then
     figname=${kplot}_${headf}
@@ -821,4 +851,7 @@
       fi
       filen=`stats_filename ${varn} ${kind} ${headf}`
+      dims=`python ${pyHOME}/nc_var.py -o idims -f ${filen} | grep alldims |         \
+        awk '{print $3}'`
+
       if test ${iv} -eq 1; then
         varkinds=${varkind}
@@ -826,4 +859,9 @@
         varinfilen=${vn}
         figfiles=${filen}
+        vardims=${dims}
+        if $(isInlist ${dims} 'time'); then
+          tunits=`python ${pyHOME}/nc_var.py -o ivattrs -f ${filen} -v time |        \
+            grep units | grep -v '#' | awk '{print $3}'`
+        fi
       else
         varkinds=${varkinds}':'${varkind}
@@ -831,4 +869,5 @@
         varinfilen=${varinfilen}':'${vn}
         figfiles=${figfiles}':'${filen}
+        vardims=${vardims}':'${dims}
       fi
 
@@ -891,8 +930,4 @@
         exit
       ;;
-      'hovmsfc')
-        echo "  "${fname}": kind of plot '"${kplot}"' not ready !!"
-        exit
-      ;;
       'map2Dsfc')
         echo "  "${fname}": kind of plot '"${kplot}"' not ready !!"
@@ -903,6 +938,6 @@
         exit
       ;;
-      'shadcount2Dsfc')
-        figtit=`echo ${varkinds} | tr ':' '|'`
+      'shadcont2Dsfc')
+        figtit=${mod}'|'${exp}'|'$(echo ${varkinds} | tr ':' '|')
         shdstdn=`echo ${CFvars} | tr ':' ' ' | awk '{print $1}'`
         cntstdn=`echo ${CFvars} | tr ':' ' ' | awk '{print $2}'`
@@ -924,9 +959,4 @@
         graphvals=${graphvals}${figtit}':'${kindfig}':False:'${mapval}
  
-        plotins="python "${pyHOME}"/drawing.py -f "${figfs}" -o draw_2D_shad_cont "
-        plotins=${plotins}"-S '"${graphvals}"' -v "$(echo ${varinfileb} | tr ':' ',')
-        echo " " >> ${odir}/all_figures.inf
-        echo "#"$(echo $f{igtit} | tr '|' ' ') >> ${odir}/all_figures.inf
-        echo ${plotins} >> ${odir}/all_figures.inf
         pyout=`python ${pyHOME}/drawing.py -f ${figfs} -o draw_2D_shad_cont          \
           -S ${graphvals} -v $(echo ${varinfilen} | tr ':' ',')`
@@ -935,4 +965,71 @@
         ferrmsg ${pyn} ${fname} "python!'draw_2D_shad_cont'!failed#"${Spyout}
         mv 2Dfields_shadow-contour.${kindfig} ${figname}
+
+        # keeping all figures
+        plotins="python "${pyHOME}"/drawing.py -f "${figfs}" -o draw_2D_shad_cont "
+        plotins=${plotins}"-S '"${graphvals}"' -v "$(echo ${varinfileb} | tr ':' ',')
+        echo " " >> ${odir}/all_figures.inf
+        echo "#"$(echo $f{igtit} | tr '|' ' ') >> ${odir}/all_figures.inf
+        echo ${plotins} >> ${odir}/all_figures.inf
+
+#        exit
+      ;;
+      'shadconthovmsfc')
+        shdstdn=`echo ${CFvars} | tr ':' ' ' | awk '{print $1}'`
+        cntstdn=`echo ${CFvars} | tr ':' ' ' | awk '{print $2}'`
+
+        # It is assumed that if the space variable is 'lon': is desired a (lon, time) plot
+        #   it it is 'lat': then (time, lat) plot
+        dimspace='xxx' 
+        if $( isInlist ${vardims} 'lon'); then
+          spacedim='lon'
+          figtit=${mod}'|'${exp}'|mean|longitudinal|evolution|of|'${shdstdn}'|&|'
+          figtit=${figtit}${cntstdn}
+          reverse='None'
+          dims=${spacedim}'|-1,time|-1;'${spacedim}'|-1,time|-1;'${spacedim}';time'
+        else
+          spacedim='lat'
+          figtit=${mod}'|'${exp}'|mean|meridional|evolution|of|'${shdstdn}'|&|'
+          figtit=${figtit}${cntstdn}
+          reverse='None'
+          dims=${spacedim}'|-1,time|-1;'${spacedim}'|-1,time|-1;time;'${spacedim}
+        fi
+
+        figfs=`echo ${figfiles} | tr ':' ','`
+        srange=`echo ${figvarparam} | tr ':' ' ' | awk '{print $1}' | tr '|' ' ' |   \
+          awk '{print $1","$2}'`
+        cbar=`echo ${figvarparam} | tr ':' ' ' | awk '{print $1}' | tr '|' ' ' |     \
+          awk '{print $3}'`
+        crange=`echo ${figvarparam} | tr ':' ' ' | awk '{print $2}' | tr '|' ' ' |   \
+          awk '{print $1","$2}'`
+        cline=`echo ${figvarparam} | tr ':' ' ' | awk '{print $2}' | tr '|' ' ' |    \
+          awk '{print $5}'`
+        cfmt=`echo ${figvarparam} | tr ':' ' ' | awk '{print $2}' | tr '|' ' ' |     \
+          awk '{print $4}'`
+
+#        if test ${spacedim} = 'lon'; then
+#          dims='lon|-1,time|-1:lon|-1,time|-1:time:lon'
+#        else
+#          dims='lat|-1,time|-1:lat|-1,time|-1:time:lat'
+#        fi
+
+        graphvals=$(echo ${CFvars} | tr ':' ',')
+        graphvals=${shdstdn}','${cntstdn}';'${dims}';'
+        graphvals=${graphvals}${cbar}';fixsigc,'${cline}';'${cfmt}';'${srange}';'
+        graphvals=${graphvals}${crange}',9;'${figtit}';'${kindfig}';'${reverse}';'
+        graphvals=${graphvals}'time|'${tunits}'|'${timekind}'|'${timefmt}'|'
+        graphvals=${graphvals}${timelabel}
+
+        python ${pyHOME}/drawing.py -f ${figfs} -o draw_2D_shad_cont_time            \
+         -S ${graphvals} -v $(echo ${varinfilen} | tr ':' ',')
+        mv 2Dfields_shadow-contour.${kindfig} ${figname}
+
+        # keeping all figures
+        plotins="python "${pyHOME}"/drawing.py -f "${figfs}" -o draw_2D_shad_cont_time"
+        plotins=${plotins}" -S ${graphvals} -v "$(echo ${varinfilen} | tr ':' ',')
+        echo " " >> ${odir}/all_figures.inf
+        echo "#"$(echo $f{igtit} | tr '|' ' ') >> ${odir}/all_figures.inf
+        echo ${plotins} >> ${odir}/all_figures.inf
+
 #        exit
       ;;
@@ -987,4 +1084,16 @@
 fi
 
+if test ${addfiles} = 'true'; then
+  addfiles=true
+else
+  addfiles=false
+fi
+
+if test ${addfigures} = 'true'; then
+  addfigures=true
+else
+  addfigures=false
+fi
+
 if test ${debug} = 'true'; then
   dbg=true
@@ -1075,5 +1184,4 @@
       echo "## Computation of variables " > ${owdir}/all_computevars.inf
       echo "## Computation of statistics " > ${owdir}/all_statsvars.inf
-
     fi
 
@@ -1320,7 +1428,4 @@
         if $(isInlist ${directplots} ${drw}); then
           case ${drw} in
-            'hovmsfc')
-              plts=${plothovmsfc}
-            ;;
             'map2Dsfc')
               plts=${pltmap2Dsfc}
@@ -1329,6 +1434,9 @@
               plts=${pltmap3D}
             ;;
-            'shadcount2Dsfc')
-              plts=${pltshadcount2Dsfc}
+            'shadcont2Dsfc')
+              plts=${pltshadcont2Dsfc}
+            ;;
+            'shadconthovmsfc')
+              plts=${pltshadconthovmsfc}
             ;;
             *)
@@ -1353,4 +1461,5 @@
       done
       cat << EOF > directplotsdraw.inf
+Nkinds= ${ikp}
 plots= ${plots}
 EOF
@@ -1358,4 +1467,5 @@
       echo ${warnmsg}
       echo "  "${main}": retrieving direct plots from existing file 'directplotsdraw.inf' !!"
+      Nkinds=`cat directplotsdraw.inf | grep Nkinds | awk '{print $2}'`
       plots=`cat directplotsdraw.inf | grep plots | awk '{print $2}'`
     fi
Index: trunk/tools/model_graphics_template.dat
===================================================================
--- trunk/tools/model_graphics_template.dat	(revision 936)
+++ trunk/tools/model_graphics_template.dat	(revision 937)
@@ -18,12 +18,18 @@
 HOMEpy = ${HOME}/etudes/WRF_LMDZ/svn/LMDZ_WRF/tools
 
-# Srcatch
-scratch=false
+# Srcatch: should be any previous work removed and start from the scratch?
+scratch = false
 
-# Scratch files
-filescratch=false
+# Scratch files: should be any files previous work removed and start from the scratch?
+filescratch = false
 
-# Scratch figures
-figscratch=false
+# Scratch figures: should be any figures previous work removed and start from the scratch?
+figscratch = false
+
+# Have new files been added and do they need to be processed?
+addfiles = false
+
+# Have new figures been added and do they need to be drawn?
+addfiles = false
 
 # Debug
@@ -77,5 +83,5 @@
 varlast = tas:uas:vas:ps:pr:pracc:rsds:prw:evspsbl:hfss:hfls:hurs:huss:zmla:hufs:wakes:lwakeh:stherm:zmaxth:clt:cll:clm:clh:prc:prls:bils:wss
 vartmean = tas:uas:vas:ps:pr:pracc:rsds:prw:evspsbl:hfss:hfls:hurs:huss:zmla:hufs:wakes:lwakeh:stherm:zmaxth:clt:cll:clm:clh:prc:prls:bils:wss
-varxmean = ta:ua:va:hur
+varxmean = ta:ua:va:hur:hurs:tas:wss:ps
 vardiff = ualmean:valmean:talmean:huslmean:uas:vas:ps:pr
 varpinterp = ta:ua:va:hur
@@ -83,5 +89,5 @@
 
 # Operations which attach 'mean' at the end of the variable name
-varmeanname='Lmean:lmean:tmaen:xmean:ymean'
+varmeanname='Lmean:lmean:tmean:xmean:ymean'
 
 # Pressure levels
@@ -92,17 +98,18 @@
 #   diffmap2Dsfc: 2D map of surface differences values of 1 variable
 #   diffmap2Dz: 2D map of 3D differences values of 1 variable
-#   hovmsfc: Hovmoeller diagrams of 1 variable at the surface
+#   shadconthovmsfc: Hovmoeller diagrams of 2 variables at the surface in shadow and the other in contourn
 #   map2Dsfc: 2D map of surface values of 1 variable
 #   map3D: 2D map of 3D values of 1 variable
-#   shadcount2D: 2D map of shadow (1st variable) and countour (2nd variable) [stvar1]#[stvar2]
+#   shadcont2Dsfc: 2D map of shadow (1st variable) and countour (2nd variable) [stvar1]#[stvar2]
 #
 #   ':' separated list of statitsics variable values are given as: [var]|[kind(including combo values)]
 #     in figures with more than 1 variable, use '#' to separate them
-drawplots = shadcount2Dsfc
+drawplots = shadcont2Dsfc:shadconthovmsfc
 
 # Figures which can be made directly without another model/experiment output
-directplots = hovmsfc:map2Dsfc:map3D:shadcount2Dsfc
+directplots = shadconthovmsfc:map2Dsfc:map3D:shadcont2Dsfc
 
-pltshadcount2Dsfc = huss|tmean#tas|tmean:vas|tmean#uas|tmean:ps|tmean#wss|tmean:pr|tmean#rsds|tmean:prw|tmean#clt|tmean:hfls|tmean#hfss|tmean:evspsbl|tmean#bils|tmean:zmaxth|tmean#stherm|tmean:wakeh|tmean#wakes|tmean:zmaxth|tmean#stherm|tmean:prls|tmean#prc|tmean:clt|tmean#cll|tmean:clm|tmean#clh|tmean:hurs|tmean#zmla|tmean:huss|last#tas|last:vas|last#uas|last:ps|last#wss|tmean:pr|last#rsds|last:prw|last#clt|last:hfls|last#hfss|last:evspsbl|last#bils|last:zmaxth|last#stherm|last:wakeh|last#wakes|last:zmaxth|last#stherm|last:prls|last#prc|last:clt|last#cll|last:clm|last#clh|last:hurs|last#zmla|last
+pltshadcont2Dsfc = huss|tmean#tas|tmean:vas|tmean#uas|tmean:ps|tmean#wss|tmean:pr|tmean#rsds|tmean:prw|tmean#clt|tmean:hfls|tmean#hfss|tmean:evspsbl|tmean#bils|tmean:zmaxth|tmean#stherm|tmean:wakeh|tmean#wakes|tmean:zmaxth|tmean#stherm|tmean:prls|tmean#prc|tmean:clt|tmean#cll|tmean:clm|tmean#clh|tmean:hurs|tmean#zmla|tmean:huss|last#tas|last:vas|last#uas|last:ps|last#wss|tmean:pr|last#rsds|last:prw|last#clt|last:hfls|last#hfss|last:evspsbl|last#bils|last:zmaxth|last#stherm|last:wakeh|last#wakes|last:zmaxth|last#stherm|last:prls|last#prc|last:clt|last#cll|last:clm|last#clh|last:hurs|last#zmla|last
+pltshadconthovmsfc = hurs|xmean#tas|xmean:wss|xmean#ps|xmean
 
 pltdiffmap2Dsfc = uas:vas:ps:pr
@@ -128,4 +135,17 @@
 mapval = lcc,l
 
+# Time parameters
+#  [timekind]; kind of output for the time ticks
+#     'Nval': according to a given number of values as 'Nval',[Nval]
+#     'exct': according to an exact number [Nunits] of time unit as 'exct',[tunit]; 
+#       tunit= [Nunits],[tu]
+#         [tu]= 'c': centuries, 'y': year, 'm': month, 'w': week, 'd': day, 'h': hour, 'i': minute, 's': second, 'l': milisecond
+#  [timefmt]; desired format for the time ticks (combination of LaTeX and 'linux date formats')
+#  [timelabel]; label at the graph ('!' for spaces)
+
+timekind = exct,6,h
+timefmt = $%d^{%H}$
+timelabel = date!($[DD]^{[HH]}$)
+
 # Generic
 errmsg = ERROR--error--ERROR--error
