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
a8f50f06
Commit
a8f50f06
authored
Oct 24, 2014
by
Uwe Schulzweida
Browse files
srvScanTimestep: cleanup
parent
c42a2927
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/stream_srv.c
View file @
a8f50f06
...
...
@@ -256,33 +256,6 @@ void srv_add_record(stream_t *streamptr, int param, int level, int xsize, int ys
varID
,
gridID
,
levelID
);
}
void
srvCmpRecord
(
stream_t
*
streamptr
,
int
tsID
,
int
recID
,
off_t
position
,
int
param
,
int
level
,
int
xsize
,
int
ysize
)
{
int
varID
=
0
;
int
levelID
=
0
;
record_t
*
record
;
record
=
&
streamptr
->
tsteps
[
tsID
].
records
[
recID
];
if
(
param
!=
(
*
record
).
param
||
level
!=
(
*
record
).
ilevel
)
Error
(
"inconsistent timestep"
);
(
*
record
).
position
=
position
;
/*
varID = (*record).varID;
levelID = (*record).levelID;
streamptr->vars[varID].level[levelID] = recID;
streamptr->tsteps[tsID].nallrecs++;
streamptr->nrecs++;
*/
if
(
CDI_Debug
)
Message
(
"varID = %d levelID = %d"
,
varID
,
levelID
);
}
static
void
srvScanTimestep1
(
stream_t
*
streamptr
)
{
...
...
@@ -600,17 +573,15 @@ long srvScanTimestep(stream_t *streamptr)
int
header
[
8
];
int
status
;
int
fileID
;
int
tsID
;
/* int rxsize = 0, rysize = 0; */
int
param
=
0
;
int
rcode
=
0
,
rlevel
=
0
,
vdate
=
0
,
vtime
=
0
;
off_t
recpos
=
0
;
int
recID
;
taxis_t
*
taxis
;
int
rindex
,
nrecs
=
0
;
SRVCOMPVAR
compVar
,
compVar0
;
srvrec_t
*
srvp
=
(
srvrec_t
*
)
streamptr
->
record
->
exsep
;
/*
if ( CDI_Debug )
{
Message("streamID = %d", streamptr->self);
...
...
@@ -618,12 +589,10 @@ long srvScanTimestep(stream_t *streamptr)
Message("rts = %d", streamptr->rtsteps);
Message("nts = %d", streamptr->ntsteps);
}
*/
if
(
streamptr
->
rtsteps
==
0
)
Error
(
"Internal problem! Missing contents."
);
tsID
=
streamptr
->
rtsteps
;
taxis
=
&
streamptr
->
tsteps
[
tsID
].
taxis
;
int
tsID
=
streamptr
->
rtsteps
;
taxis_t
*
taxis
=
&
streamptr
->
tsteps
[
tsID
].
taxis
;
if
(
streamptr
->
tsteps
[
tsID
].
recordSize
==
0
)
{
...
...
@@ -632,8 +601,7 @@ long srvScanTimestep(stream_t *streamptr)
nrecs
=
streamptr
->
tsteps
[
1
].
nrecs
;
streamptr
->
tsteps
[
tsID
].
nrecs
=
nrecs
;
streamptr
->
tsteps
[
tsID
].
recIDs
=
(
int
*
)
xmalloc
((
size_t
)
nrecs
*
sizeof
(
int
));
streamptr
->
tsteps
[
tsID
].
recIDs
=
(
int
*
)
xmalloc
((
size_t
)
nrecs
*
sizeof
(
int
));
for
(
recID
=
0
;
recID
<
nrecs
;
recID
++
)
streamptr
->
tsteps
[
tsID
].
recIDs
[
recID
]
=
streamptr
->
tsteps
[
1
].
recIDs
[
recID
];
...
...
@@ -673,9 +641,7 @@ long srvScanTimestep(stream_t *streamptr)
taxis
->
vdate
=
vdate
;
taxis
->
vtime
=
vtime
;
}
/*
srvCmpRecord(streamptr, tsID, nrecs, recpos, param, rlevel, rxsize, rysize);
*/
compVar
.
param
=
param
;
compVar
.
level
=
rlevel
;
compVar0
.
param
=
streamptr
->
tsteps
[
tsID
].
records
[
recID
].
param
;
...
...
@@ -687,7 +653,7 @@ long srvScanTimestep(stream_t *streamptr)
tsID
,
recID
,
streamptr
->
tsteps
[
tsID
].
records
[
recID
].
param
,
param
,
streamptr
->
tsteps
[
tsID
].
records
[
recID
].
ilevel
,
rlevel
);
Error
(
"Invalid, unsupported or inconsistent record structure"
);
Error
(
"Invalid, unsupported or inconsistent record structure
!
"
);
}
streamptr
->
tsteps
[
tsID
].
records
[
recID
].
position
=
recpos
;
...
...
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