stfc / fparser

This project maintains and develops a Fortran parser called fparser2 written purely in Python which supports Fortran 2003 and some Fortran 2008. A legacy parser fparser1 is also available but is not supported. The parsers were originally part of the f2py project by Pearu Peterson.
https://fparser.readthedocs.io
Other
63 stars 29 forks source link

Add support for the open convert specifier (which is not part of the standard) #426

Closed sergisiso closed 8 months ago

sergisiso commented 1 year ago

fparser fails to parse:

       open(unit       = MyUnit,       &
            file       = trim(filename), &
            form       = 'UNFORMATTED',  &
            access     = 'SEQUENTIAL',   &
            action     = 'WRITE',        &
            convert    = 'BIG_ENDIAN',   &
            iostat     = E_IO)

I believe this is because the "convert" is not part of the Fortran standard but it is supported by gfortran, nvfortran and ifort https://gcc.gnu.org/onlinedocs/gfortran/CONVERT-specifier.html

arporter commented 9 months ago

WaveWatchIII also uses this and I've come to the same conclusion as @sergisiso - it's a common extension to the standard. Our default tactic is to support such things.