Deco calculation oddities..

Robert C. Helling helling at lmu.de
Fri Feb 8 02:08:50 PST 2013


On Fri, 8 Feb 2013, Linus Torvalds wrote:

Linus,

> Robert (and others interested in the deco calculations), please
> double-check me on this..
>
> Since I did the no-fly code, and was looking at the effect of
> GFlow/GFhigh, I noted some *serious* oddities in the deco code that
> makes me go hmm..
>

Hmm.

> In particular, the tissue_tolerated_ambient_pressure[] array seems
> entirely pointless. It is a write-only array, and there is no reason
> for it existing as far as I can tell. T\Yes, there is technically a
> single reader, but that reader is *immediately* after the write to the
> array, so the read of the array could just trivially be bypassed and
> the value just taken from the calculation directly.
>
> Similarly, the code saves/restores it in the deco_cache_state() and
> deco_restore_state() functions as if it had some long-term meaning,
> but it definitely does *not* have any such long-term use at all. So
> somebody has been just confused.
>
> I wonder if it was written that way for debugging purposes (ie you
> want to see the arrays just while debugging the algorithm, even if the
> algorithm itself doesn't use the data long-term), but as it is, it is
> actively confusing.

You are absolutely right, we only need the maximum of that array. And your 
patch does exactly that. My only excuse is "I did not write that", the 
array was already there in the old version of the deco code and I only 
modified how its elements are calculated.

> In particular, it turns out that GF_low/high have absolutely *zero*
> impact on the actual long-term deco calculations - they only matter
> for the "convert deco state to a pressure tolerance and thus a depth",
> but not for the state itself.

I am not sure I understand what you mean by this. The tissue loadings (as 
exemplified in the calculation of tissue_inertgas_saturation, 
tissue_n2_sat[] and tissue_he_sat[] are not influenced by gradient 
factors. I would call that "tissue state" and not neccessarily "deco 
state". They only come into play once you want to convert the loading 
state of the tissues to a ceiling (tissue_tolerated_ambient_pressure or 
tolerated in your patch).


> So as far as I can tell, the array should be removed, and replaced
> with just a single variable in the loop that calculates the per-tissue
> thing. Something like the attached patch.

So be it.

> Comments? Am I missing something? Where does that array come from, and
> why was it done that way?

Historical ballast.

Sorry about that
Robert

-- 
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
Robert C. Helling     Elite Master Course Theoretical and Mathematical Physics
                       Scientific Coordinator
 		      Ludwig Maximilians Universitaet Muenchen, Dept. Physik
print "Just another   Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339
     stupid .sig\n";   http://www.atdotde.de


More information about the subsurface mailing list