(j3.2006) Intrinsic assignment question
Daniel C Chen
cdchen
Fri May 30 14:19:09 EDT 2014
Hello all,
Please consider the following test case:
real, allocatable :: r1, r2
r1 = r2
print*, allocated(r1), allocated(r2)
end
Question:
1. Is the above test case standard conforming? I couldn't find in the
standard that we disallow using an unallocated scalar as the 'expr' in an
intrinsic assignment, but I could have missed it.
2. If it is standard conforming, what should the output be?
a) FF
b) TF
I couldn't find in the standard what is supposed to happen to the
'variable' when the 'expr' is an unallocated allocatable scalar of
intrinsic type after the execution of the intrinsic assignment.
The closest words I can find is the following:
7.2.1.3
...
... If the variable is or becomes an unallocated allocatable variable, it
is then allocated with
20 ? if the variable is polymorphic, the same dynamic type as expr ,
21 ? each deferred type parameter equal to the corresponding type parameter
of expr ,
22 ? if the variable is an array and expr is scalar, the same bounds as
before, and
23 ? if expr is an array, the shape of expr with each lower bound equal to
the corresponding element of LBOUND (expr ).
But none of the bullets seems describe the scenario of the test case.
Can someone please shed some light on this issue?
Thanks,
Daniel
XL Fortran Development - IBM Toronto Software Lab
Phone: 905-413-3056
Tie: 969-3056
Email: cdchen at ca.ibm.com
http://www.ibm.com/software/awdtools/fortran/xlfortran
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.j3-fortran.org/pipermail/j3/attachments/20140530/c0fcb3c2/attachment.html
More information about the J3
mailing list