You are on page 1of 3

Reyhan Andika Pradana_ L1C018021

_Praktikum IV_PDPK

clear all; clc;


% Load Data %
data = load('data_from_1.txt');
lat = -8.96;
lon = 109.6;
dept0 = data(:,4);
temp0 = data(:,6);
sali0 = data(:,5);

% Interpolasi %
dept = [min(dept0):2:max(dept0)]';
sali = interp1(dept0,sali0,dept,'spline');
temp = interp1(dept0,temp0,dept,'spline');
datanew=[dept sali temp];

% Calculate Parameter %
pres=pressure(dept,lat);
dens=densatp(sali,temp,pres);
sig=dens*10000-10000; %Sigma Theta

% Vertical Profile %
figure('name','Temperatur, Salinitas, dan Densitas');

subplot(1,3,1);
plot(temp,dept,'r','LineWidth',1.5);
grid on;
xlabel('Temperatur [^oC]','FontWeight','bold','FontSize',12);
ylabel('Depth [m]','FontWeight','bold','FontSize',12);
set(gca,'Ydir','reverse','XMinorTick','on','YMinorTick','on','TickDir',...
'out', 'LineWidth',1.5,'FontWeight','bold');
title('(a)','FontWeight','bold','FontSize',12);

subplot(1,3,2);
plot(sali,dept,'b','LineWidth',1.5);
grid on;
xlabel('Salinitas [psu]','FontWeight','bold','fontsize',12);
ylabel('Depth [m]','FontWeight','bold','FontSize',12);
set(gca,'Ydir','reverse','XMinorTick','on','YMinorTick','on','TickDir',...
'out','LineWidth',1.5,'FontWeight','bold');
title('(b)','FontWeight','bold','FontSize',12);

subplot(1,3,3);
plot(sig,dept,'y','LineWidth',1.5);
grid on;
xlabel('\sigma_\theta [kg m^-^3]','FontWeight','bold','FontSize',12);
ylabel('Depth [m]','FontWeight','bold','FontSize',12);
set(gca,'Ydir','reverse','XMinorTick','on','YMinorTick','on','TickDir',...
'out','LineWidth',1.5,'FontWeight','bold');
title('(c)','FontWeight','bold','FontSize',12);

% Multiple Plots %
figure('position',[10 50 400 600]);
CTDXXX(dept,temp,sali,sig,'ctdxxx',10,{'Temperatur [deg C]',...
'Salinitas [psu]','Densitas [Kg/m^3]'});
% T-S Diagram %
figure('Name','T-S Diagram','position',[5 50 600 650]);
PTa=sw_ptmp(sali,temp,pres,0); %Potential Temperature
theta_sdiag(PTa,sali);

Figure 1

Figure 2
Figure 3

You might also like