# Density of water as a function of the Temperature alone. # rho = 1000(1 - (T+288.9414)/(508929.2*(T+68.12963))*(T-3.9863)^2) # Water density as a function of temperature and salinity # rhos = density in kg/m^3 as a function of temperature and salinity # S = salinity in g/kg # rhos = rho + AS + BS^(3/2) + CS^2 # A = 8.24493E-1 - 4.0899E-3*T + 7.6438E-5*T^2 -8.2467E-7*T^3 + 5.3675E-9*T^4 # B = -5.724E-3 + 1.0227E-4*T - 1.6546E-6*T^2 # C = 4.8314E-4 Dwater<- function(T){rho<-1000*(1-(T+288.9414)/(508929.2*(T+68.12963))*(T-3.9863)^2) rho }