source: trunk/src/mode_sahelien/reconstitution_1025.m @ 91

Last change on this file since 91 was 91, checked in by pinsard, 10 years ago

fix thanks to coding rules

File size: 2.9 KB
Line 
1%
2
3clear;
4close all;
5
6%lon=[-30:2.5:30], lat=[-10:2.5:30]
7
8status=load('eof_1025_jjas.mat','C','olr');
9C=status.C;
10olr=status.olr;
11clear status;
12
13olr=olr';
14PC1=olr*C;
15
16cosa=zeros(4,3416,425);
17% boucle sur les VP
18for a=1:4;
19      for b=1:3416 % boucle sur le temps
20          for c=1:425 % boucle sur l espace
21             cosa(a,b,c)=PC1(b,426-a)*C(c,426-a);
22          end;
23      end;
24end;
25
26cosa1(:,:)=cosa(1,:,:);
27cosa1=reshape(cosa1,3416,25,17);
28
29cosa2(:,:)=cosa(2,:,:);
30cosa2=reshape(cosa2,3416,25,17);
31
32cosabis=cosa(2:3,:,:);
33cosa23(:,:)=sum(cosabis);
34clear cosabis;
35cosa23=reshape(cosa23,3416,25,17);
36
37cosabis=cosa(2:4,:,:);
38cosa24(:,:)=sum(cosabis);
39clear cosabis;
40cosa24=reshape(cosa24,3416,25,17);
41
42figure(1);
43orient('landscape')
44figure(2);
45orient('landscape')
46figure(3);
47orient('landscape')
48
49% On sélectionne le domaine géographique
50
51% la latitude : 5N (7) 12.5N (10)
52% la longitude : 10W (9) 10E(17)
53lat1=7;
54lat2=10;
55lon1=9;
56lon2=17;
57taille=(lat2-lat1+1)*(lon2-lon1+1);
58
59cosa23=cosa23(:,lon1:lon2,lat1:lat2);
60clear cosi2;
61cosa23=reshape(cosa23,3416,taille);
62cosa23=cosa23';
63cosa23=mean(cosa23);
64cosa23=cosa23';
65save('eof23_1025.txt','cosa23','-ASCII');
66cosa23=reshape(cosa23,122,28);
67
68cosa24=cosa24(:,lon1:lon2,lat1:lat2);
69clear cosi2;
70cosa24=reshape(cosa24,3416,taille);
71cosa24=cosa24';
72cosa24=mean(cosa24);
73cosa24=cosa24';
74save('eof24_1025.txt','cosa24','-ASCII');
75cosa24=reshape(cosa24,122,28);
76
77fid=fopen('sahel_scav.dat','r');
78v=fread(fid,3538,'float');
79fclose(fid);
80
81% on met sous la forme annee mois
82ind_olr=reshape(v,122,29);
83clear v;
84
85% on selectionne les annees de 1979 a 2006
86ind_olr=ind_olr(:,1:28);
87
88for a=1:28;
89     if a<12;
90        figure(1);
91        subplot(4,3,a);
92     elseif a<24
93        figure(2);
94        subplot(4,3,a-11);
95    else
96        figure(3);
97        subplot(4,3,a-23);
98     end;
99     y2=ind_olr(:,a);
100     y4=cosa24(:,a);
101     x=[1:122]';
102     plot(x,y2);
103     hold on;
104     plot(x,y4,'k');
105     y5=zeros(122,1);
106     plot(x,y5,'k:');
107
108     title(a+1978,'Fontsize',8);
109     if a==2;
110         text(0,65,'OLR 5 -12.5N et 10W - 10E');
111     elseif a==13;
112         text(0,65,'OLR 5 -12.5N et 10W - 10E');
113     end;
114     set (gca,'tickDir','out');
115     if a==11;
116        aa=legend('OLR VP2-3','OLR NOAA');
117        set (aa,'fontsize',8,'Position',[0.6800 0.1039 0.2470 0.1642])
118        legend boxoff;
119     elseif a==22;
120        clear aa;
121        aa=legend('OLR VP2-3','OLR NOAA');
122        set (aa,'fontsize',8,'Position',[0.6800 0.1039 0.2470 0.1642])
123        legend boxoff;
124     end;
125     axis([1 122 -15 15]);
126     set (gca,'YTick',[-15:5:15],'YTickLabel',[-15:5:15],'fontname','Arial','fontsize',6);
127   set (gca,'XTick',[10:10:122],'XTickLabel',[10:10:122],'fontname','Arial','fontsize',6);
128
129end;
130
131figure(1);
132print('-depsc2','reconstitution1_eof234_1025.eps');
133figure(2);
134print('-depsc2','reconstitution2_eof234_1025.eps');
135figure(3);
136print('-depsc2','reconstitution3_eof234_1025.eps');
Note: See TracBrowser for help on using the repository browser.