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
2160282b
Commit
2160282b
authored
Aug 13, 2014
by
Uwe Schulzweida
Browse files
cgribex: use timerange indication to identify different variables
parent
d8d7a3d4
Changes
4
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
2160282b
...
...
@@ -3,6 +3,10 @@
* Version 1.7.0 released
* using CGRIBEX library version 1.7.0
2014-08-13 Uwe Schulzweida
* cgribex: use timerange indication to identify different variables
2014-08-12 Daniel Reinert
* listDestroy(): set resHListSize=0 [Bug #5058]
...
...
app/cdi.c
View file @
2160282b
...
...
@@ -375,6 +375,8 @@ void printShortinfo(int streamID, int vlistID, int vardis)
else
if
(
tsteptype
==
TSTEP_MIN
)
fprintf
(
stdout
,
"%-8s "
,
"min"
);
else
if
(
tsteptype
==
TSTEP_MAX
)
fprintf
(
stdout
,
"%-8s "
,
"max"
);
else
if
(
tsteptype
==
TSTEP_ACCUM
)
fprintf
(
stdout
,
"%-8s "
,
"accum"
);
else
if
(
tsteptype
==
TSTEP_RANGE
)
fprintf
(
stdout
,
"%-8s "
,
"range"
);
else
if
(
tsteptype
==
TSTEP_DIFF
)
fprintf
(
stdout
,
"%-8s "
,
"diff"
);
else
fprintf
(
stdout
,
"%-8s "
,
"unknown"
);
/* layer info */
...
...
src/stream_cgribex.c
View file @
2160282b
...
...
@@ -533,16 +533,15 @@ compvar_t cgribexVarSet(int param, int level1, int level2, int leveltype, int tr
static
int
cgribexVarCompare
(
compvar_t
compVar
,
record_t
record
)
{
int
rstatus
;
compvar_t
compVar0
;
compVar0
.
param
=
record
.
param
;
compVar0
.
level1
=
record
.
ilevel
;
compVar0
.
level2
=
record
.
ilevel2
;
compVar0
.
ltype
=
record
.
ltype
;
compVar0
.
param
=
record
.
param
;
compVar0
.
level1
=
record
.
ilevel
;
compVar0
.
level2
=
record
.
ilevel2
;
compVar0
.
ltype
=
record
.
ltype
;
compVar0
.
tsteptype
=
record
.
tsteptype
;
rstatus
=
memcmp
(
&
compVar0
,
&
compVar
,
sizeof
(
compvar_t
));
int
rstatus
=
memcmp
(
&
compVar0
,
&
compVar
,
sizeof
(
compvar_t
));
return
(
rstatus
);
}
...
...
src/varscan.c
View file @
2160282b
...
...
@@ -121,7 +121,7 @@ void paramInitEntry(int varID, int param)
}
static
int
varGetEntry
(
int
param
,
int
zaxistype
,
int
ltype
,
const
char
*
name
)
int
varGetEntry
(
int
param
,
int
zaxistype
,
int
ltype
,
int
tsteptype
,
const
char
*
name
)
{
int
varID
;
...
...
@@ -129,7 +129,8 @@ int varGetEntry(int param, int zaxistype, int ltype, const char *name)
{
if
(
vartable
[
varID
].
param
==
param
&&
vartable
[
varID
].
zaxistype
==
zaxistype
&&
vartable
[
varID
].
ltype
==
ltype
)
vartable
[
varID
].
ltype
==
ltype
&&
vartable
[
varID
].
tsteptype
==
tsteptype
)
{
if
(
name
&&
name
[
0
]
&&
vartable
[
varID
].
name
&&
vartable
[
varID
].
name
[
0
]
)
{
...
...
@@ -325,17 +326,17 @@ void varAddRecord(int recID, int param, int gridID, int zaxistype, int lbounds,
int
levelID
=
-
1
;
if
(
!
(
cdiSplitLtype105
==
1
&&
zaxistype
==
ZAXIS_HEIGHT
)
)
varID
=
varGetEntry
(
param
,
zaxistype
,
ltype
,
name
);
varID
=
varGetEntry
(
param
,
zaxistype
,
ltype
,
tsteptype
,
name
);
if
(
varID
==
UNDEFID
)
{
nvars
++
;
varID
=
paramNewEntry
(
param
);
vartable
[
varID
].
gridID
=
gridID
;
vartable
[
varID
].
zaxistype
=
zaxistype
;
vartable
[
varID
].
ltype
=
ltype
;
vartable
[
varID
].
lbounds
=
lbounds
;
vartable
[
varID
].
level_sf
=
level_sf
;
vartable
[
varID
].
gridID
=
gridID
;
vartable
[
varID
].
zaxistype
=
zaxistype
;
vartable
[
varID
].
ltype
=
ltype
;
vartable
[
varID
].
lbounds
=
lbounds
;
vartable
[
varID
].
level_sf
=
level_sf
;
vartable
[
varID
].
level_unit
=
level_unit
;
if
(
tsteptype
!=
UNDEFID
)
vartable
[
varID
].
tsteptype
=
tsteptype
;
if
(
numavg
)
vartable
[
varID
].
timave
=
1
;
...
...
@@ -449,23 +450,20 @@ void cdi_generate_vars(stream_t *streamptr)
double
*
dlevels
=
NULL
;
double
*
dlevels1
=
NULL
;
double
*
dlevels2
=
NULL
;
int
vlistID
;
int
*
varids
,
index
,
varid
;
int
index
,
varid
;
double
level_sf
=
1
;
int
vlistID
=
streamptr
->
vlistID
;
vlistID
=
streamptr
->
vlistID
;
varids
=
(
int
*
)
malloc
(
nvars
*
sizeof
(
int
));
int
*
varids
=
(
int
*
)
malloc
(
nvars
*
sizeof
(
int
));
for
(
varID
=
0
;
varID
<
nvars
;
varID
++
)
varids
[
varID
]
=
varID
;
if
(
streamptr
->
sortname
)
{
int
index
;
param_t
**
varInfo
;
varInfo
=
(
param_t
**
)
malloc
(
nvars
*
sizeof
(
param_t
*
));
varInfo
[
0
]
=
(
param_t
*
)
malloc
(
nvars
*
sizeof
(
param_t
));
for
(
index
=
1
;
index
<
nvars
;
index
++
)
for
(
int
index
=
1
;
index
<
nvars
;
index
++
)
varInfo
[
index
]
=
varInfo
[
0
]
+
index
;
for
(
varid
=
0
;
varid
<
nvars
;
varid
++
)
...
...
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