Closed chrisdane closed 2 years ago
The carb()
function of the seacarb package uses the boron concentration of Uppstrom (1974) as default, while the newer reference of Lee et al. (2010) is more widely used in the community. You can test it by selecting Uppstrom (1974) from the dropdown menu in the Additional choices box in ScarFace. Alternatively, apply the Lee et al. (2010) boron concentration in the original carb()
function:
carb(flag=15, var1=2200/1e6, var2=2000/1e6, S=35, T=25, b="l10")
You should then get identical results between seacarb and ScarFace.
Thanks a lot for your answer!
carb(flag=15, var1=2200/1e6, var2=2000/1e6, S=35, T=25, b="l10")$pCO2
equals 622.5467 which is quite similar as the ScarFace value 622.52 but still not equal?
I can not reproduce this issue. I always get exactly the same numbers, no matter whether I use seacarb or ScarFace. In fact, there is even no way that they can be different as ScarFace is using seacarb, and there are no conversions involved. Please check and compare carefully the parameters set in each program.
Screenshot from ScarFace: --> pCO2_scarface = 622.52
library(seacarb)
round(seacarb::carb(flag=15, var1=2200/1e6, var2=2000/1e6, S=35, T=25, b="l10")$pCO2, 2)
[1] 622.55
--> pCO2_seacarb = 622.55
You cant reproduce this?
This is the flag=15
case in ScarFace:
if (!input$pHscale == "NBS") {
carb(flag=as.numeric(input$pair), var1=input$first/1000000, var2=input$second/1000000,
S=input$salc, T=input$tempc, Patm=1, P=input$presc,
Pt=input$pho/1000000, Sit=input$sil/1000000, k1k2=input$k1k2,
kf="x", ks="d", pHscale=input$pHscale, b=input$b, gas=input$gasm,
warn="y", eos="eos80", long=1.e20, lat=1.e20)
} else {
carb(flag=as.numeric(input$pair), var1=input$first/1000000, var2=input$second/1000000,
S=input$salc, T=input$tempc, Patm=1, P=input$presc,
Pt=input$pho/1000000, Sit=input$sil/1000000, k1k2=input$k1k2,
kf="x", ks="d", pHscale="SWS", b=input$b, gas=input$gasm,
warn="y", eos="eos80", long=1.e20, lat=1.e20)
}
Since by default pHscale = "T"
, the first case applies and using the same arguments yields
round(seacarb::carb(flag=15, var1=2200/1e6, var2=2000/1e6, S=35, T=25,
Patm=1, P=0, Pt=0/1e6, Sit=0/1e6, k1k2="x", kf="x", ks="d",
pHscale="T", b="l10", gas="potential", warn="y",
eos="eos80", long=1.e20, lat=1.e20)$pCO2, 2)
[1] 622.55
, i.e. pCO2_seacarb = pCO2_myscarface = 622.55 != pCO2_scarface = 622.52.
What is the seacarb package version used by ScarFace?
Yes its the package version:
packageVersion("seacarb")
[1] ‘3.2.16’
round(seacarb::carb(flag=15, var1=2200/1e6, var2=2000/1e6, S=35, T=25, b="l10")$pCO2, 2)
[1] 622.52
but
packageVersion("seacarb")
[1] ‘3.3.0’
round(seacarb::carb(flag=15, var1=2200/1e6, var2=2000/1e6, S=35, T=25, b="l10")$pCO2, 2)
[1] 622.55
Thanks and cheers, Chris
Hi
With flag=15, ALK=2200 µmol kg-1 and DIC=2000 µmol kg-1 the shiny app yields
When I do it directly in R the result is
I am aware that the shiny app returns different units than the
carb()
function, e.g. for ALK and DIC.However,
pCO2_app = 622.52
whilepCO2_carb = 614.4945
. Could you please explain these differences?Thanks for any help and kind regards, Chris