I have an elemental subroutine which is basically like this:
elemental subroutine calc_stuff(x, a, b, c) real, intent(in) :: a, b, c real, intent(out) :: x x = a/b + c end subroutine calc_stuff
Now I changed this to:
elemental subroutine calc_stuff(x, a, t) real, intent(in) :: a type(mytype), intent(in) :: t real, intent(out) :: x x = a/t%b + t%c end subroutine calc_stuff
Where "mytype" is a type containing various integer and real scalars, as well as a real allocatable array. The second code compiles fine on various compilers (GFortran, Intel, NEC, Cray), but now I saw that the Fortran standard says for elemental subroutines:
"All dummy arguments must be scalar, and must not have the ALLOCATABLE or POINTER attribute."
So, is my code not standard conforming and all the compilers "know" what I want but should actually complain, or am I misunderstanding the standard and everything is fine? It would be very good if I could use the second version, as I intend to branch the code where the calculation would then be something like "x = a/t%b + t%c/t%d" and I would not a have to change all calls to this function with the second version.
Thanks everyone in advance,