1 | %plot le diagramme T-S pour des eaux de surface vers 19°C |
---|
2 | %Donne la regression linéaire sur les premiers niveaux de surface |
---|
3 | |
---|
4 | f=netcdf('../data_in/file_rest/GYRE_00000400_restart.nc'); |
---|
5 | |
---|
6 | T=f{'tb'}(:,:,:); |
---|
7 | S=f{'sb'}(:,:,:); |
---|
8 | |
---|
9 | close(f); |
---|
10 | |
---|
11 | %Prends la température de surface entre 18 et 28° |
---|
12 | [I,J]=find(squeeze(T(1,:,:))>18 & squeeze(T(1,:,:))<20); |
---|
13 | |
---|
14 | |
---|
15 | cmap=jet(length(I)); |
---|
16 | Ssurf=nan*ones(5,length(I)); |
---|
17 | Tsurf=nan*ones(5,length(I)); |
---|
18 | for i=1:length(I) |
---|
19 | |
---|
20 | |
---|
21 | % plot(squeeze(S(1:5,I(i),J(i))),squeeze(T(1:5,I(i),J(i))),'+') |
---|
22 | % plot(squeeze(S(10:15,I(i),J(i))),squeeze(T(10:15,I(i),J(i))),'-','Color',cmap(i,:)) |
---|
23 | Ssurf(:,i)=squeeze(S(1:5,I(i),J(i))); |
---|
24 | Tsurf(:,i)=squeeze(T(1:5,I(i),J(i))); |
---|
25 | hold on |
---|
26 | % disp(int2str(i)) |
---|
27 | end |
---|
28 | Ssurf=Ssurf(:); |
---|
29 | Tsurf=Tsurf(:); |
---|
30 | figure(1) |
---|
31 | clf |
---|
32 | plot(Ssurf,Tsurf,'+'); |
---|
33 | |
---|
34 | P=polyfit(Ssurf,Tsurf,1); |
---|
35 | |
---|
36 | Sref=[36.6 36.78]; |
---|
37 | Tref=Sref*P(1)+P(2); |
---|
38 | |
---|
39 | hold on |
---|
40 | plot(Sref,Tref,'-'); |
---|
41 | |
---|
42 | title(['dT/dS=' ,num2str(P(1))]); |
---|
43 | |
---|
44 | Ssub=nan*ones(5,length(I)); |
---|
45 | Tsub=nan*ones(5,length(I)); |
---|
46 | |
---|
47 | for i=1:length(I) |
---|
48 | |
---|
49 | |
---|
50 | % plot(squeeze(S(1:5,I(i),J(i))),squeeze(T(1:5,I(i),J(i))),'+') |
---|
51 | % plot(squeeze(S(10:15,I(i),J(i))),squeeze(T(10:15,I(i),J(i))),'-','Color',cmap(i,:)) |
---|
52 | Ssub(:,i)=squeeze(S(13:17,I(i),J(i))); |
---|
53 | Tsub(:,i)=squeeze(T(13:17,I(i),J(i))); |
---|
54 | hold on |
---|
55 | % disp(int2str(i)) |
---|
56 | end |
---|