module ordered_pair ! Types public type pair ! Interfaces public interface reverse ! Subroutines and functions private subroutine reverse_pair (p) private subroutine reverse_int (i) end module ordered_pairSupport for ordered pairs of integers. (A simple example for f90doc.)
For example, you can create the pair p = (10,20) with the following code:
type (pair) :: p p%a = 10 p%b = 20
Author: Erik Demaine
Version: simple
public type pair integer :: a
integer :: b
end type pairEvery pair has two parts,
public interface reverse module procedure reverse_pair module procedure reverse_int end interface reverseThis interface allows one to try to reverse an integer as well as a pair. Reversing the integer does nothing.
private subroutine reverse_pair (p) type (kind=pair), intent (inout) :: p end subroutine reverse_pairReversal routine for a pair of integers. Swaps them in-place.
private subroutine reverse_int (i) integer, intent (in) :: i end subroutine reverse_intReversal routine for an integer. Does nothing.