I would prefer something more modest which doesn’t require any new functions or statements. Namely:
- The de facto convention of storing complex numbers as [real_1, imag_1, real_2, imag_2, …] is standardised.
- The following code compiles and runs
program test
implicit none
complex(8) z
call foo(z)
print *,z
end program
subroutine foo(x)
implicit none
real(8), intent(out) :: x(2)
x(1)=1.d0
x(2)=2.d0
end subroutine
… without error. A warning or information statement would be fine (and even welcome). Right now to make this work we have to include -fallow-argument-mismatch with GFortran or hide foo by putting it in a separate file.