function [ro]=ro(S,T,r) % W J Schulz 22 Dec 2009 % Modified by B. Barrett and J. Beattie Jan 2010 % SO 513 Lab 1 % % Computes the density for sea water at one standard % atmospheric pressure, i.e. the ocean surface, per % Pond and Pickard's "Introductory Dynamical Oceanography", 2nd Ed. % % Variables: % r = array of coefficients for the density calculation % ro = 'rho zero' = density of sea water at surface % in kg/m^3 % input: % S= salinity in practical salinity units % T = Temperature in degrees Celsius % % %calculate the density at the surface % ro = r(1) ... +r(2).*T.^2 + r(3).*T.^4 ... +r(4).*S + r(5).*S.*T.^2 ... +r(6).*S.*T.^4 + r(7).*T.*S.^(3/2) ... +r(8).*S.^2 + r(9).*T ... +r(10).*T.^3 + r(11).*T.^5 ... +r(12).*T.*S ... +r(13).*S.*T.^3+r(14).*S.^(3/2) ... +r(15).*T.^2.*S.^(3/2); %end function