%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% This code plots the Basic Graphs %%%%
%%%% for the PAPER %%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

keep cr;


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Creation of MAIN Graph (Mixing Ratio-Cloud Base and Top-LCL) %%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

cr_title = {'EPIC 2001'; 'Stratus 2003'; 'Stratus 2004'};
cr_fname = {'EPIC'; 'Stratus03'; 'Stratus04'};
day_of_month = {'Day of October 2001 (UTC)'; 'Day of November 2003 (UTC)'; 'Day of December 2004 (UTC)'};
radar_id = {'Cloud Top (MMCR)'; 'Cloud Top (MMCR)'; 'Inversion Base (Wind Profiler)';};
ls = [10 11 6]; bs = [16 15.8 11.2];
le = [25 24 23]; be = [22.3 21.37 16.25];

for i=1:3
    cr(i).flux.min.zlcl_int = interp1(cr(i).flux.min.mday, cr(i).flux.min.zlcl, cr(i).ceilo.min.mday);
end

%for i=1:3
i=3
    figure(i)
    set(gcf,'DefaultAxesFonts',16);   %%%% 24, if saved after full screen
    set(gcf,'DefaultAxesFontName','times');

    dummy=jet(128);
    dummy(1,1:3)=1;
    colormap(dummy);
    
    if i==1
        imagesc(cr(i).sound.data.mday(4:end), cr(i).sound.data.h/1000, cr(i).sound.data.r(:,4:end), [0 13]);    
    else
        imagesc(cr(i).sound.data.mday, cr(i).sound.data.h/1000, cr(i).sound.data.r, [0 13]);
    end
    
    axis xy; ylim([0 3]);
    hc = colorbar;
    %set(hc,'LineWidth',2)
    
    xlabel(day_of_month(i),'FontName','times','FontSize',16); %%%% 24, if saved after full screen
    ylabel('Height (Km)','FontName','times','FontSize',16);   %%%% 24, if saved after full screen
    title([cr(i).name ', Mixing Ratio (Rawinsondes), Cloud Boundaries and LCL'],'FontName','times','FontSize',16);   %%%% 24, if saved after full screen
    
    hold on
    
    plot(cr(i).ceilo.min.mday, cr(i).flux.min.zlcl_int/1000,'.');
    plot(cr(i).ceilo.min.mday, cr(i).ceilo.min.clba/1000,'k.')
    plot(cr(i).radar.hr.mday, cr(i).radar.hr.cltop/1000,'r*')
        
    h=legend('LCL (Surface Met)','Cloud Base (Ceilometer)', char(radar_id(i)));
    set(h,'FontName','times','FontSize',14);   %%%% 20, if saved after full screen
    
    %xlim([ls(i) le(i)]); 
    %ylim([0 3]);
    h1=plot([bs(i) bs(i)],ylim,'k--');
    set(h1,'LineWidth',2)
    h2=plot([be(i) be(i)],ylim,'k--');
    set(h2,'LineWidth',2)
    
    print('-djpeg100',['C:\THESIS\PAPER\Old_Graphs\' char(cr_fname(i)) '_MainGraph.jpg'])

%end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Plot cloud fraction cruise-composite graphs from the "cr" .mat file %%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

cr_title = {'EPIC 2001'; 'Stratus 2003'; 'Stratus 2004'};
cr_fname = {'EPIC'; 'Stratus03'; 'Stratus04'};
day_of_month = {'Day of October 2001 (UTC)'; 'Day of November 2003 (UTC)'; 'Day of December 2004 (UTC)'};
ls = [10 11 6];
le = [25 24 21];

for i=1:3

    figure(i)
    set(gcf,'DefaultAxesFonts',16);
    set(gcf,'DefaultAxesFontName','times');
    
    h = plot(cr(i).ceilo.hr.mday,cr(i).ceilo.hr.clfr*100,'o--');
    set(h,'color',[0.3 0.3 0.3])
    xlim([ls(i) le(i)]); ylim([0 100]);
    grid on
    
    if i==1
        set(gca,'xtick',[10:2:25]);
        set(gca,'xticklabel',[10:2:24]);
    elseif i==3
        set(gca,'xtick',[6:2:20]);
        set(gca,'xticklabel',[6:2:20]);
    end
    
    xlabel(day_of_month(i),'FontName','times','FontSize',16);
    ylabel('Fraction (%)','FontName','times','FontSize',16);
    title([char(cr_title(i)), ', Zenith cloud fraction (Ceilometer)'],'FontName','times','FontSize',16);
    
    print('-djpeg100',['C:\THESIS\PAPER\Old_Graphs\' char(cr_fname(i)) '_cloud_fraction_hr.jpg'])

end

close all
keep cr


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Plot drizzle fraction (occurrence) cruise-composite histograms %%%%%
%%%% and diurnal cycle cloud & drizzle fraction graphs from the "cr" %%%%
%%%% structure (epic_stratus_all.mat) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


cr_title = {'EPIC 2001'; 'Stratus 2003'; 'Stratus 2004'};
cr_fname = {'EPIC'; 'Stratus03'; 'Stratus04'};
day_of_month = {'Day of October 2001 (UTC)'; 'Day of November 2003 (UTC)'; 'Day of December 2004 (UTC)'};
month = {'10'; '11'; '12'};
radar = {'MMCR'; 'MMCR'; 'FMCW'};
ls = [10 14 6];
le = [25 24 20];


for i=1:3

    figure(i+3)
    set(gcf,'DefaultAxesFonts',16);
    set(gcf,'DefaultAxesFontName','times');
    h = bar(cr(i).radar.hr.mday, cr(i).radar.hr.drfr*100);
    set(h,'facecolor',[0.6 0.6 0.6]);
    set(h,'edgecolor',[0.4 0.4 0.4]);
    xlim([ls(i) le(i)]); 
    grid on;
    
    if i==1
        set(gca,'xtick',[10:2:25]);
        set(gca,'xticklabel',[10:2:24]);
    end
    
    xlabel(day_of_month(i),'FontName','times','FontSize',16);
    ylabel('Fraction (%)','FontName','times','FontSize',16);
    title([char(cr_title(i)) ', Drizzle occurrence (' char(radar(i)) ' )'],'FontName','times','FontSize',16);
    
    print('-djpeg100',['C:\THESIS\PAPER\Old_Graphs\' char(cr_fname(i)) '_drizzle_fraction_hr.jpg'])
    
end

%{
for i=1:3
    
    figure(i+6)
    set(gcf,'DefaultAxesFonts',16);
    set(gcf,'DefaultAxesFontName','times');
    h = bar(1:24,[cr(i).ceilo.diu.clfr*100 cr(i).radar.diu.drfr*100]);
    set(h(1),'facecolor',[0.1 0.1 0.1]);
    set(h(2),'facecolor',[0.7 0.7 0.7]);
    set(gca,'xtick',[1:2:23]);
    set(gca,'xticklabel',[18 20 22 0 2 4 6 8 10 12 14 16]);
    xlim([0.5 24.5]); grid on;

    xlabel('Local Time','FontName','times','FontSize',16); 
    ylabel('Fraction (%)','FontName','times','FontSize',16);
    title ( [char(cr_title(i)) ', Diurnal cycle of cloud fraction (black) and drizzle occurrence (gray)'],'FontName','times','FontSize',16);

    print('-djpeg100',['C:\THESIS\PAPER\Old_Graphs\' char(cr_fname(i)) '_cloud_drizzle_fr_diu.jpg'])

end
%}


    
figure(7)
%orient tall

set(gcf,'DefaultAxesFonts',14);
set(gcf,'DefaultAxesFontName','times');

h1 = plot(1:24,cr(1).ceilo.diu.clfr*100,'*-');
set(h1,'color',[0 0 0]); hold on;
h2 = plot(1:24,cr(2).ceilo.diu.clfr*100,'s--'); 
set(h2,'color',[0 0 0]);
h3 = plot(1:24,cr(3).ceilo.diu.clfr*100,'o-.'); 
set(h3,'color',[0 0 0]);

h = legend('EPIC 2001','Stratus 2003','Stratus 2004');
set(h,'FontName','times','FontSize',10);

h4 = plot(1:24,cr(1).radar.diu.drfr*100,'*-');
set(h4,'color',[0.4 0.4 0.4]); hold on;
h5 = plot(1:24,cr(2).radar.diu.drfr*100,'s--');
set(h5,'color',[0.4 0.4 0.4]); hold on;
h6 = plot(1:24,cr(3).radar.diu.drfr*100,'o-.');
set(h6,'color',[0.4 0.4 0.4]); hold on;

set(gca,'xtick',[1:2:23]);
set(gca,'xticklabel',[18 20 22 0 2 4 6 8 10 12 14 16]);
xlim([0 24]); grid on;

xlabel('Local Time','FontName','times','FontSize',14); 
ylabel('Fraction (%)','FontName','times','FontSize',14);
title ('Diurnal cycle of cloud fraction (black) and drizzle occurrence (gray)','FontName','times','FontSize',14);

print('-djpeg100',['C:\THESIS\PAPER\Old_Graphs\All_cloud_drizzle_fractions_diurnal.jpg'])


close all
keep cr


%{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Plot LWP cruise-composite graphs for EPIC and PACS from Paquita's data %%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


lwp = load('C:\THESIS\DATA\EPIC\data\Paquita\epic_newlwp_nohd.txt');
%lwp = load('C:\THESIS\DATA\PACS03\DATA\Paquita\pacs03_lwp_nohd.txt');

mday    = lwp(:,1);
lwp_mwr = lwp(:,2);
%lwp_ad  = lwp(:,3);

figure(30)
set(gcf,'DefaultAxesFonts',16);
set(gcf,'DefaultAxesFontName','times');
plot(mday-273,lwp_mwr,'ko')
%hold on
%plot(mday-304,lwp_ad,'*')
%xlim([0.5 24.5]);
grid on
xlabel('Day of October 2001 (UTC)','FontName','times','FontSize',16);
ylabel('LWP (g/m^2)','FontName','times','FontSize',16);
title('EPIC 2001, Microwave Radiometer LWP, Corrected physical retrievals','FontName','times','FontSize',16);
%}


%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Plot Flux Graphs %%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%

cr_title = {'EPIC 2001'; 'Stratus 2003'; 'Stratus 2004'};
cr_fname = {'EPIC'; 'Stratus03'; 'Stratus04'};
day_of_month = {'Day of October 2001 (UTC)'; 'Day of November 2003 (UTC)'; 'Day of December 2004 (UTC)'};
ls = [10 11 6]; bs = [16 15.8 11.2];
le = [25 24 23]; be = [22.3 21.37 16.25];

for i=1:3

    figure(i)
    set(gcf,'DefaultAxesFonts',16);
    set(gcf,'DefaultAxesFontName','times');
    
    h1 = plot(cr(i).flux.min.mday,cr(i).flux.min.sst,'.');
    set(h1,'color',[0 0 0])
    hold on; grid on;
    h2 = plot(cr(i).flux.min.mday,cr(i).flux.min.tair,'.');
    set(h2,'color',[0.5 0.5 0.5])
    
    if i==1
        set(gca,'xtick',[10:2:25]);
        set(gca,'xticklabel',[10:2:24]);
    end
    
    xlim([ls(i) le(i)]); 
    ylim([15 25]);
    plot([bs(i) bs(i)],ylim,'k--'); 
    plot([be(i) be(i)],ylim,'k--');
    
    xlabel(day_of_month(i),'FontName','times','FontSize',16);
    ylabel('Temperature (^o C)','FontName','times','FontSize',16);
    title([char(cr_title(i)), ', SST (black) & T_{air} (gray)'],'FontName','times','FontSize',16);
    
    print('-djpeg100',['C:\THESIS\PAPER\Old_Graphs\' char(cr_fname(i)) '_SST_Tair_5min.jpg'])

end

close all; clear h1 h2

for i=1:3

    figure(i)
    set(gcf,'DefaultAxesFonts',16);
    set(gcf,'DefaultAxesFontName','times');
    
    h1 = plot(cr(i).flux.min.mday, cr(i).flux.min.sh,'.');
    set(h1,'color',[0 0 0])
    hold on; grid on;
    h2 = plot(cr(i).flux.min.mday, cr(i).flux.min.lh,'.');
    set(h2,'color',[0.7 0.7 0.7])
    h3 = plot(cr(i).flux.min.mday, cr(i).flux.min.sh+0.608*292*0.0004*cr(i).flux.min.lh,'.');
    set(h3,'color',[0.4 0.4 0.4])
    
    if i==1
        set(gca,'xtick',[10:2:25]);
        set(gca,'xticklabel',[10:2:24]);
    end
    
    xlim([ls(i) le(i)]); 
    ylim([-20 200]);
    plot([bs(i) bs(i)],ylim,'k--'); 
    plot([be(i) be(i)],ylim,'k--');
    
    xlabel(day_of_month(i),'FontName','times','FontSize',16);
    ylabel('Flux (Wm^{-2})','FontName','times','FontSize',16);
    title([char(cr_title(i)), ', Surface turbulent fluxes'],'FontName','times','FontSize',16);
    h=legend('SH (black)','LH (light gray)','VH (dark gray)');
    set(h,'FontName','times','FontSize',12);
    
    print('-djpeg100',['C:\THESIS\PAPER\Old_Graphs\' char(cr_fname(i)) '_SH_LH_VH_5min.jpg'])

end

close all
keep cr



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Plot Composite soundings %%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


ymax=3;
h = [10:10:20000]/1000;

figure(10)

orient tall
set(gcf,'DefaultAxesFontSize',12)
set(gcf,'DefaultAxesFontName','times');


subplot(3,2,1)
plot(cr(1).sound.comp.dim.mean.theta, h, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.dim.mean.theta, h, 'k--'); plot(cr(3).sound.comp.dim.mean.theta, h, 'k-.');
ylim([0 ymax]); %xlim([280 320]); 
ylabel('Height (km)','FontName','times','FontSize',12);
title('\theta (K)','FontName','times','FontSize',12);

subplot(3,2,2)
plot(cr(1).sound.comp.dim.mean.thetae, h, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.dim.mean.thetae, h, 'k--'); plot(cr(3).sound.comp.dim.mean.thetae, h, 'k-.');
ylim([0 ymax]); %xlim([300 330]); 
%ylabel('Height (km)','FontName','times','FontSize',12);
title('\thetae (K)','FontName','times','FontSize',12);

subplot(3,2,3)
plot(cr(1).sound.comp.dim.mean.r, h, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.dim.mean.r, h, 'k--'); plot(cr(3).sound.comp.dim.mean.r, h, 'k-.');
ylim([0 ymax]); xlim([0 15]); 
ylabel('Height (km)','FontName','times','FontSize',12);
title('r (g/kg)','FontName','times','FontSize',12);

subplot(3,2,4)
plot(cr(1).sound.comp.dim.mean.rh, h, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.dim.mean.rh, h, 'k--'); plot(cr(3).sound.comp.dim.mean.rh, h, 'k-.');
ylim([0 ymax]);
%ylabel('Height (km)','FontName','times','FontSize',12);
title('RH (%)','FontName','times','FontSize',12);

subplot(3,2,5)
plot(cr(1).sound.comp.dim.mean.wspd, h, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.dim.mean.wspd, h, 'k--'); plot(cr(3).sound.comp.dim.mean.wspd, h, 'k-.');
ylim([0 ymax]); xlim([0 15]); 
ylabel('Height (km)','FontName','times','FontSize',12);
title('Wind Spd (m/s)','FontName','times','FontSize',12);

subplot(3,2,6)
plot(cr(1).sound.comp.dim.mean.wdir, h, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.dim.mean.wdir, h, 'k--'); plot(cr(3).sound.comp.dim.mean.wdir, h, 'k-.');
ylim([0 ymax]); xlim([100 150]); 
%ylabel('Height (km)','FontName','times','FontSize',12);
title('Wind Dir (^o)','FontName','times','FontSize',12);
    
%text(0, 0, ['Composite Mean profiles for WHOI buoy period: EPIC (solid) - Stratus03 (dashed) - Stratus04 (dashed-dotted)'],'FontName','times','FontSize',10);
%gtext([cr_name ', Sounding Launch Date: ' month '/' day(u) ' - Hour: ' hour(u) ' (UTC)'],'FontName','times','FontSize',10);

%print -djpeg100 C:\THESIS\PAPER\Old_Graphs\All_buoy_mean_profiles.jpg


%{
figure(11)

orient tall
set(gcf,'DefaultAxesFontSize',12)
set(gcf,'DefaultAxesFontName','times');


subplot(3,2,1)
plot(cr(1).sound.comp.dim.std.theta, h, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.dim.std.theta, h, 'k--'); plot(cr(3).sound.comp.dim.std.theta, h, 'k-.');
ylim([0 ymax]); %xlim([280 320]); 
ylabel('Height (km)','FontName','times','FontSize',12);
title('\theta (K)','FontName','times','FontSize',12);

subplot(3,2,2)
plot(cr(1).sound.comp.dim.std.thetae, h, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.dim.std.thetae, h, 'k--'); plot(cr(3).sound.comp.dim.std.thetae, h, 'k-.');
ylim([0 ymax]); %xlim([300 330]); 
%ylabel('Height (km)','FontName','times','FontSize',12);
title('\thetae (K)','FontName','times','FontSize',12);

subplot(3,2,3)
plot(cr(1).sound.comp.dim.std.r, h, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.dim.std.r, h, 'k--'); plot(cr(3).sound.comp.dim.std.r, h, 'k-.');
ylim([0 ymax]); %xlim([0 15]); 
ylabel('Height (km)','FontName','times','FontSize',12);
title('r (g/kg)','FontName','times','FontSize',12);

subplot(3,2,4)
plot(cr(1).sound.comp.dim.std.rh, h, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.dim.std.rh, h, 'k--'); plot(cr(3).sound.comp.dim.std.rh, h, 'k-.');
ylim([0 ymax]);
%ylabel('Height (km)','FontName','times','FontSize',12);
title('RH (%)','FontName','times','FontSize',12);

subplot(3,2,5)
plot(cr(1).sound.comp.dim.std.wspd, h, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.dim.std.wspd, h, 'k--'); plot(cr(3).sound.comp.dim.std.wspd, h, 'k-.');
ylim([0 ymax]); %xlim([0 15]); 
ylabel('Height (km)','FontName','times','FontSize',12);
title('Wind Spd (m/s)','FontName','times','FontSize',12);

subplot(3,2,6)
plot(cr(1).sound.comp.dim.std.wdir, h, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.dim.std.wdir, h, 'k--'); plot(cr(3).sound.comp.dim.std.wdir, h, 'k-.');
ylim([0 ymax]); %xlim([100 150]); 
%ylabel('Height (km)','FontName','times','FontSize',12);
title('Wind Dir (^o)','FontName','times','FontSize',12);
    
%text(0, 0, ['Composite STD profiles for WHOI buoy period: EPIC (solid) - Stratus03 (dashed) - Stratus04 (dashed-dotted)'],'FontName','times','FontSize',12,'FontWeight','bold','FontAngle','italic');
%gtext([cr_name ', Sounding Launch Date: ' month '/' day(u) ' - Hour: ' hour(u) ' (UTC)'],'FontName','times','FontSize',12);

%print -djpeg100 C:\THESIS\PAPER\Old_Graphs\All_buoy_std_profiles.jpg
%}

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

ymax = 2;
h_norm = [0.01:0.01:2];


figure(12)

orient tall
set(gcf,'DefaultAxesFontSize',12)
set(gcf,'DefaultAxesFontName','times');

subplot(3,2,1)
plot(cr(1).sound.comp.nondim.mean.theta, h_norm, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.nondim.mean.theta, h_norm, 'k--'); plot(cr(3).sound.comp.nondim.mean.theta, h_norm, 'k-.');
ylim([0 ymax]); %xlim([280 320]); 
ylabel('Z/Zi','FontName','times','FontSize',12);
title('\theta (K)','FontName','times','FontSize',12);

subplot(3,2,2)
plot(cr(1).sound.comp.nondim.mean.thetae, h_norm, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.nondim.mean.thetae, h_norm, 'k--'); plot(cr(3).sound.comp.nondim.mean.thetae, h_norm, 'k-.');
ylim([0 ymax]); %xlim([300 330]); 
%ylabel('Z/Zi','FontName','times','FontSize',12);
title('\thetae (K)','FontName','times','FontSize',12);

subplot(3,2,3)
plot(cr(1).sound.comp.nondim.mean.r, h_norm, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.nondim.mean.r, h_norm, 'k--'); plot(cr(3).sound.comp.nondim.mean.r, h_norm, 'k-.');
ylim([0 ymax]); xlim([0 15]); 
ylabel('Z/Zi','FontName','times','FontSize',12);
title('r (g/kg)','FontName','times','FontSize',12);

subplot(3,2,4)
plot(cr(1).sound.comp.nondim.mean.rh, h_norm, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.nondim.mean.rh, h_norm, 'k--'); plot(cr(3).sound.comp.nondim.mean.rh, h_norm, 'k-.');
ylim([0 ymax]);
%ylabel('Z/Zi','FontName','times','FontSize',12);
title('RH (%)','FontName','times','FontSize',12);

subplot(3,2,5)
plot(cr(1).sound.comp.nondim.mean.wspd, h_norm, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.nondim.mean.wspd, h_norm, 'k--'); plot(cr(3).sound.comp.nondim.mean.wspd, h_norm, 'k-.');
ylim([0 ymax]); xlim([0 15]); 
ylabel('Z/Zi','FontName','times','FontSize',12);
title('Wind Spd (m/s)','FontName','times','FontSize',12);

subplot(3,2,6)
plot(cr(1).sound.comp.nondim.mean.wdir, h_norm, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.nondim.mean.wdir, h_norm, 'k--'); plot(cr(3).sound.comp.nondim.mean.wdir, h_norm, 'k-.');
ylim([0 ymax]); xlim([100 150]); 
%ylabel('Z/Zi','FontName','times','FontSize',12);
title('Wind Dir (^o)','FontName','times','FontSize',12);
    
%text(0, 0, ['Normalized mean profiles for WHOI buoy period: EPIC (solid) - Stratus03 (dashed) - Stratus04 (dashed-dotted)'],'FontName','times','FontSize',16,'FontWeight','bold');
%print -djpeg100 C:\THESIS\PAPER\Old_Graphs\All_buoy_mean_profiles_norm.jpg
    

%{
figure(13)

orient tall
set(gcf,'DefaultAxesFontSize',12)
set(gcf,'DefaultAxesFontName','times');

subplot(3,2,1)
plot(cr(1).sound.comp.nondim.std.theta, h_norm, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.nondim.std.theta, h_norm, 'k--'); plot(cr(3).sound.comp.nondim.std.theta, h_norm, 'k-.');
ylim([0 ymax]); %xlim([280 320]); 
ylabel('Z/Zi','FontName','times','FontSize',12);
title('\theta (K)','FontName','times','FontSize',12);

subplot(3,2,2)
plot(cr(1).sound.comp.nondim.std.thetae, h_norm, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.nondim.std.thetae, h_norm, 'k--'); plot(cr(3).sound.comp.nondim.std.thetae, h_norm, 'k-.');
ylim([0 ymax]); %xlim([300 330]); 
%ylabel('Z/Zi','FontName','times','FontSize',12);
title('\thetae (K)','FontName','times','FontSize',12);

subplot(3,2,3)
plot(cr(1).sound.comp.nondim.std.r, h_norm, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.nondim.std.r, h_norm, 'k--'); plot(cr(3).sound.comp.nondim.std.r, h_norm, 'k-.');
ylim([0 ymax]); %xlim([0 15]); 
ylabel('Z/Zi','FontName','times','FontSize',12);
title('r (g/kg)','FontName','times','FontSize',12);

subplot(3,2,4)
plot(cr(1).sound.comp.nondim.std.rh, h_norm, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.nondim.std.rh, h_norm, 'k--'); plot(cr(3).sound.comp.nondim.std.rh, h_norm, 'k-.');
ylim([0 ymax]);
%ylabel('Z/Zi','FontName','times','FontSize',12);
title('RH (%)','FontName','times','FontSize',12);

subplot(3,2,5)
plot(cr(1).sound.comp.nondim.std.wspd, h_norm, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.nondim.std.wspd, h_norm, 'k--'); plot(cr(3).sound.comp.nondim.std.wspd, h_norm, 'k-.');
ylim([0 ymax]); %xlim([0 15]); 
ylabel('Z/Zi','FontName','times','FontSize',12);
title('Wind Spd (m/s)','FontName','times','FontSize',12);

subplot(3,2,6)
plot(cr(1).sound.comp.nondim.std.wdir, h_norm, 'k-'); grid on; hold on; %set(gr,'linewidth',2); 
plot(cr(2).sound.comp.nondim.std.wdir, h_norm, 'k--'); plot(cr(3).sound.comp.nondim.std.wdir, h_norm, 'k-.');
ylim([0 ymax]); %xlim([100 150]); 
%ylabel('Z/Zi','FontName','times','FontSize',12);
title('Wind Dir (^o)','FontName','times','FontSize',12);
    
%text(0, 0, ['Normalized STD profiles for WHOI buoy period: EPIC (solid) - Stratus03 (dashed) - Stratus04 (dashed-dotted)'],'FontName','times','FontSize',16,'FontWeight','bold');
%print -djpeg100 C:\THESIS\PAPER\Old_Graphs\All_buoy_std_profiles_norm.jpg
%}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Plot wind profiler cloud top against inversion base and top height from soundings (Stratus 2004) %%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

figure(1)
set(gcf,'DefaultAxesFonts',16);
set(gcf,'DefaultAxesFontName','times');

h1=plot(cr(3).sound.level.mday, cr(3).sound.level.inv.top_h, 'ks--');
set(h1,'LineWidth',1)
hold on; grid on;

h2=plot(cr(3).sound.level.mday, cr(3).sound.level.inv.base_h, 'ko:');
set(h2,'LineWidth',1)

h3=plot(cr(3).radar.hr.mday, cr(3).radar.hr.radar_top,'k.');
xlim([6 22])

xlabel('Day of December 2004 (UTC)','FontName','times','FontSize',16);
ylabel('Height (m)','FontName','times','FontSize',16);
%title(['Stratus 2004, Sonde-derived Inversion heights: Base (red) and Top (black) - Wind profiler-derived BL height (blue)  '],'FontName','times','FontSize',16);
print -djpeg100 C:\THESIS\PAPER\Old_Graphs\Stratus04\Wind_Profiler.jpg


