function Plot1DResults_ALL(info, dirs)
%% PLOT 1D STORM DATA
% This script plots the measured data and the data obtained from the 1D
% simulation (using XBeach) for the duration of a swell wave event. This 
% event is defined as: 
% 14-Jun-2009,12:00:00 (index = 133)
% 19-Jun-2009, 00:00:00 (index = 241)
% 
% Data obtained at C6 has been interpolated to form a continuous signal. 
%
% Modified: A.Pomeroy (Oct 2011)
%% LOAD DATA
% Model Data
ModDat_raw      = load ([dirs.data filesep '1DStormData.mat']);

ModDat.Hsig_SW  = ModDat_raw.Hsig_SW(:,7:115); 
ModDat.Hsig_IG  = ModDat_raw.Hsig_IG(:,7:115);
ModDat.MWL      = ModDat_raw.MWL(:,7:115);

% Measured Data - From LOWE
MeasDat_raw = load([dirs.data filesep 'data_LOWE.mat']);

% Kill Peaks (Manually)
MeasDat_raw.Hsig_IG(1,179)=0.1918;
MeasDat_raw.Hsig_IG(1,232)=0.0820;
MeasDat_raw.Hsig_IG(1,233)=0.0820;

peaktime        = MeasDat_raw.time_burst(156);
time            = MeasDat_raw.time_burst(133:241);
MeasDat.Hsig_SW = MeasDat_raw.Hsig_swell(:,133:241); 
MeasDat.Hsig_IG = MeasDat_raw.Hsig_IG(:,133:241);
MeasDat.MWL     = MeasDat_raw.MWL(:,133:241);

% Clean Up
clear MeasDat_raw ModDat_raw

%% SETUP FIGURE FOR ALL PLOTS
figJGR      = figure;
xtickarr    = [time(13) time(37) time(61) time(85) time(109)];
%% SHORT WAVES COMPARISON PLOT
Axes11      = subplot (5,3,1);
hold(Axes11);
plot(time, sqrt(2)/2*ModDat.Hsig_SW(1,:), '-b', 'LineWidth',1);
plot(time, sqrt(2)/2*MeasDat.Hsig_SW(1,:), '-r', 'LineWidth',1);
plot([peaktime peaktime],[0 4],'-r');
text(time(3), 3,'(a)');
ylim([0 4]); 
xlim([time(1) time(109)]);
set(Axes11,'XTick',xtickarr);
title('H_{rms.sw} (m)');
datetick('x','keepticks','keeplimits');

Axes12      = subplot (5,3,4);
hold(Axes12);
plot(time,sqrt(2)/2*ModDat.Hsig_SW(2,:),'-b','LineWidth',1);
plot(time,sqrt(2)/2*MeasDat.Hsig_SW(2,:),'-r','LineWidth',1);
plot([peaktime peaktime],[0 0.4],'-r');
text(time(3), 0.3,'(b)');
ylim([0 0.4]);
xlim([time(1) time(109)]);
set(Axes12,'XTick',xtickarr);
datetick('x','keepticks','keeplimits');

Axes13      = subplot (5,3,7);
hold(Axes13);
plot(time,sqrt(2)/2*ModDat.Hsig_SW(3,:),'-b','LineWidth',1);
plot(time,sqrt(2)/2*MeasDat.Hsig_SW(3,:),'-r','LineWidth',1);
plot([peaktime peaktime],[0 0.2],'-r');
text(time(3), 0.15,'(c)');
ylim([0 0.2]);
xlim([time(1) time(109)]);
set(Axes13,'XTick',xtickarr);
datetick('x','keepticks','keeplimits');

Axes14      = subplot (5,3,10);
hold(Axes14);
plot(time,sqrt(2)/2*ModDat.Hsig_SW(4,:),'-b','LineWidth',1);
plot(time,sqrt(2)/2*MeasDat.Hsig_SW(4,:),'-r','LineWidth',1);
plot([peaktime peaktime],[0 0.2],'-r');
text(time(3), 0.15,'(d)');
ylim([0 0.2]);
xlim([time(1) time(109)]);
set(Axes14,'XTick',xtickarr);
datetick('x','keepticks','keeplimits');

