Index: /trunk/src/cell2tab.m
===================================================================
--- /trunk/src/cell2tab.m	(revision 106)
+++ /trunk/src/cell2tab.m	(revision 107)
@@ -35,5 +35,4 @@
         charchain=[charchain textlu];
     end
-    %Tabchar(itab)={charchain};
     Tabchar(itab,1)={charchain};
 end
Index: /trunk/src/civ.m
===================================================================
--- /trunk/src/civ.m	(revision 106)
+++ /trunk/src/civ.m	(revision 107)
@@ -752,6 +752,6 @@
 set(handles.list_subdir_civ1,'Value',1) 
 set(handles.list_subdir_civ2,'Value',1)
-set(handles.list_subdir_civ1,'String',['browse...';listdir])
-set(handles.list_subdir_civ2,'String',['browse...';listdir])
+set(handles.list_subdir_civ1,'String',[{'browse...'};listdir])
+set(handles.list_subdir_civ2,'String',[{'browse...'};listdir])
 %check wether the current subdir exists:
 subdir_civ1=get(handles.subdir_civ1,'String');
Index: /trunk/src/get_field.m
===================================================================
--- /trunk/src/get_field.m	(revision 106)
+++ /trunk/src/get_field.m	(revision 107)
@@ -784,19 +784,7 @@
 function RUN_Callback(hObject, eventdata, handles)
 %---------------------------------------------------------
-%path_get_field=fileparts(which('get_field'));
-%list=get(handles.ACTION,'String');
 index=get(handles.ACTION,'Value');
-% ACTION=list{index};
 list_func=get(handles.ACTION,'UserData');
 h_fun=list_func{index};
-% %hselect_field=get(handles.inputfile,'parent');%handle of the get_field interface
-% fct_path=list_path{index}; %path stored for the function ACTION
-% if ~isequal(fct_path,path_get_field)
-%     addpath(fct_path)% add the prescribed path if not the current one
-% end
-% eval(['h_fun=@' ACTION ';'])
-% if ~isequal(fct_path,path_get_field)
-%      rmpath(fct_path)% add the prescribed path if not the current one    
-% end
 set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784])
 drawnow
@@ -1026,7 +1014,7 @@
             if isfield(Field, Field.ListGlobalAttribute{iline})
                 eval(['val=Field.' Field.ListGlobalAttribute{iline} ';'])
-                if ischar(val);
+                if ischar(val);% attribute value is char string
                     Tabcell{iline,2}=val;
-                else
+                elseif size(val,1)==1 %attribute value is a number or matlab vector
                     Tabcell{iline,2}=num2str(val);
                 end
@@ -1458,5 +1446,13 @@
 % --------------------------------------------------------------------
 function MenuExportField_Callback(hObject, eventdata, handles)
-
+global Data_get_field
+% huvmat=findobj(allchild(0),'Name','uvmat');
+inputfile=get(handles.inputfile,'String');
+Data_get_field=nc2struct(inputfile);
+% Data_view_field=UvData.ProjField_2;
+evalin('base','global Data_get_field')%make CurData global in the workspace
+display(['content of ' inputfile ':'])
+evalin('base','Data_get_field') %display CurData in the workspace
+commandwindow;
 
 % --------------------------------------------------------------------
Index: /trunk/src/nomtype2pair.m
===================================================================
--- /trunk/src/nomtype2pair.m	(revision 106)
+++ /trunk/src/nomtype2pair.m	(revision 107)
@@ -31,37 +31,39 @@
 %determine nom_type_nc:
 nom_type_pair=[];%default
-switch nom_type
-    case {'_i_j'}
-        if Dtj>0 || Dtj<0
-            nom_type_pair='_i_j1-j2';
+if ischar(nom_type)
+    switch nom_type
+        case {'_i_j'}
+            if Dtj>0 || Dtj<0
+                nom_type_pair='_i_j1-j2';
+                if Dti>0 || Dti<0
+                    nom_type_pair='_i1-i2_j1-j2';
+                end
+                elseif Dti>0 || Dti<0
+                nom_type_pair='_i1-i21_j';   
+            else
+                 nom_type_pair='_i_j';
+            end
+        case {'_i1-i2_j'}
+            if Dtj>0 || Dtj<0
+               nom_type_pair='_i1-i2_j1-j2';
+            else
+                nom_type_pair='_i1-i2_j';
+            end
+        case {'i_j1-j2'}
             if Dti>0 || Dti<0
-                nom_type_pair='_i1-i2_j1-j2';
+               nom_type_pair='_i1-i2_j1-j2';
+            else
+                nom_type_pair='_i1-i2_j';
             end
