From da719dfd937f0c63a6c35b62bb1b1237dfcf970a Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 28 Jan 2015 22:54:42 +0000 Subject: [PATCH] ECC-13: Fortran interface and module --- examples/F90/clone.f90 | 2 +- examples/F90/copy_message.f90 | 2 +- examples/F90/copy_namespace.f90 | 2 +- examples/F90/count_messages.f90 | 2 +- examples/F90/get.f90 | 2 +- examples/F90/get_data.f90 | 2 +- examples/F90/get_fortran.f90 | 2 +- examples/F90/get_pl.f90 | 2 +- examples/F90/get_pv.f90 | 2 +- examples/F90/get_set_uuid.f90 | 2 +- examples/F90/index.f90 | 2 +- examples/F90/iterator_fortran.f90 | 2 +- examples/F90/keys_iterator.f90 | 2 +- examples/F90/keys_iterator_fortran.f90 | 2 +- examples/F90/multi.f90 | 2 +- examples/F90/multi_fortran.f90 | 2 +- examples/F90/multi_write.f90 | 2 +- examples/F90/nearest.f90 | 2 +- examples/F90/new_from_file.f90 | 2 +- examples/F90/precision.f90 | 2 +- examples/F90/precision_fortran.f90 | 2 +- examples/F90/print_data.f90 | 2 +- examples/F90/print_data_fortran.f90 | 2 +- examples/F90/read_from_file.f90 | 2 +- examples/F90/read_message.f90 | 2 +- examples/F90/samples.f90 | 2 +- examples/F90/set.f90 | 2 +- examples/F90/set_bitmap.f90 | 2 +- examples/F90/set_fortran.f90 | 2 +- examples/F90/set_gvc.f90 | 2 +- examples/F90/set_missing.f90 | 2 +- examples/F90/set_missing_fortran.f90 | 2 +- examples/F90/set_pv.f90 | 2 +- fortran/CMakeLists.txt | 24 +++- fortran/Makefile.am | 25 ++-- fortran/create_grib_f90.sh | 8 +- fortran/eccodes_f90_head.f90 | 132 ++++++++++++++++++++ fortran/eccodes_f90_int.f90 | 159 ++++++++++++++++++++++++ fortran/eccodes_f90_int_size_t.f90 | 72 +++++++++++ fortran/eccodes_f90_long_int.f90 | 165 +++++++++++++++++++++++++ fortran/eccodes_f90_long_size_t.f90 | 83 +++++++++++++ fortran/eccodes_f90_tail.f90 | 5 + fortran/grib_f90_head.f90 | 22 ---- fortran/grib_f90_int.f90 | 43 +------ fortran/grib_f90_int_size_t.f90 | 19 --- fortran/grib_f90_long_int.f90 | 48 ------- fortran/grib_f90_long_size_t.f90 | 30 ----- fortran/grib_f90_tail.f90 | 5 - 48 files changed, 690 insertions(+), 216 deletions(-) create mode 100644 fortran/eccodes_f90_head.f90 create mode 100644 fortran/eccodes_f90_int.f90 create mode 100644 fortran/eccodes_f90_int_size_t.f90 create mode 100644 fortran/eccodes_f90_long_int.f90 create mode 100644 fortran/eccodes_f90_long_size_t.f90 diff --git a/examples/F90/clone.f90 b/examples/F90/clone.f90 index b0c23d031..f661b744d 100644 --- a/examples/F90/clone.f90 +++ b/examples/F90/clone.f90 @@ -14,7 +14,7 @@ ! ! program clone - use grib_api + use eccodes implicit none integer :: err,i,iret integer :: nx, ny diff --git a/examples/F90/copy_message.f90 b/examples/F90/copy_message.f90 index dcd24120a..911209414 100644 --- a/examples/F90/copy_message.f90 +++ b/examples/F90/copy_message.f90 @@ -13,7 +13,7 @@ ! ! program copy - use grib_api + use eccodes implicit none integer :: err, centre integer(kind=kindOfSize) :: byte_size diff --git a/examples/F90/copy_namespace.f90 b/examples/F90/copy_namespace.f90 index 14fabadb6..29f457e1c 100644 --- a/examples/F90/copy_namespace.f90 +++ b/examples/F90/copy_namespace.f90 @@ -12,7 +12,7 @@ ! ! program copy_namespace - use grib_api + use eccodes implicit none integer :: file1, file2, file3 integer :: igrib1,igrib2,igrib3 diff --git a/examples/F90/count_messages.f90 b/examples/F90/count_messages.f90 index d1cbc5a36..0cc3b0126 100644 --- a/examples/F90/count_messages.f90 +++ b/examples/F90/count_messages.f90 @@ -10,7 +10,7 @@ ! ! program get - use grib_api + use eccodes implicit none integer :: ifile diff --git a/examples/F90/get.f90 b/examples/F90/get.f90 index 7c78d212d..8cc4d9569 100644 --- a/examples/F90/get.f90 +++ b/examples/F90/get.f90 @@ -11,7 +11,7 @@ ! ! program get - use grib_api + use eccodes implicit none integer :: ifile diff --git a/examples/F90/get_data.f90 b/examples/F90/get_data.f90 index ea84a0ac1..a9862846d 100644 --- a/examples/F90/get_data.f90 +++ b/examples/F90/get_data.f90 @@ -12,7 +12,7 @@ ! ! program get_data -use grib_api +use eccodes implicit none integer :: ifile integer :: iret,i diff --git a/examples/F90/get_fortran.f90 b/examples/F90/get_fortran.f90 index 8066f26f1..4d936ba6a 100644 --- a/examples/F90/get_fortran.f90 +++ b/examples/F90/get_fortran.f90 @@ -6,7 +6,7 @@ ! ! program get -use grib_api +use eccodes implicit none integer :: ifile diff --git a/examples/F90/get_pl.f90 b/examples/F90/get_pl.f90 index bc0660e7d..706410110 100644 --- a/examples/F90/get_pl.f90 +++ b/examples/F90/get_pl.f90 @@ -12,7 +12,7 @@ ! ! program get_pl - use grib_api + use eccodes implicit none integer :: infile integer :: igrib diff --git a/examples/F90/get_pv.f90 b/examples/F90/get_pv.f90 index cda6708fa..b8f28f60b 100644 --- a/examples/F90/get_pv.f90 +++ b/examples/F90/get_pv.f90 @@ -13,7 +13,7 @@ ! ! program get_pv - use grib_api + use eccodes implicit none integer :: infile integer :: igrib diff --git a/examples/F90/get_set_uuid.f90 b/examples/F90/get_set_uuid.f90 index 63e149136..066cc4d5a 100644 --- a/examples/F90/get_set_uuid.f90 +++ b/examples/F90/get_set_uuid.f90 @@ -12,7 +12,7 @@ ! Original authors: Harald Anlauf, Doerte Liermann (DWD), Luis Kornblueh (MPIfM). ! program get_set_uuid - use grib_api + use eccodes implicit none integer :: infile, outfile integer :: igrib, ogrib diff --git a/examples/F90/index.f90 b/examples/F90/index.f90 index 6462400e1..6295049c2 100644 --- a/examples/F90/index.f90 +++ b/examples/F90/index.f90 @@ -13,7 +13,7 @@ ! ! program index - use grib_api + use eccodes implicit none integer :: iret diff --git a/examples/F90/iterator_fortran.f90 b/examples/F90/iterator_fortran.f90 index 181552811..ca4122c27 100644 --- a/examples/F90/iterator_fortran.f90 +++ b/examples/F90/iterator_fortran.f90 @@ -8,7 +8,7 @@ ! ! program iterator -use grib_api +use eccodes implicit none integer :: ifile integer :: iret,iter diff --git a/examples/F90/keys_iterator.f90 b/examples/F90/keys_iterator.f90 index e28a483c0..cb12b0012 100644 --- a/examples/F90/keys_iterator.f90 +++ b/examples/F90/keys_iterator.f90 @@ -14,7 +14,7 @@ ! ! program keys_iterator - use grib_api + use eccodes implicit none character(len=20) :: name_space integer :: kiter,ifile,igrib,iret diff --git a/examples/F90/keys_iterator_fortran.f90 b/examples/F90/keys_iterator_fortran.f90 index 61d720097..a8f8022e4 100644 --- a/examples/F90/keys_iterator_fortran.f90 +++ b/examples/F90/keys_iterator_fortran.f90 @@ -14,7 +14,7 @@ ! ! program keys_iterator - use grib_api + use eccodes implicit none integer :: kiter,ifile,igrib,iret character(len=256) :: key diff --git a/examples/F90/multi.f90 b/examples/F90/multi.f90 index b68457f8b..87b4aa2ff 100644 --- a/examples/F90/multi.f90 +++ b/examples/F90/multi.f90 @@ -16,7 +16,7 @@ ! ! program multi - use grib_api + use eccodes implicit none integer :: iret diff --git a/examples/F90/multi_fortran.f90 b/examples/F90/multi_fortran.f90 index 7d95a77d9..43b994bd5 100644 --- a/examples/F90/multi_fortran.f90 +++ b/examples/F90/multi_fortran.f90 @@ -14,7 +14,7 @@ ! ! program multi - use grib_api + use eccodes implicit none integer :: iret diff --git a/examples/F90/multi_write.f90 b/examples/F90/multi_write.f90 index 078752e0c..93aa66739 100644 --- a/examples/F90/multi_write.f90 +++ b/examples/F90/multi_write.f90 @@ -15,7 +15,7 @@ ! ! program multi_write - use grib_api + use eccodes implicit none integer :: infile,outfile integer :: in_gribid,iret diff --git a/examples/F90/nearest.f90 b/examples/F90/nearest.f90 index 0efeec29c..535e5e0f7 100644 --- a/examples/F90/nearest.f90 +++ b/examples/F90/nearest.f90 @@ -13,7 +13,7 @@ ! ! program find - use grib_api + use eccodes implicit none integer :: npoints integer :: infile diff --git a/examples/F90/new_from_file.f90 b/examples/F90/new_from_file.f90 index 6aba32b5b..437942958 100644 --- a/examples/F90/new_from_file.f90 +++ b/examples/F90/new_from_file.f90 @@ -11,7 +11,7 @@ ! ! program new_from_file -use grib_api +use eccodes implicit none integer :: ifile integer :: iret diff --git a/examples/F90/precision.f90 b/examples/F90/precision.f90 index b5cb06f0e..339145e54 100644 --- a/examples/F90/precision.f90 +++ b/examples/F90/precision.f90 @@ -13,7 +13,7 @@ ! ! program precision - use grib_api + use eccodes implicit none integer(kind = 4) :: size1 integer :: infile,outfile diff --git a/examples/F90/precision_fortran.f90 b/examples/F90/precision_fortran.f90 index 9fd73e698..e925beda7 100644 --- a/examples/F90/precision_fortran.f90 +++ b/examples/F90/precision_fortran.f90 @@ -11,7 +11,7 @@ ! ! program precision - use grib_api + use eccodes implicit none integer(kind = 4) :: size integer :: infile,outfile diff --git a/examples/F90/print_data.f90 b/examples/F90/print_data.f90 index 422ac2bfa..be2ac236d 100644 --- a/examples/F90/print_data.f90 +++ b/examples/F90/print_data.f90 @@ -12,7 +12,7 @@ ! ! program print_data -use grib_api +use eccodes implicit none integer :: ifile integer :: iret diff --git a/examples/F90/print_data_fortran.f90 b/examples/F90/print_data_fortran.f90 index ac3aac117..7ab9ec3c0 100644 --- a/examples/F90/print_data_fortran.f90 +++ b/examples/F90/print_data_fortran.f90 @@ -13,7 +13,7 @@ ! ! program print_data_fortran -use grib_api +use eccodes implicit none integer :: ifile integer :: iret diff --git a/examples/F90/read_from_file.f90 b/examples/F90/read_from_file.f90 index e5cf6f271..f0198d41d 100644 --- a/examples/F90/read_from_file.f90 +++ b/examples/F90/read_from_file.f90 @@ -10,7 +10,7 @@ ! See GRIB-292 ! program read_from_file -use grib_api +use eccodes implicit none character(len=32) :: input_grib_file integer,dimension(26) :: message_lengths ! expected message lengths diff --git a/examples/F90/read_message.f90 b/examples/F90/read_message.f90 index d2056cfe5..73791ee86 100644 --- a/examples/F90/read_message.f90 +++ b/examples/F90/read_message.f90 @@ -10,7 +10,7 @@ ! Description: how to get values using keys. ! program read_message -use grib_api +use eccodes implicit none integer :: ifile,ofile integer :: iret,igrib diff --git a/examples/F90/samples.f90 b/examples/F90/samples.f90 index bbccd59c2..b91247930 100644 --- a/examples/F90/samples.f90 +++ b/examples/F90/samples.f90 @@ -11,7 +11,7 @@ ! ! program sample - use grib_api + use eccodes implicit none integer :: err integer :: outfile, infile, datafile diff --git a/examples/F90/set.f90 b/examples/F90/set.f90 index 68f431c6e..38549c764 100644 --- a/examples/F90/set.f90 +++ b/examples/F90/set.f90 @@ -13,7 +13,7 @@ ! ! program set - use grib_api + use eccodes implicit none integer(kind = 4) :: centre, date1 integer :: infile,outfile diff --git a/examples/F90/set_bitmap.f90 b/examples/F90/set_bitmap.f90 index 6d80bf261..486a633f5 100644 --- a/examples/F90/set_bitmap.f90 +++ b/examples/F90/set_bitmap.f90 @@ -13,7 +13,7 @@ ! ! program set_bitmap - use grib_api + use eccodes implicit none integer :: infile,outfile integer :: igrib, iret diff --git a/examples/F90/set_fortran.f90 b/examples/F90/set_fortran.f90 index 4bd724b36..e025a74e5 100644 --- a/examples/F90/set_fortran.f90 +++ b/examples/F90/set_fortran.f90 @@ -10,7 +10,7 @@ ! ! program set - use grib_api + use eccodes implicit none integer :: err integer(kind = 4) :: centre diff --git a/examples/F90/set_gvc.f90 b/examples/F90/set_gvc.f90 index a53d92e19..ca832cefb 100644 --- a/examples/F90/set_gvc.f90 +++ b/examples/F90/set_gvc.f90 @@ -13,7 +13,7 @@ ! ! program set - use grib_api + use eccodes implicit none integer(kind = 4) :: NV integer :: infile,outfile diff --git a/examples/F90/set_missing.f90 b/examples/F90/set_missing.f90 index bd872d00b..7a713b3d6 100644 --- a/examples/F90/set_missing.f90 +++ b/examples/F90/set_missing.f90 @@ -13,7 +13,7 @@ ! ! program set - use grib_api + use eccodes implicit none integer :: infile,outfile integer :: igrib, Ni, is_missing diff --git a/examples/F90/set_missing_fortran.f90 b/examples/F90/set_missing_fortran.f90 index 1eb4c5ea7..649fe2a4c 100644 --- a/examples/F90/set_missing_fortran.f90 +++ b/examples/F90/set_missing_fortran.f90 @@ -10,7 +10,7 @@ ! ! program set - use grib_api + use eccodes implicit none integer :: err integer :: len diff --git a/examples/F90/set_pv.f90 b/examples/F90/set_pv.f90 index d7fbd8bbb..ff920b65d 100644 --- a/examples/F90/set_pv.f90 +++ b/examples/F90/set_pv.f90 @@ -13,7 +13,7 @@ ! ! program set_pv - use grib_api + use eccodes implicit none integer :: numberOfLevels integer :: numberOfCoefficients diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index ab92e5ab2..3d777ccb6 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -14,28 +14,35 @@ if( EC_HAVE_FORTRAN ) DEPENDS grib_types ) if( ${EC_SIZEOF_INT} EQUAL ${EC_SIZEOF_LONG} ) - set( _long_int_interface grib_f90_int.f90 ) + set( _long_int_interface grib_f90_int.f90 ) + set( _long_int_interface_ec eccodes_f90_int.f90 ) else() - set( _long_int_interface grib_f90_long_int.f90 ) + set( _long_int_interface grib_f90_long_int.f90 ) + set( _long_int_interface_ec eccodes_f90_long_int.f90 ) endif() if( ${EC_SIZEOF_INT} EQUAL ${EC_SIZEOF_SIZE_T} ) - set( _sizet_int_interface grib_f90_int_size_t.f90 ) + set( _sizet_int_interface grib_f90_int_size_t.f90 ) + set( _sizet_int_interface_ec eccodes_f90_int_size_t.f90 ) else() - set( _sizet_int_interface grib_f90_long_size_t.f90 ) + set( _sizet_int_interface grib_f90_long_size_t.f90 ) + set( _sizet_int_interface_ec eccodes_f90_long_size_t.f90 ) endif() add_custom_command( OUTPUT grib_f90.f90 COMMAND cat ${srcdir}/grib_f90_head.f90 ${srcdir}/${_long_int_interface} ${srcdir}/${_sizet_int_interface} ${srcdir}/grib_f90_tail.f90 > grib_f90.f90 DEPENDS grib_f90_head.f90 grib_f90_tail.f90 grib_kinds.h ${_long_int_interface} ${_sizet_int_interface} ) + add_custom_command( OUTPUT eccodes_f90.f90 + COMMAND cat ${srcdir}/eccodes_f90_head.f90 ${srcdir}/${_long_int_interface_ec} ${srcdir}/${_sizet_int_interface_ec} ${srcdir}/eccodes_f90_tail.f90 > eccodes_f90.f90 + DEPENDS eccodes_f90_head.f90 eccodes_f90_tail.f90 grib_kinds.h ${_long_int_interface_ec} ${_sizet_int_interface_ec} ) ecbuild_add_library( TARGET grib_api_f77 SOURCES grib_fortran.c grib_f77.c LIBS grib_api ) ecbuild_add_library( TARGET grib_api_f90 - SOURCES grib_fortran.c grib_f90.f90 grib_kinds.h - GENERATED grib_f90.f90 + SOURCES grib_fortran.c grib_f90.f90 eccodes_f90.f90 grib_kinds.h + GENERATED grib_f90.f90 eccodes_f90.f90 LIBS grib_api ) # Add the eccodes module file as well @@ -59,6 +66,11 @@ if( EC_HAVE_FORTRAN ) grib_api_visibility.h grib_types.f90 create_grib_f90.sh grib_f90.f90.head grib_f90.f90.tail grib_f90_int.f90 grib_f90_long_int.f90 grib_f90_int_size_t.f90 grib_f90_long_size_t.f90 + + eccodes_visibility.h eccodes_constants.h + eccodes_f90.f90.head eccodes_f90.f90.tail eccodes_f90_int.f90 eccodes_f90_long_int.f90 + eccodes_f90_int_size_t.f90 eccodes_f90_long_size_t.f90 + same_int_long.f90 same_int_size_t.f90 grib_fortran_kinds.c ) diff --git a/fortran/Makefile.am b/fortran/Makefile.am index 92b33facf..10e3319de 100644 --- a/fortran/Makefile.am +++ b/fortran/Makefile.am @@ -9,7 +9,7 @@ libgrib_api_f77_la_SOURCES= grib_fortran.c grib_f77.c libgrib_api_f77_la_DEPENDENCIES = $(top_builddir)/src/libgrib_api.la libgrib_api_f77_la_LDFLAGS = -version-info $(GRIB_ABI_CURRENT):$(GRIB_ABI_REVISION):$(GRIB_ABI_AGE) -libgrib_api_f90_la_SOURCES= grib_fortran.c grib_f90.f90 +libgrib_api_f90_la_SOURCES= grib_fortran.c grib_f90.f90 eccodes_f90.f90 libgrib_api_f90_la_DEPENDENCIES = $(top_builddir)/src/libgrib_api.la grib_api_externals.h grib_api_visibility.h grib_api_constants.h grib_kinds.h libgrib_api_f90_la_LDFLAGS = -version-info $(GRIB_ABI_CURRENT):$(GRIB_ABI_REVISION):$(GRIB_ABI_AGE) @@ -18,9 +18,11 @@ libgrib_api_fortran_prototypes= grib_fortran.c if UPPER_CASE_MOD_FALSE nodist_include_HEADERS = grib_api.mod grib_api.mod: grib_f90.o +eccodes.mod: eccodes_f90.o else nodist_include_HEADERS = GRIB_API.mod GRIB_API.mod: grib_f90.o +ECCODES.mod: eccodes_f90.o endif # set the include path @@ -28,7 +30,7 @@ INCLUDES= -I$(top_builddir)/src ## Make sure these will be cleaned even when they're not built by ## default. -CLEANFILES = libgrib_api_f77.la libgrib_api_f90.la grib_f90.f90 *.mod grib_types grib_kinds.h same_int_long same_int_size_t +CLEANFILES = libgrib_api_f77.la libgrib_api_f90.la grib_f90.f90 eccodes_f90.f90 *.mod grib_types grib_kinds.h same_int_long same_int_size_t #noinst_HEADERS = @@ -36,14 +38,23 @@ EXTRA_DIST= grib_fortran_prototypes.h grib_api_constants.h grib_api_externals.h grib_api_visibility.h grib_types.f90 create_grib_f90.sh \ grib_f90_head.f90 grib_f90_tail.f90 grib_f90_int.f90 grib_f90_long_int.f90 \ grib_f90_int_size_t.f90 grib_f90_long_size_t.f90 \ + \ + eccodes_f90_head.f90 eccodes_f90_tail.f90 eccodes_f90_int.f90 eccodes_f90_long_int.f90 \ + eccodes_f90_int_size_t.f90 eccodes_f90_long_size_t.f90 \ same_int_long.f90 same_int_size_t.f90 grib_fortran_kinds.c \ CMakeLists.txt grib_f90.f90: grib_f90_head.f90 grib_f90_tail.f90 grib_f90_int.f90 grib_f90_long_int.f90 grib_f90_int_size_t.f90 grib_f90_long_size_t.f90 same_int_long same_int_size_t grib_kinds.h - ./create_grib_f90.sh + ./create_grib_f90.sh + +eccodes_f90.f90: eccodes_f90_head.f90 eccodes_f90_tail.f90 eccodes_f90_int.f90 eccodes_f90_long_int.f90 eccodes_f90_int_size_t.f90 eccodes_f90_long_size_t.f90 same_int_long same_int_size_t grib_kinds.h + ./create_grib_f90.sh + grib_f90.o : grib_kinds.h +eccodes_f90.o : grib_kinds.h + grib_kinds.h: grib_types ./grib_types > grib_kinds.h @@ -56,13 +67,9 @@ same_int_long: same_int_long.o grib_fortran_kinds.o same_int_size_t: same_int_size_t.o grib_fortran_kinds.o $(FC) $(FCFLAGS) -o same_int_size_t same_int_size_t.o grib_fortran_kinds.o -# After the installation, create the eccodes module file as a symlink # Note: hooks are always executed after the main rule's work is done -install-data-hook: - ( cd $(DESTDIR)$(includedir) && ln -s $(nodist_include_HEADERS) eccodes.mod ) +#install-data-hook: +# ( some commands in here .... ) include extrules.am -all-local: - rm -f eccodes.mod; ln -s $(nodist_include_HEADERS) eccodes.mod - diff --git a/fortran/create_grib_f90.sh b/fortran/create_grib_f90.sh index 032a880ef..06bb220ad 100755 --- a/fortran/create_grib_f90.sh +++ b/fortran/create_grib_f90.sh @@ -12,8 +12,10 @@ same=`./same_int_long` if [ $same -eq 1 ] then long=grib_f90_int.f90 + ec_long=eccodes_f90_int.f90 else long=grib_f90_long_int.f90 + ec_long=eccodes_f90_long_int.f90 fi same=`./same_int_size_t` @@ -21,9 +23,11 @@ same=`./same_int_size_t` if [ $same -eq 1 ] then sizet=grib_f90_int_size_t.f90 + ec_sizet=eccodes_f90_int_size_t.f90 else sizet=grib_f90_long_size_t.f90 + ec_sizet=eccodes_f90_long_size_t.f90 fi -cat grib_f90_head.f90 $long $sizet grib_f90_tail.f90 > grib_f90.f90 - +cat grib_f90_head.f90 $long $sizet grib_f90_tail.f90 > grib_f90.f90 +cat eccodes_f90_head.f90 $ec_long $ec_sizet eccodes_f90_tail.f90 > eccodes_f90.f90 diff --git a/fortran/eccodes_f90_head.f90 b/fortran/eccodes_f90_head.f90 new file mode 100644 index 000000000..c30aa01d5 --- /dev/null +++ b/fortran/eccodes_f90_head.f90 @@ -0,0 +1,132 @@ +! 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. +! +! +!> Module eccodes +!> +!> The eccodes module provides the Fortran 90 interface. +module eccodes + + use grib_api + implicit none + include "eccodes_constants.h" + include "eccodes_visibility.h" + + !> Create a new message in memory from an integer or character array containting the coded message. + !> + !> The message can be accessed through its gribid and it will be available\n + !> until @ref codes_release is called. A reference to the original coded\n + !> message is kept in the new message structure. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> + !> \b Examples: \ref copy_message.f90 "copy_message.f90" + !> + !> @param gribid id of the grib loaded in memory + !> @param message array containing the coded message + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_new_from_message + module procedure codes_new_from_message_int4 + module procedure codes_new_from_message_char + end interface codes_new_from_message + + !> Get a value of specified index from an array key. + !> + !> Given a gribid and key name as input a value corresponding to the given index + !> is returned. The index is zero based i.e. the first element has + !> zero index, the second element index one and so on. + !> If the parameter index is an array all the values correspondig to the indexes + !> list is returned. + !> The gribid references to a grib message loaded in memory. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> 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" + !> + !> @see codes_new_from_file, codes_release, codes_get + !> + !> @param[in] gribid id of the grib loaded in memory + !> @param[in] key key name + !> @param[in] index index can be a scalar or array of integer(4) + !> @param[out] value value can be a scalar or array of integer(4),real(4),real(8) + !> @param[out] status CODES_SUCCESS if OK, integer value on error + interface codes_get_element + module procedure codes_get_real4_element, & + codes_get_real8_element, & + codes_get_real4_elements, & + codes_get_real8_elements + end interface codes_get_element + + !> Find the nearest point/points of a given latitude/longitude point. + !> + !> The value in the nearest point (or the four nearest points) is returned as well as the + !> zero based index (which can be used in @ref codes_get_element) + !> and its distance from the given point using the following + !> formula radius * acos( sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon1-lon2) ). + !> + !> If the is_lsm flag is .true. the input field gribid is considered as + !> a land sea mask and the nearest land point is returned.\n + !> The nearest land point among the four neighbours is: + !> - the nearest point with land sea mask value >= 0.5 + !> - the nearest without any other condition if all the four have land sea mask value <0.5. + !> + !> Arrays (real(8)) of latitude/longitude can be provided to find with one call + !> the values,indexes and distances for all the lat/lon points listed in the arrays. + !> + !> If a single latitude/longitude point is provided and outlat,outlon,value,distance,index + !> are defined as arrays with four elements the lat/lon coordinates and values, distances + !> and indexes of the four nearest points are returned. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> 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" + !> + !> @param[in] gribid id of the grib loaded in memory + !> @param[in] is_lsm .true. if the nearest land point is required otherwise .false. + !> @param[in] inlat latitude of the point in degrees + !> @param[in] inlon longitudes of the point in degrees + !> @param[out] outlat latitude of the nearest point in degrees + !> @param[out] outlon longitude of the nearest point in degrees + !> @param[out] distance distance between the given point and its nearest (in km) + !> @param[out] index zero based index + !> @param[out] value value of the field in the nearest point + !> @param[out] status CODES_SUCCESS if OK, integer value on error + interface codes_find_nearest + module procedure codes_find_nearest_single, & + codes_find_nearest_four_single, & + codes_find_nearest_multiple + end interface codes_find_nearest + + !> Get latitude/longitude and data values. + !> + !> Latitudes, longitudes, data values arrays are returned. + !> They must be properly allocated by the caller and their required + !> dimension can be obtained with \ref codes_get_size or by getting (with \ref codes_get) + !> the value of the integer key "numberOfPoints". + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> \b Examples: \ref get_data.f90 "get_data.f90" + !> + !> @param[in] gribid id of the grib loaded in memory + !> @param[out] lats latitudes array with dimension "size" + !> @param[out] lons longitudes array with dimension "size" + !> @param[out] values data values array with dimension "size" + interface codes_get_data + module procedure codes_get_data_real4, & + codes_get_data_real8 + end interface codes_get_data diff --git a/fortran/eccodes_f90_int.f90 b/fortran/eccodes_f90_int.f90 new file mode 100644 index 000000000..ad458fae2 --- /dev/null +++ b/fortran/eccodes_f90_int.f90 @@ -0,0 +1,159 @@ +! 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. + + + !> Get the distinct values of the key in argument contained in the index. The key must belong to the index. + !> + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> \b Examples: \ref index.f90 "index.f90" + !> + !> @param indexid id of an index created from a file. The index must have been created with the key in argument. + !> @param key key for wich the values are returned + !> @param values array of values. The array must be allocated before entering this function and its size must be enough to contain all the values. + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_index_get + module procedure codes_index_get_int, & + codes_index_get_string, & + codes_index_get_real8 + end interface codes_index_get + + !> Get the number of distinct values of the key in argument contained in the index. The key must belong to the index. + !> + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> \b Examples: \ref index.f90 "index.f90" + !> + !> @param indexid id of an index created from a file. The index must have been created with the key in argument. + !> @param key key for which the number of values is computed + !> @param size number of distinct values of the key in the index + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_index_get_size + module procedure codes_index_get_size_int + end interface codes_index_get_size + + !> Select the message subset with key==value. + !> + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> \b Examples: \ref index.f90 "index.f90" + !> + !> @param indexid id of an index created from a file. The index must have been created with the key in argument. + !> @param key key to be selected + !> @param value value of the key to select + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_index_select + module procedure codes_index_select_int, & + codes_index_select_string, & + codes_index_select_real8 + end interface codes_index_select + + !> Get the value for a key from a grib message. + !> + !> Given a \em gribid and \em key as input a \em value for the \em key is returned. + !> In some cases the \em value can be an array rather than a scalar. + !> As examples of array keys we have "values","pl", "pv" respectively the data values, + !> the list of number of points for each latitude in a reduced grid and the list of + !> vertical levels. In these cases the \em value array must be allocated by the caller + !> and their required dimension can be obtained with \ref codes_get_size. \n + !> The \em value can be integer(4), real(4), real(8), character. + !> Although each key has its own native type, a key of type integer + !> can be retrieved (with \ref codes_get) as real(4), real(8) or character. + !> Analogous conversions are always provided when possible. + !> Illegal conversions are real to integer and character to any other type. + !> + !> The \em gribid references to a grib message loaded in memory. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> \b Examples: \ref get.f90 "get.f90", \ref print_data.f90 "print_data.f90" + !> + !> @see codes_new_from_file, codes_release, codes_set + !> + !> + !> @param[in] gribid id of the grib loaded in memory + !> @param[in] key key name + !> @param[out] value value can be a scalar or array of integer(4),real(4),real(8),character + !> @param[out] status CODES_SUCCESS if OK, integer value on error + interface codes_get + module procedure codes_get_int, & + codes_get_real4, & + codes_get_real8, & + codes_get_string, & + codes_get_int_array, & + codes_get_byte_array, & + codes_get_real4_array, & + codes_get_real8_array + end interface codes_get + + + !> Get the size of an array key. + !> + !> To get the size of a key representing an array. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> @param gribid id of the grib loaded in memory + !> @param key name of the key + !> @param size size of the array key + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_get_size + module procedure codes_get_size_int + end interface codes_get_size + + !> Set the value for a key in a grib message. + !> + !> The given \em value is set for the \em key in the \em gribid message. + !> In some cases the \em value can be an array rather than a scalar. + !> As examples of array keys we have "values","pl", "pv" respectively the data values, + !> the list of number of points for each latitude in a reduced grid and the list of + !> vertical levels. In these cases the \em value array must be allocated by the caller + !> and their required dimension can be obtained with \ref codes_get_size. \n + !> The gribid references to a grib message loaded in memory. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> \b Examples: \ref set.f90 "set.f90" + !> + !> @see codes_new_from_file, codes_release, codes_get + !> + !> @param[in] gribid id of the grib loaded in memory + !> @param[in] key key name + !> @param[out] value value can be a scalar or array of integer(4),real(4),real(8) + !> @param[out] status CODES_SUCCESS if OK, integer value on error + interface codes_set + module procedure codes_set_int, & + codes_set_real4, & + codes_set_real8, & + codes_set_string, & + codes_set_int_array, & + codes_set_byte_array, & + codes_set_real4_array, & + codes_set_real8_array + end interface codes_set + + interface codes_set_force + module procedure codes_set_force_real4_array, & + codes_set_force_real8_array + end interface codes_set_force + diff --git a/fortran/eccodes_f90_int_size_t.f90 b/fortran/eccodes_f90_int_size_t.f90 new file mode 100644 index 000000000..b638aad41 --- /dev/null +++ b/fortran/eccodes_f90_int_size_t.f90 @@ -0,0 +1,72 @@ +! 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. + + !> Reads a message in the buffer array from the file opened with codes_open_file. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> + !> @param ifile id of the opened file to be used in all the file functions. + !> @param buffer buffer to be read + !> @param nbytes number of bytes to be read + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_read_from_file + module procedure codes_read_from_file_int4 + module procedure codes_read_from_file_char + end interface codes_read_from_file + + !> Reads nbytes bytes into the buffer from a file opened with codes_open_file. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> + !> @param ifile id of the opened file to be used in all the file functions. + !> @param buffer buffer to be read + !> @param nbytes number of bytes to be read + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_read_bytes + module procedure codes_read_bytes_int4 + module procedure codes_read_bytes_char + module procedure codes_read_bytes_real8 + module procedure codes_read_bytes_real4 + end interface codes_read_bytes + + !> Write nbytes bytes from the buffer in a file opened with codes_open_file. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> + !> @param ifile id of the opened file to be used in all the file functions. + !> @param buffer buffer to be written + !> @param nbytes number of bytes to be written + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_write_bytes + module procedure codes_write_bytes_int4 + module procedure codes_write_bytes_char + module procedure codes_write_bytes_real8 + module procedure codes_write_bytes_real4 + end interface codes_write_bytes + + !> Get the size of a coded message. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> @param gribid id of the grib loaded in memory + !> @param nbytes size in bytes of the message + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_get_message_size + module procedure codes_get_message_size_int + end interface codes_get_message_size diff --git a/fortran/eccodes_f90_long_int.f90 b/fortran/eccodes_f90_long_int.f90 new file mode 100644 index 000000000..72ff1ae52 --- /dev/null +++ b/fortran/eccodes_f90_long_int.f90 @@ -0,0 +1,165 @@ +! 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. + + + !> Get the distinct values of the key in argument contained in the index. The key must belong to the index. + !> + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> \b Examples: \ref index.f90 "index.f90" + !> + !> @param indexid id of an index created from a file. The index must have been created with the key in argument. + !> @param key key for wich the values are returned + !> @param values array of values. The array must be allocated before entering this function and its size must be enough to contain all the values. + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_index_get + module procedure codes_index_get_int, & + codes_index_get_long, & + codes_index_get_string, & + codes_index_get_real8 + end interface codes_index_get + + !> Get the number of distinct values of the key in argument contained in the index. The key must belong to the index. + !> + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> \b Examples: \ref index.f90 "index.f90" + !> + !> @param indexid id of an index created from a file. The index must have been created with the key in argument. + !> @param key key for which the number of values is computed + !> @param size number of distinct values of the key in the index + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_index_get_size + module procedure codes_index_get_size_int, & + codes_index_get_size_long + end interface codes_index_get_size + + !> Select the message subset with key==value. + !> + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> \b Examples: \ref index.f90 "index.f90" + !> + !> @param indexid id of an index created from a file. The index must have been created with the key in argument. + !> @param key key to be selected + !> @param value value of the key to select + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_index_select + module procedure codes_index_select_int, & + codes_index_select_long, & + codes_index_select_string, & + codes_index_select_real8 + end interface codes_index_select + + !> Get the value for a key from a grib message. + !> + !> Given a \em gribid and \em key as input a \em value for the \em key is returned. + !> In some cases the \em value can be an array rather than a scalar. + !> As examples of array keys we have "values","pl", "pv" respectively the data values, + !> the list of number of points for each latitude in a reduced grid and the list of + !> vertical levels. In these cases the \em value array must be allocated by the caller + !> and their required dimension can be obtained with \ref codes_get_size. \n + !> The \em value can be integer(4), real(4), real(8), character. + !> Although each key has its own native type, a key of type integer + !> can be retrieved (with \ref codes_get) as real(4), real(8) or character. + !> Analogous conversions are always provided when possible. + !> Illegal conversions are real to integer and character to any other type. + !> + !> The \em gribid references to a grib message loaded in memory. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> \b Examples: \ref get.f90 "get.f90", \ref print_data.f90 "print_data.f90" + !> + !> @see codes_new_from_file, codes_release, codes_set + !> + !> + !> @param[in] gribid id of the grib loaded in memory + !> @param[in] key key name + !> @param[out] value value can be a scalar or array of integer(4),real(4),real(8),character + !> @param[out] status CODES_SUCCESS if OK, integer value on error + interface codes_get + module procedure codes_get_int, & + codes_get_long, & + codes_get_real4, & + codes_get_real8, & + codes_get_string, & + codes_get_int_array, & + codes_get_byte_array, & + codes_get_real4_array, & + codes_get_real8_array + end interface codes_get + + !> Get the size of an array key. + !> + !> To get the size of a key representing an array. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> @param gribid id of the grib loaded in memory + !> @param key name of the key + !> @param size size of the array key + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_get_size + module procedure codes_get_size_int, & + codes_get_size_long + end interface codes_get_size + + !> Set the value for a key in a grib message. + !> + !> The given \em value is set for the \em key in the \em gribid message. + !> In some cases the \em value can be an array rather than a scalar. + !> As examples of array keys we have "values","pl", "pv" respectively the data values, + !> the list of number of points for each latitude in a reduced grid and the list of + !> vertical levels. In these cases the \em value array must be allocated by the caller + !> and their required dimension can be obtained with \ref codes_get_size. \n + !> The gribid references to a grib message loaded in memory. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> \b Examples: \ref set.f90 "set.f90" + !> + !> @see codes_new_from_file, codes_release, codes_get + !> + !> @param[in] gribid id of the grib loaded in memory + !> @param[in] key key name + !> @param[out] value value can be a scalar or array of integer(4),real(4),real(8) + !> @param[out] status CODES_SUCCESS if OK, integer value on error + interface codes_set + module procedure codes_set_int, & + codes_set_long, & + codes_set_real4, & + codes_set_real8, & + codes_set_string, & + codes_set_int_array, & + codes_set_long_array, & + codes_set_byte_array, & + codes_set_real4_array, & + codes_set_real8_array + end interface codes_set + + interface codes_set_force + module procedure codes_set_force_real4_array, & + codes_set_force_real8_array + end interface codes_set_force + diff --git a/fortran/eccodes_f90_long_size_t.f90 b/fortran/eccodes_f90_long_size_t.f90 new file mode 100644 index 000000000..c73a4b231 --- /dev/null +++ b/fortran/eccodes_f90_long_size_t.f90 @@ -0,0 +1,83 @@ +! 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. + + !> Reads a message in the buffer array from the file opened with codes_open_file. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> + !> @param ifile id of the opened file to be used in all the file functions. + !> @param buffer buffer to be read + !> @param nbytes number of bytes to be read + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_read_from_file + module procedure codes_read_from_file_int4 + module procedure codes_read_from_file_int4_size_t + module procedure codes_read_from_file_char + module procedure codes_read_from_file_char_size_t + end interface codes_read_from_file + + !> Reads nbytes bytes into the buffer from a file opened with codes_open_file. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> + !> @param ifile id of the opened file to be used in all the file functions. + !> @param buffer buffer to be read + !> @param nbytes number of bytes to be read + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_read_bytes + module procedure codes_read_bytes_int4 + module procedure codes_read_bytes_int4_size_t + module procedure codes_read_bytes_char + module procedure codes_read_bytes_char_size_t + module procedure codes_read_bytes_real8 + module procedure codes_read_bytes_real8_size_t + module procedure codes_read_bytes_real4 + module procedure codes_read_bytes_real4_size_t + end interface codes_read_bytes + + !> Write nbytes bytes from the buffer in a file opened with codes_open_file. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> + !> @param ifile id of the opened file to be used in all the file functions. + !> @param buffer buffer to be written + !> @param nbytes number of bytes to be written + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_write_bytes + module procedure codes_write_bytes_int4 + module procedure codes_write_bytes_int4_size_t + module procedure codes_write_bytes_char + module procedure codes_write_bytes_char_size_t + module procedure codes_write_bytes_real8 + module procedure codes_write_bytes_real8_size_t + module procedure codes_write_bytes_real4 + module procedure codes_write_bytes_real4_size_t + end interface codes_write_bytes + + !> Get the size of a coded message. + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref codes_get_error_string. + !> + !> @param gribid id of the grib loaded in memory + !> @param nbytes size in bytes of the message + !> @param status CODES_SUCCESS if OK, integer value on error + interface codes_get_message_size + module procedure codes_get_message_size_int + module procedure codes_get_message_size_size_t + end interface codes_get_message_size diff --git a/fortran/eccodes_f90_tail.f90 b/fortran/eccodes_f90_tail.f90 index cb9546cf1..0b93757c7 100644 --- a/fortran/eccodes_f90_tail.f90 +++ b/fortran/eccodes_f90_tail.f90 @@ -1,3 +1,6 @@ + + contains + !> !> Wrapper for eccodes !> @@ -1245,3 +1248,5 @@ subroutine codes_skip_read_only ( iterid, status ) call grib_skip_read_only ( iterid, status ) end subroutine codes_skip_read_only + +end module eccodes diff --git a/fortran/grib_f90_head.f90 b/fortran/grib_f90_head.f90 index be6afd02a..a9383da97 100644 --- a/fortran/grib_f90_head.f90 +++ b/fortran/grib_f90_head.f90 @@ -15,10 +15,8 @@ module grib_api implicit none include "grib_kinds.h" include "grib_api_constants.h" - include "eccodes_constants.h" include "grib_api_externals.h" include "grib_api_visibility.h" - include "eccodes_visibility.h" !> Create a new message in memory from an integer or character array containting the coded message. !> @@ -40,10 +38,6 @@ module grib_api module procedure grib_new_from_message_int4 module procedure grib_new_from_message_char end interface grib_new_from_message - interface codes_new_from_message - module procedure codes_new_from_message_int4 - module procedure codes_new_from_message_char - end interface codes_new_from_message !> Get a value of specified index from an array key. !> @@ -73,12 +67,6 @@ module grib_api grib_get_real4_elements, & grib_get_real8_elements end interface grib_get_element - interface codes_get_element - module procedure codes_get_real4_element, & - codes_get_real8_element, & - codes_get_real4_elements, & - codes_get_real8_elements - end interface codes_get_element !> Find the nearest point/points of a given latitude/longitude point. !> @@ -122,12 +110,6 @@ module grib_api grib_find_nearest_multiple end interface grib_find_nearest - interface codes_find_nearest - module procedure codes_find_nearest_single, & - codes_find_nearest_four_single, & - codes_find_nearest_multiple - end interface codes_find_nearest - !> Get latitude/longitude and data values. !> !> Latitudes, longitudes, data values arrays are returned. @@ -151,7 +133,3 @@ module grib_api grib_get_data_real8 end interface grib_get_data - interface codes_get_data - module procedure codes_get_data_real4, & - codes_get_data_real8 - end interface codes_get_data diff --git a/fortran/grib_f90_int.f90 b/fortran/grib_f90_int.f90 index 73d0d6506..69dbfeff4 100644 --- a/fortran/grib_f90_int.f90 +++ b/fortran/grib_f90_int.f90 @@ -25,11 +25,6 @@ grib_index_get_string, & grib_index_get_real8 end interface grib_index_get - interface codes_index_get - module procedure codes_index_get_int, & - codes_index_get_string, & - codes_index_get_real8 - end interface codes_index_get !> Get the number of distinct values of the key in argument contained in the index. The key must belong to the index. !> @@ -47,9 +42,6 @@ interface grib_index_get_size module procedure grib_index_get_size_int end interface grib_index_get_size - interface codes_index_get_size - module procedure codes_index_get_size_int - end interface codes_index_get_size !> Select the message subset with key==value. !> @@ -69,11 +61,6 @@ grib_index_select_string, & grib_index_select_real8 end interface grib_index_select - interface codes_index_select - module procedure codes_index_select_int, & - codes_index_select_string, & - codes_index_select_real8 - end interface codes_index_select !> Get the value for a key from a grib message. !> @@ -114,17 +101,7 @@ grib_get_real4_array, & grib_get_real8_array end interface grib_get - interface codes_get - module procedure codes_get_int, & - codes_get_real4, & - codes_get_real8, & - codes_get_string, & - codes_get_int_array, & - codes_get_byte_array, & - codes_get_real4_array, & - codes_get_real8_array - end interface codes_get - + !> Get the size of an array key. !> @@ -141,9 +118,6 @@ interface grib_get_size module procedure grib_get_size_int end interface grib_get_size - interface codes_get_size - module procedure codes_get_size_int - end interface codes_get_size !> Set the value for a key in a grib message. !> @@ -177,23 +151,8 @@ grib_set_real4_array, & grib_set_real8_array end interface grib_set - interface codes_set - module procedure codes_set_int, & - codes_set_real4, & - codes_set_real8, & - codes_set_string, & - codes_set_int_array, & - codes_set_byte_array, & - codes_set_real4_array, & - codes_set_real8_array - end interface codes_set interface grib_set_force module procedure grib_set_force_real4_array, & grib_set_force_real8_array end interface grib_set_force - interface codes_set_force - module procedure codes_set_force_real4_array, & - codes_set_force_real8_array - end interface codes_set_force - diff --git a/fortran/grib_f90_int_size_t.f90 b/fortran/grib_f90_int_size_t.f90 index 742615a35..fb0c695d2 100644 --- a/fortran/grib_f90_int_size_t.f90 +++ b/fortran/grib_f90_int_size_t.f90 @@ -21,10 +21,6 @@ module procedure grib_read_from_file_int4 module procedure grib_read_from_file_char end interface grib_read_from_file - interface codes_read_from_file - module procedure codes_read_from_file_int4 - module procedure codes_read_from_file_char - end interface codes_read_from_file !> Reads nbytes bytes into the buffer from a file opened with grib_open_file. !> @@ -43,12 +39,6 @@ module procedure grib_read_bytes_real8 module procedure grib_read_bytes_real4 end interface grib_read_bytes - interface codes_read_bytes - module procedure codes_read_bytes_int4 - module procedure codes_read_bytes_char - module procedure codes_read_bytes_real8 - module procedure codes_read_bytes_real4 - end interface codes_read_bytes !> Write nbytes bytes from the buffer in a file opened with grib_open_file. !> @@ -67,12 +57,6 @@ module procedure grib_write_bytes_real8 module procedure grib_write_bytes_real4 end interface grib_write_bytes - interface codes_write_bytes - module procedure codes_write_bytes_int4 - module procedure codes_write_bytes_char - module procedure codes_write_bytes_real8 - module procedure codes_write_bytes_real4 - end interface codes_write_bytes !> Get the size of a coded message. !> @@ -86,6 +70,3 @@ interface grib_get_message_size module procedure grib_get_message_size_int end interface grib_get_message_size - interface codes_get_message_size - module procedure codes_get_message_size_int - end interface codes_get_message_size diff --git a/fortran/grib_f90_long_int.f90 b/fortran/grib_f90_long_int.f90 index 97dae78cd..e6ef13691 100644 --- a/fortran/grib_f90_long_int.f90 +++ b/fortran/grib_f90_long_int.f90 @@ -26,12 +26,6 @@ grib_index_get_string, & grib_index_get_real8 end interface grib_index_get - interface codes_index_get - module procedure codes_index_get_int, & - codes_index_get_long, & - codes_index_get_string, & - codes_index_get_real8 - end interface codes_index_get !> Get the number of distinct values of the key in argument contained in the index. The key must belong to the index. !> @@ -50,10 +44,6 @@ module procedure grib_index_get_size_int, & grib_index_get_size_long end interface grib_index_get_size - interface codes_index_get_size - module procedure codes_index_get_size_int, & - codes_index_get_size_long - end interface codes_index_get_size !> Select the message subset with key==value. !> @@ -74,12 +64,6 @@ grib_index_select_string, & grib_index_select_real8 end interface grib_index_select - interface codes_index_select - module procedure codes_index_select_int, & - codes_index_select_long, & - codes_index_select_string, & - codes_index_select_real8 - end interface codes_index_select !> Get the value for a key from a grib message. !> @@ -121,17 +105,6 @@ grib_get_real4_array, & grib_get_real8_array end interface grib_get - interface codes_get - module procedure codes_get_int, & - codes_get_long, & - codes_get_real4, & - codes_get_real8, & - codes_get_string, & - codes_get_int_array, & - codes_get_byte_array, & - codes_get_real4_array, & - codes_get_real8_array - end interface codes_get !> Get the size of an array key. !> @@ -149,10 +122,6 @@ module procedure grib_get_size_int, & grib_get_size_long end interface grib_get_size - interface codes_get_size - module procedure codes_get_size_int, & - codes_get_size_long - end interface codes_get_size !> Set the value for a key in a grib message. !> @@ -188,25 +157,8 @@ grib_set_real4_array, & grib_set_real8_array end interface grib_set - interface codes_set - module procedure codes_set_int, & - codes_set_long, & - codes_set_real4, & - codes_set_real8, & - codes_set_string, & - codes_set_int_array, & - codes_set_long_array, & - codes_set_byte_array, & - codes_set_real4_array, & - codes_set_real8_array - end interface codes_set interface grib_set_force module procedure grib_set_force_real4_array, & grib_set_force_real8_array end interface grib_set_force - interface codes_set_force - module procedure codes_set_force_real4_array, & - codes_set_force_real8_array - end interface codes_set_force - diff --git a/fortran/grib_f90_long_size_t.f90 b/fortran/grib_f90_long_size_t.f90 index f943edb13..3b74b4d4c 100644 --- a/fortran/grib_f90_long_size_t.f90 +++ b/fortran/grib_f90_long_size_t.f90 @@ -23,12 +23,6 @@ module procedure grib_read_from_file_char module procedure grib_read_from_file_char_size_t end interface grib_read_from_file - interface codes_read_from_file - module procedure codes_read_from_file_int4 - module procedure codes_read_from_file_int4_size_t - module procedure codes_read_from_file_char - module procedure codes_read_from_file_char_size_t - end interface codes_read_from_file !> Reads nbytes bytes into the buffer from a file opened with grib_open_file. !> @@ -51,16 +45,6 @@ module procedure grib_read_bytes_real4 module procedure grib_read_bytes_real4_size_t end interface grib_read_bytes - interface codes_read_bytes - module procedure codes_read_bytes_int4 - module procedure codes_read_bytes_int4_size_t - module procedure codes_read_bytes_char - module procedure codes_read_bytes_char_size_t - module procedure codes_read_bytes_real8 - module procedure codes_read_bytes_real8_size_t - module procedure codes_read_bytes_real4 - module procedure codes_read_bytes_real4_size_t - end interface codes_read_bytes !> Write nbytes bytes from the buffer in a file opened with grib_open_file. !> @@ -83,16 +67,6 @@ module procedure grib_write_bytes_real4 module procedure grib_write_bytes_real4_size_t end interface grib_write_bytes - interface codes_write_bytes - module procedure codes_write_bytes_int4 - module procedure codes_write_bytes_int4_size_t - module procedure codes_write_bytes_char - module procedure codes_write_bytes_char_size_t - module procedure codes_write_bytes_real8 - module procedure codes_write_bytes_real8_size_t - module procedure codes_write_bytes_real4 - module procedure codes_write_bytes_real4_size_t - end interface codes_write_bytes !> Get the size of a coded message. !> @@ -107,7 +81,3 @@ module procedure grib_get_message_size_int module procedure grib_get_message_size_size_t end interface grib_get_message_size - interface codes_get_message_size - module procedure codes_get_message_size_int - module procedure codes_get_message_size_size_t - end interface codes_get_message_size diff --git a/fortran/grib_f90_tail.f90 b/fortran/grib_f90_tail.f90 index 094569455..ce75a0b86 100644 --- a/fortran/grib_f90_tail.f90 +++ b/fortran/grib_f90_tail.f90 @@ -3132,10 +3132,5 @@ endif end subroutine grib_skip_read_only -!> -!> eccodes wrapper functions -!> -include "eccodes_f90_tail.f90" - end module grib_api