[gfortran] I/O of large integer and real kinds, round 2

Steve Kargl sgk@troutmask.apl.washington.edu
Fri Jun 24 02:09:00 GMT 2005


On Thu, Jun 23, 2005 at 06:01:00PM -0700, Jerry DeLisle wrote:
> Steve Kargl wrote:
> 
> >
> >Guess why I was interested in your patch. :-)
> >
> I just converted another user to gfortran on Mac platform.  He has many 
> molecular dynamics codes that are working.  However, there are several 
> cases that are precision sensitive and we could really use real(10) and 
> real(16).  If you need help with specific pieces, let me know.  My 
> interest in intrinsics started with knowing this stage would have to 
> come. Thanks FX and Steve for doing this first step.
> 

When you say that you "could really use real(10) and real(16)",
is either type already available on the Mac?  I wasn't not
thinking about doing a software implementation of either type.

On at least FreeBSD-amd64, gfortran will be built with real(10).
I believe that the standards requires implementations for all
intrinsic procedures of real(10) if gfortran provides this kind.
(My copy of the draft standard is too far way to find the exact
requirement.)

That is, 

  program z
  real(10) x
  x = sin(0.5e0_10)
  end

is conforming.

My intentions are to provide wrapper functions to either call
libm functions if available or not use MPFR to do the work.
For example in a pseudocode,

return_type
gfc_sin_r1x(arg)
{
#if HAVE_SINL
    return sinl(arg)
#else
    return_type val
    mpfr_t x

    set x to arg
    mpfr_sin(x, )
    set val to x 

    return val
#endif
}

-- 
Steve



More information about the Fortran mailing list