Index: /trunk/src/mouse_up.m
===================================================================
--- /trunk/src/mouse_up.m	(revision 220)
+++ /trunk/src/mouse_up.m	(revision 221)
@@ -201,5 +201,5 @@
                 map=colormap(currentaxes);
                 colormap(map);%transmit the current colormap to the zoom fig
-                set(hfig2,'Position',[0.2 0.33 0.6 0.6]);          
+                set(hfig2,'Position',[0.2 0.33 0.6 0.6]);
                 set(hfig2,'Unit','normalized')
                 set(hfig2,'KeyPressFcn',{@keyboard_callback,handles})%set keyboard action function
@@ -229,18 +229,12 @@
                     set(hcol_new,'Yticklabel',YTicklabel);
                 end
-            end
-    %             if ishandle(AxeData.ZoomAxes)
-%             hnew_rect=findobj(AxeData.ZoomAxes,'Tag','rect_zoom');
-%             if ~isempty(hnew_rect)
-%                 delete(hnew_rect);
-
-                ChildAxeData.CurrentRectZoom=[]; % no rect zoom in the new window
-                ChildAxeData.Drawing='off';
-                ChildAxeData.ParentRect=AxeData.CurrentRectZoom;%set the rectangle as a 'parent' associated to the new axe
-                PosRect=CurrentOrigin;
-                xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates
-                set(AxeData.ZoomAxes,'Xlim',[PosRect(1) xy(1,1)])
-                set(AxeData.ZoomAxes,'Ylim',[PosRect(2) xy(1,2)])
-%             end
+            end          
+            ChildAxeData.CurrentRectZoom=[]; % no rect zoom in the new window
+            ChildAxeData.Drawing='off';
+            ChildAxeData.ParentRect=AxeData.CurrentRectZoom;%set the rectangle as a 'parent' associated to the new axe
+            PosRect=CurrentOrigin;
+            xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates
+            set(AxeData.ZoomAxes,'Xlim',[PosRect(1) xy(1,1)])
+            set(AxeData.ZoomAxes,'Ylim',[PosRect(2) xy(1,2)])
             set(AxeData.ZoomAxes,'UserData',ChildAxeData);%update the AxeData of the new axes
         end
@@ -253,4 +247,5 @@
     xlim=get(currentaxes,'XLim');
     ylim=get(currentaxes,'YLim');
+ % if left mouse button has been pressed, zoom in by a factor of 2
     if  isequal(get(currentfig,'SelectionType'),'normal');%if left button has been pressed, zoom in by a factor of 2
         xlim(1)=0.5*xy(1,1)+0.5*xlim(1);
@@ -260,17 +255,18 @@
         ylim(1)=0.5*xy(1,2)+0.5*ylim(1);
         set(currentaxes,'YLim',ylim)
-        %zoom out by a factor of 2 out when the right mouse button has been used
-    else%if isequal(get(currentfig,'SelectionType'),'alt'); %if right button has been pressed
+ % if right mouse button has been pressed, zoom out by a factor of 2
+    else
         xlim(1)=2*xlim(1)-xy(1,1);
         xlim(2)=2*xlim(2)-xy(1,1);
         ylim(1)=2*ylim(1)-xy(1,2);
         ylim(2)=2*ylim(2)-xy(1,2);
-        %             ylim_new(1)=(1+alpha)*ylim(1)/2+(1-alpha)*ylim(2)/2;
-        %             ylim_new(2)=(1-alpha)*ylim(1)/2+(1+alpha)*ylim(2)/2;
         if isfield(AxeData,'RangeX')&& isfield(AxeData,'RangeY')
+            'TESTup'
+            AxeData
             xlim(1)=max(AxeData.RangeX(1),xlim(1));
             xlim(2)=min(AxeData.RangeX(2),xlim(2));
             ylim(1)=max(AxeData.RangeY(1),ylim(1));
             ylim(2)=min(AxeData.RangeY(2),ylim(2));
+         % desactivate the zoom if the full field is visible within the axes
             if isequal(xlim,AxeData.RangeX) && isequal(ylim,AxeData.RangeY)
                 set(hhuvmat.zoom,'Value',0)
@@ -280,4 +276,6 @@
             end
         end
+        xlim
+        ylim
         set(currentaxes,'XLim',xlim)
         set(currentaxes,'YLim',ylim)
@@ -287,11 +285,4 @@
         end
     end
-%     if isfield(AxeData,'ParentRect')% update the position of the parent rectangle represneting the field
-%         hparentrect=AxeData.ParentRect;
-%         xlim=get(currentaxes,'XLim');
-%         ylim=get(currentaxes,'YLim');
-%         rect([1 2])=[xlim(1) ylim(1)];
-%         rect([3 4])=[xlim(2)-xlim(1) ylim(2)-ylim(1)];
-%         set(hparentrect,'Position',rect)
     if isfield(AxeData,'LimEditBox')&& AxeData.LimEditBox% update display of the GUI containing the axis (uvmat or view_field)
         set(hhcurrentfig.MinX,'String',num2str(xlim(1)))
@@ -327,16 +318,4 @@
             Tabchar=[Tabchar ;{'......'}];
             set(h_ListCoord,'String',Tabchar)
-            %         coord_str=Coord{index_point}; %current line (string)
-            %         k=findstr('|',coord_str);%find separator indices on the string
-            %         blanks=blank
-            %         xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates
-            %         if numel(k)>=3
-            %             coord_str=[coord_str(1:k(3)-1) ' | ' num2str(xy(1,1),4) ' | ' num2str(xy(1,2),4)]; %update the pixel information while preserving phys coord
-            %         else
-            %             coord_str=[ '    |    '  '    |    '  '    |    ' num2str(xy(1,1),4) '    |    ' num2str(xy(1,2),4)];
-            %         end
-            %         Coord{index_point}=coord_str;
-            %         set(h_ListCoord,'String',Coord)
-            %         data=read_geometry_calib(Coord);%transform char cell to numbers
             set(hh,'XData',data.Coord(:,4))
             set(hh,'YData',data.Coord(:,5))
@@ -344,5 +323,4 @@
     end
 end
-
 
 %% finalising ruler
@@ -383,15 +361,15 @@
         currentobj=gco;%default
     end
-    if ((nbselect==0) && isequal(get(currentobj,'Type'),'axes')) || isequal(currentobj,huvmat)
-        currentfig=get(currentobj,'parent');
-        figname=get(currentfig,'name');
-        eval(['global Data_' figname])
-        eval(['Data_' figname '=get(currentobj,''UserData'')']);
-        evalin('base',['global Data_' figname])%make CurData global in the workspace
-        objtype=get(currentobj,'Type');
-        display(['UserData of ' objtype ':'])
-        evalin('base',['Data_' figname]) %display CurData in the workspace
-        commandwindow %brings the Matlab command window to the front
-    end
+%     if ((nbselect==0) && isequal(get(currentobj,'Type'),'axes')) || isequal(currentobj,huvmat)
+%         currentfig=get(currentobj,'parent');
+%         figname=get(currentfig,'name');
+%         eval(['global Data_' figname])
+%         eval(['Data_' figname '=get(currentobj,''UserData'')']);
+%         evalin('base',['global Data_' figname])%make CurData global in the workspace
+%         objtype=get(currentobj,'Type');
+%         display(['UserData of ' objtype ':'])
+%         evalin('base',['Data_' figname]) %display CurData in the workspace
+%         commandwindow %brings the Matlab command window to the front
+%     end
 end
 
Index: /trunk/src/name_generator.m
===================================================================
--- /trunk/src/name_generator.m	(revision 220)
+++ /trunk/src/name_generator.m	(revision 221)
@@ -272,6 +272,9 @@
     num_i1=str2double(field_count);
     num_i2=str2double(str2);
-    num_j1=stra2double(str_a);
-    num_j2=stra2double(str_b);
+    if isnan(num_i2)
+        num_i2=num_i1;
+    end
+    num_j1=stra2num(str_a);
+    num_j2=stra2num(str_b);
      pathname=fileparts(filebasesub);% CORRIGE LE 6 JUIN (ETAIT DESACTIVE)
     filename=fullfile(pathname,dirpair(indpair).name);
Index: /trunk/src/plot_field.m
===================================================================
--- /trunk/src/plot_field.m	(revision 220)
+++ /trunk/src/plot_field.m	(revision 221)
@@ -240,9 +240,13 @@
     msgbox_uvmat('ERROR', errormsg)
 end
