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
4f2847c7
Commit
4f2847c7
authored
Jan 16, 2013
by
Uwe Schulzweida
Browse files
stream_gribapi: replaced streamID by streamptr
parent
75dfa354
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/stream_cgribex.h
View file @
4f2847c7
#ifndef _STREAM_CGRIBEX_H
#define _STREAM_CGRIBEX_H
int
cgribexScanTimestep1
(
int
stream
ID
);
int
cgribexScanTimestep2
(
int
stream
ID
);
int
cgribexScanTimestep
(
int
stream
ID
);
int
cgribexScanTimestep1
(
stream_t
*
stream
ptr
);
int
cgribexScanTimestep2
(
stream_t
*
stream
ptr
);
int
cgribexScanTimestep
(
stream_t
*
stream
ptr
);
int
cgribexDecode
(
unsigned
char
*
gribbuffer
,
int
gribsize
,
double
*
data
,
int
gridsize
,
int
unreduced
,
int
*
nmiss
,
int
*
zip
,
double
missval
);
...
...
src/stream_grb.c
View file @
4f2847c7
...
...
@@ -200,12 +200,12 @@ int grbScanTimestep1(int streamID)
#if defined (HAVE_LIBCGRIBEX)
if
(
filetype
==
FILETYPE_GRB
)
{
status
=
cgribexScanTimestep1
(
stream
ID
);
status
=
cgribexScanTimestep1
(
stream
ptr
);
}
else
#endif
{
status
=
gribapiScanTimestep1
(
stream
ID
);
status
=
gribapiScanTimestep1
(
stream
ptr
);
}
return
(
status
);
...
...
@@ -224,12 +224,12 @@ int grbScanTimestep2(int streamID)
#if defined (HAVE_LIBCGRIBEX)
if
(
filetype
==
FILETYPE_GRB
)
{
status
=
cgribexScanTimestep2
(
stream
ID
);
status
=
cgribexScanTimestep2
(
stream
ptr
);
}
else
#endif
{
status
=
gribapiScanTimestep2
(
stream
ID
);
status
=
gribapiScanTimestep2
(
stream
ptr
);
}
return
(
status
);
...
...
@@ -248,12 +248,12 @@ int grbScanTimestep(int streamID)
#if defined (HAVE_LIBCGRIBEX)
if
(
filetype
==
FILETYPE_GRB
)
{
status
=
cgribexScanTimestep
(
stream
ID
);
status
=
cgribexScanTimestep
(
stream
ptr
);
}
else
#endif
{
status
=
gribapiScanTimestep
(
stream
ID
);
status
=
gribapiScanTimestep
(
stream
ptr
);
}
return
(
status
);
...
...
@@ -275,7 +275,7 @@ int grbInqContents(int streamID)
streamptr
->
curTsID
=
0
;
status
=
grbScanTimestep1
(
streamID
);
if
(
status
==
0
&&
streamptr
->
ntsteps
==
-
1
)
status
=
grbScanTimestep2
(
streamID
);
fileSetPos
(
fileID
,
0
,
SEEK_SET
);
...
...
@@ -298,7 +298,7 @@ int grbInqTimestep(int streamID, int tsID)
if
(
CDI_Debug
)
Message
(
"tsid = %d rtsteps = %d"
,
tsID
,
streamptr
->
rtsteps
);
ntsteps
=
CDI_UNDEFID
;
while
(
(
tsID
+
1
)
>
streamptr
->
rtsteps
&&
ntsteps
==
CDI_UNDEFID
)
{
...
...
src/stream_gribapi.c
View file @
4f2847c7
...
...
@@ -756,7 +756,7 @@ void grib2GetLevel(grib_handle *gh, int *leveltype, int *lbounds, int *level1, i
}
static
void
gribapiAddRecord
(
int
stream
ID
,
int
param
,
grib_handle
*
gh
,
void
gribapiAddRecord
(
stream_t
*
stream
ptr
,
int
param
,
grib_handle
*
gh
,
long
recsize
,
off_t
position
,
int
datatype
,
int
comptype
)
{
long
editionNumber
;
...
...
@@ -771,7 +771,6 @@ void gribapiAddRecord(int streamID, int param, grib_handle *gh,
record_t
*
record
;
grid_t
grid
;
int
vlistID
;
stream_t
*
streamptr
;
int
leveltype
;
long
lpar
;
int
status
;
...
...
@@ -779,8 +778,6 @@ void gribapiAddRecord(int streamID, int param, grib_handle *gh,
size_t
vlen
;
long
ens_index
=
0
,
ens_count
=
0
,
ens_forecast_type
=
0
;
streamptr
=
stream_to_pointer
(
streamID
);
vlistID
=
streamptr
->
vlistID
;
tsID
=
streamptr
->
curTsID
;
recID
=
recordNewEntry
(
streamptr
,
tsID
);
...
...
@@ -958,7 +955,7 @@ void gribapiAddRecord(int streamID, int param, grib_handle *gh,
}
#endif
int
gribapiScanTimestep1
(
int
stream
ID
)
int
gribapiScanTimestep1
(
stream_t
*
stream
ptr
)
{
#if defined (HAVE_LIBGRIB_API)
off_t
recpos
=
0
;
...
...
@@ -987,7 +984,6 @@ int gribapiScanTimestep1(int streamID)
int
comptype
;
long
unzipsize
;
compvar2_t
compVar
,
compVar0
;
stream_t
*
streamptr
;
grib_handle
*
gh
=
NULL
;
int
leveltype
;
int
pdis
=
0
,
pcat
=
0
,
pnum
=
0
;
...
...
@@ -997,10 +993,6 @@ int gribapiScanTimestep1(int streamID)
int
lieee
=
FALSE
;
int
lbounds
;
streamptr
=
stream_to_pointer
(
streamID
);
stream_check_ptr
(
__func__
,
streamptr
);
streamptr
->
curTsID
=
0
;
tsID
=
tstepsNewEntry
(
streamptr
);
...
...
@@ -1192,7 +1184,7 @@ int gribapiScanTimestep1(int streamID)
if
(
CDI_Debug
)
Message
(
"%4d %8d %4d %8d %8d %6d"
,
nrecs
,
(
int
)
recpos
,
param
,
level1
,
vdate
,
vtime
);
gribapiAddRecord
(
stream
ID
,
param
,
gh
,
recsize
,
recpos
,
datatype
,
comptype
);
gribapiAddRecord
(
stream
ptr
,
param
,
gh
,
recsize
,
recpos
,
datatype
,
comptype
);
grib_handle_delete
(
gh
);
gh
=
NULL
;
...
...
@@ -1271,7 +1263,7 @@ int gribapiScanTimestep1(int streamID)
}
int
gribapiScanTimestep2
(
int
stream
ID
)
int
gribapiScanTimestep2
(
stream_t
*
stream
ptr
)
{
int
rstatus
=
0
;
#if defined (HAVE_LIBGRIB_API)
...
...
@@ -1295,7 +1287,6 @@ int gribapiScanTimestep2(int streamID)
int
vlistID
;
long
unzipsize
;
compvar2_t
compVar
,
compVar0
;
stream_t
*
streamptr
;
grib_handle
*
gh
=
NULL
;
int
leveltype
;
int
pdis
=
0
,
pcat
=
0
,
pnum
=
0
;
...
...
@@ -1304,10 +1295,6 @@ int gribapiScanTimestep2(int streamID)
long
lpar
;
int
lbounds
;
streamptr
=
stream_to_pointer
(
streamID
);
stream_check_ptr
(
__func__
,
streamptr
);
streamptr
->
curTsID
=
1
;
fileID
=
streamptr
->
fileID
;
...
...
@@ -1574,7 +1561,7 @@ int gribapiScanTimestep2(int streamID)
}
int
gribapiScanTimestep
(
int
stream
ID
)
int
gribapiScanTimestep
(
stream_t
*
stream
ptr
)
{
int
rstatus
=
0
;
#if defined (HAVE_LIBGRIB_API)
...
...
@@ -1596,7 +1583,6 @@ int gribapiScanTimestep(int streamID)
int
rindex
,
nrecs
=
0
;
long
unzipsize
;
compvar2_t
compVar
,
compVar0
;
stream_t
*
streamptr
;
grib_handle
*
gh
=
NULL
;
int
leveltype
;
int
pdis
=
0
,
pcat
=
0
,
pnum
=
0
;
...
...
@@ -1605,15 +1591,11 @@ int gribapiScanTimestep(int streamID)
long
lpar
;
int
lbounds
;
streamptr
=
stream_to_pointer
(
streamID
);
stream_check_ptr
(
__func__
,
streamptr
);
vlistID
=
streamptr
->
vlistID
;
if
(
CDI_Debug
)
{
Message
(
"stream
ID
= %
d
"
,
stream
ID
);
Message
(
"stream
ptr
= %
p
"
,
stream
ptr
);
Message
(
"cts = %d"
,
streamptr
->
curTsID
);
Message
(
"rts = %d"
,
streamptr
->
rtsteps
);
Message
(
"nts = %d"
,
streamptr
->
ntsteps
);
...
...
src/stream_gribapi.h
View file @
4f2847c7
#ifndef _STREAM_GRIBAPI_H
#define _STREAM_GRIBAPI_H
int
gribapiScanTimestep1
(
int
stream
ID
);
int
gribapiScanTimestep2
(
int
stream
ID
);
int
gribapiScanTimestep
(
int
stream
ID
);
int
gribapiScanTimestep1
(
stream_t
*
stream
ptr
);
int
gribapiScanTimestep2
(
stream_t
*
stream
ptr
);
int
gribapiScanTimestep
(
stream_t
*
stream
ptr
);
int
gribapiDecode
(
unsigned
char
*
gribbuffer
,
int
gribsize
,
double
*
data
,
int
gridsize
,
int
unreduced
,
int
*
nmiss
,
int
*
zip
,
double
missval
);
...
...
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