Merge branch 'eccodes' of ssh://software.ecmwf.int:7999/grib/grib_api into eccodes

Conflicts:
	confluence/examples.par
	examples/F90/Makefile.am
	examples/python/Makefile.am
This commit is contained in:
Sandor Kertesz 2015-03-17 16:20:35 +00:00
commit 06f1772ed9
46 changed files with 216 additions and 167 deletions

32
.gitignore vendored
View File

@ -99,20 +99,20 @@ examples/C/bufr_print_header
examples/C/grib_get_keys examples/C/grib_get_keys
examples/C/get_data examples/C/get_data
examples/C/get_product_kind examples/C/get_product_kind
examples/C/iterator examples/C/grib_iterator
examples/C/keys_iterator examples/C/grib_keys_iterator
examples/C/large_grib1 examples/C/large_grib1
examples/C/list examples/C/list
examples/C/mars_param examples/C/mars_param
examples/C/multi examples/C/multi
examples/C/multi2 examples/C/multi2
examples/C/multi_write examples/C/multi_write
examples/C/nearest examples/C/grib_nearest
examples/C/points examples/C/points
examples/C/precision examples/C/precision
examples/C/print_data examples/C/grib_print_data
examples/C/sections_copy examples/C/sections_copy
examples/C/set examples/C/grib_set_keys
examples/C/set_bitmap examples/C/set_bitmap
examples/C/set_data examples/C/set_data
examples/C/set_missing examples/C/set_missing
@ -249,14 +249,14 @@ include
#from make #from make
examples/C/check_gaussian_grid examples/C/check_gaussian_grid
examples/C/ensemble_index examples/C/grib_ensemble_index
examples/C/clone examples/C/grib_clone
examples/C/iterator_bitmap examples/C/grib_iterator_bitmap
examples/C/new_sample examples/C/new_sample
examples/F90/f_bufr_read_header examples/F90/f_bufr_read_header
examples/F90/f_bufr_clone examples/F90/f_bufr_clone
examples/F90/f_bufr_print_header examples/F90/f_bufr_print_header
examples/F90/f_clone examples/F90/f_grib_clone
examples/F90/f_copy_message examples/F90/f_copy_message
examples/F90/f_copy_namespace examples/F90/f_copy_namespace
examples/F90/f_count_messages examples/F90/f_count_messages
@ -267,17 +267,17 @@ examples/F90/f_get_pl
examples/F90/f_get_pv examples/F90/f_get_pv
examples/F90/f_get_set_uuid examples/F90/f_get_set_uuid
examples/F90/f_index examples/F90/f_index
examples/F90/f_keys_iterator examples/F90/f_grib_keys_iterator
examples/F90/f_multi examples/F90/f_multi
examples/F90/f_multi_write examples/F90/f_multi_write
examples/F90/f_nearest examples/F90/f_grib_nearest
examples/F90/f_new_from_file examples/F90/f_new_from_file
examples/F90/f_precision examples/F90/f_precision
examples/F90/f_print_data examples/F90/f_grib_print_data
examples/F90/f_read_from_file examples/F90/f_read_from_file
examples/F90/f_read_message examples/F90/f_read_message
examples/F90/f_samples examples/F90/f_samples
examples/F90/f_set examples/F90/f_grib_set_keys
examples/F90/f_set_bitmap examples/F90/f_set_bitmap
examples/F90/f_set_gvc examples/F90/f_set_gvc
examples/F90/f_set_missing examples/F90/f_set_missing
@ -285,9 +285,9 @@ examples/F90/f_set_pv
examples/python/.libs/ examples/python/.libs/
examples/python/my.idx examples/python/my.idx
examples/python/p_count_messages examples/python/p_count_messages
examples/python/p_iterator examples/python/p_grib_iterator
examples/python/p_keys_iterator examples/python/p_grib_keys_iterator
examples/python/p_print_data examples/python/p_grib_print_data
examples/python/*.sh.log examples/python/*.sh.log
examples/python/*.sh.trs examples/python/*.sh.trs
examples/python/test-suite.log examples/python/test-suite.log

View File

@ -1,22 +1,22 @@
#examples #examples
!GRIB ( !GRIB (
clone grib_clone
ensemble_index grib_ensemble_index
get grib_get_keys
index index
iterator_bitmap grib_iterator_bitmap
iterator grib_iterator
keys_iterator grib_keys_iterator
multi_write multi_write
multi multi
nearest grib_nearest
precision precision
print_data grib_print_data
set_bitmap set_bitmap
set_data set_data
set_pv set_pv
set grib_set_keys
) )
BUFR ( BUFR (
bufr_attributes bufr_attributes

View File

@ -2,14 +2,14 @@
\example grib_get_keys.c grib_get_keys.c How to get values through the key names. \example grib_get_keys.c grib_get_keys.c How to get values through the key names.
\example set.c set.c How to set values through the key names. \example set.c set.c How to set values through the key names.
\example keys_iterator.c keys_iterator.c How to get the names of all the keys \example grib_keys_iterator.c grib_keys_iterator.c How to get the names of all the keys
defined in a message and how to iterate through them. defined in a message and how to iterate through them.
\example grib_iterator.c grib_iterator.c How to use an iterator on latitude, longitude, values. \example grib_iterator.c grib_iterator.c How to use an iterator on latitude, longitude, values.
\example precision.c precision.c How to control precision when coding a grib field. \example precision.c precision.c How to control precision when coding a grib field.
\example multi.c multi.c How to decode a grib message containing many fields. \example multi.c multi.c How to decode a grib message containing many fields.
\example multi_write.c multi_write.c How to encode a grib message containing many fields. \example multi_write.c multi_write.c How to encode a grib message containing many fields.
\example print_data.c print_data.c How to print all the data from a grib message. \example grib_print_data.c grib_print_data.c How to print all the data from a grib message.
\example nearest.c nearest.c How to find the nearest grid points. \example grib_nearest.c grib_nearest.c How to find the nearest grid points.
\example index.f90 How access a grib file through and index. \example index.f90 How access a grib file through and index.
\example grib_get_keys.f90 How to get values through the key names. \example grib_get_keys.f90 How to get values through the key names.
@ -24,13 +24,13 @@ defined in a message and how to iterate through them.
\example samples.f90 How to create a new message from a samples. \example samples.f90 How to create a new message from a samples.
\example grib_clone.f90 How to clone a message. \example grib_clone.f90 How to clone a message.
\example copy_message.f90 How to copy a message in memory and create a new message. \example copy_message.f90 How to copy a message in memory and create a new message.
\example keys_iterator.f90 How to get the names of all the keys \example grib_keys_iterator.f90 How to get the names of all the keys
defined in a message and how to iterate through them. defined in a message and how to iterate through them.
\example precision.f90 How to control precision when coding a grib field. \example precision.f90 How to control precision when coding a grib field.
\example multi_write.f90 How to encode a grib message containing many fields. \example multi_write.f90 How to encode a grib message containing many fields.
\example multi.f90 How to decode a grib message containing many fields. \example multi.f90 How to decode a grib message containing many fields.
\example print_data.f90 How to print all the data contained in a grib file. \example grib_print_data.f90 How to print all the data contained in a grib file.
\example nearest.f90 How to find the nearest grid points. \example grib_nearest.f90 How to find the nearest grid points.
\example get_fortran.F get_fortran.F How to get values through the key names. \example get_fortran.F get_fortran.F How to get values through the key names.
\example set_fortran.F set_fortran.F How to set values through the key names. \example set_fortran.F set_fortran.F How to set values through the key names.
@ -43,15 +43,15 @@ defined in a message and how to iterate through them.
\example index.py How access a grib file through and index. \example index.py How access a grib file through and index.
\example grib_get_keys.py How to get values through the key names. \example grib_get_keys.py How to get values through the key names.
\example print_data.py How to print all the data contained in a grib file. \example grib_print_data.py How to print all the data contained in a grib file.
\example set.py How to set values through the key names. \example set.py How to set values through the key names.
\example nearest.py How to find the nearest grid points. \example grib_nearest.py How to find the nearest grid points.
\example set_missing.py How to set a missing value in the header. \example set_missing.py How to set a missing value in the header.
\example count_messages.py How to count the messages in a file and loop through them. \example count_messages.py How to count the messages in a file and loop through them.
\example samples.py How to create a new message from a sample. \example samples.py How to create a new message from a sample.
\example grib_clone.py How to clone a message. \example grib_clone.py How to clone a message.
\example grib_iterator.py How to use an iterator on latitude, longitude, values. \example grib_iterator.py How to use an iterator on latitude, longitude, values.
\example keys_iterator.py How to get the names of all the keys. \example grib_keys_iterator.py How to get the names of all the keys.
\example multi_write.py How to encode a multi grib message. \example multi_write.py How to encode a multi grib message.
\example set_pv.py How to encode the pv coefficients. \example set_pv.py How to encode the pv coefficients.

View File

@ -6,15 +6,15 @@ that can be taken as a starting point to write more complex programs.\n
\section python Python \section python Python
- \ref index.py "index.py" How access a grib file through and index. - \ref index.py "index.py" How access a grib file through and index.
- \ref grib_get_keys.py "grib_get_keys.py" How to get values through the key names. - \ref grib_get_keys.py "grib_get_keys.py" How to get values through the key names.
- \ref print_data.py "print_data.py" How to print all the data contained in a grib file. - \ref grib_print_data.py "grib_print_data.py" How to print all the data contained in a grib file.
- \ref set.py "set.py" How to set values through the key names. - \ref set.py "set.py" How to set values through the key names.
- \ref nearest.py "nearest.py" How to find the nearest grid points. - \ref grib_nearest.py "grib_nearest.py" How to find the nearest grid points.
- \ref set_missing.py "set_missing.py" How to set a missing value in the header. - \ref set_missing.py "set_missing.py" How to set a missing value in the header.
- \ref count_messages.py "count_messages.py" How to count the messages in a file and loop through them. - \ref count_messages.py "count_messages.py" How to count the messages in a file and loop through them.
- \ref samples.py "samples.py" How to create a new message from a sample. - \ref samples.py "samples.py" How to create a new message from a sample.
- \ref grib_clone.py "grib_clone.py" How to clone a message. - \ref grib_clone.py "grib_clone.py" How to clone a message.
- \ref grib_iterator.py "grib_iterator.py" How to use an iterator on latitude, longitude, values. - \ref grib_iterator.py "grib_iterator.py" How to use an iterator on latitude, longitude, values.
- \ref keys_iterator.py "keys_iterator.py" How to get the names of all the keys. - \ref grib_keys_iterator.py "grib_keys_iterator.py" How to get the names of all the keys.
- \ref multi_write.py "multi_write.py" How to encode a multi grib message. - \ref multi_write.py "multi_write.py" How to encode a multi grib message.
- \ref set_pv.py "set_pv.py" How to encode the pv coefficients. - \ref set_pv.py "set_pv.py" How to encode the pv coefficients.
@ -32,24 +32,24 @@ that can be taken as a starting point to write more complex programs.\n
- \ref samples.f90 "samples.f90" how to create a new message from a template. - \ref samples.f90 "samples.f90" how to create a new message from a template.
- \ref grib_clone.f90 "grib_clone.f90" how to clone a message. - \ref grib_clone.f90 "grib_clone.f90" how to clone a message.
- \ref copy_message.f90 "copy_message.f90" how to copy a message in memory and create a new message. - \ref copy_message.f90 "copy_message.f90" how to copy a message in memory and create a new message.
- \ref keys_iterator.f90 "keys_iterator.f90" how to get the names of all the keys - \ref grib_keys_iterator.f90 "grib_keys_iterator.f90" how to get the names of all the keys
defined in a message and how to iterate through them. defined in a message and how to iterate through them.
- \ref precision.f90 "precision.f90" how to control precision when coding a grib field. - \ref precision.f90 "precision.f90" how to control precision when coding a grib field.
- \ref multi_write.f90 "multi_write.f90" how to encode a grib message containing many fields. - \ref multi_write.f90 "multi_write.f90" how to encode a grib message containing many fields.
- \ref multi.f90 "multi.f90" how to decode a grib message containing many fields. - \ref multi.f90 "multi.f90" how to decode a grib message containing many fields.
- \ref print_data.f90 "print_data.f90" how to print all the data contained in a grib file. - \ref grib_print_data.f90 "grib_print_data.f90" how to print all the data contained in a grib file.
- \ref nearest.f90 "nearest.f90" how to find the nearest grid points. - \ref grib_nearest.f90 "grib_nearest.f90" how to find the nearest grid points.
\section C \section C
- \ref grib_get_keys.c "grib_get_keys.c" is an example showing how to get values through the key names. - \ref grib_get_keys.c "grib_get_keys.c" is an example showing how to get values through the key names.
- \ref set.c "set.c" is an example illustrating how to set values through the key names. - \ref set.c "set.c" is an example illustrating how to set values through the key names.
- \ref keys_iterator.c "keys_iterator.c" explains how to get the names of all the keys - \ref grib_keys_iterator.c "grib_keys_iterator.c" explains how to get the names of all the keys
defined in a message and how to iterate through them. defined in a message and how to iterate through them.
- \ref grib_iterator.c "grib_iterator.c" shows how to use an iterator on latitude, longitude, values. - \ref grib_iterator.c "grib_iterator.c" shows how to use an iterator on latitude, longitude, values.
- \ref precision.c "precision.c" illustrates how to control precision when coding a grib field. - \ref precision.c "precision.c" illustrates how to control precision when coding a grib field.
- \ref multi.c "multi.c" is an example describing how to decode a grib message containing many fields. - \ref multi.c "multi.c" is an example describing how to decode a grib message containing many fields.
- \ref print_data.c "print_data.c" is an example on how to print all the data contained in a grib file. - \ref grib_print_data.c "grib_print_data.c" is an example on how to print all the data contained in a grib file.
- \ref nearest.c "nearest.c" is an example on how to find the nearest grid points. - \ref grib_nearest.c "grib_nearest.c" is an example on how to find the nearest grid points.
- \ref multi_write.c "multi_write.c" how to encode a grib message containing many fields. - \ref multi_write.c "multi_write.c" how to encode a grib message containing many fields.
\section fortran77 Fortran 77 \section fortran77 Fortran 77

View File

@ -7,14 +7,14 @@ configure_file( include.ctest.sh.in include.ctest.sh @ONLY )
# Build the executables used by test scripts # Build the executables used by test scripts
################################################ ################################################
list( APPEND test_bins list( APPEND test_bins
nearest grib_nearest
set_bitmap set_bitmap
grib_iterator grib_iterator
grib_get_keys grib_get_keys
print_data grib_print_data
set grib_set_keys
set_missing set_missing
keys_iterator grib_keys_iterator
set_data set_data
mars_param mars_param
values_check values_check
@ -27,11 +27,11 @@ list( APPEND test_bins
list list
get_data get_data
sections_copy sections_copy
iterator_bitmap grib_iterator_bitmap
large_grib1 large_grib1
grib_clone grib_clone
check_gaussian_grid check_gaussian_grid
ensemble_index grib_ensemble_index
get_product_kind get_product_kind
bufr_attributes bufr_attributes
bufr_clone bufr_clone
@ -58,9 +58,9 @@ endforeach()
list( APPEND tests list( APPEND tests
grib_iterator grib_iterator
grib_get_keys grib_get_keys
print_data grib_print_data
set grib_set_keys
keys_iterator grib_keys_iterator
multi multi
multi_write multi_write
precision precision

View File

@ -1,17 +1,19 @@
AM_CFLAGS = @WARN_PEDANTIC@ @WERROR@ AM_CFLAGS = @WARN_PEDANTIC@ @WERROR@
TESTS = grib_iterator.sh grib_get_keys.sh print_data.sh set.sh keys_iterator.sh multi.sh multi_write.sh \ TESTS = grib_iterator.sh grib_get_keys.sh grib_print_data.sh grib_set_keys.sh \
precision.sh list.sh large_grib1.sh get_data.sh sections_copy.sh set_missing.sh grib_clone.sh set_pv.sh \ grib_keys_iterator.sh multi.sh multi_write.sh precision.sh \
check_gaussian_grids.sh \ list.sh large_grib1.sh get_data.sh sections_copy.sh \
bufr_attributes.sh bufr_clone.sh bufr_expanded.sh bufr_get_keys.sh bufr_read_header.sh bufr_read_synop.sh \ set_missing.sh grib_clone.sh set_pv.sh \
bufr_set_keys.sh bufr_subset.sh bufr_keys_iterator.sh bufr_missing.sh bufr_read_temp.sh \ check_gaussian_grids.sh bufr_attributes.sh bufr_clone.sh bufr_expanded.sh \
get_product_kind.sh bufr_get_keys.sh bufr_read_header.sh bufr_read_synop.sh \
bufr_set_keys.sh bufr_subset.sh bufr_keys_iterator.sh bufr_missing.sh \
bufr_read_temp.sh get_product_kind.sh
noinst_PROGRAMS = nearest set_bitmap grib_iterator grib_get_keys print_data set set_missing keys_iterator \ noinst_PROGRAMS = grib_nearest set_bitmap grib_iterator grib_get_keys grib_print_data grib_set_keys set_missing grib_keys_iterator \
set_data mars_param values_check box multi multi2 multi_write precision \ set_data mars_param values_check box multi multi2 multi_write precision \
set_pv list sections_copy large_grib1 get_data iterator_bitmap grib_clone new_sample \ set_pv list sections_copy large_grib1 get_data grib_iterator_bitmap grib_clone new_sample \
check_gaussian_grid ensemble_index points \ check_gaussian_grid grib_ensemble_index points \
bufr_attributes bufr_clone bufr_expanded bufr_get_keys bufr_read_header bufr_read_synop \ bufr_attributes bufr_clone bufr_expanded bufr_get_keys bufr_read_header bufr_read_synop \
bufr_get_keys bufr_subset bufr_keys_iterator bufr_set_keys bufr_missing bufr_read_temp \ bufr_get_keys bufr_subset bufr_keys_iterator bufr_set_keys bufr_missing bufr_read_temp \
get_product_kind get_product_kind
@ -22,18 +24,18 @@ box_SOURCES = box.c
set_data_SOURCES = set_data.c set_data_SOURCES = set_data.c
mars_param_SOURCES = mars_param.c mars_param_SOURCES = mars_param.c
values_check_SOURCES = values_check.c values_check_SOURCES = values_check.c
nearest_SOURCES = nearest.c grib_nearest_SOURCES = grib_nearest.c
multi_write_SOURCES = multi_write.c multi_write_SOURCES = multi_write.c
grib_get_keys_SOURCES = grib_get_keys.c grib_get_keys_SOURCES = grib_get_keys.c
print_data_SOURCES = print_data.c grib_print_data_SOURCES = grib_print_data.c
set_SOURCES = set.c grib_set_keys_SOURCES = grib_set_keys.c
set_missing_SOURCES = set_missing.c set_missing_SOURCES = set_missing.c
set_bitmap_SOURCES = set_bitmap.c set_bitmap_SOURCES = set_bitmap.c
multi_SOURCES = multi.c multi_SOURCES = multi.c
multi2_SOURCES = multi2.c multi2_SOURCES = multi2.c
keys_iterator_SOURCES = keys_iterator.c grib_keys_iterator_SOURCES = grib_keys_iterator.c
grib_iterator_SOURCES = grib_iterator.c grib_iterator_SOURCES = grib_iterator.c
iterator_bitmap_SOURCES = iterator_bitmap.c grib_iterator_bitmap_SOURCES = grib_iterator_bitmap.c
set_pv_SOURCES = set_pv.c set_pv_SOURCES = set_pv.c
points_SOURCES = points.c points_SOURCES = points.c
list_SOURCES = list.c list_SOURCES = list.c
@ -43,7 +45,7 @@ get_data_SOURCES = get_data.c
grib_clone_SOURCES = grib_clone.c grib_clone_SOURCES = grib_clone.c
new_sample_SOURCES = new_sample.c new_sample_SOURCES = new_sample.c
check_gaussian_grid_SOURCES = check_gaussian_grid.c check_gaussian_grid_SOURCES = check_gaussian_grid.c
ensemble_index_SOURCES = ensemble_index.c grib_ensemble_index_SOURCES = grib_ensemble_index.c
bufr_attributes_SOURCES = bufr_attributes.c bufr_attributes_SOURCES = bufr_attributes.c
bufr_clone_SOURCES = bufr_clone.c bufr_clone_SOURCES = bufr_clone.c
bufr_expanded_SOURCES = bufr_expanded.c bufr_expanded_SOURCES = bufr_expanded.c

View File

@ -9,12 +9,12 @@
*/ */
/* /*
* C Implementation: keys_iterator * C Implementation: grib_keys_iterator
* *
* Description: * Description:
* Example on how to use keys_iterator functions and the * Example on how to use keys_iterator functions and the
* codes_keys_iterator structure to get all the available * codes_keys_iterator structure to get all the available
* keys in a message. * keys in a GRIB message.
* *
*/ */

