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] | |
On 08/19/2009 07:59 PM, Toon Moene wrote:Steve Kargl wrote:On Wed, Aug 19, 2009 at 06:43:13PM +0200, Toon Moene wrote:
The following code is perfectly OK:
DIMENSION A(10) A = 10.0 CALL SUB(A,A) END SUBROUTINE SUB(A,B) REAL, INTENT(IN) :: A(:), B(:)
What happens if you replace the last line with
REAL, INTENT(IN) :: A(:) REAL, INTENT(OUT) :: B(:)
Fascinating. I *think* that - as long as you do not actually write to B - you're in the clear.
Yes. That's the origin of the ASYNCHRONOUS loophole in the standard that I need to get fixed.
I think even B(2) = A(1) would be fine. Or even
B(2:N:2) = A(1:N-1:2)
Absolutely NOT! That is permitted only for assumed size arrays (another reason not to use them). On the other hand, replacing the CALL by:
Regards, Nick Maclaren.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |