Print

Print


On Sat, 2006-03-18 at 04:49 +0000, S Yuan wrote:
> For the following code, some complilers write out 1.0 and some write out 
> 0.0 for op(1:3,1:3,1).  Which one is correct, or standard conforming?

Both, I suppose.  The real problem is that your code is illegal.  The
dummy arguments A and B are associated with the same actual argument
and in this case is illegal to redefine either A or B (see 5.7.2 in
Fortran 95/2003 explained, e.g.).  Incidentally, the differences you see
are probably exposed by passing non-contiguous array sections when the
dummy arguments are declared as (contiguous) explicit shape arrays;
this requires copy-in/copy-out of the arguments.

Regards,
  Neil