figure_dany_congres.m 2.66 KB
clear all;
close all;









dossier=['strain1';'strain2';'strain3'];
dospec=['sim1.nc';'sim2.nc';'sim3.nc'];
dospec=cellstr(dospec);

dossier=cellstr(dossier);
for j=1:3
%Q=load('/home/bauj0001/projets/WIM/output/Q.dat');
%beta=load('/home/bauj0001/projets/WIM/output/beta.dat');
dos=char(dossier(j));
dosdos=char(dospec(j));
fichier=['/home/bauj0001/projets/WIM/output/',dos,'.dat'];
strain=load(fichier);

Fsize=ncread('simulation1.nc','floe size');
om=ncread('simulation1.nc','omega');
spectre=ncread(dosdos,'Spectrum');

hcat=ncread('simulation1.nc','thickness categories');
IDT=ncread('simulation1.nc','Ice Thickness Distribution');

lambda1=9.81*2*pi./om.^2;
lambda=linspace(500,10,500);

spec=reshape(spectre(1,1,:),800,1);



%---------------------------------------------------------------
p1=figure(1);
p1.Units='inches';
p1.Position=[7.0729 5.6146 5.8333 4.3750];
p1.OuterPosition=[7.0729 5.6146 5.8333 5.3750];

p1.PaperUnits = 'inches';
p1.PaperPosition = [0 0 5.8333 4.3750];
p1.PaperPositionMode = 'manual';
p1.PaperOrientation='Portrait';
p1.PaperSize=[5.8333 4.3750];
plot(lambda1,spec,'linewidth',1.5)

hold on
 h1=legend('Hs = 0.5m','Hs = 0.1m','Hs = 0.05m','location','northeast');
 set(h1,'box','off')
ylabel('Spectrum [m]')
xlabel('wavelength [m]')
grid on






%-----------------------------------------------------------------
P=exp((-2*3e-5^2)./(strain.^2));
P(find(P<0.15))=0;
P(find(lambda<50))=0;
P=P/sum(P+3e-14);
p2=figure(2);

p2.Units='inches';
p2.Position=[7.0729 5.6146 5.8333 4.3750];
p2.OuterPosition=[7.0729 5.6146 5.8333 5.3750];

p2.PaperUnits = 'inches';
p2.PaperPosition = [0 0 5.8333 4.3750];
p2.PaperPositionMode = 'manual';
p2.PaperOrientation='Portrait';
p2.PaperSize=[5.8333 4.3750];


plot(lambda/2,P,'linewidth',1.5)
hold on
 h2=legend('Hs = 0.5m','Hs = 0.1m','Hs = 0.05m');
 set(h2,'position',[0.25 0.77 0.225 0.123])
 if j==3
 plot([25 25],ylim,'k--')
 end
 set(h2,'box','off')
 ylabel('Redistribution function')
xlabel('Floes size [m]')
 hh=text(35,3e-3,'Lmin');
 set(hh,'rotation',90)
 
grid on 

 
 
 

Q=zeros(500,1);
for i=1:length(P)-1
    Q(i)=sum(P(i:end));
end
p3=figure(3);

p3.Units='inches';
p3.Position=[7.0729 5.6146 5.8333 4.3750];
p3.OuterPosition=[7.0729 5.6146 5.8333 5.3750];

p3.PaperUnits = 'inches';
p3.PaperPosition = [0 0 5.8333 4.3750];
p3.PaperPositionMode = 'manual';
p3.PaperOrientation='Portrait';
p3.PaperSize=[5.8333 4.3750];

 plot(lambda/2,Q,'linewidth',1.5)
 hold on
 h3=legend('Hs = 0.5m','Hs = 0.1m','Hs = 0.05m','location','northwest');
 set(h3,'box','off')
 
 ylabel('Breaking probability')
xlabel('Floes size [m]')
grid on
end
 


saveas(p1,'spectrum','pdf')
saveas(p2,'redistribution_f','pdf')
saveas(p3,'breaking_p','pdf')