/[MITgcm]/MITgcm_contrib/gael/matlab_class/gcmfaces_diags/diags_set_A.m
ViewVC logotype

Contents of /MITgcm_contrib/gael/matlab_class/gcmfaces_diags/diags_set_A.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.13 - (show annotations) (download)
Mon Jan 11 21:28:30 2016 UTC (9 years, 6 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65x, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, HEAD
Changes since 1.12: +10 -7 lines
- diags_driver.m: add MLD in default list.
- diags_driver_tex.m: issue message about compiling tex.
- diags_grid_parms.m: treat case when nctiles_grid is used.
- diags_set_A.m: skip Atl., Pac., Ind. computation if
  basin_masks_eccollc_90x50.bin is not found by v4_basin.
- diags_set_C.m: fix nctiles, climatology case.

1
2 if userStep==1;%diags to be computed
3 listDiags='fldBAR fldTRANSPORTS gloOV gloOVbolus gloOVres gloMT_H gloMT_FW gloMT_SLT';
4 listBasins=1;
5 if sum([90 1170]~=mygrid.ioSize)==0;
6 listBasins=[1:3];
7 mskC=v4_basin({'atlExt'});
8 if isempty(mskC); listBasins=1; end;
9 end;
10 if length(listBasins)==3;
11 listDiags=[listDiags ' atlOV atlOVbolus atlOVres atlMT_H atlMT_FW atlMT_SLT'];
12 listDiags=[listDiags ' pacindOV pacindOVbolus pacindOVres pacindMT_H pacindMT_FW pacindMT_SLT'];
13 end;
14 elseif userStep==2;%input files and variables
15 listFlds={'UVELMASS','VVELMASS','GM_PsiX','GM_PsiY'};
16 listFlds={listFlds{:},'ADVx_TH ','ADVy_TH ','DFxE_TH ','DFyE_TH '};
17 listFlds={listFlds{:},'ADVx_SLT','ADVy_SLT','DFxE_SLT','DFyE_SLT'};
18 listFldsNames=deblank(listFlds);
19 listFiles={'trsp_3d_set1','trsp_2d_set1','trsp_3d_set2'};
20 listSubdirs={[dirModel 'diags/TRSP/'],[dirModel 'diags/']};
21 elseif userStep==3;%computational part;
22 %mask fields:
23 fldU=UVELMASS.*mygrid.mskW; fldV=VVELMASS.*mygrid.mskS;
24 if ~isempty(whos('ADVx_TH'));%for backward compatibility
25 if size(ADVx_TH{1},3)>1; %assume full 3D fields
26 mskW=mygrid.mskW; mskS=mygrid.mskS;
27 else; %assume vertically integrated (2D fields)
28 mskW=mygrid.mskW(:,:,1); mskS=mygrid.mskS(:,:,1);
29 end;
30 ADVx_TH=ADVx_TH.*mskW; ADVy_TH=ADVy_TH.*mskS;
31 ADVx_SLT=ADVx_SLT.*mskW; ADVy_SLT=ADVy_SLT.*mskS;
32 DFxE_TH=DFxE_TH.*mskW; DFyE_TH=DFyE_TH.*mskS;
33 DFxE_SLT=DFxE_SLT.*mskW; DFyE_SLT=DFyE_SLT.*mskS;
34 end;
35 if ~isempty(whos('GM_PsiX'));%for backward compatibility
36 [fldUbolus,fldVbolus,fldWbolus]=calc_bolus(GM_PsiX,GM_PsiY);
37 fldUbolus=fldUbolus.*mygrid.mskW; fldVbolus=fldVbolus.*mygrid.mskS;
38 fldUres=fldU+fldUbolus; fldVres=fldV+fldVbolus;
39 end;
40
41 %compute barotropic stream function:
42 [fldBAR]=calc_barostream(fldU,fldV);
43 %compute transports along transects:
44 [fldTRANSPORTS]=1e-6*calc_transports(fldU,fldV,mygrid.LINES_MASKS,{'dh','dz'});
45
46 %compute overturning stream functions:
47 for bb=listBasins;
48 %mask : global, atlantic or Pac+Ind
49 if bb==1; mskC=mygrid.mskC; mskC(:)=1;
50 elseif bb==2; mskC=v4_basin({'atlExt'}); mskC=mk3D(mskC,fldU);
51 elseif bb==3; mskC=v4_basin({'pacExt','indExt'}); mskC=mk3D(mskC,fldU);
52 end;
53 %note: while mskC is a basin mask for tracer points, it can be applied to U/V below
54 %compute overturning: eulerian contribution
55 [fldOV]=calc_overturn(fldU.*mskC,fldV.*mskC);
56 if ~isempty(whos('GM_PsiX'));%for backward compatibility
57 %compute overturning: eddy contribution
58 [fldOVbolus]=calc_overturn(fldUbolus.*mskC,fldVbolus.*mskC);
59 %compute overturning: residual overturn
60 [fldOVres]=calc_overturn(fldUres.*mskC,fldVres.*mskC);
61 else;
62 fldOVbolus=NaN*fldOV; fldOVres=NaN*fldOV;
63 end;
64
65 if ~isempty(whos('ADVx_TH'));%for backward compatibility
66 %compute meridional heat transports:
67 tmpU=(ADVx_TH+DFxE_TH).*mskC(:,:,1:size(ADVx_TH{1},3));
68 tmpV=(ADVy_TH+DFyE_TH).*mskC(:,:,1:size(ADVx_TH{1},3));
69 [fldMT_H]=1e-15*4e6*calc_MeridionalTransport(tmpU,tmpV,0);
70 %compute meridional fresh water transports:
71 %... using the virtual salt flux formula:
72 %[fldMT_FW]=1e-6/35*calc_MeridionalTransport(ADVx_SLT+DFxE_SLT,ADVy_SLT+DFyE_SLT,0);
73 %[fldMT_FW]=1e-6/35*calc_MeridionalTransport(ADVx_SLT,ADVy_SLT,0);
74 %... using the real freshwater flux formula:
75 [fldMT_FW]=1e-6*calc_MeridionalTransport(fldU.*mskC,fldV.*mskC,1);
76 %compute meridional salt transports:
77 tmpU=(ADVx_SLT+DFxE_SLT).*mskC(:,:,1:size(ADVx_TH{1},3));
78 tmpV=(ADVy_SLT+DFyE_SLT).*mskC(:,:,1:size(ADVx_TH{1},3));
79 [fldMT_SLT]=1e-6*calc_MeridionalTransport(tmpU,tmpV,0);
80 else;
81 fldMT_H=NaN*mygrid.LATS; fldMT_FW=NaN*mygrid.LATS; fldMT_SLT=NaN*mygrid.LATS;
82 end;
83
84 %store to global, atlantic or Pac+Ind arrays:
85 if bb==1;
86 gloMT_H=fldMT_H; gloMT_FW=fldMT_FW; gloMT_SLT=fldMT_SLT;
87 gloOV=fldOV; gloOVbolus=fldOVbolus; gloOVres=fldOVres;
88 elseif bb==2;
89 kk=find(mygrid.LATS<-35|mygrid.LATS>70);
90 fldMT_H(kk,:)=NaN; fldMT_FW(kk,:)=NaN; fldMT_SLT(kk,:)=NaN;
91 fldOV(kk,:)=NaN; fldOVbolus(kk,:)=NaN; fldOVres(kk,:)=NaN;
92 atlMT_H=fldMT_H; atlMT_FW=fldMT_FW; atlMT_SLT=fldMT_SLT;
93 atlOV=fldOV; atlOVbolus=fldOVbolus; atlOVres=fldOVres;
94 elseif bb==3;
95 kk=find(mygrid.LATS<-35|mygrid.LATS>65);
96 fldMT_H(kk,:)=NaN; fldMT_FW(kk,:)=NaN; fldMT_SLT(kk,:)=NaN;
97 fldOV(kk,:)=NaN; fldOVbolus(kk,:)=NaN; fldOVres(kk,:)=NaN;
98 pacindMT_H=fldMT_H; pacindMT_FW=fldMT_FW; pacindMT_SLT=fldMT_SLT;
99 pacindOV=fldOV; pacindOVbolus=fldOVbolus; pacindOVres=fldOVres;
100 end;
101 end;
102
103 %===================== COMPUTATIONAL SEQUENCE ENDS =========================%
104 %===================== PLOTTING SEQUENCE BEGINS =========================%
105
106 elseif userStep==-1;%plotting
107
108 if isempty(setDiagsParams);
109 choicePlot={'all'};
110 else;
111 choicePlot=setDiagsParams;
112 end;
113
114 if ~sum(strcmp(listDiags,'atlOV')); multiBasins=0; end;
115
116 if sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'bf'));
117
118 if addToTex; write2tex(fileTex,1,'barotropic streamfunction',2); end;
119
120 %barotropic streamfunction:
121 fld=mean(alldiag.fldBAR(:,:,tt),3);
122 cc=[[-80:20:-40] [-25 -15:5:15 25] [40:40:200]]; title0='Horizontal Stream Function';
123 if doAnomalies; cc=scaleAnom*[-5:0.5:5]; end;
124 figureL; m_map_gcmfaces(fld,0,{'myCaxis',cc},{'do_m_coast',1},{'myTitle',title0});
125 myCaption={myYmeanTxt,'mean -- barotropic streamfunction (Sv)'};
126 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
127 %and the corresponding standard deviation:
128 if multiTimes;
129 fld=std(alldiag.fldBAR(:,:,tt),[],3);
130 cc=[0:0.5:3 4 5 7 10 15:5:25 35 50]; title0='Horizontal Stream Function';
131 if doAnomalies; cc=scaleAnom*[0:0.25:2]; end;
132 figureL; m_map_gcmfaces(fld,0,{'myCaxis',cc},{'do_m_coast',1},{'myTitle',title0});
133 myCaption={myYmeanTxt,' standard deviation -- barotropic streamfunction (Sv)'};
134 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
135 end;
136
137 end;
138
139 if sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'ov'));
140
141 if addToTex; write2tex(fileTex,1,'meridional streamfunction',2); end;
142
143 %meridional streamfunction (Eulerian) :
144 fld=mean(alldiag.gloOV(:,:,tt),3); fld(fld==0)=NaN;
145 X=mygrid.LATS*ones(1,length(mygrid.RF)); Y=ones(length(mygrid.LATS),1)*(mygrid.RF');
146 cc=[[-50:10:-30] [-24:3:24] [30:10:50]]; title0='Meridional Stream Function';
147 if doAnomalies; cc=scaleAnom*[-1:0.1:1]; end;
148 figureL; set(gcf,'Renderer','zbuffer'); %set(gcf,'Units','Normalized','Position',[0.05 0.1 0.4 0.8]);
149 depthStretchPlot('pcolor',{X,Y,fld}); shading interp; cbar=gcmfaces_cmap_cbar(cc); title(title0);
150 myCaption={myYmeanTxt,'mean -- overturning streamfunction (Sv)'};
151 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
152
153 %meridional streamfunction (residual) :
154 fld=mean(alldiag.gloOVres(:,:,tt),3); fld(fld==0)=NaN;
155 X=mygrid.LATS*ones(1,length(mygrid.RF)); Y=ones(length(mygrid.LATS),1)*(mygrid.RF');
156 cc=[[-50:10:-30] [-24:3:24] [30:10:50]]; title0='Meridional Stream Function (incl. GM)';
157 if doAnomalies; cc=scaleAnom*[-1:0.1:1]; end;
158 figureL; set(gcf,'Renderer','zbuffer'); %set(gcf,'Units','Normalized','Position',[0.05 0.1 0.4 0.8]);
159 depthStretchPlot('pcolor',{X,Y,fld}); shading interp; cbar=gcmfaces_cmap_cbar(cc); title(title0);
160 myCaption={myYmeanTxt,'mean -- overturning streamfunction incl. GM (Sv)'};
161 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
162
163 if multiBasins;
164 %meridional streamfunction (Eulerian):
165 fld=mean(alldiag.atlOV(:,:,tt),3); fld(fld==0)=NaN;
166 X=mygrid.LATS*ones(1,length(mygrid.RF)); Y=ones(length(mygrid.LATS),1)*(mygrid.RF');
167 cc=[[-50:10:-30] [-24:3:24] [30:10:50]]; title0='Atlantic Meridional Stream Function';
168 if doAnomalies; cc=scaleAnom*[-1:0.1:1]; end;
169 figureL; set(gcf,'Renderer','zbuffer'); %set(gcf,'Units','Normalized','Position',[0.05 0.1 0.4 0.8]);
170 depthStretchPlot('pcolor',{X,Y,fld}); shading interp; cbar=gcmfaces_cmap_cbar(cc); title(title0);
171 myCaption={myYmeanTxt,'mean -- Atlantic overturning streamfunction (Sv)'};
172 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
173 %meridional streamfunction (residual):
174 fld=mean(alldiag.pacindOV(:,:,tt),3); fld(fld==0)=NaN;
175 X=mygrid.LATS*ones(1,length(mygrid.RF)); Y=ones(length(mygrid.LATS),1)*(mygrid.RF');
176 cc=[[-50:10:-30] [-24:3:24] [30:10:50]]; title0='Pac+Ind Meridional Stream Function';
177 if doAnomalies; cc=scaleAnom*[-1:0.1:1]; end;
178 figureL; set(gcf,'Renderer','zbuffer'); %set(gcf,'Units','Normalized','Position',[0.05 0.1 0.4 0.8]);
179 depthStretchPlot('pcolor',{X,Y,fld}); shading interp; cbar=gcmfaces_cmap_cbar(cc); title(title0);
180 myCaption={myYmeanTxt,'mean -- Pac+Ind overturning streamfunction (Sv)'};
181 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
182 end;
183
184 if multiTimes;
185 %and the corresponding standard deviation:
186 fld=std(alldiag.gloOV(:,:,tt),[],3); fld(fld==0)=NaN;
187 X=mygrid.LATS*ones(1,length(mygrid.RF)); Y=ones(length(mygrid.LATS),1)*(mygrid.RF');
188 cc=[0:0.5:3 4 5 7 10 15:5:25 35 50]; title0='Meridional Stream Function';
189 if doAnomalies; cc=scaleAnom*[0:0.1:1]; end;
190 figureL; set(gcf,'Renderer','zbuffer'); %set(gcf,'Units','Normalized','Position',[0.05 0.1 0.4 0.8]);
191 depthStretchPlot('pcolor',{X,Y,fld}); shading interp; cbar=gcmfaces_cmap_cbar(cc); title(title0);
192 myCaption={myYmeanTxt,' standard deviation -- overturning streamfunction (Sv)'};
193 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
194 end;
195
196 if multiTimes&multiBasins;
197 %and the corresponding standard deviation:
198 fld=std(alldiag.atlOV(:,:,tt),[],3); fld(fld==0)=NaN;
199 X=mygrid.LATS*ones(1,length(mygrid.RF)); Y=ones(length(mygrid.LATS),1)*(mygrid.RF');
200 cc=[0:0.5:3 4 5 7 10 15:5:25 35 50]; title0='Atlantic Meridional Stream Function';
201 if doAnomalies; cc=scaleAnom*[0:0.1:1]; end;
202 figureL; set(gcf,'Renderer','zbuffer'); %set(gcf,'Units','Normalized','Position',[0.05 0.1 0.4 0.8]);
203 depthStretchPlot('pcolor',{X,Y,fld}); shading interp; cbar=gcmfaces_cmap_cbar(cc); title(title0);
204 myCaption={myYmeanTxt,' standard deviation -- Atlantic overturning streamfunction (Sv)'};
205 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
206 end;
207
208 end;
209
210 if sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'ovtime'));
211
212 if addToTex; write2tex(fileTex,1,'meridional streamfunction (time series)',2); end;
213
214 %time series
215 if multiTimes;
216 figureL;
217 tmp1=abs(-mygrid.RC-1000); kk=find(tmp1==min(tmp1)); kk=kk(1);
218 gloOV1000=squeeze(alldiag.gloOV(:,kk,:)); gloOV1000=runmean(gloOV1000,myNmean,2);
219 plot(TT,gloOV1000(90+25,:),'LineWidth',2); hold on; plot(TT,gloOV1000(90+35,:),'k','LineWidth',2);
220 plot(TT,gloOV1000(90+45,:),'r','LineWidth',2); plot(TT,gloOV1000(90+55,:),'g','LineWidth',2);
221 title0='annual global overturning at \approx 1000m depth (Sv)'; aa=axis; aa()
222 legend('25N','35N','45N','55N'); title(title0);
223 aa(3:4)=[0 20]; axis(aa); grid on;
224 if doAnomalies; aa(3:4)=scaleAnom*[-1 1]; axis(aa); end;
225 myCaption={'annual global overturning at select latitudes at $\\approx$ 1000m depth'};
226 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
227 end;
228
229 if multiTimes&multiBasins;
230 figureL;
231 tmp1=abs(-mygrid.RC-1000); kk=find(tmp1==min(tmp1)); kk=kk(1);
232 atlOV1000=squeeze(alldiag.atlOV(:,kk,:)); atlOV1000=runmean(atlOV1000,myNmean,2);
233 plot(TT,atlOV1000(90+25,:),'LineWidth',2); hold on; plot(TT,atlOV1000(90+35,:),'k','LineWidth',2);
234 plot(TT,atlOV1000(90+45,:),'r','LineWidth',2); plot(TT,atlOV1000(90+55,:),'g','LineWidth',2);
235 title0='annual atlantic overturning at \approx 1000m depth';
236 legend('25N','35N','45N','55N'); title(title0);
237 aa(3:4)=[0 20]; axis(aa); grid on;
238 if doAnomalies; aa(3:4)=scaleAnom*[-1 1]*2; axis(aa); end;
239 myCaption={'annual Atlantic overturning at select latitudes at $\\approx$ 1000m depth (Sv)'};
240 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
241 end;
242
243 end;
244
245 if sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'mht'));
246
247 if addToTex; write2tex(fileTex,1,'meridional heat transport',2); end;
248
249 %meridional heat transport
250 figureL;
251 fld=mean(alldiag.gloMT_H(:,tt),2);
252 plot(mygrid.LATS,fld,'LineWidth',2);
253 if multiBasins;
254 atl=mean(alldiag.atlMT_H(:,tt),2); pacind=mean(alldiag.pacindMT_H(:,tt),2);
255 hold on; plot(mygrid.LATS,atl,'r','LineWidth',2);
256 plot(mygrid.LATS,pacind,'g','LineWidth',2);
257 legend('global','Atlantic','Pacific+Indian','Location','SouthEast');
258 end;
259 set(gca,'FontSize',14); grid on; axis([-90 90 -2 2]);
260 if doAnomalies; aa=axis; aa(3:4)=scaleAnom*[-1 1]*0.05; axis(aa); end;
261 title('Meridional Heat Transport (in PW)');
262 myCaption={myYmeanTxt,'mean -- meridional heat transport (PW)'};
263 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
264
265 %and the corresponding standard deviation:
266 if multiTimes;
267 figureL;
268 fld=std(alldiag.gloMT_H(:,tt),[],2);
269 plot(mygrid.LATS,fld,'LineWidth',2);
270 if multiBasins;
271 atl=std(alldiag.atlMT_H(:,tt),[],2);
272 pacind=std(alldiag.pacindMT_H(:,tt),[],2);
273 hold on; plot(mygrid.LATS,atl,'r','LineWidth',2);
274 plot(mygrid.LATS,pacind,'g','LineWidth',2);
275 legend('global','Atlantic','Pacific+Indian');
276 end;
277 set(gca,'FontSize',14); grid on; axis([-90 90 0 4]);
278 if doAnomalies; aa=axis; aa(3:4)=scaleAnom*[0 1]*0.1; axis(aa); end;
279 title('Meridional Heat Transport (in PW)');
280 myCaption={myYmeanTxt,' standard deviation -- meridional heat transport (PW)'};
281 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
282 end;
283
284 end;
285
286 if sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'mfwt'));
287
288 if addToTex; write2tex(fileTex,1,'meridional freshwater transport',2); end;
289
290 %meridional freshwater transport
291 figureL;
292 fld=mean(alldiag.gloMT_FW(:,tt),2);
293 plot(mygrid.LATS,fld,'LineWidth',2);
294 if multiBasins;
295 atl=mean(alldiag.atlMT_FW(:,tt),2); pacind=mean(alldiag.pacindMT_FW(:,tt),2);
296 hold on; plot(mygrid.LATS,atl,'r','LineWidth',2);
297 plot(mygrid.LATS,pacind,'g','LineWidth',2);
298 legend('global','Atlantic','Pacific+Indian');
299 end;
300 set(gca,'FontSize',14); grid on; axis([-90 90 -1.5 2.0]);
301 if doAnomalies; aa=axis; aa(3:4)=scaleAnom*[-1 1]*0.1; axis(aa); end;
302 title('Meridional Freshwater Transport (in Sv)');
303 myCaption={myYmeanTxt,'mean -- meridional freshwater transport (Sv)'};
304 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
305
306 %and the corresponding standard deviation:
307 if multiTimes;
308 figureL;
309 fld=std(alldiag.gloMT_FW(:,tt),[],2);
310 plot(mygrid.LATS,fld,'LineWidth',2);
311 if multiBasins;
312 atl=std(alldiag.atlMT_FW(:,tt),[],2); pacind=std(alldiag.pacindMT_FW(:,tt),[],2);
313 hold on; plot(mygrid.LATS,atl,'r','LineWidth',2);
314 plot(mygrid.LATS,pacind,'g','LineWidth',2);
315 legend('global','Atlantic','Pacific+Indian');
316 end;
317 set(gca,'FontSize',14); grid on; axis([-90 90 0 2]);
318 if doAnomalies; aa=axis; aa(3:4)=scaleAnom*[0 1]*0.2; axis(aa); end;
319 title('Meridional Freshwater Transport (in Sv)');
320 myCaption={myYmeanTxt,' standard deviation -- meridional freshwater transport (Sv)'};
321 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
322 end;
323
324 end;
325
326 if sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'mslt'));
327
328 if addToTex; write2tex(fileTex,1,'meridional salt transport',2); end;
329
330 %meridional salt transport
331 figureL;
332 fld=mean(alldiag.gloMT_SLT(:,tt),2);
333 plot(mygrid.LATS,fld,'LineWidth',2);
334 if multiBasins;
335 atl=mean(alldiag.atlMT_SLT(:,tt),2); pacind=mean(alldiag.pacindMT_SLT(:,tt),2);
336 hold on; plot(mygrid.LATS,atl,'r','LineWidth',2);
337 plot(mygrid.LATS,pacind,'g','LineWidth',2);
338 legend('global','Atlantic','Pacific+Indian');
339 end;
340 set(gca,'FontSize',14); grid on; axis([-90 90 -50 50]);
341 if doAnomalies; aa=axis; aa(3:4)=scaleAnom*[-1 1]*2; axis(aa); end;
342 title('Meridional Salt Transport (in psu.Sv)');
343 myCaption={myYmeanTxt,'mean -- meridional salt transport (psu.Sv)'};
344 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
345 %and the corresponding standard deviation:
346
347 if multiTimes;
348 figureL;
349 fld=std(alldiag.gloMT_SLT(:,tt),[],2);
350 plot(mygrid.LATS,fld,'LineWidth',2);
351 if multiBasins;
352 atl=std(alldiag.atlMT_SLT(:,tt),[],2); pacind=std(alldiag.pacindMT_SLT(:,tt),[],2);
353 hold on; plot(mygrid.LATS,atl,'r','LineWidth',2);
354 plot(mygrid.LATS,pacind,'g','LineWidth',2);
355 legend('global','Atlantic','Pacific+Indian');
356 end;
357 set(gca,'FontSize',14); grid on; axis([-90 90 0 60]);
358 if doAnomalies; aa=axis; aa(3:4)=scaleAnom*[0 1]*2; axis(aa); end;
359 title('Meridional Salt Transport (in psu.Sv)');
360 myCaption={myYmeanTxt,' standard deviation -- meridional salt transport (psu.Sv)'};
361 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
362 end;
363
364 end;
365
366 if multiTimes&(sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'mttime')));
367
368 if addToTex; write2tex(fileTex,1,'meridional transports (time series)',2); end;
369
370 %meridional heat transport
371 fld=squeeze(alldiag.gloMT_H(:,tt))';
372 x=TT*ones(1,length(mygrid.LATS)); y=ones(nt,1)*mygrid.LATS';
373 fld=runmean(fld,myNmean,1);
374 cc=[[-250:50:-100] [-75 -50] [-35:10:35] [50 75] [100:50:250]]/50;
375 if doAnomalies; cc=scaleAnom*[-1:0.1:1]*0.05; end;
376 figureL; pcolor(x,y,fld); shading flat; axis([TT(1) TT(end) -90 90]);
377 gcmfaces_cmap_cbar(cc); title('Meridional Heat Transport (in PW)');
378 myCaption={'meridional heat transport (PW, annual mean)'};
379 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
380
381 %meridional freshwater transport
382 fld=squeeze(alldiag.gloMT_FW(:,tt))';
383 x=TT*ones(1,length(mygrid.LATS)); y=ones(nt,1)*mygrid.LATS';
384 fld=runmean(fld,myNmean,1);
385 cc=[[-250:50:-100] [-75 -50] [-35:10:35] [50 75] [100:50:250]]/100;
386 if doAnomalies; cc=scaleAnom*[-1:0.1:1]*0.05; end;
387 figureL; pcolor(x,y,fld); shading flat; axis([TT(1) TT(end) -90 90]);
388 gcmfaces_cmap_cbar(cc); title('Meridional Freshwater Transport (in Sv)');
389 myCaption={'meridional freshwater transport (Sv, annual mean)'};
390 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
391
392 %meridional salt transport
393 fld=squeeze(alldiag.gloMT_SLT(:,tt))';
394 x=TT*ones(1,length(mygrid.LATS)); y=ones(nt,1)*mygrid.LATS';
395 fld=runmean(fld,myNmean,1);
396 cc=[[-250:50:-100] [-75 -50] [-35:10:35] [50 75] [100:50:250]]/10;
397 if doAnomalies; cc=scaleAnom*[-1:0.1:1]*1; end;
398 figureL; pcolor(x,y,fld); shading flat; axis([TT(1) TT(end) -90 90]);
399 gcmfaces_cmap_cbar(cc); title('Meridional Salt Transport (in psu.Sv)');
400 myCaption={'meridional salt transport (psu.Sv, annual mean)'};
401 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
402
403 end;
404
405
406 if (sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'sectime')));
407
408 if addToTex; write2tex(fileTex,1,'transects transport',2); end;
409
410 %Bering Strait and Arctic/Atlantic exchanges:
411 if multiTimes; figureL; end;
412 iiList=[1 8:12]; rrList=[[-1 3];[-3 1];[-7 -2];[0 9];[-4 4];[-0.5 0.5]];
413 for iii=1:length(iiList);
414 ii=iiList(iii);
415 if multiTimes; subplot(3,2,iii); end;
416 trsp=squeeze(alldiag.fldTRANSPORTS(ii,:,:));
417 txt=[mygrid.LINES_MASKS(ii).name ' (>0 to Arctic)'];
418 ylim=rrList(iii,:);
419 if doAnomalies; ylim=scaleAnom*[-1 1]*0.4; end;
420 disp_transport(trsp,TT,txt,{'ylim',ylim},{'nmean',myNmean});
421 end;
422 myCaption={'volume transports entering the Arctic (Sv, annual mean)'};
423 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); end;
424
425 %Florida Strait:
426 if multiTimes; figureL; end;
427 iiList=[3 4 6 7]; rrList=[[20 40];[20 40];[-1 3];[-6 2]];
428 for iii=1:length(iiList);
429 ii=iiList(iii);
430 if multiTimes; subplot(2,2,iii); end;
431 trsp=squeeze(alldiag.fldTRANSPORTS(ii,:,:));
432 txt=[mygrid.LINES_MASKS(ii).name ' (>0 to Atlantic)'];
433 ylim=rrList(iii,:);
434 if doAnomalies; ylim=scaleAnom*[-1 1]*2; end;
435 disp_transport(trsp,TT,txt,{'ylim',ylim},{'nmean',myNmean});
436 end;
437 myCaption={'volume transports entering the Atlantic (Sv, annual mean)'};
438 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); end;
439
440 %Gibraltar special case:
441 if multiTimes; figureL; end;
442 trsp=squeeze(alldiag.fldTRANSPORTS(2,:,:));
443 txt='Gibraltar Overturn (upper ocean transport towards Med.)';
444 ylim=[0.4 1.2];
445 if doAnomalies; ylim=scaleAnom*[-1 1]*0.05; end;
446 disp_transport(trsp,TT,txt,{'ylim',ylim},{'nmean',myNmean},{'choicePlot',2});
447 myCaption={'Gibraltar Overturn (Sv, annual mean)'};
448 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); end;
449
450 %Drake, ACC etc:
451 if multiTimes; figureL; end;
452 iiList=[13 20 19 18]; rrList=[[120 180];[140 200];[-40 -10];[140 200]];
453 for iii=1:length(iiList);
454 ii=iiList(iii);
455 if multiTimes; subplot(2,2,iii); end;
456 trsp=squeeze(alldiag.fldTRANSPORTS(ii,:,:));
457 txt=[mygrid.LINES_MASKS(ii).name ' (>0 westward)'];
458 ylim=rrList(iii,:);
459 if doAnomalies; ylim=scaleAnom*[-1 1]*5; end;
460 disp_transport(trsp,TT,txt,{'ylim',ylim},{'nmean',myNmean});
461 end;
462 myCaption={'ACC volume transports (Sv, annual mean)'};
463 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); end;
464
465 %Indonesian Throughflow special case:
466 if multiTimes; figureL; end;
467 %trsp=-squeeze(nansum(alldiag.fldTRANSPORTS([15:17],:,:),1));
468 trsp=-squeeze(nansum(alldiag.fldTRANSPORTS([14:17],:,:),1));%needed to fix sign for the (small) No.14 transport
469 txt='Indonesian Throughflow (>0 toward Indian Ocean)';
470 ylim=[5 25];
471 if doAnomalies; ylim=scaleAnom*[-1 1]*0.5; end;
472 disp_transport(trsp,TT,txt,{'ylim',ylim},{'nmean',myNmean});
473 myCaption={'Indonesian Throughflow (Sv, annual mean)'};
474 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); end;
475
476 end;
477
478
479 end;

  ViewVC Help
Powered by ViewVC 1.1.22