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

simple operations in statements

marlinux
Beginner
622 Views
Hello,
i have some problem with the simples operations in the statements.
For examples if A(j) and B(j) are two INTEGER the compiler gives me ERROR ifI write "A(l)=B(n+m)" or "A(l)=B(n*m)".
I have also some errors when I define some variables with operation in the dimension definition: for example when I define the integer C like "integer*4 C(n*m)".
Is there any compiler option to able this operations?
Thanks,

Martino
0 Kudos
3 Replies
Steven_L_Intel1
Employee
622 Views
Can you post a small but complete sample that shows the problem? I can't quite figure out what you're doing from the description, and often the other declarations are needed to understand the problem. It would also help if you said what the error messages were.

Steve
0 Kudos
marlinux
Beginner
622 Views
The error messages I have are for example:


...

PARAMETER N_CCD_BUF=MAX_X*MAX_Y
^
Error 157 at (28:ccdne_com.inc) : Evaluation overflow for the subexpression with this operator

....

....

COMMON /DATAXY/ I_XY(MAX_X*MAX_Y,N_CCD)
^
Error 157 at (161:ccdne_com.inc) : Evaluation overflow for the subexpression with this operator

....

where N_CCD_BUF is a INTEGER*4, and MAX_X and MAX_Y are INTEGER*2


....

parwt_b(IP+2) = ICHAR(i1+48)
^
Error 191 at (133:ccdne_inp_03.f) : This argument has either the wrong type or no type
....

where parwt_b is a INTEGER(1) with a dimension of 64 and IP and i1 are implicit integers.


I hope the problem will be more clear.
Thank you very much again,

Martino
0 Kudos
TimP
Honored Contributor III
622 Views
While you don't show enough to be certain of this, it appears that you have given MAX_X and MAX_Y values such that their product doesn't fit in 15 bits. Also, you are using a non-standard version of PARAMETER (no parentheses), which would have had different interpretations on different (long past) compilers, and I never saw such a combination.

Apparently, your compiler objects to assignment of a default integer intrinsic function result to an integer(1), or something has happened to make the compiler ignore whatever declaration you used to make parwt_b an array.

As I doubt you still have a pre-f77 compiler with which you are trying to be compatible, it might be worth while to make this closer to standard Fortran.
0 Kudos
Reply