Software Archive
Read-only legacy content
17061 Discussions

Elemental function as argument for a subroutine

del_toro_llorens__Al
208 Views

Dear all,

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?

Thanks in advance for your help.

Regards,

Alvaro

0 Kudos
0 Replies
Reply