External procedure version:
SUBROUTINE Summy2(res,x,y) IMPLICIT NONE REAL, INTENT(IN) :: x, y REAL, INTENT(OUT) :: res res = x+y END SUBROUTINE Summy2 PROGRAM Main IMPLICIT NONE REAL :: answer CALL Summy2(answer,2.6,3.1) PRINT*, answer CALL Summy2(answer,6.1,9.2) PRINT*, answer CALL Summy2(answer,.1,.555) PRINT*, answer END PROGRAM Main
Internal procedure version,
PROGRAM Main IMPLICIT NONE REAL :: answer CALL Summy2(answer,2.6,3.1) PRINT*, answer CALL Summy2(answer,6.1,9.2) PRINT*, answer CALL Summy2(answer,.1,.555) PRINT*, answer CONTAINS SUBROUTINE Summy2(res,x,y) REAL, INTENT(IN) :: x, y REAL, INTENT(OUT) :: res res = x+y END SUBROUTINE Summy2 END PROGRAM Main
There is no need laboriously type out the interfaces if the procedures are internal.