Axes15      = subplot (5,3,13); 
hold(Axes15);
plot(time, sqrt(2)/2*ModDat.Hsig_SW(5,:), '-b', 'LineWidth',1);
plot(time, sqrt(2)/2*MeasDat.Hsig_SW(5,:), '.r', 'LineWidth',1);
plot([peaktime peaktime],[0 0.2],'-r');
text(time(3), 0.15,'(e)');
ylim([0 0.2]);
xlim([time(1) time(109)]);
set(Axes15,'XTick',xtickarr);
datetick('x','keepticks','keeplimits');

%% LONG WAVES COMPARISION PLOT
Axes21      = subplot (5,3,2);
hold(Axes21);
plot(time, sqrt(2)/2*ModDat.Hsig_IG(1,:), '-b', 'LineWidth', 1);
plot(time, sqrt(2)/2*MeasDat.Hsig_IG(1,:),'-r','LineWidth',1);
plot([peaktime peaktime],[0 0.5],'-r');
text(time(3), 0.40,'(f)');
ylim([0 0.5]);
set(Axes21,'ytick',[0 0.1 0.3 0.5]);
title('H_{rms.IG} (m)');
xlim([time(1) time(109)]);
set(Axes21,'XTick',xtickarr);
datetick('x','keepticks','keeplimits');

Axes22      = subplot (5,3,5);
hold(Axes22);
plot(time, sqrt(2)/2*ModDat.Hsig_IG(2,:),'-b','LineWidth',1);
plot(time, sqrt(2)/2*MeasDat.Hsig_IG(2,:),'-r','LineWidth',1);
plot([peaktime peaktime],[0 0.5],'-r');
text(time(3), 0.4,'(g)');
ylim([0 0.5]);
set(Axes22,'ytick',[0 0.1 0.3 0.5]);
xlim([time(1) time(109)]);
set(Axes22,'XTick',xtickarr);
datetick('x','keepticks','keeplimits');

Axes23      = subplot (5,3,8);
hold(Axes23);
plot(time,sqrt(2)/2*ModDat.Hsig_IG(3,:),'-b','LineWidth',1);
plot(time,sqrt(2)/2*MeasDat.Hsig_IG(3,:),'-r','LineWidth',1);
plot([peaktime peaktime],[0 0.5],'-r');
text(time(3), 0.4,'(h)');
ylim([0 0.5]);
set(Axes23,'ytick',[0 0.1 0.3 0.5]);
xlim([time(1) time(109)]);
set(Axes23,'XTick',xtickarr);
datetick('x','keepticks','keeplimits');

Axes24      = subplot (5,3,11);
hold(Axes24);
plot(time,sqrt(2)/2*ModDat.Hsig_IG(4,:),'-b','LineWidth',1);
plot(time,sqrt(2)/2*MeasDat.Hsig_IG(4,:),'-r','LineWidth',1);
plot([peaktime peaktime],[0 0.5],'-r');
text(time(3), 0.4,'(i)');
ylim([0 0.5]);
set(Axes24,'ytick',[0 0.1 0.3 0.5]);
xlim([time(1) time(109)]);
set(Axes24,'XTick',xtickarr);
datetick('x','keepticks','keeplimits');

Axes25      = subplot (5,3,14);
hold(Axes25);
plot(time,sqrt(2)/2*ModDat.Hsig_IG(5,:),'-b','LineWidth',1);
plot(time,sqrt(2)/2*MeasDat.Hsig_IG(5,:),'.r','LineWidth',1);
plot([peaktime peaktime],[0 0.5],'-r');
text(time(3), 0.4,'(j)');
ylim([0 0.5]);
set(Axes25,'ytick',[0 0.1 0.3 0.5]);
set(Axes25,'XTick',xtickarr);
xlim([time(1) time(109)]);
datetick('x','keepticks','keeplimits');

%% MWL COMPARISION PLOT
Axes31      = subplot (5,3,3);
hold(Axes31);
plot(time,ModDat.MWL(1,:),'-b','LineWidth',1);
plot(time,MeasDat.MWL(1,:),'-r','LineWidth',1);
plot([peaktime peaktime],[-1 1],'-r');
text(time(3), 0.5,'(k)');
ylim([-1 1]);
title('z_{s} (m)');
xlim([time(1) time(109)]);
set(Axes31,'XTick',xtickarr);
datetick('x','keepticks','keeplimits');

