function plot_veggie(info, dirs)

%% Run settings

curDir = dirs.output;
% curDir = 'd:\xbveg_validate_Lovas\runs\';% for debugging TeamCity
% dirs.data = 'D:\Dropbox\Research\XBeach_Veg\Validation\';% for debugging TeamCity
% dirs.output = curDir;% for debugging TeamCity

% Experimental data for model input
Hm0 = [13.739520,22.539353,12.608168,20.23,18.489053,19.692676];
Tps = [2.5  2.5  3.5  3.5  3.5  3.5];
hs  = [0.77 0.77 0.77 0.77 0.69 0.73];
types     = {'sb0','sbv','nh0','nhv'};

% Load sloping beach profile based on Lovas & Torum (2000, ICCE)
x = fliplr(-1*[-0.45-1 -0.45 0 1 (0.77-0.1)*30+1 27.79]);
z = fliplr([0.45/1.5 0.45/1.5 0 -1*0.1 -0.77 -0.77]+0.77);

% Vegetation settings
Lh   = 7.27; % length over which vegetation is present
xveg = [-13 -13+Lh];

for i = 1:length(Tps)
    legs{i} = ['H_{m0} = ' num2str(round(Hm0(i))) ' cm, T_p = ' num2str(Tps(i)) ' s, h = ' num2str(hs(i)) ' m'];
end

%% Load data
% keyboard

% Load measurements
load([dirs.data filesep 'lovasdata.mat'])

% Load model reults
for ii = 1:length(Tps)   
    caseID  = num2str(ii,'%.2d');
    for jj = 1:length(types)        
        ncFil          = fullfile(curDir,['lovas_' caseID '_' types{jj}],'xboutput.nc');
        r(ii,jj).x     = nc_varget(ncFil,'globalx');
        r(ii,jj).t     = nc_varget(ncFil,'globaltime');
        r(ii,jj).zb    = nc_varget(ncFil,'zb');
        
        % water level
        r(ii,jj).zs    = squeeze(nc_varget(ncFil,'zs'));
        r(ii,jj).zsm   = squeeze(nc_varget(ncFil,'zs_mean'));
        r(ii,jj).zsv   = squeeze(nc_varget(ncFil,'zs_var'));
        
        r(ii,jj).zs(isnan(r(ii,jj).zs)) = r(ii,jj).zb(isnan(r(ii,jj).zs));
        
        % compute wave height
        if strcmp(types{jj}(1:2),'sb')
            r(ii,jj).Hm0_hf = squeeze(nc_varget(ncFil,'H_mean'))*sqrt(2);
            r(ii,jj).Hm0_lf = 4*sqrt(r(ii,jj).zsv);
            r(ii,jj).Hm0    = sqrt(r(ii,jj).Hm0_hf.^2+r(ii,jj).Hm0_lf.^2);
        else
            for kk = 1:size(r(ii,jj).zs,2)% for every location
                [f,Snn,A,ff,Af] = comp_spec(detrend(r(ii,jj).zs(:,kk)),1/(r(ii,jj).t(2)-r(ii,jj).t(1)));
                df = f(2)-f(1);

                % calculate variance below (IG) and above (short waves) fsplit
                fsplit = 0.5/Tps(ii);
                m0hf(kk) = sum(Snn(f >= fsplit)*df);% short wave energy density variance
                m0lf(kk) = sum(Snn(f <  fsplit)*df);%  long wave energy density variance
                clearvars f Snn A ff Af
            end
            r(ii,jj).Hm0_hf = 4*sqrt(m0hf);
            r(ii,jj).Hm0_lf = 4*sqrt(m0lf);
            r(ii,jj).Hm0    = sqrt(r(ii,jj).Hm0_hf.^2+r(ii,jj).Hm0_lf.^2);
        end
    end
end
% keyboard

