F2C(1)

πŸ“¦
this version Β· 3 versions
, in epel 9, fedora 43, fedora 44, opensuse-leap 16.0

πŸ’– NAME πŸ’–

okay so this is F2C(1) β€” the f2c page β€” from the General Commands Manual, and it's literally here to convert Fortran 77 into C or C++ πŸ’…

f2c β€” Convert Fortran 77 to C or C++.


✨ SYNOPSIS ✨

f2c [ option ...  ] file ...

πŸ¦‹ DESCRIPTION πŸ¦‹

F2c converts Fortran 77 source code in files with names ending in .f or .F to C (or C++) source files in the current directory, with .c substituted for the final .f or .F. If no Fortran files are named, f2c reads Fortran from standard input and writes C on standard output. File names that end with .p or .P are taken to be prototype files, as produced by option -P, and are read first.

The following options have the same meaning as in f77(1).

🌈 Same-Meaning-as-f77(1) Options 🌈

  • -C β€” Compile code to check that subscripts are within declared array bounds.
  • -I2 β€” Render INTEGER and LOGICAL as short, INTEGERβˆ—4 as long int. Assume the default libF77 and libI77: allow only INTEGERβˆ—4 (and no LOGICAL) variables in INQUIREs. Option -I4 confirms the default rendering of INTEGER as long int.
  • -Idir β€” Look for a non-absolute include file first in the directory of the current input file, then in directories specified by -I options (one directory per option). Options -I2 and -I4 have precedence, so, e.g., a directory named 2 should be specified by -I./2 .
  • -onetrip β€” Compile DO loops that are performed at least once if reached. (Fortran 77 DO loops are not performed at all if the upper limit is smaller than the lower limit.)
  • -U β€” Honor the case of variable and external names. Fortran keywords must be in lower case.
  • -u β€” Make the default type of a variable undefined rather than using the default Fortran rules.
  • -w β€” Suppress all warning messages, or, if the option is -w66, just Fortran 66 compatibility warnings.

The following options are peculiar to f2c.

🧚 Peculiar-to-f2c Options 🧚

  • -A β€” Produce ANSI C (default, starting 20020621). For old-style C, use option -K.
  • -a β€” Make local variables automatic rather than static unless they appear in a DATA, EQUIVALENCE, NAMELIST, or SAVE statement.
  • -C++ β€” Output C++ code.
  • -c β€” Include original Fortran source as comments.
  • -cd β€” Do not recognize cdabs, cdcos, cdexp, cdlog, cdsin, and cdsqrt as synonyms for the double complex intrinsics zabs, zcos, zexp, zlog, zsin, and zsqrt, respectively, nor dreal as a synonym for dble.
  • -ddir β€” Write .c files in directory dir instead of the current directory.
  • -E β€” Declare uninitialized COMMON to be Extern (overridably defined in f2c.h as extern).
  • -ec β€” Place uninitialized COMMON blocks in separate files: COMMON /ABC/ appears in file abc_com.c. Option -e1c bundles the separate files into the output file, with comments that give an unbundling sed(1) script.
  • -ext β€” Complain about f77(1) extensions.
  • -f β€” Assume free-format input: accept text after column 72 and do not pad fixed-format lines shorter than 72 characters with blanks.
  • -72 β€” Treat text appearing after column 72 as an error.
  • -g β€” Include original Fortran line numbers in #line lines.
  • -h β€” Emulate Fortran 66's treatment of Hollerith: try to align character strings on word (or, if the option is -hd, on double-word) boundaries.
  • -i2 β€” Similar to -I2, but assume a modified libF77 and libI77 (compiled with -Df2c_i2), so INTEGER and LOGICAL variables may be assigned by INQUIRE and array lengths are stored in short ints.
  • -i90 β€” Do not recognize the Fortran 90 bit-manipulation intrinsics btest, iand, ibclr, ibits, ibset, ieor, ior, ishft, and ishftc.
  • -kr β€” Use temporary values to enforce Fortran expression evaluation where K&R (first edition) parenthesization rules allow rearrangement. If the option is -krd, use double precision temporaries even for single-precision operands.
  • -P β€” Write a file.P of ANSI (or C++) prototypes for definitions in each input file.f or file.F. When reading Fortran from standard input, write prototypes at the beginning of standard output. Option -Ps implies -P and gives exit status 4 if rerunning f2c may change prototypes or declarations.
  • -p β€” Supply preprocessor definitions to make common-block members look like local variables.
  • -R β€” Do not promote REAL functions and operations to DOUBLE PRECISION. Option -!R confirms the default, which imitates f77.
  • -r β€” Cast REAL arguments of intrinsic functions and values of REAL functions (including intrinsics) to REAL.
  • -r8 β€” Promote REAL to DOUBLE PRECISION, COMPLEX to DOUBLE COMPLEX.
  • -s β€” Preserve multidimensional subscripts. Suppressed by option -C .
  • -Tdir β€” Put temporary files in directory dir.
  • -trapuv β€” Dynamically initialize local variables, except those appearing in SAVE or DATA statements, with values that may help find references to uninitialized variables. For example, with IEEE arithmetic, initialize local floating-point variables to signaling NaNs.
  • -w8 β€” Suppress warnings when COMMON or EQUIVALENCE forces odd-word alignment of doubles.
  • -Wn β€” Assume n characters/word (default 4) when initializing numeric variables with character data.
  • -z β€” Do not implicitly recognize DOUBLE COMPLEX.
  • -!bs β€” Do not recognize backslash escapes (\", \', \0, \\, \b, \f, \n, \r, \t, \v) in character strings.
  • -!c β€” Inhibit C output, but produce -P output.
  • -!I β€” Reject include statements.
  • -!i8 β€” Disallow INTEGER*8 , or, if the option is -!i8const, permit INTEGER*8 but do not promote integer constants to INTEGER*8 when they involve more than 32 bits.
  • -!it β€” Don't infer types of untyped EXTERNAL procedures from use as parameters to previously defined or prototyped procedures.
  • -!P β€” Do not attempt to infer ANSI or C++ prototypes from usage.

The resulting C invokes the support routines of f77; object code should be loaded by f77 or with ld(1) or cc(1) options -lF77 -lI77 -lm. Calling conventions are those of f77: see the reference below.


πŸŽ€ FILES πŸŽ€

  • file.[fF] β€” input file
  • *.c β€” output file
  • /usr/include/f2c.h β€” header file
  • /usr/lib/libF77.a β€” intrinsic function library
  • /usr/lib/libI77.a β€” Fortran I/O library
  • /lib/libc.a β€” C library, see section 3

πŸ”₯ SEE ALSO πŸ”₯

S. I. Feldman and P. J. Weinberger, A Portable Fortran 77 Compiler, UNIX Time Sharing System Programmer's Manual, Tenth Edition, Volume 2, AT&T Bell Laboratories, 1990.


πŸ’€ DIAGNOSTICS πŸ’€

The diagnostics produced by f2c are intended to be self-explanatory.


πŸ™ˆ BUGS πŸ™ˆ

  • Floating-point constant expressions are simplified in the floating-point arithmetic of the machine running f2c, so they are typically accurate to at most 16 or 17 decimal places.
  • Untypable EXTERNAL functions are declared int.
  • There is no notation for INTEGER*8 constants.
  • Some intrinsic functions do not yet work with INTEGER*8 .

πŸ’– aaaand that's the whole F2C(1) page from the General Commands Manual β€” the footer/source-version-date slot is literally just the classic F2C(1) stamp, no extra source/version/date text to spill, periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from