Commit a1a9974d authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

vlistCopy: removed free(vlistptr2->vars[varID].ensdata) (bug fix)

parent 89594fbd
...@@ -840,11 +840,15 @@ void gribapiAddRecord(int streamID, int param, grib_handle *gh, ...@@ -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. 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" 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); int status;
GRIB_CHECK(grib_get_long(gh, "numberOfForecastsInEnsemble", &ens_count ), 0); status = grib_get_long(gh, "typeOfEnsembleForecast", &ens_forecast_type );
GRIB_CHECK(grib_get_long(gh, "perturbationNumber", &ens_index ), 0); 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 ) if ( ens_index > 0 )
varDefEnsembleInfo(varID, (int)ens_index, (int)ens_count, (int)ens_forecast_type); varDefEnsembleInfo(varID, (int)ens_index, (int)ens_count, (int)ens_forecast_type);
......
...@@ -285,7 +285,6 @@ void vlistCopy(int vlistID2, int vlistID1) ...@@ -285,7 +285,6 @@ void vlistCopy(int vlistID2, int vlistID1)
memcpy(vlistptr2->vars[varID].levinfo, memcpy(vlistptr2->vars[varID].levinfo,
vlistptr1->vars[varID].levinfo, nlevs*sizeof(levinfo_t)); vlistptr1->vars[varID].levinfo, nlevs*sizeof(levinfo_t));
if ( vlistptr2->vars[varID].ensdata ) free(vlistptr2->vars[varID].ensdata);
if ( vlistptr1->vars[varID].ensdata ) if ( vlistptr1->vars[varID].ensdata )
{ {
vlistptr2->vars[varID].ensdata = (ensinfo_t *) malloc(sizeof(ensinfo_t)); vlistptr2->vars[varID].ensdata = (ensinfo_t *) malloc(sizeof(ensinfo_t));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment