Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
28 Views

Submodule error

Hi,

I think this code is correct but ifort  generate an error

Module MyModule
  implicit none
  private
  Type ,public  ::  Object
    integer     ::  NVar
  contains
    procedure   ::  DoSomething
  End Type
  Interface
    Pure Module Function DoSomething( This, Vinp ) result(Vout)
      class(Object)                   ,intent(in)   ::      This
      real(8) ,dimension( This%NVar ) ,intent(in)   ::      Vinp
      real(8) ,dimension( This%NVar )               ::      Vout
    End Function
  End Interface
End Module

Submodule(MyModule) MySubModule
  implicit none
  contains
    Pure Module Function DoSomething( This, Vinp ) result(Vout)
      class(Object)                   ,intent(in)   ::      This
      real(8) ,dimension( This%NVar ) ,intent(in)   ::      Vinp
      real(8) ,dimension( This%NVar )               ::      Vout
      Vout = Vinp / This%NVar
    End Function
End Submodule

The error is:

$ ifort -c module.f90 
module.f90: error #6121: The characteristics of the function result differ from those specified in the separate interface body.   [DOSOMETHING]
compilation aborted for module.f90 (code 1)

and I'm compiling with:

$ ifort --version
ifort (IFORT) 17.0.0 20160721

on the following system:

$ uname -a
Linux XXX 4.8.15-300.fc25.x86_64 #1 SMP Thu Dec 15 23:10:23 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

 

0 Kudos
3 Replies
Highlighted
Employee
28 Views

You are correct. It should compile. Steve found and reported this defect earlier (see reply #10) in this post:  https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/672035

With your test case, I confirmed the error occurs with the 17.0 initial release compiler and that with our latest 17.0 update 1 it compiles w/o the error.

0 Kudos
Highlighted
New Contributor I
28 Views

Hi,

Is this one fixed in Update 4 ?

Also, is there a centralized location where to look for the submitted bugs ?

The 'Release Notes' which come with the compiler (at least, the Fortran one) are not very useful to track changes and bug fix.

Thanks.

0 Kudos
Highlighted
Employee
28 Views

Your issue was fixed back in PSXE 2017 Update1 as I posted in #2 earlier this year.

The fixes list for PSXE 2017 are incomplete at this time. There's a partial Update 2 list for Fortran specific issues. They are available here: https://software.intel.com/en-us/articles/intel-parallel-studio-xe-2017-composer-edition-compiler-fi...

0 Kudos