What is a "real module subroutine"?

In Intel’s Fortran compiler documentation, on the MODULE SUBROUTINE page, there is the following example code snippet:

submodule (M) A
contains
  real module subroutine FOO (arg) 
    type(tt), intent(in) :: arg
    arg%r =1
  end subroutine FOO
end submodule A

Could be my own ignorance, but I thought only functions could have types.

I wonder if this is a copy-paste-find-replace from other similar examples that have nearly identical code snippets containing real module functions like separate module procedures.

And I just noticed arg is intent(in) but one of its members is assigned in the subroutine.

2 Likes

I cannot see what “real” would mean in this context and netiher gfortran nor Intel Fortran oneAPI accept it. I think this is a documentation error.

2 Likes

Unfortunately, the Intel documentation has a number of examples that are invalid or otherwise wrong. I’ll file a report on this (and maybe look for others).

3 Likes

Submitted as ticket 06185140. I think it was adapted from the example for MODULE FUNCTION without sufficient review.

2 Likes