Index: TOOLS/MOSAIX/README.txt
===================================================================
--- TOOLS/MOSAIX/README.txt	(revision 3666)
+++ TOOLS/MOSAIX/README.txt	(revision 3671)
@@ -12,2 +12,5 @@
 All documentation available at https://forge.ipsl.jussieu.fr/igcmg/wiki/IPSLCM6/MOSAIX
 
+Extraction :
+> svn co http://forge.ipsl.jussieu.fr/igcmg/svn/TOOLS/MOSAIX MOSAIX
+> svn co svn+ssh://omamce@forge.ipsl.jussieu.fr/ipsl/forge/projets/igcmg/svn/TOOLS/MOSAIX MOSAIX
Index: TOOLS/MOSAIX/bld.cfg
===================================================================
--- TOOLS/MOSAIX/bld.cfg	(revision 3666)
+++ TOOLS/MOSAIX/bld.cfg	(revision 3671)
@@ -1,3 +1,10 @@
 # --
+## SVN information
+#  $Author: omamce $
+#  $Date: 2018-03-12 11:17:59 +0100 (Mon, 12 Mar 2018) $
+#  $Revision: 3625 $
+#  $Id: CreateWeightsMask.bash 3625 2018-03-12 10:17:59Z omamce $
+#  $HeadURL: svn+ssh://omamce@forge.ipsl.jussieu.fr/ipsl/forge/projets/igcmg/svn/TOOLS/MOSAIX/CreateWeightsMask.bash $
+#
 
 cfg::type     bld                           
Index: TOOLS/MOSAIX/update_xml.py
===================================================================
--- TOOLS/MOSAIX/update_xml.py	(revision 3666)
+++ TOOLS/MOSAIX/update_xml.py	(revision 3671)
@@ -30,15 +30,15 @@
 def usage () :
     texte = """%(prog)s usage :
-python %(prog)s [-d] [-i iodef.xml] [-o iodef_new.xml] -n [node in Xpath syntax] -k <key>  -v <value>
-python %(prog)s [-d] [-i iodef.xml] [-o iodef_new.xml] -n [node in Xpath syntax] -t <value>
+python %(prog)s [-d] [-i iodef.xml] [-o iodef_new.xml] -n <node in Xpath syntax> -k <key>  -v <value>
+python %(prog)s [-d] [-i iodef.xml] [-o iodef_new.xml] -n <node in Xpath syntax> -t <value>
  -d         | --debug         : debug
- -i <file>  | --input=<file>  : input file  (default iodef.xml)
+ -i <file>  | --input=<file>  : input file  (default: iodef.xml)
  -o <file>  | --output=<file> : output file (default: overwrite input file)
- -n <file>  | --node=<file>   : node in Xpath syntax
+ -n <node>  | --node=<node>   : node in Xpath syntax
  -f <field> | --field=<field> : xml field to update
+ -v <value> | --value=<value> : new value for xml field
  -t <text>  | --text=<text>   : will replace the 'text' part of the Xpath by <text>
- -v <value> | --value=<value> : new value for xml field
 example :  
-    python %(prog)s -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="mask_source"]' -k name  -v maskutil_T
+    python %(prog)s -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="mask_source"]' -k name -v maskutil_T
     """
     #print ( texte % ( sys.argv[0], sys.argv[0], sys.argv[0], sys.argv[0] ) )
@@ -46,10 +46,12 @@
     print ( texte % { 'prog':sys.argv[0] } )
     
-# Check version
-if sys.version_info<(2,7,0):
+# Check version of Python
+Version = sys.version_info
+if Version < (2,7,0) :
   sys.stderr.write ( "You need python 2.7 or later to run this script\n" )
+  sys.stderr.write ( "Present version is: " + str(Version[0]) + "." + str(Version[1]) + "." + str(Version[2]) + "\n" )
   sys.exit (1)
   
-## Input parameters
+## Default input parameters
 FileIn   = 'iodef.xml'
 FileOut  = None
@@ -64,5 +66,5 @@
     myopts, myargs = getopt.getopt ( sys.argv[1:], 'i:o:n:k:v:t:dh', [ 'input=', 'output=', 'node=', 'key=', 'value=', 'text=', 'debug=', '--help' ] )
 except getopt.GetoptError as cmdle :
-    print ( "Command line error :", cmdle, "\n" )
+    print ( "Command line error : "+cmdle )
     usage ()
     sys.exit(1)
@@ -79,25 +81,31 @@
 
 ## Some coherency checking of command line parameters
-if FileOut == None : FileOut = FileIn
+ErrorCount = 0
+
+if FileIn == None :
+    print ( "Error : please specify input file by -i <file>" )
+    ErrorCount += 1
 
 if Node == None :
-    print ( "Error : please specify -n <node>", "\n" )
-    usage ()
-    sys.exit (1)
+    print ( "Error : please specify -n <node>" )
+    ErrorCount += 1
     
 if Key == None and Text == None :
-    print ( "Error : please specify either -t <text> or -k <key> -v <value> ", "\n" )
+    print ( "Error : please specify either -t <text> or -k <key> -v <value>" )
+    ErrorCount += 1
+
+if Key != None and Text != None :
+    print ( "Error : please specify only one option between -t "+Text+" and -k "+Key )
+    ErrorCount += 1
+
+if Key != None and Value == None :
+    print ( "Error : please specify -v <value> when -k "+Key+" is given")
+    ErrorCount += 1
+ 
+if ErrorCount > 0 :
     usage ()
     sys.exit (1)
 
-if Key != None and Text != None :
-    print ( "Error : please specify only one option between -t", Text, "and -k", Key, "\n" )
-    usage ()
-    sys.exit (1)
-
-if Key != None and Value == None :
-    print ( "Error : please specify -v <value> when -k", Key, "is given", "\n")
-    usage ()
-    sys.exit (1)
+if FileOut == None : FileOut = FileIn
     
 ## Get XML tree from input file
@@ -107,14 +115,14 @@
 nodeList = iodef.findall ( Node )
 
-## Check that only one node is found
+## Check that one and only one node is found
 if len(nodeList) == 0 :
     print ( "Error : node not found" )
-    print ( "Node  :", Node )
-    sys.exit(1)
+    print ( "Node  : "+Node )
+    sys.exit (1)
     
 if len(nodeList) > 1 :
-    print ( "Error :", len(nodeList), "occurences of node found" )
-    print ( "Node  :", Node )
-    sys.exit(1)
+    print ( "Error : "+len(nodeList)+" occurences of node found" )
+    print ( "Node  : "+Node )
+    sys.exit (1)
 
 ## Update element
@@ -122,12 +130,12 @@
 
 if Debug :
-    print ( 'Node  :', Node  )
-    print ( 'Key   :', Key   )
-    print ( 'Value :', Value )
+    print ( 'Node  : '+Node  )
+    print ( 'Key   : '+Key   )
+    print ( 'Value : '+Value )
 
 if Text != None :
     if Debug :
-        print ( 'Attributes of node:', elem.attrib )
-        print ( 'Text       :', elem.text   )
+        print ( 'Attributes of node: '+str(elem.attrib) )
+        print ( 'Text              : '+str(elem.text)   )
     elem.text = Text
 
@@ -135,5 +143,5 @@
     # To do : check that Key exist (it is added if not : do we want that ?)
     if Debug :
-        print ( 'Attributes of node:', elem.attrib )
+        print ( 'Attributes of node: '+str(elem.attrib) )
     elem.attrib.update ( { Key:Value } )
     
@@ -143,5 +151,5 @@
 
 ## This is the end
-sys.exit(0)
+sys.exit (0)
     
 ### ===========================================================================
