cd /Users/shaymaalali/Desktop/Physical_Oceanography/cchdo_320620170820
direc=dir('*.nc');
zonal1=[];
for i=1:length(direc)
zonal1.lat=ncread(direc(i).name,'latitude');
zonal1.lon=ncread(direc(i).name,'longitude');
zonal1.time=ncread(direc(i).name,'time');
zonal1.pressure=ncread(direc(i).name,'pressure');
zonal1.temp=ncread(direc(i).name,'temperature');
zonal1.salinity=ncread(direc(i).name,'salinity');
end
zonal1.density=[];
for j=1:length(zonal1)
[zonal1.density,alpha, beta]=gsw_rho_alpha_beta_CT_exact(zonal1.salinity,zonal1.temp,zonal1.pressure);
end
zonal1.depth=[];
for i=1:length(zonal1)
zonal1.depth=Depth(zonal1.pressure,zonal1.lat);
end
cd /Users/shaymaalali/Desktop/Physical_Oceanography/cchdo_74EQ20151206
unzip('1_a05_74EQ20151206_nc_ctd.zip');
unzip('0_a05_74EQ20151206_ct1.zip');
direc=dir('*.nc');
zonal2=[];
for i=1:length(direc)
zonal2.lat=ncread(direc(i).name,'latitude');
zonal2.lon=ncread(direc(i).name,'longitude');
zonal2.time=ncread(direc(i).name,'time');
zonal2.pressure=ncread(direc(i).name,'pressure');
zonal2.temp=ncread(direc(i).name,'temperature');
zonal2.salinity=ncread(direc(i).name,'salinity');
end
zonal2.density=[];
for j=1:length(zonal2)
[zonal2.density,alpha, beta]=gsw_rho_alpha_beta_CT_exact(zonal2.salinity,zonal2.temp,zonal2.pressure);
end
zonal2.depth=[];
for i=1:length(zonal2)
zonal2.depth=Depth(zonal2.pressure,zonal2.lat);
end
[X,Y,Z]=meshgrid(zonal2.lon,zonal2.lat,zonal2.depth);
[pdistance,az]=distance(zonal1.lat,zonal1.lon,zonal2.lat,zonal2.lon);
for i=1:length(zonal1.pressure)
for j=1:length(zonal2.pressure)
pdiff=[pdiff,zonal1.pressure(1)-zonal2.pressure(j)]';
end
end