program interface_subroutine_example
  implicit none
  interface
    subroutine larger(u,v,w)
      integer,intent(in)::u,v
      integer,intent(out)::w
    endsubroutine
  endinterface
  
  integer::i,a,b,c
  write(*,*) 'would you kindly give me two integers, a,b?'
  read(*,*) a,b
  do i=1,2
     call larger(a,b,c)
     write(*,*) 'larger of',a,'and',b,'is',c
  enddo
endprogram interface_subroutine_example

!----subroutine definitions
subroutine larger(u,v,w)
  implicit none
  integer,intent(in)::u,v
  integer,intent(out)::w
  if (u>v) then
    w=u
  else
    w=v
  endif
endsubroutine larger
