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
a1a9974d
Commit
a1a9974d
authored
Sep 03, 2012
by
Uwe Schulzweida
Browse files
vlistCopy: removed free(vlistptr2->vars[varID].ensdata) (bug fix)
parent
89594fbd
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/stream_gribapi.c
View file @
a1a9974d
...
...
@@ -840,11 +840,15 @@ void gribapiAddRecord(int streamID, int param, grib_handle *gh,
Get the ensemble Info from the grib-2 Tables and update the intermediate datastructure.
Further update to the "vlist" is handled in the same way as for GRIB-1 by "cdiGenVars"
*/
/*
GRIB_CHECK(grib_get_long(gh, "typeOfEnsembleForecast", &ens_forecast_type ), 0);
GRIB_CHECK(grib_get_long(gh, "numberOfForecastsInEnsemble", &ens_count ), 0);
GRIB_CHECK(grib_get_long(gh, "perturbationNumber", &ens_index ), 0);
*/
{
int
status
;
status
=
grib_get_long
(
gh
,
"typeOfEnsembleForecast"
,
&
ens_forecast_type
);
if
(
status
==
0
)
{
GRIB_CHECK
(
grib_get_long
(
gh
,
"numberOfForecastsInEnsemble"
,
&
ens_count
),
0
);
GRIB_CHECK
(
grib_get_long
(
gh
,
"perturbationNumber"
,
&
ens_index
),
0
);
}
}
if
(
ens_index
>
0
)
varDefEnsembleInfo
(
varID
,
(
int
)
ens_index
,
(
int
)
ens_count
,
(
int
)
ens_forecast_type
);
...
...
src/vlist.c
View file @
a1a9974d
...
...
@@ -285,7 +285,6 @@ void vlistCopy(int vlistID2, int vlistID1)
memcpy
(
vlistptr2
->
vars
[
varID
].
levinfo
,
vlistptr1
->
vars
[
varID
].
levinfo
,
nlevs
*
sizeof
(
levinfo_t
));
if
(
vlistptr2
->
vars
[
varID
].
ensdata
)
free
(
vlistptr2
->
vars
[
varID
].
ensdata
);
if
(
vlistptr1
->
vars
[
varID
].
ensdata
)
{
vlistptr2
->
vars
[
varID
].
ensdata
=
(
ensinfo_t
*
)
malloc
(
sizeof
(
ensinfo_t
));
...
...
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