Blame view

scripts_matlab/fig8_article.m~ 2.97 KB
c5b6a1a5   Jérémy Baudry   makefile and disp...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
clear all;
close all;


for i=1:100
    
    
    dossier=['pc_ec',num2str(i-1)];
   path=['/home/bauj0001/projets/WIM/output/',dossier,'/',dossier,'.nc'];
   Dave=ncread(path,'Dave');
   
   x=ncread(path,'x_axis');

   Lmiz(i)=length(find(Dave>0 & Dave<396))*(x(2)-x(1));
  
 i
   
end

Lmiz2=reshape(Lmiz,10,10);
Ec=[3e-5 4e-5 5e-5 6e-5 7e-5 8e-5 9e-5 1e-4 2e-4 3e-4];

legende=['$P_c=0.10$';'$P_c=0.15$';'$P_c=0.20$';'$P_c=0.25$';'$P_c=0.30$'...
    ;'$P_c=0.35$';'$P_c=0.40$';'$P_c=0.45$';'$P_c=0.50$';'$P_c=0.55$'];
legende=cellstr(legende);

cmap=jet(10);
M=['*','o','+','*','o','+','*','o','+','*'];
    


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];


for i=1:10
 
    
    plot(Ec,Lmiz2(i,:),'color',cmap(i,:),'Marker',M(i));
    hold on
   
end  
  xlabel('$\varepsilon_c$','interpreter','latex')
  ylabel('$L_{MIZ}$ [km]','interpreter','latex')
  a=gca;
%   a.Position(2)=a.Position(2)+0.2;
%   a.Position(3)=a.Position(3)-0.2;
%   a.Position(4)=a.Position(4)-0.2;
  
  
  l=legend(char(legende));
  set(l,'interpreter','latex','Box','off','location','eastoutside');
  
  
  %------------------------------------------------------------------------------------------------------
  figure
  cmap=jet(10);
  for j=1:10
    
    
    dossier=['ec',num2str(j)];
   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 400 0 1])
   xlabel('Floe size [m]')
   ylabel('normalized number of floe')
   hold on
   axis([0 250 0 0.2])

a=a+10
   
  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');
%