Axes32      = subplot (5,3,6);
hold(Axes32);
plot(time,ModDat.MWL(2,:),'-b','LineWidth',1);
plot(time,MeasDat.MWL(2,:),'-r','LineWidth',1);
plot([peaktime peaktime],[-1 1],'-r');
text(time(3), 0.5,'(l)');
ylim([-1 1]);
xlim([time(1) time(109)]);
set(Axes32,'XTick',xtickarr);
datetick('x','keepticks','keeplimits');

Axes33      = subplot (5,3,9);
hold(Axes33);
plot(time,ModDat.MWL(3,:),'-b','LineWidth',1);
plot(time,MeasDat.MWL(3,:),'-r','LineWidth',1);
plot([peaktime peaktime],[-1 1],'-r');
text(time(3), 0.5,'(m)');
ylim([-1 1]);
xlim([time(1) time(109)]);
set(Axes33,'XTick',xtickarr);
datetick('x','keepticks','keeplimits');

Axes34      = subplot (5,3,12);
hold(Axes34);
plot(time,ModDat.MWL(4,:),'-b','LineWidth',1);
plot(time,MeasDat.MWL(4,:),'-r','LineWidth',1);
plot([peaktime peaktime],[-1 1],'-r');
text(time(3), 0.5,'(n)');
ylim([-1 1]);
xlim([time(1) time(109)]);
set(Axes34,'XTick',xtickarr);
datetick('x','keepticks','keeplimits');

Axes35      = subplot (5,3,15);
hold(Axes35);
plot(time,ModDat.MWL(5,:),'-b','LineWidth',1);
plot(time,MeasDat.MWL(5,:),'.r','LineWidth',1);
plot([peaktime peaktime],[-1 1],'-r');
text(time(3), 0.5,'(o)');
ylim([-1 1]);
xlim([time(1) time(109)]);
set(Axes35,'XTick',xtickarr);
datetick('x','keepticks','keeplimits');

% Save as Fig File
saveas(figJGR,'JGR_1D_ALL');

%% FORMAT FOR JGR JOURNAL AND MAKE TIFF FILE
display 'Formatting for JGR Journal and saving file'
JGR_FigFormat

% % SEA SWELL WAVES COMPARISION PLOT
% set(figJGR,'PaperSize', [16 9.5]);
% set(figJGR,'PaperPosition', [0 0 16 9.5]);
% set(Axes11,'Position',[0.75 7.5 4.25 1]);
% set(Axes12,'Position',[0.75 5.75 4.25 1]);
% set(Axes13,'Position',[0.75 4 4.25 1]);
% set(Axes14,'Position',[0.75 2.25 4.25 1]);
% set(Axes15,'Position',[0.75 0.5 4.25 1]);
% 
% % LONG WAVES COMPARISION PLOT
% set(Axes21,'Position',[6 7.5 4.25 1]);
% set(Axes22,'Position',[6 5.75 4.25 1]);
% set(Axes23,'Position',[6 4 4.25 1]);
% set(Axes24,'Position',[6 2.25 4.25 1]);
% set(Axes25,'Position',[6 0.5 4.25 1]);
% 
% % MWL COMPARISION PLOT
% set(Axes31,'Position',[11.25 7.5 4.25 1]);
% set(Axes32,'Position',[11.25 5.75 4.25 1]);
% set(Axes33,'Position',[11.25 4 4.25 1]);
% set(Axes34,'Position',[11.25 2.25 4.25 1]);
% set(Axes35,'Position',[11.25 0.5 4.25 1]);

% % ADD OVERBAR TO Zs
% annotation(figJGR,'line',[1 1],[1 1],...
%            'Units','Centimeters',...
%            'Position',[13 9.1 0.2 0]);

% Save file as TIF preview (contains color gradients in bathymetry)
xb_write_plot(figJGR, dirs.output, 'JGR_1D_ALL');
end