[CCR PATCH] Calculate appropriate po2 values

Robert C. Helling helling at atdotde.de
Sat Jun 21 03:43:36 PDT 2014


On 21 Jun 2014, at 00:54, Dirk Hohndel <dirk at hohndel.org> wrote:

Hi,

> Could someone else do a code review and provide feedback - maybe some of
> the long time contributors (Lubomir, Miika, Henrik)?

three quick comments:

1) What about the case of readings 1050, 1140, 1160? Then only one difference is big.

2) The logic of hard coding all the cases with explicit 1,2,3 is in my point of view not the most straight forward. Why don’t you start by sorting the three values (can be done in a single for loop: Find both the min and the max of the three and the middle one is the sum - min - max) and then have the clear cases min far away from mid or max far away from mid.

3) Strictly speaking the ppO2 not only appears in the profile. It is also needed in deco.c to determine the amount of inert gases. Why don’t you implement a general helper function that determines the breathing gas mix given what is in the cylinders and a parameter which is either OC (in which case the cylinder mix is returned), CCR (in which case the result of you calculation is returned) or PSCR (in which case the steady state value for which I still have to write the code, see ticket #545).

Oh, and then there is 

4) In case the if statement has curly braces the else statement also needs them even if it is a single instruction.

Best
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 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140621/1e7643f5/attachment.sig>


More information about the subsurface mailing list