-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gsw_cp0 #27
Comments
Yes, that would be useful. I think that they have to be copied over manually from the C source: https://github.com/TEOS-10/GSW-C/blob/master/gsw_internal_const.h#L33 Are you interested to make a pull request? |
Yes, I can try, although I'm a Julia newbie so will probably need some help. |
That could be a one-liner, as defined and tested below, but the harder thing would be finding where in the source to put this, so that it would sit alongside similar functions.
|
I guess that we can also declare it as an irrational as we did for Base.@irrational gsw_cp0 3991.86795711963 big(3991.86795711963)
export gsw_cp0 It can go maybe the same file julia> Base.@irrational gsw_cp0 3991.86795711963 big(3991.86795711963)
julia> gsw_cp0
gsw_cp0 = 3991.8679571196...
julia> gsw_cp0 * 1.0
3991.86795711963
julia> gsw_cp0 * 1f0
3991.868f0
julia> typeof(gsw_cp0 * 1f0)
Float32
julia> typeof(gsw_cp0 * 1.0)
Float64 |
@Alexander-Barth, thanks for your support. |
@ThomasHaine, I've updated. You can try after update the package, like julia> using GibbsSeaWater
julia> Float32(GibbsSeaWater.gsw_cp0)
3991.868f0 Now, to check it without a warning, we may need to cast them to a type like |
Works! Thanks @kouketsu |
How do I access the seawater specific heat capacity
gsw_cp0
constant (and other constants, for that matter)? The MATLAB gsw package has a function that returns it.Thanks for building this Julia gsw package!
The text was updated successfully, but these errors were encountered: