function AnalyseXBeachOutput_Morpho(info, dirs)
    test_name = info.run;

    %% Notes
    % Morfologische analyse output

    %% ------------------------------------------------------------------ %%
    %  ---------------------------- Settings ---------------------------- %
    %  ------------------------------------------------------------------ %
    dxmin = 1;        % minimale gridresolutie[m]

    %% Load data
    load([dirs.data filesep test_name '.mat']);
    
    % Hoogste offshore waterstand tijdens storm
    zs      = load([dirs.output filesep 'tide.txt']); 
    zs0     = max(zs(:,2)); 
    
    %% CALCULATE DUNE EROSION STATS IN MEASURED PROFILES
    
    % Dune erosion volume
    [VeroMeas, d_all, z1_all, z2_all, d1, z1, d2, z2] = compute_Vero2(...
        Meas_PreStorm.x(Meas_PreStorm.z>0),  ...
        Meas_PreStorm.z(Meas_PreStorm.z>0),  ...
        Meas_PostStorm.x(Meas_PostStorm.z>0),...
        Meas_PostStorm.z(Meas_PostStorm.z>0),...
        zs0, 0); 
    
    % Retreat distance
    try
        retreatMeas     = compute_retreat2(d_all, z1_all, z2_all, [], 3);
    catch
        retreatMeas = [];
    end
    
    % Helling sedimentatiezone onderaan duin
    try    BermSlopeMeas    = compute_bedslope_berm_based_on_accretion_zone(d_all, z1_all, z2_all, zs0);   end
    
    %% READ AND PROCESS XBEACH OUTPUT
    ncfile  = [dirs.output filesep 'xboutput.nc']; 
    errfile = [dirs.output filesep 'XBerror.txt'];
    
    if isfile(ncfile) %&& ~isfile(errfile)
        x           = Meas_PreStorm.x'; %squeeze(ncread(ncfile,'globalx'));
        zb          = squeeze(ncread(ncfile,'zb'));

        %% Calculate dune erosion statistics       
        [VeroXB, ~, ~, ~, d1_XB, z1_XB, d2_XB, z2_XB] = compute_Vero2(x, zb(:,1), x, zb(:,end), zs0, 0); 
        try BermSlopeXB = compute_bedslope_berm_based_on_accretion_zone(x,zb(:,1),zb(:,end),zs0); end
        try 
            retreatXB   = compute_retreat2(x, zb(:,1), zb(:,end), dxmin, 3);
        catch
            retreatXB = [];
        end
        
        %% Plot figure cross-section
        
        % Let op: zelf aanpassen: xlims, referentieniveau in label y-as en tekst met retreat distance, hoogte mean water level
        
        % voor xlims
%         idx_init    = find(zb(:,1)>zs0, 1, 'first');
%         idx_end     = find(zb(:,end)>zs0, 1, 'first');        
        
        figure; hold on; grid on; box on;
        set(gcf, 'Position', [300 200 900 600])          
        title(['Profile ', test_name], 'interpreter', 'none')

        xlim([5100 5500])  % Range zelf instellen
        ylim([-5 10])
            
        xlims = xlim;
        % Erosievolume 
        h1 = fill([d1_XB; flipud(d2_XB)],  [z1_XB; flipud(z2_XB)], 'r', 'FaceAlpha', 0.2, 'EdgeColor', 'none', 'displayname', 'Dune erosion XBeach'); % [255 200 0]./255 = oranjegeel
        h2 = fill([d1;    flipud(d2)],     [z1; flipud(z2)],       'k', 'FaceAlpha', 0.1, 'EdgeColor', 'none', 'displayname', 'Dune erosion measured');
        % Max. waterstand
        h3 = plot(xlims,  [zs0, zs0],  '-b', 'linewidth', 1.2, 'DisplayName', 'Max. storm surge level');
%             h7 = plot(xlims,  [0, 0],':b', 'linewidth', 1.2, 'DisplayName', 'Mean water level'); % Let op: case-specifiek. Dit is gemiddelde over enkele maanden rondom de storm in TAW.
        % Profielen
        h5 = plot(x,                zb(:,end),   '-r', 'linewidth', 1.2, 'DisplayName', 'XBeach post-storm bed level');
        h6 = plot(Meas_PostStorm.x, Meas_PostStorm.z, '-k', 'linewidth', 1.2, 'DisplayName', 'Measured post-storm bed level');
        h4 = plot(x,                zb(:,1),     '--k', 'linewidth', 1.2, 'DisplayName', 'Initial bed level');
        % Tekstblok met duinerosie-eigenschappen
        ylims = ylim;   
        txty  = ylims(1)+0.95.*(ylims(2)-ylims(1));     
        txtdy = 0.03.*(ylims(2)-ylims(1));   
        txtx  = xlims(1)+0.4.*(xlims(2)-xlims(1));
        text(txtx,txty,        ['Dune erosion volume - XBeach            = '    num2str(VeroXB, '%.0f')         ' m^3/m']);           
        text(txtx,txty-txtdy,  ['Dune erosion volume - measured         = '     num2str(VeroMeas, '%.0f')       ' m^3/m']); 
        try text(txtx,txty-2*txtdy,['Dune retreat at 3 m +NAVD88 - XBeach    = '       num2str(retreatXB, '%.0f')      ' m']  ); end
        try text(txtx,txty-3*txtdy,['Dune retreat at 3 m +NAVD88 - measured = '        num2str(retreatMeas, '%.0f')    ' m']  ); end
                      
        leg = legend([h4 h6 h5 h2 h1 h3], 'location', 'northwest');
        set(gca, 'FontSize', 11)

        xlabel('Distance along transect [m]');
        ylabel('Elevation [m +NAVD88]');
        
        xb_write_plot(gcf, dirs.output, ['BL_BeforeAndAfterStorm_Profile' test_name])
        save([dirs.output filesep 'values.mat'], 'VeroXB','VeroMeas', 'retreatXB','retreatMeas'); 
    end  
end    

   

