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

Error 6465...can't use parameter in array size?

chris-sn
Beginner
834 Views

I am trying to convert some elderly COMPAQ vintage Fortran to compile under the Intel compiler, and VS 2008. After using the "Extract Compaq Visual FORTRAN Project Items" tool I get masses of compilation errors :-(

The first set are of this form:

In SOMESUB.FOR I have

INCLUDE 'PARAMS.FI'

INCLUDE 'VALVE.FI'

PARAMS.FI contains

PARAMETER (P_JWTVLV=600)

VALVE.FI contains

STRUCTURE /NRTV_S/

INTEGER NVALVE(P_JWTVLV)

...

Compilation of SOMESUB.FOR fails with

error #6465: Adjustable, assumed-size, or passed-length declarations are invalid in field declarations. [NVALVE]


Any idea on cause/best solution? I can fix the compilation error by hard coding 600 into the declaration of NVALVE, but that's a pretty horrible thing to have to do.

0 Kudos
1 Solution
TimP
Honored Contributor III
834 Views
This should work, if P_JWTVLV is declared integer before assigning a value, and the files are included in the order you quoted. The f90 way would be
INTEGER, PARAMETER :: P_JWTVLV = 600
If you didn't give P_JWTVLV a type, you are running into non-support of a legacy pre-f77 version of PARAMETER.

View solution in original post

0 Kudos
2 Replies
TimP
Honored Contributor III
835 Views
This should work, if P_JWTVLV is declared integer before assigning a value, and the files are included in the order you quoted. The f90 way would be
INTEGER, PARAMETER :: P_JWTVLV = 600
If you didn't give P_JWTVLV a type, you are running into non-support of a legacy pre-f77 version of PARAMETER.
0 Kudos
chris-sn
Beginner
834 Views
Whoops ... I just noticed the $IF DEFINED (OS_WINDOWS) way back in the parameters include file. Having got rid of that malarkey (compiling on DOS is no longer a requirement !) I am down to two errors - woohoo!

Thanks for the thought Tim!

0 Kudos
Reply