Skip to content
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

Sw_extras soundspeed method Delgrosso correction #92

Open
ThaliaGueroult opened this issue Jun 7, 2023 · 3 comments
Open

Sw_extras soundspeed method Delgrosso correction #92

ThaliaGueroult opened this issue Jun 7, 2023 · 3 comments

Comments

@ThaliaGueroult
Copy link

XX = np.sin(45 * np.pi / 180) need to be squared

And verify whole formula:
Fofonoff 1983, page 28 (https://repository.oceanbestpractices.org/bitstream/handle/11329/109/059832eb.pdf?sequence=1&isAllowed=y)
GR = 9.780318 * (1.0 + (5.2788e-3 + 2.36e-5 * XX) * XX) + 1.092e-6 * D
P = D / GR

@ocefpaf
Copy link
Member

ocefpaf commented Jun 8, 2023

Thanks for the report. Do you want to send a PR to fix that?

@FloraSauerbronn
Copy link

FloraSauerbronn commented Oct 25, 2024

This section in sw_extras.py is an exact copy of the MATLAB function. So, does it mean that both are incorrect?
I can add the correction to the squared equation. Could you assign this issue to me, @ocefpaf ?

Issue track -> sw_extras.py line 669

elif equation == "del_grosso":
        # Del grosso uses pressure in kg/cm^2.  To get to this from dbars
        # we  must divide by "g".  From the UNESCO algorithms (referring to
        # ANON (1970) BULLETIN GEODESIQUE) we have this formula for g as a
        # function of latitude and pressure.  We set latitude to 45 degrees
        # for convenience!

        XX = np.sin(45 * np.pi / 180)

        GR = 9.780318 * (1.0 + (5.2788e-3 + 2.36e-5 * XX) * XX) + 1.092e-6 * D

        P = D / GR

`
How is on the reference page 28:

X =SIN(LAT/57.29547)

X = X * X

GR = 9.780318 * (1.0 + (5.2788e-3 + 2.36e-5 * XX) * XX) + 1.092e-6 * D

P = D / GR 

This is how the Matlab function is:

% Del grosso uses pressure in kg/cm^2. To get to this from dbars we must 
% divide by "g". From the UNESCO algorithms (referring to ANON (1970) 
% BULLETIN GEODESIQUE) we have this formula for g as a function of latitude 
% and pressure. We set latitude to 45 degrees for convenience!
      XX=sin(45*pi/180);

      GR = 9.780318*(1.0+(5.2788E-3+2.36E-5*XX)*XX) + 1.092E-6*D;

      P=D./GR;

Matlab reference

@ocefpaf
Copy link
Member

ocefpaf commented Oct 28, 2024

The matlab one may be wrong. A PR to fix that according to the Unesco ref would be welcomed! I'm not an expert on this field so I'd appreciate if someone could look up the latest references on the topic to make sure the equation implemented yields the correct values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants