Skip to content

Commit

Permalink
Merge pull request #209 from ecmwf/feature/modernisation-inheritance
Browse files Browse the repository at this point in the history
Feature/modernisation_inheritance
  • Loading branch information
shahramn committed May 13, 2024
2 parents 501dc2c + 1514b73 commit 6960978
Show file tree
Hide file tree
Showing 596 changed files with 23,861 additions and 36,096 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ grib_api.pc
grib_api_f90.pc
*.analyzerinfo
*.snalyzerinfo
tags
src/convert_*.sh

# compiled source #
###################
Expand Down Expand Up @@ -72,3 +74,4 @@ data/bufr/*test

build/
*.back
trash
15 changes: 13 additions & 2 deletions examples/C/grib_pthreads.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,22 @@
*/

#include <pthread.h>
#include "grib_api_internal.h"
#include <stdio.h>
#include <stdlib.h>
/*#include "grib_api_internal.h"*/

#include "eccodes.h"
#define NUM_THREADS 4

void Assert(int condition)
{
if (!condition) {
printf("Assertion failed\n");
exit(1);
}
}


/* Return 0 if numbers considered equal, otherwise 1 */
static int compare_doubles(double a, double b, double tolerance)
{
Expand All @@ -40,7 +51,7 @@ static void* process_grib(void* threadID)
ProductKind prod_kind = 0;

codes_handle* h = codes_grib_handle_new_from_samples(0, "regular_ll_pl_grib2");
Assert(h);
Assert(h != NULL);
CODES_CHECK(codes_get_product_kind(h, &prod_kind), 0);
Assert(prod_kind == PRODUCT_GRIB);
printf("Thread %ld running\n", tid);
Expand Down
2 changes: 1 addition & 1 deletion fortran/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if( HAVE_FORTRAN )
# Note: $<BUILD_INTERFACE:...> will be present only while building (for the whole bundle),
# whereas $<INSTALL_INTERFACE:...> is only present once you install the package / bundle
ecbuild_add_library( TARGET eccodes_f90
SOURCES grib_fortran.c grib_f90.f90 eccodes_f90.f90 grib_kinds.h
SOURCES grib_fortran.cc grib_f90.f90 eccodes_f90.f90 grib_kinds.h
GENERATED grib_f90.f90 eccodes_f90.f90
PUBLIC_INCLUDES $<BUILD_INTERFACE:${CMAKE_Fortran_MODULE_DIRECTORY}>
$<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}>
Expand Down
1 change: 1 addition & 0 deletions fortran/grib_fortran.c → fortran/grib_fortran.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

#include "grib_api_internal.h"
#include "grib_fortran_prototypes.h"

#if HAVE_SYS_TYPES_H
# include <sys/types.h>
Expand Down
332 changes: 332 additions & 0 deletions fortran/grib_fortran_prototypes.h

Large diffs are not rendered by default.

Loading

0 comments on commit 6960978

Please sign in to comment.