PRB: Error 87 When DREAL Function Used in DCMPLX Function
PSS ID Number: Q10636
Article last modified on 02-09-1993

3.20

MS-DOS


----------------------------------------------------------------------
The information in this article applies to:

 - Microsoft FORTRAN for MS-DOS, version 3.2
----------------------------------------------------------------------

Summary:

SYMPTOMS
   An attempt to compile an application fails and the compiler
   generates the following message:

      ***** Error 87,line 3 -- argument type conflict

CAUSE
   The application uses the DREAL intrinsic function in an argument to
   the DCMPLX intrinsic function.

RESOLUTION
   Store the results of the DREAL intrinsic function in a temporary
   variable. Specify the temporary variable in the DCMPLX function
   call.

STATUS
   Microsoft has confirmed this to be a problem in FORTRAN version 3.2
   for MS-DOS. This problem was corrected in FORTRAN version 3.3 for
   MS-DOS.

More Information:

The following code example demonstrates this problem.

Sample Code #1
--------------

C Compile options needed: None

      COMPLEX*16 X, Y

      X = (1.0D0, 2.0D0)
      Y = DCMPLX(DREAL(X), 3.0D0)
      WRITE(*, *) Y
      END

The following code example demonstrates the method to avoid this
problem.

Sample Code #2
--------------

C Compile options needed: None

      COMPLEX*16 X, Y
      REAL*8 Z

      X = (1.0D0, 2.0D0)
      Z = DREAL(X)
      Y = DCMPLX(Z, 3.0D0)
      WRITE(*,*) Y
      STOP
      END

Additional reference words: 3.20

=============================================================================

Copyright Microsoft Corporation 1993.
