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
98388ef4
Commit
98388ef4
authored
Jan 18, 2008
by
Uwe Schulzweida
Browse files
grbDefTime: add support for century < 0
parent
e50bce3d
Changes
3
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
98388ef4
...
...
@@ -7,6 +7,7 @@
* Add support for Lambert grids [request: Patrick Samuelsson]
* Change cdiDefCompress to streamDefZtype/streamDefZlevel
* decode_timevalue: bug fix for rounding error [report: Veronika Gayler]
* grbDefTime: add support for century < 0
* Version 1.1.0 released
2007-10-22 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
...
...
src/griblib.c
View file @
98388ef4
/* Generated automatically from m214003 on Fri Jan 18 1
1:53:23
CET 2008 */
/* Generated automatically from m214003 on Fri Jan 18 1
4:07:14
CET 2008 */
/* GRIBLIB_VERSION="1.1.0" */
...
...
@@ -123,7 +123,7 @@ void gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
#define GET_INT3(a,b,c) ((1-(int) ((unsigned) (a & 128) >> 6)) * (int) (((a & 127) << 16)+(b<<8)+c))
#define GET_INT2(a,b) ((1-(int) ((unsigned) (a & 128) >> 6)) * (int) (((a & 127) << 8) + b))
#define GET_INT1(a) ((1-(int) ((unsigned) (a & 128) >> 6)) * (int) (a))
#define GET_INT1(a) ((1-(int) ((unsigned) (a & 128) >> 6)) * (int) (a
&127
))
/* this requires a 32-bit default integer machine */
#define GET_UINT4(a,b,c,d) ((int) ((a << 24) + (b << 16) + (c << 8) + (d)))
...
...
@@ -265,7 +265,7 @@ void gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
(lGrib[z++] = (Value) >> 8), \
(lGrib[z++] = (Value)))
#define Put1Int(Value) {ival = Value; if ( ival < 0 ) ival =
256
- ival; Put1Byte(ival);}
#define Put1Int(Value) {ival = Value; if ( ival < 0 ) ival =
128
- ival; Put1Byte(ival);}
#define Put3Int(Value) {ival = Value; if ( ival < 0 ) ival = 8388608 - ival; Put3Byte(ival);}
#define Put1Real(Value) \
...
...
@@ -991,17 +991,19 @@ void gribDateTime(int *isec1, int *date, int *time)
int
ryear
,
rmonth
,
rday
,
rhour
,
rminute
;
int
time_period
;
int
julday
,
secofday
,
addsec
;
int
century
;
ryear
=
ISEC1_Year
;
century
=
ISEC1_Century
-
1
;
ryear
=
ISEC1_Year
;
if
(
ISEC1_C
entury
)
if
(
c
entury
!=
0
)
{
if
(
ryear
!=
255
)
{
if
(
ISEC1_C
entury
>
127
)
ryear
=
((
ISEC1_Century
-
1
-
256
)
*
100
+
ISEC1_Year
);
if
(
c
entury
<
0
)
ryear
=
-
(
-
century
*
100
+
ISEC1_Year
);
else
ryear
=
((
ISEC1_C
entury
-
1
)
*
100
+
ISEC1_Year
)
;
ryear
=
c
entury
*
100
+
ISEC1_Year
;
}
else
ryear
=
1
;
...
...
@@ -3984,7 +3986,7 @@ static int decodePDS(unsigned char *pds, int *isec0, int *isec1)
if
(
ISEC1_Year
<
0
)
{
ISEC1_Year
=
-
ISEC1_Year
;
ISEC1_Year
=
-
ISEC1_Year
;
ISEC1_Century
=
-
ISEC1_Century
;
}
...
...
@@ -8282,7 +8284,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
return
(
gribLen
);
}
static
const
char
grb_libvers
[]
=
"1.1.0"
" of ""Jan 18 2008"" ""1
1:53:23
"
;
static
const
char
grb_libvers
[]
=
"1.1.0"
" of ""Jan 18 2008"" ""1
4:07:14
"
;
...
...
src/stream_grb.c
View file @
98388ef4
...
...
@@ -1708,9 +1708,11 @@ void grbDefTime(int *isec1, int date, int time, int numavg, int timeID)
rtime
=
taxisInqRtime
(
timeID
);
decode_date
(
rdate
,
&
year
,
&
month
,
&
day
);
decode_time
(
rtime
,
&
hour
,
&
minute
);
century
=
year
/
100
;
ISEC1_Year
=
year
-
century
*
100
;
if
(
year
<
0
)
ISEC1_Year
=
-
ISEC1_Year
;
ISEC1_Month
=
month
;
ISEC1_Day
=
day
;
ISEC1_Hour
=
hour
;
...
...
@@ -1753,9 +1755,11 @@ void grbDefTime(int *isec1, int date, int time, int numavg, int timeID)
{
decode_date
(
date
,
&
year
,
&
month
,
&
day
);
decode_time
(
time
,
&
hour
,
&
minute
);
century
=
year
/
100
;
ISEC1_Year
=
year
-
century
*
100
;
if
(
year
<
0
)
ISEC1_Year
=
-
ISEC1_Year
;
ISEC1_Month
=
month
;
ISEC1_Day
=
day
;
ISEC1_Hour
=
hour
;
...
...
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