Open jordansread opened 6 years ago
Yup, I think its missing.
Sanity check with the OCE package
> 1000 + oce::swSigma0(35,25, pressure=10.1325)
[1] 1023.342
> rLakeAnalyzer::water.density(25, 35)
[1] 1022.768
If we fix the equation to have the S^2 at the end.
> rLakeAnalyzer::water.density(25, 35)
[1] 1023.343
Digging into OCE
, we can find their implementation of this equation. It is written in a way I didn't expect, but if you expand the algebra out, you find that last Salinity term (associated with 4.8314e-4) is squared.
So I think you're right. That last term should be squared.
Thanks for digging in - seems a simple fix, but an embarrassing error I made in the first place.
Don't worry about it.
While I've said this before, this is why these tools should be open source.
@jread-usgs want to review and merge #99 quick?
It seems the ^2 is missing from the source code?