
load ../mat/wind_1109.mat

Um0 = squeeze(Umean(3,:,:))/C;
Us0 = squeeze(Ustd(3,:,:))/C;
Um = Um0-Us0;
Up = Um0+Us0;
gind = [1 2 3 4 5 6 7 8];
gind = [1 2 5 7 8];

Y= [1:8];
figure(1),orient tall,clf

xSize = 16; ySize = 12;  %size of the figure to be generated
set(gcf,'PaperUnits','centimeters')
set(gcf,'PaperPosition',[0 0  xSize ySize])

x0 = 0.10;
xwt1 = 0.42; xwt2=0.32; dx = 0.08;  x1 = x0+xwt1+dx;
y0 = 0.11;
xw = xwt1+xwt2+dx;
yw = 0.37;  dy = 0.1
ywt = 0.37;
ywb = 0.34
y1 = y0+dy+yw;

pos = [x0 y1 xwt1 ywt;  x1 y1 xwt2 ywt; x0 y0 xw ywb];
subplot('position',pos(1,:))
for i=1:length(gind),
    hold on
    hh=errorbar( Um0(gind(i),1:8),Y(1:8),Us0(gind(i),1:8),Us0(gind(i),1:8),'d','horizontal');
    hh.MarkerFaceColor = 'auto';
    hh.MarkerSize = 5;
    %    plot( Um0(gind(i),1:8),Y(1:8),'d')
    %for j=1:8,
    %    plot( [ Um(gind(i),j) Up(gind(i),j)],[ Y(j) Y(j)], 'k')
    %end;
end;
axis([-3 4.5 0 8.5])
box on
grid on
xlabel('$\langle\bar{U}\rangle/C$','interpreter','latex')
ylabel('$z/h_0$','interpreter','latex')
title('(a)','interpreter','latex')

iy=6;
subplot('position',pos(2,:))
Umean6 = squeeze(Umean(:,:,6));
% hh=plot(REstar,Umean6(1,:)/C,'ko','markersize',6)
% set(hh,'markerfacecolor','g')
% hold on
% hh=plot(REstar,Umean6(2,:)/C,'ko','markersize',6)
% set(hh,'markerfacecolor','r')
h2=plot(REstar,Umean6(3,:)/C,'ko','markersize',7)
set(h2,'markerfacecolor','b')
hold off
grid
title(sprintf('(b) $z/h_0=%.0f$',Y(iy)),'interpreter','latex')
%legend('Bo=200','Bo=1000','Bo=4000','location','northwest')
ylabel('$\langle \bar{U}\rangle/C$','interpreter','latex')
xlabel('$\mathrm{Re}^*$','interpreter','latex')


subplot('position',pos(3,:))
h3=plot(time(itime)-1001,squeeze(Umeanx(3,[1 2 5 7 8],:,1)),'linewidth',1),grid
xlabel('$t\sqrt{g/h}$','interpreter','latex')
ylabel('$\bar{U}/C$','interpreter','latex')
axis([0 20 -2.5 4.5])
legend('$\mathrm{Re}^*=2400$','$\mathrm{Re}^*=1800$','$\mathrm{Re}^*=0$','$\mathrm{Re}^*=-1200$','$\mathrm{Re}^*=-1800$','interpreter','latex','location','northwest')
title('(c) $z/h_0=1$','interpreter','latex')

           set(gcf,'PaperUnits','centimeters')
           set(gcf,'papersize',[xSize ySize],'paperposition',[ 0 0 xSize ySize]);

print -dpdf test.pdf

return

% Make some plots vs. time at different Bo,REstar
for k=1:nB,
    figure(k),clf,orient tall
    for i=1:nR,
        subplot(4,2,i)

      title(sprintf('Bo=%d, REstar=%d, y=[1:8]',Bo(k),REstar(i)))
      tmp = squeeze(Umeanx(k,i,:,:));
      maxU = max(tmp(:));  minU = min(tmp(:));
      if (i<5)
          axis([1001 1022 -0.2 1.1*maxU])
      elseif (i==5)
          axis([1001 1022 -0.05 0.05])
      else
          axis([1001 1022 1.1*minU 0.2])
      end;
      if (i>6),
          xlabel('time')
      end
      if (mod(i,2)==1),
          ylabel('Uwind')
      end;
    end;
    print('-dpdf',sprintf('Figures/Wind_Bo%d_REstar_time.pdf',Bo(k)))
end;


return

figure(10),clf,orient tall
for iy=1:length(Y),
    subplot(4,2,iy)
    plot(REstar,squeeze(Umean(:,:,iy))/C,'.','markersize',12),grid
    title(sprintf('y=%.0f',Y(iy)))
    if (iy==1),
        legend('Bo=200','Bo=1000','Bo=4000','location','northwest')
    end;
    if (mod(iy,2)==1),
          ylabel('$\bar{U}/C$','interpreter','latex')
    end;
    if (i>6),
          xlabel('$\mathrm{Re}^*$','interpreter','latex')
    end
end;                       
