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.
The following code snippet from LFRic (taken from PSyclone's
tests/psyad/tl2ad_test.py
does not recognise
random_number
as an intrinsic. FParser returns it as:It should not be a Call_Stmt. I checked - it calls
Call_Stmt.match
, but notIntrinsic_Name.match
.