mirror of https://github.com/ecmwf/eccodes.git
ECC-1640: Tools: Deprecate the grib1to2 script
This commit is contained in:
parent
4b2f8bcb46
commit
abfaec141e
|
@ -104,14 +104,3 @@ grib_check_key_equals $temp2 stepType,stepRange 'accum 0-240'
|
|||
rm -f $temp1 $temp2
|
||||
|
||||
rm -f $output
|
||||
|
||||
#sed "s:toolsdir:${tools_dir}/:" ${tools_dir}/grib1to2.txt > ${tools_dir}/grib1to2.test
|
||||
#chmod +x ${tools_dir}/grib1to2.test
|
||||
#${tools_dir}/grib1to2.test -f ${data_dir}/test.grib1 ${data_dir}/test.grib2
|
||||
#${tools_dir}/grib_get -p typeOfProcessedData:s,type:s ${data_dir}/test.grib2 > ${data_dir}/typeOfProcessedData.log
|
||||
|
||||
#diff ${data_dir}/typeOfProcessedData.log ${data_dir}/typeOfProcessedData.ok
|
||||
|
||||
#${tools_dir}/grib_compare -Pe ${data_dir}/test.grib1 ${data_dir}/test.grib2
|
||||
|
||||
#rm -f ${data_dir}/test.grib2
|
||||
|
|
|
@ -93,13 +93,6 @@ ecbuild_add_executable( TARGET codes_bufr_filter
|
|||
|
||||
if( ECCODES_INSTALL_EXTRA_TOOLS )
|
||||
ecbuild_info("ECCODES_INSTALL_EXTRA_TOOLS enabled")
|
||||
# grib1to2 script needs to be generated before installation
|
||||
configure_file( grib1to2.in grib1to2 )
|
||||
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/grib1to2
|
||||
DESTINATION ${INSTALL_BIN_DIR}
|
||||
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
|
||||
GROUP_EXECUTE GROUP_READ
|
||||
WORLD_EXECUTE WORLD_READ )
|
||||
else()
|
||||
ecbuild_info("ECCODES_INSTALL_EXTRA_TOOLS disabled")
|
||||
endif()
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ $# -lt 2 ]
|
||||
then
|
||||
echo "usage: $0 [-f] in.grib1 out.grib2"
|
||||
echo "-f convert to grib2 only typeOfLevel='hybrid' and copy other level types as grib1"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
grib_filter=@CMAKE_INSTALL_PREFIX@/bin/grib_filter
|
||||
rules_filter=rules.filter$$
|
||||
|
||||
force=0
|
||||
out=$2
|
||||
in=$1
|
||||
while getopts fd:D:t:b:w:e:r:s:n:p: options
|
||||
do
|
||||
case $options in
|
||||
f) force=1
|
||||
out=$3
|
||||
in=$2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
if [ $force = 1 ]
|
||||
then
|
||||
|
||||
cat >> $rules_filter <<EOF
|
||||
if ( typeOfLevel is 'hybrid' ) {
|
||||
set edition=2;
|
||||
}
|
||||
write;
|
||||
EOF
|
||||
|
||||
else
|
||||
|
||||
cat >> $rules_filter <<EOF
|
||||
if ( ! typeOfLevel is 'hybrid' ) {
|
||||
print "Error: typeOfLevel='[typeOfLevel]' unable to convert. Only typeOfLevel='hybrid' can be converted.";
|
||||
assert( typeOfLevel is 'hybrid' );
|
||||
}
|
||||
set edition=2;
|
||||
write;
|
||||
EOF
|
||||
|
||||
fi
|
||||
|
||||
set +e
|
||||
$grib_filter -o $out $rules_filter $in
|
||||
|
||||
error=$?
|
||||
|
||||
rm -f $rules_filter
|
||||
|
||||
exit $error
|
||||
|
Loading…
Reference in New Issue