-
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_f(lat) - (coriolis parameter) missing? #19
Comments
Yes, it appears to be missing, since
produces no output. |
I'm not the maintainer of GibbsSeaWater.jl, but perhaps that person will notice this and add it. In the meantime, you could define it in your own code, with gsw_f(latitude) = 2*7.292115e-5*sin(latitude*pi/180.0) |
Indeed. Just was surprised it was missing :) Thanks |
It is indeed surprising that this function was missing. As far as I know, the wrapper has been automatically generated by @kouketsu. But also the C library (that we are using) misses this function
|
I imagine it was not included in the C library because it has nothing to do with seawater; it isn't used within gsw, and logically doesn't belong there. |
For context, GSW-R does not provide |
As this function is apparently in Matlab and python gsw package. I propose to include it here as well (as it is a single line) and then make a new release. Is this ok for you @kouketsu ? (I can make this change, but I am not in front of a computer right now). But if you prefer not to have it, it would be fine for me too. |
I basically agree with @dankelley, but as pointed out @Alexander-Barth, I also understand that someone who plans to move Julia from Matlab may need gsw_f. So I have added gsw_f, please try it (pkg> add GibbsSeaWater.jl#master; @Alexander-Barth and @willcoxe ). |
I'd like to thank everyone who participated in the discussion. I never considered that the C code might not have implemented a function that is described in the teos-10 function contents (https://www.teos-10.org/pubs/gsw/html/gsw_contents.html) which is usually where I go to find my function descriptions irrespective of language (in my case python and julia). I'm fine with it either way, but thanks for adding it! |
I tried (naively) latitude = 50 as an integer, and I got this error:
I am wondering if we could use the following instead (julia's automatic type promotion): gsw_f2(latitude) = 2 * 7.292115e-5 * sind(latitude)
#(sind = sin for degrees) But single precision floats become automatically double precision because we use a double precision constant. Maybe you wanted to avoid this? What about this: _Omega(::Type{Float32}) = 7.292115f-5 # constant as Float32
_Omega(::Type{T}) where T = 7.292115e-5 # default to Float64
gsw_f3(latitude::T) where T = 2 * _Omega(T) * sind(latitude)
Sorry if this is overkill :-) I am likely to use only Float64, so the current master is fine for me (the C functions are Float64-only anyway as far as I know) |
Thanks, @Alexander-Barth. |
I can't see the function referred to anywhere in the code, is it missing?
The text was updated successfully, but these errors were encountered: