Abstract interface (Fortran 2003)

An abstract interface allows you to specify procedure characteristics and dummy argument names without declaring a procedure with those characteristics. You can use an abstract interface to declare interfaces for procedures and deferred bindings. The procedure names defined in an abstract interface block do not have an EXTERNAL attribute.

Read syntax diagramSkip visual syntax diagramABSTRACT_INTERFACE_statement

Read syntax diagramSkip visual syntax diagramFUNCTION_interface_bodySUBROUTINE_interface_bodyPROCEDURE_statement

Read syntax diagramSkip visual syntax diagramEND_ABSTRACT_INTERFACE_statement
ABSTRACT_INTERFACE_statement
See ABSTRACT INTERFACE(Fortran 2003) for syntax details
FUNCTION_interface_body
See Interface blocks for syntax details
SUBROUTINE_interface_body
See Interface blocks for syntax details
PROCEDURE_statement
See PROCEDURE for syntax details
END_ABSTRACT_INTERFACE_statement
See END INTERFACE for syntax details

Examples

MODULE M
	ABSTRACT INTERFACE
		SUBROUTINE SUB(X,Y)
			INTEGER ,INTENT(IN)::X
			INTEGER ,INTENT(IN)::Y
		END SUBROUTINE
	END INTERFACE
END MODULE

PROGRAM MAIN
	USE M
	PROCEDURE (SUB) SUB1
	PROCEDURE (SUB), POINTER::P
	P=>SUB1
	CALL P(5,10)
END PROGRAM

SUBROUTINE SUB1 (X,Y)
		INTEGER ,INTENT(IN)::X
		INTEGER ,INTENT(IN)::Y
		PRINT*, "The sum of X and Y is: ", X + Y
END SUBROUTINE		

Related information

For more information see: