In my fortran77 project, I call the subroutine BDET in the subroutine MATS. However the get the following error:
Procedure <BDET> called with an implicit interface [-Werror=implicit-interface]
I don't understand why this happens! BDET subroutine is declared before MATS, why is the implicit interface problem happening here?
Any help is greatly appreciated (F77 newbie here). Thanks in advance.
SUBROUTINE BDET(mat_A, DET)
C This subroutine calculates the determinant of a 3x3 matrix
IMPLICIT NONE
REAL*8 DET
REAL*8 mat_A(3,3)
DET = mat_A(1,1) * mat_A(2,2) * mat_A(3,3) -
1 mat_A(1,2) * mat_A(2,1) * mat_A(3,3)
DET = DET + mat_A(1,2) * mat_A(2,3) * mat_A(3,1) +
1 mat_A(1,3) * mat_A(2,1) * mat_A(3,2) -
2 mat_A(1,1) * mat_A(2,3) * mat_A(3,2) -
3 mat_A(1,3) * mat_A(2,2) * mat_A(3,1)
RETURN
END SUBROUTINE BDET
SUBROUTINE MATS(DFGRD0,DFGRD1)
C Implicitly declare variables and set character length
IMPLICIT REAL*8 (A-H,O-Z)
CHARACTER*80 CMNAME
REAL*8 DFGRD1(3,3)
REAL*8 Ibar1, Ibar2, J
REAL*8 F(3,3)
CALL BDET(F, J)
RETURN
END SUBROUTINE MATS