function [w,jd]=getvel(cdf,start,stop,var1,var2);
%GETVEL gets velocity time series from cdf file(s)
%  USAGE 
%     [w,jd]=getvel(cdf,start,stop,uvar,vvar;
%    or
%     [w,jd]=getvel(cdf,start,stop);   (uses 'east' and 'north')
%     or
%     [w,jd]=getvel(cdf);
% 
%  where: cdf = cdf file
%         start = [yyyy mm dd hh mi sc];
%         stop  = [yyyy mm dd hh mi sc];
%         uvar = u variable name
%         vvar = v variable name
%
%    if start and stop are missing, then the whole series is returned
%
%     jd = decimal julian days
%     w  = complex velocity vector
if(nargin<4),
  var1='east';   % the u component of velocity
  var2='north';  % the v component of velocity
end
%
[m,n]=size(cdf);
if nargin==1,
  [u,jd]=getts(cdf,var1);
  [v,jd]=getts(cdf,var2);
else
  [u,jd]=getts(cdf,var1,start,stop);
  [v,jd]=getts(cdf,var2,start,stop);
end
nt=length(jd);
w=u+j*v;
