------- Comment #2 from kargl at gcc dot gnu dot org 2008-02-24 17:42 ------- FX is correct with respect to assignment of a complex expression to a real variable. See page 141 of the F2003 standard especially table 7.9.
real x complex :: z = (1,-1) x = z end The 'x = z' is treated as if you wrote 'x = real(z,kind(x))' As to the subroutine problem, your program is technically illegal for at least one reasone. You've never assigned a value to CA(2), so you're not allowed to reference it. To avoid these types of issues if make the subroutine an internal subprogram or use an explicit interface for the subroutine. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35348