Index: trunk/src/series.m
===================================================================
--- trunk/src/series.m	(revision 770)
+++ trunk/src/series.m	(revision 771)
@@ -234,11 +234,11 @@
     set(handles.FieldName,'Value',Param.index_fields);% selected string index
 end
-if isfield(Param,'Coord_x_str')&& isfield(Param,'Coord_x_val')
+if isfield(Param,'Coord_x_str') && ischar(Param.Coord_x_str)
         set(handles.Coord_x,'String',Param.Coord_x_str);% list menu fields
-    set(handles.Coord_x,'Value',Param.Coord_x_val);% selected string index
-end
-if isfield(Param,'Coord_y_str')&& isfield(Param,'Coord_y_val')
+%     set(handles.Coord_x,'Value',Param.Coord_x_val);% selected string index
+end
+if isfield(Param,'Coord_y_str')&& ischar(Param.Coord_y_str)
         set(handles.Coord_y,'String',Param.Coord_y_str);% list menu fields
-    set(handles.Coord_y,'Value',Param.Coord_y_val);% selected string index
+%     set(handles.Coord_y,'Value',Param.Coord_y_val);% selected string index
 end
 
@@ -1031,39 +1031,51 @@
 switch FileType
     case {'civx','civdata'}
-        FieldList=set_field_list('U','V');
-        set(handles.FieldName,'String',[FieldList;{'C'};{'get_field...'}]);%standard menu for civx data
-        set(handles.FieldName,'Value',1) % set menu to 'velocity
-        set(handles.Coord_x,'Value',1);
-        set(handles.Coord_x,'String',{'X'});
-        set(handles.Coord_y,'Value',1);
-        set(handles.Coord_y,'String',{'Y'});
+        FieldList=[set_field_list('U','V');{'C'}];%standard menu for civx data
+%         set(handles.Coord_x,'Value',1);
+        set(handles.Coord_x,'String','X');
+%         set(handles.Coord_y,'Value',1);
+        set(handles.Coord_y,'String','Y');
     case 'netcdf'
-        set(handles.FieldName,'Value',1)
-        set(handles.FieldName,'String',{'get_field...'})
-        if isempty(i2_series)
-            i2=[];
+        ind_x=find(strcmp(get(handles.Coord_x,'String'),FileInfo.ListVarName));
+        if isempty(ind_x)
+            FieldList={};% new kind of file opened, we need to pick variables with get_field...
+            set(handles.Coord_x,'String','')
+            set(handles.Coord_y,'String','')
         else
-            i2=i2_series(1,ref_j+1,ref_i+1);
-        end
-        if isempty(j1_series)
-            j1=[];j2=[];
-        else
-            j1=j1_series(1,ref_j+1,ref_i+1);
-            if isempty(j2_series)
-                j2=[];
+            FileInfo.ListVarName(ind_x)=[];%remove coord-x from the list of variables to display
+            ind_y=find(strcmp(get(handles.Coord_y,'String'),FileInfo.ListVarName));
+            if isempty(ind_y)
+            FieldList={};% new kind of file opened, we need to pick variables with get_field...
+            set(handles.Coord_x,'String','')
+            set(handles.Coord_y,'String','')
             else
-                j2=j2_series(1,ref_j+1,ref_i+1);
+                FileInfo.ListVarName(ind_y)=[];%remove coord-y from the list of variables to display
+                FieldList=(FileInfo.ListVarName)';
             end
-        end
-       % FieldName_Callback([], [], handles)
+        end  
     otherwise
         set(handles.FieldName,'Value',1) % set menu to 'image'
         set(handles.FieldName,'String',{'image'})
-        set(handles.Coord_x,'Value',1);
-        set(handles.Coord_x,'String',{'AX'});
-        set(handles.Coord_y,'Value',1);
-        set(handles.Coord_y,'String',{'AY'});
-end
-
+        set(handles.Coord_x,'String','AX');
+        set(handles.Coord_y,'String','AY');
+end
+if ismember(FileType,{'civx','civdata','netcdf'})
+    PrevMenu=get(handles.FieldName,'String');
+    PrevMenu=PrevMenu(get(handles.FieldName,'Value'));
+    FieldValue=[];
+    for ilist=1:numel(PrevMenu)
+        index_menu=find(strcmp(PrevMenu{ilist},FieldList));
+        if ~isempty(index_menu)
+            FieldValue=[FieldValue index_menu];
+        end
+    end
+    if isempty(FieldValue)
+        FieldValue=1;
+    end
+    set(handles.FieldName,'Value',FieldValue)
+    set(handles.FieldName,'String',[FieldList;{'get_field...'}])
+end 
+
+      
 %------------------------------------------------------------------------
 function num_first_i_Callback(hObject, eventdata, handles)
@@ -2311,4 +2323,5 @@
         Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2);
     if exist(FirstFileName,'file')
+        ParamIn.Title='get_field: pick input variables and coordinates for series processing';
         ParamIn.SeriesInput=1;
         GetFieldData=get_field(FirstFileName,ParamIn);
@@ -2322,5 +2335,5 @@
                     ['norm(' UName ',' VName ')'];...
                     UName;VName};
-            case {'scalar','pick variables'}
+            case {'scalar'}
                 FieldList=GetFieldData.PanelScalar.scalar;
                 YName={GetFieldData.Coordinates.Coord_y};
@@ -2328,9 +2341,7 @@
                     FieldList={FieldList};
                 end
-            case '1D plot'
-                YName=GetFieldData.PanelOrdinate.ordinate;
             case 'civdata...'
-                FieldList=[set_field_list('U','V','C') ;{'C'}];
-                set(handles.FieldName,'Value',2) % set menu to 'velocity
+                FieldList=[set_field_list('U','V') ;{'C'}];
+                set(handles.FieldName,'Value',1) % set menu to 'velocity
                 XName='X';
                 YName='y';
@@ -2340,7 +2351,8 @@
         set(handles.FieldName,'String',[FieldList; {'get_field...'}]);
         if ~strcmp(GetFieldData.FieldOption,'civdata...')
-            set(handles.FieldName,'Value',[1:numel(FieldList)])%select all input fields by default
+            set(handles.FieldName,'Value',1:numel(FieldList))%select all input fields by default
             set(handles.VelType,'visible','off')
             XName=GetFieldData.Coordinates.Coord_x;
+            YName=GetFieldData.Coordinates.Coord_y;
             TimeNameStr=GetFieldData.Time.SwitchVarIndexTime;
             switch TimeNameStr
@@ -2363,5 +2375,5 @@
             end
         end
-                set(handles.Coord_x,'String',{XName})
+        set(handles.Coord_x,'String',XName)
         set(handles.Coord_y,'String',YName)
     end
