Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

not a valid initialization

wen
Beginner
645 Views

When I compile the following module:

module t

integer :: i=2

integer :: j=i

end module t

IFort gave me the error message:

t.f90(3) : Error: This symbol must be a defined parameter or an argument of an inquiry function that evaluates to a compile-time constant.

Integer :: j=i

----------------^

t.f90(3) : Error: This is not a valid initialization expression.

Integer :: j=i

----------------^

Could you tell me what is wrong with my code? Thanks.

Wen

0 Kudos
2 Replies
anthonyrichards
New Contributor III
645 Views

Why not follow the compilers suggestion and try

integer, parameter:: i=2

?

0 Kudos
wen
Beginner
645 Views
Now I see what it meant. Thank you, Anthony.
Wen

0 Kudos
Reply