On 14.09.2014, at 20:39, Willem Ferguson <[email protected]> 
wrote:

Willem,

> This patch takes the po2 calculations in calculate_gas_information()
> and puts these in a separate function calc_po2(). This was suggested
> by Robert Helling. Several variables are required to do this calcu-
> lation, passed to the function as a pointer to a structure defined
> in profile.h


I must admit, I don’t quite get this. What is the point of that new structure? 
I don’t see what you earn from combining the ambient pressure and some info 
from struct gasmix. Why don’t you pass the ambient pressure and a pointer to 
the gasmix to your new function.

Another warning: The ambient pressure variable is double (and not int) because 
it has units of bar (and not mbar) different from what the comment in the 
header file says. So have the partial pressure fields in entry as they are 
plotted and the user wants to see bars, not our internal units.

To me, it would make much more sense to have a helper function that returns all 
three partial pressures given a gas mix and an ambient pressure (and a measured 
pO2 and possibly another variable indicating the type of dive i.e. OC, CCR or 
PSCR).

BTW, code with a similar function (i.e. get partial pressures from an ambient 
pressure and gas mix) are also found in add_segemnt in deco.c. There, you also 
want to use your helper functions.

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
                      Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339
                      http://www.atdotde.de

Enhance your privacy, use cryptography! My PGP keys have fingerprints
A9D1 A01D 13A5 31FA 6515  BB44 0820 367C 36BC 0C1D    and
DCED 37B6 251C 7861 270D  5613 95C7 9D32 9A8D 9B8F




Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
subsurface mailing list
[email protected]
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to