Index: TOOLS/MOSAIX/Build_coordinates_mask.py
===================================================================
--- TOOLS/MOSAIX/Build_coordinates_mask.py	(revision 6123)
+++ TOOLS/MOSAIX/Build_coordinates_mask.py	(revision 6124)
@@ -17,5 +17,5 @@
 __Revision__ = "$Revision$"
 __Id__       = "$Id$"
-__HeadURL__  = "$HeadURL: http://forge.ipsl.jussieu.fr/igcmg/svn/TOOLS/MOSAIX/Build_coordinates_mask.py $"
+__HeadURL__  = "$HeadURL: $"
 ###
 
@@ -24,5 +24,6 @@
 parser = argparse.ArgumentParser (
     description = """Read coordinates and bathymetry to build masks, grid bounds and areas for MOSAIX""",
-    epilog='-------- End of the help message --------')
+    epilog='-------- End of the help message --------',
+    formatter_class=argparse.ArgumentDefaultsHelpFormatter)
 
 # Adding arguments
@@ -31,5 +32,5 @@
 parser.add_argument ('--coord'   , help='coordinates file name', type=str, default='coordinates.nc' )
 parser.add_argument ('--fout'    , help='output file name (given as an input to MOSAIX)', type=str, default='coordinates_mask.nc' )
-parser.add_argument ('--ocePerio', help='periodicity of ocean grid', type=int, default=0, choices=range(1, 7) )
+parser.add_argument ('--ocePerio', help='periodicity of ocean grid, if not given is imposed according to --model', type=int, default=0, choices=range(1, 7) )
 parser.add_argument ('--nemo4Ubug',help='reproduce NEMO lbc_lnk bug for U grid and periodicity 4', type=bool, default=False, choices=(True, False) )
 parser.add_argument ('--straits' , help='modify grid metrics for selected strait points (depends on model name)', type=bool, default=False, choices=(True, False) )
@@ -99,13 +100,8 @@
 Bathymetry = f_bathy['Bathymetry'].copy()
 
-try :
-    Bathymetry = Bathymetry.rename ({'nav_lat':'nav_lat_grid_T', 'nav_lon':'nav_lon_grid_T'})
-    print ('Bathymetry file: Normal case')
-except : 
-    print ('Bathymetry file: Exception')
-    nav_lon_grid_T = f_bathy ['nav_lon'].data
-    nav_lat_grid_T = f_bathy ['nav_lat'].data
-    Bathymetry = xr.DataArray (Bathymetry, coords = { "nav_lat_grid_T": (["y", "x"], nav_lat_grid_T),
-                                                      "nav_lon_grid_T": (["y", "x"], nav_lon_grid_T) } )
+nav_lon_grid_T = f_bathy['nav_lon'].data
+nav_lat_grid_T = f_bathy['nav_lat'].data
+Bathymetry = xr.DataArray (Bathymetry, coords = { "nav_lat_grid_T": (["y", "x"], nav_lat_grid_T),
+                                                  "nav_lon_grid_T": (["y", "x"], nav_lon_grid_T) } )
     
 Bathymetry = Bathymetry.rename ({'y':'y_grid_T', 'x':'x_grid_T'})
@@ -182,7 +178,7 @@
 # impose or not periodicity on coordinates read from file
         if coordperio :
-            locals()[coord_name] = nemo.lbc (f_coord [dir_name].copy(), nperio=nperio, cd_type=cd_type, nemo_4U_bug=nemoUbug)
+            locals()[coord_name] = nemo.lbc (f_coord[dir_name].copy(), nperio=nperio, cd_type=cd_type, nemo_4U_bug=nemoUbug)
         else :
-            locals()[coord_name] = f_coord [dir_name].copy()
+            locals()[coord_name] = f_coord[dir_name].copy()
 
         locals()[coord_name] = locals()[coord_name].rename( {'y':'y_grid_'+cd_type, 'x':'x_grid_'+cd_type} )
@@ -303,18 +299,18 @@
     if cdgrd in ['T', 'W'] : 
         icnr = -1 ; jcnr = -1
-        corner_lon = f_coord ['glamf'].copy() ; corner_lat = f_coord ['gphif'].copy()
-        center_lon = f_coord ['glamt'].copy() ; center_lat = f_coord ['gphit'].copy()
+        corner_lon = f_coord['glamf'].copy() ; corner_lat = f_coord['gphif'].copy()
+        center_lon = f_coord['glamt'].copy() ; center_lat = f_coord['gphit'].copy()
     if cdgrd == 'U'        : 
         icnr =  0 ; jcnr = -1
-        corner_lon = f_coord ['glamv'].copy() ; corner_lat = f_coord ['gphiv'].copy()
-        center_lon = f_coord ['glamu'].copy() ; center_lat = f_coord ['gphiu'].copy()
+        corner_lon = f_coord['glamv'].copy() ; corner_lat = f_coord['gphiv'].copy()
+        center_lon = f_coord['glamu'].copy() ; center_lat = f_coord['gphiu'].copy()
     if cdgrd == 'V'        : 
         icnr = -1 ; jcnr =  0
-        corner_lon = f_coord ['glamu'].copy() ; corner_lat = f_coord ['gphiu'].copy()
-        center_lon = f_coord ['glamv'].copy() ; center_lat = f_coord ['gphiv'].copy()
+        corner_lon = f_coord['glamu'].copy() ; corner_lat = f_coord['gphiu'].copy()
+        center_lon = f_coord['glamv'].copy() ; center_lat = f_coord['gphiv'].copy()
     if cdgrd == 'F'        : 
         icnr = -1 ; jcnr = -1
-        corner_lon = f_coord ['glamt'].copy() ; corner_lat = f_coord ['gphit'].copy()
-        center_lon = f_coord ['glamf'].copy() ; center_lat = f_coord ['gphif'].copy()
+        corner_lon = f_coord['glamt'].copy() ; corner_lat = f_coord['gphit'].copy()
+        center_lon = f_coord['glamf'].copy() ; center_lat = f_coord['gphif'].copy()
       
     jpj, jpi = corner_lon.shape ;
@@ -369,6 +365,6 @@
         bounds_lon_tmp = np.roll (bounds_lon, shift=-2, axis=2)
         bounds_lat_tmp = np.roll (bounds_lat, shift=-2, axis=2)
-        bounds_lon [0,:,:] = bounds_lon [0,:,:]
-        bounds_lat [0,:,:] = bounds_lat [0,:,:]
+        bounds_lon[0,:,:] = bounds_lon[0,:,:]
+        bounds_lat[0,:,:] = bounds_lat[0,:,:]
     
     #bounds_lon.attrs['coordinates'] = 'nav_lat_grid_' + cdgrd + ' nav_lon_grid_' + cdgrd
