I have this code in a Fortran project:
ITEGER IV, IY
DIMENSION IV(NTAB,IDEPTH)
DIMENSION IY(IDEPTH)
DATA IV,IY /(IDEPTH*NTAB)*0,IDEPTH*0)/
Attempting to compile the project generates this error:
DATA IV,IY /(IDEPTH*NTAB)*0,IDEPTH*0)/
1
Syntax error in DATA statement at (1).
This worked under f77/g77 (gcc 4.1), but a recent upgrade has moved us to gcc 4.4 and gfortran. Now this code is causing errors but I just can't see the problem.
My guess is that this was an extension to the Standard, which is not supported any more. The FORTRAN 77 Standard, ch. 9.1 states that the repeat value shall be a
As such, the
IDEPTH*NTABis not allowed as repeat value.You can circumvent this by using another constant that constitutes the product:
Or, to make it strictly FORTRAN 77 compliant: