Skip to content

Commit

Permalink
Merge branch 'feature/modernisation_short_file_names' of github.com:e…
Browse files Browse the repository at this point in the history
…cmwf/eccodes into feature/modernisation_short_file_names
  • Loading branch information
joobog committed Feb 25, 2025
2 parents 0cfea04 + 70f0d38 commit fd3fb5f
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 30 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ add_subdirectory( ifs_samples ) # must come after samples
ecbuild_dont_pack( FILES .cproject .project )
ecbuild_dont_pack( DIRS
experimental deprecated doxygen confluence tests/deprecated tests/tests.ecmwf
src/deprecated tools/deprecated ifs_samples/grib1_mlgrib2_ieee32
src/eccodes/deprecated tools/deprecated ifs_samples/grib1_mlgrib2_ieee32
examples/examples.dev examples/extra examples/deprecated bamboo
fortran/fortranCtypes share/eccodes .settings )
#ecbuild_dont_pack( DIRS data/bufr DONT_PACK_REGEX "*.bufr" )
Expand Down
2 changes: 1 addition & 1 deletion memfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def get_outfile_name(base, count):
print("MEMFS: Generating output:", opath)
g = open(opath, "w")

f = open(os.path.join(os.path.dirname(__file__), "src", "memfs.c"))
f = open(os.path.join(os.path.dirname(__file__), "src", "eccodes", "memfs.c"))
for line in f.readlines():
line = line.rstrip()
if "<MARKER>" in line:
Expand Down
8 changes: 0 additions & 8 deletions src/eccodes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@
# nor does it submit to any jurisdiction.
#

include_directories(
"${CMAKE_CURRENT_SOURCE_DIR}/action"
"${CMAKE_CURRENT_SOURCE_DIR}/dumper"
"${CMAKE_CURRENT_SOURCE_DIR}/accessor"
"${CMAKE_CURRENT_SOURCE_DIR}/geo/iterator"
"${CMAKE_CURRENT_SOURCE_DIR}/geo/nearest"
)

list( APPEND eccodes_src_files
step_unit.cc
step.cc
Expand Down
1 change: 1 addition & 0 deletions src/eccodes/accessor/BufrDataArray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "BufrDataArray.h"
#include "ExpandedDescriptors.h"
#include "BufrDataElement.h"
#include "BufrElementsTable.h"
#include "Variable.h"
#include "ecc_numeric_limits.h"

Expand Down
30 changes: 15 additions & 15 deletions src/eccodes/accessor/BufrElementsTable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,6 @@
static pthread_once_t once = PTHREAD_ONCE_INIT;
static pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;

int bufr_descriptor_is_marker(bufr_descriptor* d)
{
int isMarker = 0;
switch (d->code) {
case 223255:
case 224255:
case 225255:
case 232255:
return 1;
}
if (d->F == 2 && d->X == 5)
isMarker = 1;
return isMarker;
}

static void init_mutex()
{
pthread_mutexattr_t attr;
Expand All @@ -54,6 +39,21 @@ static void init_mutex()
}
#endif

int bufr_descriptor_is_marker(bufr_descriptor* d)
{
int isMarker = 0;
switch (d->code) {
case 223255:
case 224255:
case 225255:
case 232255:
return 1;
}
if (d->F == 2 && d->X == 5)
isMarker = 1;
return isMarker;
}

eccodes::accessor::BufrElementsTable _grib_accessor_bufr_elements_table;
eccodes::Accessor* grib_accessor_bufr_elements_table = &_grib_accessor_bufr_elements_table;

Expand Down
4 changes: 2 additions & 2 deletions src/eccodes/accessor/BufrElementsTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ class BufrElementsTable : public Gen
int bufr_get_from_table(bufr_descriptor* v);
};

int bufr_descriptor_is_marker(bufr_descriptor* d);

} // namespace eccodes::accessor

int bufr_descriptor_is_marker(bufr_descriptor* d);
2 changes: 1 addition & 1 deletion src/eccodes/accessor/Md5.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

#include "Md5.h"
#include "md5.h"
#include "../md5.h"

eccodes::accessor::Md5 _grib_accessor_md5;
eccodes::Accessor* grib_accessor_md5 = &_grib_accessor_md5;
Expand Down
5 changes: 4 additions & 1 deletion src/eccodes/accessor/MessageIsValid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ int MessageIsValid::check_grid_and_packing_type()
const bool is_spectral_grid = (STR_EQUAL(gridType, "sh") ||
STR_EQUAL(gridType, "rotated_sh") ||
STR_EQUAL(gridType, "stretched_sh") ||
STR_EQUAL(gridType, "stretched_rotated_sh") ||
STR_EQUAL(gridType, "lambert_bf") ||
STR_EQUAL(gridType, "stretched_rotated_sh"));
STR_EQUAL(gridType, "polar_stereographic_bf") ||
STR_EQUAL(gridType, "mercator_bf"));
const bool is_spectral_packing = (STR_EQUAL(packing_type, "spectral_complex") ||
STR_EQUAL(packing_type, "spectral_simple") ||
STR_EQUAL(packing_type, "spectral_ieee") ||
STR_EQUAL(packing_type, "bifourier_complex"));

if ( (is_spectral_grid && !is_spectral_packing) ||
Expand Down
2 changes: 1 addition & 1 deletion src/eccodes/eccodes_prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void grib_viarray_delete(grib_viarray* v);
void grib_viarray_delete_content(grib_viarray* v);

/* grib_accessor_class_bufr_elements_table.cc */
int bufr_descriptor_is_marker(bufr_descriptor* d);
// int bufr_descriptor_is_marker(bufr_descriptor* d);
// bufr_descriptor* accessor_bufr_elements_table_get_descriptor(grib_accessor* a, int code, int* err);

/* grib_accessor_class.cc */
Expand Down
5 changes: 5 additions & 0 deletions tests/grib_check_message_validity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ grib_check_key_equals $ECCODES_SAMPLES_PATH/reduced_ll_sfc_grib1.tmpl isMessag
grib_check_key_equals $ECCODES_SAMPLES_PATH/reduced_ll_sfc_grib2.tmpl isMessageValid 1
grib_check_key_equals $ECCODES_SAMPLES_PATH/sh_ml_grib2.tmpl isMessageValid 1

if [ $ECCODES_ON_WINDOWS -eq 0 ]; then
grib_check_key_equals $ECCODES_SAMPLES_PATH/lambert_bf_grib2.tmpl isMessageValid 1
fi


IFS_SAMPLES_ROOT=${proj_dir}/ifs_samples
grib_check_key_equals $IFS_SAMPLES_ROOT/grib1_mlgrib2_ccsds/gg_ml.tmpl isMessageValid 1
grib_check_key_equals $IFS_SAMPLES_ROOT/grib1_mlgrib2_ccsds/gg_sfc_grib2.tmpl isMessageValid 1
Expand Down

0 comments on commit fd3fb5f

Please sign in to comment.