Index: trunk/ToBeReviewed/PLOTS/legende.pro
===================================================================
--- trunk/PLOTS/legende.pro	(revision 2)
+++ trunk/ToBeReviewed/PLOTS/legende.pro	(revision 42)
@@ -45,82 +45,46 @@
 pro legende,mi,ma,coupe,CONTOUR = contour,ENDPOINTS = endpoints, DIREC = direc $
             , VECTLEGENDE = vectlegende $
-            , INTERVALLE = intervalle, YZ_TYPE = yz_type, VARNAME2 = varname2 $
+            , INTERVALLE = intervalle, TYPE_YZ = type_yz, VARNAME2 = varname2 $
             , NPTS = npts, _EXTRA = ex
 @common
    tempsun = systime(1)         ; pour key_performance
 ;------------------------------------------------------------
-   grille, mask, glam, gphi, gdep, nx, ny, nz & mask = 1
-;
-; choose langage
-;
-   if n_elements(langage) EQ 0 then langage = 'non definit'
-   CASE langage OF
-      'gb': BEGIN
+   grille, -1, -1, -1, gdep, nx, ny, nz
 ;
 ; English legends
 ;
-         fmt_mm = '(f12.2)'
-         fmt_bt = '(f7.1)'
-         colorf = ''
-         contourf = 'Contour plot,'
-         vecteurf = 'Vector norm  '
-         expf = ''
-         datef = '   '
-         fieldf = '   '
-         depthf = '   '
-         endpointsf = 'Diag. Section'
-         zonalf = ''
-         latintf = 'latitudes in '
-         timintf = 'time in '
-         onf = ' - '
-         depthf2 = 'Depth (m)'
-         Meridf = 'Zonal Mean  '
-         lonintf = 'longitudes in '
-         hovxt = 'XT-plot   '
-         diaghovxt = 'Diag. XT-plot   '
-         depintf = 'depths in '
-         timef = 'Time'
-         hovyt = 'YT-plot   '
-         diaghovyt = 'Diag. YT-plot   '
-         hovzt = 'ZT-plot   '
-         hovt = ''
-      END 
-;
-; Legendes en francais
-;
-      ELSE: BEGIN 
-         fmt_mm = '(f12.2)'
-         fmt_bt = '(f7.1)'
-         colorf = 'Champ en couleur '
-         contourf = 'Champ en trace noir '
-         vecteurf = 'Norme vecteur '
-         expf = 'exp: '
-         datef = ', date: '
-         fieldf = ', champ: '
-         depthf = ', profondeur: '
-         endpointsf = 'Diag. Section, exp: '
-         zonalf = 'Coupe Zonale, exp: '
-         latintf = 'latitude in '
-         timintf = 'time in '
-         onf = ' - '
-         depthf2 = 'Profondeur (m)'
-         meridf = 'Coupe Meridienne, exp: '
-         lonintf = 'longitude in '
-         hovxt = 'Trace Longitude-Temps, exp: '
-         diaghovxt = 'Trace Diag. Longitude-Temps, exp: '
-         depintf = 'profondeur in '
-         timef = 'Temps'
-         hovyt = 'Trace Latitude-Temps, exp: '
-         diaghovyt = 'Trace Diag. Latitude-Temps, exp: '
-         hovzt = 'Trace Profondeur-Temps, exp: '
-         hovt = 'Evolution Temporelle, exp: '
-      END
-
-   ENDCASE 
+   fmt_mm = '(f12.2)'
+   fmt_bt = '(f7.1)'
+   colorf = ''
+   contourf = 'Contour plot,'
+   vecteurf = 'Vector norm  '
+   expf = ''
+   datef = '   '
+   fieldf = '   '
+   depthf = '   '
+   endpointsf = 'Diag. Section'
+   zonalf = ''
+   IF key_onearth THEN latintf = 'latitudes in ' ELSE latintf = 'j index in '
+   timintf = 'time in '
+   onf = ' - '
+   depthf2 = 'Depth (m)'
+   Meridf = 'Zonal Mean  '
+   IF key_onearth THEN lonintf = 'longitudes in ' ELSE lonintf = 'i in '
+   hovxt = 'XT-plot   '
+   diaghovxt = 'Diag. XT-plot   '
+   depintf = 'depths in '
+   timef = 'Time'
+   hovyt = 'YT-plot   '
+   diaghovyt = 'Diag. YT-plot   '
+   hovzt = 'ZT-plot   '
+   hovt = ''
+   IF key_onearth THEN lontitle = 'Longitude' ELSE lontitle = 'i index'
+   IF key_onearth THEN lattitle = 'Latitude' ELSE lattitle = 'j index'
+   
    vertz = depthf2
    legniv = ' m'
