From b1c923cd5995b4826b75e9aaef83dbcff70d49f2 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Fri, 26 Feb 2016 15:16:36 +0100 Subject: If salinity is not density, add density of fresh water There was a reported case of an import of a dive that gave a salinity of 35g/l. This is an actual salinity (an amount of salt in the water) but for subsurface the salinity is actually the density of the water. So for too small values of the salinity add the density of fresh water. Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- dive.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'dive.c') diff --git a/dive.c b/dive.c index bb35f4454..83ec161c6 100644 --- a/dive.c +++ b/dive.c @@ -1116,6 +1116,8 @@ static void fixup_water_salinity(struct dive *dive) for_each_dc (dive, dc) { if (dc->salinity) { + if (dc->salinity < 500) + dc->salinity += FRESHWATER_SALINITY; sum += dc->salinity; nr++; } -- cgit v1.2.3-70-g09d2