diff --git a/examples/C/CMakeLists.txt b/examples/C/CMakeLists.txt index 7452a1528..eb25fbe23 100644 --- a/examples/C/CMakeLists.txt +++ b/examples/C/CMakeLists.txt @@ -15,7 +15,7 @@ list( APPEND test_bins grib_print_data grib_set_keys grib_index - set_missing + grib_set_missing grib_keys_iterator grib_set_data mars_param @@ -83,7 +83,7 @@ if( HAVE_BUILD_TOOLS ) grib_get_data grib_nearest_multiple grib_multi - set_missing + grib_set_missing bufr_attributes bufr_copy_data bufr_clone @@ -117,7 +117,7 @@ else() grib_get_data grib_nearest_multiple grib_multi - set_missing + grib_set_missing bufr_attributes bufr_expanded bufr_get_keys diff --git a/examples/C/Makefile.am b/examples/C/Makefile.am index 57933cf49..ed686f1d8 100644 --- a/examples/C/Makefile.am +++ b/examples/C/Makefile.am @@ -13,7 +13,7 @@ TESTS = grib_iterator.sh \ large_grib1.sh \ grib_get_data.sh \ grib_sections_copy.sh \ - set_missing.sh \ + grib_set_missing.sh \ grib_clone.sh \ grib_set_pv.sh \ grib_set_bitmap.sh \ @@ -37,7 +37,7 @@ noinst_PROGRAMS = c_grib_nearest \ c_grib_get_keys \ c_grib_print_data \ c_grib_set_keys \ - c_set_missing \ + c_grib_set_missing \ c_grib_keys_iterator \ c_grib_set_data \ c_grib_index \ @@ -84,7 +84,7 @@ c_grib_multi_write_SOURCES = grib_multi_write.c c_grib_get_keys_SOURCES = grib_get_keys.c c_grib_print_data_SOURCES = grib_print_data.c c_grib_set_keys_SOURCES = grib_set_keys.c -c_set_missing_SOURCES = set_missing.c +c_grib_set_missing_SOURCES = grib_set_missing.c c_grib_index_SOURCES = grib_index.c c_grib_set_bitmap_SOURCES = grib_set_bitmap.c c_grib_multi_SOURCES = grib_multi.c diff --git a/examples/C/set_missing.c b/examples/C/grib_set_missing.c similarity index 100% rename from examples/C/set_missing.c rename to examples/C/grib_set_missing.c diff --git a/examples/C/set_missing.sh b/examples/C/grib_set_missing.sh similarity index 92% rename from examples/C/set_missing.sh rename to examples/C/grib_set_missing.sh index a2d5b27d0..52167eee9 100755 --- a/examples/C/set_missing.sh +++ b/examples/C/grib_set_missing.sh @@ -9,5 +9,5 @@ . ./include.sh -${examples_dir}/c_set_missing +${examples_dir}/c_grib_set_missing rm -f out_surface_level.grib2 diff --git a/examples/F90/CMakeLists.txt b/examples/F90/CMakeLists.txt index 06a2583c1..c2cd8aee9 100644 --- a/examples/F90/CMakeLists.txt +++ b/examples/F90/CMakeLists.txt @@ -18,8 +18,8 @@ if( HAVE_BUILD_TOOLS ) bufr_copy_message grib_get_keys grib_get_data - get_pl - get_pv + grib_get_pl + grib_get_pv grib_keys_iterator grib_multi_write grib_multi @@ -33,9 +33,9 @@ if( HAVE_BUILD_TOOLS ) grib_count_messages grib_count_messages_multi grib_copy_namespace - read_message + grib_read_message read_from_file - get_set_uuid + grib_get_set_uuid grib_clone bufr_attributes bufr_copy_data @@ -63,8 +63,8 @@ else() grib_index grib_get_keys grib_get_data - get_pl - get_pv + grib_get_pl + grib_get_pv grib_keys_iterator grib_multi grib_nearest diff --git a/examples/F90/Makefile.am b/examples/F90/Makefile.am index cdf73fc85..6530fe905 100644 --- a/examples/F90/Makefile.am +++ b/examples/F90/Makefile.am @@ -1,12 +1,12 @@ AM_CFLAGS = @WARN_PEDANTIC@ @WERROR@ @FORCE_32_CFLAGS@ -TESTS = grib_copy_message.sh grib_get_keys.sh grib_get_data.sh get_pl.sh get_pv.sh grib_keys_iterator.sh \ +TESTS = grib_copy_message.sh grib_get_keys.sh grib_get_data.sh grib_get_pl.sh grib_get_pv.sh grib_keys_iterator.sh \ grib_nearest.sh grib_precision.sh grib_multi_write.sh grib_multi.sh \ 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 \ - read_message.sh grib_count_messages_multi.sh \ - read_from_file.sh grib_index.sh get_set_uuid.sh \ + grib_read_message.sh grib_count_messages_multi.sh \ + 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 \ @@ -18,8 +18,8 @@ noinst_PROGRAMS = eccodes_f_grib_index \ eccodes_f_grib_copy_message \ eccodes_f_grib_get_keys \ eccodes_f_grib_get_data \ - eccodes_f_get_pl \ - eccodes_f_get_pv \ + eccodes_f_grib_get_pl \ + eccodes_f_grib_get_pv \ eccodes_f_grib_keys_iterator \ eccodes_f_grib_multi_write \ eccodes_f_grib_multi \ @@ -34,11 +34,11 @@ noinst_PROGRAMS = eccodes_f_grib_index \ eccodes_f_grib_samples \ eccodes_f_grib_count_messages \ eccodes_f_grib_count_messages_multi \ - eccodes_f_read_message \ + eccodes_f_grib_read_message \ eccodes_f_read_from_file \ eccodes_f_new_from_file \ eccodes_f_grib_copy_namespace \ - eccodes_f_get_set_uuid \ + eccodes_f_grib_get_set_uuid \ eccodes_f_grib_set_gvc \ eccodes_f_grib_clone \ eccodes_f_bufr_clone \ @@ -60,8 +60,8 @@ eccodes_f_grib_index_SOURCES=grib_index.f90 eccodes_f_grib_copy_message_SOURCES=grib_copy_message.f90 eccodes_f_grib_get_keys_SOURCES=grib_get_keys.f90 eccodes_f_grib_get_data_SOURCES=grib_get_data.f90 -eccodes_f_get_pl_SOURCES=get_pl.f90 -eccodes_f_get_pv_SOURCES=get_pv.f90 +eccodes_f_grib_get_pl_SOURCES=grib_get_pl.f90 +eccodes_f_grib_get_pv_SOURCES=grib_get_pv.f90 eccodes_f_grib_keys_iterator_SOURCES=grib_keys_iterator.f90 eccodes_f_grib_multi_write_SOURCES=grib_multi_write.f90 eccodes_f_grib_multi_SOURCES=grib_multi.f90 @@ -76,11 +76,11 @@ eccodes_f_grib_set_pv_SOURCES=grib_set_pv.f90 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_read_message_SOURCES=read_message.f90 +eccodes_f_grib_read_message_SOURCES=grib_read_message.f90 eccodes_f_read_from_file_SOURCES=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_get_set_uuid_SOURCES=get_set_uuid.f90 +eccodes_f_grib_get_set_uuid_SOURCES=grib_get_set_uuid.f90 eccodes_f_grib_set_gvc_SOURCES=grib_set_gvc.f90 eccodes_f_grib_clone_SOURCES=grib_clone.f90 eccodes_f_bufr_attributes_SOURCES=bufr_attributes.f90 diff --git a/examples/F90/get_pl.f90 b/examples/F90/grib_get_pl.f90 similarity index 96% rename from examples/F90/get_pl.f90 rename to examples/F90/grib_get_pl.f90 index b364f4113..a13e1752a 100644 --- a/examples/F90/get_pl.f90 +++ b/examples/F90/grib_get_pl.f90 @@ -10,7 +10,7 @@ ! Description: how to get PL values. ! ! -program get_pl +program grib_get_pl use eccodes implicit none integer :: infile @@ -42,4 +42,4 @@ program get_pl call codes_close_file(infile) -end program get_pl +end program grib_get_pl diff --git a/examples/F90/get_pv.sh b/examples/F90/grib_get_pl.sh similarity index 89% rename from examples/F90/get_pv.sh rename to examples/F90/grib_get_pl.sh index 568d8701c..62448137e 100755 --- a/examples/F90/get_pv.sh +++ b/examples/F90/grib_get_pl.sh @@ -9,4 +9,4 @@ . ./include.sh -${examples_dir}/eccodes_f_get_pv > /dev/null +${examples_dir}/eccodes_f_grib_get_pl > /dev/null diff --git a/examples/F90/get_pv.f90 b/examples/F90/grib_get_pv.f90 similarity index 96% rename from examples/F90/get_pv.f90 rename to examples/F90/grib_get_pv.f90 index dcfcdb77a..2fcf8a26e 100644 --- a/examples/F90/get_pv.f90 +++ b/examples/F90/grib_get_pv.f90 @@ -10,7 +10,7 @@ ! Description: how to get PV values. ! ! -program get_pv +program grib_get_pv use eccodes implicit none integer :: infile @@ -42,4 +42,4 @@ program get_pv call codes_close_file(infile) -end program get_pv +end program grib_get_pv diff --git a/examples/F90/get_pl.sh b/examples/F90/grib_get_pv.sh similarity index 89% rename from examples/F90/get_pl.sh rename to examples/F90/grib_get_pv.sh index 7001252b9..c0dca3755 100755 --- a/examples/F90/get_pl.sh +++ b/examples/F90/grib_get_pv.sh @@ -9,4 +9,4 @@ . ./include.sh -${examples_dir}/eccodes_f_get_pl > /dev/null +${examples_dir}/eccodes_f_grib_get_pv > /dev/null diff --git a/examples/F90/get_set_uuid.f90 b/examples/F90/grib_get_set_uuid.f90 similarity index 98% rename from examples/F90/get_set_uuid.f90 rename to examples/F90/grib_get_set_uuid.f90 index 097285987..17a812a3b 100644 --- a/examples/F90/get_set_uuid.f90 +++ b/examples/F90/grib_get_set_uuid.f90 @@ -11,7 +11,7 @@ ! ! Original authors: Harald Anlauf, Doerte Liermann (DWD), Luis Kornblueh (MPIfM). ! -program get_set_uuid +program grib_get_set_uuid use eccodes implicit none integer :: infile, outfile @@ -97,4 +97,4 @@ contains nibble = achar (iachar ('a') - 10 + x) end select end function nibble -end program get_set_uuid +end program grib_get_set_uuid diff --git a/examples/F90/get_set_uuid.sh b/examples/F90/grib_get_set_uuid.sh similarity index 93% rename from examples/F90/get_set_uuid.sh rename to examples/F90/grib_get_set_uuid.sh index cf512b777..66254cf75 100755 --- a/examples/F90/get_set_uuid.sh +++ b/examples/F90/grib_get_set_uuid.sh @@ -14,7 +14,7 @@ uuid=`${tools_dir}/grib_get -w count=1 -p uuidOfVGrid:s ${data_dir}/test_uuid.gr [ "$uuid" = "08b1e836bc6911e1951fb51b5624ad8d" ] # This reads the file in data/test_uuid.grib2 and creates test_uuid.grib2 -${examples_dir}/eccodes_f_get_set_uuid > /dev/null +${examples_dir}/eccodes_f_grib_get_set_uuid > /dev/null # Check output was written output=out_uuid.grib2 diff --git a/examples/F90/read_message.f90 b/examples/F90/grib_read_message.f90 similarity index 96% rename from examples/F90/read_message.f90 rename to examples/F90/grib_read_message.f90 index cb4dee699..ac0f80ff2 100644 --- a/examples/F90/read_message.f90 +++ b/examples/F90/grib_read_message.f90 @@ -8,7 +8,7 @@ ! ! Description: how to get values using keys. ! -program read_message +program grib_read_message use eccodes implicit none integer :: ifile,ofile @@ -49,5 +49,5 @@ implicit none call codes_close_file(ifile) call codes_close_file(ofile) -end program read_message +end program grib_read_message diff --git a/examples/F90/read_message.sh b/examples/F90/grib_read_message.sh similarity index 90% rename from examples/F90/read_message.sh rename to examples/F90/grib_read_message.sh index 04d6cbcfe..639fc4c97 100755 --- a/examples/F90/read_message.sh +++ b/examples/F90/grib_read_message.sh @@ -14,7 +14,7 @@ out=out.readmsg.grib rm -f $out | true -${examples_dir}/eccodes_f_read_message > /dev/null +${examples_dir}/eccodes_f_grib_read_message > /dev/null ${tools_dir}/grib_compare $in $out diff --git a/memfs.py b/memfs.py index 767ddb012..e419b3ed6 100755 --- a/memfs.py +++ b/memfs.py @@ -63,8 +63,6 @@ for directory in dirs: for dirpath, dirnames, files in os.walk(directory, followlinks=True): - - # Prune the walk by modifying the dirnames in-place dirnames[:] = [dirname for dirname in dirnames if dirname not in EXCLUDED] for name in files: @@ -73,7 +71,7 @@ for directory in dirs: fcount += 1 opath = get_outfile_name(output_file_base, fcount) print("MEMFS: Generating output:", opath) - buffer = open(opath, 'wb') + buffer = open(opath, "w") full = "%s/%s" % (dirpath, name) _, ext = os.path.splitext(full) @@ -106,7 +104,9 @@ for directory in dirs: # e.g. 23 -> 0x23 for n in range(0, len(contents_hex), 2): twoChars = ascii(contents_hex[n : n + 2]) + buffer.write(encode("0x%s," % (twoChars,))) + i += 1 if (i % 20) == 0: buffer.write(encode("\n")) @@ -116,6 +116,7 @@ for directory in dirs: buffer.close() buffer = None + if buffer is not None: buffer.close()