GRIB-363: grib_filter: cannot convert to grib2 and set typeOfFirstFixedSurface=150

This commit is contained in:
Shahram Najm 2013-05-08 11:53:09 +01:00
parent 32900991ac
commit 91c38a8094
3 changed files with 20 additions and 5 deletions

View File

@ -49,16 +49,16 @@ transient genVertHeightCoords = 0;
if (defined(typeOfFirstFixedSurface)) {
if (typeOfFirstFixedSurface == 150) {
transient genVertHeightCoords = 1;
transient PVPresent = 0;
ieeefloat nlev : dump ;
ieeefloat numberOfVGridUsed : dump;
byte[16] uuidOfVGrid : dump;
}
}
if (genVertHeightCoords) {
# Generalized vertical height coordinate case
transient PVPresent = 0;
ieeefloat nlev : dump ;
alias numberOfVerticalCoordinateValues = nlev ;
ieeefloat numberOfVGridUsed : dump;
byte[16] uuidOfVGrid : dump;
}
else {
if (NV == 0){

View File

@ -58,5 +58,20 @@ EOF
result=`${tools_dir}/grib_filter ${data_dir}/formatint.rules $GRIB_SAMPLES_PATH/GRIB1.tmpl`
[ "$result" = "edition=001, level= 500" ]
# Convert from grib1 to grib2 "Generalized vertical height coordinates"
cat >temp.filt <<EOF
set edition=2;
set PVPresent=1;
set NV=6;
set typeOfFirstFixedSurface=150;
set nlev=41.0;
write;
EOF
${tools_dir}/grib_filter -o temp.grib2 temp.filt $GRIB_SAMPLES_PATH/GRIB1.tmpl
result=`${tools_dir}/grib_get -p typeOfFirstFixedSurface,NV,nlev temp.grib2`
[ "$result" = "150 6 41" ]
rm -f temp.grib2 temp.filt
rm -f ${data_dir}/formatint.rules