[CCR PATCH] PO2 Calculations extracted to separate function.

Robert Helling helling at atdotde.de
Mon Sep 15 03:09:57 PDT 2014


On 14.09.2014, at 20:39, Willem Ferguson <willemferguson at zoology.up.ac.za> 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




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140915/ea05939e/attachment.html>
-------------- 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/20140915/ea05939e/attachment.sig>


More information about the subsurface mailing list