Index: /trunk/tools/model_graphics.bash
===================================================================
--- /trunk/tools/model_graphics.bash	(revision 992)
+++ /trunk/tools/model_graphics.bash	(revision 993)
@@ -220,7 +220,28 @@
   word=$2
 
+  if test $# -ne 2; then
+    echo ${errmsg}
+    echo "  "$fname}": wrong number of arguments !!"
+    echo "    2 are required and "$#" are given!"
+    echo "    passed: "$0
+    exit
+  fi
+
+
   Lstring=`expr length ${string}`
   Lword=`expr length ${word}`
  
+  if test ${Lstring} -lt 1; then
+    echo ${errmsg}
+    echo "  "$fname}": wrong string '"${string}"' !!"
+    exit
+  fi
+
+  if test ${Lword} -lt 1; then
+    echo ${errmsg}
+    echo "  "$fname}": wrong word '"${word}"' !!"
+    exit
+  fi
+
   Lfinalstring=`expr ${Lstring} - ${Lword}`
 
@@ -1237,6 +1258,4 @@
   fname='draw_plot'
 
-  set -x
-
   plot=$1
   odir=$2
@@ -1248,6 +1267,7 @@
     if test ${additional} = 'diff'; then
       specvarplot=${diffspecificvarplot}
-    fi
-    specvarplot=${specificvarplot}
+    else
+      specvarplot=${specificvarplot}
+    fi
   fi
 
@@ -1342,7 +1362,7 @@
       specific=false
 #      if $(isInlist ${specvarplot} ${varn}); then
-      if test $(index_string ${specvarplot} ${vn}) -ne -1; then
-        vals=`list_filter ${specvarplot} ${vn}`
-        kvals=`list_filter ${specvarplot} ${kind}`
+      if test $(index_string ${specvarplot} ${varn}) -ne -1; then
+        vals=`list_filter ${specvarplot} ${varn}`
+        kvals=`list_filter ${vals} ${kind}`
         Lkvals=`expr length ${kvals}'0'`
         if test ${Lkvals} -gt 1; then
@@ -1355,5 +1375,5 @@
             colorbar=`echo ${fkvals} | tr '|' ' ' | awk '{print $6}'`
             cntformat=`echo ${fkvals} | tr '|' ' ' | awk '{print $7}'`
-            colorcnt=`echo ${fkvals} | tr '|' ' ' | awk '{print $8}'`
+            colorcnt=`echo ${fkvals} | tr '|' ' ' | awk '{print $8}' | tr ':' ' ' | awk '{print $1}'`
           fi
         fi
@@ -1619,5 +1639,5 @@
 differences=true
 
-combosfile=${HOMEpy}/diagnostics.inf
+combosfile=${pyHOME}/diagnostics.inf
 
 ####### ###### ##### #### ### ## #
@@ -1649,5 +1669,5 @@
   esac  
 
