real*16

I have received some code that uses quadruple precision in some parts:

      SUBROUTINE GAUSSQ(NS,C,B,NSD,A)
      IMPLICIT REAL*16 (A-H,O-Z)
      DIMENSION C(NS),B(NS),A(NSD,NS)
      IF (NS.EQ.2) THEN
         C(1)=  .211324865405187117745425609749Q+00
         C(2)=  .788675134594812882254574390251Q+00
         B(1) =  0.5Q+00
         A(1,1)=  .250000000000000000000000000000Q+00
         A(1,2)= -.386751345948128822545743902510Q-01
         A(2,1)=  .538675134594812882254574390251Q+00
         A(2,2)=  .250000000000000000000000000000Q+00
      END IF

and so on. However, I can’t compile this code with pgf77, pgf90, etc. I get an error

PGFTN-W-0031-Illegal data type length specifier for real

Is there a way to get this to compile and run?

Jerry,

REAL*16 is not currently supported with PGI Fortran.

Best regards,

+chris

Could this support be added to a future release? real*16 capabilities, even if it is “slow” because of software implementation, could be very useful for a number of applications.

Hi Jerry,

Not sure if this will help, but there are a few Variable- or Multiple- or High-Precision Arithmetic libraries/modules for FORTRAN. I’ve never used any of them (I’ve been meaning to, but haven’t found the time), so I can’t say much about them. Two examples are http://crd-legacy.lbl.gov/~dhbailey/mpdist/ and http://myweb.lmu.edu/dmsmith/fmlib.html. If you do land up using something like these, it would be great if you could share some of your experiences.

Hope this helps.

Cheers,
Kyle

Jerry, you could try using double-double, DD, The mantissa uses two double words, although the exponent is still limited to +/- E308. There is a paper on using it here in the PGI library - do a search.

Malcolm