temp_results.m 4.14 KB
clear all;
close all;


dossier=['temp1'];
path=['/home/bauj0001/projets/WIM/output/',dossier,'/',dossier,'.nc'];

x=ncread(path,'x_axis');
t=ncread(path,'time');
om=ncread(path,'omega');
spectre=ncread(path,'Spectrum');
Dave=ncread(path,'Dave');
Dmax=ncread(path,'Dmax');
FSD=ncread(path,'Floe size distribution');
Fsize=ncread(path,'floe size');
thick=ncread(path,'Ice thickness');
conc=ncread(path,'Ice concentration');
Hs=ncread(path,'significant height');
IDT=ncread(path,'Ice Thickness Distribution');
hcat=ncread(path,'thickness categories');



FSD1=reshape(FSD(:,10,:,:),size(FSD,1),size(FSD,3),size(FSD,4));
IDT1=IDT(25,:)';



for i=1:length(hcat)
    FSD1(:,:,i)=FSD1(:,:,i).*IDT1(i);
end
a=1;
for i=1:length(t)
    FSD2(:,i)=sum(reshape(FSD1(i,:,:),size(FSD1,2),size(FSD1,3)),2);
    FSD2(find(FSD2(:,i)<0.0001),i)=0;
    if FSD2(end,i)<0.999
        FSD3(:,a)=FSD2(:,i);
        a=a+1;
    end
end


a=1;
FSD4(:,a)=FSD3(:,1);
for i=2:size(FSD3,2)
    if max(FSD3(:,i))==max(FSD3(:,i-1))
        
    else
        a=a+1;
        FSD4(:,a)=FSD3(:,i);
        
    end
end


 fig=figure;

fig.Units='inches';
fig.Position=[5.7396 7.3333 7.4479 2.0937];
fig.OuterPosition=[5.7396 7.3333 7.4479 3.0937];

fig.PaperUnits = 'inches';
fig.PaperPosition = [0 0 7.4479 2.0937];
fig.PaperPositionMode = 'manual';
fig.PaperOrientation='landscape';
fig.PaperSize=[7.4479 2.0937];


cmap=jet(size(FSD4,2));
for i=1:size(FSD4,2)
    
    for j=1:size(FSD4,1)
        CFSD(j,i)=sum(FSD4(j:end,i));
    end
    
     subplot(1,2,1)
    plot(Fsize,FSD4(:,i),'color',cmap(i,:))
    hold on
    xlabel('Floe size [m]','interpreter','latex')
    ylabel('Area fraction','interpreter','latex')
    axis([0 400 0 0.4])
    
    subplot(1,2,2)
    plot(Fsize,CFSD(:,i),'color',cmap(i,:))
    hold on
    xlabel('Floe size [m]','interpreter','latex')
    ylabel(' cumulative area fraction','interpreter','latex')
    
end
c=colorbar;
colormap(jet)
caxis([0 size(FSD4,2)*t(2)])
ylabel(c,'Time [min]','interpreter','latex')
c.Position(1)=c.Position(1)+0.1;
c.Position(3)=c.Position(3)-0.02;



%----------------------------------------------------------------------------
clear all

dossier=['temp2'];
path=['/home/bauj0001/projets/WIM/output/',dossier,'/',dossier,'.nc'];

x=ncread(path,'x_axis');
t=ncread(path,'time');
om=ncread(path,'omega');
spectre=ncread(path,'Spectrum');
Dave=ncread(path,'Dave');
Dmax=ncread(path,'Dmax');
FSD=ncread(path,'Floe size distribution');
Fsize=ncread(path,'floe size');
thick=ncread(path,'Ice thickness');
conc=ncread(path,'Ice concentration');
Hs=ncread(path,'significant height');
IDT=ncread(path,'Ice Thickness Distribution');
hcat=ncread(path,'thickness categories');



FSD1=reshape(FSD(:,10,:,:),size(FSD,1),size(FSD,3),size(FSD,4));
IDT1=IDT(25,:)';



for i=1:length(hcat)
    FSD1(:,:,i)=FSD1(:,:,i).*IDT1(i);
end
a=1;
for i=1:length(t)
    FSD2(:,i)=sum(reshape(FSD1(i,:,:),size(FSD1,2),size(FSD1,3)),2);
    FSD2(find(FSD2(:,i)<0.0001),i)=0;
    if FSD2(end,i)<0.999
        FSD3(:,a)=FSD2(:,i);
        a=a+1;
    end
end


a=1;
FSD4(:,a)=FSD3(:,1);
for i=2:size(FSD3,2)
    if max(FSD3(:,i))==max(FSD3(:,i-1))
        
    else
        a=a+1;
        FSD4(:,a)=FSD3(:,i);
        
    end
end


 fig2=figure(2);

fig2.Units='inches';
fig2.Position=[5.7396 7.3333 7.4479 2.0937];
fig.OuterPosition=[5.7396 7.3333 7.4479 3.0937];

fig2.PaperUnits = 'inches';
fig2.PaperPosition = [0 0 7.4479 2.0937];
fig2.PaperPositionMode = 'manual';
fig2.PaperOrientation='landscape';
fig2.PaperSize=[7.4479 2.0937];


cmap=jet(size(FSD4,2));
for i=1:size(FSD4,2)
    
    for j=1:size(FSD4,1)
        CFSD(j,i)=sum(FSD4(j:end,i));
    end
    
     subplot(1,2,1)
    plot(Fsize,FSD4(:,i),'color',cmap(i,:))
    hold on
    xlabel('Floe size [m]','interpreter','latex')
    ylabel('Area fraction','interpreter','latex')
    axis([0 400 0 0.4])
    
    subplot(1,2,2)
    plot(Fsize,CFSD(:,i),'color',cmap(i,:))
    hold on
    xlabel('Floe size [m]','interpreter','latex')
    ylabel(' cumulative area fraction','interpreter','latex')
    
end
c=colorbar;
colormap(jet)
caxis([0 size(FSD4,2)*t(2)])
ylabel(c,'Time [min]','interpreter','latex')
c.Position(1)=c.Position(1)+0.1;
c.Position(3)=c.Position(3)-0.02;