Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
14 Views

Problem with sub sub submodules

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)
 


 

 

 

0 Kudos
2 Replies
Highlighted
14 Views

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

 

0 Kudos
Highlighted
Beginner
14 Views

Steve

Thanks for your help.

Nick

0 Kudos