Index: trunk/SRC/Grid/.idlwave_catalog
===================================================================
--- trunk/SRC/Grid/.idlwave_catalog	(revision 72)
+++ trunk/SRC/Grid/.idlwave_catalog	(revision 74)
@@ -2,5 +2,5 @@
 ;; IDLWAVE catalog for library saxo
 ;; Automatically Generated -- do not edit.
-;; Created by idlwave_catalog on Thu May  4 08:42:55 2006
+;; Created by idlwave_catalog on Tue May 23 15:31:07 2006
 ;;
 (setq idlwave-library-catalog-libname "saxo")
Index: trunk/SRC/Grid/computegrid.pro
===================================================================
--- trunk/SRC/Grid/computegrid.pro	(revision 72)
+++ trunk/SRC/Grid/computegrid.pro	(revision 74)
@@ -386,5 +386,5 @@
 ; check the peridicity if iyminmesh and iymaxmesh have the default definitions...
   IF NOT keyword_set(plain) AND key_onearth EQ 1 AND key_stride[1] EQ 1 $
-    AND iyminmesh EQ 0l AND iymaxmesh eq jpjglo-1 AND jpj GE 3 THEN BEGIN
+    AND iyminmesh EQ 0l AND iymaxmesh eq jpjglo-1 AND jpj GE 3 AND jpi GE 2 THEN BEGIN
 
     CASE 1 OF
@@ -581,5 +581,4 @@
     ENDCASE
     glamf = glamt + 0.5 * stepxf
-    IF jpj EQ 1 THEN glamf = reform(glamf, jpi, jpj, /over)
   ENDIF ELSE glamf = glamt + 0.5
 ;
@@ -590,4 +589,6 @@
     ENDIF ELSE glamf = glamboundary[0] > temporary(glamf) < glamboundary[1]
   ENDIF
+;
+  IF jpj EQ 1 THEN glamf = reform(glamf, jpi, jpj, /over)
 ;
 ;====================================================
@@ -614,4 +615,6 @@
   IF key_onearth THEN gphif = -90. > gphif < 90.
 ;
+  IF jpj EQ 1 THEN gphif = reform(gphif, jpi, jpj, /over)
+;
 ;====================================================
 ; e1t: x distance between U(i-1,j) and U(i,j)
@@ -638,7 +641,8 @@
       IF NOT keyword_set(key_periodic) THEN $
         e1t[0, *] = e1t[1, *] 
-      IF jpj EQ 1 THEN e1t = reform(e1t, jpi, jpj, /over)
     ENDIF ELSE e1t = replicate(stepx, jpi, jpj)
   ENDIF ELSE e1t = replicate(1b, jpi, jpj)
+;
+  IF jpj EQ 1 THEN e1t = reform(e1t, jpi, jpj, /over)
 ;
 ;====================================================
@@ -660,4 +664,6 @@
   IF key_onearth THEN e2t = r * !pi/180. * temporary(e2t)
 ;
+  IF jpj EQ 1 THEN e2t = reform(e2t, jpi, jpj, /over)
+;
 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   IF keyword_set(fullcgrid) THEN BEGIN
@@ -672,4 +678,6 @@
         glamu = glamboundary[0] > temporary(glamu) < glamboundary[1]
     ENDIF ELSE glamu = glamf
+;
+    IF jpj EQ 1 THEN glamu = reform(glamu, jpi, jpj, /over)
 ;
 ;====================================================
@@ -684,8 +692,9 @@
           stepyu[jpi-1, *] = stepyu[jpi-2, *]
         gphiu = gphit + 0.5 * stepyu
-        IF jpj EQ 1 THEN gphiu = reform(gphiu, jpi, jpj, /over)
       ENDIF ELSE gphiu = gphit
     ENDIF ELSE gphiu = gphit
   IF key_onearth THEN gphiu = -90. > gphiu < 90.
+;
+  IF jpj EQ 1 THEN gphiu = reform(gphiu, jpi, jpj, /over)
 ;
 ;====================================================
@@ -718,4 +727,6 @@
     IF key_onearth THEN gphiv = -90. > gphiv < 90.
 ;
+    IF jpj EQ 1 THEN gphiv = reform(gphiv, jpi, jpj, /over)
+;
 ;====================================================
 ; e1u: x distance between T(i,j) and T(i+1,j)
