path(path,'/home/ruoying/Software/mapstuff/')
path(path,'/home/ruoying/Software/mtool/')
path(path,'/home/ruoying/ROMS/matlab/tools/')

load /home/ruoying/MERHAB/bath_coast/GOM_mask.mat
run /home/ruoying/Software/opnml_matlab5/startup

gn='/home/ruoying/MERHAB/OC391_archive/FCAST_2.0_keston/MESH/stw2';
stw2=loadgrid(gn)
[stw2.y,stw2.x]=xy2ll(stw2.x,stw2.y); % default lon lat: Boston

load /home/ruoying/MERHAB/CTD/2003oc391.mat
cx=-1*cruise.lon; cy=cruise.lat;

 dir='/home/ruoying/MERHAB/OC391_archive/FCAST_2.0_keston/fcast_archives/RH22/CRUISE_Q5.1/'
 fn1=[dir 'STF001.icq5'];

 dir='/home/ruoying/MERHAB/OC391_archive/FCAST_2.0_keston/fcast_archives/RH25/CRUISE_Q5.1/'
 fn2=[dir 'STF001.icq5'];

orient tall
for k=1:6
 if k==6; xi=[cx(1:12)]; yi=[cy(1:12)]; end
 if k==5; xi=[cx(13:26)]; yi=[cy(13:26)]; end
 if k==4; xi=[cx(27:40)]; yi=[cy(27:40)]; end
 if k==3; xi=[cx(41:54)]; yi=[cy(41:54)]; end
 if k==2; xi=[cx(55:69)]; yi=[cy(55:69)]; end
 if k==1; xi=[cx(70:83)]; yi=[cy(70:83)]; end

 subplot(6,2,2*k-1)
 icq=read_icq5(fn1);
 R=searibbon2(icq,stw2,xi,yi);
 pcolor(R.x,R.ZMID,R.TMPMID);shading interp; caxis([4 10])
 set(gca,'tickdir','out','fontsize',8)
 if k==1, title('Prior Temperature','fontweight','bold','fontsize',12); end
 
 subplot(6,2,2*k)
 icq=read_icq5(fn2);
 R=searibbon2(icq,stw2,xi,yi);
 pcolor(R.x,R.ZMID,R.TMPMID);shading interp; caxis([4 10])
 set(gca,'tickdir','out','fontsize',8)
 if k==1, title('Posterior Temperature','fontweight','bold','fontsize',12);end
end
