ECC-490: grib_api -> ecCodes F90 migration issue

This commit is contained in:
Shahram Najm 2017-07-11 13:39:49 +01:00
commit 9e64cc7264
3 changed files with 41 additions and 2 deletions

View File

@ -174,8 +174,8 @@ int grib_init_accessor_from_handle(grib_loader* loader,grib_accessor* ga,grib_ar
{
case GRIB_TYPE_STRING:
/* len = len > 1024 ? len : 1024; */
_grib_get_string_length(ga,&len);
/*_grib_get_string_length(ga,&len); See ECC-490 */
grib_get_string_length(h,name,&len);
sval = (char*)grib_context_malloc(h->context,len);
ret = grib_get_string_internal(h,name,sval,&len);
if(ret == GRIB_SUCCESS)

View File

@ -76,6 +76,7 @@ list( APPEND tests_data_reqd
ecc-379
ecc-393
ecc-433
ecc-490
gts_get
gts_ls
gts_compare

38
tests/ecc-490.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/sh
# Copyright 2005-2017 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#
. ./include.sh
set -u
# ---------------------------------------------------------
# This is the test for the JIRA issue ECC-490.
# It tests changing GRIB templates
# ---------------------------------------------------------
label="ecc-490-test"
tempSample=temp.${label}.sample.grib
tempRules=temp.${label}.filter
tempOut=temp.${label}.grib
grib2_sample=$ECCODES_SAMPLES_PATH/reduced_gg_pl_128_grib2.tmpl
${tools_dir}/grib_set -s productDefinitionTemplateNumber=11,typeOfProcessedData=pf,typeOfLevel=surface $grib2_sample $tempSample
cat > $tempRules <<EOF
set productDefinitionTemplateNumber=1;
set typeOfFirstFixedSurface=1;
set typeOfSecondFixedSurface=255;
set typeOfFirstFixedSurface=100;
set productDefinitionTemplateNumber=11;
set typeOfFirstFixedSurface=100;
set typeOfSecondFixedSurface=255;
write;
EOF
${tools_dir}/grib_filter -o $tempOut $tempRules $tempSample
rm -f $tempSample $tempRules $tempOut