## Convert atmospheric pressure from mbar to atm
Patm_mbar = 1052 # in millibar
Patm = Patm_mbar / 1013.25 # in atm
## Compute xCO2 from pCO2
pCO2 = 380
xCO2 = p2xCO2(T=25, S=35, Patm=Patm, pCO2=pCO2)
print(xCO2)
## The result is 377.1546 ppm
Run the code above in your browser using DataLab