Index: trunk/tools/model_graphics.bash
===================================================================
--- trunk/tools/model_graphics.bash	(revision 956)
+++ trunk/tools/model_graphics.bash	(revision 962)
@@ -575,4 +575,5 @@
 #        pinterp: pressure interpolation (to the given $plevels)
 #        tmean: temporal mean values
+#        turb: Taylor's turbulence decomposition value
 #        xmean: x-axis mean values
 #        ymean: y-axis mean values
@@ -731,4 +732,24 @@
 
         varkeep=':'${CFvarn}'mean:timestats'
+      ;;
+      # turbulence values
+      'turb')
+        vals='turbulence|'${CFvarn}
+        dims='time@time,'${dnz}'@'${vdnz}',lat@lat,lon@lon,pres@pres'
+
+        pyout=`python ${pyHOME}/diagnostics.py -d ${dims} -v ${vals} -f ${cfiles}`
+        pyn=$?
+        Spyout=`echo ${pyout} | tr '\n' '#' | tr ' ' '!'`
+        ferrmsg ${pyn} ${fname} "python!'diagnostics'!'turbulence'!failed#"${Spyout}
+        mv diagnostics.nc ${filen}
+
+        # Keeping the operations
+        pyins="python "${pyHOME}"/diagnostics.py -d "${dims}" -v '"${vals}
+        pyins=${pyins}"' -f ${cfiles}"
+        echo " " >> ${odir}/all_statsvars.inf
+        echo "# ${CFvarn}" "${vark}" >> ${odir}/all_statsvars.inf
+        echo ${pyins} >> ${odir}/all_statsvars.inf
+
+        varkeep=':'${CFvarn}'turb'
       ;;
       # x-axis mean values
@@ -807,6 +828,4 @@
   fname='draw_plot'
 
-  set -x
-
   plot=$1
   odir=$2
@@ -854,13 +873,17 @@
           vn=${varn}
         fi
+        if test ${op} = 'turb'; then
+          vn=${vn}'turb'
+        fi          
       else
         oprs=`echo ${kind} | tr '@' ' '`
+        vn=${varn}
         for op in ${oprs}; do
           if $(isInlist ${varmeanname} ${op}); then 
-            vn=${varn}'mean'
-            break
-          else
-            vn=${varn}
+            vn=${vn}'mean'
           fi
+          if test ${op} = 'turb'; then
+            vn=${vn}'turb'
+          fi          
         done
       fi
@@ -897,12 +920,13 @@
       figname=${figname}'_'${vn}'-'$(echo ${kind} | tr '@' '-')
 
-      # Getting plot variable configuration
+      # Getting plot variable configuration (using variable name inside the file?)
       specific=false
-      if $(isInlist ${specificvarplot} ${varn}); then
-        vals=`listfilter ${specificvarplot} ${varn}`
-        kvals=`listfilter ${specificvarplot} ${kind}`
+#      if $(isInlist ${specificvarplot} ${varn}); then
+      if test $(index_string ${specificvarplot} ${vn}) -ne -1; then
+        vals=`list_filter ${specificvarplot} ${vn}`
+        kvals=`list_filter ${specificvarplot} ${kind}`
         Lkvals=`expr length ${kvals}'0'`
         if test ${Lkvals} -gt 1; then
-          fkvals=`listfilter ${kvals} ${kplot}`
+          fkvals=`list_filter ${kvals} ${kplot}`
           Lfkvals=`expr length ${fkvals}'0'`
           if test ${Lfkvals} -gt 1; then
@@ -1438,5 +1462,5 @@
             echo "  "${main}": differences will be calculated when all the "         \
               "model/experiments will be done !"
-          elif test ${vark} = 'diff'; then
+          elif test ${vark} = 'combo'; then
             echo "  "${main}": combos will be calculated later when all the "        \
               "variables will be done !"
@@ -1466,11 +1490,25 @@
         diagv=`echo ${cvar} | tr '|' ' ' | awk '{print $5}'`
 
+#        if $(index_string ${vark} 'pinterp') -ne -1; then
+#          fhead=${fileh}'p'
+#        else
+#          fhead=${fileh}
+#        fi
         combs=`echo ${vco} | tr ';' ' ' | awk '{print $2}' | tr '@' ' '`
         ifile=${CFv}_${fhead}
         for comb in ${combs}; do
-          combcvar=${CFv}'|'${comb}'|'${fileh}'|'${modv}'|'${diagv}
+          combcvar=${CFv}'|'${comb}'|'${fhead}'|'${modv}'|'${diagv}
           compute_statistics ${iwdir} ${ifile}.nc ${owdir} ${combcvar} ${moddims}    \
             ${modvdims} ${filescratch} ${ifile}.nc
           ifile=${ifile}_${comb}
+
+          # Adding 'surnames' to the variable's name
+          if test ${comb} = 'turb'; then
+            CFv=${CFv}'turb'
+          fi
+          if $(isInlist ${varmeanname} ${comb}); then
+            CFv=${CFv}'mean'
+          fi
+
           isc=`expr ${isc} + 1`
         # End of combo 
