Tmax below Mixed Layer

Tianyu Zhou, 11/10/2021, at UDel

Quality control and binning

Load data located within Nares Strait (pre-selected and stored in a '.mat' file) and perform quality control procedures.
% run the binning code that is the same as what is used before
preproce_binning

The depth of the first stability maximum and Tmax below it

depth_Nmax = ones(profi_num,1);
Tmax = ones(profi_num,1);
depth_Tmax = ones(profi_num,1);
depth_max = ones(profi_num,1);
S_Tmax = ones(profi_num,1);
for cast = 1:profi_num
depth_max(cast) = max(output{cast,5}(:,2));
% calculate pressure, absolute salinity and potential temperature
lat = output{cast,4};
lon = -output{cast,3};
P = gsw_p_from_z(-depth(cast,:),lat); %pressure
SA = gsw_SA_from_SP(S(cast,:),P,lat,lon); %absolute salinity
pT = gsw_pt_from_t(SA,T(cast,:),P,0); %potential temperature
% calculate conservative temperature and the stability frequency
CT = gsw_CT_from_t(SA,T(cast,:),P); %conservative temperature
[N2, ~] = gsw_Nsquared(SA,CT,P,lat);
% the first stability maximum
diff_N2 = diff(N2);
index = find(diff_N2 >= 0);
n = 1;
while diff_N2(index(n)+1) >= 0
n = n+1;
end
depth_Nmax(cast) = depth(1,index(n)+1);
pT(1:index(n)+1) = -999;
pT(1:20) = -999; % rule out the upper 20 m
pT(end) = [];
[Tmax(cast),index_Tmax] = max(pT);
depth_Tmax(cast) = depth(1,index_Tmax);
S_Tmax(cast) = S(cast,index_Tmax);
end

Save results related to Tmax into a data file

year = cell2mat(output(:,1));
lon = -cell2mat(output(:,3));
lat = cell2mat(output(:,4));
outfile = [lat,lon,year,Tmax,depth_Tmax,S_Tmax];
save('WHW_10.dat','outfile','-ascii')

Plotting figures based on the results

% Temporal variation of Tmax, D(Tmax) and S(Tmax)
f = figure;
set(f,'units','centimeters','position',[1,1,13*1.5,9*1.5],'color','w')
FontSize = 15;
subplot(3,1,1)
plot(year,Tmax,'.','MarkerSize',12)
xlim([2015.5 2021.5])
ylim([-1 4.5])
ylabel('Tmax','FontWeight','bold')
set(gca,'FontSize',FontSize,'tickdir','out')
subplot(3,1,2)
plot(year,depth_Tmax,'.','MarkerSize',12)
hold on
depth_max = floor(depth_max);
plot(year(depth_Tmax==depth_max),depth_Tmax(depth_Tmax==depth_max),'.','MarkerSize',12,'Color','r')
xlim([2015.5 2021.5])
ylabel('D(Tmax)','FontWeight','bold')
set(gca,'FontSize',FontSize,'tickdir','out')
subplot(3,1,3)
plot(year,S_Tmax,'.','MarkerSize',12)
xlim([2015.5 2021.5])
ylim([28 36])
ylabel('S(Tmax)','FontWeight','bold')
xlabel('Years','FontWeight','bold')
set(gca,'FontSize',FontSize,'tickdir','out')
% T-S space
f = figure;
set(f,'units','centimeters','position',[1,1,15.5*1.5,10*1.5],'color','w')
FontSize = 20;
color = jet;
c_max = 800;
c_min = 200;
range = linspace(c_min,c_max,256);
for n = 1:profi_num
[~,pos] = min(abs(depth_Tmax(n)-range));
plot(S_Tmax(n),Tmax(n),'.','color',color(pos,:),'MarkerSize',17)
hold on
end
colormap("jet")
colorbar
caxis([c_min c_max])
cbarrow
xlabel('S(Tmax)','FontWeight','bold')
ylabel('Tmax (^{o}C)','FontWeight','bold')
title('D(Tmax) and Water Properties','FontWeight','bold')
set(gca,'FontSize',FontSize,'tickdir','out')
% Spatial distribution
lat_start = 77.5;
lat_end = 83.3;
lon_start = -85;
lon_end = -47;
f = figure;
set(f,'units','centimeters','position',[1,1,12*1.5,9*1.5],'color','w')
m_proj('mercator','lon',[lon_start lon_end],'lat',[lat_start lat_end]);
hold on
m_grid('box','on','linest','none','fontname','times','linewidth',0.1,'tickdir','out','backcolor',[1 1 1],'Fontsize',20);
m_gshhs_h('patch',[0.6 0.6 0.6]);
color = jet;
c_max = 1;
c_min = -0.5;
range = linspace(c_min,c_max,256);
for n = 1:profi_num
[~,pos] = min(abs(Tmax(n)-range));
m_plot(lon(n),lat(n),'.','color',color(pos,:),'markersize',20)
end
% Colorbar settings
colormap(color)
colorbar
caxis([c_min c_max])
cbarrow('up')
title('Spatial Distribution of Tmax')
set(gca,'fontsize',16,'color','w');