Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

FastCO2SYS

A fast parallelizable ocean carbonate system solver

all input and outputs are in μmol/kgsw or ppm for pCO2

to add the package:

pkg> add https://github.com/rafeknight/FastCO2SYS

The function has 10 arguments as follows:

values = CO2Solver(param1, param2, param1_val, param2_val, Temp, 
  Sal, Pressure, Boron_T, Total_PO4, Total_SiO2)

Positions 1 and 2 are the names of your carbonate system paramaters (i.e. "ALK"). Positions 3 and 4 are the values of those paramaters.

Note: pH is on the total scale (will add a conversion function)

Note: The total boron concentration can be modified. This is helpful for artificial seawater. However, be careful when converting pH scales for ASW

The outputs are as follows: Outputs: (ALK, DIC, pH, CO2_ppm, CO2_aq, HCO3, CO3, Ω_c, Ω_a)

example:

using FastCO2SYS
pH = CO2Solver("ALK", "DIC", 2300, 2000, Default, Default, Default, Default, Default, Default)[3]

Or

using FastCO2SYS
pH = CO2Solver("ALK", "DIC", 2300, 2000, 25, 35, 0.0, 420, 0.0, 0.0)[3]

Example (pH increase with ALK even at constant pCO2):

using FastCO2SYS
using Plots
n = 4000
ALK = zeros(n)
pH = zeros(n)
@time for i in 1:n
  ALK[i] = i
  pH[i] = CO2Solver("ALK", "CO2_ppm", ALK[i], 400, "Default", "Default", "Default", "Default", "Default", "Default")[3]
end

plot(ALK, pH, xlabel = "ALK", ylabel = "pH", lw = 5, color = :dodgerblue, label = "pCO2 = 400 ppm", framestyle = :box)

Other notes:

The "default" total boron concetration is 420 μmol/kgsw regardless of salinity. A salinity correction will be added. Additionally, I'll add conversions between pHnbs, pHT, pHsws

All dissociation constants are the recommended ones from Zeebe and Wolf-Gladrow 2001.

I'll add the corresponding references

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages