Silverfrost Forums

Welcome to our forums

Operand incompatible with opcode

19 Jan 2007 12:59 #1551

When I compile the code below with the /check option I get an error message 'Operand incompatible with opcode' at line 14. What does this mean? It is very old code and was OK with FTN95 4.9.1.

  SUBROUTINE ACCTOG(MODE,IX,IVAL)
  INTEGER*1 IBTOG4
  COMMON/GUT4VB/IBTOG4(1024)
  IF(MODE.EQ.1.AND.IX.LT.0)THEN
     IF(IX.EQ.-1)THEN
        CALL I1ZERO(IBTOG4,1024)
     ELSE
        NF=-IX
        CALL I1ZERO(IBTOG4,NF)
     ENDIF
     GOTO 9999
  ENDIF
  IF(MODE.EQ.1)THEN
     IBTOG4(IX)=IVAL
  ELSE
     IVAL=IBTOG4(IX)
  ENDIF

9999 RETURN END

20 Jan 2007 5:12 #1553

This is a strange bug.

It only occurs with /check, not with /checkmate which is odd.

The checking process that is going wrong is to do with checking the type of the argument IVAL which has default type INTEGER4, whilst IBTOG4 has type INTEGER1.

We will investigate this. In the mean time, try using /checkmate instead or revert to an earlier version of FTN95.

22 Jan 2007 10:34 #1555

I tried using /checkmate and the 1st routine worked. However, here is one that gives the same error with /checkmate. I have cut it down a lot so there are also some warnings about unused variables.

  SUBROUTINE ADRCOL(IASTAR,NREP,ICOLD,ICNEW)
  INTRINSIC CORE1,CORE2,CORE4
  INTEGER*1 I1C,I1COLD,I1CNEW
  INTEGER*2 I2C,I2COLD,I2CNEW
  DATA NBYCOL/1/
  IF(NBYCOL.NE.1)GOTO 200
  IA=IASTAR
  I1COLD=IABS(ICOLD)
  I1CNEW=ICNEW
  IF(ICOLD.GE.0)THEN
     DO 10 I=1,NREP
     I1C=CORE1(IA)
     IF(I1C.EQ.I1COLD)CORE1(IA)=I1CNEW
     IA=IA+1

10 CONTINUE ENDIF GOTO 9999 200 CONTINUE IF(NBYCOL.NE.2)GOTO 400 IA=IASTAR I2COLD=IABS(ICOLD) I2CNEW=ICNEW 400 CONTINUE 9999 RETURN END

Please login to reply.