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

gsw_enthalpy_first_derivatives: doc says 3 return values, code has 2 return values #7

Closed
dankelley opened this issue Mar 18, 2017 · 6 comments

Comments

@dankelley
Copy link

The doc says 3 return values: http://www.teos-10.org/pubs/gsw/html/gsw_enthalpy_first_derivatives.html

The code says 2 return values: https://github.com/TEOS-10/GSW-Matlab/blob/master/Toolbox/gsw_enthalpy_first_derivatives.m#L1

@dankelley
Copy link
Author

Also, I think, the check values in the HTML for h_SA are wrong. I get the reported values for h_CT (to 15 digits) but my values differ from the values in the HTML page by fraction up to 1e-4. In case it is of any help, I'll state what I get:

> d
$h_SA
[1] -0.070223912348929 -0.351159768365102 -0.887025065692568
[4] -1.829602387915694 -4.423463748270238 -7.405100077558673

$h_CT
[1] 3991.89970553048 3992.02564052010 3992.21036503074 3992.28415025049
[5] 3992.68538912266 3993.01416853418

@dankelley
Copy link
Author

Also, http://www.teos-10.org/pubs/gsw/html/gsw_enthalpy_first_derivatives_CT_exact.html has the problem with the number of arguments, although I find that my R code (a wrapper around C) returns the stated check values for d/dSA and d/dCT.

@PaulMBarker
Copy link
Member

The help page is incorrect, only two derivatives are returned. I initially had the programme returning the pressure derivative but deleted it as h_P is specific volume, v.

I have also rerun the code and updated the check values reported on the webpage, see below.

SA = [34.7118; 34.8915; 35.0256; 34.8472; 34.7366; 34.7324;]
CT = [28.7856; 28.4329; 22.8103; 10.2600; 6.8863; 4.4036;]
p = [ 10; 50; 125; 250; 600; 1000;]

[h_SA, h_CT] = gsw_enthalpy_first_derivatives(SA,CT,p)

h_SA =

-0.070223912348929
-0.351159768365102
-0.887025065692568
-1.829602387915694
-4.423463748270238
-7.405100077558673

h_CT =

1.0e+03 *

3.991899705530481
3.992025640520101
3.992210365030743
3.992284150250490
3.992685389122658
3.993014168534175

@dankelley
Copy link
Author

Thanks, @PaulMBarker. I've updated the doc and test suite in the develop branch of GSW-R, commit b74c88ef39b903f71234efad8d46da22ad913784.

As of this moment (2017-03-20 09:30:47 UTC), the webpage http://www.teos-10.org/pubs/gsw/html/gsw_enthalpy_first_derivatives.html still lists the old check values. Also, on that webpage, we still see "3.05 (16th February, 2015)" as the date. I wonder if those webpages are cached, so that I'm seeing an old version?

@PaulMBarker
Copy link
Member

PaulMBarker commented Mar 20, 2017 via email

@dankelley
Copy link
Author

dankelley commented Jul 30, 2017

I'm finally getting around to closing this issue with respect to GSW-R, which consists mainly of removing the warning that the test values on the TEOS-10 website were wrong. Sorry for the delay. The fix is in master commit 05175e7316c18270c597a63f94f51b71e70c6455 (also merged into develop).

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

2 participants