Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Intrensic error

Status
Not open for further replies.

khkhan

Programmer
Aug 7, 2018
1
US
thread214-1610541
Hello everyone

I'm using gfortran on SUSE to compile my code and receive the following error:

CODE

DELTAL = SIGN (.1,(GFIX-GAMFLT))
1
Error: 'b' argument of 'sign' intrinsic at (1) must be the same type and kind as 'a'


Here's my code attached where at 3509 line the error happens:


 
 https://files.engineering.com/getfile.aspx?folder=d55e28c0-10bf-4c50-b07f-c1de071c9567&file=sftol.f
As the compiler said, both arguments of the SIGN function must be of the same type.

On the beginning of your program you have this declaration
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
that means that your variables GFIX and GAMFLT are double precision.
But the constant .1 seems to be handled by the compiler as single precision constant. To make it double precision use for example this notation with double precision exponent: 0.1D0
So instead of
DELTAL = SIGN (.1,(GFIX-GAMFLT))
try to use
DELTAL = SIGN (0.1D0,(GFIX-GAMFLT))
and see if it helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top