Index: /trunk/src/calc_field.m
===================================================================
--- /trunk/src/calc_field.m	(revision 246)
+++ /trunk/src/calc_field.m	(revision 247)
@@ -105,5 +105,5 @@
                         EM = tps_eval(epoints,ctrs);
                     case{'vort','div'}
-                        EMDXY = tps_eval_dxy(epoints,ctrs);%2D matrix of distances between extrapolation points epoints and spline centres (=site points) ctrs
+                        [EMDX,EMDY] = tps_eval_dxy(epoints,ctrs);%2D matrix of distances between extrapolation points epoints and spline centres (=site points) ctrs
      
                 end
@@ -132,5 +132,5 @@
 %                         DataIn.V_tps(nbvec_sub+2,isub)=0;% X coefficient suppressed for x wise derivatives
 %                         DataIn.U_tps(nbvec_sub+3,isub)=0;% Y coefficient suppressed for x wise derivatives
-                        DataOut.vort(ind_sel)=DataOut.vort(ind_sel)+EMDXY(:,:,2) *DataIn.U_tps(1:nbvec_sub+3,isub)-EMDXY(:,:,1) *DataIn.V_tps(1:nbvec_sub+3,isub);
+                        DataOut.vort(ind_sel)=DataOut.vort(ind_sel)+EMDY *DataIn.U_tps(1:nbvec_sub+3,isub)-EMDX *DataIn.V_tps(1:nbvec_sub+3,isub);
                     case 'div'
                         ListFields={'div'};
@@ -142,5 +142,5 @@
 %                         DataIn.V_tps(nbvec_sub+2,isub)=0;% X coefficient suppressed for x wise derivatives
 %                         DataIn.U_tps(nbvec_sub+3,isub)=0;% Y coefficient suppressed for x wise derivatives
-                        DataOut.div(ind_sel)=DataOut.div(ind_sel)+EMDXY(:,:,1)*DataIn.U_tps(1:nbvec_sub+3,isub)+EMDXY(:,:,2) *DataIn.V_tps(1:nbvec_sub+3,isub);
+                        DataOut.div(ind_sel)=DataOut.div(ind_sel)+EMDX*DataIn.U_tps(1:nbvec_sub+3,isub)+EMDY *DataIn.V_tps(1:nbvec_sub+3,isub);
                 end
         end
Index: /trunk/src/plot_field.m
===================================================================
--- /trunk/src/plot_field.m	(revision 246)
+++ /trunk/src/plot_field.m	(revision 247)
@@ -106,4 +106,5 @@
 % introduce PlotParam.Hold: 'on' or 'off' (for curves)
 %default output
+
 if ~exist('PlotParam','var'),PlotParam=[];end;
 if ~exist('PosColorbar','var'),PosColorbar=[];end;
Index: /trunk/src/read_civxdata.m
===================================================================
--- /trunk/src/read_civxdata.m	(revision 246)
+++ /trunk/src/read_civxdata.m	(revision 247)
@@ -50,5 +50,7 @@
 errormsg='';
 DataTest=nc2struct(filename,'ListGlobalAttribute','Conventions');
-if isequal(DataTest.Conventions,'uvmat/civdata')%test for new civ format
+if isfield(DataTest,'Txt')
+    errormsg=DataTest.Txt;    
+elseif isequal(DataTest.Conventions,'uvmat/civdata')%test for new civ format
      [Field,VelTypeOut]=read_civdata(filename,FieldNames,VelType);
      return
Index: /trunk/src/tps_eval_dxy.m
===================================================================
--- /trunk/src/tps_eval_dxy.m	(revision 246)
+++ /trunk/src/tps_eval_dxy.m	(revision 247)
@@ -11,10 +11,10 @@
 %            N centres, with s=space dimension, DMXY(:,:,k) gives the derivatives
 %            along dimension k (=x, y,z) after multiplication by the N+1+s tps sources.
-  function DMXY = tps_eval_dxy(dsites,ctrs)
+  function [DMX,DMY] = tps_eval_dxy(dsites,ctrs)
   %%  matrix declarations
   [M,s] = size(dsites); [N,s] = size(ctrs);
-  Dsites=zeros(M,N,s);
+  Dsites=zeros(M,N);
   DM = zeros(M,N);
-  DMXY = zeros(M,N+1+s,s);
+ % DMXY = zeros(M,N+1+s);
   
   %% Accumulate sum of squares of coordinate differences
@@ -24,13 +24,15 @@
   %  Ctrs, consisting of M identical rows (each containing
   %       the d-th coordinate of the N centers)
-  for d=1:s
-     [Dsites(:,:,d),Ctrs] = ndgrid(dsites(:,d),ctrs(:,d));%d coordinates of interpolation points (Dsites) and initial points (Ctrs)
-     DM = DM + (Dsites(:,:,d)-Ctrs).^2;% add d component squared 
-  end
   
-  %% calculate mtrix of tps derivatives
-  DM(DM~=0) = log(DM)+1; %=2 log(r)+1 derivative of the tps r^2 log(r)
-  for d=1:s
-    DMXY(:,1:N,d)=Dsites(:,:,d).*DM;
-    DMXY(:,N+1+d,d)=1;% effect of mean gradient
-  end
+[Dsites,Ctrs] = ndgrid(dsites(:,1),ctrs(:,1));%d coordinates of interpolation points (Dsites) and initial points (Ctrs)
+DX=Dsites-Ctrs;
+[Dsites,Ctrs] = ndgrid(dsites(:,2),ctrs(:,2));%d coordinates of interpolation points (Dsites) and initial points (Ctrs)
+DY=Dsites-Ctrs;
+DM = DX.*DX + DY.*DY;% add d component squared 
+
+ %% calculate matrix of tps derivatives
+DM(DM~=0) = log(DM(DM~=0))+1; %=2 log(r)+1 derivative of the tps r^2 log(r)
+
+DMX=[DX.*DM zeros(M,1)  ones(M,1) zeros(M,1)];% effect of mean gradient
+DMY=[DY.*DM zeros(M,1)  ones(M,1) zeros(M,1)];% effect of mean gradient
+
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 246)
+++ /trunk/src/uvmat.m	(revision 247)
@@ -2147,4 +2147,5 @@
     ParamIn.GUIName='get_field';
     [Field{1},ParamOut,errormsg] = read_field(ObjectName,FileType,ParamIn,num_i1);
+    Field{1}
     if ~isempty(errormsg)
         errormsg=['error in reading ' filename ': ' errormsg];
@@ -2462,6 +2463,6 @@
     end
 else
-    errormsg='input field coordinates not defined';
-    return
+%     errormsg='input field coordinates not defined';
+%     return
 end
 if NbDim==3
@@ -2593,5 +2594,5 @@
 
 %% Plot the projections on the selected  projection objects
-
+'PLOT'
 % main projection object (uvmat display)
 list_object=get(handles.list_object_1,'String');
