On Mon, Oct 01, 2007 at 09:30:13AM -0700, Alan Irwin wrote:
> On 2007-10-01 13:44+0100 Andrew Ross wrote:
> > Alan,
> > It appears that your recent updates to example 23 to tidy up strings
> > have broken compilation using the ifort compiler on my system. This is
> > an with the old-ish version (8.1) but it is in wide use. The problem
> > seems to be that it doesn't like the string concatenation operator //.
> > A quick test program seems to suggest that gfortran (4.1) also doesn't
> > allow this. The problem in both cases seems to be that the // gets
> > confused with the / for the data statement. g77 works ok.
> > Statements like
> > print *,"Hello"//" World"
> > work with all 3 compilers, although ifort adds an extra blank space in
> > when concatenating the strings.
> Ugh. Why in the world would they add a blank when concatanating character
> strings? That's just an ifort bug in my view.
I agree. Maybe it's fixed in v9. v8 had various interesting features...
> > Looks like this might be best avoided for compatibilities sake.
> Thanks for the test results for gfortran (which I no longer have access to
> for PLplot tests since PLplot requires a newer gfortran than is installed on
> my two boxes) and ifort.
> The old method of continuing a long string in data statements was inserting
> an extra blank (at least for g77) corresponding to the continuation. That's
> almost as bad as the ifort concatanation issue, but I suppose it could be
> justified; there is nothing terminating the string on the first line that is
> continued so assuming a trailing blank character there makes a small degree
> of sense. Anyhow, I have crossed my fingers and assumed this string
> continuation behaviour was universal with Revision 7918.
> This should compile for all the non-g77 compilers, and I have checked it
> gives good results (agreement with C) for the g77 case. Could you please
> check whether it gives good results for the the non-g77 compilers accessible
> to you?
> If it doesn't, then we could go with an assignment statement with string
> concatanation rather than continuation. Of course, ifort will give the
> wrong answer in that case (extra inserted blank), but to my mind that is
> their implementation issue and certainly not the behaviour one would expect
> in general with string concatanation.
Now compiles and works on ifort and gfortran. Just the f95 issues for
example 28 to resolve now.