path(path,'/home/ruoying/Software/mapstuff/')
path(path,'/home/ruoying/Software/mtool/')
path(path,'/home/ruoying/ROMS/matlab/tools/')
path(path,'/home/ruoying/Casco/casco4c/mfiles/')
path(path,'/home/ruoying/ROMS/matlab/movies/')
path(path,'/home/ruoying/ROMS/matlab/floats/')

run /home/ruoying/Software/opnml_matlab5/startup

 fn='/home/ruoying/Experiment/FCAST2_stw2_vn_final/fcast_archives/OC391_vn_qtc4/CRUISE_Q5.1/TAUXY.Q5.m1d'

 [wd,g,yr]=read_obs(fn);

% interpolote wd to 6 hourly data
t=wd(:,1); ti=[t(1):0.25:t(end)];
u=interp1(t,wd(:,2),ti);
v=interp1(t,wd(:,3),ti);

fid=fopen('windts.mts','w')
fprintf(fid,'%s \n','comment');
fprintf(fid,'%s \n','21 5 2003 0. ');
fprintf(fid,'%s \n','69  21600 ');
fprintf(fid,'%s \n','2');
for k=1:length(u)
 fprintf(fid,'%7.4f %7.4f \n',u(k),v(k));
end

