This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: question about elemental subroutines


Dominique Dhumieres wrote:
How am I supposed to understand:
12.7.3 Elemental subroutine actual arguments

...  . In the case that the actual arguments associated with INTENT (OUT)
and INTENT (INOUT) dummy arguments are arrays, the values of the
elements, if any, of the results are the same as would be obtained if the
subroutine had been applied separately, in any order, to corresponding
elements of each array actual argument.

in the following case:
[...]
where the result of 'nonassign' depends on the order of the calls?

The answer for this sort of question is always the same, and is very simple: if you reach an obvious contradiction like that, the code in question is illegal.


In the particular case illustrated by this section and your code, I believe the relevant contradiction can be found in the remainder of 12.7.3, which notes that the arguments must follow the restrictions in 12.4.1.6. Those restrictions (as explained in note 12.22) do not allow changing an entity that is associated with multiple dummy arguments, as x(2) is in your code.

- Brooks


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]