-  modinf=`$pyHOME/nc_var.py -o model_characteristics -f None -S ${mod} | \
+  modinf=`${pyHOME}/nc_var.py -o model_characteristics -f None -S ${mod} | \
     grep singleline | awk '{print $2}'`
   ferrmsg $? $main "python!'model_characteristics'!failed"
@@ -1824,4 +1844,5 @@
     vdiffs=`echo ${vardiff} | tr ':' ' '`
     ivd=1
+    echo "      Computing diff statistics ..."
     for vdiff in ${vdiffs}; do
       echo ${vdiff}" ..."
@@ -1832,6 +1853,20 @@
         vn=`echo ${vdiff} | tr '|' ' ' | awk '{print $1}'`
         ops='None'
-      fi  
-      fileh=`echo ${varcompute} | tr ';' '\n' | grep ${vdiff} | tr '|' ' ' | awk '{print $3}'`
+      fi
+      #Modify in case of combo
+      if test $(expr index ${ops} '@') -eq 0; then
+        fileh=`echo ${varcompute} | tr ';' '\n' | grep ${vdiff} | tr '|' ' ' |       \
+          awk '{print $3}'`
+      else
+        set -x
+        Lcombo=`expr length ${vn}';'${ops}'|combo|'`
+        Lvarcompute=`expr length ${varcompute}`
+        indcombo=`index_string ${varcompute} ${vn}';'${ops}'|combo|'`
+        Lindcombo=`expr ${Lvarcompute} - ${indcombo}`
+
+        fileh=`echo ${varcompute:${indcombo}:${Lindcombo}} | tr ';' '\n' |           \
+          head -n 2  | tail -n 1 | tr '|' ' ' | awk '{print $3}'`
+        if test $(index_string ${ops} pinterp) -ne -1; then fileh=${fileh}'p_pinterp'; fi
+      fi
 
       owdir=${ofold}/${mod}/${difexp1}-${difexp2}
@@ -1844,4 +1879,5 @@
       if ${filescratch}; then rm ${owdir}/${filen} >& /dev/null; fi
       if test ! -f ${owdir}/${filen}; then
+        set -x
         dfile1=${ofold}/${mod}/${difexp1}/${filen}
         dfile2=${ofold}/${mod}/${difexp2}/${filen}
@@ -1849,4 +1885,6 @@
         dfiles='add|'${dfile1}'|'${vn}',sub|'${dfile2}'|'${vn}
         dims='time|pres|lat|lon@'${dfiles}
+        Lfileh=`expr length ${fileh}`
+        Lfileh1=`expr ${Lfileh} - 1`
         echo "python ${pyHOME}/nc_var.py -S ${dims} -o compute_opersvarsfiles -v ${vn}"
         pyout=`python ${pyHOME}/nc_var.py -S ${dims} -o compute_opersvarsfiles -v ${vn}`
@@ -1858,21 +1896,20 @@
       fi
 
-      echo "      Computing diff statistics ..."
-
       cfdims='lon:lat:pres:time'
       cfvdims='lon:lat:pres:time'
       cdiffvn=`echo ${filen} | tr '_' ' ' | awk '{print $1}'`
-      cdiffh=`echo ${filen} | tr '_' ' ' | awk '{print $2}' | tr '.' ' ' | awk '{print $1}'`
+      cdiffh=`echo ${filen} | tr '_' ' ' | awk '{print $2}' | tr '.' ' ' |           \
+        awk '{print $1}'`
 
       cdiffvar=${cdiffvn}'|'${ops}'|'${cdiffh}'|None|None'
 
-      compute_statistics ${owdir} ${filen} ${owdir} ${cdiffvar} ${cfdims} ${cfvdims} \
-        ${filescratch}
-
-      # Computing combos
-      if test $(expr index ${ops} '@') -ne -1; then
+      if test $(expr index ${ops} '@') -eq 0; then
+        compute_statistics ${owdir} ${filen} ${owdir} ${cdiffvar} ${cfdims}          \
+          ${cfvdims} ${filescratch}
+      else
+        # Computing combos
         echo "      Computing combos: "${ops}
-        combs=`echo ${ops} | tr ';' ' ' | awk '{print $2}' | tr '@' ' '`
-        ifile=${cdiffvn}_${fhead}
+        combs=`echo ${ops} | tr '@' ' '`
+        ifile=${cdiffvn}_${fileh}
         for comb in ${combs}; do
           combcvar=${cdiffvn}'|'${comb}'|'${cdiffh}'|None|None'
@@ -1898,6 +1935,4 @@
 # Diff plotting
 ##
-    set -x
-
     echo "  "${main}": Plotting diff figures ..."
     if ${figscratch}; then rm diffplotsdraw.inf; fi
@@ -1963,5 +1998,5 @@
           dvals='T:Time,Z:bottom_top,Y:south_north,X:west_east'
           dimnames='T:Time,Z:bottom_top,Y:south_north,X:west_east'
-          python ${HOMEpy}/vertical_interpolation.py                            \
+          python ${pyHOME}/vertical_interpolation.py                            \
             -f ${ofold}/${exp}/${filensfc} -o WRFp -i ${plevels} -k 'lin'            \
             -v WRFt,U,V,WRFrh,WRFght -d ${dimnames} -D T:Times,Z:ZNU,Y:XLAT,X:XLONG
@@ -1969,5 +2004,5 @@
             echo ${errormsg}
             echo "  python failed!"
-            echo "  python ${HOMEpy}/vertical_interpolation.py"                            \
+            echo "  python ${pyHOME}/vertical_interpolation.py"                            \
             "-f ${ofold}/${exp}/${filensfc} -o WRFp -i ${plevels} -k 'lin'"            \
             "-v WRFt,U,V,WRFrh,WRFght -d ${dimnames} -D T:Times,Z:ZNU,Y:XLAT,X:XLONG"
@@ -1984,7 +2019,7 @@
           fileworig=${filensfc}
           cp ${ifoldsfc}/${exp}/${fileworig} ${ifoldsfc}/${exp}/${filensfc}
-          python ${HOMEpy}/nc_var.py -o WRF_CFxtime_creation -f ${ifoldsfc}/${exp}/${filensfc} \
+          python ${pyHOME}/nc_var.py -o WRF_CFxtime_creation -f ${ifoldsfc}/${exp}/${filensfc} \
             -S 19491201000000,hours -v time
-          python ${HOMEpy}/nc_var.py -o WRF_CFlonlat_creation -f ${ifoldsfc}/${exp}/${filensfc}\
+          python ${pyHOME}/nc_var.py -o WRF_CFlonlat_creation -f ${ifoldsfc}/${exp}/${filensfc}\
             -S longitude,latitude -v XLONG,XLAT
         fi
@@ -2005,5 +2040,5 @@
             echo "    var:"${var}
             varn=`echo ${var} | tr '_' ' ' | awk '{print $2}'`
-            combo=`python ${HOMEpy}/diagnostics.py -f ${combosfile} -d variable_combo -v ${varn}\
+            combo=`python ${pyHOME}/diagnostics.py -f ${combosfile} -d variable_combo -v ${varn}\
               | grep COMBO | awk '{print $2}'`
             if test ${combo} = 'ERROR'; then
