Coarray question: If I pass a coarray to a routine, must it be declared coarray in that routine?

I am new to using coarrays in Fortran. At the moment I am rewriting one of my MPI codes in CAF. My mental picture is that expressing an array as a coarray [i.e., with square brackets] simply exposes the possibility of performing communication of that array among images.

In my case I have a certain array that is declared as a coarray at the beginning. But eventually in the subroutine hierarchy I reach a point where there is no more communication required. My question is: If I pass a previously declared coarray to a subroutine, must the corresponding dummy array be declared as a coarray if it will not, in that subroutine or any subsequent calls in that routine, be accessed via communication?

2 Likes

This makes perfect sense. Thank you!

And now, it doesn’t!

2 Likes

If the procedure does not do any Coarray communications, it does not have to have Coarray dummy arguments.

1 Like

Thank you for your reply. Strange that there must have been some discussion 11 months ago, because I thought my question was answered, but now there appears to be no record of the discussion.

1 Like

I think some people opt to set their messages to self-destruct in 24 hours, just like the Inspector gadget used to. I did not notice this question was old.

1 Like

Indeed, there is a deleted message in this thread, which contains the previous context and answer. Any user is free to delete their post again, though (there is a time restriction of 6 months if I read the discourse settings correctly).

However, deleting a message bumps the thread up on the main page again, due to the deletion event, which could cause some confusion.

Something along this lines was discussed here, I think:

2 Likes