Re: why doesn't this compile ?



Bart Vandewoestyne wrote:
I am cleaning up my directory with test and example programs, and I came
across the following testprogram that I've written somewhere in the past:

http://www.cs.kuleuven.ac.be/~bartv/downloads/test_array_arguments.f95

I guess I wanted to demonstrate to myself how to write a function that
can act on arrays of both rank 1 and rank 2, but unfortunately this
thing doesn't compile anymore.

If i compile it with my F-compiler I get:

Error: test_array_arguments.f95, line 39: F_2 declared as an array in host but is a procedure
       detected at FUNCTION@F_2
Error: test_array_arguments.f95, line 39: Attribute set for FUNCTION F_2 which has RESULT Y
       detected at FUNCTION@F_2
Error: test_array_arguments.f95, line 42: Duplicate type declaration for Y
       detected at ::@Y
Error: test_array_arguments.f95, line 42: Array dimensions already specified for Y
       detected at ::@Y
Error: test_array_arguments.f95, line 50: Duplicate subprogram name F_1
       detected at FUNCTION@F_1
Error: test_array_arguments.f95, line 50: Attribute set for FUNCTION F_1 which has RESULT Y
       detected at FUNCTION@F_1
Error: test_array_arguments.f95, line 53: Duplicate type declaration for Y
       detected at ::@Y


I've been playing around, but could not get it to compile yet... I've been staring for too long at it and now it's probably too late in the evening ;-) Does anybody see what I'm doing wrong?

Regards,
Bart

It seems to work OK on my F compiler.

Are you sure the program that produced these errors
is exactly the same as the one you linked us to?

--
Walt Brainerd         +1-877-355-6640 (voice & fax)
The Fortran Company   +1-520-760-1397 (outside USA)
6025 N. Wilmot Road   walt@xxxxxxxxxxx
Tucson, AZ 85750 USA  http://www.fortran.com
.



Relevant Pages

  • Re: Select rows in a rank 2 array
    ... from the arrays in the assignment, ... rank> 1 and to modify some cells in a row where other cells of the ... same row match some conditions. ...
    (comp.lang.fortran)
  • Re: rank mismatch
    ... > You can write two versions yet reference them via a generic name ("Fortran ... end interface f_c0 ... for rank 1 arrays. ...
    (comp.lang.fortran)
  • Re: Array with unknown number of dimensions
    ... > i) Return it as a 1-D array, regardless of its true dimensionality. ... Both these are certainly valid (and 7 is, indeed, the maximum allowed rank). ... end module arrays ...
    (comp.lang.fortran)
  • Re: intrinsic elemental math functions
    ... "Yes, sqrt is elemental. ... a scalar or on arrays of any rank" ...
    (comp.lang.fortran)