Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29253 Discussions

Compilation errors :- Declaration of routine 'CHG_BASIS' conflicts with a previous declaration

peterbennett26
Beginner
695 Views

I have encountered the following error during the compilation of some code supplied to me (compiles ok under the Lahey fortran compiler)

X:VPSCvpsc7avpsc7.sub(155) : Error: Declaration of routine 'CHG_BASIS' conflicts with a previous declaration
SUBROUTINE CHG_BASIS(CE2,C2,CE4,C4,IOPT,KDIM)

lines 155-250 (the subroutine CHG_BASIS) are reproduced below


SUBROUTINE CHG_BASIS(CE2,C2,CE4,C4,IOPT,KDIM)

PARAMETER (SQR2=1.41421356237309 )
PARAMETER (RSQ2=0.70710678118654744)
PARAMETER (RSQ3=0.57735026918962584)
PARAMETER (RSQ6=0.40824829046386304)

DIMENSION CE2(KDIM),C2(3,3),CE4(KDIM,KDIM),C4(3,3,3,3)

C DIMENSION B(3,3,6)
C DATA B /RSQ6,0, 0, 0, RSQ6,0, 0, 0, -2*RSQ6,
C # RSQ2,0, 0, 0, -RSQ2,0, 0, 0, 0,
C # 0, 0, 0, 0, 0, RSQ2,0, RSQ2,0,
C # 0, 0, RSQ2,0, 0, 0, RSQ2,0, 0,
C # 0, RSQ2,0, RSQ2,0, 0, 0, 0, 0,
C # RSQ3,0, 0, 0, RSQ3,0, 0, 0, RSQ3/

COMMON/BASIS/ B(3,3,6)

IF(IOPT.EQ.0) THEN
C *** CALCULATES BASIS TENSORS B(N)

DO I=1,3
DO J=1,3
DO N=1,6
B(I,J,N)=0.0
ENDDO
ENDDO
ENDDO

B(1,1,2)=-RSQ6
B(2,2,2)=-RSQ6
B(3,3,2)= 2.D0*RSQ6

B(1,1,1)=-RSQ2
B(2,2,1)= RSQ2

B(2,3,3)=RSQ2
B(3,2,3)=RSQ2

B(1,3,4)=RSQ2
B(3,1,4)=RSQ2

B(1,2,5)=RSQ2
B(2,1,5)=RSQ2

B(1,1,6)=RSQ3
B(2,2,6)=RSQ3
B(3,3,6)=RSQ3

ENDIF

C *** CALCULATES CARTESIAN SECOND ORDER TENSOR FROM b-COMPONENTS VECTOR.
IF(IOPT.EQ.1) THEN
DO 40 I=1,3
DO 40 J=1,3
C2(I,J)=0.0
DO 40 N=1,KDIM
40 C2(I,J)=C2(I,J)+CE2(N)*B(I,J,N)
ENDIF

C *** CALCULATES KDIMx1 b-COMPONENTS VECTOR FROM SECOND ORDER TENSOR.
IF(IOPT.EQ.2) THEN
DO 50 N=1,KDIM
CE2(N)=0.0
DO 50 I=1,3
DO 50 J=1,3
50 CE2(N)=CE2(N)+C2(I,J)*B(I,J,N)
ENDIF

C *** CALCULATES FOURTH ORDER TENSOR FROM b-COMPONENTS MATRIX.
IF(IOPT.EQ.3) THEN
DO 20 I=1,3
DO 20 J=1,3
DO 20 K=1,3
DO 20 L=1,3
C4(I,J,K,L)=0.0
DO 20 N=1,KDIM
DO 20 M=1,KDIM
20 C4(I,J,K,L)=C4(I,J,K,L)+CE4(N,M)*B(I,J,N)*B(K,L,M)
ENDIF

C *** CALCULATES KDIMxKDIM b-COMPONENTS MATRIX FROM FOURTH ORDER TENSOR.
IF(IOPT.EQ.4) THEN
DO 30 N=1,KDIM
DO 30 M=1,KDIM
CE4(N,M)=0.0
DO 30 I=1,3
DO 30 J=1,3
DO 30 K=1,3
DO 30 L=1,3
30 CE4(N,M)=CE4(N,M)+C4(I,J,K,L)*B(I,J,N)*B(K,L,M)
ENDIF

RETURN
END

I have checked the main code and the other included files and the name CHG_BASIS does not appear other than in the file of subroutines vpsc7.sub. In that file it only appears in the above subroutine and in CALL statements such as:-

line 124

CALL CHG_BASIS(AUX6,AUX33,AUX66,AUX3333,1,6)

and

line 907

CALL CHG_BASIS(AUX5,AUX33,AUX55,AUX3333,2,5)

and so on.

So I am bit stumped as to what is the problem. NB The error 'goes away' if I turn off Check Routine Interfaces, which is found here.

Project > Properties > Fortran >Diagnostics > Language Usage Warnings


0 Kudos
3 Replies
Steven_L_Intel1
Employee
695 Views
Exactly which compiler version are you using? I recall a problem similar to this, with generated interface checking, in an older version. View the Build Log after a build and it should identify the version (e.g. 10.1.024)

What happens if you do a Build > Rebuild Solution?
0 Kudos
peterbennett26
Beginner
695 Views
I get the same errors, the compiler version is Compiling with Intel Fortran Compiler 10.0.025 [IA-32]...
0 Kudos
Steven_L_Intel1
Employee
695 Views
That is an old and unsupported version and may indeed have had the bug I referred to. If you can't upgrade, simply turn off generated interface checking to work around the problem.
0 Kudos
Reply