@@ -2019,16 +2054,16 @@
             ivar=`expr ${ivar} + 1`
           done
-          python ${HOMEpy}/diagnostics.py -d ${values} -f ${ifoldsfc}/${exp}/${filensfc} -v \
+          python ${pyHOME}/diagnostics.py -d ${values} -f ${ifoldsfc}/${exp}/${filensfc} -v \
             ${varcombos}
           if test $? -ne 0; then
             echo ${errormsg}
             echo "  python failed!!"
-            echo python ${HOMEpy}/diagnostics.py -d ${values} -f ${ifoldsfc}/${exp}/${filensfc}\
+            echo python ${pyHOME}/diagnostics.py -d ${values} -f ${ifoldsfc}/${exp}/${filensfc}\
               -v ${varcombos}
             exit
           fi
-          python ${HOMEpy}/nc_var.py -o WRF_CFxtime_creation -f diagnostics.nc                 \
+          python ${pyHOME}/nc_var.py -o WRF_CFxtime_creation -f diagnostics.nc                 \
             -S 19491201000000,hours -v time
-           python ${HOMEpy}/nc_var.py -o WRF_CFlonlat_creation -f diagnostics.nc               \
+           python ${pyHOME}/nc_var.py -o WRF_CFlonlat_creation -f diagnostics.nc               \
             -S longitude,latitude -v XLONG,XLAT
           mv diagnostics.nc ${ifolddiag}/${exp}
@@ -2049,5 +2084,5 @@
         echo "    var: "${varn}
         var=`echo ${varn} | tr '|' ' ' | awk '{print $2}'`
-        varval=`python ${HOMEpy}/drawing.py -o variable_values -S ${var} | grep all_values | awk '{print $3}'`
+        varval=`python ${pyHOME}/drawing.py -o variable_values -S ${var} | grep all_values | awk '{print $3}'`
         varname=`echo ${varval} | tr ',' ' ' | awk '{print $1}'`
 
@@ -2058,10 +2093,10 @@
         if test ${vark} = 'mean'; then
           vals='time:-1|z:-1|y:-1|x:-1,time:x,mean,pressure:lat'
-          python ${HOMEpy}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${file} -v ${var}
+          python ${pyHOME}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${file} -v ${var}
           pyexec=$?
           if test ${pyexec} -ne 0; then
             echo ${errormsg}
             echo "  "${main}": python fai1ls!"
-            echo "python ${HOMEpy}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${file} -v ${var}"
+            echo "python ${pyHOME}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${file} -v ${var}"
             exit
           else
