(j3.2006) Submodule/module interface mismatch: is this standard-conforming?

Damian Rouson damian
Fri Oct 7 19:22:13 EDT 2016


All,

Is the program below standard-conforming?  The Cray compiler gives an error message stating that the IMPLICIT NONE disallows the implicitly typed interface body and and a second error message reporting a conflict between the interface body and and the module function in the submodule.  This is the behavior I would hope would be the intention of the standard, but I?m not certain it is the standard behavior.

The gfortran 6.1.0 compiler compiles the program without errors and prints the following:

9.18340949E-41  is not            1

The Intel 16.0 compiler compiles the program without errors and prints the following:

 1.000000      is not            1

Despite my hopes, I suspect the interface body is standard-conforming on the grounds that the IMPLICIT statement does not apply to the interface block.  Nonetheless, I suspect that  having an interface body that refers to a procedure with the same names as a different procure in the a child submodule makes the program non-conforming.

Damian


module one_module
  implicit none
  interface
    module function one()
    end function
  end interface
end module

submodule(one_module) one_submodule
  implicit none
contains
  integer module function one()
    one = 1 
  end function
end submodule  

use one_module
print *,one()," is not ",1
end 





More information about the J3 mailing list