Comments (10)
I can confirm that this segfaults even if run from the old teos()
method.
> teos('gsw_ipv_vs_fnsquared_ratio', 34, 28, 10)
*** caught segfault ***
address 0x40, cause 'memory not mapped'
Traceback:
1: .C("gsw3a", as.character(lib), as.character(name), as.integer(ngood), as.double(a1[good]), as.double(a2[good]), as.double(a3[good]), rval = double(ngood), NAOK = TRUE, PACKAGE = "oce")
2: teos("gsw_ipv_vs_fnsquared_ratio", 34, 28, 10)
from gsw-r.
Let's wait to see what the higher ups say, but my vote is that if the fix is obvious and easy we do it for now, and document the change. It's not like we're dependent on the source from somewhere else, since we're directly including a particular snapshot in the package.
I know we don't want to just create another version of the library, but I think that outweighs the wait that would come from waiting for upstream changes to the C library (which in all likelihood is going to change anyway).
from gsw-r.
Hi Everyone,
I'm the developer/maintainer of the C library and am in the process of putting
it up on github (I've been using mercurial for my RCS so be patient). I've
indeed noted the bug and it's likely it is also in the F90 library. I believe
the better fix is to change the API to include pref as does the Matlab library.
Frank
Frank Delahoyde | Phone: 858.534.9562
Shipboard Technical Support | Computing Resources
Scripps Institution of Oceanography | Nimitz Marine Facility
297 Rosecrans Street |
San Diego, Ca. 92106 | [email protected]
On 12/30/14, 5:52 PM, Clark Richards wrote:
Let's wait to see what the higher ups say, but my vote is that if the fix is
obvious and easy we do it for now, and document the change. It's not like we're
dependent on the source from somewhere else, since we're directly including a
particular snapshot in the package.I know we don't want to just create another version of the library, but I think
that outweighs the wait that would come from waiting for upstream changes to the
C library (which in all likelihood is going to change anyway).—
Reply to this email directly or view it on GitHub
#9 (comment).
from gsw-r.
Hi Frank. This is indeed the fix that will go into GSW-R (probably tomorrow morning). The fix looks pretty simple.
It's hard to know who is in charge of the C library. I had thought @PaulMBarker was doing that. Is it you?
from gsw-r.
Hi Dan,
Yes, it's me. We couldn't deal with the Fortran (sorry Paul).
Frank
On 12/30/14, 6:17 PM, Dan Kelley wrote:
Hi Frank. This is indeed the fix that will go into GSW-R (probably tomorrow
morning). The fix looks pretty simple.It's hard to know who is in charge of the C library. I had thought @PaulMBarker
https://github.com/PaulMBarker was doing that. Is it you?—
Reply to this email directly or view it on GitHub
#9 (comment).
from gsw-r.
I've updated the library (C and h files) within GSW-R.
@fdelahoyde in case you want to see the differences in the C library, issue the following two commands in an OS shell:
git diff 7cf2cc e19735e src/gsw_oceanographic_toolbox.c
git diff 7cf2cc e19735e src/gswteos-10.h
you can also see all the differences (including in my R code) with
git diff 7cf2cc e19735e
in case that's of interest. Finally, if you don't like git commands, you can see colour-coded changes in the github webpage
from gsw-r.
@richardsc Although this bug has been fixed, we might want to leave the issue open a while in case others don't realize they can read and comment upon closed issues. --Dan.
from gsw-r.
Closing, in light of previous "2-day wait to close" argument.
from gsw-r.
There is another bug that needs fixing in this code that is how dsa and dct are calculated. Frank alerted me to it.
Paul.
Here is the latest matlab lines:
dSA = SA(Ishallow,:) - SA(Ideep,:);
dCT = CT(Ishallow,:) - CT(Ideep,:);and here are the fortran lines from my laptop:
dsa = (sa(k+1) - sa(k))
dct = (ct(k+1) - ct(k))and here are Glenn's lines
forall (i = 1: nz-1)
dsa(i) = sa(i+1) - sa(i)
sa_mid(i) = 0.5d0_(sa(i) + sa(i+1))
dct(i) = ct(i+1) - ct(i)
ct_mid(i) = 0.5d0_(ct(i) + ct(i+1))
dp(i) = p(i+1) - p(i)
p_mid(i) = 0.5d0*(p(i) + p(i+1))
end forallthey are different and this is wrong. The fortran needs changing to match the matlab, it should be
dsa = (sa(k) - sa(k+1))
dct = (ct(k) - ct(k+1))and in Glenn's version to:
forall (i = 1: nz-1)
dsa(i) = sa(i) - sa(i+1)
sa_mid(i) = 0.5d0_(sa(i) + sa(i+1))
dct(i) = ct(i) - ct(i+1)
ct_mid(i) = 0.5d0_(ct(i) + ct(i+1))
p_mid(i) = 0.5d0*(p(i) + p(i+1))
end forallNote that in the fortran code the line
dp = (p(k+1) - p(k))
or
dp(i) = p(i+1) - p(i)
is unnecessary and should be deleted.
From: Dan Kelley [[email protected]]
Sent: Saturday, January 03, 2015 3:48 AM
To: TEOS-10/GSW-R
Cc: Paul Barker
Subject: Re: [GSW-R] bug ingsw_ipv_vs_fnsquared_ratio()
in C library (#9)
Closing, in light of previous "2-day wait to close" argument.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-68541106.
from gsw-r.
This is fixed in the new version of the C library, incorporated into gsw today.
from gsw-r.
Related Issues (20)
- https://github.com/TEOS-10/GSW-R/issues/27 HOT 1
- problem with qsort_r HOT 22
- docs for gsw_SA_from_Sstar should name arg1 as Sstar HOT 2
- correct package building makefile HOT 7
- Official Listing on teos-10.org HOT 9
- Using gsw_nsquared HOT 2
- GSW-R should not "Depend" on the 'testthat' package HOT 11
- GSW-R (beta) not agreeing with TEOS-10 for gsw_geo_strf_dyn_height() HOT 18
- release 1.0-6 HOT 5
- fix some doc links HOT 3
- O2 functions not included in GSW-R HOT 11
- gsw_sp_salinometer() required HOT 1
- large negative gsw_t_freezing anomaly at large absolute salinity HOT 6
- docs should note limits for SA, CT, and p HOT 5
- Small units typo in gsw_Nsquared HOT 1
- Oxygen functions missing from R package? HOT 3
- new CRAN release HOT 24
- CRAN release of 1.0-0 HOT 12
- Post release: tag a release and update webpage HOT 3
- Functions in GSW-C that are not in GSW-R HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gsw-r.