-if isfield(PlotParamOut,'MinX')
-    set(haxes,'XLim',[PlotParamOut.MinX PlotParamOut.MaxX])
-    set(haxes,'YLim',[PlotParamOut.MinY PlotParamOut.MaxY])
-    AxeData.RangeX=[PlotParamOut.MinX PlotParamOut.MaxX];
-    AxeData.RangeY=[PlotParamOut.MinY PlotParamOut.MaxY];
+if isfield(PlotParamOut,'RangeX')&& isfield(PlotParamOut,'RangeY')
+%     'TESTplot'
+%     haxes
+%     PlotParamOut.MinX
+%     PlotParamOut.MaxY
+%     set(haxes,'XLim',[PlotParamOut.MinX PlotParamOut.MaxX])
+%     set(haxes,'YLim',[PlotParamOut.MinY PlotParamOut.MaxY])
+    AxeData.RangeX=PlotParamOut.RangeX;%'[PlotParamOut.MinX PlotParamOut.MaxX];
+    AxeData.RangeY=PlotParamOut.RangeY;%[PlotParamOut.MinY PlotParamOut.MaxY]
 end
 
@@ -508,9 +512,11 @@
 
 %% determine axes bounds
- fix_lim=isfield(PlotParam,'FixLimits') && PlotParam.FixLimits;
+PlotParamOut.RangeX=[min(XMin) max(XMax)];
+PlotParamOut.RangeY=[min(YMin_cell) max(YMax_cell)];
+fix_lim=isfield(PlotParam,'FixLimits') && PlotParam.FixLimits;
 if fix_lim
     if ~isfield(PlotParam,'MinX')||~isfield(PlotParam,'MaxX')||~isfield(PlotParam,'MinY')||~isfield(PlotParam,'MaxY')
         fix_lim=0; %free limits if lits are not set,
-    end  %else PlotParamOut.XMin =PlotParam.XMin...
+    end 
 end
 if ~fix_lim
@@ -1074,5 +1080,5 @@
         end  %else PlotParamOut.XMin =PlotParam.XMin...
     end
-    if ~fix_lim
+%     if ~fix_lim
         XMin=[];
         XMax=[];
@@ -1091,4 +1097,7 @@
             YMax=[YMax max(vec_Y)];
         end
+        PlotParamOut.RangeX=[min(XMin) max(XMax)]; %range of x, to be stored in the user data of the plot axes
+        PlotParamOut.RangeY=[min(YMin) max(YMax)]; %range of x, to be stored in the user data of the plot axes
+    if ~fix_lim
         PlotParamOut.MinX=min(XMin);
         PlotParamOut.MaxX=max(XMax);
@@ -1102,22 +1111,4 @@
         end
     end
-%     if Ylim(2)>Ylim(1)
-%         set(haxes,'YLim',Ylim);% set y limits of frame in axes coordinate
-%     end
-%     end
-    %    adjust the size of the plot to include the whole field, except if PlotParam.FixLimits=1
-    %     if ~(isfield(PlotParam,'FixLimits') && PlotParam.FixLimits) && test_lim
-    %         PlotParamOut.MinX=Xlim(1);
-    %         PlotParamOut.MaxX=Xlim(2);
-    %         PlotParamOut.MinY=Ylim(1);
-    %         PlotParamOut.MaxY=Ylim(2);
-%     if Xlim(2)>Xlim(1)
-%         set(haxes,'XLim',Xlim);% set x limits of frame in axes coordinates
-%     end
-%     if Ylim(2)>Ylim(1)
-%         set(haxes,'YLim',Ylim);% set y limits of frame in axes coordinate
-%     end
-    %     end
-
     set(haxes,'YDir','normal')
     set(get(haxes,'XLabel'),'String',[XName ' (' x_units ')']);
Index: /trunk/src/read_civxdata.m
===================================================================
--- /trunk/src/read_civxdata.m	(revision 220)
+++ /trunk/src/read_civxdata.m	(revision 221)
@@ -111,4 +111,5 @@
 test_civ2=isequal(VelTypeOut,'civ2')||isequal(VelTypeOut,'interp2')||isequal(VelTypeOut,'filter2');
 Field.Time=0; %default
+Field.TimeUnit='s'; 
 if test_civ1
     if isfield(Field,'absolut_time_T0')
@@ -162,5 +163,5 @@
 end
 List(ind_remove)=[];
-Field.ListGlobalAttribute=[{'NbCoord'},{'NbDim'} List {'Time','CivStage','CoordUnit'}];
+Field.ListGlobalAttribute=[{'NbCoord'},{'NbDim'} List {'Time','TimeUnit','CivStage','CoordUnit'}];
 Field.CoordUnit='pixel';
 
