Fortran I/O (Was: Calling FORTRAN from C)

George Seibel seibel at cgl.ucsf.edu
Thu May 18 12:23:23 AEST 1989


In article <471 at chem.ucsd.EDU> tps at chem.ucsd.edu (Tom Stockfisch) writes:
>In article <8197 at june.cs.washington.edu> ka at june.cs.washington.edu (Kenneth Almquist) writes:

>In calling fortran from C I would like to avoid the fortran library as
>much as possible.  On our system the fortran i/o junk is almost 100k,
>stripped.  I tend to use fortran just for LINPACK and other stuff that
>does no i/o, so I hate the waste.

It's been my experience that Fortran I/O is pretty terrible in terms
of speed and compiled code volume.  I've actually written code (in fortran)
that reads a formatted record into a character buffer, converts the
ascii characters to integers, multiplies by powers of ten, and sums
to generate a floating point number.  This was significantly faster than
the standard reads.  This strikes me as ridiculous.  Is there some
fundamental reason for the lack of efficiency, or have I just been dealing
with a lot of bad implementations?

George Seibel, UCSF



More information about the Comp.lang.c mailing list