Re: Problem with log function - Intel fortran compiler under Linux
- From: "James Van Buskirk" <not_valid@xxxxxxxxxxx>
- Date: Fri, 19 Oct 2007 01:35:04 -0600
"Michael Metcalf" <michaelmetcalf@xxxxxxxxxxxxxx> wrote in message
news:aZORi.7628$tX1.3365@xxxxxxxxxxx
"dpb" <none@xxxxxxx> wrote in message news:ff8bkj$1lv$1@xxxxxxxxxxx
CWORK(J,I) = CWORK(J,I)+0.5*DLI1*(CHNK1*A1+
* CHNK2*A2)+CMPLX(0.5*GS,0.D0)
All variables are either real*8 or complex*16 ...
The mismatch is between the variables and the single-precision constant
(0.5) in the expression both in and out of the argument to CMPLX().
Just to be clear about this:
a) if CMPLX has two arguments, they can be integer or real and do not have
to 'match';
b) in this particular case, although it's true that 0.5 is single
precision, the argument is the expression 0.5*GS and so, if GS is real*8,
so is the argument.
c) CMPLX always returns a COMPLEX(KIND(1.0)) result, even if both arguments
are REAL(KIND(1.0D0)) unless the optional KIND argument is present. This
is one of the more confusing issues among the f90 intrinsics.
Whenever I see an argument to CMPLX explicitly given as double precision
and then see no KIND argument, I wonder whether the programmer has further
swelled the ranks of those who have fallen into this trap.
--
write(*,*) transfer(0.64682312090346863D-153,(/'X'/));end
.
- References:
- Problem with log function - Intel fortran compiler under Linux
- From: Arjen Markus
- Re: Problem with log function - Intel fortran compiler under Linux
- From: Arjen Markus
- Re: Problem with log function - Intel fortran compiler under Linux
- From: Arjen Markus
- Re: Problem with log function - Intel fortran compiler under Linux
- From: dpb
- Re: Problem with log function - Intel fortran compiler under Linux
- From: Arjen Markus
- Re: Problem with log function - Intel fortran compiler under Linux
- From: dpb
- Re: Problem with log function - Intel fortran compiler under Linux
- From: Michael Metcalf
- Problem with log function - Intel fortran compiler under Linux
- Prev by Date: Re: Lahey LF Fortran95 / VS2005 beta
- Next by Date: Re: Can Fortran2003 do "generic programming"?
- Previous by thread: Re: Problem with log function - Intel fortran compiler under Linux
- Next by thread: Compiler creating unnecessary intermediate temporary array
- Index(es):
Relevant Pages
|