write recursive call

Paul Thomas paulthomas2@wanadoo.fr
Mon Nov 28 19:50:00 GMT 2005


Richard,

> On Nov 24, 2005, at 3:25 AM, François-Xavier Coudert wrote:
>
>>> I'd like to know if the fact that
>>> "Recursive library calls not allowed"
>>> for the intinsic function WRITE is a feature or a bug.
>>
>>
>> The basic line is: recursive I/O is indeed forbidden in Fortran 95,
>> but allowed in Fortran 2003.
>
>
> But only in very limited cases, even in f2003. Specifically, it is not 
> allowed to external files. The recursive I/O statement can only be to 
> an internal file (or as part of user-defined-derived-type I/O, but 
> that doesn't come up in f95).

As I just learned from modifying the Polyhedron benchmark harness 
program, most f95 compilers seem to permit recursion for the limited 
case of external + internal IO eg;

write (*, *) foo (x)

character function foo (x)
.....
  write (foo, '(f10.4)') x
.....

Cheers

Paul T



More information about the Fortran mailing list