I am trying to pass an elemental function as argument to a subroutine without the expected result because the elemental function does not operate component-wise inside the subroutine.
Here is the sequence: in the "main program" within a contains statement has an elemental function "fx". From the "main program" a module is imported with use, where a subroutine "quad" has as argument "fx" that is declared as external. Inside "quad", "fx" is called to operate in a 1d array but it only operates on its first component instead of on the whole array.
Why do I not get the expected result from the elemental attribute?