polaris.ocean.conservation.compute_total_salt

polaris.ocean.conservation.compute_total_salt(ds_mesh, ds)[source]

Compute the total mass of salt in an ocean model output file using a constant density

Salinity is assumed to be in g/kg (i.e. grams of salt per kilogram of seawater), so the volume integral of layerThickness * salinity is converted to a salt mass with rho_sw / 1000.

Parameters:
  • ds_mesh (xarray.Dataset) – The mesh dataset, containing areaCell

  • ds (xarray.Dataset) – The dataset containing salinity and a layer thickness

Returns:

total_salt (float) – The total mass of salt in kg over the whole domain