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