diff --git a/.gitignore b/.gitignore index 25133b5f6..e50e14d2b 100644 --- a/.gitignore +++ b/.gitignore @@ -99,20 +99,20 @@ examples/C/bufr_print_header examples/C/grib_get_keys examples/C/get_data examples/C/get_product_kind -examples/C/iterator -examples/C/keys_iterator +examples/C/grib_iterator +examples/C/grib_keys_iterator examples/C/large_grib1 examples/C/list examples/C/mars_param examples/C/multi examples/C/multi2 examples/C/multi_write -examples/C/nearest +examples/C/grib_nearest examples/C/points examples/C/precision -examples/C/print_data +examples/C/grib_print_data examples/C/sections_copy -examples/C/set +examples/C/grib_set_keys examples/C/set_bitmap examples/C/set_data examples/C/set_missing @@ -249,14 +249,14 @@ include #from make examples/C/check_gaussian_grid -examples/C/ensemble_index -examples/C/clone -examples/C/iterator_bitmap +examples/C/grib_ensemble_index +examples/C/grib_clone +examples/C/grib_iterator_bitmap examples/C/new_sample examples/F90/f_bufr_read_header examples/F90/f_bufr_clone examples/F90/f_bufr_print_header -examples/F90/f_clone +examples/F90/f_grib_clone examples/F90/f_copy_message examples/F90/f_copy_namespace examples/F90/f_count_messages @@ -267,17 +267,17 @@ examples/F90/f_get_pl examples/F90/f_get_pv examples/F90/f_get_set_uuid examples/F90/f_index -examples/F90/f_keys_iterator +examples/F90/f_grib_keys_iterator examples/F90/f_multi examples/F90/f_multi_write -examples/F90/f_nearest +examples/F90/f_grib_nearest examples/F90/f_new_from_file 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_message examples/F90/f_samples -examples/F90/f_set +examples/F90/f_grib_set_keys examples/F90/f_set_bitmap examples/F90/f_set_gvc examples/F90/f_set_missing @@ -285,9 +285,9 @@ examples/F90/f_set_pv examples/python/.libs/ examples/python/my.idx examples/python/p_count_messages -examples/python/p_iterator -examples/python/p_keys_iterator -examples/python/p_print_data +examples/python/p_grib_iterator +examples/python/p_grib_keys_iterator +examples/python/p_grib_print_data examples/python/*.sh.log examples/python/*.sh.trs examples/python/test-suite.log diff --git a/confluence/examples.par b/confluence/examples.par index 4765c7cdd..7f591abbb 100644 --- a/confluence/examples.par +++ b/confluence/examples.par @@ -1,22 +1,22 @@ #examples !GRIB ( - clone - ensemble_index - get + grib_clone + grib_ensemble_index + grib_get_keys index - iterator_bitmap - iterator - keys_iterator + grib_iterator_bitmap + grib_iterator + grib_keys_iterator multi_write multi - nearest + grib_nearest precision - print_data + grib_print_data set_bitmap set_data set_pv - set + grib_set_keys ) BUFR ( bufr_attributes diff --git a/doxygen/examples.dox b/doxygen/examples.dox index 4f7312ee5..19b0306cc 100644 --- a/doxygen/examples.dox +++ b/doxygen/examples.dox @@ -2,14 +2,14 @@ \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 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. \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 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 print_data.c 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_print_data.c grib_print_data.c How to print all the data from a grib message. +\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 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 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 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. \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.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 nearest.f90 How to find the nearest grid points. +\example grib_print_data.f90 How to print all the data contained in a grib file. +\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 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 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 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 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 grib_clone.py How to clone a message. \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 set_pv.py How to encode the pv coefficients. diff --git a/doxygen/grib_examples.dox b/doxygen/grib_examples.dox index a972c36f9..c17380947 100644 --- a/doxygen/grib_examples.dox +++ b/doxygen/grib_examples.dox @@ -6,15 +6,15 @@ that can be taken as a starting point to write more complex programs.\n \section python Python - \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 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 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 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 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 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 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 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 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. - \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.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 nearest.f90 "nearest.f90" how to find the nearest grid points. +- \ref grib_print_data.f90 "grib_print_data.f90" how to print all the data contained in a grib file. +- \ref grib_nearest.f90 "grib_nearest.f90" how to find the nearest grid points. \section C - \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 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. - \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 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 nearest.c "nearest.c" is an example on how to find the nearest grid points. +- \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 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. \section fortran77 Fortran 77 diff --git a/examples/C/CMakeLists.txt b/examples/C/CMakeLists.txt index 6b7abea5d..406732fb0 100644 --- a/examples/C/CMakeLists.txt +++ b/examples/C/CMakeLists.txt @@ -7,14 +7,14 @@ configure_file( include.ctest.sh.in include.ctest.sh @ONLY ) # Build the executables used by test scripts ################################################ list( APPEND test_bins - nearest + grib_nearest set_bitmap grib_iterator grib_get_keys - print_data - set + grib_print_data + grib_set_keys set_missing - keys_iterator + grib_keys_iterator set_data mars_param values_check @@ -27,11 +27,11 @@ list( APPEND test_bins list get_data sections_copy - iterator_bitmap + grib_iterator_bitmap large_grib1 grib_clone check_gaussian_grid - ensemble_index + grib_ensemble_index get_product_kind bufr_attributes bufr_clone @@ -58,9 +58,9 @@ endforeach() list( APPEND tests grib_iterator grib_get_keys - print_data - set - keys_iterator + grib_print_data + grib_set_keys + grib_keys_iterator multi multi_write precision diff --git a/examples/C/Makefile.am b/examples/C/Makefile.am index 3f699289f..c90ea4fe9 100644 --- a/examples/C/Makefile.am +++ b/examples/C/Makefile.am @@ -1,17 +1,19 @@ 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 \ - precision.sh list.sh large_grib1.sh get_data.sh sections_copy.sh set_missing.sh grib_clone.sh set_pv.sh \ - check_gaussian_grids.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 bufr_subset.sh bufr_keys_iterator.sh bufr_missing.sh bufr_read_temp.sh \ - get_product_kind.sh +TESTS = grib_iterator.sh grib_get_keys.sh grib_print_data.sh grib_set_keys.sh \ + grib_keys_iterator.sh multi.sh multi_write.sh precision.sh \ + list.sh large_grib1.sh get_data.sh sections_copy.sh \ + set_missing.sh grib_clone.sh set_pv.sh \ + check_gaussian_grids.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 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_pv list sections_copy large_grib1 get_data iterator_bitmap grib_clone new_sample \ - check_gaussian_grid ensemble_index points \ + set_pv list sections_copy large_grib1 get_data grib_iterator_bitmap grib_clone new_sample \ + check_gaussian_grid grib_ensemble_index points \ 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 \ get_product_kind @@ -22,18 +24,18 @@ box_SOURCES = box.c set_data_SOURCES = set_data.c mars_param_SOURCES = mars_param.c values_check_SOURCES = values_check.c -nearest_SOURCES = nearest.c +grib_nearest_SOURCES = grib_nearest.c multi_write_SOURCES = multi_write.c grib_get_keys_SOURCES = grib_get_keys.c -print_data_SOURCES = print_data.c -set_SOURCES = set.c +grib_print_data_SOURCES = grib_print_data.c +grib_set_keys_SOURCES = grib_set_keys.c set_missing_SOURCES = set_missing.c set_bitmap_SOURCES = set_bitmap.c multi_SOURCES = multi.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 -iterator_bitmap_SOURCES = iterator_bitmap.c +grib_iterator_bitmap_SOURCES = grib_iterator_bitmap.c set_pv_SOURCES = set_pv.c points_SOURCES = points.c list_SOURCES = list.c @@ -43,7 +45,7 @@ get_data_SOURCES = get_data.c grib_clone_SOURCES = grib_clone.c new_sample_SOURCES = new_sample.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_clone_SOURCES = bufr_clone.c bufr_expanded_SOURCES = bufr_expanded.c diff --git a/examples/C/ensemble_index.c b/examples/C/grib_ensemble_index.c similarity index 100% rename from examples/C/ensemble_index.c rename to examples/C/grib_ensemble_index.c diff --git a/examples/C/iterator_bitmap.c b/examples/C/grib_iterator_bitmap.c similarity index 100% rename from examples/C/iterator_bitmap.c rename to examples/C/grib_iterator_bitmap.c diff --git a/examples/C/keys_iterator.c b/examples/C/grib_keys_iterator.c similarity index 97% rename from examples/C/keys_iterator.c rename to examples/C/grib_keys_iterator.c index a97525036..2c8398467 100644 --- a/examples/C/keys_iterator.c +++ b/examples/C/grib_keys_iterator.c @@ -9,12 +9,12 @@ */ /* - * C Implementation: keys_iterator + * C Implementation: grib_keys_iterator * * Description: * Example on how to use keys_iterator functions and the * codes_keys_iterator structure to get all the available - * keys in a message. + * keys in a GRIB message. * */ diff --git a/examples/C/keys_iterator.sh b/examples/C/grib_keys_iterator.sh similarity index 69% rename from examples/C/keys_iterator.sh rename to examples/C/grib_keys_iterator.sh index 161cfa32b..01cca8a60 100755 --- a/examples/C/keys_iterator.sh +++ b/examples/C/grib_keys_iterator.sh @@ -9,7 +9,7 @@ . ./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 diff --git a/examples/C/nearest.c b/examples/C/grib_nearest.c similarity index 100% rename from examples/C/nearest.c rename to examples/C/grib_nearest.c diff --git a/examples/C/print_data.c b/examples/C/grib_print_data.c similarity index 95% rename from examples/C/print_data.c rename to examples/C/grib_print_data.c index ddf09b6e3..03bb514a5 100644 --- a/examples/C/print_data.c +++ b/examples/C/grib_print_data.c @@ -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 diff --git a/examples/C/print_data.sh b/examples/C/grib_print_data.sh similarity index 81% rename from examples/C/print_data.sh rename to examples/C/grib_print_data.sh index 3a9b6b06d..7d97d8e66 100755 --- a/examples/C/print_data.sh +++ b/examples/C/grib_print_data.sh @@ -9,7 +9,7 @@ . ./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 ] then diff --git a/examples/C/set.c b/examples/C/grib_set_keys.c similarity index 96% rename from examples/C/set.c rename to examples/C/grib_set_keys.c index 1cb2ebb45..73725e22d 100644 --- a/examples/C/set.c +++ b/examples/C/grib_set_keys.c @@ -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 diff --git a/examples/C/set.sh b/examples/C/grib_set_keys.sh similarity index 91% rename from examples/C/set.sh rename to examples/C/grib_set_keys.sh index 89beec2a4..6a6becb66 100755 --- a/examples/C/set.sh +++ b/examples/C/grib_set_keys.sh @@ -9,6 +9,6 @@ . ./include.sh -${examples_dir}set > /dev/null +${examples_dir}grib_set_keys > /dev/null rm -f out.set.grib1 diff --git a/examples/F90/CMakeLists.txt b/examples/F90/CMakeLists.txt index 13ae9a809..b1789859d 100644 --- a/examples/F90/CMakeLists.txt +++ b/examples/F90/CMakeLists.txt @@ -13,13 +13,13 @@ list( APPEND tests get_data get_pl get_pv - keys_iterator + grib_keys_iterator multi_write multi - nearest + grib_nearest precision - print_data - set + grib_print_data + grib_set_keys set_bitmap set_missing set_pv diff --git a/examples/F90/Makefile.am b/examples/F90/Makefile.am index c367e04d8..77540cf49 100644 --- a/examples/F90/Makefile.am +++ b/examples/F90/Makefile.am @@ -1,17 +1,18 @@ 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 \ - nearest.sh precision.sh multi_write.sh multi.sh print_data.sh set.sh set_bitmap.sh set_missing.sh \ - set_pv.sh samples.sh count_messages.sh read_message.sh read_from_file.sh index.sh get_set_uuid.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 \ - bufr_keys_iterator.sh bufr_subset.sh get_product_kind.sh bufr_read_temp.sh +TESTS = copy_message.sh grib_get_keys.sh get_data.sh get_pl.sh get_pv.sh grib_keys_iterator.sh \ + grib_nearest.sh precision.sh multi_write.sh multi.sh grib_print_data.sh grib_set_keys.sh \ + set_bitmap.sh set_missing.sh set_pv.sh samples.sh count_messages.sh read_message.sh \ + read_from_file.sh index.sh get_set_uuid.sh bufr_attributes.sh bufr_clone.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 \ - f_multi_write f_multi f_nearest f_precision f_print_data f_set f_set_bitmap f_set_missing \ +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_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_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_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_pl_SOURCES=get_pl.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_SOURCES=multi.f90 -f_nearest_SOURCES=nearest.f90 +f_grib_nearest_SOURCES=grib_nearest.f90 f_precision_SOURCES=precision.f90 -f_print_data_SOURCES=print_data.f90 -f_set_SOURCES=set.f90 +f_grib_print_data_SOURCES=grib_print_data.f90 +f_grib_set_keys_SOURCES=grib_set_keys.f90 f_set_bitmap_SOURCES=set_bitmap.f90 f_set_missing_SOURCES=set_missing.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_get_keys_SOURCES=bufr_get_keys.f90 f_bufr_keys_iterator_SOURCES=bufr_keys_iterator.f90 -f_bufr_read_header_SOURCES=bufr_read_header.f90 -f_bufr_read_synop_SOURCES=bufr_read_synop.f90 +f_bufr_print_header_SOURCES=bufr_print_header.f90 +f_bufr_print_data_SOURCES=bufr_print_data.f90 f_bufr_read_temp_SOURCES=bufr_read_temp.f90 f_bufr_set_keys_SOURCES=bufr_set_keys.f90 f_bufr_subset_SOURCES=bufr_subset.f90 diff --git a/examples/F90/keys_iterator.f90 b/examples/F90/grib_keys_iterator.f90 similarity index 100% rename from examples/F90/keys_iterator.f90 rename to examples/F90/grib_keys_iterator.f90 diff --git a/examples/F90/nearest.sh b/examples/F90/grib_keys_iterator.sh similarity index 89% rename from examples/F90/nearest.sh rename to examples/F90/grib_keys_iterator.sh index c54eed8d8..19137e8fc 100755 --- a/examples/F90/nearest.sh +++ b/examples/F90/grib_keys_iterator.sh @@ -9,4 +9,4 @@ . ./include.sh -${examples_dir}f_nearest > /dev/null +${examples_dir}f_grib_keys_iterator > /dev/null diff --git a/examples/F90/nearest.f90 b/examples/F90/grib_nearest.f90 similarity index 99% rename from examples/F90/nearest.f90 rename to examples/F90/grib_nearest.f90 index bbae6b528..dbde95951 100644 --- a/examples/F90/nearest.f90 +++ b/examples/F90/grib_nearest.f90 @@ -11,7 +11,6 @@ ! ! ! -! program find use eccodes implicit none diff --git a/examples/F90/print_data.sh b/examples/F90/grib_nearest.sh similarity index 90% rename from examples/F90/print_data.sh rename to examples/F90/grib_nearest.sh index 3eddf2137..ea0cd407a 100755 --- a/examples/F90/print_data.sh +++ b/examples/F90/grib_nearest.sh @@ -9,4 +9,4 @@ . ./include.sh -${examples_dir}f_print_data > /dev/null +${examples_dir}f_grib_nearest > /dev/null diff --git a/examples/F90/print_data.f90 b/examples/F90/grib_print_data.f90 similarity index 96% rename from examples/F90/print_data.f90 rename to examples/F90/grib_print_data.f90 index 097bd8481..bf7da4845 100644 --- a/examples/F90/print_data.f90 +++ b/examples/F90/grib_print_data.f90 @@ -7,7 +7,7 @@ ! 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 ! ! ! diff --git a/examples/F90/keys_iterator.sh b/examples/F90/grib_print_data.sh similarity index 90% rename from examples/F90/keys_iterator.sh rename to examples/F90/grib_print_data.sh index bf78daae8..d679f3fa7 100755 --- a/examples/F90/keys_iterator.sh +++ b/examples/F90/grib_print_data.sh @@ -9,4 +9,4 @@ . ./include.sh -${examples_dir}f_keys_iterator > /dev/null +${examples_dir}f_grib_print_data > /dev/null diff --git a/examples/F90/set.f90 b/examples/F90/grib_set_keys.f90 similarity index 97% rename from examples/F90/set.f90 rename to examples/F90/grib_set_keys.f90 index 331b8d4ef..fa50d47a9 100644 --- a/examples/F90/set.f90 +++ b/examples/F90/grib_set_keys.f90 @@ -7,9 +7,7 @@ ! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. ! ! -! -! Description: how to set key values. -! +! Description: how to set key values in GRIB messages ! ! program set @@ -19,7 +17,6 @@ program set integer :: infile,outfile integer :: igrib - centre = 80 call current_date(date1) call codes_open_file(infile, & diff --git a/examples/F90/set.sh b/examples/F90/grib_set_keys.sh similarity index 92% rename from examples/F90/set.sh rename to examples/F90/grib_set_keys.sh index f4d4f7f40..e80bd95e2 100755 --- a/examples/F90/set.sh +++ b/examples/F90/grib_set_keys.sh @@ -9,7 +9,7 @@ . ./include.sh -${examples_dir}f_set > /dev/null +${examples_dir}f_grib_set_keys > /dev/null ${examples_dir}f_set_gvc > /dev/null [ -f out_gvc.grib2 ] diff --git a/examples/python/CMakeLists.txt b/examples/python/CMakeLists.txt index 6b99c1ad2..d67f64473 100644 --- a/examples/python/CMakeLists.txt +++ b/examples/python/CMakeLists.txt @@ -7,8 +7,8 @@ configure_file( include.ctest.sh.in include.ctest.sh @ONLY ) # Build the executables used by test scripts ################################################ list( APPEND test_bins - keys_iterator - print_data + grib_keys_iterator + grib_print_data grib_iterator count_messages ) @@ -30,12 +30,12 @@ list( APPEND tests grib_get_keys index grib_iterator - keys_iterator + grib_keys_iterator multi_write - nearest - print_data + grib_nearest + grib_print_data samples - set + grib_set_keys set_missing binary_message set_bitmap diff --git a/examples/python/Makefile.am b/examples/python/Makefile.am index 0766e5ceb..425da7049 100644 --- a/examples/python/Makefile.am +++ b/examples/python/Makefile.am @@ -1,15 +1,17 @@ if WITH_PYTHON 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 \ - samples.sh set.sh set_missing.sh binary_message.sh set_bitmap.sh bufr_read_header.sh bufr_read_synop.sh \ - bufr_clone.sh bufr_get_keys.sh bufr_set_keys.sh bufr_expanded.sh bufr_keys_iterator.sh bufr_subset.sh \ +TESTS = grib_clone.sh count_messages.sh grib_get_keys.sh index.sh grib_iterator.sh \ + grib_keys_iterator.sh multi_write.sh grib_nearest.sh grib_print_data.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 TESTS_ENVIRONMENT = TOPBUILDDIR=$(top_builddir) PYTHON=$(PYTHON) -noinst_PROGRAMS = p_keys_iterator p_print_data p_grib_iterator p_count_messages -p_keys_iterator_SOURCES = keys_iterator.c -p_print_data_SOURCES = print_data.c +noinst_PROGRAMS = p_grib_keys_iterator p_grib_print_data p_grib_iterator p_count_messages +p_grib_keys_iterator_SOURCES = grib_keys_iterator.c +p_grib_print_data_SOURCES = grib_print_data.c p_grib_iterator_SOURCES = grib_iterator.c p_count_messages_SOURCES = count_messages.c INCLUDES = -I$(top_builddir)/src @@ -17,9 +19,9 @@ LDADD = $(top_builddir)/src/libeccodes.la DEPENDENCIES = $(LDADD) 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 \ - nearest.py print_data.py samples.py set.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 \ + grib_keys_iterator.py multi_write.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_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 \ get_product_kind.py bufr_read_temp.py \ CMakeLists.txt include.ctest.sh.in diff --git a/examples/python/keys_iterator.c b/examples/python/grib_keys_iterator.c similarity index 97% rename from examples/python/keys_iterator.c rename to examples/python/grib_keys_iterator.c index 97c73d9df..102076681 100644 --- a/examples/python/keys_iterator.c +++ b/examples/python/grib_keys_iterator.c @@ -9,13 +9,12 @@ */ /* - * C Implementation: keys_iterator + * C Implementation: grib_keys_iterator * * Description: * Example on how to use keys_iterator functions and the * grib_keys_iterator structure to get all the available - * keys in a message. - * + * keys in a GRIB message. * * */ diff --git a/examples/python/keys_iterator.py b/examples/python/grib_keys_iterator.py similarity index 100% rename from examples/python/keys_iterator.py rename to examples/python/grib_keys_iterator.py diff --git a/examples/python/grib_keys_iterator.sh b/examples/python/grib_keys_iterator.sh new file mode 100755 index 000000000..99b3b4c13 --- /dev/null +++ b/examples/python/grib_keys_iterator.sh @@ -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 diff --git a/examples/python/nearest.py b/examples/python/grib_nearest.py similarity index 100% rename from examples/python/nearest.py rename to examples/python/grib_nearest.py diff --git a/examples/python/grib_nearest.sh b/examples/python/grib_nearest.sh new file mode 100755 index 000000000..f1ddc8aa2 --- /dev/null +++ b/examples/python/grib_nearest.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +. ./include.sh + +REDIRECT=/dev/null +$PYTHON grib_nearest.py 2> $REDIRECT > $REDIRECT diff --git a/examples/python/print_data.c b/examples/python/grib_print_data.c similarity index 94% rename from examples/python/print_data.c rename to examples/python/grib_print_data.c index 7390810fc..752d7ebec 100644 --- a/examples/python/print_data.c +++ b/examples/python/grib_print_data.c @@ -9,10 +9,9 @@ */ /* - * C Implementation: print_data - * - * Description: prints all the data contained in a grib file + * C Implementation: grib_print_data * + * Description: prints all the data contained in a GRIB file * * */ diff --git a/examples/python/print_data.py b/examples/python/grib_print_data.py similarity index 100% rename from examples/python/print_data.py rename to examples/python/grib_print_data.py diff --git a/examples/python/grib_print_data.sh b/examples/python/grib_print_data.sh new file mode 100755 index 000000000..caaf8dc83 --- /dev/null +++ b/examples/python/grib_print_data.sh @@ -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 diff --git a/examples/python/set.py b/examples/python/grib_set_keys.py similarity index 100% rename from examples/python/set.py rename to examples/python/grib_set_keys.py diff --git a/examples/python/set.sh b/examples/python/grib_set_keys.sh similarity index 59% rename from examples/python/set.sh rename to examples/python/grib_set_keys.sh index 6f30220d1..e15c8579f 100755 --- a/examples/python/set.sh +++ b/examples/python/grib_set_keys.sh @@ -3,5 +3,5 @@ . ./include.sh REDIRECT=/dev/null -$PYTHON set.py 2> $REDIRECT > $REDIRECT +$PYTHON grib_set_keys.py 2> $REDIRECT > $REDIRECT rm -f out.set.grib || true diff --git a/examples/python/keys_iterator.sh b/examples/python/keys_iterator.sh deleted file mode 100755 index 1c57f2adc..000000000 --- a/examples/python/keys_iterator.sh +++ /dev/null @@ -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 diff --git a/examples/python/nearest.sh b/examples/python/nearest.sh deleted file mode 100755 index fcb26e4b5..000000000 --- a/examples/python/nearest.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -. ./include.sh - -REDIRECT=/dev/null -$PYTHON nearest.py 2> $REDIRECT > $REDIRECT diff --git a/examples/python/print_data.sh b/examples/python/print_data.sh deleted file mode 100755 index db2be4f24..000000000 --- a/examples/python/print_data.sh +++ /dev/null @@ -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 diff --git a/fortran/eccodes_f90_head.f90 b/fortran/eccodes_f90_head.f90 index 4f7b05021..c645254c8 100644 --- a/fortran/eccodes_f90_head.f90 +++ b/fortran/eccodes_f90_head.f90 @@ -56,7 +56,7 @@ module eccodes !> exit with an error message.\n Otherwise the error message can be !> 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 !> @@ -96,7 +96,7 @@ module eccodes !> exit with an error message.\n Otherwise the error message can be !> 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] is_lsm .true. if the nearest land point is required otherwise .false. diff --git a/fortran/grib_f90_head.f90 b/fortran/grib_f90_head.f90 index a9383da97..7df844fbe 100644 --- a/fortran/grib_f90_head.f90 +++ b/fortran/grib_f90_head.f90 @@ -52,7 +52,7 @@ module grib_api !> exit with an error message.\n Otherwise the error message can be !> 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 !> @@ -92,7 +92,7 @@ module grib_api !> exit with an error message.\n Otherwise the error message can be !> 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] is_lsm .true. if the nearest land point is required otherwise .false. diff --git a/python/gribapi.py b/python/gribapi.py index c53cbab07..3cddce702 100644 --- a/python/gribapi.py +++ b/python/gribapi.py @@ -372,7 +372,7 @@ def grib_write(gribid, fileobj): """ @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 fileobj python file object @@ -599,7 +599,7 @@ def grib_keys_iterator_next(iterid): """ @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 @exception GribInternalError @@ -614,7 +614,7 @@ def grib_keys_iterator_delete(iterid): """ @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 @exception GribInternalError @@ -626,7 +626,7 @@ def grib_keys_iterator_get_name(iterid): """ @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 @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. - \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 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. - \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 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 92f6cc583..347be8224 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -42,6 +42,7 @@ list( APPEND tests2 bufr_filter bufr_json bufr_ls + gts_ls bufr_set ieee grib1to2 diff --git a/tests/Makefile.am b/tests/Makefile.am index 6b29a169b..e3c6b3dba 100755 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,7 @@ TESTS = definitions.sh calendar.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 \ + gts_ls.sh \ ieee.sh grib1to2.sh \ unit_tests.sh \ grib2to1.sh badgrib.sh ls.sh filter.sh \ diff --git a/tests/gts_ls.sh b/tests/gts_ls.sh new file mode 100755 index 000000000..b4a8ad0a5 --- /dev/null +++ b/tests/gts_ls.sh @@ -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