View File

@ -9,7 +9,7 @@
. ./include.sh . ./include.sh
${examples_dir}keys_iterator ${data_dir}/reduced_latlon_surface.grib1 > /dev/null ${examples_dir}grib_keys_iterator ${data_dir}/reduced_latlon_surface.grib1 > /dev/null
${examples_dir}keys_iterator ${data_dir}/regular_gaussian_model_level.grib1 > /dev/null ${examples_dir}grib_keys_iterator ${data_dir}/regular_gaussian_model_level.grib1 > /dev/null

View File

@ -9,9 +9,9 @@
*/ */
/* /*
* C Implementation: print_data * C Implementation: grib_print_data
* *
* Description: prints all the data contained in a grib file * Description: prints all the data contained in a GRIB file
* *
*/ */
#include <stdio.h> #include <stdio.h>

View File

@ -9,7 +9,7 @@
. ./include.sh . ./include.sh
numberOfValues=`${examples_dir}print_data ../../data/constant_field.grib1 | grep values | awk '{print $1}'` numberOfValues=`${examples_dir}grib_print_data ../../data/constant_field.grib1 | grep values | awk '{print $1}'`
if [ $numberOfValues -ne 99200 ] if [ $numberOfValues -ne 99200 ]
then then

View File

@ -9,9 +9,9 @@
*/ */
/* /*
* C Implementation: set * C Implementation: grib_set_keys
* *
* Description: how to set key values. * Description: how to set key values in GRIB messages
* *
*/ */
#include <stdio.h> #include <stdio.h>

