Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29253 Discussions

problem with Hollerith constant and continuation line

vivekrao4
Beginner
624 Views

The code at

http://www.itl.nist.gov/div898/software/datapac/datapac.f,

after commenting the DLL_EXPORT lines, and replacing 10**10 with 10**8 to avoid integer overflow in a few places, compiles with gfortran and g95, but IVF does not compile Hollerith constants combined with continuation lines, as in

107 FORMAT(1H , 88H
1 FREQUENCY )

saying

datapac_no_dll.for(7443) : Error: End of statement found while lexing a hollerith constant
107 FORMAT(1H , 88H
------------------^

I know Hollerith constants are not standard in Fortran 77 or later, but itwould be nice if IVF could compile such code.

Vivek Rao

P.S. Merry Christmas to Steve Lionel and company.

0 Kudos
1 Reply
Steven_L_Intel1
Employee
624 Views

ifort can compile the code just fine. However, the source file has been modified from its original and has had trailing blanks removed. Therefore, the first line of the statement you show has no characters after the 88H and the Hollerith count runs out of characters on the continued line. Note that earlier lines with similar continued Hollerith items are ok, as there is source text out to column 72.

Intel Fortran has an option, -pad-source, which can be used to simulate reading the program from punchcards so that short records are padded out to column 72.

I'll note that the Fortran standard specifies that fixed-form source lines have 72 characters, no more, no less. If the input file has fewer than 72, the standard does not say how the line is treated.

0 Kudos
Reply