This package provides a simplified expression to calculate globally averaged ocean pH. Is follows Equation 7 from Appendix F of "Valuing Climate Damages: Updating Estimation of the Social Cost of Carbon Dioxide":
The equation is based on the ocean surface partial pressure of CO2 (pCO2), but the report notes, "Globally averaged pCO2 of the surface ocean can be estimated from globally averaged CO2 concentration in the atmosphere with approximately 1 year lag." It therefore represents pCO2 in period [t] as the atmospheric CO2 concentration in period [t-1].
The code is written in the Julia programming language and uses the Mimi framework for integrated assessment models.