subroutine bigsub(a,b,c,d)
integer :: a,b,c,d
a=2; b=3; c=4
call subsub(a,b,c,d)
d=d-a-b-c
return

contains
  subroutine subsub(a,b,c,d)
    integer, intent(in) :: a,b,c
    integer, intent(out) :: d
    d=a+b+c
    return
  end subroutine subsub
end subroutine bigsub

