function [cmod]=syncruise(cdf,x,y,z,jd);
%function [cmod]=syncruise(cdf,x,y,z,jd);
%
% cdf = ecomsi.cdf file to extract data out of along cruise track
% x = x location of profiles in km
% y = y location of profiles in km
% z = vector of profile depths

 jdmod=ecomtime2(cdf);
% we need the x and y locations of the model grid
 [depth,xmod,ymod]=kslice(cdf,'depth');
 iwet=find(~isnan(depth));

 xmod=xmod/1000;  % convert to km
 ymod=ymod/1000;

 nsta=length(x);
 z=-abs(z);
 cmod=ones(length(z),length(x))*nan;
 for i=1:nsta
   ind=nearxy(xmod(iwet),ymod(iwet),x(i),y(i));
   ind=iwet(ind);
   [imod,jmod]=ind2ij(xmod,ind);
   ti=tind(jdmod,gregorian(jd(i)));
   [cc,jdt,zmod]=ecomts(cdf,'conc',imod,jmod,nan,ti);
   ii=find(z>min(zmod)&z<max(zmod));
   cmod(ii,i)=interp(zmod,cc,z(ii));
  end
