Blame view

scripts_matlab/temp_results.m 4.14 KB
68586e03   Jérémy Baudry   new release
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
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
c5b6a1a5   Jérémy Baudry   makefile and disp...
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
125
126
127
128
129
130
131
132
133
134
135
136
        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
68586e03   Jérémy Baudry   new release
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
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

c5b6a1a5   Jérémy Baudry   makefile and disp...
152
153
154
155
156
157
158
159
160
161
162
163
164
165

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


68586e03   Jérémy Baudry   new release
166
167
cmap=jet(size(FSD4,2));
for i=1:size(FSD4,2)
c5b6a1a5   Jérémy Baudry   makefile and disp...
168
169
170
171
172
173
174
175
176
177
178
179
180
181
    
    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,:))
68586e03   Jérémy Baudry   new release
182
    hold on
c5b6a1a5   Jérémy Baudry   makefile and disp...
183
184
185
186
187
188
189
190
191
192
    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;