- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What happens if you do a Build > Rebuild Solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page