mirror of https://github.com/ecmwf/eccodes.git
Definitions: Precedence order env var
This commit is contained in:
parent
6d0e3e733a
commit
d8f1cdcc3d
|
@ -12,7 +12,8 @@ constant internalVersion=30 : hidden;
|
||||||
meta checkInternalVersion check_internal_version(internalVersion) : hidden;
|
meta checkInternalVersion check_internal_version(internalVersion) : hidden;
|
||||||
|
|
||||||
# ECC-806: Local concepts precedence order
|
# ECC-806: Local concepts precedence order
|
||||||
transient preferLocalConcepts = 0 : hidden;
|
preferLocalConceptsEnvVar = getenv("ECCODES_GRIB_PREFER_LOCAL_CONCEPTS","0") : hidden;
|
||||||
|
transient preferLocalConcepts = preferLocalConceptsEnvVar : hidden;
|
||||||
|
|
||||||
constant defaultTypeOfLevel="unknown" : hidden;
|
constant defaultTypeOfLevel="unknown" : hidden;
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
label="grib_ecc-806_test"
|
label="grib_ecc-806_test"
|
||||||
tempGrb=temp.${label}.grb
|
tempGrb=temp.${label}.grb
|
||||||
tempOut=temp.${label}.txt
|
tempOut=temp.${label}.txt
|
||||||
tempErr=temp.${label}.err
|
|
||||||
|
|
||||||
# This NCEP grib2 file has the keys
|
# This NCEP grib2 file has the keys
|
||||||
# discipline = 0
|
# discipline = 0
|
||||||
|
@ -36,5 +35,17 @@ res=`${tools_dir}/grib_get -p paramId,shortName,units,name $input`
|
||||||
res=`${tools_dir}/grib_get -s preferLocalConcepts=1 -p paramId,shortName,units,name $input`
|
res=`${tools_dir}/grib_get -s preferLocalConcepts=1 -p paramId,shortName,units,name $input`
|
||||||
[ "$res" = "260056 sdwe kg m**-2 Water equivalent of accumulated snow depth (deprecated)" ]
|
[ "$res" = "260056 sdwe kg m**-2 Water equivalent of accumulated snow depth (deprecated)" ]
|
||||||
|
|
||||||
|
# Test the environment variable too
|
||||||
|
export ECCODES_GRIB_PREFER_LOCAL_CONCEPTS=1
|
||||||
|
grib_check_key_equals $input preferLocalConceptsEnvVar,preferLocalConcepts '1 1'
|
||||||
|
res=`${tools_dir}/grib_get -p paramId,shortName,units,name $input`
|
||||||
|
[ "$res" = "260056 sdwe kg m**-2 Water equivalent of accumulated snow depth (deprecated)" ]
|
||||||
|
|
||||||
|
export ECCODES_GRIB_PREFER_LOCAL_CONCEPTS=0
|
||||||
|
grib_check_key_equals $input preferLocalConceptsEnvVar,preferLocalConcepts '0 0'
|
||||||
|
unset ECCODES_GRIB_PREFER_LOCAL_CONCEPTS
|
||||||
|
grib_check_key_equals $input preferLocalConceptsEnvVar,preferLocalConcepts '0 0'
|
||||||
|
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
rm -f $tempGrb $tempOut $tempErr
|
rm -f $tempGrb $tempOut
|
||||||
|
|
Loading…
Reference in New Issue