Is this code legal
Tobias Burnus
burnus@net-b.de
Mon Oct 9 09:36:00 GMT 2006
Dominique Dhumieres schrieb:
> Is the following code legal:
>
> integer i
> i = 1
> print ('(z20.8)'), i
> end
I'm not completely sure, but I think it is valid. The problem are the
parentheses around '(z20.8)' as gfortran does not permit them.
In the Fortran 2003 standard, one finds in Section 9.5 and 9.5.1.1:
R911 write-stmt is WRITE (io-control-spec-list) [output-item list]
R912 print-stmt is PRINT format[, output-item-list]
where "format" is:
R914 format is default-char-expr
or label
or *
The () are thus not mandatory, but the might be part of the
default-char-expr.
Actually, gfortran happily accepts the parentheses in expressions like:
character(len=*), parameter :: foo = ('bar')
print *, ('hello')
Tobias
More information about the Fortran
mailing list