@@ -2077,5 +2112,5 @@
           if test ${var} = 'ACRAINTOT'; then
             files='add|'${file}'|RAINC,add|'${file}'|RAINNC'
-            python ${HOMEpy}/nc_var.py -S 'time|XLAT|XLONG@'${files} -o compute_opersvarsfiles \
+            python ${pyHOME}/nc_var.py -S 'time|XLAT|XLONG@'${files} -o compute_opersvarsfiles \
               -v ${var}
             mv opersvarsfiles_${var}.nc ${ofold}/${exp}
@@ -2083,5 +2118,5 @@
           elif test ${var} = 'RAINTOT'; then
             dims='Time@time,bottom_top@ZNU,south_north@XLAT,west_east@XLONG'
-            python ${HOMEpy}/diagnostics.py -d ${dims} -v 'RAINTOT|RAINC@RAINNC@time' -f ${file}
+            python ${pyHOME}/diagnostics.py -d ${dims} -v 'RAINTOT|RAINC@RAINNC@time' -f ${file}
             mv diagnostics.nc ${ofold}/${exp}/diagnostics_${varname}.nc
             file=${ofold}/${exp}/diagnostics_${varname}.nc
@@ -2095,10 +2130,10 @@
               var=${cl}
               echo "    var: "${var}
-              python ${HOMEpy}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${file} -v ${cl}
+              python ${pyHOME}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${file} -v ${cl}
               pyexec=$?
               if test ${pyexec} -ne 0; then
                 echo ${errormsg}
                 echo "  "${main}": python fails!"
-                echo python ${HOMEpy}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${file} -v ${cl}
+                echo python ${pyHOME}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${file} -v ${cl}
                 exit
               fi
@@ -2106,5 +2141,5 @@
               vals='Time:-1|south_north:-1|west_east:-1,Time,mean,XLONG:XLAT'
               dims='Time@time,bottom_top@ZNU,south_north@XLAT,west_east@XLONG'
-              python ${HOMEpy}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${file} -v ${cl}
+              python ${pyHOME}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${file} -v ${cl}
               pyexec=$?
               if test ${pyexec} -ne 0; then
@@ -2120,5 +2155,5 @@
           elif test ${var} = 'WRFbils' && test ! -f ${ofold}/${exp}/diagnostics_${varname}.nc; then
             dims='Time@time,south_north@XLAT,west_east@XLONG'
-            python ${HOMEpy}/diagnostics.py -d ${dims} -v 'WRFbils|HFX@LH' -f ${file}
+            python ${pyHOME}/diagnostics.py -d ${dims} -v 'WRFbils|HFX@LH' -f ${file}
             mv diagnostics.nc ${ofold}/${exp}/diagnostics_${varname}.nc
             file=${ofold}/${exp}/diagnostics_${varname}.nc
@@ -2126,5 +2161,5 @@
           elif test ${var} = 'WRFprw' && test ! -f ${ofold}/${exp}/diagnostics_${varname}.nc; then
             dims='Time@time,bottom_top@ZNU,south_north@XLAT,west_east@XLONG'
-            python ${HOMEpy}/diagnostics.py -d ${dims} -v 'WRFprw|WRFdens@QVAPOR' -f ${file}
+            python ${pyHOME}/diagnostics.py -d ${dims} -v 'WRFprw|WRFdens@QVAPOR' -f ${file}
             mv diagnostics.nc ${ofold}/${exp}/diagnostics_${varname}.nc
             file=${ofold}/${exp}/diagnostics_${varname}.nc
@@ -2132,5 +2167,5 @@
           elif test ${var} = 'WRFrhs' && test ! -f ${ofold}/${exp}/diagnostics_${varname}.nc; then
             dims='Time@time,bottom_top@ZNU,south_north@XLAT,west_east@XLONG'
-            python ${HOMEpy}/diagnostics.py -d ${dims} -v 'WRFrhs|PSFC@T2@Q2' -f ${file}
+            python ${pyHOME}/diagnostics.py -d ${dims} -v 'WRFrhs|PSFC@T2@Q2' -f ${file}
             mv diagnostics.nc ${ofold}/${exp}/diagnostics_${varname}.nc
             file=${ofold}/${exp}/diagnostics_${varname}.nc
