untitled5.m 3.53 KB
  clear all
  close all

 fig=figure;

fig.Units='inches';
fig.Position=[7.0729 6.7396 4.2708 2.600];
fig.OuterPosition=[7.0729 6.7396 4.2708 3.600];

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


  cmap=jet(10);
  for j=1:10
    
    
    dossier=['ec',num2str(j-1)];
   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,10,:,:),length(Fsize),length(hcat));

IDT1=IDT(10,:);
for i=1:length(hcat)
    FSD1(:,i)=FSD1(:,i)*IDT1(i);
    nfloe(:,i)=((FSD1(:,i)*(5000)^2)./Fsize.^2) ;
end
 nfloe=nfloe/sum(sum(nfloe));
FSD2=sum(FSD1,2);

nfloe2=((FSD2*5000^2)./Fsize.^2)/sum((FSD2*5000^2)./Fsize.^2);
   plot((Fsize),nfloe2,'color',cmap(j,:))
   
   axis([0 250 0 0.2])
   xlabel('Floe size [m]','interpreter','latex')
   ylabel('Normalized number of floe','interpreter','latex')
   hold on

   j
  end

  legende=['$\varepsilon_c=3\times 10^{-5}$';'$\varepsilon_c=4\times 10^{-5}$';'$\varepsilon_c=5\times 10^{-5}$'...
      ;'$\varepsilon_c=6\times 10^{-5}$';'$\varepsilon_c=7\times 10^{-5}$';'$\varepsilon_c=8\times 10^{-5}$'...
      ;'$\varepsilon_c=9\times 10^{-5}$';'$\varepsilon_c=1\times 10^{-4}$';'$\varepsilon_c=2\times 10^{-4}$'...
      ;'$\varepsilon_c=3\times 10^{-4}$'];
legende=cellstr(legende);
    l=legend(char(legende));
  set(l,'interpreter','latex','Box','off','location','eastoutside'); 
  
  
%   
%     figure
%   cmap=jet(10);
%   for j=1:10
%     
%     
%     dossier=['Pc',num2str(j-1)];
%    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,10,:,:),length(Fsize),length(hcat));
% 
% IDT1=IDT(10,:);
% for i=1:length(hcat)
%     FSD1(:,i)=FSD1(:,i)*IDT1(i);
%     nfloe(:,i)=((FSD1(:,i)*(5000)^2)./Fsize.^2) ;
% end
%  nfloe=nfloe/sum(sum(nfloe));
% FSD2=sum(FSD1,2);
% 
% nfloe2=((FSD2*5000^2)./Fsize.^2)/sum((FSD2*5000^2)./Fsize.^2);
%    plot((Fsize),nfloe2,'color',cmap(j,:))
%    
%    axis([0 250 0 0.2])
%    xlabel('Floe size [m]')
%    ylabel('normalized number of floe')
%    hold on
% 
%    j
%   end
% 
%   legende=['$\varepsilon_c=3\times 10^{-5}$';'$\varepsilon_c=4\times 10^{-5}$';'$\varepsilon_c=5\times 10^{-5}$'...
%       ;'$\varepsilon_c=6\times 10^{-5}$';'$\varepsilon_c=7\times 10^{-5}$';'$\varepsilon_c=8\times 10^{-5}$'...
%       ;'$\varepsilon_c=9\times 10^{-5}$';'$\varepsilon_c=1\times 10^{-4}$';'$\varepsilon_c=2\times 10^{-4}$'...
%       ;'$\varepsilon_c=3\times 10^{-4}$'];
% legende=cellstr(legende);
%     l=legend(char(legende));
%   set(l,'interpreter','latex','Box','off','location','eastoutside');