%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Set path to include my .m files
%
path(path,'../matlab_cen');
%
% Load observational data
%
OPATH='../OBS/'
UVOF=[OPATH,'UV_INTEG.m3d']
%
[UVO,gridname,year,ncol,gmt]=read_obs(UVOF);
%
% Load model results
%
for isim=1:3
MPATH=['../CRUISE_Q4.',num2str(isim),'/'];
UVMF=[MPATH,'UV_INTEG-Q4.m3d']
[UVEM(isim,:,:),gridname,year,ncol,gmt]=read_obs_trunc(UVMF);
end
gridname='../MESH/bank150';
gridstruct=loadgrid(gridname);
%
% Plot time-series of observational and model results
%
tallfigure;
%
for isim=1:3
subplot(3,1,isim);
hold on
hp=plot(UVO(:,1),UVO(:,4),'b--');
hp=plot(UVO(:,1),UVO(:,5),'r-');
nmod=length(UVEM(isim,:,1));
for i=1:length(UVEM(isim,:,1))
ii(i)=find(abs(UVO(:,1)-UVEM(isim,i,1))<0.0001);
end
UM=UVO(ii,4)-reshape(UVEM(isim,:,4),nmod,1);
VM=UVO(ii,5)-reshape(UVEM(isim,:,5),nmod,1);
hp=plot(UVEM(isim,:,1),UM,'b-');
set(hp,'LineWidth',2.0)
hp=plot(UVEM(isim,:,1),VM,'r--');
set(hp,'LineWidth',2.0)
legend('Obs U','Obs V','Mod U','Mod V');
ylabel('Velocity (m/s)');
title(['Quoddy Simulation ',num2str(isim),': rms error=',num2str(rms(UVEM(isim,:,4)+sqrt(-1)*UVEM(isim,:,5))),' m/s']);
end
xlabel('Time (ydgmt0)');
%
% Vector plots of observational and model results
%
tallfigure;
%
subplot(2,2,1)
plotbnd(gridstruct);
axis([150000 250000 -250000 -150000]);
axis('square');set(gca,'XTick',[]);set(gca,'YTick',[]);
hold on
V=UVO(ii,:);
hv=vecplot2(V(:,2),V(:,3),V(:,4),V(:,5),0.5,'m/s',230000.,-160000.);
set(hv,'color','blue');
title(verbatim(['Observations: RMS = ',num2str(rms(V(:,4)+sqrt(-1.0)*V(:,5))),' m/s']))
for isim=1:3
subplot(2,2,isim+1)
V=reshape(UVEM(isim,:,:),length(UVEM(isim,:,1)),ncol);
plotbnd(gridstruct);
axis([150000 250000 -250000 -150000]);
axis('square');set(gca,'XTick',[]);set(gca,'YTick',[]);
hold on
V=reshape(UVEM(isim,:,:),length(UVEM(isim,:,1)),ncol);
hv=vecplot2(V(:,2),V(:,3),V(:,4),V(:,5),0.5,'m/s',230000.,-160000.);
set(hv,'color','red')
title(['Quoddy Simulation ',num2str(isim),': rms error=',num2str(rms(V(:,4)+sqrt(-1)*V(:,5))),' m/s']);
end
%
% Drifter plots of and model results
%
tallfigure;
%
plotbnd(gridstruct);
axis([160000 230000 -230000 -160000]);
axis('square');set(gca,'XTick',[]);set(gca,'YTick',[]);
hold on
clrli=['b- ';'r--';'g-.']
for isim=1:3
PTHFILE=['../CRUISE_Q4.',num2str(isim),'/DRIFTERS.pth']
plot_pth_only(PTHFILE,clrli(isim,:))
end
title('Quoddy Drifter Trajectories: Simulation 1(b-),Simulation 2(r--), and Simulation 3(g-.)')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%