diff options
author | Robert C. Helling <helling@atdotde.de> | 2020-09-02 11:10:51 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-09-02 09:43:38 -0700 |
commit | 7e82205e9b7b14e960dc1e83fcf6ef927e746fba (patch) | |
tree | b1d4f93f34a966e2aa619ed0de23d5bd3c0caaac /core | |
parent | f5ba42e933ae4701f40ba8b8b8058e5dd8c82cc0 (diff) | |
download | subsurface-7e82205e9b7b14e960dc1e83fcf6ef927e746fba.tar.gz |
Planner: Properly initialize salinity
When the dive has no explicity salinity, our conversion
between pressure and depth assumed salt water. Make this
explicity by using the corresponding macro.
When the planner starts and no salinity is set explicity,
set the water type chooser to salt water to reflect
our default assumption.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'core')
-rw-r--r-- | core/dive.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/dive.c b/core/dive.c index d2a4ea23c..6bed5966a 100644 --- a/core/dive.c +++ b/core/dive.c @@ -3729,7 +3729,7 @@ double depth_to_atm(int depth, const struct dive *dive) int rel_mbar_to_depth(int mbar, const struct dive *dive) { int cm; - double specific_weight = 1.03 * 0.981; + double specific_weight = SEAWATER_SALINITY * 0.981 / 10000.0; if (dive->dc.salinity) specific_weight = dive->dc.salinity / 10000.0 * 0.981; /* whole mbar gives us cm precision */ |