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
6417a08a
Commit
6417a08a
authored
Mar 18, 2015
by
Uwe Schulzweida
Browse files
cdiDecodeTimevalue: fix rounding error for negativ timevalue
parent
7a208768
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
6417a08a
2015-03-
1
2 Uwe Schulzweida
2015-03-2
6
Uwe Schulzweida
* Version 1.6.8 released
* using CGRIBEX library version 1.7.1
2015-02-18 Uwe Schulzweida
* cdiDecodeTimevalue: fix rounding error for negativ timevalue
2015-02-12 Uwe Schulzweida
* scan netcdf time units attribute (bug fix)
...
...
src/taxis.c
View file @
6417a08a
...
...
@@ -941,7 +941,8 @@ void cdiDecodeTimevalue(int timeunit, double timevalue, int *days, int *secs)
if
(
timeunit
==
TUNIT_SECOND
)
{
*
days
=
(
int
)
(
timevalue
/
86400
);
*
secs
=
(
int
)
(
timevalue
-
*
days
*
86400
.
+
0
.
5
);
double
seconds
=
timevalue
-
*
days
*
86400
.;
*
secs
=
lround
(
seconds
);
if
(
*
secs
<
0
)
{
*
days
-=
1
;
*
secs
+=
86400
;
};
/*
{
...
...
@@ -954,7 +955,8 @@ void cdiDecodeTimevalue(int timeunit, double timevalue, int *days, int *secs)
else
if
(
timeunit
==
TUNIT_DAY
)
{
*
days
=
(
int
)
timevalue
;
*
secs
=
(
int
)
((
timevalue
-
*
days
)
*
86400
+
0
.
5
);
double
seconds
=
(
timevalue
-
*
days
)
*
86400
;
*
secs
=
lround
(
seconds
);
if
(
*
secs
<
0
)
{
*
days
-=
1
;
*
secs
+=
86400
;
};
/*
{
...
...
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