Index: trunk/src/proj_field.m
===================================================================
--- trunk/src/proj_field.m	(revision 1045)
+++ trunk/src/proj_field.m	(revision 1048)
@@ -539,5 +539,4 @@
 end
 % default output
-errormsg='';%default
 Xline=[];
 flux=0;
@@ -545,6 +544,4 @@
 liny=ObjectData.Coord(:,2);
 NbPoints=size(ObjectData.Coord,1);
-testfalse=0;
-ListIndex={};
 
 %% group the variables (fields of 'FieldData') in cells of variables with the same dimensions
@@ -556,10 +553,6 @@
 CellInfo=CellInfo(NbDim>=2); %keep only the 2D or 3D cells
 cell_select=true(size(CellInfo));
-
 for icell=1:length(CellInfo)
     if isfield(CellInfo{icell},'ProjModeRequest')
-%         if ~strcmp(CellInfo{icell}.ProjModeRequest, ProjMode)
-%             cell_select(icell)=0;
-%         end
         if strcmp(ProjMode,'interp_tps')&& ~strcmp(CellInfo{icell}.CoordType,'tps')
             cell_select(icell)=0;
@@ -567,5 +560,5 @@
     end
 end
-if isempty(find(cell_select))
+if isempty(find(cell_select,1))
     errormsg=[' invalid projection mode ''' ProjMode ''': use ''interp_tps'' to interpolate spatial derivatives'];
     return
@@ -598,8 +591,4 @@
 end
 CheckClosedLine=~isempty(find(strcmp(ObjectData.Type,{'rectangle','ellipse','polygon'})));
-
-%     x = a \ \cosh \mu \ \cos \nu
-%
-%     y = a \ \sinh \mu \ \sin \nu
 
 %% angles of the polyline and boundaries of action for mode 'projection'
@@ -694,10 +683,8 @@
         %case of unstructured coordinates
         case 'scattered'
-            %             XName= FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)};
-            %             YName= FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-1)};
             coord_x=FieldData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)});
             coord_y=FieldData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-1)});
             
-            if isequal(ProjMode,'projection')
+            if strcmp(ProjMode,'projection')
                 if width==0
                     errormsg='range of the projection object is missing';
@@ -707,4 +694,5 @@
                 ProjData.VarDimName=[ProjData.VarDimName FieldData.ListVarName(CellInfo{icell}.CoordIndex(end))];
                 nbvar=numel(ProjData.ListVarName);
+                ProjData.VarAttribute{nbvar}.Role='coord_x';
                 ProjData.VarAttribute{nbvar}.long_name='abscissa along line';
                 % select the (non false) input data located in the band of projection
@@ -742,4 +730,5 @@
                     ProjData.VarDimName=[ProjData.VarDimName {XName}];
                     nbvar=numel(ProjData.ListVarName);
+                    ProjData.VarAttribute{nbvar}.Role='coord_x';
                     ProjData.VarAttribute{nbvar}.long_name='abscissa along line';
                     check_abscissa=1; % define abcissa only once
@@ -769,5 +758,5 @@
                         end
                     end
-                    ProjData.VarAttribute{ivar+nbvar}.Role='continuous';% will promote plots of the profiles with continuous lines
+                    ProjData.VarAttribute{ivar+nbvar}.Role='coord_y';% will promote plots of the profiles with continuous lines
                     ProjData.(ListFieldProj{ivar})=ProjVar{ivar};
                 end
@@ -778,6 +767,6 @@
                 NbCentres=FieldData.(FieldData.ListVarName{CellInfo{icell}.NbCentres_tps});
                 SubRange=FieldData.(FieldData.ListVarName{CellInfo{icell}.SubRange_tps});
-                if isfield(CellInfo{icell},'VarIndex_vector_x_tps')&&isfield(CellInfo{icell},'VarIndex_vector_y_tps')
-                    FieldVar=cat(3,FieldData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x_tps}),FieldData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y_tps}));
+                if isfield(CellInfo{icell},'VarIndex_vector_x')&&isfield(CellInfo{icell},'VarIndex_vector_y')
+                    FieldVar=cat(3,FieldData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x}),FieldData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y}));
                 end
                 [DataOut,VarAttribute,errormsg]=calc_field_tps(Coord,NbCentres,SubRange,FieldVar,CellInfo{icell}.FieldName,cat(3,XI,YI));
@@ -786,4 +775,5 @@
                 ProjData.X=Xproj;
                 nbvar=numel(ProjData.ListVarName);
+                ProjData.VarAttribute{nbvar}.Role='coord_x';
                 ProjData.VarAttribute{nbvar}.long_name='abscissa along line';
                 ProjVarName=(fieldnames(DataOut))';
@@ -799,5 +789,5 @@
                         end
                     end
-                    ProjData.VarAttribute{ivar+nbvar}.Role='continuous';% will promote plots of the profiles with continuous lines
+                    ProjData.VarAttribute{ivar+nbvar}.Role='coord_y';% will promote plots of the profiles with continuous lines
                     ProjData.(ProjVarName{ivar})=DataOut.(ProjVarName{ivar});
                 end
@@ -1107,6 +1097,4 @@
 %error=0;%default
 %flux=0;
-%testfalse=0;
-%ListIndex={};
 
 %% group the variables (fields of 'FieldData') in cells of variables with the same dimensions
