Given the following straight forward recursive subroutine:
RECURSIVE SUBROUTINE fakultet_sub( n, fak ) IMPLICIT NONE INTEGER, INTENT( IN ) :: n INTEGER, INTENT( OUT ) :: fak INTEGER :: resultat IF ( n == 0 ) THEN fak = 1 ELSE CALL fakultet_sub( n - 1, resultat ) fak = n * resultat END IF END SUBROUTINE fakultet_sub
The compiler (version 5.10) gives up with the following rather curious message:
fakultet_sub.F95(9) : error 831 - This expression cannot receive a value, in the call to FAKULTET_SUB, with argument 1 ('FAK') which has been declared as INTENT(OUT)
This is obviously a compiler error. It must have been introduced with version 5.10.