Index: /trunk/src/read_field.m
===================================================================
--- /trunk/src/read_field.m	(revision 220)
+++ /trunk/src/read_field.m	(revision 221)
@@ -75,10 +75,11 @@
     if ~test_civx% read the field names on the interface get_field.
         hget_field=findobj(allchild(0),'Name',GUIName);%find the get_field... GUI
-        if isempty(hget_field)
+        if isempty(hget_field)% open the GUI get_field if it is not found
             hget_field= get_field(ObjectName);%open the get_field GUI
-            set(hget_field,'Name',GUIName)
+            set(hget_field,'Name',GUIName)%update the name of get_field (e.g. get_field_1)
         end
         hhget_field=guidata(hget_field);
         %% update  the get_field GUI
+        set(hhget_field.inputfile,'String',ObjectName)
         set(hhget_field.list_fig,'Value',1)
         funct_list=get(hhget_field.ACTION,'UserData');
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 220)
+++ /trunk/src/uvmat.m	(revision 221)
@@ -948,4 +948,9 @@
 set(handles.frame_j,'Visible',state_j);
 set(handles.j_text,'Visible',state_j);
+if strcmp(state_j,'on')
+    set(handles.fix_pair,'Visible','on')
+else
+    set(handles.fix_pair,'Visible','off')
+end
 
 %% view the field  
@@ -1386,5 +1391,5 @@
     set(handles.scan_i,'Value',0)
     set(handles.scan_i,'BackgroundColor',[0.831 0.816 0.784])
-    NomType=get(handles.FileIndex,'UserData');
+    NomType=get(handles.FileIndex,'UserData')
     switch NomType
     case {'_i_j1-j2','#_ab','%3dab'},% pair with j index
@@ -2115,6 +2120,6 @@
         index_fields=get(handles.Fields,'Value');% selected string index
         FieldName= list_fields{index_fields}; % selected field
-        if ~strcmp(FieldName,'get_field...')% read the field names on the interface get_field...
-           VelType=setfield(handles);
+        if ~strcmp(FieldName,'get_field...')
+           VelType=setfield(handles);% read the velocity type.
         end
         if strcmp(FieldName,'velocity')
@@ -2464,5 +2469,5 @@
             UvData.Field.ZMin=ZMin;
         else
-            UvData.Field.Mesh=sqrt(DX*DY);
+            UvData.Field.Mesh=DX;%sqrt(DX*DY);
         end
     end
@@ -2711,4 +2716,23 @@
 %% display time
 testimedoc=0;
+TimeUnit='';
+if isfield(UvData.Field,'Time')
+    abstime=UvData.Field.Time;%time read from the netcdf input file 
+end
+if isfield(UvData,'Field_1') && isfield(UvData.Field_1,'Time')
+    abstime_1=UvData.Field_1.Time;%time read from the netcdf input file 
+end
+if isfield(UvData.Field,'dt')
+    dt=UvData.Field.dt;%dt read from the netcdf input file
+    if isfield(UvData.Field,'TimeUnit')
+       TimeUnit=UvData.Field.TimeUnit;
+    end
+elseif isfield(UvData,'Field_1') && isfield(UvData.Field_1,'dt')%dt obtained from the second field if not defined in the first
+    dt=UvData.Field_1.dt;%dt read from the netcdf input file
+    if isfield(UvData.Field_1,'TimeUnit')
+       TimeUnit=UvData.Field_1.TimeUnit;
+    end
+end
+% time from xml file overset previous result
 if isfield(UvData,'XmlData') && isfield(UvData.XmlData,'Time')
     if isempty(num_i2)||isnan(num_i2)
@@ -2726,4 +2750,7 @@
         dt=(UvData.XmlData.Time(num_i2,num_j2)-UvData.XmlData.Time(num_i1,num_j1));
         testimedoc=1;
+        if isfield(UvData.XmlData,'TimeUnit')
+            TimeUnit=UvData.XmlData.TimeUnit;
+        end
     end
 end
@@ -2756,8 +2783,8 @@
     set(handles.Dt_txt,'String','')
 else
-    if ~(isfield(UvData,'TimeUnit') && ~isempty(UvData.TimeUnit))
+    if  isempty(TimeUnit)
         set(handles.Dt_txt,'String',['Dt=' num2str(1000*dt,3) '  10^(-3)'] )
     else
-        set(handles.Dt_txt,'String',['Dt=' num2str(1000*dt,3) '  m' UvData.TimeUnit] )
+        set(handles.Dt_txt,'String',['Dt=' num2str(1000*dt,3) '  m' TimeUnit] )
     end
 end
