% plot a contour of ratio of sound speed to density as a function of
% temperature and salinity for JJ O'Brien

[t s]=meshgrid(0:.5:20,20:.5:35);
p=ones(size(t))*500;                    % at 500 dbars (~500 m depth)
[svan,sigma]=swstate(s,t,p);
ss=soundspeed(s,t,p,'del grosso');
c=contour(t,s,ss./sigma,'w');
xlabel('temperature in degrees C'),
ylabel('salinity in ppt'),
title('ratio of soundspeed (m/s) to seawater density (kg/m^3) at 500 dbars')
clabel2(c,'manual')

t=1:20;
p=ones(size(t))*500;                    % at 500 dbars (~500 m depth)
for s=[28 30 32 34];
  [svan,sigma]=swstate(s,t,p);
  ss=soundspeed(s,t,p,'del grosso');
  plot(sigma,ss),hold on,
  gtext([num2str(s) ' ppt']),
end
xlabel('seawater density (kg/m^3)'),
ylabel('soundspeed (m/s)'),
title('soundspeed vs density (500 dbars, 1-20 deg C, 28-34 ppt)')
hold off
