NOAA-EMC / NCEPLIBS-g2

Utilities for coding/decoding GRIB2 messages.
Other
6 stars 15 forks source link

expose some of the new g2c functions in the C library #328

Open edwardhartnett opened 1 year ago

edwardhartnett commented 1 year ago

The C library contains some g2c functions, like g2c_open(), which I would like to use in testing in NCEPLIBS-g2c. For that it would be good to have these functions exposed in the fortran API.

This is related to #23

edwardhartnett commented 5 months ago

There is a test, test_g2cf.F90, which contains:

program test_g2cf
  use g2cf
  implicit none
  character (len = *), parameter :: fileName = "gdaswave.t00z.wcoast.0p16.f000.grib2"
  integer :: g2cid, num_msg
  integer(kind = 1) :: discipline
  integer(kind = 4) :: num_fields, num_local
  integer(kind = 2) :: center, subcenter
  integer(kind = 1) :: master_version, local_version
  integer :: ierr

  print *, 'Testing g2cf API...'
  ierr = g2cf_set_log_level(1)

  ! Open the test file.
  ierr = g2cf_open(fileName, 0, g2cid)
  if (ierr .ne. 0) stop 2

At one point I had this test code working, when I was prototyping all this last year, but now it is commented out in the cmake file, and there is no sign of a g2cf.F90 module file anywhere. So somehow that got lost.

I will recreate it and get the test working again.