Hi,
We recently upgraded to the SGI v7.4 F90 compilers and some
of my code has stopped compiling. Can somebody tell me whether
this is legal Fortran90, and whether the problem is with my code
or the compiler?
Attached is a short test program that illustrates the problem.
I get the following errors when I try to compile:
f90-1015 f90: ERROR SUB2, File = test.f90, Line = 24, Column = 24
Local-name "A1" must only be referenced once in a rename-list in this
scope.
^
f90-1015 f90: ERROR SUB2, File = test.f90, Line = 24, Column = 31
Local-name "B1" must only be referenced once in a rename-list in this
scope.
The problem happens when I try to use the USE CONSTANTS, ONLY: A1=>A,
B1=>B
statement for a second routine in the same module.
Is this legal F90? What do other compilers think about this?
I've written lots of code with this useage and it's never given me
a problem before. Were the previous versions of the compiler
correct, am I looking at a compiler bug?
Catherine
--
-------------------------------------------------------------------------
Catherine Moroney phone : (818) 393-3392
Jet Propulsion Laboratory fax : (818) 393-4802
MailStop 169-315 email : [log in to unmask]
4800 Oak Grove Drive
Pasadena, CA 91109-8099
MODULE CONSTANTS
INTEGER :: A,B
END MODULE CONSTANTS
MODULE ROUTINES
CONTAINS
SUBROUTINE SUB1
USE CONSTANTS, ONLY: A1=>A, B1=>B
INTEGER :: I
I = 1
RETURN
END SUBROUTINE SUB1
SUBROUTINE SUB2
USE CONSTANTS, ONLY: A1=>A, B1=>B
INTEGER :: I
I = 2
RETURN
END SUBROUTINE SUB2
END MODULE ROUTINES
PROGRAM TEST
USE ROUTINES
call sub1( )
call sub2( )
STOP
END PROGRAM TEST
|