I've written a function which calculates the eigenvalues of a 2*2 matrix. It takes a 2*2 matrix as an argument and returns 2 eigenvalues via a 2-element array. I have declared the function in the program unit like this:
real, dimension(2), external :: eigenvalues
But it won't compile, it comes up with this error:
Error: EXTERNAL attribute conflicts with DIMENSION attribute
Is it just not possible to have functions that return arrays, or am I doing something wrong?
Any help/suggestions are appreciated, thanks. If it helps, I'm using fortran 90 with the gfortran compiler