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

ifx: catastrophic error: Statement too long; token limit is 41000.

New Contributor I

Hi guys,

In our program, we have a large static array for precomputed coefficients of series for gamma function approximation (also known as Boys functions).


integer, public, parameter :: npf = 450
integer, public, parameter :: ngrd = 7
integer, public, parameter :: ntx_al = 7
real(kind=8), public, parameter :: fgrid(0:ntx_al,0:npf,0:ngrd) = reshape([ &
0.1000000000000002D+01, -0.1944677204778938D-01, 0.3403592489727661D-03, &
0.0000000000000000D+00 ], shape=[ntx_al+1, npf+1, ngrd+1])


 Both, ifx and ifort (IFX 2023.02) failed to compile the whole file (see the attachment) with the error: `catastrophic error: Statement too long; token limit is 41000.` The whole size of the array is 225 kB in memory.

What is the proper way to initialize such large arrays in compile time? 

0 Kudos
1 Reply

The limiting factor is not the size of the array. It's the number of continuation lines, the statement length. 




0 Kudos