mirror of https://github.com/ecmwf/eccodes.git
ECC-19: Rename grib_info to codes_info
This commit is contained in:
parent
8392a110e1
commit
6dcb518b5f
|
@ -47,7 +47,7 @@ tools/grib_get
|
|||
tools/grib_get_data
|
||||
tools/grib_histogram
|
||||
tools/grib_index_build
|
||||
tools/grib_info
|
||||
tools/codes_info
|
||||
tools/grib_keys
|
||||
tools/grib_list_keys
|
||||
tools/grib_ls
|
||||
|
|
|
@ -24,7 +24,7 @@ grib_api_bin=$1/bin
|
|||
|
||||
definitions=$2
|
||||
|
||||
if [ ! -f $grib_api_bin/grib_info ]
|
||||
if [ ! -f $grib_api_bin/codes_info ]
|
||||
then
|
||||
echo "
|
||||
Unable to find grib_api tools in $grib_api_bin
|
||||
|
@ -33,8 +33,8 @@ exit 1
|
|||
fi
|
||||
|
||||
set -e
|
||||
version=`$grib_api_bin/grib_info -v`
|
||||
defaultDefinitions=`$grib_api_bin/grib_info -d`
|
||||
version=`$grib_api_bin/codes_info -v`
|
||||
defaultDefinitions=`$grib_api_bin/codes_info -d`
|
||||
set +e
|
||||
|
||||
if [ $version != $requiredLibVersion ]
|
||||
|
|
|
@ -108,12 +108,12 @@ the environment variable GRIB_DEFINITION_PATH can be used.
|
|||
|
||||
To set properly this environment variable we have first to find the definitions
|
||||
files directory used by GRIB API.
|
||||
At this aim we can use the tool grib_info which is providing some configuration
|
||||
At this aim we can use the tool codes_info which is providing some configuration
|
||||
information about the library.
|
||||
|
||||
|
||||
\verbatim
|
||||
> grib_info
|
||||
> codes_info
|
||||
|
||||
grib_api Version 1.8.0
|
||||
|
||||
|
|
|
@ -49,6 +49,6 @@ else
|
|||
# Download the data needed for tests
|
||||
${data_dir}/download.sh "${data_dir}"
|
||||
|
||||
#${tools_dir}grib_info
|
||||
#${tools_dir}codes_info
|
||||
set -u
|
||||
fi
|
||||
|
|
|
@ -32,7 +32,7 @@ int main(int argc, char** argv)
|
|||
size_t values_len= 0;
|
||||
|
||||
/* Note: the full name of the sample file is "regular_ll_pl_grib1.tmpl" */
|
||||
/* Sample files are stored in the samples directory (use grib_info to */
|
||||
/* Sample files are stored in the samples directory (use codes_info to */
|
||||
/* see where that is). The default sample path can be changed by */
|
||||
/* setting the environment variable GRIB_SAMPLES_PATH */
|
||||
const char* sample_filename = "regular_ll_pl_grib1";
|
||||
|
|
|
@ -34,7 +34,5 @@ fi
|
|||
# Download the data needed for tests
|
||||
${data_dir}/download.sh "${data_dir}"
|
||||
|
||||
#${tools_dir}grib_info
|
||||
|
||||
set -u
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ program sample
|
|||
decimalPrecision = 2
|
||||
|
||||
! A new grib message is loaded from an existing sample.
|
||||
! Samples are searched in a default sample path (use grib_info
|
||||
! Samples are searched in a default sample path (use codes_info
|
||||
! to see where that is). The default sample path can be changed by
|
||||
! setting the environment variable GRIB_SAMPLES_PATH
|
||||
call codes_new_from_samples(igribsample, "regular_latlon_surface.grib1")
|
||||
|
|
|
@ -31,7 +31,4 @@ then
|
|||
GRIB_API_LIB=`pwd`/src
|
||||
fi
|
||||
|
||||
#${tools_dir}grib_info
|
||||
|
||||
set -u
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ then
|
|||
GRIB_API_LIB=`pwd`/src
|
||||
fi
|
||||
|
||||
#${tools_dir}grib_info
|
||||
#${tools_dir}codes_info
|
||||
|
||||
set -u
|
||||
|
||||
|
|
|
@ -1360,7 +1360,7 @@
|
|||
|
||||
!> Create a new valid gribid from a sample contained in a samples directory pointed
|
||||
!> by the environment variable GRIB_SAMPLES_PATH.
|
||||
!> To know where the samples directory is run the grib_info tool.\n
|
||||
!> To know where the samples directory is run the codes_info tool.\n
|
||||
!>
|
||||
!> In case of error, if the status parameter (optional) is not given, the program will
|
||||
!> exit with an error message.\n Otherwise the error message can be
|
||||
|
|
|
@ -44,10 +44,7 @@ then
|
|||
GRIB_API_LIB=`pwd`/src
|
||||
fi
|
||||
|
||||
#${tools_dir}grib_info
|
||||
|
||||
# go back to current working dir
|
||||
cd $save
|
||||
|
||||
set -u
|
||||
|
||||
|
|
|
@ -679,17 +679,17 @@ def grib_set_double(gribid,key,value):
|
|||
@require(samplename=str)
|
||||
def grib_new_from_samples(samplename):
|
||||
"""
|
||||
@brief Create a new valid gribid from a sample.
|
||||
|
||||
@brief Create a new valid gribid from a sample.
|
||||
|
||||
The available samples are picked up from the directory pointed to
|
||||
by the environment variable GRIB_SAMPLES_PATH.
|
||||
To know where the samples directory is run the grib_info tool.\n
|
||||
|
||||
To know where the samples directory is run the codes_info tool.\n
|
||||
|
||||
\b Examples: \ref samples.py "samples.py"
|
||||
|
||||
|
||||
@param samplename name of the sample to be used
|
||||
@return id of the grib loaded in memory
|
||||
@exception GribInternalError
|
||||
@exception GribInternalError
|
||||
"""
|
||||
err,gribid = _internal.grib_c_new_from_samples(0,samplename)
|
||||
GRIB_CHECK(err)
|
||||
|
@ -699,7 +699,7 @@ def grib_new_from_samples(samplename):
|
|||
def grib_clone(gribid_src):
|
||||
"""
|
||||
@brief Create a copy of a message.
|
||||
|
||||
|
||||
Create a copy of a given message (\em gribid_src) resulting in a new
|
||||
message in memory (\em gribid_dest) identical to the original one.
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
REDIRECT=/dev/null
|
||||
|
||||
[ -z "$GRIB_DEFINITION_PATH" ] | GRIB_DEFINITION_PATH=`${tools_dir}grib_info -d`
|
||||
[ -z "$GRIB_DEFINITION_PATH" ] | GRIB_DEFINITION_PATH=`${tools_dir}codes_info -d`
|
||||
|
||||
for file in `find $GRIB_DEFINITION_PATH -name '*.def' -print`
|
||||
do
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
. ./include.sh
|
||||
|
||||
[ -z "$GRIB_DEFINITION_PATH" ] | GRIB_DEFINITION_PATH=`${tools_dir}grib_info -d`
|
||||
[ -z "$GRIB_DEFINITION_PATH" ] | GRIB_DEFINITION_PATH=`${tools_dir}codes_info -d`
|
||||
|
||||
touch tmp$$
|
||||
for file in `find $GRIB_DEFINITION_PATH -name '*.def' -print`
|
||||
|
|
|
@ -10,7 +10,7 @@ ecbuild_add_library( TARGET grib_tools
|
|||
|
||||
list( APPEND grib_tools_bins
|
||||
grib_keys grib_histogram grib_error grib_add big2gribex
|
||||
grib_info grib_filter grib_ls grib_dump grib_merge
|
||||
codes_info grib_filter grib_ls grib_dump grib_merge
|
||||
grib2ppm grib_set grib_get grib_get_data grib_copy grib_repair
|
||||
grib_packing grib_distance grib_corruption_check
|
||||
grib_compare parser grib_count grib_index_build
|
||||
|
|
|
@ -14,7 +14,7 @@ libgrib_tools_la_SOURCES = grib_tools.c \
|
|||
dist_bin_SCRIPTS = bufr_compare_dir
|
||||
|
||||
bin_PROGRAMS = grib_keys grib_histogram grib_error grib_add big2gribex \
|
||||
grib_info grib_filter grib_ls grib_dump grib_merge \
|
||||
codes_info grib_filter grib_ls grib_dump grib_merge \
|
||||
grib2ppm grib_set grib_get grib_get_data grib_copy grib_repair \
|
||||
grib_packing grib_distance grib_corruption_check\
|
||||
grib_compare grib_list_keys parser grib_count grib_index_build grib1to2 \
|
||||
|
@ -40,12 +40,12 @@ grib_count_SOURCES = grib_count.c
|
|||
grib_packing_SOURCES = grib_packing.c
|
||||
grib_histogram_SOURCES = grib_histogram.c
|
||||
grib_distance_SOURCES = grib_distance.c
|
||||
#grib_debug_SOURCES = grib_debug.c
|
||||
#grib_debug_SOURCES = grib_debug.c
|
||||
parser_SOURCES = parser.c
|
||||
grib_list_keys_SOURCES = list_keys.c
|
||||
all_keys_SOURCES = all_keys.c
|
||||
grib2ppm_SOURCES = grib2ppm.c
|
||||
grib_info_SOURCES = grib_info.c
|
||||
codes_info_SOURCES = codes_info.c
|
||||
grib_keys_SOURCES = grib_keys.c
|
||||
grib_ls_SOURCES = grib_ls.c
|
||||
grib_copy_SOURCES = grib_copy.c
|
||||
|
|
|
@ -1,117 +0,0 @@
|
|||
/*
|
||||
* Copyright 2005-2015 ECMWF.
|
||||
*
|
||||
* This software is licensed under the terms of the Apache Licence Version 2.0
|
||||
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
|
||||
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||
*/
|
||||
|
||||
/*
|
||||
* C Implementation: grib_info
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
*/
|
||||
|
||||
#include "grib_tools.h"
|
||||
|
||||
void usage( char*);
|
||||
|
||||
#define INFO_PRINT_ALL 0
|
||||
#define INFO_PRINT_VERSION (1<<0)
|
||||
#define INFO_PRINT_DEFINITION_PATH (1<<1)
|
||||
#define INFO_PRINT_SAMPLES_PATH (1<<2)
|
||||
|
||||
int main( int argc,char* argv[]) {
|
||||
char* path=NULL;
|
||||
int c=0;
|
||||
int nfiles=0;
|
||||
unsigned long print_flags=0;
|
||||
int major=GRIB_API_MAJOR_VERSION;
|
||||
int minor=GRIB_API_MINOR_VERSION;
|
||||
int revision=GRIB_API_REVISION_VERSION;
|
||||
|
||||
while (1) {
|
||||
|
||||
c = getopt (argc, argv, "vdt");
|
||||
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case 'v':
|
||||
print_flags|=INFO_PRINT_VERSION;
|
||||
break;
|
||||
case 'd':
|
||||
print_flags|=INFO_PRINT_DEFINITION_PATH;
|
||||
break;
|
||||
case 't':
|
||||
print_flags|=INFO_PRINT_SAMPLES_PATH;
|
||||
break;
|
||||
default:
|
||||
usage(argv[0]);
|
||||
}
|
||||
}
|
||||
|
||||
nfiles=argc-optind;
|
||||
if (nfiles != 0) usage(argv[0]);
|
||||
|
||||
if (print_flags == INFO_PRINT_ALL) {
|
||||
printf("\n");
|
||||
printf("grib_api Version %d.%d.%d",
|
||||
major,minor,revision);
|
||||
if (GRIB_API_MAJOR_VERSION < 1) printf(" PRE-RELEASE");
|
||||
printf("\n");
|
||||
printf("\n");
|
||||
|
||||
|
||||
if ((path=getenv("GRIB_DEFINITION_PATH")) != NULL) {
|
||||
printf("Definition files path from environment variable");
|
||||
printf(" GRIB_DEFINITION_PATH=%s\n",path);
|
||||
} else {
|
||||
printf("Default definition files path is used: %s\n",GRIB_DEFINITION_PATH);
|
||||
printf("Definition files path can be changed setting GRIB_DEFINITION_PATH environment variable\n");
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
if ((path=getenv("GRIB_SAMPLES_PATH")) != NULL) {
|
||||
printf("SAMPLES path from environment variable");
|
||||
printf(" GRIB_SAMPLES_PATH=%s\n",path);
|
||||
} else {
|
||||
printf("Default SAMPLES path is used: %s\n",GRIB_SAMPLES_PATH);
|
||||
printf("SAMPLES path can be changed setting GRIB_SAMPLES_PATH environment variable\n");
|
||||
}
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (print_flags & INFO_PRINT_VERSION)
|
||||
printf("%d.%d.%d ",major,minor,revision);
|
||||
|
||||
if (print_flags & INFO_PRINT_DEFINITION_PATH) {
|
||||
if ((path=getenv("GRIB_DEFINITION_PATH")) != NULL) {
|
||||
printf("%s",path);
|
||||
} else {
|
||||
printf("%s",GRIB_DEFINITION_PATH);
|
||||
}
|
||||
}
|
||||
|
||||
if (print_flags & INFO_PRINT_SAMPLES_PATH) {
|
||||
if ((path=getenv("GRIB_SAMPLES_PATH")) != NULL) {
|
||||
printf("%s",path);
|
||||
} else {
|
||||
printf("%s",GRIB_SAMPLES_PATH);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void usage(char* progname) {
|
||||
printf("\nUsage: %s [-v] [-d] [-t]\n",progname);
|
||||
exit(1);
|
||||
}
|
Loading…
Reference in New Issue