mvdh7 / PyCO2SYS

Marine carbonate system calculations in Python
https://PyCO2SYS.readthedocs.io
GNU General Public License v3.0
50 stars 9 forks source link

Fix typo in p1atm.py #52

Closed AJSchiller closed 3 years ago

AJSchiller commented 3 years ago

An errant '5' seems to have snuck into the code at the end of the number highlighted in the screenshot below (taken from Roy et al., 1996 - amendment to ref. RRV93 in this repo).

image

mvdh7 commented 3 years ago

Comments from Ernie Lewis (2021-07-09):

Roy et al. had a 5 in the equation in the abstract and his Eq. 29, which is the same, in their 1993 paper (first page attached). However, the second errata for that paper (attached) lists two changes in that equation: an exponent of S is changed from 1 to 1.5 (an obvious typo) and the 5 at the end of that equation no longer appears. In the original CO2SYS.BAS I have the 5 at the end of the equation, so 1) either I was inconsistent, or 2) I assumed the real error was the obvious typo in the exponent (there are probably other options, such as I didn't notice). Thus, the 5 was in the CO2SYS.BAS code and thus presumably copied into the MATLAB code and the PyCO2SYS code, so ultimately I'm responsible for it.

The difference in K1, for S=35, caused by the omission of the 5 is less than a factor of 1.000002, so it obviously doesn't matter for anything other than obsession (i.e., consistency) and aesthetics (both of which happen to be important to me, however).

Will therefore leave this as it is for consistency with other CO2SYS implementations.