%% Plot wave heights
FS   = 10;
MS   = 5;
LW   = 1.3;
hl   = zeros(8);
for i = 1:length(Tps)
    % Generate figure per simulation case
    fig = figure;
    
    % XBeach surfbeat
    ax(1)=subplot(3,1,1); hold on;%axes('position',[0.1 0.3 0.8 0.3]);hold on
    box on
    ylabel('H_{m0} [m]','FontSize',FS)
    text(-5,0.222,'surfbeat','FontSize',FS);
    
    % Plot data
    hl(1)=plot(x_N(i,:),Hm0hf_N(i,:),'ko','MarkerSize',MS,'MarkerFaceColor',[0.25 0.25 0.25]);hold on
    hl(2)=plot(x_N(i,:),Hm0lf_N(i,:),'ko','MarkerSize',MS,'MarkerFaceColor',[0.75 0.75 0.75]);hold on
    hl(3)=plot(x_V(i,:),Hm0hf_V(i,:),'ks','MarkerSize',MS,'MarkerFaceColor',[0.25 0.25 0.25]);hold on
    hl(4)=plot(x_V(i,:),Hm0lf_V(i,:),'ks','MarkerSize',MS,'MarkerFaceColor',[0.75 0.75 0.75]);hold on
    
    % Plot without vegetation
    hl(5)=plot(r(i,1).x,r(i,1).Hm0_hf,'Color',[0 0 0],'LineStyle','-','LineWidth',LW);
    hl(6)=plot(r(i,1).x,r(i,1).Hm0_lf,'Color',[0 0 0],'LineStyle',':','LineWidth',LW);
    
    % Plot with vegetation
    hl(7)=plot(r(i,2).x,r(i,2).Hm0_hf,'Color',[255 150 26]/255,'LineStyle','-','LineWidth',LW);
    hl(8)=plot(r(i,2).x,r(i,2).Hm0_lf,'Color',[255 150 26]/255,'LineStyle',':','LineWidth',LW);
    
    
    % Limits
    xlim([-27.79 1.2])
    ylim([0 0.24]);
    set(ax(1),'FontSize',FS-1);
    
    % % % % XBeachNH
    ax(2)=subplot(3,1,2); hold on; %axes('position',[0.1 0.65 0.8 0.3]);hold on
    box on
    ylabel('H_{m0} [m]','FontSize',FS)
    text(-5,0.22,'non-hydrostatic','FontSize',FS);
    title(['Lovas Vegetation Case ' num2str(i) '; ' legs{i}],'FontSize',FS);
     
    hl(1)=plot(x_N(i,:),Hm0hf_N(i,:),'ko','MarkerSize',MS,'MarkerFaceColor',[0.25 0.25 0.25]);hold on
    hl(2)=plot(x_N(i,:),Hm0lf_N(i,:),'ko','MarkerSize',MS,'MarkerFaceColor',[0.75 0.75 0.75]);hold on
    hl(3)=plot(x_V(i,:),Hm0hf_V(i,:),'ks','MarkerSize',MS,'MarkerFaceColor',[0.25 0.25 0.25]);hold on
    hl(4)=plot(x_V(i,:),Hm0lf_V(i,:),'ks','MarkerSize',MS,'MarkerFaceColor',[0.75 0.75 0.75]);hold on
     
    % Plot without vegetation
    hl(5)=plot(r(i,3).x,r(i,3).Hm0_hf,'Color',[0 0 0],'LineStyle','-','LineWidth',LW);
    hl(6)=plot(r(i,3).x,r(i,3).Hm0_lf,'Color',[0 0 0],'LineStyle',':','LineWidth',LW);
    
    % Plot with vegetation
    hl(7)=plot(r(i,4).x,r(i,4).Hm0_hf,'Color',[255 150 26]/255,'LineStyle','-','LineWidth',LW);
    hl(8)=plot(r(i,4).x,r(i,4).Hm0_lf,'Color',[255 150 26]/255,'LineStyle',':','LineWidth',LW);
    
    leg=legend('wave height (HF, measured)','wave height (LF, measured)',...
        'wave height (HF, meas, veg)','wave height (LF, meas, veg)',...
        'wave height (HF)','wave height (LF)',...
        'wave height (HF, veg)','wave height (LF, veg)','location','West');
    set(leg,'FontSize',FS-3)
    
    % Limits
    xlim([-27.79 1.2])
    ylim([0 0.24]);
    set(ax(2),'FontSize',FS-1);
    
    % % % % Plot Experimental Setup
    zax = subplot(3,1,3); hold on; %axes('position',[0.1 0.1 0.8 0.15]);hold on
    vegs = interp1([-30 xveg(1)-0.01 xveg(1) xveg(2) xveg(2)+0.01 5],[0 0 0.2 0.2 0 0],r(ii,jj).x);
    for iv = 1:length(r(ii,jj).x)
        plot([r(ii,jj).x(iv),r(ii,jj).x(iv)],[squeeze(r(ii,jj).zb(1,1,iv)) squeeze(r(ii,jj).zb(1,1,iv))+vegs(iv)],'Color',[76 153 0]/255);
    end
    plot(r(ii,jj).x,r(ii,jj).zsm,'b');
    plot(r(ii,jj).x,squeeze(r(ii,jj).zb(1,1,:)),'k','LineWidth',1.3);
    axis([-27.79 1.2 -0.025 1.2])
    text(-27,0.88,'MWL','FontSize',FS)
    xlabel('x [m]','FontSize',FS)
    ylabel('z [m]','FontSize',FS)
    set(zax,'FontSize',FS-1);
    
    % % % Print figure   
    set(fig,'Renderer','Zbuffer','PaperPositionMode','auto');
    xb_write_plot(gcf, dirs.output, ['lovas_case_' num2str(i)]);
    close all
end
