addpath 'D:\pruis\XBeach\MatlabScripts\benodigd'
addpath 'D:\pruis\XBeach\Run\jonswap_files'
addpath D:\pruis\XBeach\matlab_scripts

load('CollectedData')

alpha_array=[0:0.2:1];
Beta_array=[0,0.05, 0.1, 0.5, 1];
T_array=[0.01, 1, 6, 100];
sealevelchangerate_array=[0.5, 0.64, 0.8];
add_sediment_array=[0.3, 3, 6];
inda=5;
indb=2;
indc=3;
indd=2;
inde=1;

y_as='height island';

for l=1:length(Beta_array)
    for k=1:length(alpha_array)
        for m=1:length(T_array)
            for n=1:length(sealevelchangerate_array)
                for o=1:length(add_sediment_array)
                    alpha(k,l,m,n,o) = alpha_array(k);
                    beta(k,l,m,n,o) = Beta_array(l);
                    theta(k,l,m,n,o) = T_array(m);
                    sealevel(k,l,m,n,o) = sealevelchangerate_array(n);
                    sediment(k,l,m,n,o) = add_sediment_array(o);
                end
            end
        end
    end
end

t=80;
regime=6;

d1 = squeeze(CollectedData(regime,:,:,:,:,:,1,t));
d2 = squeeze(CollectedData(regime,:,:,:,:,:,2,t));
d3 = squeeze(CollectedData(regime,:,:,:,:,:,3,t));
d4 = squeeze(CollectedData(regime,:,:,:,:,:,4,t));

figure;
% ALPHA
subplot(5,4,1); plot(alpha(:),d1(:),'*'),hold on;
                plot(alpha(inda,indb,indc,indd,inde),d1(inda,indb,indc,indd,inde),'go')
                plot(alpha(:,indb,indc,indd,inde),d1(:,indb,indc,indd,inde),'r*')
title('Island Height');
subplot(5,4,2); plot(alpha(:),d2(:),'*'),hold on;
                plot(alpha(inda,indb,indc,indd,inde),d2(inda,indb,indc,indd,inde),'go')
                plot(alpha(:,indb,indc,indd,inde),d2(:,indb,indc,indd,inde),'r*')
title('Island Width');
subplot(5,4,3); plot(alpha(:),d3(:),'*'),hold on;
                plot(alpha(inda,indb,indc,indd,inde),d3(inda,indb,indc,indd,inde),'go')
                plot(alpha(:,indb,indc,indd,inde),d3(:,indb,indc,indd,inde),'r*')
title('Island Volume');
subplot(5,4,4); plot(alpha(:),d4(:),'*'),hold on;
                plot(alpha(inda,indb,indc,indd,inde),d4(inda,indb,indc,indd,inde),'go')
                plot(alpha(:,indb,indc,indd,inde),d4(:,indb,indc,indd,inde),'r*')
title('X-transect (Roll-over)');
% BETA
subplot(5,4,5); plot(beta(:),d1(:),'*'),hold on;
                plot(beta(inda,indb,indc,indd,inde),d1(inda,indb,indc,indd,inde),'go')
                plot(beta(inda,:,indc,indd,inde),d1(inda,:,indc,indd,inde),'r*')
subplot(5,4,6); plot(beta(:),d2(:),'*'),hold on;
                plot(beta(inda,indb,indc,indd,inde),d2(inda,indb,indc,indd,inde),'go')
                plot(beta(inda,:,indc,indd,inde),d2(inda,:,indc,indd,inde),'r*')
subplot(5,4,7); plot(beta(:),d3(:),'*'),hold on;
                plot(beta(inda,indb,indc,indd,inde),d3(inda,indb,indc,indd,inde),'go')
                plot(beta(inda,:,indc,indd,inde),d3(inda,:,indc,indd,inde),'r*')
subplot(5,4,8); plot(beta(:),d4(:),'*'),hold on;
                plot(beta(inda,indb,indc,indd,inde),d4(inda,indb,indc,indd,inde),'go')
                plot(beta(inda,:,indc,indd,inde),d4(inda,:,indc,indd,inde),'r*')
% THETA
subplot(5,4,9); plot(theta(:),d1(:),'*'),hold on;
                plot(squeeze(theta(inda,indb,indc,indd,inde)),squeeze(d1(inda,indb,indc,indd,inde)),'go')
                plot(squeeze(theta(inda,indb,:,indd,inde)),squeeze(d1(inda,indb,:,indd,inde)),'r*')
subplot(5,4,10); plot(theta(:),d2(:),'*'),hold on;
                plot(squeeze(theta(inda,indb,indc,indd,inde)),squeeze(d2(inda,indb,indc,indd,inde)),'go')
                plot(squeeze(theta(inda,indb,:,indd,inde)),squeeze(d2(inda,indb,:,indd,inde)),'r*')
subplot(5,4,11); plot(theta(:),d3(:),'*'),hold on;
                plot(squeeze(theta(inda,indb,indc,indd,inde)),squeeze(d3(inda,indb,indc,indd,inde)),'go')
                plot(squeeze(theta(inda,indb,:,indd,inde)),squeeze(d3(inda,indb,:,indd,inde)),'r*')
subplot(5,4,12); plot(theta(:),d4(:),'*'),hold on;
                plot(squeeze(theta(inda,indb,indc,indd,inde)),squeeze(d4(inda,indb,indc,indd,inde)),'go')
                plot(squeeze(theta(inda,indb,:,indd,inde)),squeeze(d4(inda,indb,:,indd,inde)),'r*')
% Sealevel
subplot(5,4,13); plot(sealevel(:),d1(:),'*'),hold on;
                plot(squeeze(sealevel(inda,indb,indc,indd,inde)),squeeze(d1(inda,indb,indc,indd,inde)),'go')
                plot(squeeze(sealevel(inda,indb,indc,:,inde)),squeeze(d1(inda,indb,indc,:,inde)),'r*')
subplot(5,4,14); plot(sealevel(:),d2(:),'*'),hold on;
                plot(squeeze(sealevel(inda,indb,indc,indd,inde)),squeeze(d2(inda,indb,indc,indd,inde)),'go')
                plot(squeeze(sealevel(inda,indb,indc,:,inde)),squeeze(d2(inda,indb,indc,:,inde)),'r*')
subplot(5,4,15); plot(sealevel(:),d3(:),'*'),hold on;
                plot(squeeze(sealevel(inda,indb,indc,indd,inde)),squeeze(d3(inda,indb,indc,indd,inde)),'go')
                plot(squeeze(sealevel(inda,indb,indc,:,inde)),squeeze(d3(inda,indb,indc,:,inde)),'r*')
subplot(5,4,16); plot(sealevel(:),d4(:),'*'),hold on;
                plot(squeeze(sealevel(inda,indb,indc,indd,inde)),squeeze(d4(inda,indb,indc,indd,inde)),'go')
                plot(squeeze(sealevel(inda,indb,indc,:,inde)),squeeze(d4(inda,indb,indc,:,inde)),'r*')
% Sediment
subplot(5,4,17); plot(sediment(:),d1(:),'*'),hold on;
                plot(squeeze(sediment(inda,indb,indc,indd,inde)),squeeze(d1(inda,indb,indc,indd,inde)),'go')
                plot(squeeze(sediment(inda,indb,indc,indd,:)),squeeze(d1(inda,indb,indc,indd,:)),'r*')
subplot(5,4,18); plot(sediment(:),d2(:),'*'),hold on;
                plot(squeeze(sediment(inda,indb,indc,indd,inde)),squeeze(d2(inda,indb,indc,indd,inde)),'go')
                plot(squeeze(sediment(inda,indb,indc,indd,:)),squeeze(d2(inda,indb,indc,indd,:)),'r*')
subplot(5,4,19); plot(sediment(:),d3(:),'*'),hold on;
                plot(squeeze(sediment(inda,indb,indc,indd,inde)),squeeze(d3(inda,indb,indc,indd,inde)),'go')
                plot(squeeze(sediment(inda,indb,indc,indd,:)),squeeze(d3(inda,indb,indc,indd,:)),'r*')
subplot(5,4,20); plot(sediment(:),d4(:),'*'),hold on;
                plot(squeeze(sediment(inda,indb,indc,indd,inde)),squeeze(d4(inda,indb,indc,indd,inde)),'go')
                plot(squeeze(sediment(inda,indb,indc,indd,:)),squeeze(d4(inda,indb,indc,indd,:)),'r*')
  


