mirror of https://github.com/ecmwf/eccodes.git
ECC-1183: grib_ls: Add gridName to the list of keys for ECMWF unstructured grids
This commit is contained in:
parent
3e86023813
commit
01950c15cf
|
@ -6,4 +6,9 @@ concept unstructuredGridSubtype(unknown,"unstructuredGridSubtype.def",conceptsLo
|
|||
|
||||
concept unstructuredGridUUID(unknown,"unstructuredGridUUID.def",conceptsLocalDirAll,conceptsMasterDir);
|
||||
|
||||
if (unstructuredGridType is "undefined" || unstructuredGridType is "unknown") {
|
||||
meta gridName sprintf("%s",unstructuredGridType);
|
||||
} else {
|
||||
meta gridName sprintf("%s_%s",unstructuredGridType,unstructuredGridSubtype);
|
||||
}
|
||||
alias ls.gridName=gridName;
|
||||
|
|
|
@ -17,11 +17,22 @@ sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
|||
temp1=temp.1.${label}
|
||||
temp2=temp.2.${label}
|
||||
|
||||
# Default
|
||||
${tools_dir}/grib_set -s gridType=unstructured_grid $sample $temp1
|
||||
grib_check_key_equals $temp1 gridName 'undefined'
|
||||
|
||||
# Unknown values
|
||||
${tools_dir}/grib_set -s gridType=unstructured_grid,numberOfGridInReference=94,numberOfGridUsed=200 $sample $temp1
|
||||
grib_check_key_equals $temp1 gridName 'unknown'
|
||||
|
||||
# ORCA1, W grid
|
||||
${tools_dir}/grib_set -s gridType=unstructured_grid,numberOfGridInReference=4,numberOfGridUsed=2 $sample $temp1
|
||||
grib_check_key_equals $temp1 'unstructuredGridType' 'ORCA1'
|
||||
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'W'
|
||||
#grib_check_key_equals $temp1 'unstructuredGridUUID' 'ORCA1 W unknown'
|
||||
grib_check_key_equals $temp1 gridName 'ORCA1_W'
|
||||
# ECC-1183
|
||||
${tools_dir}/grib_ls -j $temp1 > $temp2
|
||||
grep -q "gridName.*ORCA1_W" $temp2
|
||||
|
||||
${tools_dir}/grib_set -s gridType=unstructured_grid,unstructuredGridType=ORCA1,unstructuredGridSubtype=W $sample $temp2
|
||||
${tools_dir}/grib_compare $temp1 $temp2
|
||||
|
|
Loading…
Reference in New Issue