Robin Vowels <
robin....@gmail.com> wrote:
> Internal I/O with namelist is unacceptable to F95,
> so your example below wouldn't compile.
"Wouldn't compile" usually needs more qualification to be accurate.
That feature is not in f95, but it is in f2003. F2003 compilers are
admitedly in very short supply. I'm willing to grant that the NAG
compiler counts as an f2003 compiler with some omitted features, because
that's basically how it documents itself. I don't have access to any
other compilers that I'd accord such a description.
Out of curiosity, I decided to give the code a try. (Slightly awkwardly,
as my computers have just been shuffled around, and the one I have the
Fortran compilers on is now my wife's; but I ssh'ed into it for the
purpose.)
NAG compiles and runs it as is with no obvious problems. If I use the
-f95 flag to ask for diagnostics about extensions to f95, I correctly
get 3 warning messages for the 3 non-f95 features in the code. Those
being only warnings, the code still does compile and run correctly.
The other two compilers I tried (g95 and gfortran) bitched about the
allocatable character, which is another feature new to f2003. My copy of
gfortran isn't particularly recent, so that might not reflect current
status. When I changed the allocatable character to a fixed-length
character (and added an invocation of trim to avoid what would otherwise
be a problem with that), both g95 and gfortran compiled and correctly
ran the program.
So, although internal I/O with namelist is not valid f95, it compiled
and even ran correctly on all 3 compilers I tried. The allocatabe
character bit didn't fare so well, working only with NAG.
--
Richard Maine
email: last name at domain . net
domain: summer-triangle