roms_tools.setup.utils.compute_in_situ_density#
- roms_tools.setup.utils.compute_in_situ_density(temp: DataArray, salt: DataArray, depth: DataArray, lat: DataArray) DataArray#
Compute in-situ seawater density (kg/m³) via TEOS-10 (gsw).
Pressure is derived from depth via
gsw.p_from_zand density is then computed withgsw.rho, both wrapped inapply_ufuncfor dask compatibility. Likecompute_potential_density(), this treats practical salinity as Absolute Salinity and in-situ temperature as Conservative Temperature – an approximation carried over from that function for consistency, sufficient for the µmol/kg -> mmol/m³ unit conversions that call this.- Parameters:
temp (xr.DataArray) – In-situ temperature (°C).
salt (xr.DataArray) – Practical salinity (PSU).
depth (xr.DataArray) – Depth (m), positive down.
lat (xr.DataArray) – Latitude (degrees north).
- Returns:
xr.DataArray – In-situ density (kg/m³).