@@ -734,4 +745,6 @@
       IF key_onearth THEN e2u = r * !pi/180. * temporary(e2u)
     ENDIF ELSE e2u = e2t
+;
+    IF jpj EQ 1 THEN e2u = reform(e2u, jpi, jpj, /over)
 ;
 ;====================================================
@@ -751,4 +764,6 @@
     ENDIF ELSE e1v = e1t 
 ;
+    IF jpj EQ 1 THEN e1v = reform(e1v, jpi, jpj, /over)
+;
 ;====================================================
 ; e2v: y distance between T(i,j) and T(i+1,j)
@@ -776,4 +791,6 @@
     ENDIF ELSE e1f = e1u
 ;
+    IF jpj EQ 1 THEN e1f = reform(e1f, jpi, jpj, /over)
+;
 ;====================================================
 ; e2f: y distance between U(i,j) and U(i,j+1)
@@ -785,4 +802,6 @@
       IF key_onearth THEN e2f = r * !pi/180. * temporary(e2f)
     ENDIF ELSE e2f = e2v
+;
+    IF jpj EQ 1 THEN e2f = reform(e2f, jpi, jpj, /over)
 ;
   ENDIF
@@ -802,4 +821,13 @@
     ENDIF
   ENDIF
+;
+  IF jpj EQ 1 THEN BEGIN 
+    e1t = reform(e1t, jpi, jpj, /over)
+    IF keyword_set(fullcgrid) THEN BEGIN
+      e1u = reform(e1u, jpi, jpj, /over)
+      e1v = reform(e1v, jpi, jpj, /over)
+      e1f = reform(e1f, jpi, jpj, /over)
+    ENDIF  
+  ENDIF  
 ;
 ;====================================================
@@ -953,37 +981,45 @@
     e3w = e3w[0:*:stride[2]]
 ; we must recompute glamf and gphif...
-   IF jpi GT 1 THEN BEGIN 
-     if (keyword_set(key_onearth) AND keyword_set(xnotsorted)) $
-       OR (keyword_set(key_periodic) AND key_irregular) then BEGIN
-       stepxf = (glamt + 720) MOD 360
-       stepxf = shift(stepxf, -1, -1) - stepxf
-       stepxf = [ [[stepxf]], [[stepxf + 360]], [[stepxf - 360]] ]
-       stepxf = min(abs(stepxf), dimension = 3)
-       IF NOT keyword_set(key_periodic) THEN $
-         stepxf[jpi-1, *] = stepxf[jpi-2, *]
-     ENDIF ELSE BEGIN
-       stepxf = shift(glamt, -1, -1) - glamt
-       IF keyword_set(key_periodic) THEN $
-         stepxf[jpi-1, *] = 360 + stepxf[jpi-1, *] $
-       ELSE stepxf[jpi-1, *] = stepxf[jpi-2, *]
-     ENDELSE
-     IF jpj GT 1 THEN BEGIN 
-       stepxf[*, jpj-1] = stepxf[*, jpj-2]
-       stepxf[jpi-1, jpj-1] = stepxf[jpi-2, jpj-2]
-     ENDIF
-     glamf = glamt + 0.5 * stepxf
-     IF jpj EQ 1 THEN glamf = reform(glamf, jpi, jpj, /over)
-   ENDIF ELSE glamf = glamt + 0.5
-   IF jpj GT 1 THEN BEGIN 
+    IF jpi GT 1 THEN BEGIN 
+      if (keyword_set(key_onearth) AND keyword_set(xnotsorted)) $
+        OR (keyword_set(key_periodic) AND key_irregular) then BEGIN
+        stepxf = (glamt + 720) MOD 360
+        stepxf = shift(stepxf, -1, -1) - stepxf
+        stepxf = [ [[stepxf]], [[stepxf + 360]], [[stepxf - 360]] ]
+        stepxf = min(abs(stepxf), dimension = 3)
+        IF NOT keyword_set(key_periodic) THEN $
+          stepxf[jpi-1, *] = stepxf[jpi-2, *]
+      ENDIF ELSE BEGIN
+        stepxf = shift(glamt, -1, -1) - glamt
+        IF keyword_set(key_periodic) THEN $
+          stepxf[jpi-1, *] = 360 + stepxf[jpi-1, *] $
+          ELSE stepxf[jpi-1, *] = stepxf[jpi-2, *]
+      ENDELSE
+      IF jpj GT 1 THEN BEGIN 
+        stepxf[*, jpj-1] = stepxf[*, jpj-2]
+        stepxf[jpi-1, jpj-1] = stepxf[jpi-2, jpj-2]
+      ENDIF
+      glamf = glamt + 0.5 * stepxf
+    ENDIF ELSE glamf = glamt + 0.5
+    IF jpj GT 1 THEN BEGIN 
 ; we must compute stepyf: y distance between T(i,j) T(i+1,j+1)
