diff options
-rw-r--r-- | dive.c | 2 | ||||
-rw-r--r-- | dive.h | 2 |
2 files changed, 4 insertions, 0 deletions
@@ -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++; } @@ -409,6 +409,8 @@ static inline int calculate_depth_to_mbar(int depth, pressure_t surface_pressure mbar = SURFACE_PRESSURE; if (!salinity) salinity = SEAWATER_SALINITY; + if (salinity < 500) + salinity += FRESHWATER_SALINITY; specific_weight = salinity / 10000.0 * 0.981; mbar += rint(depth / 10.0 * specific_weight); return mbar; |