Index: trunk/SRC/Computation/curl.pro
===================================================================
--- trunk/SRC/Computation/curl.pro	(revision 168)
+++ trunk/SRC/Computation/curl.pro	(revision 226)
@@ -9,16 +9,16 @@
 ; @categories
 ; Calculation
-; 
+;
 ; @param UU
 ; Matrix representing the zonal coordinates (U point) of a field of vectors
 ; A 2D (xy), 3D (xyz or yt) or a structure readable by litchamp and containing
 ; a 2D (xy), 3D (xyz or yt) array (4d case is not coded yet).
-; note that the dimension of the arry must suit the domain dimension.
-;
-; @param VV 
+; note that the dimension of the array must suit the domain dimension.
+;
+; @param VV
 ; Matrix representing the meridional coordinates (V point) of a field of vectors
 ; A 2D (xy), 3D (xyz or yt) or a structure readable by litchamp and containing
 ; a 2D (xy), 3D (xyz or yt) array (4d case is not coded yet).
-; note that the dimension of the arry must suit the domain dimension.
+; note that the dimension of the array must suit the domain dimension.
 ;
 ; @keyword DIREC {type=scalar string}
@@ -30,19 +30,19 @@
 ;
 ; @uses
-; cm_4cal, cm_4data, cm_4mmesh 
+; cm_4cal, cm_4data, cm_4mmesh
 ;
 ; @restrictions
 ;
-; - Works only for Arakawa C-grid. 
+; - Works only for Arakawa C-grid.
 ; - UU must be on U grid, VV must be on V grid
 ; - 4d case is not coded yet
 ; - the common variable jpt is used to differ xyz (jpt=1) and xyt (jpt\=1) cases.
-; - U and V arrays are cut in the same geographic domain. Because of the shift between 
-;   T, U, V and F grids, it is possible that these two arrays do not have the same 
-;   size and refer to different indexes. In this case, arrays are re-cut on 
+; - U and V arrays are cut in the same geographic domain. Because of the shift between
+;   T, U, V and F grids, it is possible that these two arrays do not have the same
+;   size and refer to different indexes. In this case, arrays are re-cut on
 ;   common indexes. To avoid these re-cuts, use the keyword /memeindice in domdef.pro
 ; - When computing the divergence, we update, vargrid, varname, varunits and the
 ;   grid position parameters (firstxf, lastxf, nxf, firstyf, lastyf, nyf).
-; - points that cannot be computed (domain bondaries, coastline) are set to NaN
+; - points that cannot be computed (domain boundaries, coastline) are set to NaN
 ;
 ; @examples
@@ -50,14 +50,14 @@
 ; IDL> plt, curl(dist(jpi,jpj), dist(jpi,jpj))
 ;
-; @history 
+; @history
 ; Guillaume Roullet (grlod\@ipsl.jussieu.fr)
 ; Sebastien Masson (smasson\@lodyc.jussieu.fr)
 ; adaptation to work with a reduce domain
 ; 21/5/1999: missing values at !values.f_nan
-; 
+;
 ; @version
 ; $Id$
 ;
-; @todo 
+; @todo
 ; code the 4d case
 ;-
@@ -71,5 +71,5 @@
 @cm_4cal                        ; for jpt
 @cm_4data                       ; for varname, vargrid, vardate, varunit, valmask
-@cm_4mesh 
+@cm_4mesh
 ;
   tempsun = systime(1)          ; To key_performance
@@ -84,5 +84,5 @@
   szu = size(u)
   szv = size(v)
-  
+
   if szu[0] NE szv[0] then return, report('U and V input data must have the same number of dimensions')
 
@@ -96,5 +96,5 @@
   indiceyv = (lindgen(jpj))[firstyv:firstyv+nyv-1]
   indicey = inter(indiceyu, indiceyv)
-  nx = n_elements(indicex) 
+  nx = n_elements(indicex)
   ny = n_elements(indicey)
   indice2d = lindgen(jpi, jpj)
@@ -105,5 +105,5 @@
   varunits = 's-1'
   if n_elements(valmask) EQ 0 THEN valmask = 1e20
-  firstxt = indicex[0] & lastxt = indicex[0]+nx-1 & nxt = nx 
+  firstxt = indicex[0] & lastxt = indicex[0]+nx-1 & nxt = nx
   firstyt = indicey[0] & lastyt = indicey[0]+ny-1 & nyt = ny
 ;----------------------------------------------------------------------------
@@ -113,5 +113,5 @@
 ;xyz
 ;----------------------------------------------------------------------------
-    szu[0] EQ 3 AND jpt EQ 1:BEGIN 
+    szu[0] EQ 3 AND jpt EQ 1:BEGIN
 ;------------------------------------------------------------
 ; extraction of U and V on the appropriated domain
@@ -119,5 +119,5 @@
       case 1 of
         szu[1] EQ nxu AND szu[2] EQ nyu AND $
-           szv[1] EQ nxv AND szv[2] EQ nyv:BEGIN 
+           szv[1] EQ nxv AND szv[2] EQ nyv:BEGIN
           case 1 of
             nxu NE nx:if indicex[0] EQ firstxu then u = u[0:nx-1, *, *] ELSE u = u[1: nx, *, *]
@@ -129,5 +129,5 @@
         END
         szu[1] EQ jpi AND szu[2] EQ jpj AND $