@@ -2146,5 +2181,5 @@
           fi
           if test ! -f ${ofold}/${exp}/${varname}${oper}.nc; then
-            python ${HOMEpy}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${file} -v ${var}
+            python ${pyHOME}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${file} -v ${var}
             pyexec=$?
             if test ${pyexec} -ne 0; then
@@ -2167,5 +2202,5 @@
               vals='Time:-1|south_north:-1|west_east:-1,Time,mean,XLONG:XLAT'
               dims='Time@time,bottom_top@ZNU,south_north@XLAT,west_east@XLONG'
-              python ${HOMEpy}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${file} -v ${cld}
+              python ${pyHOME}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${file} -v ${cld}
               pyexec=$?
               if test ${pyexec} -ne 0; then
@@ -2181,5 +2216,5 @@
             vals='Time:-1|south_north:-1|west_east:-1,Time,mean,XLONG:XLAT'
             dims='Time@time,bottom_top@ZNU,south_north@XLAT,west_east@XLONG'
-            python ${HOMEpy}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${file} -v ${var}
+            python ${pyHOME}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${file} -v ${var}
             pyexec=$?
             if test ${pyexec} -ne 0; then
@@ -2217,5 +2252,5 @@
       dims='bottom_top@bottom_top,south_north@south_north,west_east@west_east'
       if test ! -f ${ofold}/${exp}/${var}t-lonmean.nc; then
-        python ${HOMEpy}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${tmean} -v ${var}
+        python ${pyHOME}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${tmean} -v ${var}
         pyexec=$?
         if test ${pyexec} -ne 0; then
@@ -2257,6 +2292,6 @@
       cntvar=`echo ${gpair} | tr '@' ' ' | awk '{print $2}'`
       echo "  couple: "${shdvar}'-'${cntvar}
-      shdvals=`python ${HOMEpy}/drawing.py -o variable_values -S ${shdvar} | grep all_values | awk '{print $3}'`
-      cntvals=`python ${HOMEpy}/drawing.py -o variable_values -S ${cntvar} | grep all_values | awk '{print $3}'`
+      shdvals=`python ${pyHOME}/drawing.py -o variable_values -S ${shdvar} | grep all_values | awk '{print $3}'`
+      cntvals=`python ${pyHOME}/drawing.py -o variable_values -S ${cntvar} | grep all_values | awk '{print $3}'`
       files=${ofold}'/'${exp}'/'${shdvar}'mean.nc,'${ofold}'/'${exp}'/'${cntvar}'mean.nc'
 
@@ -2350,9 +2385,9 @@
       if test ${vark} = 'sfc' || test ${vark} = 'diag' && 
        ! $(isin_list ${coup2D} ${gpair}); then
-        python ${HOMEpy}/drawing.py -f ${files} -o draw_2D_shad_cont_time -S ${graphvals} -v   \
+        python ${pyHOME}/drawing.py -f ${files} -o draw_2D_shad_cont_time -S ${graphvals} -v   \
           ${shdstdn}'mean,'${cntstdn}'mean'
         pyexc=$?
       else
-        python ${HOMEpy}/drawing.py -f ${files} -o draw_2D_shad_cont -S ${graphvals} -v        \
+        python ${pyHOME}/drawing.py -f ${files} -o draw_2D_shad_cont -S ${graphvals} -v        \
           ${shdstdn}'mean,'${cntstdn}'mean'
         pyexc=$?
@@ -2376,5 +2411,5 @@
         echo '  '${shdstdn}'mean,'${cntstdn}'mean'
 
-        python ${HOMEpy}/drawing.py -f ${files} -o draw_2D_shad_cont -S ${graphvals} -v        \
+        python ${pyHOME}/drawing.py -f ${files} -o draw_2D_shad_cont -S ${graphvals} -v        \
           ${shdstdn}'mean,'${cntstdn}'mean'
         pyexc=$?
@@ -2408,5 +2443,5 @@
       var=`ncdump -h ${tmean} | grep float | grep mean | tr '(' ' ' | awk '{print $2}'`
       if test ! ${var} = 'cltmean'; then
