- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There seems to be a problem with sub sub submodules in Intel Fortran 17.0.1 (example code attached):
ifort -c mtop.f90
ifort -c submod.f90
ifort -c subsubmod.f90
ifort -c subsubsubmod.f90
subsubsubmod.f90(1): error #5082: Syntax error, found ':' when expecting one of: )
submodule (mtop:submod:subsubmod) subsubsubmod
----------------------^
subsubsubmod.f90(5): error #6116: A separate module procedure must only be defined in a module or a submodule. [SUB3]
module subroutine sub3
------------------^
compilation aborted for subsubsubmod.f90 (code 1)
bash-4.1$ ifort -v
ifort version 17.0.1
gfortran 6.2.1 seems to be OK:
gfortran -c mtop.f90
gfortran -c submod.f90
gfortran -c subsubmod.f90
gfortran -c subsubsubmod.f90
gfortran --version
GNU Fortran (GCC) 6.2.1 20160916 (Red Hat 6.2.1-3)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Intel Fortran is correct, gfortran is wrong is not rejecting the source. Your syntax is incorrect.
The syntax is:
R1117 submodule-stmt is SUBMODULE ( parent-identifier ) submodule-name
R1118 parent-identifier is ancestor-module-name [ : parent-submodule-name ]
You don't give the whole tree, just one of the parent's descendants. The correct line would be:
submodule (mtop:subsubmod) subsubsubmod
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve
Thanks for your help.
Nick

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page