|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
shahid
Joined: 16 Aug 2006 Posts: 6
|
Posted: Thu Nov 02, 2006 10:29 am Post subject: error 137 - Operand incompatible with opcode |
|
|
hi,
i am using personal version of salford FTN95.i am compiling one program but it is not compiling and giving the following error message.
error 137 - Operand incompatible with opcode
and it is pointing at one of the expression in the following function:
REAL FUNCTION FA(X,Y)
! .. Scalar Arguments ..
REAL X, Y, R
complex VALUE
REAL pi,umu,ep0,c,Frequency,Alam,kay0,er,a,m_l,m_u,m_m,n_l,n_u,n_m,zt,zs
COMPLEX jay
INTEGER ReIm
COMMON /C1/ pi,umu,ep0,c,Frequency,Alam,kay0,er,a,jay,ReIm,m_l,m_u,m_m,n_l,n_u,n_m,zt,zs
INTRINSIC SQRT,CEXP
R = SQRT(a*a+(X-Y)*(X-Y))
VALUE = 1.0/(4.*pi*R**5)*(cos(kay0*R)-jay*sin(kay0*R))
VALUE = VALUE * ((1+jay*kay0*R)*(2.*R**2-3*a**2)+(kay0*a*R)**2)
VALUE = VALUE*sin(kay0(X-n_l))*sin(kay0(y-m_l))
IF(ReIm.EQ.0)THEN
FA=REAL(VALUE)
ELSE
FA=AIMAG(VALUE)
ENDIF
RETURN
END
the error is pointed at this expression : VALUE = 1.0/(4.*pi*R**5)*(cos(kay0*R)-jay*sin(kay0*R))
i dont know whats the cause of this error mesage.
any help would be highly appreciated.
thanks
|
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Thu Nov 02, 2006 11:40 pm Post subject: error 137 - Operand incompatible with opcode |
|
|
Try
REAL FUNCTION FA (X,Y)
! .. Scalar Arguments ..
REAL X, Y
!
COMMON /C1/ pi,umu,ep0,c,Frequency,Alam,kay0,er,a,jay,ReIm,m_l,m_u,m_m,n_l,n_u,n_m,zt,zs
REAL pi,umu,ep0,c,Frequency,Alam,kay0,er,a,m_l,m_u,m_m,n_l,n_u,n_m,zt,zs
COMPLEX jay
INTEGER ReIm
!
INTRINSIC SQRT,COS,SIN
real r, co, si, t1, t2
complex VALUE
!
R = SQRT(a*a+(X-Y)*(X-Y))
! VALUE = 1.0/(4.*pi*R**5)*(cos(kay0*R)-jay*sin(kay0*R))
t1 = 1.0/(4.*pi*R**5)
co = cos(kay0*R)
si = sin(kay0*R)
value = t1 * co - jay*t1*si
!
! VALUE = VALUE * ((1+jay*kay0*R)*(2.*R**2-3*a**2)+(kay0*a*R)**2)
t1 = 2.*R**2-3*a**2
t2 = (kay0*a*R)**2
VALUE = VALUE*(t1+t2) + jay * (value*t1*kay0*R)
!
! VALUE = VALUE*sin(kay0*(X-n_l))*sin(kay0*(y-m_l))
t1 = sin(kay0*(X-n_l))
t2 = sin(kay0*(y-m_l))
value = value * t1 * t2
!
IF (ReIm == 0)THEN
FA=REAL(VALUE)
ELSE
FA=AIMAG(VALUE)
ENDIF
RETURN
END
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Fri Nov 03, 2006 11:22 am Post subject: error 137 - Operand incompatible with opcode |
|
|
Shahid
The error is on the line
VALUE = VALUE*sin(kay0(X-n_l))*sin(kay0(y-m_l))
which should be
VALUE = VALUE*sin(kay0*(X-n_l))*sin(kay0*(y-m_l))
We have now changed the compiler so that it gives a sensible diagnostic in this situation. |
|
Back to top |
|
|
shahid
Joined: 16 Aug 2006 Posts: 6
|
Posted: Fri Nov 03, 2006 11:28 am Post subject: error 137 - Operand incompatible with opcode |
|
|
thank you very much Paul.
you are absolutely right.
after i make this change my program is successfully compiled.
regards,
shahid |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|