function R=eqnstate2(T,S) %EQNSTATE2 - Matlab implementation of QUODDY's Equation of State. %----------------------------------------------------------------------- % purpose: This subroutine computes the perturbation density (R; in % sigmat units) as a function of two variables; temperature % (T; 0 to 40 degrees C) and salinity (S; 0 to 42 psu). % % reference: UNESCO equation of state as published in Gill(1982) % Contributed by Douglas T. Morgan % % Vectorized version; BOB for FCAST work if min(T)<0 | max(T)>40. error('Temperature outside of allowable range: (042. error('Salinity outside of allowable range: (0