Index: /trunk/SRC/Postscript/printps.pro
===================================================================
--- /trunk/SRC/Postscript/printps.pro	(revision 218)
+++ /trunk/SRC/Postscript/printps.pro	(revision 219)
@@ -105,11 +105,8 @@
 ; call the viewers
       CASE event.value OF
-        'GNU Ghostview':cmd = '\gv --media='+papsize+' --orientation='+ori+' '+uval.nameps
-        'Gnome Ghostview':cmd = '\ggv '+uval.nameps
-        'Ghostview':cmd = '\ghostview -'+papsize+' -quiet -'+ori+' '+uval.nameps
-        'Ghostscript':cmd = '\gs -sPAPERSIZE='+papsize+' -q '+uval.nameps
-        'Kghostview':cmd = '\kghostview '+uval.nameps
+        'Ghostview':spawn, '\ghostview -'+papsize+' -quiet -'+ori+' '+uval.nameps
+        'Ghostscript':spawn, '\gs -sPAPERSIZE='+papsize+' -q '+uval.nameps
+        'Kghostview':spawn, '\kghostview '+uval.nameps
       ENDCASE
-      spawn, cmd
       return
     END
@@ -279,8 +276,4 @@
 ; ps viewers grouped button
   psviewers = ['no psviewers found']
-  IF file_which(getenv('PATH'), 'gv') NE '' THEN $
-    psviewers = [psviewers, 'GNU Ghostview']
-  IF file_which(getenv('PATH'), 'ggv') NE '' THEN $
-    psviewers = [psviewers, 'Gnome Ghostview']
   IF file_which(getenv('PATH'), 'ghostview') NE '' THEN $
     psviewers = [psviewers, 'Ghostview']
Index: /trunk/SRC/ToBeReviewed/INIT/initncdf.pro
===================================================================
--- /trunk/SRC/ToBeReviewed/INIT/initncdf.pro	(revision 218)
+++ /trunk/SRC/ToBeReviewed/INIT/initncdf.pro	(revision 219)
@@ -28,5 +28,5 @@
 ; @keyword START1 {default=0}{type=scalar: 0 or 1}
 ; Index the axis from 1 instead of 0 when using
-; /xyindex and/or /zindex
+; /xyindex and/or zindex
 ;
 ; @keyword USEASMASK {type=scalar string}
@@ -39,4 +39,12 @@
 ;    3 NaN values if existing
 ;
+; @keyword XAXISNAME {default='x', 'longitude', 'nav_lon', 'lon', 'lon_rho' or 'NbLongitudes'}{type=scalar string}
+; A string giving the name of the variable in the file 
+; that contains the [xyz]axis. 
+;      
+; @keyword YAXISNAME {default='y', 'latitude', 'nav_lat','lat', 'lat_rho' or 'NbLatitudes'}{type=scalar string}
+; A string giving the name of the variable in the file 
+; that contains the [xyz]axis. 
+;
 ; @keyword ZAXISNAME {default='z', 'level', 'lev', 'depth...'}{type=scalar string}
 ; A string giving the name of the variable in the file 
@@ -55,5 +63,5 @@
 ; 
 ; @keyword _EXTRA
-; Used to pass keywords to computegrid and ncdf_getaxis
+; Used to pass keywords to computegrid
 ;
 ; @uses
@@ -80,5 +88,5 @@
 ;------------------------------------------------------------
 ;------------------------------------------------------------
-PRO initncdf, ncfilein $
+PRO initncdf, ncfilein, XAXISNAME = xaxisname, YAXISNAME = yaxisname $
               , ZAXISNAME = zaxisname, MASKNAME = maskname $
               , INVMASK = invmask, USEASMASK = useasmask $
@@ -105,11 +113,4 @@
 ; what is inside the file
   inside = ncdf_inquire(cdfid)
-;------------------------------------------------------------
-; name of all dimensions
-  namedim = strarr(inside.ndims)
-  for dimiq = 0, inside.ndims-1 do begin
-    ncdf_diminq, cdfid, dimiq, tmpname, value 
-    namedim[dimiq] = strlowcase(tmpname)
-  ENDFOR
 ;----------------------------------------------------------
 ; name of the variables
