Closed TeranIvy closed 1 year ago
The 2003 spec does not allow this:
R1206 procedure-stmt is [ MODULE ] PROCEDURE procedure-name-list
but the 2008 spec does:
R1206 procedure-stmt is [ MODULE ] PROCEDURE [ :: ] procedure-name-list
I can confirm this with gfortran ...
module test
INTERFACE get_value
MODULE PROCEDURE :: get_int, get_real
END INTERFACE get_value
contains
subroutine get_int(arg)
integer :: arg
end subroutine get_int
subroutine get_real(arg)
real :: arg
end subroutine get_real
end module test
$ gfortran -c -std=f2003 module_procedure.f90
module_procedure.f90:3:22:
3 | MODULE PROCEDURE :: get_int, get_real
| 1
Error: Fortran 2008: double colon in MODULE PROCEDURE statement at (1)
$ gfortran -c -std=f2008 module_procedure.f90
$
So we need to add support for this as a F2008 extension. I've removed the bug label and added f2008 :-).
Created branch 405_module_procedure_colons
@TeranIvy this is now on master. Please could you check that it resolves the Stylist problem and then I'll close this issue (and make a new release).
This is now on master and has been checked with stylist.
fparser2
raises a syntax error formodule procedure
statement when it is followed by double colon (::
), e.g.(see the relevant LFRic source).
When the double colon is omitted (e.g.
MODULE PROCEDURE get_free_unit_32, get_free_unit_64
), everything is fine. Both expressions pass compilation, so they should both be valid.