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
d69b6c5b
Commit
d69b6c5b
authored
Feb 10, 2019
by
Uwe Schulzweida
Browse files
Added streamScanTimeConstAdjust().
parent
6d9469c6
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/stream_cgribex.c
View file @
d69b6c5b
...
...
@@ -11,6 +11,7 @@
#include
"file.h"
#include
"varscan.h"
#include
"datetime.h"
#include
"stream_scan.h"
#include
"stream_grb.h"
#include
"stream_cgribex.h"
...
...
@@ -716,21 +717,6 @@ void cgribexScanTsFixNtsteps(stream_t *streamptr, off_t recpos)
}
}
static
inline
void
cgribexScanTsConstAdjust
(
stream_t
*
streamptr
,
taxis_t
*
taxis
)
{
const
int
vlistID
=
streamptr
->
vlistID
;
if
(
streamptr
->
ntsteps
==
1
)
{
if
(
taxis
->
vdate
==
0
&&
taxis
->
vtime
==
0
)
{
streamptr
->
ntsteps
=
0
;
for
(
int
varID
=
0
;
varID
<
streamptr
->
nvars
;
varID
++
)
vlistDefVarTimetype
(
vlistID
,
varID
,
TIME_CONSTANT
);
}
}
}
static
void
cgribexSkipRecords
(
const
int
fileID
)
{
...
...
@@ -899,7 +885,7 @@ int cgribexScanTimestep1(stream_t *streamptr)
{
streamptr
->
tsteps
[
0
].
recordSize
=
(
int
)
nrecords
;
streamptr
->
tsteps
[
0
].
records
=
(
record_t
*
)
Realloc
(
streamptr
->
tsteps
[
0
].
records
,
nrecords
*
sizeof
(
record_t
));
(
record_t
*
)
Realloc
(
streamptr
->
tsteps
[
0
].
records
,
nrecords
*
sizeof
(
record_t
));
}
streamptr
->
tsteps
[
0
].
recIDs
=
(
int
*
)
Malloc
(
nrecords
*
sizeof
(
int
));
...
...
@@ -911,7 +897,7 @@ int cgribexScanTimestep1(stream_t *streamptr)
streamptr
->
record
->
buffersize
=
buffersize
;
cgribexScanTsFixNtsteps
(
streamptr
,
recpos
);
cgribex
ScanT
s
ConstAdjust
(
streamptr
,
taxis
);
stream
ScanT
ime
ConstAdjust
(
streamptr
,
taxis
);
return
0
;
}
...
...
src/stream_ext.c
View file @
d69b6c5b
...
...
@@ -8,6 +8,7 @@
#include
"file.h"
#include
"cdi.h"
#include
"cdi_int.h"
#include
"stream_scan.h"
#include
"stream_ext.h"
#include
"varscan.h"
#include
"datetime.h"
...
...
@@ -318,15 +319,7 @@ void extScanTimestep1(stream_t *streamptr)
streamptr
->
tsteps
[
tsID
].
position
=
recpos
;
}
if
(
streamptr
->
ntsteps
==
1
)
{
if
(
taxis
->
vdate
==
0
&&
taxis
->
vtime
==
0
)
{
streamptr
->
ntsteps
=
0
;
for
(
int
varID
=
0
;
varID
<
streamptr
->
nvars
;
varID
++
)
vlistDefVarTimetype
(
vlistID
,
varID
,
TIME_CONSTANT
);
}
}
streamScanTimeConstAdjust
(
streamptr
,
taxis
);
}
static
...
...
src/stream_gribapi.c
View file @
d69b6c5b
...
...
@@ -8,6 +8,7 @@
#include
"cdi_int.h"
#include
"file.h"
#include
"gribapi_utilities.h"
#include
"stream_scan.h"
#include
"stream_grb.h"
#include
"stream_gribapi.h"
#include
"varscan.h"
...
...
@@ -93,14 +94,11 @@ static
int
gribapiGetTimeUnits
(
grib_handle
*
gh
)
{
long
unitsOfTime
=
-
1
;
grib_get_long
(
gh
,
"indicatorOfUnitOfTimeRange"
,
&
unitsOfTime
);
GRIB_CHECK
(
my_grib_set_long
(
gh
,
"stepUnits"
,
unitsOfTime
),
0
);
int
timeunits
=
getTimeunits
(
unitsOfTime
);
return
timeunits
;
return
getTimeunits
(
unitsOfTime
);
}
static
...
...
@@ -1078,15 +1076,7 @@ int gribapiScanTimestep1(stream_t * streamptr)
streamptr
->
tsteps
[
tsID
].
position
=
recpos
;
}
if
(
streamptr
->
ntsteps
==
1
)
{
if
(
taxis
->
vdate
==
0
&&
taxis
->
vtime
==
0
)
{
streamptr
->
ntsteps
=
0
;
for
(
int
varID
=
0
;
varID
<
streamptr
->
nvars
;
varID
++
)
vlistDefVarTimetype
(
vlistID
,
varID
,
TIME_CONSTANT
);
}
}
streamScanTimeConstAdjust
(
streamptr
,
taxis
);
return
0
;
}
...
...
src/stream_ieg.c
View file @
d69b6c5b
...
...
@@ -13,6 +13,7 @@
#include
"varscan.h"
#include
"datetime.h"
#include
"ieg.h"
#include
"stream_scan.h"
#include
"stream_ieg.h"
#include
"exse.h"
...
...
@@ -786,15 +787,7 @@ void iegScanTimestep1(stream_t *streamptr)
streamptr
->
tsteps
[
tsID
].
position
=
recpos
;
}
if
(
streamptr
->
ntsteps
==
1
)
{
if
(
taxis
->
vdate
==
0
&&
taxis
->
vtime
==
0
)
{
streamptr
->
ntsteps
=
0
;
for
(
int
varID
=
0
;
varID
<
streamptr
->
nvars
;
varID
++
)
vlistDefVarTimetype
(
vlistID
,
varID
,
TIME_CONSTANT
);
}
}
streamScanTimeConstAdjust
(
streamptr
,
taxis
);
}
static
...
...
src/stream_scan.c
View file @
d69b6c5b
...
...
@@ -4,12 +4,12 @@
void
streamScanTimeConstAdjust
(
stream_t
*
streamptr
,
const
taxis_t
*
taxis
)
{
const
int
vlistID
=
streamptr
->
vlistID
;
if
(
streamptr
->
ntsteps
==
1
)
if
(
streamptr
->
ntsteps
==
1
)
{
if
(
taxis
->
vdate
==
0
&&
taxis
->
vtime
==
0
)
if
(
taxis
->
vdate
==
0
&&
taxis
->
vtime
==
0
)
{
streamptr
->
ntsteps
=
0
;
for
(
int
varID
=
0
;
varID
<
streamptr
->
nvars
;
varID
++
)
for
(
int
varID
=
0
;
varID
<
streamptr
->
nvars
;
++
varID
)
vlistDefVarTimetype
(
vlistID
,
varID
,
TIME_CONSTANT
);
}
}
...
...
src/stream_srv.c
View file @
d69b6c5b
...
...
@@ -11,6 +11,7 @@
#include
"varscan.h"
#include
"datetime.h"
#include
"service.h"
#include
"stream_scan.h"
#include
"stream_srv.h"
#include
"exse.h"
...
...
@@ -314,15 +315,7 @@ void srvScanTimestep1(stream_t *streamptr)
streamptr
->
tsteps
[
tsID
].
position
=
recpos
;
}
if
(
streamptr
->
ntsteps
==
1
)
{
if
(
taxis
->
vdate
==
0
&&
taxis
->
vtime
==
0
)
{
streamptr
->
ntsteps
=
0
;
for
(
int
varID
=
0
;
varID
<
streamptr
->
nvars
;
varID
++
)
vlistDefVarTimetype
(
vlistID
,
varID
,
TIME_CONSTANT
);
}
}
streamScanTimeConstAdjust
(
streamptr
,
taxis
);
}
static
...
...
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