1program contained
2   implicit none
3   integer i
4
5   i = 0;
6   call testproc (40)
7   if (i .ne. 42) STOP 1
8contains
9   subroutine testproc (p)
10      implicit none
11      integer p
12
13      if (p .ne. 40) STOP 2
14      i = p + 2
15   end subroutine
16end program
17