Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29234 Discussions

Wrong compiler error using module from submodule

Daniel_Dopico
New Contributor I
1,356 Views

In the following code, a submodule makes explicit USE of it's parent module. 

module forces
implicit none

type force
   ! type wrongly accesed via USE statement
end type force

type force_sensib
   ! type correctly accesed via HOST ssociation
contains
   procedure,pass::fstb
end type force_sensib

interface
   module subroutine fstb(FS)
       class(force_sensib),intent(inout)::FS
   end subroutine fstb
end interface
end module forces

submodule(forces) forces_sensib
   use forces,only:force !Wrong sentence, triggering the problem.
   implicit none
contains
   module procedure fstb!(FS)
   end procedure fstb
end submodule forces_sensib

The error offered by the compiler is confusing (an wrong).

 

error #6115: A separate interface body must have been declared in the program unit or an ancestor of the program unit for the separate module procedure. [FSTB]
compilation aborted for ... (code 1)

 

Clearly the problem is not the interface to FSTB, which is present and correctly placed in the module. The problem is the USE sentence in the submodule, but the compiler is unable to detect this.

I have been experiencing similar fake errors with submodules which makes really difficult to guess which are the errors in the code.

 

 

0 Kudos
1 Solution
Ron_Green
Moderator
1,329 Views

The bug ID is CMPLRLLVM-68781


View solution in original post

6 Replies
Ron_Green
Moderator
1,338 Views

Clearly our error message could and should be better.  The Nag compiler gives a very intuitive message:

$ nagfor repro.f90
NAG Fortran Compiler Release 7.2(Shin-Urayasu) Build 7203
Error: repro.f90, line 22: Module FORCES USEs itself
       detected at :@FORCE
[NAG Fortran Compiler pass 1 error termination, 1 error]

I will open a bug report.

 

Ron_Green
Moderator
1,330 Views

The bug ID is CMPLRLLVM-68781


Daniel_Dopico
New Contributor I
1,022 Views

Thank you, Ron.

 

What is the purpose of the bug ID? Can I suscribe to it or something?

 

I don't see it in my Dashboard open cases and I didn't receive any notification either.

0 Kudos
Ron_Green
Moderator
995 Views

Issued entered on the Forum are not linked to your Online Service Center account.  If you want to track issue please enter them on OSC. 
For bugs entered here:  I give you the bug ID as bookkeeping.  For the situation where you submit several bugs.  As those get a fix I will alert you here on the Forum.  We use an internal-only Jira issue tracking system, thus you will not be able to see the bug progress.  It would be nice if it was more open, but it's not and won't be for the foreseeable future.

0 Kudos
Ron_Green
Moderator
987 Views

Another use case for the bug ID - you can ask if this bug is fixed or get a status update.

0 Kudos
Daniel_Dopico
New Contributor I
827 Views

Thank you, Ron.

I usuallly prefer to enter the tickets myself, for example if it is an ICE, but sometimes It is helpful to get a second opinion in the forum before bothering.

0 Kudos
Reply