summaryrefslogtreecommitdiffstats
path: root/deco.c
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2015-08-27 14:27:45 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-27 07:03:53 -0700
commitc5f92c750157be9aa11a2a3bc3619269e11d7c70 (patch)
tree8588b8e8222bfa3fee214182fb47bc3bc811e94f /deco.c
parentfe00abc77472f7142cd5acfe1f0dff9de99de015 (diff)
downloadsubsurface-c5f92c750157be9aa11a2a3bc3619269e11d7c70.tar.gz
Rename variable to better reflect what it does
The pressure for the Boyle compensation is of the first ceiling, i.e. the ceiling seen from the bottom rather than the first stop. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'deco.c')
-rw-r--r--deco.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/deco.c b/deco.c
index 20d8b0479..7a9f33e5a 100644
--- a/deco.c
+++ b/deco.c
@@ -23,7 +23,7 @@
extern bool in_planner();
-extern pressure_t first_stop_pressure;
+extern pressure_t first_ceiling_pressure;
//! Option structure for Buehlmann decompression.
struct buehlmann_config {
@@ -367,7 +367,7 @@ double solve_cubic2(double B, double C)
double update_gradient(double next_stop_pressure, double first_gradient)
{
- double B = cube(first_gradient) / (first_stop_pressure.mbar / 1000.0 + first_gradient);
+ double B = cube(first_gradient) / (first_ceiling_pressure.mbar / 1000.0 + first_gradient);
double C = next_stop_pressure * B;
double new_gradient = solve_cubic2(B, C);
@@ -385,10 +385,10 @@ void boyles_law(double next_stop_pressure)
return;
// This should be a tautology but prevents a numerical instability.
- if (IS_FP_SAME(next_stop_pressure, first_stop_pressure.mbar / 1000.0))
+ if (IS_FP_SAME(next_stop_pressure, first_ceiling_pressure.mbar / 1000.0))
return;
- if (!first_stop_pressure.mbar)
+ if (!first_ceiling_pressure.mbar)
return;
for (ci = 0; ci < 16; ++ci) {
allowable_n2_gradient[ci] = update_gradient(next_stop_pressure, bottom_n2_gradient[ci]);