-           szv[1] EQ jpi AND szv[2] EQ jpj:BEGIN 
+           szv[1] EQ jpi AND szv[2] EQ jpj:BEGIN
           u = u[indicex[0]:indicex[0]+nx-1, indicey[0]:indicey[0]+ny-1, *]
           v = v[indicex[0]:indicex[0]+nx-1, indicey[0]:indicey[0]+ny-1, *]
@@ -142,5 +142,5 @@
       landu = where(coefu EQ 0)
       if landu[0] NE -1 then coefu[temporary(landu)] = !values.f_nan
-      
+
       coefv = ((e2v[indice2d])[*]#replicate(1., nzt)) $
               *(vmask())[indicex[0]:indicex[0]+nx-1, indicey[0]:indicey[0]+ny-1, firstzt:lastzt]
@@ -175,5 +175,5 @@
 ;----------------------------------------------------------------------------
 ;----------------------------------------------------------------------------
-    szu[0] EQ 3 AND jpt GT 1:BEGIN 
+    szu[0] EQ 3 AND jpt GT 1:BEGIN
 ;------------------------------------------------------------
 ; extraction of U and V on the appropriated domain
@@ -181,20 +181,20 @@
       case 1 of
         szu[1] EQ nxu AND szu[2] EQ nyu AND $
-           szv[1] EQ nxv AND szv[2] EQ nyv:BEGIN 
+           szv[1] EQ nxv AND szv[2] EQ nyv:BEGIN
           if nxu NE nx then $
-             if indicex[0] EQ firstxu then u = u[0:nx-1, *, *] ELSE u = u[1: nx, *, *] 
+             if indicex[0] EQ firstxu then u = u[0:nx-1, *, *] ELSE u = u[1: nx, *, *]
           IF nxv NE nx THEN $
              if indicex[0] EQ firstxv then v = v[0:nx-1, *, *] ELSE v = v[1: nx, *, *]
           IF nyu NE ny THEN $
-             if indicey[0] EQ firstyu then u = u[*, 0:ny-1, *] ELSE u = u[*, 1: ny, *] 
+             if indicey[0] EQ firstyu then u = u[*, 0:ny-1, *] ELSE u = u[*, 1: ny, *]
           IF nyv NE ny THEN $
              if indicey[0] EQ firstyv then v = v[*, 0:ny-1, *] ELSE v = v[*, 1: ny, *]
         END
         szu[1] EQ jpi AND szu[2] EQ jpj AND $
-           szv[1] EQ jpi AND szv[2] EQ jpj:BEGIN 
+           szv[1] EQ jpi AND szv[2] EQ jpj:BEGIN
           u = u[indicex[0]:indicex[0]+nx-1, indicey[0]:indicey[0]+ny-1, *]
           v = v[indicex[0]:indicex[0]+nx-1, indicey[0]:indicey[0]+ny-1, *]
         END
-        ELSE:BEGIN 
+        ELSE:BEGIN
           print, 'problemes d''adequation entre la taille du domaine et la taille des matrices necessaires a tracer des vecteurs'
           return, -1
@@ -240,5 +240,5 @@
 ;----------------------------------------------------------------------------
 ;----------------------------------------------------------------------------
-    szu[0] EQ 4:BEGIN 
+    szu[0] EQ 4:BEGIN
       return, report('Case not coded contact saxo team or make a do loop!')
     END
@@ -248,21 +248,21 @@
 ;----------------------------------------------------------------------------
 ;----------------------------------------------------------------------------
-    szu[0] EQ 2:BEGIN 
+    szu[0] EQ 2:BEGIN
 ;------------------------------------------------------------
 ;------------------------------------------------------------
       case 1 of
         szu[1] EQ nxu AND szu[2] EQ nyu AND $
-           szv[1] EQ nxv AND szv[2] EQ nyv:BEGIN 
+           szv[1] EQ nxv AND szv[2] EQ nyv:BEGIN
           if nxu NE nx then $
-             if indicex[0] EQ firstxu then u = u[0:nx-1, *] ELSE u = u[1: nx, *] 
+             if indicex[0] EQ firstxu then u = u[0:nx-1, *] ELSE u = u[1: nx, *]
           IF nxv NE nx THEN $
              if indicex[0] EQ firstxv then v = v[0:nx-1, *] ELSE v = v[1: nx, *]
           IF nyu NE ny THEN $
-             if indicey[0] EQ firstyu then u = u[*, 0:ny-1] ELSE u = u[*, 1: ny] 
+             if indicey[0] EQ firstyu then u = u[*, 0:ny-1] ELSE u = u[*, 1: ny]
           IF nyv NE ny THEN $
              if indicey[0] EQ firstyv then v = v[*, 0:ny-1] ELSE v = v[*, 1: ny]
         END
         szu[1] EQ jpi AND szu[2] EQ jpj AND $
-           szv[1] EQ jpi AND szv[2] EQ jpj:BEGIN 
+           szv[1] EQ jpi AND szv[2] EQ jpj:BEGIN
           u = u[indice2d]
           v = v[indice2d]
@@ -305,5 +305,5 @@
   ENDCASE
 ;------------------------------------------------------------
-  if keyword_set(key_performance) THEN print, 'temps curl', systime(1)-tempsun 
+  if keyword_set(key_performance) THEN print, 'temps curl', systime(1)-tempsun
 
   return, psi
