I am surprised by Beliavsky’s example because increment is visible in the module compilation unit. The compilers can see that increment changes its argument.
In the situation where sub-programs are separately compiled, analyses of several large programs (e.g. WRF and TELEMAC) show about a 2% error rate in INTENT(IN) specifications. We experimented with removing all of the INTENT specifications and found absolutely no change in the program outputs. However I think that compilers do use INTENT in determining whether to input or output arrays in some circumstances. We found that INTENT is always checked within the routine where it is specified, but not when an INTENT(IN) argument is passed down into other routines.
fpt (http://simconglobal.com) will catch errors like this because it reads all of the routines in a program and analyses the uses. However this is not trivial. In particular it is difficult to catch INTENT(OUT) violations because this involves tracing all control paths through the code to prove that an INTENT(OUT) argument is always assigned. We are revising our handling of this at the moment.