Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Problem running Program

deadpickle
Beginner
482 Views
I am trying to use the library grib_api available from ECMWF. It is a program for reading and decoding GRIB files. I am running a test program as such:
PROGRAM api_test
USE grib_api
IMPLICIT NONE

!######################################
real(8) :: lats, lons
real(8), dimension(:), allocatable :: nearest_lats, nearest_lons
real(8), dimension(:), allocatable :: distances, values, lsm_values
integer(kind=kindOfInt), dimension(:), allocatable :: indexes
integer :: npoints
integer :: infile
integer :: igrib, ios, i

!######################################
npoints = 1

allocate(nearest_lats(npoints))
allocate(nearest_lons(npoints))
allocate(distances(npoints))
allocate(lsm_values(npoints))
allocate(values(npoints))
allocate(indexes(npoints))

!lats(1) = 39.2306404113770
!lons(1) = -100.880210876465
lats = 39.2306404113770
lons = -100.880210876465

call grib_open_file(infile, '/mnt/share/narr/u-v_comp/narr-a_221_20080522_1800_000.grb','r')
call grib_new_from_file(infile,igrib)

call grib_find_nearest(igrib, .true., lats, lons, nearest_lats, nearest_lons,lsm_values, distances, indexes)
call grib_release(igrib)

call grib_close_file(infile)

PRINT *, "Lats/Lons Return:", nearest_lats(1),nearest_lons(1)

deallocate(nearest_lats)
deallocate(nearest_lons)
deallocate(distances)
deallocate(lsm_values)
deallocate(values)
deallocate(indexes)

end program api_test

This program compiles just fine with the scheme:
ifort -c -I/usr/local/include/ gribapi1.f90
ifort -o /home/deadpickle/Desktop/gribapi1 gribapi1.o -L/usr/local/lib -lgrib_api_f90 -lgrib_api

When I go to run the program I get the ominous error:
GRIB_API ERROR : grib_find_nearest: Function not yet implemented

What does this mean exactly?
0 Kudos
2 Replies
Steven_L_Intel1
Employee
482 Views
You'll have to ask the authors of GRIB. This is not a Fortran message.
0 Kudos
Ron_Green
Moderator
482 Views
It's definitely not a compiler error. The message is coming from your grib library:

GRIB_API ERROR : grib_find_nearest: Function not yet implemented

I would find the code for grib_find_nearest (if you have the source that is), my guess is that this function is a simple stub that prints the above message and returns. It looks like they haven't completed this function.

You might insure that you have their latest library.

ron
0 Kudos
Reply