

%lon lat at shell point USGS sensor
lon_sp=-(82 + 0 + 15.95./3600);
lat_sp=26 + 31./60 + 26.6./3600;

k=16;  %sigma coord starts at bottom


cd ../olduncompressed

time=[];

u=[];
v=[];

for f=26:34,
fn=['tmpnc' num2str(f) '.nc'];

% nc=netcdf(fn);  %opens file 
% time=nc{'ocean_time'}(:);
% lon=nc{'lon_u'}(:,:);
% lat=nc{'lat_u'}(:,:);

if f==26,
lon=nc_varget(fn,'lon_u');
lat=nc_varget(fn,'lat_u');

[i,j,dist_km]=near2d(lon,lat,lon_sp,lat_sp)

end

time=[time;nc_varget(fn,'ocean_time')];

%load velocity

u_=nc_varget(fn,'ubar');

v_=nc_varget(fn,'vbar');


u=[u ;u_(:,i,j)]; %j)  %,i);
v=[v ;v_(:,i,j)]; % j),i);

end

%close(nc)
cd ../analout

jd=datenum(1968,5,24)+time./(3600.*24);



figure
plot(jd,u,'.-',jd,v,'.-')
legend('u','v')
datetick