@@ -120,7 +121,59 @@
   ENDFOR
 ;----------------------------------------------------------
-; find the x/yaxis
- ncdf_getaxis, cdfid, dimidx, dimidy, xaxis, yaxis $
-               , START1 = start1, XYINDEX = xyindex, ROMSGRID = romsgrid, _extra = ex
+; find the xaxis
+  if keyword_set(xaxisname) then xaxisname = strlowcase(xaxisname) ELSE xaxisname = 'x'
+  xvarid = (where(namevar EQ xaxisname OR namevar EQ 'longitude' $
+                  OR namevar EQ 'nav_lon' OR namevar EQ 'lon' $
+                  OR namevar EQ 'lon_rho' OR namevar EQ 'nblongitudes'))[0]
+  if xvarid EQ -1 then begin
+    print, 'the xaxis was not found, check the use of XAXISNAME keyword'
+    stop
+  endif
+  romsgrid = strmid(namevar[xvarid], 0, 4) EQ 'lon_'
+; get the size of xaxis
+  xinq = ncdf_varinq(cdfid, xvarid)
+  ncdf_diminq, cdfid, xinq.dim[0], blabla, jpifromx
+; should we read or compute the xaxis?
+  IF NOT keyword_set(xyindex) THEN BEGIN
+; read the xaxis
+    ncdf_varget, cdfid, xvarid, xaxis
+; make sure of the shape of xaxis
+    IF xinq.ndims GE 2 THEN BEGIN
+      ncdf_diminq, cdfid, xinq.dim[1], blabla, jpjfromx
+      xaxis = reform(xaxis, jpifromx, jpjfromx, /over)
+    ENDIF
+  ENDIF ELSE xaxis = keyword_set(start1) + findgen(jpifromx)
+;----------------------------------------------------------
+; find the yaxis
+  if keyword_set(yaxisname) then yaxisname = strlowcase(yaxisname) ELSE yaxisname = 'y'
+  yvarid = (where(namevar EQ yaxisname OR namevar EQ 'latitude' $
+                  OR namevar EQ 'nav_lat' OR namevar EQ 'lat' $
+                  OR namevar EQ 'lat_rho' OR namevar EQ 'nblatitudes'))[0]
+  yvarid = yvarid[0]
+  if yvarid EQ -1 then begin
+    print, 'the yaxis was not found, check the use of YAXISNAME keyword'
+    stop
+  endif
+; get the size of yaxis and check it is ok with the values found for x
+  yinq = ncdf_varinq(cdfid, yvarid)
+  IF xinq.ndims GE 2 THEN BEGIN
+    ncdf_diminq, cdfid, yinq.dim[0], blabla, jpifromy
+    ncdf_diminq, cdfid, yinq.dim[1], blabla, jpjfromy
+    IF jpifromy NE jpifromx THEN BEGIN 
+      print, 'xaxis and y axis do not have the same x dimension...'
+    ENDIF
+  ENDIF ELSE ncdf_diminq, cdfid, yinq.dim[0], blabla, jpjfromy
+  IF n_elements(jpjfromx) NE 0 THEN BEGIN
+    IF jpjfromy NE jpjfromx THEN BEGIN 
+      print, 'xaxis and y axis do not have the same y dimension...'
+    ENDIF    
+  ENDIF
+; should we read or compute the xaxis?
+  IF NOT keyword_set(xyindex) THEN BEGIN
+; read the yaxis
+    ncdf_varget, cdfid, yvarid, yaxis
+; make sure of the shape of xaxis
+    IF xinq.ndims GE 2 THEN yaxis = reform(yaxis, jpifromy, jpjfromy, /over)
+  ENDIF ELSE yaxis = keyword_set(start1) + findgen(jpjfromy)
 ;----------------------------------------------------------
 ; find the zaxis
