Equation of State
UNESCO EOS (Millero & Poisson 1981)
Pelagos.UNESCO.seawater_density! — Method
seawater_density!(rho, T, S, p)In-place, element-wise computation of density on arrays. Arrays must have the same shape (nlon, nlat, nz).
Pelagos.UNESCO.seawater_density — Method
seawater_density(T, S, p)UNESCO (Millero & Poisson 1981) in-situ seawater density.
Arguments
T: potential temperature (°C)S: salinity (psu / g kg⁻¹)p: pressure (bar; 1 bar ≈ 10 m depth)
Returns
- density ρ (kg m⁻³)
Pelagos.UNESCO.seawater_density_insitu — Method
seawater_density_insitu(T, S, z)Convenience wrapper: computes pressure from depth z (negative downward, m), then calls seawater_density. Uses hydrostatic approximation p ≈ ρ₀·g·|z|/1e5 bar.
Hydrostatic Pressure
Pelagos.Pressure.compute_pressure! — Method
compute_pressure!(p, T, S, grid)Integrate hydrostatic pressure downward into the water column.
p, T, S are Field{Center, Center, Center} on grid. Uses Oceananigans k-convention: k=Nz = surface layer, k=1 = deepest layer. Immersed (below-bathymetry) cells are set to p = pressure of the nearest active cell above them, so horizontal pressure gradients at the seafloor boundary remain small (avoids spurious velocities from the FG solve). Returns p with halos filled.