-   IF keyword_set(YZ_TYPE) THEN BEGIN
-      IF yz_type EQ 'hPa' THEN vertz = 'hPa' 
-      IF yz_type EQ 'hPa' THEN legniv = ' hPa' 
+   IF keyword_set(TYPE_YZ) THEN BEGIN
+     IF type_yz EQ 'hPa' THEN vertz = 'hPa' 
+     IF type_yz EQ 'hPa' THEN legniv = ' hPa' 
    ENDIF 
 ;
@@ -158,6 +122,6 @@
    lo1=strtrim(string(format=fmt_bt, lon1), 2)
    lo2=strtrim(string(format=fmt_bt, lon2), 2)
-   pr1=strtrim(string(format=fmt_bt, prof1), 2)
-   pr2=strtrim(string(format=fmt_bt, prof2), 2)
+   pr1=strtrim(string(format=fmt_bt, vert1), 2)
+   pr2=strtrim(string(format=fmt_bt, vert2), 2)
 ;------------------------------------------------------------
 ; gestion de la date
@@ -173,14 +137,12 @@
    case coupe of
       'xy':begin          
-         if strupcase(vargrid) EQ 'W' then gdep = gdepw ELSE gdep = gdept
-         if n_elements(gdep) GE 2 then begin
-            IF gdep[0] LT gdep[1] THEN niveautest = 1 ELSE niveautest = jpk
-         ENDIF ELSE niveautest = 1 
-         if niveau NE niveautest AND (strpos(direc, 'z') EQ -1 OR nz EQ 1) then BEGIN
-            prof=strtrim(round(gdep[niveau-1]), 1)
-            !p.title = expf+varexp+datef+svardate+fieldf+varname+depthf+prof+legniv
-         ENDIF ELSE !p.title = expf+varexp+datef+svardate+fieldf+varname
-         !x.title = 'Longitude'
-         !y.title = 'Latitude'
+        if strupcase(vargrid) EQ 'W' then firstz = firstzw $
+        ELSE firstz = firstzt
+        if(strpos(direc, 'z') EQ -1 AND firstz NE 0) then BEGIN
+          prof = strtrim(round(gdep[0]), 1)
+          !p.title = expf+varexp+datef+svardate+fieldf+varname+depthf+prof+legniv
+        ENDIF ELSE !p.title = expf+varexp+datef+svardate+fieldf+varname
+        !x.title = lontitle
+        !y.title = lattitle
       end
 
@@ -191,6 +153,8 @@
           !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $
           !p.title = zonalf+varexp+datef+svardate+fieldf+varname
-         !x.title = 'Longitude'
-         if keyword_set(endpoints) AND lat1 EQ lat2 then !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1)
+         !x.title = lontitle
+         if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN 
+           IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) ELSE !x.title = !x.title+' at j index '+strtrim(lat1, 1)
+         ENDIF
          !y.title = depthf2
       end
@@ -203,6 +167,8 @@
           !p.title = meridf+varexp+datef+svardate+fieldf+varname
          !y.title = vertz
-         !x.title = 'Latitude'
-         if keyword_set(endpoints) AND lon1 EQ lon2 then !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1)
+         !x.title = lattitle
+         if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN 
+           IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) ELSE !x.title = !x.title+' at i index '+strtrim(lon1, 1)
+         ENDIF
       end
 
@@ -213,6 +179,8 @@
          !p.title  =     hovxt+varexp+fieldf+varname
          IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !y.title = timef
-         !x.title = 'Longitude'
-         if keyword_set(endpoints) AND lat1 EQ lat2 then !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1)
+         !x.title = lontitle
+         if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN 
+           IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) ELSE !x.title = !x.title+' at j index '+strtrim(lat1, 1)
+         ENDIF
       end
 
@@ -223,6 +191,8 @@
          !p.title  =     hovyt+varexp+fieldf+varname
          IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !x.title = timef
-         !y.title = 'Latitude'
-         if keyword_set(endpoints) AND lon1 EQ lon2 then !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1)
+         !y.title = lattitle
+         if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN 
+           IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) ELSE !x.title = !x.title+' at i index '+strtrim(lon1, 1)
+         ENDIF
       end
 
@@ -246,6 +216,8 @@
           !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $
          !p.title  =            varexp+datef+svardate+fieldf+varname
-         !x.title = 'Longitude'
-         if keyword_set(endpoints) AND lat1 EQ lat2 then !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1)
+         !x.title = lontitle
+         if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN 
+           IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) ELSE !x.title = !x.title+' at j index '+strtrim(lat1, 1)
+         ENDIF
          !y.title = varname
       end
@@ -255,6 +227,8 @@
           !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $
          !p.title  =            varexp+datef+svardate+fieldf+varname
-         !x.title = 'Latitude'
-         if keyword_set(endpoints) AND lon1 EQ lon2 then !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1)
+         !x.title = lattitle
+         if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN 
+           IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) ELSE !x.title = !x.title+' at i index '+strtrim(lon1, 1)
+         ENDIF
          !y.title = varname
       end
