Index: /issm/trunk-jpl/src/m/contrib/chenggong/modeldata/interpFromITSLIVE.m
===================================================================
--- /issm/trunk-jpl/src/m/contrib/chenggong/modeldata/interpFromITSLIVE.m	(revision 28022)
+++ /issm/trunk-jpl/src/m/contrib/chenggong/modeldata/interpFromITSLIVE.m	(revision 28023)
@@ -1,16 +1,16 @@
-function [vx_out, vy_out] = interpFromITSLIVE(X,Y,Tstart,Tend,varargin)
+function [vx_out, vy_out, time_out] = interpFromITSLIVE(X,Y,Tstart,Tend,varargin)
 	%interpFromITSLIVE: 
 	%	Interpolate ITS_LIVE velocity data to the given mesh
 	%
 	%   Usage:
-	%		 [vx_out, vy_out] = interpFromITSLIVE(X,Y,Tstart,Tend,varargin)
+	%		 [vx_out, vy_out, time_out] = interpFromITSLIVE(X,Y,Tstart,Tend,varargin)
 	%
 	%	X, Y are the coordinates of the mesh 
 	%	Tstart and Tend decimal year of the start and end time
+	%  vx_out and vy_out is (size(X), nt) tensor, depending on the dimension of X 
 	%
 	%   Example:
-	%			[vx, vy] = interpFromITSLIVE(md.mesh.x,md.mesh.y, tstart, tend);
+	%			[vx, vy, t] = interpFromITSLIVE(md.mesh.x,md.mesh.y, tstart, tend);
 	%
-	%   Options:
 	options    = pairoptions(varargin{:});
 
@@ -33,5 +33,5 @@
 
 	dataToLoad = {templist(dataInd).name};
-	timeToload = dataTime(dataInd);
+	time_out = dataTime(dataInd);
 
 	% Load x,y for GRE_G0240_0000.nc
@@ -56,6 +56,6 @@
 
 	% loop through all the files
-	vx_out = zeros(numel(X)+1, numel(timeToload)); 
-	vy_out = zeros(numel(X)+1, numel(timeToload)); 
+	vx_out = zeros([size(X), numel(time_out)]); 
+	vy_out = zeros([size(X), numel(time_out)]); 
 	for i = 1:length(dataToLoad)
 
@@ -66,9 +66,10 @@
 		vx(vx<-32760) = nan;
 		vy(vy<-32760) = nan;
-		vx_out(1:end-1,i) = InterpFromGrid(xh, yh, double(vx'), X, Y);
-		vx_out(end, i) = timeToload(i);
-		vy_out(1:end-1,i) = InterpFromGrid(xh, yh, double(vy'), X, Y);
-		vy_out(end, i) = timeToload(i);
+		vx_out(:,:,i) = InterpFromGrid(xh, yh, double(vx'), X, Y);
+		vy_out(:,:,i) = InterpFromGrid(xh, yh, double(vy'), X, Y);
 	end
+
+	vx_out = squeeze(vx_out);
+	vy_out = squeeze(vy_out);
 end
 