-            elseif Dti>0 || Dti<0
-            nom_type_pair='_i1-i21_j';   
-        else
-             nom_type_pair='_i_j';
-        end
-    case {'_i1-i2_j'}
-        if Dtj>0 || Dtj<0
-           nom_type_pair='_i1-i2_j1-j2';
-        else
-            nom_type_pair='_i1-i2_j';
-        end
-    case {'i_j1-j2'}
-        if Dti>0 || Dti<0
-           nom_type_pair='_i1-i2_j1-j2';
-        else
-            nom_type_pair='_i1-i2_j';
-        end
-    case {'i1-i2_j1-j2'}
-         nom_type_pair='_i1-i2_j1-j2';
-    case '#a'
-        if Dtj>0 || Dtj<0
-            nom_type_pair='#_ab';
-        end
-    otherwise
-        if Dti>0 || Dti<0
-           nom_type_pair='_i1-i2'; 
-        end
+        case {'i1-i2_j1-j2'}
+             nom_type_pair='_i1-i2_j1-j2';
+        case '#a'
+            if Dtj>0 || Dtj<0
+                nom_type_pair='#_ab';
+            end
+        otherwise
+            if Dti>0 || Dti<0
+               nom_type_pair='_i1-i2'; 
+            end
+    end
 end
Index: /trunk/src/plot_field.m
===================================================================
--- /trunk/src/plot_field.m	(revision 106)
+++ /trunk/src/plot_field.m	(revision 107)
@@ -837,5 +837,9 @@
         if isempty(hima)
             tag=get(haxes,'Tag');
-            hima=imagesc(AX,AY,B,[MinA MaxA]);
+            if MinA<MaxA
+                hima=imagesc(AX,AY,B,[MinA MaxA]);
+            else
+                hima=imagesc(AX,AY,B,[MaxA-1 MaxA]);
+            end
             set(hima,'Tag','ima','HitTest','off')
             set(haxes,'Tag',tag);%preserve the axes tag (removed by image fct !!!)       
@@ -845,5 +849,5 @@
                 caxis([MinA MaxA])
             else
-                caxis([MinA MinA+1])
+                caxis([MaxA-1 MaxA])
             end
             set(hima,'XData',AX);
Index: /trunk/src/series/aver_stat.m
===================================================================
--- /trunk/src/series/aver_stat.m	(revision 106)
+++ /trunk/src/series/aver_stat.m	(revision 107)
@@ -323,5 +323,5 @@
                             A=imread(filename);
                     end 
-                    Data{iview}.ListVarName={'coord_y','coord_x','A'}; % 
+                    Data{iview}.ListVarName={'AY','AX','A'}; % 
                     Atype{iview}=class(A);
                     npy=size(A,1);
@@ -329,10 +329,10 @@
                     nbcolor=size(A,3);
                     if nbcolor==3
-                         Data{iview}.VarDimName={'coord_y','coord_x',{'coord_y','coord_x','rgb'}};
+                         Data{iview}.VarDimName={'AY','AX',{'AY','AX','rgb'}};
                     else
-                         Data{iview}.VarDimName={'coord_y','coord_x',{'coord_y','coord_x'}};
+                         Data{iview}.VarDimName={'AY','AX',{'AY','AX'}};
                     end  
-                    Data{iview}.coord_y=[npy-0.5 0.5];
-                    Data{iview}.coord_x=[0.5 npx-0.5];
+                    Data{iview}.AY=[npy-0.5 0.5];
+                    Data{iview}.AX=[0.5 npx-0.5];
                     Data{iview}.A=double(A);
                     Data{iview}.CoordType='px';
Index: /trunk/src/series/time_series.m
===================================================================
--- /trunk/src/series/time_series.m	(revision 106)
+++ /trunk/src/series/time_series.m	(revision 107)
@@ -186,20 +186,4 @@
 end
 
-% Root name of output files (TO GENERALISE FOR TWO INPUT SERIES)
-% filebasesub=fullfile(RootPath{1},RootFile{1});
-% if NbSlice==1
-%     filebase_out=[filebasesub '_time'];
-% else
-%     filebase_out=[filebasesub '_' NbSlice_name 'mtim'];
-%     increment=num_i1{1}(2)-num_i1{1}(1);
-%     if ~isequal(increment,1) % if an increment is set
-%         answeryes=msgbox_uvmat('INPUT_Y-N',['will take time series in ' num2str(NbSlice) 'slices with increment = ' num2str(increment) '!']); 
-%     else    
-%         answeryes=msgbox_uvmat('INPUT_Y-N',{['will take time series in ' num2str(NbSlice) ' slices'];['results stored as files ' filebase_out ' ...']});
-%     end
-%     if ~isequal(answeryes,'Yes')
-%         return
-%     end
-% end
 VelType_str=get(hseries.VelTypeMenu,'String');
 VelType_val=get(hseries.VelTypeMenu,'Value');
@@ -288,8 +272,4 @@
 % Root name of output files (TO GENERALISE FOR TWO INPUT SERIES)
 subdir_result='time_series';
-% filebasesub=fullfile(RootPath{1},subdir_result,RootFile{1});
-% if isempty(SubDir{1}) % create a subdirectory '/aver_stat'
-%     subdir_result='aver_stat';
-%     filebasemean=fullfile(RootPath{1},subdir_result);
 if ~exist(fullfile(RootPath{1},subdir_result),'dir')
     dircur=pwd; %record current working directory