-        shdvals=`python ${HOMEpy}/drawing.py -o variable_values -S ${var} |          \
+        shdvals=`python ${pyHOME}/drawing.py -o variable_values -S ${var} |          \
           grep all_values | awk '{print $3}'`
         cbar=`echo ${shdvals} | tr ',' ' ' | awk '{print $7}'`
@@ -2427,10 +2462,10 @@
 #        vals=${vals}'None:None:true'
 #        dims='south_north@XLAT,west_east@XLONG'
-        python ${HOMEpy}/nc_var.py -o WRF_CFlonlat_creation -S longitude,latitude    \
+        python ${pyHOME}/nc_var.py -o WRF_CFlonlat_creation -S longitude,latitude    \
           -f ${tmean} -v XLONG,XLAT
         vals=${var}':longitude|-1,latitude|-1:longitude:latitude:'${cbar}':'${xtrms}':monthly|mean:pdf:'
         vals=${vals}'None:None:true'
         dims='south_north@latitude,west_east@longitude'
-        python ${HOMEpy}/drawing.py -o draw_2D_shad -S ${vals} -f ${tmean} -v ${var}
+        python ${pyHOME}/drawing.py -o draw_2D_shad -S ${vals} -f ${tmean} -v ${var}
         pyexec=$?
         if test ${pyexec} -ne 0; then
@@ -2457,8 +2492,8 @@
   for exp in ${exps}; do
     file=${ofold}/${exp}/vertical_interpolation_WRFp.nc
-#    python ${HOMEpy}/nc_var.py -o WRF_CFlonlat_creation -S longitude,latitude        \
+#    python ${pyHOME}/nc_var.py -o WRF_CFlonlat_creation -S longitude,latitude        \
 #     -f ${file} -v lon,lat
 ## ALREADY done!
-#    python ${HOMEpy}/nc_var.py -o valmod -S lowthres@oper,0.,sumc,360. -f ${file}    \
+#    python ${pyHOME}/nc_var.py -o valmod -S lowthres@oper,0.,sumc,360. -f ${file}    \
 #       -v lon
     if test ${exp} = 'AR40'; then labexp='wlmdza'
@@ -2468,14 +2503,14 @@
       echo "  pt: "${pt}
       vals='x:15|y:'${pt}'|time:23'
-      lonval=`python ${HOMEpy}/nc_var.py -o varout -f ${file} -S ${vals} -v lon |    \
+      lonval=`python ${pyHOME}/nc_var.py -o varout -f ${file} -S ${vals} -v lon |    \
         awk '{print $2}'`
-      latval=`python ${HOMEpy}/nc_var.py -o varout -f ${file} -S ${vals} -v lat |    \
+      latval=`python ${pyHOME}/nc_var.py -o varout -f ${file} -S ${vals} -v lat |    \
         awk '{print $2}'`
-      tval=`python ${HOMEpy}/nc_var.py -o varout -f ${file} -S ${vals} -v time |     \
+      tval=`python ${pyHOME}/nc_var.py -o varout -f ${file} -S ${vals} -v time |     \
         awk '{print $2}'`
       for var in ${vars}; do
         echo "    var: "${var}
 
