NOAA-EMC / NCEPLIBS-bufr

The NCEPLIBS-bufr library contains routines and utilites for working with the WMO BUFR format.
Other
40 stars 19 forks source link

Undeclared iargc #559

Closed DJDavies2 closed 5 months ago

DJDavies2 commented 5 months ago

I am getting failures building with some compilers of this sort:

ftn-232 ftn: ERROR SPLIT_BY_SUBSET, File = ../../../../../lustre/research/scratch/d01/david.davies/cylc-run/EXZCrayPorting/work/1/build_ncep_bufr__exz_cray/src/utils/split_by_subset.f90, Line = 34, Column = 6 IMPLICIT NONE is specified in the local scope, therefore an explicit type must be specified for function "IARGC".

This is from the Cray compiler but there are other compilers that fail in a similar way.

DJDavies2 commented 5 months ago

iargc is not a standard Fortran function, although it is a somewhat common extension.

jbathegit commented 5 months ago

Hello @DJDavies2 and thanks for reaching out to us.

After a bit of investigation, it does indeed appear that IARGC() isn't part of the Fortran standard, though as you noted it does seem to be a very common extension. From what I've seen, it appears that the preferred replacement is COMMAND_ARGUMENT_COUNT() which is part of the 2003 standard.

Similarly, I saw that GETARG(), which we also use in several of our utilities, is also an extension rather than part of the language standard, and it similarly recommends replacing that with GET_COMMAND_ARGUMENT() from the 2003 standard.

We'll see if we can get these changes tested out and included in the next release.