function analyze_this(info, dirs)

% get general info
transect = str2double(regexp(pwd, '(?<=transect)\d{7,8}', 'match'));

% variant = regexp(pwd, '(?<=_XBeach_).*$', 'match');

% read load corresponding DUROS+ and D++ results
if ~isempty(transect)
    durosfile = fullfile(dirs.data, sprintf('transect%i', transect), 'Duros+', 'run00', 'condition0.mat');
    dppfile = fullfile(dirs.data, sprintf('transect%i', transect), 'D++', 'extended', 'condition2.mat');
else
    durosfile = fullfile(dirs.data, 'reference', 'Duros+', 'run00', 'condition0.mat');
    dppfile = false;
end

load(durosfile);

% derive DUROS+ characteristics
zRef = 5;
x = [result(1).xLand; result(1).xActive; result(1).xSea];
z = [result(1).zLand; result(1).zActive; result(1).zSea];
xRefduros = max(findCrossings(x, z, x([1 end]), ones(2,1) * zRef));
RD.duros = xRefduros - result(1).xActive(1);
% Vduros = result(1).Volumes.Erosion;

if dppfile
    if exist(dppfile, 'file')
        load(dppfile);
        % derive D++ characteristics
        x = [result(1).xLand; result(1).xActive; result(1).xSea];
        z = [result(1).zLand; result(1).zActive; result(1).zSea];
        xRefdpp = max(findCrossings(x, z, x([1 end]), ones(2,1) * zRef));
        RD.dpp = xRefdpp - result(1).xActive(1);
    else
        RD.dpp = NaN;
    end
end

% read measurements
t       = [0 5];

% read dimensions
d       = xb_read_dims;
m   = closest(t*3600, d.t);
[m i]   = closest(m(1) + t*3600, d.t);

% read input
xbi     = xb_read_input(pwd);
% zs0     = max([0 xs_get(xbi,'zs0') max(xs_get(xbi,'zs0file.tide'))]);

% read output
xbo1    = xb_read_output(pwd, 'vars', {'zb'}, 'index', i-1);
zb = squeeze(xs_get(xbo1, 'zb'));

% derive XBeach characteristics
EP = erosionpoint(zb(1,:), zb(2,:),...
    'x', d.x,...
    'positive_landward', true,...
    'method', '1in1',...
    'lowerboundary', zRef);
% cross-shore reference location xbeach (intersection with water level)
xcr =d.x;
xcr2 = d.x([1 end]);
if (size(xcr,1) > size(xcr,2))
    xcr = xcr';
    xcr2 = xcr2';
end
xRefxbeach = min(findCrossings(xcr, zb(1,:), xcr2, ones(1,2) * zRef));
RD.xbeach = EP - xRefxbeach;

% save retreat distances to mat file
savedir = strrep(dirs.output,strrep(info.run,'_','\'),'');
fname = fullfile(savedir,['RD_' info.run '.mat']);
save(fname, 'RD')

%% plot output
xb_plot_profile(xbo1);

xb_write_plot(gcf, dirs.output, 'profiles');