@@ -351,15 +331,15 @@
                             A=imread(filename);
                     end 
-                    Data{iview}.ListVarName={'coord_y','coord_x','A'}; % 
+                    Data{iview}.ListVarName={'AY','AX','A'}; % 
                     npy=size(A,1);
                     npx=size(A,2);
                     nbcolor=size(A,3);
                     if nbcolor==3
-                         Data{iview}.VarDimName={'coord_y','coord_x',{'coord_y','coord_x','rgb'}};
+                         Data{iview}.VarDimName={'AY','AX',{'AY','AX','rgb'}};
                     else
-                         Data{iview}.VarDimName={'coord_y','coord_x',{'coord_y','coord_x'}};
+                         Data{iview}.VarDimName={'AY','AX',{'AY','AX'}};
                     end  
-                    Data{iview}.coord_y=[npy-0.5 0.5];
-                    Data{iview}.coord_x=[0.5 npx-0.5];
+                    Data{iview}.AY=[npy-0.5 0.5];
+                    Data{iview}.AX=[0.5 npx-0.5];
                     Data{iview}.A=double(A);
                     Data{iview}.CoordType='px';
@@ -426,4 +406,5 @@
                         for ivar=1:nbvar
                             if length(Field.VarAttribute)>=ivar && isfield(Field.VarAttribute{ivar},'Role')
+                               %Field.ListVarName{ivar}
                                 var_role=Field.VarAttribute{ivar}.Role;%'role' of the variable
                                 if isequal(var_role,'errorflag')
@@ -439,12 +420,12 @@
                                     testsum(ivar)=1; %constant coordinates, record without time evolution
                                 end
-                                % check whether the variable ivar is a dimension variable
-                                DimCell=Field.VarDimName{ivar};
-                                if ischar(DimCell)
-                                    DimCell={DimCell};
-                                end
-                                if numel(DimCell)==1 && isequal(Field.ListVarName{ivar},DimCell{1})%detect dimension variables
-                                   testsum(ivar)=1;
-                                end
+                            end
+                            % check whether the variable ivar is a dimension variable
+                            DimCell=Field.VarDimName{ivar};
+                            if ischar(DimCell)
+                                DimCell={DimCell};
+                            end
+                            if numel(DimCell)==1 && isequal(Field.ListVarName{ivar},DimCell{1})%detect dimension variables
+                               testsum(ivar)=1;
                             end
                         end
@@ -506,17 +487,12 @@
     end
         % add time dimension and update VarDimIndex:
-   %if ~isequal(Series.ProjObject.ProjMode,'inside')% take the average in the domain for 'inside' mode
         for ivar=1:length(Field.ListVarName)
-%              vardimindex=Field.VarDimIndex{ivar};% array of dimension indices for variable VarIndex(ivar)
              DimCell=Field.VarDimName(ivar);
              if testsum(ivar)==2%variable used as time series
-%                  RecordData.VarDimIndex{ivar}=[1 vardimindex+1];
                   RecordData.VarDimName{ivar}=[{'Time'} DimCell];
              elseif testsum(ivar)==1
-%                  RecordData.VarDimIndex{ivar}=[vardimindex+1];
                  RecordData.VarDimName{ivar}=DimCell;
              end
         end
-   % end
     indexremove=find(~testsum);
     if ~isempty(indexremove)
@@ -527,5 +503,5 @@
         end
     end
-    %RecordData.VarDimIndex=[{[1]} RecordData.VarDimIndex]; %time dimension
+
     %shift variable attributes
     if isfield(RecordData,'VarAttribute')
@@ -534,4 +510,5 @@
     RecordData.VarDimName=[{'Time'} RecordData.VarDimName];
     RecordData.Action=Series.Action;%name of the processing programme
+    
     %name of result file
     [filemean]=...
@@ -544,4 +521,5 @@
     end
 end
+
 figure
 haxes=axes;
Index: /trunk/src/struct2nc.m
===================================================================
--- /trunk/src/struct2nc.m	(revision 106)
+++ /trunk/src/struct2nc.m	(revision 107)
@@ -95,5 +95,5 @@
      %write variable attributes
     if testattr
-        for ivar=1:length(VarAttribute)  
+        for ivar=1:min(numel(VarAttribute),numel(ListVarName))  
             if isstruct(VarAttribute{ivar})
                 attr_names=fields(VarAttribute{ivar});
Index: /trunk/src/struct2nc_toolbox.m
===================================================================
--- /trunk/src/struct2nc_toolbox.m	(revision 106)
+++ /trunk/src/struct2nc_toolbox.m	(revision 107)
@@ -115,5 +115,5 @@
 %write variable attributes
 if testattr
-    for ivar=1:length(VarAttribute)  %loop on the attributes of variable ivar
+    for ivar=1:min(numel(VarAttribute),numel(ListVarName))  %loop on the attributes of variable ivar
         if isstruct(VarAttribute{ivar})
             attr_names=fields(VarAttribute{ivar});
