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

Too many continuation lines

thomasnibu
Beginner
868 Views

I am trying to compile the fortran code andgetting the following error


fortcom; Error: file_name.f,line 659: too many continuation lines

compilation aborted

was trying to include raw data inside another file and incude that file using "include".

DATA FILE_SET ! file set is 15876 integer array

the file is too large and contains 4996 lines, I split the file into segments after each 615 lines. I wonder weather I can set the continuation line limit by any option. On g77, I was able to do that with -NC option. Please help

regards,

NT

0 Kudos
2 Replies
Steven_L_Intel1
Employee
868 Views
Wow - and I thought our limit of (at least) 511 continuation lines was generous. There is not an option to remove the limit entirely.
0 Kudos
jimdempseyatthecove
Honored Contributor III
868 Views

NT,

Try this:

Edit your input file to break it into lines of reasonable length (what you can read on the screen without line wraps).
For each line prepend (add to left side of line)

x('

and append(add to right side of line)

')

Representative line may look like the following

x(' 1234 5678 9012 ')

Next add to your application two subroutines that will populate the data array. One of the subroutines uses the FPP to define a subroutine call for "x" and #includes the text file in-line into the subroutine.
This makes a large subroutine that initializes your data. (Use FPP in your project for this file)

An alternate route would be to write the subroutines to open and read the text file.
But this will expose your data.

*** Note the following code is untested. Use it for reference

subroutine PopulateIntegerArray(Array)
integer :: Array(:)

integer :: LowerBound
integer :: UpperBound
integer :: i
LowerBound = LBOUND(Array)
UpperBound = UBOUND(Array)
Array = 0! Initialize to null

i = LowerBound
#define x(t) PopulateIntegerArrayStuff(Array,i,t)
#include 'YourDataFile.txt'
end subroutine PopulateIntegerArray

subroutine PopulateIntegerArrayStuff(Array,i,t)
integer :: Array(:)
integer :: i
character*(*) :: t

character(1000) :: InputLine
integer :: LowerBound
integer :: UpperBound
integer :: Delimiter
LowerBound = LBOUND(Array)
UpperBound = UBOUND(Array)
if(sizeof(t) .gt. sizeof(InputLine)) then
write(*,*) 'PopulateIntegerArrayStuff - (sizeof(t) .gt. sizeof(InputLine))'
write(*,*) 'Cell ', index
write(*,*) 'Data ', t
stop
endif
InputLine = t
do while(InputLine .ne. ' ')
InputLine = ADJUSTL(InputLine)
Delimiter = index(InputLine, ',')
if(Delimiter .ne. 0) then
InputLine(Delimiter:Delimiter) = ' '
cycle
endif
Delimiter = index(InputLine, CHAR(9))! TAB
if(Delimiter .ne. 0) then
InputLine(Delimiter:Delimiter) = ' '
cycle
endif
Delimiter = INDEX(InputLine, ' ')
if(i .gt. UpperBound) then
write(*,*) 'PopulateIntegerArrayStuff - (i .gt. UpperBound)'
stop
endif
read(InputLine(1:Delimiter-1),*) Array(i)
i = i + 1
InputLine(1:Delimiter-1) = ' '
end do
end subroutine PopulateIntegerArrayStuff

Jim Dempsey

0 Kudos
Reply