The following code consists of two modules and a program:
Module m1
Type t
Sequence
Integer :: j
End Type t
End Module m1
Module m2
Contains
Function f(i, d)
Use m1
Integer :: f
Integer, Intent(In) :: i
Type(t), Intent(In), Optional :: d
f = 0
Return
End Function f
End Module m2
Program p
Use m2
Print*, f(1)
End Program p
If the modules are stored in a different file from the program the following compilation error message is issued:
error 634 - Passing an argument of a derived type, such as Entity[0], requires the type have the SEQUENCE attribute
which seems spurious, in part because derived-type t is actually given the SEQUENCE attribute, but also because the program does not even call the function with a derived-type argument anyway.
The error message disappears if:
- the two modules are combined, while being kept in a separate file
- everything is kept in one file
I am running FTN95 version 8.70, but am pretty sure the same problem occurs in 8.80.