finally I find the problem.
If I code like
Call CaoB()
contains
subroutine B()
the error comes.
If I move subroutine B out of 'contains' like
subroutine B()
subroutine something
call CaoB()
end subroutine something
Then the problem is solved.
Thank you for your reply.
Do you mean add some code like 'external B' or 'external fcn'? That not works.
In the subroutine 'CaoB' it have a subroutine name 'fcn' determined by the interface. When I call 'CaoB(B)', 'B' as a subroutine name should be instead of 'fcn' in the subroutine 'CaoB'...
Here is the code for example:
PROGRAM main
CALL B()
CALL CaoB(B)
contains
subroutine B()
IMPLICIT NONE
write (*,*) 'fk'
end subroutine B
subroutine CaoB(fcn)
implicit none
INTERFACE
SUBROUTINE fcn()
IMPLICIT NONE
END SUBROUTINE fcn
END INTERFACE
write...