-     stepyf = shift(gphit, -1, -1) - gphit
-     stepyf[*, jpj-1] = stepyf[*, jpj-2]
-     IF jpi GT 1 THEN BEGIN
-       if NOT keyword_set(key_periodic) THEN $
-         stepyf[jpi-1, *] = stepyf[jpi-2, *]
-       stepyf[jpi-1, jpj-1] = stepyf[jpi-2, jpj-2]
-     ENDIF 
-     gphif = gphit + 0.5 * stepyf
-   ENDIF ELSE gphif = gphit + 0.5
+      stepyf = shift(gphit, -1, -1) - gphit
+      stepyf[*, jpj-1] = stepyf[*, jpj-2]
+      IF jpi GT 1 THEN BEGIN
+        if NOT keyword_set(key_periodic) THEN $
+          stepyf[jpi-1, *] = stepyf[jpi-2, *]
+        stepyf[jpi-1, jpj-1] = stepyf[jpi-2, jpj-2]
+      ENDIF 
+      gphif = gphit + 0.5 * stepyf
+    ENDIF ELSE gphif = gphit + 0.5
+;
+    IF jpj EQ 1 THEN BEGIN 
+      glamt = reform(glamt, jpi, jpj, /over)
+      gphit = reform(gphit, jpi, jpj, /over)
+      glamf = reform(glamf, jpi, jpj, /over)
+      gphif = reform(gphif, jpi, jpj, /over)
+      e1t = reform(e1t, jpi, jpj, /over)
+      e2t = reform(e2t, jpi, jpj, /over)
+    ENDIF
 ;
     IF keyword_set(fullcgrid) THEN BEGIN
@@ -1002,4 +1038,16 @@
       fmaskredy = (temporary(fmaskredy))[0, 0:*:stride[1], 0:*:stride[2]]
       fmaskredx = (temporary(fmaskredx))[0:*:stride[0], 0, 0:*:stride[2]]
+      IF jpj EQ 1 THEN BEGIN 
+        glamu = reform(glamu, jpi, jpj, /over)
+        gphiu = reform(gphiu, jpi, jpj, /over)
+        e1u = reform(e1u, jpi, jpj, /over)
+        e2u = reform(e2u, jpi, jpj, /over)
+        glamv = reform(glamv, jpi, jpj, /over)
+        gphiv = reform(gphiv, jpi, jpj, /over)
+        e1v = reform(e1v, jpi, jpj, /over)
+        e2v = reform(e2v, jpi, jpj, /over)
+        e1f = reform(e1f, jpi, jpj, /over)
+        e2f = reform(e2f, jpi, jpj, /over)
+      ENDIF
     ENDIF
   ENDIF
@@ -1044,11 +1092,16 @@
     ELSE strcalling = ccmeshparameters.filename
   ENDIF
