1 |
% m-file: mit_plotstreamfunctions.m |
2 |
|
3 |
% select timestep |
4 |
k=kmax; |
5 |
|
6 |
if iscell(u) |
7 |
uk = u{k}; |
8 |
else |
9 |
uk = squeeze(u(:,:,:,k)); |
10 |
end |
11 |
if iscell(v) |
12 |
vk = v{k}; |
13 |
else |
14 |
vk = squeeze(v(:,:,:,k)); |
15 |
end |
16 |
|
17 |
|
18 |
addlayer = 1; |
19 |
|
20 |
clear global_psi atlantic_psi baro_psi |
21 |
% global overturning |
22 |
global_psi = mit_overturning(vk,grd.hfacs,grd.dxg,grd.dz,addlayer); |
23 |
|
24 |
% atlantic overturning |
25 |
atlantic_psi = mit_overturning(vk,grd.atlantic_hfacs,grd.dxg,grd.dz,addlayer); |
26 |
% pacific overturning |
27 |
pacific_psi = mit_overturning(vk,grd.pacific_hfacs,grd.dxg,grd.dz,addlayer); |
28 |
|
29 |
clear addlayer |
30 |
|
31 |
% global barotropic stream function |
32 |
baro_psi = mit_barostream(uk,grd.umask,grd.dyg,grd.dz); |
33 |
|
34 |
% plot stream functions |
35 |
figure('PaperPosition',[0.31 0.25 10.5 7.88],'PaperOrientation','landscape') |
36 |
clear sh |
37 |
sh(1) = subplot(2,2,1); |
38 |
otlev = [-60:2:60]; |
39 |
contourf(grd.latg,-grd.zgpsi,global_psi'*1e-6,otlev); |
40 |
hold on; |
41 |
[cs h1] = contour(grd.latg,-grd.zgpsi,global_psi'*1e-6,[0 0]); |
42 |
clh1 = clabel(cs); |
43 |
hold off |
44 |
caxis([-1 1]*max(abs(global_psi(:)))*1.e-6); colorbar('h') |
45 |
psimin = min(min(global_psi(:,5:end))); |
46 |
[iy iz] = find(abs(global_psi(:,:)-psimin)<=1e-4); |
47 |
text(grd.latg(iy),-grd.zgpsi(iz), ... |
48 |
['\leftarrow ' num2str(psimin*1e-6,'%5.1f')], ... |
49 |
'horizontalalignment','left') |
50 |
title('global overturning streamfunction [Sv]') |
51 |
sh(2) = subplot(2,2,2); |
52 |
contourf(grd.latg,-grd.zgpsi,atlantic_psi'*1e-6,otlev); |
53 |
hold on; |
54 |
[cs h2] = contour(grd.latg,-grd.zgpsi,atlantic_psi'*1e-6,[0 0]); |
55 |
clh2 = clabel(cs); |
56 |
hold off |
57 |
caxis([-1 1]*max(abs(atlantic_psi(:)))*1.e-6); colorbar('h'); |
58 |
psimax = max(atlantic_psi(13,5:end)); |
59 |
iz = find(abs(atlantic_psi(13,:)-psimax)<=1e-4); |
60 |
text(grd.latg(13),-grd.zgpsi(iz), ... |
61 |
[num2str(psimax*1e-6,'%5.1f') ' \rightarrow'], ... |
62 |
'horizontalalignment','right') |
63 |
psimin = min(min(atlantic_psi(1:35,5:end))); |
64 |
[iymin,izmin] = find(abs(atlantic_psi(:,:)-psimin)<=1e-4); |
65 |
text(grd.latg(iymin),-grd.zgpsi(izmin), ... |
66 |
[num2str(psimin*1e-6,'%5.1f') ' \rightarrow'], ... |
67 |
'horizontalalignment','right') |
68 |
title('atlantic overturning streamfunction [Sv]') |
69 |
% |
70 |
sh(3) = subplot(2,2,3); |
71 |
contourf(grd.latg,-grd.zgpsi,pacific_psi'*1e-6,otlev); |
72 |
hold on; |
73 |
[cs h3] = contour(grd.latg,-grd.zgpsi,pacific_psi'*1e-6,[0 0]); |
74 |
clh3 = clabel(cs); |
75 |
hold off |
76 |
caxis([-1 1]*max(abs(pacific_psi(:)))*1.e-6); colorbar('h'); |
77 |
title('pacific overturning streamfunction [Sv]') |
78 |
if ~isempty([h1;h2;h3]) |
79 |
set([h1;h2;h3],'LineWidth',2,'EdgeColor','k'); |
80 |
end |
81 |
clh = [clh1;clh2;clh3]; |
82 |
if ~isempty(clh) |
83 |
set(clh(2:2:end),'FontSize',8); |
84 |
end |
85 |
% $$$ [cs h] = contourf(grd.long,grd.latg,baro_psi'*1e-6,20); |
86 |
% $$$ if ~isempty(h); |
87 |
% $$$ set(h,'edgecolor','none'); |
88 |
% $$$ end; |
89 |
% $$$ axis image; |
90 |
% $$$ caxis([-1 1]*max(abs(baro_psi(:)))*1.e-6); colorbar('h'); |
91 |
% $$$ title('global barotropic stream function [Sv]') |
92 |
bstlev = [-200:20:200]; |
93 |
|
94 |
sh(4) = subplot(2,2,4); |
95 |
imagesc(grd.long,grd.latg,baro_psi'*1e-6); |
96 |
hold on; |
97 |
[cs h ]=contour(grd.long,grd.latg,baro_psi'*1e-6,bstlev); |
98 |
set(h,'edgecolor','k') |
99 |
if ~isempty(h); |
100 |
clh = clabel(cs,h); |
101 |
set(clh,'Fontsize',8); |
102 |
end |
103 |
hold off |
104 |
axis image, axis xy; |
105 |
caxis([-1 1]*max(abs(baro_psi(:)))*1.e-6); colorbar('h'); |
106 |
title('global barotropic stream function [Sv]') |
107 |
suptitle(['experiment ' dname ', timestep = ' num2str(timesteps(k)) ... |
108 |
', ' tuname ' = ' num2str(tim(k))]) |
109 |
set(sh,'layer','top') |
110 |
|
111 |
clear addlayer |