The GNU Fortran Compiler
Short Contents
- Introduction
- 1 Introduction
- 2 GNU Fortran Command Options
- 3 Runtime: Influencing runtime behavior with environment variables
- 4 Fortran 2003 and 2008 Status
- 5 Compiler Characteristics
- 6 Extensions
- 7 Mixed-Language Programming
- 8 Intrinsic Procedures
- 9 Intrinsic Modules
- Contributing
- GNU General Public License
- GNU Free Documentation License
- Funding Free Software
- Option Index
- Keyword Index
Table of Contents
- Introduction
- 1 Introduction
-
2 GNU Fortran Command Options
- 2.1 Option summary
- 2.2 Options controlling Fortran dialect
- 2.3 Enable and customize preprocessing
- 2.4 Options to request or suppress errors and warnings
- 2.5 Options for debugging your program or GNU Fortran
- 2.6 Options for directory search
- 2.7 Influencing the linking step
- 2.8 Influencing runtime behavior
- 2.9 Options for code generation conventions
-
2.10 Environment variables affecting
gfortran
-
3 Runtime: Influencing runtime behavior with environment variables
-
3.1
TMPDIR
—Directory for scratch files -
3.2
GFORTRAN_STDIN_UNIT
—Unit number for standard input -
3.3
GFORTRAN_STDOUT_UNIT
—Unit number for standard output -
3.4
GFORTRAN_STDERR_UNIT
—Unit number for standard error -
3.5
GFORTRAN_UNBUFFERED_ALL
—Do not buffer I/O on all units -
3.6
GFORTRAN_UNBUFFERED_PRECONNECTED
—Do not buffer I/O on preconnected units -
3.7
GFORTRAN_SHOW_LOCUS
—Show location for runtime errors -
3.8
GFORTRAN_OPTIONAL_PLUS
—Print leading + where permitted -
3.9
GFORTRAN_DEFAULT_RECL
—Default record length for new files -
3.10
GFORTRAN_LIST_SEPARATOR
—Separator for list output -
3.11
GFORTRAN_CONVERT_UNIT
—Set endianness for unformatted I/O -
3.12
GFORTRAN_ERROR_BACKTRACE
—Show backtrace on run-time errors
-
3.1
- 4 Fortran 2003 and 2008 Status
- 5 Compiler Characteristics
-
6 Extensions
-
6.1 Extensions implemented in GNU Fortran
- 6.1.1 Old-style kind specifications
- 6.1.2 Old-style variable initialization
- 6.1.3 Extensions to namelist
-
6.1.4
X
format descriptor without count field -
6.1.5 Commas in
FORMAT
specifications -
6.1.6 Missing period in
FORMAT
specifications - 6.1.7 I/O item lists
-
6.1.8
Q
exponent-letter - 6.1.9 BOZ literal constants
- 6.1.10 Real array indices
- 6.1.11 Unary operators
-
6.1.12 Implicitly convert
LOGICAL
andINTEGER
values - 6.1.13 Hollerith constants support
- 6.1.14 Cray pointers
-
6.1.15
CONVERT
specifier - 6.1.16 OpenMP
-
6.1.17 Argument list functions
%VAL
,%REF
and%LOC
- 6.2 Extensions not implemented in GNU Fortran
-
6.1 Extensions implemented in GNU Fortran
-
7 Mixed-Language Programming
- 7.1 Interoperability with C
- 7.2 GNU Fortran Compiler Directives
-
7.3 Non-Fortran Main Program
-
7.3.1
_gfortran_set_args
— Save command-line arguments -
7.3.2
_gfortran_set_options
— Set library option flags -
7.3.3
_gfortran_set_convert
— Set endian conversion -
7.3.4
_gfortran_set_record_marker
— Set length of record markers -
7.3.5
_gfortran_set_fpe
— Enable floating point exception traps -
7.3.6
_gfortran_set_max_subrecord_length
— Set subrecord length
-
7.3.1
- 7.4 Naming and argument-passing conventions
-
8 Intrinsic Procedures
- 8.1 Introduction to intrinsic procedures
-
8.2
ABORT
— Abort the program -
8.3
ABS
— Absolute value -
8.4
ACCESS
— Checks file access modes -
8.5
ACHAR
— Character in ASCII collating sequence -
8.6
ACOS
— Arccosine function -
8.7
ACOSH
— Inverse hyperbolic cosine function -
8.8
ADJUSTL
— Left adjust a string -
8.9
ADJUSTR
— Right adjust a string -
8.10
AIMAG
— Imaginary part of complex number -
8.11
AINT
— Truncate to a whole number -
8.12
ALARM
— Execute a routine after a given delay -
8.13
ALL
— All values in MASK along DIM are true -
8.14
ALLOCATED
— Status of an allocatable entity -
8.15
AND
— Bitwise logical AND -
8.16
ANINT
— Nearest whole number -
8.17
ANY
— Any value in MASK along DIM is true -
8.18
ASIN
— Arcsine function -
8.19
ASINH
— Inverse hyperbolic sine function -
8.20
ASSOCIATED
— Status of a pointer or pointer/target pair -
8.21
ATAN
— Arctangent function -
8.22
ATAN2
— Arctangent function -
8.23
ATANH
— Inverse hyperbolic tangent function -
8.24
ATOMIC_DEFINE
— Setting a variable atomically -
8.25
ATOMIC_REF
— Obtaining the value of a variable atomically -
8.26
BACKTRACE
— Show a backtrace -
8.27
BESSEL_J0
— Bessel function of the first kind of order 0 -
8.28
BESSEL_J1
— Bessel function of the first kind of order 1 -
8.29
BESSEL_JN
— Bessel function of the first kind -
8.30
BESSEL_Y0
— Bessel function of the second kind of order 0 -
8.31
BESSEL_Y1
— Bessel function of the second kind of order 1 -
8.32
BESSEL_YN
— Bessel function of the second kind -
8.33
BGE
— Bitwise greater than or equal to -
8.34
BGT
— Bitwise greater than -
8.35
BIT_SIZE
— Bit size inquiry function -
8.36
BLE
— Bitwise less than or equal to -
8.37
BLT
— Bitwise less than -
8.38
BTEST
— Bit test function -
8.39
C_ASSOCIATED
— Status of a C pointer -
8.40
C_F_POINTER
— Convert C into Fortran pointer -
8.41
C_F_PROCPOINTER
— Convert C into Fortran procedure pointer -
8.42
C_FUNLOC
— Obtain the C address of a procedure -
8.43
C_LOC
— Obtain the C address of an object -
8.44
C_SIZEOF
— Size in bytes of an expression -
8.45
CEILING
— Integer ceiling function -
8.46
CHAR
— Character conversion function -
8.47
CHDIR
— Change working directory -
8.48
CHMOD
— Change access permissions of files -
8.49
CMPLX
— Complex conversion function -
8.50
COMMAND_ARGUMENT_COUNT
— Get number of command line arguments -
8.51
COMPILER_OPTIONS
— Options passed to the compiler -
8.52
COMPILER_VERSION
— Compiler version string -
8.53
COMPLEX
— Complex conversion function -
8.54
CONJG
— Complex conjugate function -
8.55
COS
— Cosine function -
8.56
COSH
— Hyperbolic cosine function -
8.57
COUNT
— Count function -
8.58
CPU_TIME
— CPU elapsed time in seconds -
8.59
CSHIFT
— Circular shift elements of an array -
8.60
CTIME
— Convert a time into a string -
8.61
DATE_AND_TIME
— Date and time subroutine -
8.62
DBLE
— Double conversion function -
8.63
DCMPLX
— Double complex conversion function -
8.64
DIGITS
— Significant binary digits function -
8.65
DIM
— Positive difference -
8.66
DOT_PRODUCT
— Dot product function -
8.67
DPROD
— Double product function -
8.68
DREAL
— Double real part function -
8.69
DSHIFTL
— Combined left shift -
8.70
DSHIFTR
— Combined right shift -
8.71
DTIME
— Execution time subroutine (or function) -
8.72
EOSHIFT
— End-off shift elements of an array -
8.73
EPSILON
— Epsilon function -
8.74
ERF
— Error function -
8.75
ERFC
— Error function -
8.76
ERFC_SCALED
— Error function -
8.77
ETIME
— Execution time subroutine (or function) -
8.78
EXECUTE_COMMAND_LINE
— Execute a shell command -
8.79
EXIT
— Exit the program with status. -
8.80
EXP
— Exponential function -
8.81
EXPONENT
— Exponent function -
8.82
EXTENDS_TYPE_OF
— Query dynamic type for extension -
8.83
FDATE
— Get the current time as a string -
8.84
FGET
— Read a single character in stream mode from stdin -
8.85
FGETC
— Read a single character in stream mode -
8.86
FLOOR
— Integer floor function -
8.87
FLUSH
— Flush I/O unit(s) -
8.88
FNUM
— File number function -
8.89
FPUT
— Write a single character in stream mode to stdout -
8.90
FPUTC
— Write a single character in stream mode -
8.91
FRACTION
— Fractional part of the model representation -
8.92
FREE
— Frees memory -
8.93
FSEEK
— Low level file positioning subroutine -
8.94
FSTAT
— Get file status -
8.95
FTELL
— Current stream position -
8.96
GAMMA
— Gamma function -
8.97
GERROR
— Get last system error message -
8.98
GETARG
— Get command line arguments -
8.99
GET_COMMAND
— Get the entire command line -
8.100
GET_COMMAND_ARGUMENT
— Get command line arguments -
8.101
GETCWD
— Get current working directory -
8.102
GETENV
— Get an environmental variable -
8.103
GET_ENVIRONMENT_VARIABLE
— Get an environmental variable -
8.104
GETGID
— Group ID function -
8.105
GETLOG
— Get login name -
8.106
GETPID
— Process ID function -
8.107
GETUID
— User ID function -
8.108
GMTIME
— Convert time to GMT info -
8.109
HOSTNM
— Get system host name -
8.110
HUGE
— Largest number of a kind -
8.111
HYPOT
— Euclidean distance function -
8.112
IACHAR
— Code in ASCII collating sequence -
8.113
IALL
— Bitwise AND of array elements -
8.114
IAND
— Bitwise logical and -
8.115
IANY
— Bitwise OR of array elements -
8.116
IARGC
— Get the number of command line arguments -
8.117
IBCLR
— Clear bit -
8.118
IBITS
— Bit extraction -
8.119
IBSET
— Set bit -
8.120
ICHAR
— Character-to-integer conversion function -
8.121
IDATE
— Get current local time subroutine (day/month/year) -
8.122
IEOR
— Bitwise logical exclusive or -
8.123
IERRNO
— Get the last system error number -
8.124
IMAGE_INDEX
— Function that converts a cosubscript to an image index -
8.125
INDEX
— Position of a substring within a string -
8.126
INT
— Convert to integer type -
8.127
INT2
— Convert to 16-bit integer type -
8.128
INT8
— Convert to 64-bit integer type -
8.129
IOR
— Bitwise logical or -
8.130
IPARITY
— Bitwise XOR of array elements -
8.131
IRAND
— Integer pseudo-random number -
8.132
IS_IOSTAT_END
— Test for end-of-file value -
8.133
IS_IOSTAT_EOR
— Test for end-of-record value -
8.134
ISATTY
— Whether a unit is a terminal device. -
8.135
ISHFT
— Shift bits -
8.136
ISHFTC
— Shift bits circularly -
8.137
ISNAN
— Test for a NaN -
8.138
ITIME
— Get current local time subroutine (hour/minutes/seconds) -
8.139
KILL
— Send a signal to a process -
8.140
KIND
— Kind of an entity -
8.141
LBOUND
— Lower dimension bounds of an array -
8.142
LCOBOUND
— Lower codimension bounds of an array -
8.143
LEADZ
— Number of leading zero bits of an integer -
8.144
LEN
— Length of a character entity -
8.145
LEN_TRIM
— Length of a character entity without trailing blank characters -
8.146
LGE
— Lexical greater than or equal -
8.147
LGT
— Lexical greater than -
8.148
LINK
— Create a hard link -
8.149
LLE
— Lexical less than or equal -
8.150
LLT
— Lexical less than -
8.151
LNBLNK
— Index of the last non-blank character in a string -
8.152
LOC
— Returns the address of a variable -
8.153
LOG
— Natural logarithm function -
8.154
LOG10
— Base 10 logarithm function -
8.155
LOG_GAMMA
— Logarithm of the Gamma function -
8.156
LOGICAL
— Convert to logical type -
8.157
LONG
— Convert to integer type -
8.158
LSHIFT
— Left shift bits -
8.159
LSTAT
— Get file status -
8.160
LTIME
— Convert time to local time info -
8.161
MALLOC
— Allocate dynamic memory -
8.162
MASKL
— Left justified mask -
8.163
MASKR
— Right justified mask -
8.164
MATMUL
— matrix multiplication -
8.165
MAX
— Maximum value of an argument list -
8.166
MAXEXPONENT
— Maximum exponent of a real kind -
8.167
MAXLOC
— Location of the maximum value within an array -
8.168
MAXVAL
— Maximum value of an array -
8.169
MCLOCK
— Time function -
8.170
MCLOCK8
— Time function (64-bit) -
8.171
MERGE
— Merge variables -
8.172
MERGE_BITS
— Merge of bits under mask -
8.173
MIN
— Minimum value of an argument list -
8.174
MINEXPONENT
— Minimum exponent of a real kind -
8.175
MINLOC
— Location of the minimum value within an array -
8.176
MINVAL
— Minimum value of an array -
8.177
MOD
— Remainder function -
8.178
MODULO
— Modulo function -
8.179
MOVE_ALLOC
— Move allocation from one object to another -
8.180
MVBITS
— Move bits from one integer to another -
8.181
NEAREST
— Nearest representable number -
8.182
NEW_LINE
— New line character -
8.183
NINT
— Nearest whole number -
8.184
NORM2
— Euclidean vector norms -
8.185
NOT
— Logical negation -
8.186
NULL
— Function that returns an disassociated pointer -
8.187
NUM_IMAGES
— Function that returns the number of images -
8.188
OR
— Bitwise logical OR -
8.189
PACK
— Pack an array into an array of rank one -
8.190
PARITY
— Reduction with exclusive OR -
8.191
PERROR
— Print system error message -
8.192
POPCNT
— Number of bits set -
8.193
POPPAR
— Parity of the number of bits set -
8.194
PRECISION
— Decimal precision of a real kind -
8.195
PRESENT
— Determine whether an optional dummy argument is specified -
8.196
PRODUCT
— Product of array elements -
8.197
RADIX
— Base of a model number -
8.198
RAN
— Real pseudo-random number -
8.199
RAND
— Real pseudo-random number -
8.200
RANDOM_NUMBER
— Pseudo-random number -
8.201
RANDOM_SEED
— Initialize a pseudo-random number sequence -
8.202
RANGE
— Decimal exponent range -
8.203
RANK
— Rank of a data object -
8.204
REAL
— Convert to real type -
8.205
RENAME
— Rename a file -
8.206
REPEAT
— Repeated string concatenation -
8.207
RESHAPE
— Function to reshape an array -
8.208
RRSPACING
— Reciprocal of the relative spacing -
8.209
RSHIFT
— Right shift bits -
8.210
SAME_TYPE_AS
— Query dynamic types for equality -
8.211
SCALE
— Scale a real value -
8.212
SCAN
— Scan a string for the presence of a set of characters -
8.213
SECNDS
— Time function -
8.214
SECOND
— CPU time function -
8.215
SELECTED_CHAR_KIND
— Choose character kind -
8.216
SELECTED_INT_KIND
— Choose integer kind -
8.217
SELECTED_REAL_KIND
— Choose real kind -
8.218
SET_EXPONENT
— Set the exponent of the model -
8.219
SHAPE
— Determine the shape of an array -
8.220
SHIFTA
— Right shift with fill -
8.221
SHIFTL
— Left shift -
8.222
SHIFTR
— Right shift -
8.223
SIGN
— Sign copying function -
8.224
SIGNAL
— Signal handling subroutine (or function) -
8.225
SIN
— Sine function -
8.226
SINH
— Hyperbolic sine function -
8.227
SIZE
— Determine the size of an array -
8.228
SIZEOF
— Size in bytes of an expression -
8.229
SLEEP
— Sleep for the specified number of seconds -
8.230
SPACING
— Smallest distance between two numbers of a given type -
8.231
SPREAD
— Add a dimension to an array -
8.232
SQRT
— Square-root function -
8.233
SRAND
— Reinitialize the random number generator -
8.234
STAT
— Get file status -
8.235
STORAGE_SIZE
— Storage size in bits -
8.236
SUM
— Sum of array elements -
8.237
SYMLNK
— Create a symbolic link -
8.238
SYSTEM
— Execute a shell command -
8.239
SYSTEM_CLOCK
— Time function -
8.240
TAN
— Tangent function -
8.241
TANH
— Hyperbolic tangent function -
8.242
THIS_IMAGE
— Function that returns the cosubscript index of this image -
8.243
TIME
— Time function -
8.244
TIME8
— Time function (64-bit) -
8.245
TINY
— Smallest positive number of a real kind -
8.246
TRAILZ
— Number of trailing zero bits of an integer -
8.247
TRANSFER
— Transfer bit patterns -
8.248
TRANSPOSE
— Transpose an array of rank two -
8.249
TRIM
— Remove trailing blank characters of a string -
8.250
TTYNAM
— Get the name of a terminal device. -
8.251
UBOUND
— Upper dimension bounds of an array -
8.252
UCOBOUND
— Upper codimension bounds of an array -
8.253
UMASK
— Set the file creation mask -
8.254
UNLINK
— Remove a file from the file system -
8.255
UNPACK
— Unpack an array of rank one into an array -
8.256
VERIFY
— Scan a string for characters not a given set -
8.257
XOR
— Bitwise logical exclusive OR
- 9 Intrinsic Modules
- Contributing
- GNU General Public License
- GNU Free Documentation License
- Funding Free Software
- Option Index
- Keyword Index
Introduction
This manual documents the use of gfortran
, the GNU Fortran compiler. You can find in this manual how to invoke gfortran
, as well as its features and incompatibilities.
Part I: Invoking GNU Fortran
Part II: Language Reference
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-4.9.3/gfortran/index.html