-
Notifications
You must be signed in to change notification settings - Fork 1
/
Heat_Streamfunctions.m
50 lines (44 loc) · 1.16 KB
/
Heat_Streamfunctions.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
fname = '~/data/ocean_wmass.ncra.nc';
yt = ncread(fname,'grid_yt_ocean');
T = ncread(fname,'neutral');
Te = ncread(fname,'neutralrho_edges');
rho0 = 1035;
% load and zonal sum:
tmp = squeeze(nansum(ncread(fname,'ty_trans_nrho')/rho0,1));
[yL,TL] = size(tmp);
tmp(isnan(tmp)) = 0;
psi = squeeze(cat(2,zeros(yL,1),cumsum(tmp,2)));
tmp = squeeze(nansum(ncread(fname,'ty_trans_nrho_gm')/rho0,1));
tmp(isnan(tmp)) = 0;
psi_gm = tmp;
tmp = squeeze(nansum(ncread(fname,'ty_trans_nrho_submeso')/rho0,1));
tmp(isnan(tmp)) = 0;
psi_submeso = tmp;
[Xe,Ye] = ndgrid(yt,Te);
[X,Y] = ndgrid(yt,T);
figure;
subplot(2,2,1);
pcolPlot(Xe,Ye,psi/1e6);
caxis([-20 20]);
xlabel('Latitude ($^\circ$E)');
ylabel('Temperature ($^\circ$C)');
cb = colorbar;
ylabel(cb,'Sv');
title('Resolved overturning');
subplot(2,2,2);
pcolPlot(X,Y,psi_gm/1e6);
caxis([-0.2 0.2]);
xlabel('Latitude ($^\circ$E)');
ylabel('Temperature ($^\circ$C)');
cb = colorbar;
ylabel(cb,'Sv');
title('GM overturning');
subplot(2,2,3);
pcolPlot(X,Y,psi_submeso/1e6);
caxis([-0.05 0.05]);
xlabel('Latitude ($^\circ$E)');
ylabel('Temperature ($^\circ$C)');
cb = colorbar;
ylabel(cb,'Sv');
title('Submeso overturning');
colormap(redblue);