(j3.2006) TYPE(*) and scalars

Robert Corbett robert.corbett
Wed Mar 21 20:38:01 EDT 2012

On 03/21/12 15:58, Rasmussen, Craig E wrote:
> I assume it does too much damage to the standard to allow TYPE(*) to take both 
> scalar and array actual arguments? After all a scalar is now just an array of 
> rank 0, yes (I can just hear Malcolm starting to wind up at this point so I'll 
> not say any more :-)
> -craig 

The case where I see a problem is when the actual argument is an
element of an array that is not contiguous.  If our compiler knows
that the corresponding dummy argument is a scalar, it does not
make a copy.  If it knows the dummy argument is an assumed-size
or explicit-shape array or if it does not know that the dummy
argument is not an assumed-size or explicit-shape array, it makes
a copy of the array, starting from the element specified and
ending with the last element of the array.  If the dummy argument
is not INTENT(IN), the value of the copy must be copied back to
the array on return.

Bob Corbett

More information about the J3 mailing list