Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
c2a3251f
Commit
c2a3251f
authored
Oct 20, 2017
by
Uwe Schulzweida
Browse files
gridInqXinc: added support for negativ values (bug fix).
parent
a78196a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
c2a3251f
...
...
@@ -2,6 +2,10 @@
* Version 1.9.2 released
2017-10-20 Uwe Schulzweida
* gridInqXinc: added support for negativ values (bug fix)
2017-10-09 Uwe Schulzweida
* changed type of gridsize from int to size_t
...
...
src/grid.c
View file @
c2a3251f
...
...
@@ -1846,9 +1846,10 @@ double gridInqXinc(int gridID)
size_t
xsize
=
gridptr
->
x
.
size
;
if
(
xsize
>
1
)
{
xinc
=
fabs
(
xvals
[
xsize
-
1
]
-
xvals
[
0
])
/
(
xsize
-
1
);
xinc
=
xvals
[
1
]
-
xvals
[
0
];
double
abs_xinc
=
fabs
(
xinc
);
for
(
size_t
i
=
2
;
i
<
xsize
;
i
++
)
if
(
fabs
(
fabs
(
xvals
[
i
-
1
]
-
xvals
[
i
])
-
xinc
)
>
0
.
01
*
xinc
)
if
(
fabs
(
fabs
(
xvals
[
i
-
1
]
-
xvals
[
i
])
-
abs_
xinc
)
>
0
.
01
*
abs_
xinc
)
{
xinc
=
0
;
break
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment