25 |
'argo_*_2011_to_2012*','climode_*',... |
'argo_*_2011_to_2012*','climode_*',... |
26 |
'ctd_*','itp_*','seals_*','xbt_*'}; |
'ctd_*','itp_*','seals_*','xbt_*'}; |
27 |
listVar={'T','S'}; |
listVar={'T','S'}; |
28 |
|
listBas={'atlExt','pacExt','indExt','arct'}; |
29 |
|
listBasTxt=''; for bb=1:length(listBas); listBasTxt=[listBasTxt ' ' listBas{bb} '*']; end; |
30 |
%shorter test case: listData={'argo_in*'}; listVar={'T'}; |
%shorter test case: listData={'argo_in*'}; listVar={'T'}; |
31 |
dirData='/profiles/output/'; |
dirData='/profiles/output/'; |
32 |
dirMat='mat/'; suffMat='_all'; |
dirMat='mat/'; suffMat='_all'; |
84 |
eval(['misfitDistrib' varCur '.x=x;']); eval(['misfitDistrib' varCur '.y=y;']); |
eval(['misfitDistrib' varCur '.x=x;']); eval(['misfitDistrib' varCur '.y=y;']); |
85 |
eval(['misfitDistrib' varCur '.z=z;']); eval(['misfitDistrib' varCur '.n=n;']); |
eval(['misfitDistrib' varCur '.z=z;']); eval(['misfitDistrib' varCur '.n=n;']); |
86 |
|
|
87 |
|
%upper ocean temporal distribution |
88 |
|
for bb=1:length(listBas); |
89 |
|
for ll=1:3; |
90 |
|
bbb=listBas{bb}; |
91 |
|
if ll==1; Lmin=-90; Lmax=-25; txt=[bbb '_90S25S_misDis' varCur]; |
92 |
|
elseif ll==2; Lmin=-25; Lmax=25; txt=[bbb '_25S25N_misDis' varCur]; |
93 |
|
elseif ll==3; Lmin=25; Lmax=90; txt=[bbb '_25N90N_misDis' varCur]; |
94 |
|
end; |
95 |
|
msk=v4_basin(bbb); |
96 |
|
msk(mygrid.YC<Lmin|mygrid.YC>Lmax)=0; |
97 |
|
% |
98 |
|
msk=convert2array(msk); |
99 |
|
MITprof.prof_msk=msk(MITprof.prof_point); |
100 |
|
MITprofSub=MITprof_subset(MITprof,'msk',1,'depth',[0 700]); |
101 |
|
% |
102 |
|
tmp_date=(MITprofSub.prof_date-date0)/365; |
103 |
|
[x,y,z,n]=MITprof_stats(tmp_date,[0:1/4:1+(year1-year0)],MITprofSub.prof,[-5:0.25:5]); |
104 |
|
z(n==0)=NaN; n(n==0)=NaN; |
105 |
|
eval([txt '.x=x;']); eval([txt '.y=y;']); |
106 |
|
eval([txt '.z=z;']); eval([txt '.n=n;']); |
107 |
|
end; |
108 |
|
end; |
109 |
|
|
110 |
end; |
end; |
111 |
|
|
112 |
eval(['save ' dirMat 'insitu_cost' suffMat '.mat costAve* misfitDistrib* depthTimeCost* year* listData listVar;']); |
eval(['save ' dirMat 'insitu_cost' suffMat '.mat costAve* misfitDistrib* depthTimeCost* year* ' ... |
113 |
|
'listData listVar listBas ' listBasTxt ';']); |
114 |
|
|
115 |
else;%display result |
else;%display result |
116 |
|
|
125 |
|
|
126 |
eval(['x=depthTimeCost' varCur '.x;']); eval(['y=depthTimeCost' varCur '.y;']); |
eval(['x=depthTimeCost' varCur '.x;']); eval(['y=depthTimeCost' varCur '.y;']); |
127 |
eval(['z=depthTimeCost' varCur '.z;']); eval(['n=depthTimeCost' varCur '.n;']); |
eval(['z=depthTimeCost' varCur '.z;']); eval(['n=depthTimeCost' varCur '.n;']); |
128 |
z(n<1e2)=NaN; |
z(n<1e2)=NaN; y=y+year0-1; |
129 |
subplot(2,length(listVar),vv); depthStretchPlot('pcolor',{y,x,z},[0:200:1000 1500:500:6000],[0 1000 4000]); |
subplot(2,length(listVar),vv); depthStretchPlot('pcolor',{y,x,z},[0:200:1000 1500:500:6000],[0 1000 4000]); |
130 |
caxis([0 8]); shading flat; colorbar; ylabel('depth (in m)'); |
caxis([0 8]); shading flat; colorbar; ylabel('depth (in m)'); |
|
xlabel(['date (in years since ' num2str(year0) ')']); |
|
131 |
title(sprintf('mean cost for %s: %0.3g (median: %0.3g)',varCur,costCur)); |
title(sprintf('mean cost for %s: %0.3g (median: %0.3g)',varCur,costCur)); |
132 |
|
|
133 |
%latitudinal distribution: |
%latitudinal distribution: |
143 |
'Distribution of normalized misfits (bottom) as a function of latitude. For T (left) and S (right).'}; |
'Distribution of normalized misfits (bottom) as a function of latitude. For T (left) and S (right).'}; |
144 |
if addToTex; write2tex([dirTex '/' nameTex '.tex'],2,myCaption,gcf); end; |
if addToTex; write2tex([dirTex '/' nameTex '.tex'],2,myCaption,gcf); end; |
145 |
|
|
146 |
|
ii=0; |
147 |
|
ii=ii+1; listPanels(ii).bas='atlExt'; listPanels(ii).ll=3; |
148 |
|
ii=ii+1; listPanels(ii).bas='pacExt'; listPanels(ii).ll=3; |
149 |
|
ii=ii+1; listPanels(ii).bas='arct'; listPanels(ii).ll=3; |
150 |
|
ii=ii+1; listPanels(ii).bas='atlExt'; listPanels(ii).ll=2; |
151 |
|
ii=ii+1; listPanels(ii).bas='pacExt'; listPanels(ii).ll=2; |
152 |
|
ii=ii+1; listPanels(ii).bas='indExt'; listPanels(ii).ll=2; |
153 |
|
ii=ii+1; listPanels(ii).bas='atlExt'; listPanels(ii).ll=1; |
154 |
|
ii=ii+1; listPanels(ii).bas='pacExt'; listPanels(ii).ll=1; |
155 |
|
ii=ii+1; listPanels(ii).bas='indExt'; listPanels(ii).ll=1; |
156 |
|
|
157 |
|
for vv=1:length(listVar); |
158 |
|
varCur=listVar{vv}; |
159 |
|
figureL; |
160 |
|
for ii=1:9; |
161 |
|
bbb=listPanels(ii).bas; ll=listPanels(ii).ll; |
162 |
|
if ll==1; Lmin=-90; Lmax=-25; txt=[bbb '_90S25S_misDis' varCur]; |
163 |
|
elseif ll==2; Lmin=-25; Lmax=25; txt=[bbb '_25S25N_misDis' varCur]; |
164 |
|
elseif ll==3; Lmin=25; Lmax=90; txt=[bbb '_25N90N_misDis' varCur]; |
165 |
|
end; |
166 |
|
|
167 |
|
eval(['x=' txt '.x;']); eval(['y=' txt '.y;']); |
168 |
|
eval(['z=' txt '.z;']); eval(['n=' txt '.n;']); |
169 |
|
x=x+year0-1; |
170 |
|
tmp1=(nansum(n,2)>1e4)*ones(1,size(n,2)); z(tmp1==0)=NaN; |
171 |
|
subplot(3,3,ii); contourf(x,y,z,[0:0.05:0.5]); grid on; |
172 |
|
caxis([0 0.5]); colorbar; title(txt,'Interpreter','none'); |
173 |
|
%title([txt ', normalized misfit pdf'],'Interpreter','none'); |
174 |
|
if mod(ii,3)==1; ylabel('normalized misfit'); end; |
175 |
|
%if ii<=6; set(gca,'XTick',[]); end; |
176 |
|
end; |
177 |
|
|
178 |
|
myCaption={'Distribution of normalized misfits per basin (panel) as ',... |
179 |
|
'a function of latitude, for ',varCur}; |
180 |
|
if addToTex; write2tex([dirTex '/' nameTex '.tex'],2,myCaption,gcf); end; |
181 |
|
|
182 |
|
end; |
183 |
|
|
184 |
end; |
end; |
185 |
|
|
186 |
|
|