Blame view

scripts_matlab/temp_results.m~ 1.6 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
clear all;
close all;


dossier=['Pc9'];
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



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')
    
    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)
ylabel(c,'Time [min]')