-        shdvals=`python ${HOMEpy}/drawing.py -o variable_values -S ${var} |          \
+        shdvals=`python ${pyHOME}/drawing.py -o variable_values -S ${var} |          \
           grep all_values | awk '{print $3}'`
         cbar=`echo ${shdvals} | tr ',' ' ' | awk '{print $7}'`
@@ -2494,5 +2529,5 @@
         vals=${vals}${xtrms}':'${labexp}'|vertical|longitudinal|section|('${latval}
         vals=${vals}'$^{\circ}$):pdf:flip@y:None:true'
-        python ${HOMEpy}/drawing.py -o draw_2D_shad -S ${vals} -f ${file} -v ${var}
+        python ${pyHOME}/drawing.py -o draw_2D_shad -S ${vals} -f ${file} -v ${var}
         pyexec=$?
         if test ${pyexec} -ne 0; then
@@ -2521,5 +2556,5 @@
         graphvals=${graphvals}'flip@y:None'
 
-        python ${HOMEpy}/drawing.py -o draw_2D_shad_cont -S ${graphvals}             \
+        python ${pyHOME}/drawing.py -o draw_2D_shad_cont -S ${graphvals}             \
           -f ${file},${file} -v ${var},${var}
         pyexec=$?
@@ -2566,5 +2601,5 @@
           values='pressure|lat@add|'${ofold}'/'${exp1}'/'${var}${fileorigd}'|'${var}'mean,'
           values=${values}'sub|'${ofold}'/'${exp2}'/'${var}${fileorigd}'|'${var}'mean'
-          python ${HOMEpy}/nc_var.py -o compute_opersvarsfiles -S ${values} -v ${var}
+          python ${pyHOME}/nc_var.py -o compute_opersvarsfiles -S ${values} -v ${var}
           pyexec=$?
           if test ${pyexec} -ne 0; then
@@ -2577,5 +2612,5 @@
           values='longitude|latitude@add|'${ofold}'/'${exp1}'/'${var}${fileorigd}'|'${var}'mean,'
           values=${values}'sub|'${ofold}'/'${exp2}'/'${var}${fileorigd}'|'${var}'mean'
-          python ${HOMEpy}/nc_var.py -o compute_opersvarsfiles -S ${values} -v ${var}
+          python ${pyHOME}/nc_var.py -o compute_opersvarsfiles -S ${values} -v ${var}
           pyexec=$?
           if test ${pyexec} -ne 0; then
@@ -2597,6 +2632,6 @@
         echo "  couple: "${shdvar}'-'${cntvar}
 
-        shdvals=`python ${HOMEpy}/drawing.py -o variable_values -S ${shdvar} | grep all_values | awk '{print $3}'`
-        cntvals=`python ${HOMEpy}/drawing.py -o variable_values -S ${cntvar} | grep all_values | awk '{print $3}'`
+        shdvals=`python ${pyHOME}/drawing.py -o variable_values -S ${shdvar} | grep all_values | awk '{print $3}'`
+        cntvals=`python ${pyHOME}/drawing.py -o variable_values -S ${cntvar} | grep all_values | awk '{print $3}'`
         files=${ofold}'/'${shdvar}'_diff.nc,'${ofold}'/'${cntvar}'_diff.nc'
 
@@ -2632,5 +2667,5 @@
         graphvals=${graphvals}${shdstdn}'|&|'${cntstdn}':pdf:flip@y:None'
 
-        python ${HOMEpy}/drawing.py -o draw_2D_shad_cont -S ${graphvals}             \
+        python ${pyHOME}/drawing.py -o draw_2D_shad_cont -S ${graphvals}             \
           -f ${files} -v ${shdvar},${cntvar}
         pyexec=$?
@@ -2648,5 +2683,5 @@
       for var in ${vars}; do
         echo "  "${var}
-        vals=`python ${HOMEpy}/drawing.py -o variable_values -S ${var} | grep all_values | awk '{print $3}'`
+        vals=`python ${pyHOME}/drawing.py -o variable_values -S ${var} | grep all_values | awk '{print $3}'`
         file=${ofold}/${var}_diff.nc
 
@@ -2663,5 +2698,5 @@
         vals=${vals}${xtrms}':'${exp1}'-'${exp2}'|meridional|monthly|average|differences:'
         vals=${vals}'pdf:None:None:true'
-        python ${HOMEpy}/drawing.py -o draw_2D_shad -S ${vals} -f ${file} -v ${var}
+        python ${pyHOME}/drawing.py -o draw_2D_shad -S ${vals} -f ${file} -v ${var}
         pyexec=$?
         if test ${pyexec} -ne 0; then
Index: /trunk/tools/model_graphics_template.dat
===================================================================
--- /trunk/tools/model_graphics_template.dat	(revision 992)
+++ /trunk/tools/model_graphics_template.dat	(revision 993)
@@ -16,8 +16,10 @@
 
 # python HOME
-HOMEpy = ${HOME}/etudes/WRF_LMDZ/svn/LMDZ_WRF/tools
+pyHOME = /home/lluis/etudes/WRF_LMDZ/svn/LMDZ_WRF/tools
+# cdo HOME
+cdoHOME = /home/lluis/bin/gcc_cdo/1.6.4rc6/bin/cdo
 
 # Srcatch: should be any previous work removed and start from the scratch?
-scratch = false
+scratch = true
 
 # Scratch files: should be any files previous work removed and start from the scratch?
@@ -34,5 +36,5 @@
 
 # Debug
-debug=false
+debug = true
 
 # Folder with the files
@@ -85,5 +87,4 @@
 #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:hurs:tas:wss:ps
-#vardiff = tas|last:tas|xmean:tas|tmean
 #varpinterp = ta:ua:va:hur:ws:hus
 #varcombo = ta;pinterp@last@xmean:ua;pinterp@last@xmean:va;pinterp@last@xmean:hur;pinterp@last@xmean:ws;pinterp@turb@xmean:hus;pinterp@turb@xmean
@@ -95,8 +96,8 @@
 varcombo = ta;pinterp@last@xmean:ua;pinterp@last@xmean:va;pinterp@last@xmean:hur;pinterp@last@xmean:ws;pinterp@turb@xmean:hus;pinterp@turb@xmean
 
-vardiff = tas|last:tas|xmean:tas|tmean:wss|last:wss|xmean:wss|tmean
+vardiff = tas|last:tas|xmean:tas|tmean:wss|last:wss|xmean:wss|tmean:ua|pinterp@last@xmean:va|pinterp@last@xmean
 
 # Operations which attach 'mean' at the end of the variable name
-varmeanname='Lmean:lmean:tmean:xmean:ymean'
+varmeanname=Lmean:lmean:tmean:xmean:ymean
 
 # Pressure levels
@@ -106,4 +107,8 @@
 plevels = 100000.:97500.:95000.:92500.:90000.:85000.:80000.:75000.:70000.:65000.:60000.:55000.:50000.:45000.:40000.:35000.:30000.:25000.:20000.:15000.:10000.:5000.:2500.:1000.:500.:250.
 
+# Common projection
+#   File with the information of the projection to be used for inter-model differences
+#   File obtained from 'cdo griddes'
+commonproj = WaqualCommon.griddes
 
 # Kind of plots
@@ -119,5 +124,5 @@
 #drawplots = shadcont2Dsfc:shadconthovmsfc:sahdcont2Dzsec
 drawplots = shadcont2Dzsec
-drawdiffplots = shadcont2Dsfc
+drawdiffplots = shadcont2Dsfc:shadconthovmsfc:sahdcont2Dzsec
 
 # Figures which can be made directly without another model/experiment output
@@ -126,7 +131,9 @@
 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
-pltshadcont2Dzsec=ua|pinterp@last@xmean#va|pinterp@last@xmean:hur|pinterp@last@xmean#ta|pinterp@last@xmean:ws|pinterp@turb@xmean#hus|pinterp@turb@xmean
+pltshadcont2Dzsec = ua|pinterp@last@xmean#va|pinterp@last@xmean:hur|pinterp@last@xmean#ta|pinterp@last@xmean:ws|pinterp@turb@xmean#hus|pinterp@turb@xmean
 
-pltdiffshadcont2Dsfc = tas|tmean#wss|tmean:tas|last#wss|last
+pltdiffshadcont2Dsfc = tas|tmean#wss|tmean:wss|last#tas|last
+pltdiffshadconthovmsfc = wss|xmean#tas|xmean
+pltdiffshadcont2Dzsec = ua|pinterp@last@xmean#va|pinterp@last@xmean
 
 # Specific variable-statistisc graphic parameters (if no value is given, they will be retrieved from 'variables_values.dat')
@@ -142,5 +149,5 @@
 #        [colorcnt]: color for the countor lines
 specificvarplot = cll|last|shadcont2Dsfc|0.|1.|gist_gray|%g|black:clh|last|shadcont2Dsfc|0.|1.|gist_gray|%g|black:husturbmean|pinterp@turb@xmean|shadcont2Dzsec|0.|1.e-6|Blues|%g|black
-diffspecificvarplot = tas|tmean|shadcont2Dsfc|-20.|20.seismic|%g|black:wss|tmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:tas|last|shadcont2Dsfc|-20.|20.seismic|%g|black:wss|last|shadcont2Dsfc|-30.|30.|seismic|%g|black
+diffspecificvarplot = tas|tmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:wss|tmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:tas|last|shadcont2Dsfc|-20.|20.|seismic|%g|black:wss|last|shadcont2Dsfc|-30.|30.|seismic|%g|black
 
 # Figures output kind
