Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
be965313
Commit
be965313
authored
May 28, 2019
by
Uwe Schulzweida
Browse files
gribapiDefSteptype: check stepType status.
parent
25f5a4ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/gribapi_utilities.c
View file @
be965313
...
...
@@ -340,6 +340,7 @@ int gribapiTimeIsFC(grib_handle *gh)
return
sigofrtime
!=
3
;
}
struct
cdiGribAPI_ts_str_map_elem
cdiGribAPI_ts_str_map
[]
=
{
// clang-format off
[
TSTEP_INSTANT
]
=
{
0
,
"instant"
},
...
...
@@ -353,7 +354,7 @@ struct cdiGribAPI_ts_str_map_elem cdiGribAPI_ts_str_map[] = {
[
TSTEP_COV
]
=
{
8
,
"cov"
},
[
TSTEP_RATIO
]
=
{
8
,
"ratio"
},
[
TSTEP_SUM
]
=
{
8
,
"sum"
},
{
0
,
""
}
{
0
,
""
}
// clang-format on
};
...
...
src/stream_gribapi.c
View file @
be965313
...
...
@@ -1721,7 +1721,7 @@ int gribapiDefSteptype(int editionNumber, grib_handle *gh, int productDefinition
const
char
*
stepType
=
"instant"
;
long
proDefTempNum
=
0
;
if
(
tsteptype
>=
TSTEP_INSTANT
&&
tsteptype
<=
TSTEP_
RATIO
)
if
(
tsteptype
>=
TSTEP_INSTANT
&&
tsteptype
<=
TSTEP_
SUM
)
{
stepType
=
cdiGribAPI_ts_str_map
[
tsteptype
].
sname
;
proDefTempNum
=
cdiGribAPI_ts_str_map
[
tsteptype
].
productionTemplate
;
...
...
@@ -1738,7 +1738,8 @@ int gribapiDefSteptype(int editionNumber, grib_handle *gh, int productDefinition
{
if
(
editionNumber
>
1
)
GRIB_CHECK
(
my_grib_set_long
(
gh
,
"productDefinitionTemplateNumber"
,
proDefTempNum
),
0
);
size_t
len
=
strlen
(
stepType
);
GRIB_CHECK
(
my_grib_set_string
(
gh
,
"stepType"
,
stepType
,
&
len
),
0
);
int
status
=
my_grib_set_string
(
gh
,
"stepType"
,
stepType
,
&
len
);
if
(
status
!=
0
)
GRIB_CHECK
(
my_grib_set_long
(
gh
,
"productDefinitionTemplateNumber"
,
0
),
0
);
}
return
(
int
)
proDefTempNum
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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