Index: /trunk/SRC/ToBeReviewed/POSTSCRIPT/calibre.pro
===================================================================
--- /trunk/SRC/ToBeReviewed/POSTSCRIPT/calibre.pro	(revision 218)
+++ /trunk/SRC/ToBeReviewed/POSTSCRIPT/calibre.pro	(revision 219)
@@ -98,5 +98,4 @@
 ;------------------------------------------------------------
    tempsun = systime(1)         ; For key_performance
-;
 ;-------------------------------------------------------------
    if keyword_set(portrait) then key_portrait=1
@@ -121,9 +120,5 @@
 ; If smalldraw is count like in matlab
 ;-------------------------------------------------------------
-   if n_elements(smalldraw) EQ 3  then BEGIN
-     IF smalldraw[2] LT 1 OR smalldraw[2] GT smalldraw[0]*smalldraw[1] THEN BEGIN
-       dummy = report('wrong definition of the small keyword, we stop')
-       stop
-     ENDIF
+   if n_elements(smalldraw) EQ 3  then begin
       if n_elements(page_margins) EQ 0 then page_margins = [1, 1, 1, 1]
       smalldraw = long(smalldraw)
Index: /trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/scanfile.pro
===================================================================
--- /trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/scanfile.pro	(revision 218)
+++ /trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/scanfile.pro	(revision 219)
@@ -9,9 +9,9 @@
 ;
 ; 
-; @keyword GRID {default='T'}{type=scalar string}
-; Used to specify on which grid type are located the data
+; @keyword GRID
+;
 ;
 ; @keyword _EXTRA
-; Used to pass your keywords to isafile and ncdf_getaxis
+; Used to pass your keywords
 ; 
 ; @returns
@@ -76,8 +76,9 @@
 @common
 ;------------------------------------------------------------
+  res = -1
+;------------------------------------------------------------
 ; filename
 ;------------------------------------------------------------
   fullname = isafile(filename = namefile, IODIRECTORY = iodir, _extra = ex)
-  IF size(fullname, /type) NE 7 THEN return, -1
 ;------------------------------------------------------------
 ; open file
@@ -87,27 +88,77 @@
 ; What contains the file?
 ;------------------------------------------------------------
-  inside = ncdf_inquire(cdfid)  ;
+  infile = ncdf_inquire(cdfid)  ;
 ;------------------------------------------------------------
 ; name of all dimensions
 ;------------------------------------------------------------
-  namedim = strarr(inside.ndims)
-  for dimiq = 0, inside.ndims-1 do begin
+  namedim = strarr(infile.ndims)
+  for dimiq = 0, infile.ndims-1 do begin
     ncdf_diminq, cdfid, dimiq, tmpname, value 
     namedim[dimiq] = strlowcase(tmpname)
   ENDFOR
