Re: PGF90 problem with adjustl(trim(..))

From: James Van Buskirk (not_valid_at_comcast.net)
Date: 08/09/04


Date: Mon, 09 Aug 2004 19:11:43 GMT


"Paul Van Delst" <paul.vandelst@noaa.gov> wrote in message
news:cf82kb$4ck$1@news.nems.noaa.gov...

> But if I do,
> write(*,'(/5x, "This is the busted "& ! Removed the , before the &
> &"sequence output:")') ! Added the & before the first
"

> Both pgf90 and intel give me
> This is the busted sequence output:
> but Lahey gives me:
> This is the busted "sequence output:

I just want to comment on this snippet. Without the second
ampersand, i.e.:

program continue
   write(*,'(/5x, "This is the busted "&
                 "sequence output:")')
end program continue

Both LF95 5.70f and CVF 6.6C (properly) hate it:

C:\LF9556\James\clf\continue>lf95 -f95 continue
Lahey/Fujitsu Fortran 95 Express Release 5.70f S/N: XXXXXXXX
Copyright (C) 1994-2004 Lahey Computer Systems. All rights reserved.
Copyright (C) 1998-2004 FUJITSU LIMITED. All rights reserved.
Registered to: James Van Buskirk
                XXXXXXXXXXXXX
Options:
-nap -nc -nchk -nchkglobal -concc
-dal -ndbl -ndll -f95 -nfix
-ng -nin -ninfo -li -nlst
-nlong -maxfatals 50 -o1 -npause -nprefetch
-nprivate -npca -nquad -nsav -staticlib
-nstaticlink -stchk -tp -trace -ntrap
-w -nwide -winconsole -nwo -nxref
-zero

Compiling file continue.f90.
Compiling program unit continue at line 1:
  1495-W: "continue.f90", line 2: The first nonblank character of a cont
inued line must be '&' in a character context continuation.
  3134-W: "continue.f90", line 2: In the format specification, omission
of the format item separator ',' after character string edit descriptor
is not standard-conforming.
Encountered 0 errors, 2 warnings in file continue.f90.
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

C:\LF9556\James\clf\continue>continue

    This is the busted sequence output:

C:\LF9556\James\clf\continue>df /stand:f95 continue
Compaq Visual Fortran Optimizing Compiler Version 6.6 (Update C)
Copyright 2003 Compaq Computer Corp. All rights reserved.

continue
continue.F90(3) : Warning: Missing ampersand in continued character cons
tant
                 "sequence output:")')
-----------------^
continue.F90(2) : Error: Missing mandatory separating blank
   write(*,'(/5x, "This is the busted "&
---------------^
continue.F90(2) : Error: Syntax error, found ''' when expecting one of:
( * <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_
CONSTANT> ...
   write(*,'(/5x, "This is the busted "&
-----------^

But with the ampersand:

program continue
   write(*,'(/5x, "This is the busted "&
                 &"sequence output:")')
end program continue

Both compilers like it with output:

     This is the busted "sequence output:

This seems correct to me, and completely unambiguous. The
continuation isn't breaking a character constant at a tricky
point as it would be if two apostrophes were being separated.
I think the compiler should consider quotation marks to be
nothing special when parsing a string delimited by apostrophes;
only at the next stage, after the apostrophe-delimited string
has been parsed, should the special properties of the
quotation-delimited strings be considered. In fact, the
compiler should in principle be able to pass the whole format
expression to the run-time library for parsing. If any
compiler prints the second example without the wierd-looking
quotation mark, I think it's time for a bug report.

-- 
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end