Index: trunk/tools/generic.py
===================================================================
--- trunk/tools/generic.py	(revision 804)
+++ trunk/tools/generic.py	(revision 805)
@@ -15,10 +15,21 @@
 # Character to split passed values
 cS = ','
+# Character to split serie of values
+cV = '@'
 # List of available operations
-operations=['unitsDate']
+operations=['grid_combinations', 'PolyArea', 'rmNOnum',                              \
+  'significant_decomposition', 'squared_radial',                                     \
+  'unitsDate']
 
+## e.g. # generic.py -o grid_combinations -S 1,2
+## e.g. # generic.py -o PolyArea -S -0.5@0.5@0.5@-0.5,0.5@0.5@-0.5@-0.5
+## e.g. # generic.py -o rmNOnum -S LMD123IPSL
+## e.g. # generic.py -o significant_decomposition -S 3.576,-2
 ## e.g. # generic.py -o secondsDate -S '19490101000000,19760217082932,second'
+## e.g. # generic.py -o squared_radial -S 3
 
 operationnames = "'" + gen.numVector_String(operations, "', '") + "'"
+valuesinf = "'" + cS + "' list of values to use according to the operation ('" + cV +\
+  "' for list of values)"
 
 parser = OptionParser()
@@ -26,5 +37,5 @@
   choices=operations, help="operation to make: " + operationnames, metavar="OPER")
 parser.add_option("-S", "--valueS (when applicable)", dest="values", 
-  help="'" + cS + "' list of values to use according to the operation", metavar="VALUES")
+  help=valuesinf, metavar="VALUES")
 (opts, args) = parser.parse_args()
 
@@ -41,4 +52,84 @@
             print opern + '_______ ______ _____ ____ ___ __ _'
             print getattr(object, opern).__doc__
+
+elif oper == 'grid_combinations':
+    Nvals = 2
+    vals = opts.values.split(cS)
+    if vals[0] == 'h':
+        print gen.grid_combinations.__doc__
+        quit(-1)
+    else:
+        if len(vals) != Nvals:
+            print errormsg
+            print '  ' + main + ": operation '" + oper + "' requires", Nvals, 'and', \
+              len(vals), ' has passed!!'
+            print gen.grid_combinations.__doc__
+            quit(-1)
+
+        print gen.grid_combinations(np.int(vals[0]), np.int(vals[1]))
+
+elif oper == 'PolyArea':
+    Nvals = 2
+    vals = opts.values.split(cS)
+    if vals[0] == 'h':
+        print gen.PolyArea.__doc__
+        quit(-1)
+    else:
+        if len(vals) != Nvals:
+            print errormsg
+            print '  ' + main + ": operation '" + oper + "' requires", Nvals, 'and', \
+              len(vals), ' has passed!!'
+            print gen.PolyArea.__doc__
+            quit(-1)
+        xvals = np.array(vals[0].split(cV), dtype=np.float)
+        yvals = np.array(vals[1].split(cV), dtype=np.float)
+
+        print gen.PolyArea(xvals, yvals)
+
+elif oper == 'rmNOnum':
+    Nvals = 1
+    vals = opts.values.split(cS)
+    if vals[0] == 'h':
+        print gen.rmNOnum.__doc__
+        quit(-1)
+    else:
+        if len(vals) != Nvals:
+            print errormsg
+            print '  ' + main + ": operation '" + oper + "' requires", Nvals, 'and', \
+              len(vals), ' has passed!!'
+            print gen.rmNOnum.__doc__
+            quit(-1)
+        print gen.rmNOnum(vals[0])
+
+elif oper == 'significant_decomposition':
+    Nvals = 2
+    vals = opts.values.split(cS)
+    if vals[0] == 'h':
+        print gen.significant_decomposition.__doc__
+        quit(-1)
+    else:
+        if len(vals) != Nvals:
+            print errormsg
+            print '  ' + main + ": operation '" + oper + "' requires", Nvals, 'and', \
+              len(vals), ' has passed!!'
+            print gen.significant_decomposition.__doc__
+            quit(-1)
+        print gen.significant_decomposition(np.float(vals[0]), int(vals[1]))
+
+elif oper == 'squared_radial':
+    Nvals = 1
+    vals = opts.values.split(cS)
+    if vals[0] == 'h':
+        print gen.squared_radial.__doc__
+        quit(-1)
+    else:
+        if len(vals) != Nvals:
+            print errormsg
+            print '  ' + main + ": operation '" + oper + "' requires", Nvals, 'and', \
+              len(vals), ' has passed!!'
+            print gen.squared_radial.__doc__
+            quit(-1)
+        print gen.squared_radial(int(vals[0]))
+
 elif oper == 'unitsDate':
     Nvals = 3
@@ -48,5 +139,5 @@
         quit(-1)
     else:
-        if len(vals) != Nvals and vals[0] != 'h':
+        if len(vals) != Nvals:
             print errormsg
             print '  ' + main + ": operation '" + oper + "' requires", Nvals, 'and', \
Index: trunk/tools/generic_tools.py
===================================================================
--- trunk/tools/generic_tools.py	(revision 804)
+++ trunk/tools/generic_tools.py	(revision 805)
@@ -5677,4 +5677,8 @@
     """
     fname = 'squared_radial'
+    if Npt == 'h':
+        print fname + '_____________________________________________________________'
+        print squared_radial.__doc__
+        quit()
 
     radii = []
@@ -5744,4 +5748,8 @@
     """
     fname = 'fillvalue_kind'
+    if vartype == 'h':
+        print fname + '_____________________________________________________________'
+        print fillvalue_kind.__doc__
+        quit()
 
     if vartype == type('c'):
@@ -6267,4 +6275,6 @@
     1.0
     """
+    fname = 'PolyArea'
+
     return 0.5*np.abs(np.dot(x,np.roll(y,1))-np.dot(y,np.roll(x,1)))
 
@@ -6349,4 +6359,5 @@
     while diff > 0.:
         pot = np.floor(np.log10(diff))
+        if pot < minpot: break
         potv = np.int(diff/(10.**pot))
 #        print 'Lluis:',np.log10(diff), pot,':',10.**pot,':',diff/(10.**pot),'.',potv,'.',potv*10.**pot,diff
@@ -6354,5 +6365,4 @@
         potencies.append(pot)
         potval.append(potv)
-        if pot < -minpot: break
         iipot = iipot + 1
 
@@ -6371,9 +6381,4 @@
     import datetime as dt
     fname = 'unitsDate'
-
-    if refdate == 'h':
-        print fname + '_____________________________________________________________'
-        print unitsDate.__doc__
-        quit()
 
     yrref=int(refdate[0:4])