-;------------------------------------------------------------
-; x/y dimensions id
-;------------------------------------------------------------
-  ncdf_getaxis, cdfid, dimidx, dimidy, _extra = ex
+; roms file?
+  dimidx = where(namedim EQ 'xi_rho' OR namedim EQ 'xi_u' OR namedim EQ 'xi_v' OR namedim EQ 'xi_psi')
+  IF dimidx[0] EQ -1 THEN BEGIN
+; we are looking for a x dimension with a name matching one of the following regular expression:
+    testname = ['longitude', 'lon', 'x', 'longitude*', 'lon*', 'x*', '*longitude*', '*lon*', '*x*']
+    cnt = -1
+    ii = 0
+    WHILE cnt NE 1 AND ii LT n_elements(testname) DO BEGIN
+      dimidx = where(strmatch(namedim, testname[ii]) EQ 1, cnt)
+      ii = ii+1
+    ENDWHILE
+    CASE cnt OF
+      0:begin
+        dummy = report(['none of the dimensions name matches one of the following regular expression:' $
+                        , '''longitude'', ''lon'', ''x'', ''longitude*'', ''lon*'', ''x*'', ''*longitude*'', ''*lon*'', ''*x*''' $
+                        , ' => we cannot find the x dimension'])
+        stop
+      END
+      1:dimidx = dimidx[0]
+      ELSE:begin
+        dummy = report(['several (and not one unique) dimensions name matches the following regular expression:' $
+                        , '''longitude'', ''lon'', ''x'', ''longitude*'', ''lon*'', ''x*'', ''*longitude*'', ''*lon*'', ''*x*''' $
+                        , ' => we cannot find the x dimension'])
+        stop
+      ENDELSE
+    ENDCASE
+  ENDIF
+; roms file?
+  dimidy = where(namedim EQ 'eta_rho' OR namedim EQ 'eta_u' OR namedim EQ 'eta_v' OR namedim EQ 'eta_psi')
+  IF dimidy[0] EQ -1 THEN BEGIN
+; we are looking for a y dimension with a name matching one of the following regular expression:
+    testname = ['latitude', 'lat', 'y', 'latitude*', 'lat*', 'y*', 'eta_*', '*latitude*', '*lat*', '*y*']
+    cnt = -1
+    ii = 0
+    WHILE cnt NE 1 AND ii LT n_elements(testname) DO BEGIN
+      dimidy = where(strmatch(namedim, testname[ii]) EQ 1, cnt)
+      ii = ii+1
+    ENDWHILE
+    CASE cnt OF
+      0:begin
+        dummy = report(['none of the dimensions name matches one of the following regular expression:' $
+                        , '''latitude'', ''lat'', ''y'', ''latitude*'', ''lat*'', ''y*'', ''eta_*'', ''*latitude*'', ''*lat*'', ''*y*''' $
+                        , ' => we cannot find the y dimension'])
+        stop
+      END
+      1:dimidy = dimidy[0]
+      ELSE:begin
+        dummy = report(['several (and not one unique) dimensions name matches the following regular expression:' $
+                        , '''latitude'', ''lat'', ''y'', ''latitude*'', ''lat*'', ''y*'', ''eta_*'', ''*latitude*'', ''*lat*'', ''*y*''' $
+                        , ' => we cannot find the x dimension'])
+        stop
+      ENDELSE
+    ENDCASE
+  ENDIF
 ;------------------------------------------------------------
 ; name of all variables
 ;------------------------------------------------------------
 ; we keep only the variables containing at least x, y and time dimension (if existing...)
-  namevar = strarr(inside.nvars)
-  for varid = 0, inside.nvars-1 do begin
+  namevar = strarr(infile.nvars)
+  for varid = 0, infile.nvars-1 do begin
     invar = ncdf_varinq(cdfid, varid) ; what contains the variable?
     if (inter(invar.dim, dimidx))[0] NE -1 AND $
        (inter(invar.dim, dimidy))[0] NE -1 AND $
-       ((where(invar.dim EQ inside.recdim))[0] NE -1 OR inside.recdim EQ -1) $
+       ((where(invar.dim EQ infile.recdim))[0] NE -1 OR infile.recdim EQ -1) $
     THEN namevar[varid] = invar.name 
   ENDFOR
@@ -159,19 +210,19 @@
 ;------------------------------------------------------------
   date0fk = date2jul(19000101)
-  IF inside.recdim EQ -1 THEN BEGIN 
+  IF infile.recdim EQ -1 THEN BEGIN 
     jpt = 1
     time = date0fk
     fakecal = 1
   ENDIF ELSE BEGIN
-    ncdf_diminq, cdfid, inside.recdim, timedimname, jpt
+    ncdf_diminq, cdfid, infile.recdim, timedimname, jpt
 ; we look for the variable containing the time axis
-; we look for the first variable having for only dimension inside.recdim
+; we look for the first variable having for only dimension infile.recdim
     varid = 0
     repeat BEGIN
-      IF varid LT inside.nvars THEN BEGIN
+      IF varid LT infile.nvars THEN BEGIN
         invar = ncdf_varinq(cdfid, varid) 
         varid = varid+1        
       ENDIF ELSE varid = 0
-    endrep until (n_elements(invar.dim) EQ 1 AND invar.dim[0] EQ inside.recdim) OR (varid EQ 0)
+    endrep until (n_elements(invar.dim) EQ 1 AND invar.dim[0] EQ infile.recdim) OR (varid EQ 0)
     varid = varid-1
 ;
