Giter Site home page Giter Site logo

Comments (5)

martens73 avatar martens73 commented on September 26, 2024

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.

from scarface.

chrisdane avatar chrisdane commented on September 26, 2024

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?

from scarface.

martens73 avatar martens73 commented on September 26, 2024

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.

from scarface.

chrisdane avatar chrisdane commented on September 26, 2024

Screenshot from ScarFace:
Screenshot at 2022-01-14 11-36-54
--> 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?

from scarface.

chrisdane avatar chrisdane commented on September 26, 2024

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

from scarface.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.