MAST-467/667: Introduction to Arctic Oceanography (2021)

NASA's OMG

Date: 12/01/2021; updated 12/06/2021
Author: Frederike Benz

HW 11 - Spatial Average of Tmax below Mixed Layer

close all
clear all
% The next step will be to use our bin
% average profile data of potential temperature, absolute salinity, and potential
% density to estimate the potential temperature maximum of the Atlantic waters below
% 100-m depth.
% 1_Create a file with latitude, longitude, year, Tmax, D(Tmax), S(Tmax), and year where
% D(Tmax) and S(Tmax) for each year.
load disko_proc_2017.mat
load disko_proc_2018.mat
load disko_proc_2019.mat
load disko_proc_2020.mat
load disko_proc_2021.mat
profile =17;
%% 2017
% skip empty profile 30;
binDepth_2017 = [binDepth_2017(:,1:29) binDepth_2017(:,31:35)];
binPT_2017 = [binPT_2017(:,1:29) binPT_2017(:,31:35)];
binR0_2017 = [binR0_2017(:,1:29) binR0_2017(:,31:35)];
binSA_2017 = [binSA_2017(:,1:29) binSA_2017(:,31:35)];
lon_2017 = [lon_2017(:,1:29) lon_2017(:,31:35)];
lat_2017 = [lat_2017(:,1:29) lat_2017(:,31:35)];
% Tmax below 100 m water depth
for ii = 1:34
indDepth_100m_2017(ii) = find(binDepth_2017(:,ii) >= 100,1,'first'); % index 100 m depth
Tmax_100m_2017(ii) = max(binPT_2017(indDepth_100m_2017:end,ii)); % maximum potential temperature below 100 m
indTmax_100m_2017(ii) = find(binPT_2017(:,ii) == Tmax_100m_2017(ii)); % index Tmax at 100 m depth
Density_tmax_100m_2017(ii) = binR0_2017(indTmax_100m_2017(ii),ii); % potential density at Tmax
S_tmax_100m_2017(ii) = binSA_2017(indTmax_100m_2017(ii),ii); % absolute salinity at Tmax
Depth_Tmax_100m_2017(ii) = binDepth_2017(indTmax_100m_2017(ii),ii);
end
lat_2017 = lat_2017(1,:);
lon_2017 = lon_2017(1,:);
year_2017 = 2017.*ones(1,34);
clf
subplot(1,3,1)
plot(binPT_2017(:,profile),binDepth_2017(:,profile),'linewidth',2)
hold on
plot(Tmax_100m_2017(:,profile),Depth_Tmax_100m_2017(:,profile),'-s','MarkerSize',10,...
'MarkerEdgeColor','red',...
'MarkerFaceColor',[1 .6 .6])
xlabel('Potential Temperature [deg. C]')
set(gca,'ydir','reverse','linewidth',2,'fontsize',10)
subplot(1,3,2)
plot(binSA_2017(:,profile),binDepth_2017(:,profile),'linewidth',2)
hold on
plot(S_tmax_100m_2017(:,profile),Depth_Tmax_100m_2017(:,profile),'-s','MarkerSize',10,...
'MarkerEdgeColor','red',...
'MarkerFaceColor',[1 .6 .6])
xlabel('Absolute Salinity [ppt]')
set(gca,'ydir','reverse','linewidth',2,'fontsize',10)
subplot(1,3,3)
plot(binR0_2017(:,profile),binDepth_2017(:,profile),'linewidth',2)
hold on
plot(Density_tmax_100m_2017(:,profile),Depth_Tmax_100m_2017(:,profile),'-s','MarkerSize',10,...
'MarkerEdgeColor','red',...
'MarkerFaceColor',[1 .6 .6])
xlabel('Potential Density [kg/m^3]')
set(gca,'ydir','reverse','linewidth',2,'fontsize',10)
%% 2018
% Tmax below 100 m water depth
for ii = 1:18
indDepth_100m_2018(ii) = find(binDepth_2018(:,ii) >= 100,1,'first'); % index 100 m depth
Tmax_100m_2018(ii) = max(binPT_2018(indDepth_100m_2018:end,ii)); % maximum potential temperature below 100 m
indTmax_100m_2018(ii) = find(binPT_2018(:,ii) == Tmax_100m_2018(ii)); % index Tmax at 100 m depth
Density_tmax_100m_2018(ii) = binR0_2018(indTmax_100m_2018(ii),ii); % potential density at Tmax
S_tmax_100m_2018(ii) = binSA_2018(indTmax_100m_2018(ii),ii); % absolute salinity at Tmax
Depth_Tmax_100m_2018(ii) = binDepth_2018(indTmax_100m_2018(ii),ii);
end
lat_2018 = lat_2018(1,:);
lon_2018 = lon_2018(1,:);
year_2018 = 2018.*ones(1,18);
clf
subplot(1,3,1)
plot(binPT_2018(:,profile),binDepth_2018(:,profile),'linewidth',2)
hold on
plot(Tmax_100m_2018(:,profile),Depth_Tmax_100m_2018(:,profile),'-s','MarkerSize',10,...
'MarkerEdgeColor','red',...
'MarkerFaceColor',[1 .6 .6])
xlabel('Potential Temperature [deg. C]')
set(gca,'ydir','reverse','linewidth',2,'fontsize',10)
subplot(1,3,2)
plot(binSA_2018(:,profile),binDepth_2018(:,profile),'linewidth',2)
hold on
plot(S_tmax_100m_2018(:,profile),Depth_Tmax_100m_2018(:,profile),'-s','MarkerSize',10,...
'MarkerEdgeColor','red',...
'MarkerFaceColor',[1 .6 .6])
xlabel('Absolute Salinity [ppt]')
set(gca,'ydir','reverse','linewidth',2,'fontsize',10)
subplot(1,3,3)
plot(binR0_2018(:,profile),binDepth_2018(:,profile),'linewidth',2)
hold on
plot(Density_tmax_100m_2018(:,profile),Depth_Tmax_100m_2018(:,profile),'-s','MarkerSize',10,...
'MarkerEdgeColor','red',...
'MarkerFaceColor',[1 .6 .6])
xlabel('Potential Density [kg/m^3]')
set(gca,'ydir','reverse','linewidth',2,'fontsize',10)
%% 2019
% profile 25 does not have any data below 100m -> skip profile
binDepth_2019 = [binDepth_2019(:,1:24) binDepth_2019(:,26:end)];
binPT_2019 = [binPT_2019(:,1:24) binPT_2019(:,26:end)];
binR0_2019 = [binR0_2019(:,1:24) binR0_2019(:,26:end)];
binSA_2019 = [binSA_2019(:,1:24) binSA_2019(:,26:end)];
lon_2019 = [lon_2019(:,1:24) lon_2019(:,26:end)];
lat_2019 = [lat_2019(:,1:24) lat_2019(:,26:end)];
% Tmax below 100 m water depth
for ii = 1:36
indDepth_100m_2019(ii) = find(binDepth_2019(:,ii) >= 100,1,'first'); % index 100 m depth
Tmax_100m_2019(ii) = max(binPT_2019(indDepth_100m_2019:end,ii)); % maximum potential temperature below 100 m
indTmax_100m_2019(ii) = find(binPT_2019(:,ii) == Tmax_100m_2019(ii)); % index Tmax at 100 m depth
Density_tmax_100m_2019(ii) = binR0_2019(indTmax_100m_2019(ii),ii); % potential density at Tmax
S_tmax_100m_2019(ii) = binSA_2019(indTmax_100m_2019(ii),ii); % absolute salinity at Tmax
Depth_Tmax_100m_2019(ii) = binDepth_2019(indTmax_100m_2019(ii),ii);
end
lat_2019 = lat_2019(1,:);
lon_2019 = lon_2019(1,:);
year_2019 = 2019.*ones(1,36);
clf
subplot(1,3,1)
plot(binPT_2019(:,profile),binDepth_2019(:,profile),'linewidth',2)
hold on
plot(Tmax_100m_2019(:,profile),Depth_Tmax_100m_2019(:,profile),'-s','MarkerSize',10,...
'MarkerEdgeColor','red',...
'MarkerFaceColor',[1 .6 .6])
xlabel('Potential Temperature [deg. C]')
set(gca,'ydir','reverse','linewidth',2,'fontsize',10)
subplot(1,3,2)
plot(binSA_2019(:,profile),binDepth_2019(:,profile),'linewidth',2)
hold on
plot(S_tmax_100m_2019(:,profile),Depth_Tmax_100m_2019(:,profile),'-s','MarkerSize',10,...
'MarkerEdgeColor','red',...
'MarkerFaceColor',[1 .6 .6])
xlabel('Absolute Salinity [ppt]')
set(gca,'ydir','reverse','linewidth',2,'fontsize',10)
subplot(1,3,3)
plot(binR0_2019(:,profile),binDepth_2019(:,profile),'linewidth',2)
hold on
plot(Density_tmax_100m_2019(:,profile),Depth_Tmax_100m_2019(:,profile),'-s','MarkerSize',10,...
'MarkerEdgeColor','red',...
'MarkerFaceColor',[1 .6 .6])
xlabel('Potential Density [kg/m^3]')
set(gca,'ydir','reverse','linewidth',2,'fontsize',10)
%% 2020
% Tmax below 100 m water depth
for ii = 1:39
indDepth_100m_2020(ii) = find(binDepth_2020(:,ii) >= 100,1,'first'); % index 100 m depth
Tmax_100m_2020(ii) = max(binPT_2020(indDepth_100m_2020:end,ii)); % maximum potential temperature below 100 m
indTmax_100m_2020(ii) = find(binPT_2020(:,ii) == Tmax_100m_2020(ii)); % index Tmax at 100 m depth
Density_tmax_100m_2020(ii) = binR0_2020(indTmax_100m_2020(ii),ii); % potential density at Tmax
S_tmax_100m_2020(ii) = binSA_2020(indTmax_100m_2020(ii),ii); % absolute salinity at Tmax
Depth_Tmax_100m_2020(ii) = binDepth_2020(indTmax_100m_2020(ii),ii);
end
lat_2020 = lat_2020(1,:);
lon_2020 = lon_2020(1,:);
year_2020 = 2020.*ones(1,39);
clf
subplot(1,3,1)
plot(binPT_2020(:,profile),binDepth_2020(:,profile),'linewidth',2)
hold on
plot(Tmax_100m_2020(:,profile),Depth_Tmax_100m_2020(:,profile),'-s','MarkerSize',10,...
'MarkerEdgeColor','red',...
'MarkerFaceColor',[1 .6 .6])
xlabel('Potential Temperature [deg. C]')
set(gca,'ydir','reverse','linewidth',2,'fontsize',10)
subplot(1,3,2)
plot(binSA_2020(:,profile),binDepth_2020(:,profile),'linewidth',2)
hold on
plot(S_tmax_100m_2020(:,profile),Depth_Tmax_100m_2020(:,profile),'-s','MarkerSize',10,...
'MarkerEdgeColor','red',...
'MarkerFaceColor',[1 .6 .6])
xlabel('Absolute Salinity [ppt]')
set(gca,'ydir','reverse','linewidth',2,'fontsize',10)
subplot(1,3,3)
plot(binR0_2020(:,profile),binDepth_2020(:,profile),'linewidth',2)
hold on
plot(Density_tmax_100m_2020(:,profile),Depth_Tmax_100m_2020(:,profile),'-s','MarkerSize',10,...
'MarkerEdgeColor','red',...
'MarkerFaceColor',[1 .6 .6])
xlabel('Potential Density [kg/m^3]')
set(gca,'ydir','reverse','linewidth',2,'fontsize',10)
%% 2021
% Tmax below 100 m water depth
for ii = 1:30
indDepth_100m_2021(ii) = find(binDepth_2021(:,ii) >= 100,1,'first'); % index 100 m depth
Tmax_100m_2021(ii) = max(binPT_2021(indDepth_100m_2021:end,ii)); % maximum potential temperature below 100 m
indTmax_100m_2021(ii) = find(binPT_2021(:,ii) == Tmax_100m_2021(ii)); % index Tmax at 100 m depth
Density_tmax_100m_2021(ii) = binR0_2021(indTmax_100m_2021(ii),ii); % potential density at Tmax
S_tmax_100m_2021(ii) = binSA_2021(indTmax_100m_2021(ii),ii); % absolute salinity at Tmax
Depth_Tmax_100m_2021(ii) = binDepth_2021(indTmax_100m_2021(ii),ii);
end
lat_2021 = lat_2021(1,:);
lon_2021 = lon_2021(1,:);
year_2021 = 2021.*ones(1,30);
clf
subplot(1,3,1)
plot(binPT_2021(:,profile),binDepth_2021(:,profile),'linewidth',2)
hold on
plot(Tmax_100m_2021(:,profile),Depth_Tmax_100m_2021(:,profile),'-s','MarkerSize',10,...
'MarkerEdgeColor','red',...
'MarkerFaceColor',[1 .6 .6])
xlabel('Potential Temperature [deg. C]')
set(gca,'ydir','reverse','linewidth',2,'fontsize',10)
subplot(1,3,2)
plot(binSA_2021(:,profile),binDepth_2021(:,profile),'linewidth',2)
hold on
plot(S_tmax_100m_2021(:,profile),Depth_Tmax_100m_2021(:,profile),'-s','MarkerSize',10,...
'MarkerEdgeColor','red',...
'MarkerFaceColor',[1 .6 .6])
xlabel('Absolute Salinity [ppt]')
set(gca,'ydir','reverse','linewidth',2,'fontsize',10)
subplot(1,3,3)
plot(binR0_2021(:,profile),binDepth_2021(:,profile),'linewidth',2)
hold on
plot(Density_tmax_100m_2021(:,profile),Depth_Tmax_100m_2021(:,profile),'-s','MarkerSize',10,...
'MarkerEdgeColor','red',...
'MarkerFaceColor',[1 .6 .6])
xlabel('Potential Density [kg/m^3]')
set(gca,'ydir','reverse','linewidth',2,'fontsize',10)
% % 1_Create a file with latitude, longitude, year, Tmax, D(Tmax), S(Tmax), and year where
% D(Tmax) and S(Tmax) for each year.
file_2017 = [lat_2017;lon_2017;year_2017;Tmax_100m_2017;Depth_Tmax_100m_2017;S_tmax_100m_2017;Density_tmax_100m_2017];
file_2017 = file_2017';
file_2018 = [lat_2018;lon_2018;year_2018;Tmax_100m_2018;Depth_Tmax_100m_2018;S_tmax_100m_2018;Density_tmax_100m_2018];
file_2018 = file_2018';
file_2019 = [lat_2019;lon_2019;year_2019;Tmax_100m_2019;Depth_Tmax_100m_2019;S_tmax_100m_2019;Density_tmax_100m_2019];
file_2019 = file_2019';
file_2020 = [lat_2020;lon_2020;year_2020;Tmax_100m_2020;Depth_Tmax_100m_2020;S_tmax_100m_2020;Density_tmax_100m_2020];
file_2020 = file_2020';
file_2021 = [lat_2021;lon_2021;year_2021;Tmax_100m_2021;Depth_Tmax_100m_2021;S_tmax_100m_2021;Density_tmax_100m_2021];
file_2021 = file_2021';
file_disko_bay = [file_2017;file_2018;file_2019;file_2020;file_2021]';
% % .txt file
fileID = fopen('file_disko_bay.txt','w');
fprintf(fileID,'%6s %6s %6s %6s %6s %6s %6s\n','latitude','longitude','year','Tmax','Depth(Tmax)','SA(Tmax)','R0(Tmax)');
fprintf(fileID,'%7f %7f %4d %7f %7f %7f %7f\n',file_disko_bay);
fclose(fileID);

