transfer_array_intrinsic testcase failures (was Re: transfer_array_intrinsic failures)
Dominique Dhumieres
dominiq@lps.ens.fr
Mon Mar 27 19:12:00 GMT 2006
Paul,
I am not sure to follow you with 'size_bytes(DEST)'. What is it in the following code:
integer(4) :: y(4)
character(4) :: ch(4)=(/'abcd','efgh','ijkl','mnop'/)
y = transfer(ch,y)
print *, y
print *, transfer(y,ch,3)
end
where there is no assignement to anything like a DEST with prescribed size
(beside the one prescibed by TRANSFER itself)?
A commitee member will certainly explain better than I can do what they
meant by "physical representation", but my understanding is the one
procuded by TRANSFER without any connection to is future use, as it is
the case for any intrinsic function.
Dominique
PS Apparently there is no conformance check in gfortran:
real(4) :: pi, a(2), b(3)
pi = acos(-1.0)
b = pi
a = cos(b)
a = -pi
b = cos(a)
print *, b
end
gives
[karma] f90/bug% a.out
-1.000000 -1.000000 0.5403023
while xlf reject the code with:
"conform_1.f90", line 4.5: 1516-078 (S) Operands must be conformable.
"conform_1.f90", line 6.5: 1516-078 (S) Operands must be conformable.
and g95 with:
In file conform_1.f90:4
a = cos(b)
1
Error: Array assignment at (1) has different shape on dimension 1 (2/3)
In file conform_1.f90:6
b = cos(a)
1
Error: Array assignment at (1) has different shape on dimension 1 (3/2)
One could wish a sloppy assignement in which 'a=cos(b)' is understood
a 'a=cos(b(:size(a))' if size(a)<size(b) and 'b=cos(a)' as
'b(:size(a))=cos(a)', but apparently this is not even the case
for the last assignement because the result would be
-1.0 -1.0 3.14159...
More information about the Fortran
mailing list