The following program defines two interface operators (both ==) for separate derived types. They are defined in separate modules, but the second module uses the derived type in the first module for some independent reason. The use creates a warning message that I am nto quite sure how to interpret. It seems to imply that I cannot use the first interface operator in module 2. Any advice on what might be happening here would be greatly appreciated.
MODULE m1
TYPE type1
INTEGER :: i1
INTEGER :: i2
END TYPE type1
INTERFACE OPERATOR(==)
MODULE PROCEDURE same1
END INTERFACE
CONTAINS
FUNCTION same1(t1a,t1b)
LOGICAL :: same1
TYPE(type1), INTENT(IN) :: t1a
TYPE(type1), INTENT(IN) :: t1b
IF ((t1a%i1==t1b%i1).AND.(t1a%i2==t1b%i2)) THEN
same1=.true.
ELSE
same1=.false.
ENDIF
END FUNCTION same1
END MODULE m1
!
MODULE m2
USE m1, ONLY: type1
TYPE type2
INTEGER :: i1
INTEGER :: i2
INTEGER :: i3
END TYPE type2
PUBLIC :: OPERATOR(==)
INTERFACE OPERATOR(==)
MODULE PROCEDURE same2
END INTERFACE
CONTAINS
FUNCTION same2(t2a,t2b)
LOGICAL :: same2
TYPE(type2), INTENT(IN) :: t2a
TYPE(type2), INTENT(IN) :: t2b
IF ((t2a%i1==t2b%i1).AND.(t2a%i2==t2b%i2).AND.(t2a%i3==t2b%i3)) THEN
same2=.true.
ELSE
same2=.false.
ENDIF
END FUNCTION same2
END MODULE m2