%  plotSz.m - plot vertical profile of salinity versus depth.
%    needs variables set: DataDir CruiseName DepthResolution ctdcastlist 
%                         srange deprange InfoString
%    sets variables: none
%    calls: readctd

%        dummy start values
S=[10 11];
dep=[0 1];
figure;

plot(S,dep);
axis([srange deprange]);
title('Salinity vs depth');
xlabel('Salinity');
ylabel('Depth (m)');
text(srange(1) + .1*(srange(2)-srange(1)),.75*deprange(1),InfoString);
text(srange(1) + .1*(srange(2)-srange(1)),.81*deprange(1),CruiseName);
hold on;

for cast = ctdcastlist
  file= [DataDir '/' CruiseName '/Ctd/' DepthResolution '/ctd' castnum(cast) '.dat'];
   [nlines,ndepths,desc,p,t,s,pt,r0,r1,bv,t0,t1,s0,s1,o2,par,tr,fl] = readctd(file);
  dep=-p;
  plot(s,dep);
end

hold off;
