> I have two questions on array assignments:
>
> Q1) Will the following work?
> REAL, DIMENSION(3,4) :: X
> REAL, DIMENSION(3) :: Y
> REAL, DIMENSION(4) :: Z
> ...
> X(:,1)=Y
> X(1,:)=Z
>
Yes, all the arrays or array sections are rank-1 and have the correct
size.
>
> Q2) Will the following work?
> REAL, DIMENSION(2,3) :: X
> REAL, DIMENSION(3) :: Y,Z
> ...
> X= RESHAPE (/ Y, Z/), (/2, 3/)
>
Nearly, you have missing parentheses:
X= RESHAPE( (/ Y, Z/), (/2, 3/))
Regards,
Mike Metcalf
|