HW 12 - Time Average of Spatial Average of Tmax below 100-m

% The next step will be to use our bin average profile data of potential temperature, absolute salinity, and potential density
% to estimate the potential temperature maximum of the Atlantic waters below 100-m depth as an annual average for all years 2016-21
% 1_Average the Tmax(x,y,t) for a specific year "t" that you estimated from each station at location (x,y) to get Tmax_avg(t)
t = file_disko_bay(3,:);
Tmax = file_disko_bay(4,:);
Tmax_100m_2017_mean = mean(Tmax_100m_2017)
Tmax_100m_2017_mean = 2.5702
Tmax_100m_2018_mean = mean(Tmax_100m_2018)
Tmax_100m_2018_mean = 2.1242
Tmax_100m_2019_mean = mean(Tmax_100m_2019)
Tmax_100m_2019_mean = 2.3570
Tmax_100m_2020_mean = mean(Tmax_100m_2020)
Tmax_100m_2020_mean = 2.6856
Tmax_100m_2021_mean = mean(Tmax_100m_2021)
Tmax_100m_2021_mean = 2.1543
t_mean = [2017 2018 2019 2020 2021];
Tmax_mean = [Tmax_100m_2017_mean Tmax_100m_2018_mean Tmax_100m_2019_mean Tmax_100m_2020_mean Tmax_100m_2021_mean];
clf
plot(t,Tmax,'.')
hold on
plot(t_mean,Tmax_mean,'-s','MarkerSize',10,...
'MarkerEdgeColor','red',...
'MarkerFaceColor',[1 .6 .6])
xlabel('time [years]')
ylabel('Temperature [deg C]')
xlim([2016 2022])
set(gca,'linewidth',2,'fontsize',20)
% 2016 is missing ....