Klaus Ramstoeck writes:
> Agreed. And I am aware of at least one f90 compiler which works nicely for me.
> Alas not NAG, it choked on s.th. like
> select case
> case default
> print *, 'fails to compile'
> end select
> as I compiled my program elsewhere (reported earlier here).
> There were other problems as well which I however failed to nail down like this
> one.
Two things.
1. If you have a nice short sample like that, I'd suggest sending a
bug report. I've found NAG to be quite good about responding to
well-written bug reports with concise samples.
2. But the above sample is not legal Fortran. Even if you can get
some compilers to accept it, I advise against doing something
so clearly non-standard that has so little obvious need for the
non-standard feature. I'll do non-standard things when it
fills a real need, but I don't see this particular syntax as
falling in that category.
Yes, I can imagine some reasons why one might want a SELECT
statement that has nothing except for a CASE DEFAULT; for one
example, one might be planning to add some other cases at some
later time.
But this isn't a legal syntax for doing so. The parens and
select-expression on the SELECT CASE statement are not optional;
even though they don't do much useful in this degenerate case, the
syntax requires them. The minimum change that occurs to me is to
make your select statement
select case (0)
With that change, the copy of the NAG compiler that I tried
(v2.2(303) for Sun Solaris 2 with gcc) worked fine. If you have
a version that doesn't work with the standard-conforming syntax,
then send a bug report to NAG.
I could perhaps see merit to making the parens and the
select-expression optional in this degenerate case where they don't
really do anything useful. But since that isn't how the standard
reads, I'd advise against coding that way.
--
Richard Maine
[log in to unmask]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|