<div dir="ltr">Robert,<br><div><div class="gmail_extra"><br><div class="gmail_quote">On 27 August 2015 at 22:26, Robert C. Helling <span dir="ltr"><<a href="mailto:helling@atdotde.de" target="_blank">helling@atdotde.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">let me add to this confusion: In my branch, I had computed the first stop depth for each round of the CVA, as done in this patch:<div><br></div></div></blockquote><div>I don't know this does add to confusion.  It suggests that doing the first_ceiling_pressure calculation inside the CVA loop does work, and my hypothesizing earlier as to why it wouldn't work (for me), was incorrect.  All along it could be that the problem was that not all the variables had been initialized properly.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div></div><div></div></div><br><div style="word-wrap:break-word"><div></div><div>This makes all but one test pass and even the fail I would say (looking at the spread sheet) actually passes but the comparison is for a wrong goal.</div><div><br></div></div></blockquote><div>I don't think the goal is wrong: the Fortran code (original reference implementation) and MultiDeco (probably the de-facto standard if such a thing exists) both calculate 95 minutes for the 60 m for 30 min dive with air and 50%.  I would take those runtimes over GUE DecoPlanner (97 minutes), which has some deliberate tweaks to the algorithm.  As it isn't open, we can't really see what it does differently.<br><br></div><div>None of that changes that this is a great improvement.  With the Subsurface calculating a runtime of 98 minutes (c.f 95 minutes, or a debatable 97 minutes), we can live with being slightly more conservative than others on one test.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div></div><div>With this, when I now remove that vpmb_start_gradient I get a totally off test (which is what I remembered adding this line in the first place, I think it was to set the bottom pressure, but right now I haven’t gotten to confirm this). So, I would argue for taking this patch here and keeping the call.</div></div></blockquote><div><br></div><div>Agreed, and verified that removing the vpmb_start_gradient call messes things up.  More precisely, it appears the call to vpmb_next_gradient doesn't do the right thing if initial_he_gradient and initial_n2_gradient haven't been defined.<br><br></div><div>I think your patch makes obsolete the earlier calculation of first_stop(/ceiling)_pressure immediately before the CVA loop commences.<br></div><div><br></div><div>For some reason, again I couldn't apply your patch with git so I had to test it manually.<br><br></div><div>Cheers,<br><br></div><div>Rick<br></div></div></div></div></div>