function [w,jd]=tsvel(cdf,lev);
% function [w,jd]=tsvel(cdf,lev);
% reads salt from TSEPIC style files
[t]=mcvgt(cdf,'time');
nt=length(t);
%
[stations]=mcvgt(cdf,'stations');
nsta=length(stations);
%
[sigma]=mcvgt(cdf,'sigma');
nsigma=length(sigma);
if(lev>nsigma),
  disp('invalid level');
  return
end
%
lev=nsigma-lev+1;
corner=[0 lev-1 0 0];
edges=[nt, 1, 1, nsta];
w=mcvgt(cdf,'salt',corner,edges);
%
base_date=zeros(1,6);
base_date(1:3)=mcagt(cdf,'global','base_date');
jd0=julian(base_date);
jd=jd0+t/(3600*24);
