% TSCAST - 
%
%    B. A. Moran, 04-Feb-1998

%    Copyright (C) 1995-1998
%    Massachussetts Institute of Technology
%    Sea Grant AUV Laboratory
%    $Id: tscast.m,v 1.1 1998/07/01 13:31:47 bamoran Exp $	

function tscast( depth, temp, salt, svel )

if nargin > 3
    subplot( 1, 2, 1 )
end

h1 = gca;
plot( temp, depth );
clrs = get( h1, 'ColorOrder' );

xlabel( 'Temperature (^{o}C)', 'Color', clrs(1,:) )
ylabel( 'Depth (m)' );

h2 = axes( 'Position', get(h1, 'Position') );
plot( salt, depth, 'Color', clrs(2,:) );
set( h2, 'XAxisLocation', 'top', 'Color', 'none' );

xlabel( 'Salinity (psu)', 'Color', clrs(2,:) )

set( [h1 h2], 'YDir', 'reverse' );

if nargin > 3
    subplot( 1, 2, 2 )

    plot( svel, depth ); set( gca, 'YDir', 'rev' );
    xlabel( 'Sound Velocity (m/s)' )
end