ECC-1166: GRIB: Add the gridName key for ORCA grids

This commit is contained in:
Shahram Najm 2020-11-20 15:46:45 +00:00
parent c236ad2fc7
commit ae16bbda57
3 changed files with 19 additions and 15 deletions

View File

@ -5,3 +5,6 @@ concept_nofail unstructuredGridType(unknown,"unstructuredGridType.def",conceptsL
concept_nofail unstructuredGridSubtype(unknown,"unstructuredGridSubtype.def",conceptsLocalDirAll,conceptsMasterDir);
concept_nofail unstructuredGridUUID(unknown,"unstructuredGridUUID.def",conceptsLocalDirAll,conceptsMasterDir);
meta unstructuredGridName sprintf("%s_%s",unstructuredGridType,unstructuredGridSubtype);
alias gridName=unstructuredGridName;

View File

@ -1,6 +1,6 @@
'undefined' = { numberOfGridInReference = 0; }
'T grid' = { numberOfGridInReference = 1; }
'U grid' = { numberOfGridInReference = 2; }
'V grid' = { numberOfGridInReference = 3; }
'W grid' = { numberOfGridInReference = 4; }
'F grid' = { numberOfGridInReference = 5; }
'T' = { numberOfGridInReference = 1; }
'U' = { numberOfGridInReference = 2; }
'V' = { numberOfGridInReference = 3; }
'W' = { numberOfGridInReference = 4; }
'F' = { numberOfGridInReference = 5; }

View File

@ -19,29 +19,30 @@ temp2=temp.2.${label}
${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 grid'
#grib_check_key_equals $temp1 'unstructuredGridUUID' 'ORCA1 W grid unknown'
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'W'
#grib_check_key_equals $temp1 'unstructuredGridUUID' 'ORCA1 W unknown'
grib_check_key_equals $temp1 gridName 'ORCA1_W'
${tools_dir}/grib_set -s gridType=unstructured_grid,unstructuredGridType=ORCA1,unstructuredGridSubtype='W grid' $sample $temp2
${tools_dir}/grib_set -s gridType=unstructured_grid,unstructuredGridType=ORCA1,unstructuredGridSubtype=W $sample $temp2
${tools_dir}/grib_compare $temp1 $temp2
grib_check_key_equals $temp2 'numberOfGridInReference' '4'
grib_check_key_equals $temp2 'numberOfGridUsed' '2'
grib_check_key_equals $temp2 'numberOfGridInReference,numberOfGridUsed,gridName' '4 2 ORCA1_W'
# Test some lat/lon parameters
${tools_dir}/grib_set -s paramId=250003 $sample $temp1
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'T grid'
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'T'
${tools_dir}/grib_set -s paramId=250005 $sample $temp1
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'U grid'
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'U'
${tools_dir}/grib_set -s paramId=250007 $sample $temp1
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'V grid'
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'V'
${tools_dir}/grib_set -s paramId=250009 $sample $temp1
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'W grid'
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'W'
${tools_dir}/grib_set -s paramId=250011 $sample $temp1
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'F grid'
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'F'
rm -f $temp1 $temp2