View File

@ -9,6 +9,6 @@
. ./include.sh . ./include.sh
${examples_dir}set > /dev/null ${examples_dir}grib_set_keys > /dev/null
rm -f out.set.grib1 rm -f out.set.grib1

View File

@ -13,13 +13,13 @@ list( APPEND tests
get_data get_data
get_pl get_pl
get_pv get_pv
keys_iterator grib_keys_iterator
multi_write multi_write
multi multi
nearest grib_nearest
precision precision
print_data grib_print_data
set grib_set_keys
set_bitmap set_bitmap
set_missing set_missing
set_pv set_pv

View File

@ -1,17 +1,18 @@
AM_CFLAGS = @WARN_PEDANTIC@ @WERROR@ @FORCE_32_CFLAGS@ AM_CFLAGS = @WARN_PEDANTIC@ @WERROR@ @FORCE_32_CFLAGS@
TESTS = copy_message.sh grib_get_keys.sh get_data.sh get_pl.sh get_pv.sh keys_iterator.sh \ TESTS = copy_message.sh grib_get_keys.sh get_data.sh get_pl.sh get_pv.sh grib_keys_iterator.sh \
nearest.sh precision.sh multi_write.sh multi.sh print_data.sh set.sh set_bitmap.sh set_missing.sh \ grib_nearest.sh precision.sh multi_write.sh multi.sh grib_print_data.sh grib_set_keys.sh \
set_pv.sh samples.sh count_messages.sh read_message.sh read_from_file.sh index.sh get_set_uuid.sh \ set_bitmap.sh set_missing.sh set_pv.sh samples.sh count_messages.sh read_message.sh \
bufr_attributes.sh bufr_clone.sh bufr_expanded.sh bufr_get_keys.sh bufr_read_header.sh bufr_read_synop.sh bufr_set_keys.sh \ read_from_file.sh index.sh get_set_uuid.sh bufr_attributes.sh bufr_clone.sh \
bufr_keys_iterator.sh bufr_subset.sh get_product_kind.sh bufr_read_temp.sh bufr_expanded.sh bufr_get_keys.sh bufr_print_header.sh bufr_print_data.sh \
bufr_set_keys.sh bufr_keys_iterator.sh bufr_subset.sh get_product_kind.sh bufr_read_temp.sh
noinst_PROGRAMS = f_index f_copy_message f_grib_get_keys f_get_data f_get_pl f_get_pv f_keys_iterator \ noinst_PROGRAMS = f_index f_copy_message f_grib_get_keys f_get_data f_get_pl f_get_pv f_grib_keys_iterator \
f_multi_write f_multi f_nearest f_precision f_print_data f_set f_set_bitmap f_set_missing \ f_multi_write f_multi f_grib_nearest f_precision f_grib_print_data f_grib_set_keys f_set_bitmap f_set_missing \
f_set_pv f_samples f_count_messages f_read_message f_read_from_file f_new_from_file \ f_set_pv f_samples f_count_messages f_read_message f_read_from_file f_new_from_file \
f_copy_namespace f_get_set_uuid f_set_gvc f_grib_clone f_bufr_clone f_bufr_expanded f_bufr_get_keys \ f_copy_namespace f_get_set_uuid f_set_gvc f_grib_clone f_bufr_clone f_bufr_expanded f_bufr_get_keys \
f_bufr_read_header f_bufr_read_synop f_bufr_set_keys f_bufr_keys_iterator f_bufr_subset f_bufr_attributes \ f_bufr_print_header f_bufr_print_data f_bufr_set_keys f_bufr_keys_iterator f_bufr_subset f_bufr_attributes \
f_get_product_kind f_bufr_read_temp f_get_product_kind f_bufr_read_temp
f_index_SOURCES=index.f90 f_index_SOURCES=index.f90
@ -20,13 +21,13 @@ f_grib_get_keys_SOURCES=grib_get_keys.f90
f_get_data_SOURCES=get_data.f90 f_get_data_SOURCES=get_data.f90
f_get_pl_SOURCES=get_pl.f90 f_get_pl_SOURCES=get_pl.f90
f_get_pv_SOURCES=get_pv.f90 f_get_pv_SOURCES=get_pv.f90
f_keys_iterator_SOURCES=keys_iterator.f90 f_grib_keys_iterator_SOURCES=grib_keys_iterator.f90
f_multi_write_SOURCES=multi_write.f90 f_multi_write_SOURCES=multi_write.f90
f_multi_SOURCES=multi.f90 f_multi_SOURCES=multi.f90
f_nearest_SOURCES=nearest.f90 f_grib_nearest_SOURCES=grib_nearest.f90
f_precision_SOURCES=precision.f90 f_precision_SOURCES=precision.f90
f_print_data_SOURCES=print_data.f90 f_grib_print_data_SOURCES=grib_print_data.f90
f_set_SOURCES=set.f90 f_grib_set_keys_SOURCES=grib_set_keys.f90
f_set_bitmap_SOURCES=set_bitmap.f90 f_set_bitmap_SOURCES=set_bitmap.f90
f_set_missing_SOURCES=set_missing.f90 f_set_missing_SOURCES=set_missing.f90
f_set_pv_SOURCES=set_pv.f90 f_set_pv_SOURCES=set_pv.f90
@ -44,8 +45,8 @@ f_bufr_clone_SOURCES=bufr_clone.f90
f_bufr_expanded_SOURCES=bufr_expanded.f90 f_bufr_expanded_SOURCES=bufr_expanded.f90
f_bufr_get_keys_SOURCES=bufr_get_keys.f90 f_bufr_get_keys_SOURCES=bufr_get_keys.f90
f_bufr_keys_iterator_SOURCES=bufr_keys_iterator.f90 f_bufr_keys_iterator_SOURCES=bufr_keys_iterator.f90
f_bufr_read_header_SOURCES=bufr_read_header.f90 f_bufr_print_header_SOURCES=bufr_print_header.f90
f_bufr_read_synop_SOURCES=bufr_read_synop.f90 f_bufr_print_data_SOURCES=bufr_print_data.f90
f_bufr_read_temp_SOURCES=bufr_read_temp.f90 f_bufr_read_temp_SOURCES=bufr_read_temp.f90
f_bufr_set_keys_SOURCES=bufr_set_keys.f90 f_bufr_set_keys_SOURCES=bufr_set_keys.f90
f_bufr_subset_SOURCES=bufr_subset.f90 f_bufr_subset_SOURCES=bufr_subset.f90

View File

@ -9,4 +9,4 @@
. ./include.sh . ./include.sh
${examples_dir}f_nearest > /dev/null ${examples_dir}f_grib_keys_iterator > /dev/null

View File

@ -11,7 +11,6 @@
! !
! !
! !
!
program find program find
use eccodes use eccodes
implicit none implicit none

View File

@ -9,4 +9,4 @@
. ./include.sh . ./include.sh
${examples_dir}f_print_data > /dev/null ${examples_dir}f_grib_nearest > /dev/null

View File

@ -7,7 +7,7 @@
! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. ! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
! !
! !
! Description: prints all the data contained in a grib file ! Description: prints all the data contained in a GRIB file
! !
! !
! !

View File

@ -9,4 +9,4 @@
. ./include.sh . ./include.sh
${examples_dir}f_keys_iterator > /dev/null ${examples_dir}f_grib_print_data > /dev/null

View File

@ -7,9 +7,7 @@
! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. ! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
! !
! !
! ! Description: how to set key values in GRIB messages
! Description: how to set key values.
!
! !
! !
program set program set
@ -19,7 +17,6 @@ program set
integer :: infile,outfile integer :: infile,outfile
integer :: igrib integer :: igrib
centre = 80 centre = 80
call current_date(date1) call current_date(date1)
call codes_open_file(infile, & call codes_open_file(infile, &

View File

@ -9,7 +9,7 @@
. ./include.sh . ./include.sh
${examples_dir}f_set > /dev/null ${examples_dir}f_grib_set_keys > /dev/null
${examples_dir}f_set_gvc > /dev/null ${examples_dir}f_set_gvc > /dev/null
[ -f out_gvc.grib2 ] [ -f out_gvc.grib2 ]

View File

@ -7,8 +7,8 @@ configure_file( include.ctest.sh.in include.ctest.sh @ONLY )
# Build the executables used by test scripts # Build the executables used by test scripts
################################################ ################################################
list( APPEND test_bins list( APPEND test_bins
keys_iterator grib_keys_iterator
print_data grib_print_data
grib_iterator grib_iterator
count_messages count_messages
) )
@ -30,12 +30,12 @@ list( APPEND tests
grib_get_keys grib_get_keys
index index
grib_iterator grib_iterator
keys_iterator grib_keys_iterator
multi_write multi_write
nearest grib_nearest
print_data grib_print_data
samples samples
set grib_set_keys
set_missing set_missing
binary_message binary_message
set_bitmap set_bitmap

View File

@ -1,15 +1,17 @@
if WITH_PYTHON if WITH_PYTHON
AM_CFLAGS = @WARN_PEDANTIC@ @WERROR@ AM_CFLAGS = @WARN_PEDANTIC@ @WERROR@
TESTS = grib_clone.sh count_messages.sh grib_get_keys.sh index.sh grib_iterator.sh keys_iterator.sh multi_write.sh nearest.sh print_data.sh \ TESTS = grib_clone.sh count_messages.sh grib_get_keys.sh index.sh grib_iterator.sh \
samples.sh set.sh set_missing.sh binary_message.sh set_bitmap.sh bufr_read_header.sh bufr_read_synop.sh \ grib_keys_iterator.sh multi_write.sh grib_nearest.sh grib_print_data.sh \
bufr_clone.sh bufr_get_keys.sh bufr_set_keys.sh bufr_expanded.sh bufr_keys_iterator.sh bufr_subset.sh \ samples.sh grib_set_keys.sh set_missing.sh binary_message.sh set_bitmap.sh \
bufr_print_header.sh bufr_print_data.sh bufr_clone.sh bufr_get_keys.sh \
bufr_set_keys.sh bufr_expanded.sh bufr_keys_iterator.sh bufr_subset.sh \
bufr_attributes.sh get_product_kind.sh bufr_read_temp.sh bufr_attributes.sh get_product_kind.sh bufr_read_temp.sh
TESTS_ENVIRONMENT = TOPBUILDDIR=$(top_builddir) PYTHON=$(PYTHON) TESTS_ENVIRONMENT = TOPBUILDDIR=$(top_builddir) PYTHON=$(PYTHON)
noinst_PROGRAMS = p_keys_iterator p_print_data p_grib_iterator p_count_messages noinst_PROGRAMS = p_grib_keys_iterator p_grib_print_data p_grib_iterator p_count_messages
p_keys_iterator_SOURCES = keys_iterator.c p_grib_keys_iterator_SOURCES = grib_keys_iterator.c
p_print_data_SOURCES = print_data.c p_grib_print_data_SOURCES = grib_print_data.c
p_grib_iterator_SOURCES = grib_iterator.c p_grib_iterator_SOURCES = grib_iterator.c
p_count_messages_SOURCES = count_messages.c p_count_messages_SOURCES = count_messages.c
INCLUDES = -I$(top_builddir)/src INCLUDES = -I$(top_builddir)/src
@ -17,9 +19,9 @@ LDADD = $(top_builddir)/src/libeccodes.la
DEPENDENCIES = $(LDADD) DEPENDENCIES = $(LDADD)
EXTRA_DIST = $(TESTS) include.sh grib_clone.py count_messages.py grib_get_keys.py index.py grib_iterator.py \ EXTRA_DIST = $(TESTS) include.sh grib_clone.py count_messages.py grib_get_keys.py index.py grib_iterator.py \
keys_iterator.py multi_write.py \ grib_keys_iterator.py multi_write.py \
nearest.py print_data.py samples.py set.py set_missing.py binary_message.py set_pv.py set_bitmap.py \ grib_nearest.py grib_print_data.py samples.py grib_set_keys.py set_missing.py binary_message.py set_pv.py set_bitmap.py \
bufr_read_header.py bufr_read_synop.py bufr_clone.py bufr_get_keys.py bufr_set_keys.py \ bufr_print_header.py bufr_print_data.py bufr_clone.py bufr_get_keys.py bufr_set_keys.py \
bufr_expanded.py bufr_keys_iterator.py bufr_subset.py bufr_attributes.py \ bufr_expanded.py bufr_keys_iterator.py bufr_subset.py bufr_attributes.py \
get_product_kind.py bufr_read_temp.py \ get_product_kind.py bufr_read_temp.py \
CMakeLists.txt include.ctest.sh.in CMakeLists.txt include.ctest.sh.in

View File

@ -9,13 +9,12 @@
*/ */
/* /*
* C Implementation: keys_iterator * C Implementation: grib_keys_iterator
* *
* Description: * Description:
* Example on how to use keys_iterator functions and the * Example on how to use keys_iterator functions and the
* grib_keys_iterator structure to get all the available * grib_keys_iterator structure to get all the available
* keys in a message. * keys in a GRIB message.
*
* *
* *
*/ */

View File

@ -0,0 +1,12 @@
#!/bin/sh
. ./include.sh
TEMP1=temp1.$$
TEMP2=temp2.$$
$PYTHON grib_keys_iterator.py 2> $TEMP1 > $TEMP1
./p_grib_keys_iterator ../../data/reduced_latlon_surface.grib1 2> $TEMP2 > $TEMP2
diff $TEMP1 $TEMP2
rm $TEMP1 $TEMP2 || true

View File

@ -0,0 +1,6 @@
#!/bin/sh
. ./include.sh
REDIRECT=/dev/null
$PYTHON grib_nearest.py 2> $REDIRECT > $REDIRECT

View File

@ -9,10 +9,9 @@
*/ */
/* /*
* C Implementation: print_data * C Implementation: grib_print_data
*
* Description: prints all the data contained in a grib file
* *
* Description: prints all the data contained in a GRIB file
* *
* *
*/ */

View File

@ -0,0 +1,12 @@
#!/bin/sh
. ./include.sh
TEMP1=temp1.$$
TEMP2=temp2.$$
$PYTHON grib_print_data.py 2> $TEMP1 > $TEMP1
./p_grib_print_data ../../data/regular_latlon_surface.grib1 2> $TEMP2 > $TEMP2
diff $TEMP1 $TEMP2
rm $TEMP1 $TEMP2 || true

View File

@ -3,5 +3,5 @@
. ./include.sh . ./include.sh
REDIRECT=/dev/null REDIRECT=/dev/null
$PYTHON set.py 2> $REDIRECT > $REDIRECT $PYTHON grib_set_keys.py 2> $REDIRECT > $REDIRECT
rm -f out.set.grib || true rm -f out.set.grib || true

View File

@ -1,12 +0,0 @@
#!/bin/sh
. ./include.sh
TEMP1=temp1.$$
TEMP2=temp2.$$
$PYTHON keys_iterator.py 2> $TEMP1 > $TEMP1
./p_keys_iterator ../../data/reduced_latlon_surface.grib1 2> $TEMP2 > $TEMP2
diff $TEMP1 $TEMP2
rm $TEMP1 $TEMP2 || true

View File

@ -1,6 +0,0 @@
#!/bin/sh
. ./include.sh
REDIRECT=/dev/null
$PYTHON nearest.py 2> $REDIRECT > $REDIRECT

View File

@ -1,12 +0,0 @@
#!/bin/sh
. ./include.sh
TEMP1=temp1.$$
TEMP2=temp2.$$
$PYTHON print_data.py 2> $TEMP1 > $TEMP1
./p_print_data ../../data/regular_latlon_surface.grib1 2> $TEMP2 > $TEMP2
diff $TEMP1 $TEMP2
rm $TEMP1 $TEMP2 || true

View File

@ -56,7 +56,7 @@ module eccodes
!> exit with an error message.\n Otherwise the error message can be !> exit with an error message.\n Otherwise the error message can be
!> gathered with @ref codes_get_error_string. !> gathered with @ref codes_get_error_string.
!> !>
!> \b Examples: \ref nearest.f90 "nearest.f90" !> \b Examples: \ref grib_nearest.f90 "grib_nearest.f90"
!> !>
!> @see codes_new_from_file, codes_release, codes_get !> @see codes_new_from_file, codes_release, codes_get
!> !>
@ -96,7 +96,7 @@ module eccodes
!> exit with an error message.\n Otherwise the error message can be !> exit with an error message.\n Otherwise the error message can be
!> gathered with @ref codes_get_error_string. !> gathered with @ref codes_get_error_string.
!> !>
!> \b Examples: \ref nearest.f90 "nearest.f90" !> \b Examples: \ref grib_nearest.f90 "grib_nearest.f90"
!> !>
!> @param[in] gribid id of the grib loaded in memory !> @param[in] gribid id of the grib loaded in memory
!> @param[in] is_lsm .true. if the nearest land point is required otherwise .false. !> @param[in] is_lsm .true. if the nearest land point is required otherwise .false.

View File

@ -52,7 +52,7 @@ module grib_api
!> exit with an error message.\n Otherwise the error message can be !> exit with an error message.\n Otherwise the error message can be
!> gathered with @ref grib_get_error_string. !> gathered with @ref grib_get_error_string.
!> !>
!> \b Examples: \ref nearest.f90 "nearest.f90" !> \b Examples: \ref grib_nearest.f90 "grib_nearest.f90"
!> !>
!> @see grib_new_from_file, grib_release, grib_get !> @see grib_new_from_file, grib_release, grib_get
!> !>
@ -92,7 +92,7 @@ module grib_api
!> exit with an error message.\n Otherwise the error message can be !> exit with an error message.\n Otherwise the error message can be
!> gathered with @ref grib_get_error_string. !> gathered with @ref grib_get_error_string.
!> !>
!> \b Examples: \ref nearest.f90 "nearest.f90" !> \b Examples: \ref grib_nearest.f90 "grib_nearest.f90"
!> !>
!> @param[in] gribid id of the grib loaded in memory !> @param[in] gribid id of the grib loaded in memory
!> @param[in] is_lsm .true. if the nearest land point is required otherwise .false. !> @param[in] is_lsm .true. if the nearest land point is required otherwise .false.

View File

@ -372,7 +372,7 @@ def grib_write(gribid, fileobj):
""" """
@brief Write a message to a file. @brief Write a message to a file.
\b Examples: \ref set.py "set.py" \b Examples: \ref grib_set_keys.py "grib_set_keys.py"
@param gribid id of the grib loaded in memory @param gribid id of the grib loaded in memory
@param fileobj python file object @param fileobj python file object
@ -599,7 +599,7 @@ def grib_keys_iterator_next(iterid):
""" """
@brief Advance to the next keys iterator value. @brief Advance to the next keys iterator value.
\b Examples: \ref keys_iterator.py "keys_iterator.py" \b Examples: \ref grib_keys_iterator.py "grib_keys_iterator.py"
@param iterid keys iterator id created with @ref grib_keys_iterator_new @param iterid keys iterator id created with @ref grib_keys_iterator_new
@exception GribInternalError @exception GribInternalError
@ -614,7 +614,7 @@ def grib_keys_iterator_delete(iterid):
""" """
@brief Delete a keys iterator and free memory. @brief Delete a keys iterator and free memory.
\b Examples: \ref keys_iterator.py "keys_iterator.py" \b Examples: \ref grib_keys_iterator.py "grib_keys_iterator.py"
@param iterid keys iterator id created with @ref grib_keys_iterator_new @param iterid keys iterator id created with @ref grib_keys_iterator_new
@exception GribInternalError @exception GribInternalError
@ -626,7 +626,7 @@ def grib_keys_iterator_get_name(iterid):
""" """
@brief Get the name of a key from a keys iterator. @brief Get the name of a key from a keys iterator.
\b Examples: \ref keys_iterator.py "keys_iterator.py" \b Examples: \ref grib_keys_iterator.py "grib_keys_iterator.py"
@param iterid keys iterator id created with @ref grib_keys_iterator_new @param iterid keys iterator id created with @ref grib_keys_iterator_new
@return key name to be retrieved @return key name to be retrieved
@ -1345,7 +1345,7 @@ def grib_find_nearest(gribid,inlat,inlon,is_lsm = False,npoints = 1):
The number of nearest points returned can be controled through the npoints function argument. The number of nearest points returned can be controled through the npoints function argument.
\b Examples: \ref nearest.py "nearest.py" \b Examples: \ref grib_nearest.py "grib_nearest.py"
@param gribid id of the grib loaded in memory @param gribid id of the grib loaded in memory
@param inlat latitude of the point @param inlat latitude of the point
@ -1510,7 +1510,7 @@ def grib_set(gribid,key,value):
The input value can be a python int, float or str. The input value can be a python int, float or str.
\b Examples: \ref set.py "set.py" \b Examples: \ref grib_set_keys.py "grib_set_keys.py"
@see grib_new_from_file, grib_release, grib_get @see grib_new_from_file, grib_release, grib_get

View File

@ -42,6 +42,7 @@ list( APPEND tests2
bufr_filter bufr_filter
bufr_json bufr_json
bufr_ls bufr_ls
gts_ls
bufr_set bufr_set
ieee ieee
grib1to2 grib1to2

View File

@ -1,6 +1,7 @@
TESTS = definitions.sh calendar.sh \ TESTS = definitions.sh calendar.sh \
bufrdc_desc_ref.sh bufrdc_ref.sh bufr_dump.sh bufr_filter.sh \ bufrdc_desc_ref.sh bufrdc_ref.sh bufr_dump.sh bufr_filter.sh \
bufr_json.sh bufr_compare.sh bufr_copy.sh bufr_count.sh bufr_get.sh bufr_ls.sh bufr_set.sh \ bufr_json.sh bufr_compare.sh bufr_copy.sh bufr_count.sh bufr_get.sh bufr_ls.sh bufr_set.sh \
gts_ls.sh \
ieee.sh grib1to2.sh \ ieee.sh grib1to2.sh \
unit_tests.sh \ unit_tests.sh \
grib2to1.sh badgrib.sh ls.sh filter.sh \ grib2to1.sh badgrib.sh ls.sh filter.sh \

48
tests/gts_ls.sh Executable file
View File

@ -0,0 +1,48 @@
#!/bin/sh
# 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.
#
. ./include.sh
#Enter data dir
cd ${data_dir}/gts
#Define a common label for all the tmp files
label="gts_ls_test"
#Create log file
fLog=${label}".log"
rm -f $fLog
touch $fLog
#Define tmp file
fTmp=${label}".tmp.txt"
rm -f $fTmp
#----------------------------------------------
# Test default "ls" on all the gts data files
#----------------------------------------------
gts_file=EGRR20150317121020_00493212.DAT
f=$gts_file
echo $f >> $fLog
${tools_dir}/gts_ls $f >> $fLog
#-------------------------------------------
# Test "-p" switch
#-------------------------------------------
ref_ls=$f".ls.ref"
res_ls=$f".ls.test"
REDIRECT=/dev/null
${tools_dir}/gts_ls -p TT,AA,II,CCCC,YY,GG,gg,BBB $f 2> $REDIRECT > $res_ls
diff $ref_ls $res_ls >$REDIRECT 2> $REDIRECT
rm -f $fLog $res_ls