-  glaminfo = moment(glamt)
-  IF finite(glaminfo[2]) EQ 0 THEN glaminfo = glaminfo[0:1]
-  gphiinfo = moment(gphit)
-  IF finite(gphiinfo[2]) EQ 0 THEN gphiinfo = gphiinfo[0:1]
+  IF n_elements(glamt) GE 2 THEN BEGIN
+    glaminfo = moment(glamt)
+    IF finite(glaminfo[2]) EQ 0 THEN glaminfo = glaminfo[0:1]
+    gphiinfo = moment(gphit)
+    IF finite(gphiinfo[2]) EQ 0 THEN gphiinfo = gphiinfo[0:1]
+  ENDIF ELSE BEGIN 
+    glaminfo = glamt
+    gphiinfo = gphit
+  ENDELSE 
   ccmeshparameters = {filename:strcalling  $
-          , glaminfo:glaminfo $
-          , gphiinfo:gphiinfo $
+          , glaminfo:float(string(glaminfo, format = '(E11.4)')) $
+          , gphiinfo:float(string(gphiinfo, format = '(E11.4)')) $
           , jpiglo:jpiglo, jpjglo:jpjglo, jpkglo:jpkglo $
           , jpi:jpi, jpj:jpj, jpk:jpk $
Index: trunk/SRC/Grid/ncdf_meshread.pro
===================================================================
--- trunk/SRC/Grid/ncdf_meshread.pro	(revision 72)
+++ trunk/SRC/Grid/ncdf_meshread.pro	(revision 74)
@@ -335,5 +335,4 @@
       ENDIF
       glamf = glamt + 0.5 * stepxf
-      IF jpj EQ 1 THEN glamf = reform(glamf, jpi, jpj, /over)
     ENDIF ELSE glamf = glamt + 0.5
     IF jpj GT 1 THEN BEGIN 
@@ -529,4 +528,31 @@
   endif
 ;-------------------------------------------------------
+; make sure we do have 2d arrays when jpj eq 1
+;-------------------------------------------------------
+  IF jpj EQ 1 THEN BEGIN 
+    glamt = reform(glamt, jpi, jpj, /over)
+    gphit = reform(gphit, jpi, jpj, /over)
+    e1t = reform(e1t, jpi, jpj, /over)
+    e2t = reform(e2t, jpi, jpj, /over)
+    glamu = reform(glamu, jpi, jpj, /over)
+    gphiu = reform(gphiu, jpi, jpj, /over)
+    e1u = reform(e1u, jpi, jpj, /over)
+    e2u = reform(e2u, jpi, jpj, /over)
+    glamv = reform(glamv, jpi, jpj, /over)
+    gphiv = reform(gphiv, jpi, jpj, /over)
+    e1v = reform(e1v, jpi, jpj, /over)
+    e2v = reform(e2v, jpi, jpj, /over)
+    glamf = reform(glamf, jpi, jpj, /over)
+    gphif = reform(gphif, jpi, jpj, /over)
+    e1f = reform(e1f, jpi, jpj, /over)
+    e2f = reform(e2f, jpi, jpj, /over)
+    IF keyword_set(key_partialstep) THEN BEGIN
+      hdept = reform(hdept, jpi, jpj, /over)
+      hdepw = reform(hdepw, jpi, jpj, /over)
+      e3t_ps = reform(e3t_ps, jpi, jpj, /over)
+      e3w_ps = reform(e3w_ps, jpi, jpj, /over)
+    ENDIF 
+  ENDIF
+;-------------------------------------------------------
   ixmindta = ixmindtasauve
   iymindta = iymindtasauve
@@ -547,11 +573,16 @@
     ELSE strcalling = ccmeshparameters.filename
   ENDIF 
-  glaminfo = moment(glamt)
-  IF finite(glaminfo[2]) EQ 0 THEN glaminfo = glaminfo[0:1]
-  gphiinfo = moment(gphit)
-  IF finite(gphiinfo[2]) EQ 0 THEN gphiinfo = gphiinfo[0:1]
+  IF n_elements(glamt) GE 2 THEN BEGIN
+    glaminfo = moment(glamt)
+    IF finite(glaminfo[2]) EQ 0 THEN glaminfo = glaminfo[0:1]
+    gphiinfo = moment(gphit)
+    IF finite(gphiinfo[2]) EQ 0 THEN gphiinfo = gphiinfo[0:1]
+  ENDIF ELSE BEGIN 
+    glaminfo = glamt
+    gphiinfo = gphit
+  ENDELSE 
   ccmeshparameters = {filename:strcalling  $
-          , glaminfo:glaminfo $
-          , gphiinfo:gphiinfo $
+          , glaminfo:float(string(glaminfo, format = '(E11.4)')) $
+          , gphiinfo:float(string(gphiinfo, format = '(E11.4)')) $
           , jpiglo:jpiglo, jpjglo:jpjglo, jpkglo:jpkglo $
           , jpi:jpi, jpj:jpj, jpk:jpk $
