From b07bc640b62da345751fa6b619bcca60eef67111 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 26 Apr 2021 14:10:58 +0100 Subject: [PATCH] ECC-1235: Fortran examples: Show how to convert an error code into a string --- examples/F90/CMakeLists.txt | 4 ++-- examples/F90/Makefile.am | 6 +++--- .../F90/{read_from_file.f90 => grib_read_from_file.f90} | 6 +++--- examples/F90/{read_from_file.sh => grib_read_from_file.sh} | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) rename examples/F90/{read_from_file.f90 => grib_read_from_file.f90} (95%) rename examples/F90/{read_from_file.sh => grib_read_from_file.sh} (89%) diff --git a/examples/F90/CMakeLists.txt b/examples/F90/CMakeLists.txt index 1a3b66c46..93b6435a1 100644 --- a/examples/F90/CMakeLists.txt +++ b/examples/F90/CMakeLists.txt @@ -34,7 +34,7 @@ if( HAVE_BUILD_TOOLS ) grib_count_messages_multi grib_copy_namespace grib_read_message - read_from_file + grib_read_from_file grib_get_set_uuid grib_clone bufr_attributes @@ -75,7 +75,7 @@ else() grib_samples grib_count_messages grib_count_messages_multi - read_from_file + grib_read_from_file grib_clone bufr_attributes bufr_clone diff --git a/examples/F90/Makefile.am b/examples/F90/Makefile.am index 6530fe905..a4824b086 100644 --- a/examples/F90/Makefile.am +++ b/examples/F90/Makefile.am @@ -6,7 +6,7 @@ TESTS = grib_copy_message.sh grib_get_keys.sh grib_get_data.sh grib_get_pl.sh gr grib_print_data.sh grib_set_keys.sh \ grib_set_bitmap.sh grib_set_missing.sh grib_set_pv.sh grib_samples.sh grib_count_messages.sh \ grib_read_message.sh grib_count_messages_multi.sh \ - read_from_file.sh grib_index.sh grib_get_set_uuid.sh \ + grib_read_from_file.sh grib_index.sh grib_get_set_uuid.sh \ bufr_attributes.sh grib_clone.sh bufr_clone.sh \ bufr_expanded.sh bufr_get_keys.sh bufr_get_string_array.sh \ bufr_read_header.sh bufr_read_synop.sh \ @@ -35,7 +35,7 @@ noinst_PROGRAMS = eccodes_f_grib_index \ eccodes_f_grib_count_messages \ eccodes_f_grib_count_messages_multi \ eccodes_f_grib_read_message \ - eccodes_f_read_from_file \ + eccodes_f_grib_read_from_file \ eccodes_f_new_from_file \ eccodes_f_grib_copy_namespace \ eccodes_f_grib_get_set_uuid \ @@ -77,7 +77,7 @@ eccodes_f_grib_samples_SOURCES=grib_samples.f90 eccodes_f_grib_count_messages_SOURCES=grib_count_messages.f90 eccodes_f_grib_count_messages_multi_SOURCES=grib_count_messages_multi.f90 eccodes_f_grib_read_message_SOURCES=grib_read_message.f90 -eccodes_f_read_from_file_SOURCES=read_from_file.f90 +eccodes_f_grib_read_from_file_SOURCES=grib_read_from_file.f90 eccodes_f_new_from_file_SOURCES=new_from_file.f90 eccodes_f_grib_copy_namespace_SOURCES=grib_copy_namespace.f90 eccodes_f_grib_get_set_uuid_SOURCES=grib_get_set_uuid.f90 diff --git a/examples/F90/read_from_file.f90 b/examples/F90/grib_read_from_file.f90 similarity index 95% rename from examples/F90/read_from_file.f90 rename to examples/F90/grib_read_from_file.f90 index 2397fa2f0..5a9e2b520 100644 --- a/examples/F90/read_from_file.f90 +++ b/examples/F90/grib_read_from_file.f90 @@ -9,7 +9,7 @@ ! Get message lengths using two different interfaces ! See GRIB-292 ! -program read_from_file +program grib_read_from_file use eccodes implicit none character(len=32) :: input_grib_file @@ -57,7 +57,7 @@ contains if (iret /= CODES_END_OF_FILE) then call codes_get_error_string(iret, error_message) write (*, *) 'error message: ', error_message - call codes_check(iret, 'read_from_file', '') + call codes_check(iret, 'grib_read_from_file', '') end if call codes_close_file(ifile) @@ -94,7 +94,7 @@ contains if (iret /= CODES_END_OF_FILE) then call codes_get_error_string(iret, error_message) write (*, *) 'error message: ', error_message - call codes_check(iret, 'read_from_file', '') + call codes_check(iret, 'grib_read_from_file', '') end if call codes_close_file(ifile) diff --git a/examples/F90/read_from_file.sh b/examples/F90/grib_read_from_file.sh similarity index 89% rename from examples/F90/read_from_file.sh rename to examples/F90/grib_read_from_file.sh index 116ffe8e1..5b8820df9 100755 --- a/examples/F90/read_from_file.sh +++ b/examples/F90/grib_read_from_file.sh @@ -13,4 +13,4 @@ # Check program completed successfully. We have to resort to testing # the output as there is no way in Fortran to set the exit code # -${examples_dir}/eccodes_f_read_from_file | grep 'Passed' +${examples_dir}/eccodes_f_grib_read_from_file | grep 'Passed'