Print

Print


Hi,

On Dec 8, 2011, at 05:29 , Oliver Fuhrer wrote:

Harvey Richardson's answer is correct,
as is NAG's compiler.

You can change the code to

> program test
> implicit none
> real :: a
> a=1.0
> call sub(a,a)

call sub( (a), a)

> write(*,*) a
> end program test

Since a  is changed in sub, it must be known
by only one name within sub.

Placing the intent( in) actual argument in parenthesis
makes it an expression.  It is nonstandard to store
to a dummy argument that is associated with an expression.
But it is argument associated, in this case, with an intent( in)
dummy argument, so you aren't storing to it anyway.

An expression whose value happens to be a, and a, are two
distinct things.

Sorry this is a bit technical, but you asked.  :-)

-- 
Cheers!

Dan Nagle