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