[quote='IanLambley']The generic function is 'ABS()', whereas 'DABS' is expecting a double precision/real8 variable.
The following would work:[code]
REAL8 DIXR, DIXL
DIX(I) = DABS((DIXR + DIXL)/2.0)
[/code]
Your code must be using single precision for the variable, i.e. 'REAL4' and therefore only has about 7 digits precision, REAL8 is a much better option for all your variables. The '/DREAL' compilation option can help otherwise define every real variable as REAL8.
[code]
IMPLICIT REAL8 (A-H,O-Z)
[/code] as the first statement of a routine will ensure that the standard Fortran assignments of real variables uses the higher precision.
Actually, you don't need to use 'DABS()' at all these days, just use 'ABS()' for any numeric variable and the compiler will sort it out.
The same really goes for other functions that at one time requred preceding by a D or an I, e.g. IABS, DCOS etc.
In your case, the first argument is everything in the brackets '(DIXR + DIXL)/2.0' as there is only one argument for this function. An argument being an input/output variable or and input value/expression.
Real kind 1 is a real number stored in 4 bytes.
Real kind 2 is a real number stored in 8 bytes.
Real kind 3 is a real number stored in 10 bytes for FTN95.
Ian[/quote]
Dear Ian
Thanks a lot for your valuable information. Now I understand what is the issue.
Just one more question.
In the beginning of my code, it is declared as
IMPLICIT Real*8 (A-H,O-Z)
As you have mentioned. I supposed having this declaration, it should work, but it didn't.
Also I have to add that after compilation it gets error and stops in the IMPLICIT line.
Will be happy to know your opinion