Index: trunk/tools/drawing.py
===================================================================
--- trunk/tools/drawing.py	(revision 2756)
+++ trunk/tools/drawing.py	(revision 2757)
@@ -2570,6 +2570,6 @@
 
     timename = timevals.split('|')[0]
-    timekind = timevals.split('|')[1]
-    timefmt = timevals.split('|')[2]
+    timekind = timevals.split('|')[2]
+    timefmt = timevals.split('|')[3]
 
     if rangevals == 'None':
@@ -2765,7 +2765,7 @@
 
         if ifn == 0:
-            varunits = drw.units_lunits(vvobj0.units)
+            varunits = gen.units_lunits(vvobj0.units)
         else:
-            if varunits != drw.units_lunits(vvobj0.units):
+            if varunits != gen.units_lunits(vvobj0.units):
                 print errormsg
                 print '  ' + fname + ': wrong units:', vvobj0.units, " of " +        \
@@ -2795,5 +2795,7 @@
     print '  ' + fname + ': plotting from: ' + dtiS + ' to ' + dteS
 
-    timepos, timelabels = drw.CFtimes_plot(tvals, timeunit, timekind, timefmt)
+    tU = timeunit.replace('!', ' ')
+    print timeunit, timekind, timefmt
+    timepos, timelabels = drw.CFtimes_plot(tvals, tU, timekind, timefmt)
 
 #    print 'Lluis min/max tval +/- dtval/2:', mintval-dtvals/2., maxtval+dtvals/2.,'dt:', len(tvals)
Index: trunk/tools/drawing_tools.py
===================================================================
--- trunk/tools/drawing_tools.py	(revision 2756)
+++ trunk/tools/drawing_tools.py	(revision 2757)
@@ -1928,5 +1928,5 @@
         fontsize = int(fontsize0)
     if len(legstring.split(char)) == 2:
-        return locleg, fontsize
+        return locleg, fontsize, 1
     else:
         ncol = int(legstring.split(char)[2])
Index: trunk/tools/generic_tools.py
===================================================================
--- trunk/tools/generic_tools.py	(revision 2756)
+++ trunk/tools/generic_tools.py	(revision 2757)
@@ -77,4 +77,5 @@
 # auto_val: Function to provide a value following an 'auto' configuration
 # auto_val_list: Function to provide a list of values following an 'auto' configuration or a single value
+# begend_spaces: Function to remove any spaces at the beginning and end of an String
 # Capturing: Class to capture the standard output from a function
 # CF_gribequiv: Function to provide the GRIB variable code number from a CF name
@@ -594,4 +595,39 @@
 
     return sign
+
+def begend_spaces(Str):
+    """ Function to remove any spaces at the beginning and end of an Sting
+      Str: string to remove spaces
+    >>> begend_spaces(' Antartic ')
+    'Antartic'
+    """
+    fname = 'begend_spaces'
+
+    newstring=''
+    Nchars = len(Str)
+    Hspace = True
+    for ic in range(Nchars):
+        if Hspace:
+            if Str[ic:ic+1] == ' ':
+                newstring = ''
+            else:
+                newstring = newstring + Str[ic:ic+1]
+                Hspace = False
+        else:
+            newstring = newstring + Str[ic:ic+1]
+
+    Tspace = True
+    newstring2 = ''
+    for ic in range(Nchars-2,-1,-1):
+        if Tspace:
+            if newstring[ic:ic+1] == ' ':
+                newstring2 = ''
+            else:
+                newstring2 = newstring[ic:ic+1] + newstring2
+                Tspace = False
+        else:
+            newstring2 = newstring[ic:ic+1] + newstring2
+
+    return newstring2
 
 ##
@@ -17317,4 +17353,6 @@
       'U', 'U']
 
+    print " Lluis '" + stval +  "' "
+
     if stcrit == 'h':
         print fname + '_____________________________________________________________'
@@ -17344,4 +17382,5 @@
     Nst = 0
     stations = {}
+    availvals = []
     for line in ncf:
         if line[0:1] != '#' and len(line) > 10:
@@ -17354,5 +17393,8 @@
 
             stvalues = list_listKs(values, stKs)
-            if stvalues[icrit] == stv: 
+            if not searchInlist(availvals, stvalues[icrit]):
+                availvals.append(stvalues[icrit])
+            print "'" + stvalues[icrit] + "'", "'"+ stv+ "'", type(stvalues[icrit]), type(stv), stvalues[icrit] == stv
+            if stvalues[icrit] == stv:
                 stations[Nst] = stvalues
                 Nst = Nst + 1
@@ -17360,6 +17402,11 @@
     if Nst == 0:
         print errormsg
-        print '  ' + fname + ": station with criteria '" + stcrit + "'= '", stval,   \
-          "' not found !!!"
+        if type (stval) == type('H'):
+            print '  ' + fname + ": station with criteria '" + stcrit + "'= '" +     \
+              stval + "' not found !!!"
+        else:
+            print '  ' + fname + ": station with criteria '" + stcrit + "'= '",      \
+              stval, "' not found !!!"
+        print '    available ones', availvals
         ncf.close()
         if Notfound: 
@@ -17385,4 +17432,7 @@
     return stations
 
+print stations_values('prov', 'Antartic')
+quit()
+
 def list_rmchar(listv, rmchr):
     """ Function to remove a list of characters from its values
