clear all
name = 'OC391-FC1'
clf
BCF=['M2';'Z0'];
clpt = ['r*';'b+'];
%
%tallfigure;
subplot(2,2,1)
for i=1:2
   file=['../CLIM_BCS/BCS_',BCF(i,:),'.s2c']
   [BCS,freq,gridname]=read_s2c(file);
   if i == 2
     plot(BCS(:,2)*10,clpt(i,:));
   else
     plot(BCS(:,2),clpt(i,:));
   end
   hold on
end
titl = ['prior ',name]
title(titl)
xlabel('node number')
ylabel('amplitude (m)')
set(gca,'Xlim',[0 58]);
ybnds = get(gca,'YLim');
ymax = ybnds(2);
plot([11 11],[0 ymax]);
legend('M2 clim','Z0 clim')

subplot(2,2,2)
for i=1:2
   file=['../CRUISE_T6.ALL/BCS_PRT',num2str(i),'.s2c']
   [BCS,freq,gridname]=read_s2c(file);
   plot(BCS(:,2),clpt(i,:));
   hold on
end
titl2=['first inv.',name]
title(titl2)
xlabel('node number')
ylabel('amplitude (m)')
set(gca,'Xlim',[0 58]);
legend('M2','Z0')
ybnds = get(gca,'YLim');
ymax = ybnds(2);
plot([11 11],[0 ymax]);


subplot(2,2,3)
for i=3:4
   file=['../CRUISE_T6.ALL/BCS_PRT',num2str(i),'.s2c']
   [BCS,freq,gridname]=read_s2c(file);
   freq
   plot(BCS(:,2),clpt(i-2,:));
   hold on
end
titl3=['second inv.',name]
title(titl3)
xlabel('node number')
ylabel('amplitude (m)')
set(gca,'Xlim',[0 58]);
legend('M2','Z0')
ybnds = get(gca,'YLim');
ymax = ybnds(2);
plot([11 11],[0 ymax]);

subplot(2,2,4)
for i=1:2:3
   file=['../CRUISE_T6.ALL/BCS_PRT',num2str(i),'.s2c']
   [BCS,freq,gridname]=read_s2c(file);
   if i == 1
     plot(BCS(:,3),clpt(1,:));
   else
     plot(BCS(:,3),clpt(2,:));
   end
   hold on
end
titl4 = ['M2 inv. phase ',name];
title(titl4)
xlabel('node number')
ylabel('phase')
ybnds = get(gca,'YLim');
ymax = ybnds(2);
plot([11 11],[0 ymax]);
legend('M2, inv1','M2, inv2')
axis([0 58 0 360])

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
