Contents Menu Expand Light mode Dark mode Auto light/dark mode
Using GNU Fortran 13.0.1 (experimental 20220101) documentation
Logo
Using GNU Fortran 13.0.1 (experimental 20220101) documentation
  • Copyright
  • Introduction
    • About GNU Fortran
    • GNU Fortran and GCC
    • Standards
  • GNU Fortran Command Options
    • Description
    • Option summary
    • Options controlling Fortran dialect
    • Enable and customize preprocessing
    • Options to request or suppress errors and warnings
    • Options for debugging your program or GNU Fortran
    • Options for directory search
    • Influencing the linking step
    • Influencing runtime behavior
    • Options for code generation conventions
    • Options for interoperability with other languages
    • Environment variables affecting gfortran
  • Runtime: Influencing runtime behavior with environment variables
    • TMPDIR—Directory for scratch files
    • GFORTRAN_STDIN_UNIT—Unit number for standard input
    • GFORTRAN_STDOUT_UNIT—Unit number for standard output
    • GFORTRAN_STDERR_UNIT—Unit number for standard error
    • GFORTRAN_UNBUFFERED_ALL—Do not buffer I/O on all units
    • GFORTRAN_UNBUFFERED_PRECONNECTED—Do not buffer I/O on preconnected units
    • GFORTRAN_SHOW_LOCUS—Show location for runtime errors
    • GFORTRAN_OPTIONAL_PLUS—Print leading + where permitted
    • GFORTRAN_LIST_SEPARATOR—Separator for list output
    • GFORTRAN_CONVERT_UNIT—Set conversion for unformatted I/O
    • GFORTRAN_ERROR_BACKTRACE—Show backtrace on run-time errors
    • GFORTRAN_FORMATTED_BUFFER_SIZE—Set buffer size for formatted I/O
    • GFORTRAN_UNFORMATTED_BUFFER_SIZE—Set buffer size for unformatted I/O
  • Compiler Characteristics
    • KIND Type Parameters
    • Internal representation of LOGICAL variables
    • Evaluation of logical expressions
    • MAX and MIN intrinsics with REAL NaN arguments
    • Thread-safety of the runtime library
    • Data consistency and durability
    • Files opened without an explicit ACTION= specifier
    • File operations on symbolic links
    • File format of unformatted sequential files
    • Asynchronous I/O
  • Extensions
    • Extensions implemented in GNU Fortran
    • Extensions not implemented in GNU Fortran
  • Mixed-Language Programming
    • Interoperability with C
    • GNU Fortran Compiler Directives
    • Non-Fortran Main Program
    • Naming and argument-passing conventions
  • Coarray Programming
    • Type and enum ABI Documentation
    • Function ABI Documentation
  • Intrinsic Procedures
    • Introduction to intrinsic procedures
    • ABORT — Abort the program
    • ABS — Absolute value
    • ACCESS — Checks file access modes
    • ACHAR — Character in ASCII collating sequence
    • ACOS — Arccosine function
    • ACOSD — Arccosine function, degrees
    • ACOSH — Inverse hyperbolic cosine function
    • ADJUSTL — Left adjust a string
    • ADJUSTR — Right adjust a string
    • AIMAG — Imaginary part of complex number
    • AINT — Truncate to a whole number
    • ALARM — Execute a routine after a given delay
    • ALL — All values in MASK along DIM are true
    • ALLOCATED — Status of an allocatable entity
    • AND — Bitwise logical AND
    • ANINT — Nearest whole number
    • ANY — Any value in MASK along DIM is true
    • ASIN — Arcsine function
    • ASIND — Arcsine function, degrees
    • ASINH — Inverse hyperbolic sine function
    • ASSOCIATED — Status of a pointer or pointer/target pair
    • ATAN — Arctangent function
    • ATAND — Arctangent function, degrees
    • ATAN2 — Arctangent function
    • ATAN2D — Arctangent function, degrees
    • ATANH — Inverse hyperbolic tangent function
    • ATOMIC_ADD — Atomic ADD operation
    • ATOMIC_AND — Atomic bitwise AND operation
    • ATOMIC_CAS — Atomic compare and swap
    • ATOMIC_DEFINE — Setting a variable atomically
    • ATOMIC_FETCH_ADD — Atomic ADD operation with prior fetch
    • ATOMIC_FETCH_AND — Atomic bitwise AND operation with prior fetch
    • ATOMIC_FETCH_OR — Atomic bitwise OR operation with prior fetch
    • ATOMIC_FETCH_XOR — Atomic bitwise XOR operation with prior fetch
    • ATOMIC_OR — Atomic bitwise OR operation
    • ATOMIC_REF — Obtaining the value of a variable atomically
    • ATOMIC_XOR — Atomic bitwise OR operation
    • BACKTRACE — Show a backtrace
    • BESSEL_J0 — Bessel function of the first kind of order 0
    • BESSEL_J1 — Bessel function of the first kind of order 1
    • BESSEL_JN — Bessel function of the first kind
    • BESSEL_Y0 — Bessel function of the second kind of order 0
    • BESSEL_Y1 — Bessel function of the second kind of order 1
    • BESSEL_YN — Bessel function of the second kind
    • BGE — Bitwise greater than or equal to
    • BGT — Bitwise greater than
    • BIT_SIZE — Bit size inquiry function
    • BLE — Bitwise less than or equal to
    • BLT — Bitwise less than
    • BTEST — Bit test function
    • C_ASSOCIATED — Status of a C pointer
    • C_F_POINTER — Convert C into Fortran pointer
    • C_F_PROCPOINTER — Convert C into Fortran procedure pointer
    • C_FUNLOC — Obtain the C address of a procedure
    • C_LOC — Obtain the C address of an object
    • C_SIZEOF — Size in bytes of an expression
    • CEILING — Integer ceiling function
    • CHAR — Character conversion function
    • CHDIR — Change working directory
    • CHMOD — Change access permissions of files
    • CMPLX — Complex conversion function
    • CO_BROADCAST — Copy a value to all images the current set of images
    • CO_MAX — Maximal value on the current set of images
    • CO_MIN — Minimal value on the current set of images
    • CO_REDUCE — Reduction of values on the current set of images
    • CO_SUM — Sum of values on the current set of images
    • COMMAND_ARGUMENT_COUNT — Get number of command line arguments
    • COMPILER_OPTIONS — Options passed to the compiler
    • COMPILER_VERSION — Compiler version string
    • COMPLEX — Complex conversion function
    • CONJG — Complex conjugate function
    • COS — Cosine function
    • COSD — Cosine function, degrees
    • COSH — Hyperbolic cosine function
    • COTAN — Cotangent function
    • COTAND — Cotangent function, degrees
    • COUNT — Count function
    • CPU_TIME — CPU elapsed time in seconds
    • CSHIFT — Circular shift elements of an array
    • CTIME — Convert a time into a string
    • DATE_AND_TIME — Date and time subroutine
    • DBLE — Double conversion function
    • DCMPLX — Double complex conversion function
    • DIGITS — Significant binary digits function
    • DIM — Positive difference
    • DOT_PRODUCT — Dot product function
    • DPROD — Double product function
    • DREAL — Double real part function
    • DSHIFTL — Combined left shift
    • DSHIFTR — Combined right shift
    • DTIME — Execution time subroutine (or function)
    • EOSHIFT — End-off shift elements of an array
    • EPSILON — Epsilon function
    • ERF — Error function
    • ERFC — Error function
    • ERFC_SCALED — Error function
    • ETIME — Execution time subroutine (or function)
    • EVENT_QUERY — Query whether a coarray event has occurred
    • EXECUTE_COMMAND_LINE — Execute a shell command
    • EXIT — Exit the program with status.
    • EXP — Exponential function
    • EXPONENT — Exponent function
    • EXTENDS_TYPE_OF — Query dynamic type for extension
    • FDATE — Get the current time as a string
    • FGET — Read a single character in stream mode from stdin
    • FGETC — Read a single character in stream mode
    • FINDLOC — Search an array for a value
    • FLOOR — Integer floor function
    • FLUSH — Flush I/O unit(s)
    • FNUM — File number function
    • FPUT — Write a single character in stream mode to stdout
    • FPUTC — Write a single character in stream mode
    • FRACTION — Fractional part of the model representation
    • FREE — Frees memory
    • FSEEK — Low level file positioning subroutine
    • FSTAT — Get file status
    • FTELL — Current stream position
    • GAMMA — Gamma function
    • GERROR — Get last system error message
    • GETARG — Get command line arguments
    • GET_COMMAND — Get the entire command line
    • GET_COMMAND_ARGUMENT — Get command line arguments
    • GETCWD — Get current working directory
    • GETENV — Get an environmental variable
    • GET_ENVIRONMENT_VARIABLE — Get an environmental variable
    • GETGID — Group ID function
    • GETLOG — Get login name
    • GETPID — Process ID function
    • GETUID — User ID function
    • GMTIME — Convert time to GMT info
    • HOSTNM — Get system host name
    • HUGE — Largest number of a kind
    • HYPOT — Euclidean distance function
    • IACHAR — Code in ASCII collating sequence
    • IALL — Bitwise AND of array elements
    • IAND — Bitwise logical and
    • IANY — Bitwise OR of array elements
    • IARGC — Get the number of command line arguments
    • IBCLR — Clear bit
    • IBITS — Bit extraction
    • IBSET — Set bit
    • ICHAR — Character-to-integer conversion function
    • IDATE — Get current local time subroutine (day/month/year)
    • IEOR — Bitwise logical exclusive or
    • IERRNO — Get the last system error number
    • IMAGE_INDEX — Function that converts a cosubscript to an image index
    • INDEX — Position of a substring within a string
    • INT — Convert to integer type
    • INT2 — Convert to 16-bit integer type
    • INT8 — Convert to 64-bit integer type
    • IOR — Bitwise logical or
    • IPARITY — Bitwise XOR of array elements
    • IRAND — Integer pseudo-random number
    • IS_CONTIGUOUS — Test whether an array is contiguous
    • IS_IOSTAT_END — Test for end-of-file value
    • IS_IOSTAT_EOR — Test for end-of-record value
    • ISATTY — Whether a unit is a terminal device
    • ISHFT — Shift bits
    • ISHFTC — Shift bits circularly
    • ISNAN — Test for a NaN
    • ITIME — Get current local time subroutine (hour/minutes/seconds)
    • KILL — Send a signal to a process
    • KIND — Kind of an entity
    • LBOUND — Lower dimension bounds of an array
    • LCOBOUND — Lower codimension bounds of an array
    • LEADZ — Number of leading zero bits of an integer
    • LEN — Length of a character entity
    • LEN_TRIM — Length of a character entity without trailing blank characters
    • LGE — Lexical greater than or equal
    • LGT — Lexical greater than
    • LINK — Create a hard link
    • LLE — Lexical less than or equal
    • LLT — Lexical less than
    • LNBLNK — Index of the last non-blank character in a string
    • LOC — Returns the address of a variable
    • LOG — Natural logarithm function
    • LOG10 — Base 10 logarithm function
    • LOG_GAMMA — Logarithm of the Gamma function
    • LOGICAL — Convert to logical type
    • LSHIFT — Left shift bits
    • LSTAT — Get file status
    • LTIME — Convert time to local time info
    • MALLOC — Allocate dynamic memory
    • MASKL — Left justified mask
    • MASKR — Right justified mask
    • MATMUL — matrix multiplication
    • MAX — Maximum value of an argument list
    • MAXEXPONENT — Maximum exponent of a real kind
    • MAXLOC — Location of the maximum value within an array
    • MAXVAL — Maximum value of an array
    • MCLOCK — Time function
    • MCLOCK8 — Time function (64-bit)
    • MERGE — Merge variables
    • MERGE_BITS — Merge of bits under mask
    • MIN — Minimum value of an argument list
    • MINEXPONENT — Minimum exponent of a real kind
    • MINLOC — Location of the minimum value within an array
    • MINVAL — Minimum value of an array
    • MOD — Remainder function
    • MODULO — Modulo function
    • MOVE_ALLOC — Move allocation from one object to another
    • MVBITS — Move bits from one integer to another
    • NEAREST — Nearest representable number
    • NEW_LINE — New line character
    • NINT — Nearest whole number
    • NORM2 — Euclidean vector norms
    • NOT — Logical negation
    • NULL — Function that returns an disassociated pointer
    • NUM_IMAGES — Function that returns the number of images
    • OR — Bitwise logical OR
    • PACK — Pack an array into an array of rank one
    • PARITY — Reduction with exclusive OR
    • PERROR — Print system error message
    • POPCNT — Number of bits set
    • POPPAR — Parity of the number of bits set
    • PRECISION — Decimal precision of a real kind
    • PRESENT — Determine whether an optional dummy argument is specified
    • PRODUCT — Product of array elements
    • RADIX — Base of a model number
    • RAN — Real pseudo-random number
    • RAND — Real pseudo-random number
    • RANDOM_INIT — Initialize a pseudo-random number generator
    • RANDOM_NUMBER — Pseudo-random number
    • RANDOM_SEED — Initialize a pseudo-random number sequence
    • RANGE — Decimal exponent range
    • RANK — Rank of a data object
    • REAL — Convert to real type
    • RENAME — Rename a file
    • REPEAT — Repeated string concatenation
    • RESHAPE — Function to reshape an array
    • RRSPACING — Reciprocal of the relative spacing
    • RSHIFT — Right shift bits
    • SAME_TYPE_AS — Query dynamic types for equality
    • SCALE — Scale a real value
    • SCAN — Scan a string for the presence of a set of characters
    • SECNDS — Time function
    • SECOND — CPU time function
    • SELECTED_CHAR_KIND — Choose character kind
    • SELECTED_INT_KIND — Choose integer kind
    • SELECTED_REAL_KIND — Choose real kind
    • SET_EXPONENT — Set the exponent of the model
    • SHAPE — Determine the shape of an array
    • SHIFTA — Right shift with fill
    • SHIFTL — Left shift
    • SHIFTR — Right shift
    • SIGN — Sign copying function
    • SIGNAL — Signal handling subroutine (or function)
    • SIN — Sine function
    • SIND — Sine function, degrees
    • SINH — Hyperbolic sine function
    • SIZE — Determine the size of an array
    • SIZEOF — Size in bytes of an expression
    • SLEEP — Sleep for the specified number of seconds
    • SPACING — Smallest distance between two numbers of a given type
    • SPREAD — Add a dimension to an array
    • SQRT — Square-root function
    • SRAND — Reinitialize the random number generator
    • STAT — Get file status
    • STORAGE_SIZE — Storage size in bits
    • SUM — Sum of array elements
    • SYMLNK — Create a symbolic link
    • SYSTEM — Execute a shell command
    • SYSTEM_CLOCK — Time function
    • TAN — Tangent function
    • TAND — Tangent function, degrees
    • TANH — Hyperbolic tangent function
    • THIS_IMAGE — Function that returns the cosubscript index of this image
    • TIME — Time function
    • TIME8 — Time function (64-bit)
    • TINY — Smallest positive number of a real kind
    • TRAILZ — Number of trailing zero bits of an integer
    • TRANSFER — Transfer bit patterns
    • TRANSPOSE — Transpose an array of rank two
    • TRIM — Remove trailing blank characters of a string
    • TTYNAM — Get the name of a terminal device
    • UBOUND — Upper dimension bounds of an array
    • UCOBOUND — Upper codimension bounds of an array
    • UMASK — Set the file creation mask
    • UNLINK — Remove a file from the file system
    • UNPACK — Unpack an array of rank one into an array
    • VERIFY — Scan a string for characters not a given set
    • XOR — Bitwise logical exclusive OR
  • Intrinsic Modules
    • OpenACC Module OPENACC
    • ISO_FORTRAN_ENV
    • ISO_C_BINDING
    • IEEE modules: IEEE_EXCEPTIONS, IEEE_ARITHMETIC, and IEEE_FEATURES
    • OpenMP Modules OMP_LIB and OMP_LIB_KINDS
  • Contributing
    • Contributors to GNU Fortran
    • Projects
  • GNU GENERAL PUBLIC LICENSE
  • GNU Free Documentation License
  • Funding Free Software
  • Indexes and tables
Back to top
Edit this page

Options for directory search#

These options affect how GNU Fortran searches for files specified by the INCLUDE directive and where it searches for previously compiled modules.

It also affects the search paths used by cpp when used to preprocess Fortran source.

-Idir#

These affect interpretation of the INCLUDE directive (as well as of the #include directive of the cpp preprocessor).

Also note that the general behavior of -I and INCLUDE is pretty much the same as of -I with #include in the cpp preprocessor, with regard to looking for header.gcc files and other such things.

This path is also used to search for .mod files when previously compiled modules are required by a USE statement.

See Options for Directory Search, for information on the -I option.

-Jdir#

This option specifies where to put .mod files for compiled modules. It is also added to the list of directories to searched by an USE statement.

The default is the current directory.

-fintrinsic-modules-path dir#

This option specifies the location of pre-compiled intrinsic modules, if they are not in the default location expected by the compiler.

Next
Influencing the linking step
Previous
Options for debugging your program or GNU Fortran
Copyright © 1999-2022 Free Software Foundation, Inc.
Made with Sphinx and @pradyunsg's Furo
Last updated on Nov 08, 2022