Module procedures are specified after the CONTAINS separator,
MODULE related_procedures IMPLICIT NONE ! INTERFACEs of MODULE PROCEDURES do ! not need to be specified they are ! 'already present' CONTAINS SUBROUTINE sub1(A,B,C) ! Can see Sub2's INTERFACE ... END SUBROUTINE sub1 SUBROUTINE sub2(time,dist) ! Can see Sub1's INTERFACE ... END SUBROUTINE sub2 END MODULE related_procedures
The main program attaches the procedures by
use-association
PROGRAM use_of_module USE related_procedures ! includes INTERFACES CALL sub1((/1.0,3.14,0.57/),2,'Yobot') CALL sub2(t,d) END PROGRAM use_of_modulesub1 can call sub2 or vice versa.
For more information, click here