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 Coarray Programming
- 9 Intrinsic Procedures
- 10 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 OpenACC
-
6.1.18 Argument list functions
%VAL
,%REF
and%LOC
- 6.1.19 Read/Write after EOF marker
- 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 Coarray Programming
- 8.1 Type and enum ABI Documentation
-
8.2 Function ABI Documentation
-
8.2.1
_gfortran_caf_init
— Initialiation function -
8.2.2
_gfortran_caf_finish
— Finalization function -
8.2.3
_gfortran_caf_this_image
— Querying the image number -
8.2.4
_gfortran_caf_num_images
— Querying the maximal number of images -
8.2.5
_gfortran_caf_register
— Registering coarrays -
8.2.6
_gfortran_caf_deregister
— Deregistering coarrays -
8.2.7
_gfortran_caf_send
— Sending data from a local image to a remote image -
8.2.8
_gfortran_caf_get
— Getting data from a remote image -
8.2.9
_gfortran_caf_sendget
— Sending data between remote images -
8.2.10
_gfortran_caf_lock
— Locking a lock variable -
8.2.11
_gfortran_caf_lock
— Unlocking a lock variable -
8.2.12
_gfortran_caf_event_post
— Post an event -
8.2.13
_gfortran_caf_event_wait
— Wait that an event occurred -
8.2.14
_gfortran_caf_event_query
— Query event count -
8.2.15
_gfortran_caf_sync_all
— All-image barrier -
8.2.16
_gfortran_caf_sync_images
— Barrier for selected images -
8.2.17
_gfortran_caf_sync_memory
— Wait for completion of segment-memory operations -
8.2.18
_gfortran_caf_error_stop
— Error termination with exit code -
8.2.19
_gfortran_caf_error_stop_str
— Error termination with string -
8.2.20
_gfortran_caf_atomic_define
— Atomic variable assignment -
8.2.21
_gfortran_caf_atomic_ref
— Atomic variable reference -
8.2.22
_gfortran_caf_atomic_cas
— Atomic compare and swap -
8.2.23
_gfortran_caf_atomic_op
— Atomic operation -
8.2.24
_gfortran_caf_co_broadcast
— Sending data to all images -
8.2.25
_gfortran_caf_co_max
— Collective maximum reduction -
8.2.26
_gfortran_caf_co_min
— Collective minimum reduction -
8.2.27
_gfortran_caf_co_sum
— Collective summing reduction -
8.2.28
_gfortran_caf_co_reduce
— Generic collective reduction
-
8.2.1
-
9 Intrinsic Procedures
- 9.1 Introduction to intrinsic procedures
-
9.2
ABORT
— Abort the program -
9.3
ABS
— Absolute value -
9.4
ACCESS
— Checks file access modes -
9.5
ACHAR
— Character in ASCII collating sequence -
9.6
ACOS
— Arccosine function -
9.7
ACOSH
— Inverse hyperbolic cosine function -
9.8
ADJUSTL
— Left adjust a string -
9.9
ADJUSTR
— Right adjust a string -
9.10
AIMAG
— Imaginary part of complex number -
9.11
AINT
— Truncate to a whole number -
9.12
ALARM
— Execute a routine after a given delay -
9.13
ALL
— All values in MASK along DIM are true -
9.14
ALLOCATED
— Status of an allocatable entity -
9.15
AND
— Bitwise logical AND -
9.16
ANINT
— Nearest whole number -
9.17
ANY
— Any value in MASK along DIM is true -
9.18
ASIN
— Arcsine function -
9.19
ASINH
— Inverse hyperbolic sine function -
9.20
ASSOCIATED
— Status of a pointer or pointer/target pair -
9.21
ATAN
— Arctangent function -
9.22
ATAN2
— Arctangent function -
9.23
ATANH
— Inverse hyperbolic tangent function -
9.24
ATOMIC_ADD
— Atomic ADD operation -
9.25
ATOMIC_AND
— Atomic bitwise AND operation -
9.26
ATOMIC_CAS
— Atomic compare and swap -
9.27
ATOMIC_DEFINE
— Setting a variable atomically -
9.28
ATOMIC_FETCH_ADD
— Atomic ADD operation with prior fetch -
9.29
ATOMIC_FETCH_AND
— Atomic bitwise AND operation with prior fetch -
9.30
ATOMIC_FETCH_OR
— Atomic bitwise OR operation with prior fetch -
9.31
ATOMIC_FETCH_XOR
— Atomic bitwise XOR operation with prior fetch -
9.32
ATOMIC_OR
— Atomic bitwise OR operation -
9.33
ATOMIC_REF
— Obtaining the value of a variable atomically -
9.34
ATOMIC_XOR
— Atomic bitwise OR operation -
9.35
BACKTRACE
— Show a backtrace -
9.36
BESSEL_J0
— Bessel function of the first kind of order 0 -
9.37
BESSEL_J1
— Bessel function of the first kind of order 1 -
9.38
BESSEL_JN
— Bessel function of the first kind -
9.39
BESSEL_Y0
— Bessel function of the second kind of order 0 -
9.40
BESSEL_Y1
— Bessel function of the second kind of order 1 -
9.41
BESSEL_YN
— Bessel function of the second kind -
9.42
BGE
— Bitwise greater than or equal to -
9.43
BGT
— Bitwise greater than -
9.44
BIT_SIZE
— Bit size inquiry function -
9.45
BLE
— Bitwise less than or equal to -
9.46
BLT
— Bitwise less than -
9.47
BTEST
— Bit test function -
9.48
C_ASSOCIATED
— Status of a C pointer -
9.49
C_F_POINTER
— Convert C into Fortran pointer -
9.50
C_F_PROCPOINTER
— Convert C into Fortran procedure pointer -
9.51
C_FUNLOC
— Obtain the C address of a procedure -
9.52
C_LOC
— Obtain the C address of an object -
9.53
C_SIZEOF
— Size in bytes of an expression -
9.54
CEILING
— Integer ceiling function -
9.55
CHAR
— Character conversion function -
9.56
CHDIR
— Change working directory -
9.57
CHMOD
— Change access permissions of files -
9.58
CMPLX
— Complex conversion function -
9.59
CO_BROADCAST
— Copy a value to all images the current set of images -
9.60
CO_MAX
— Maximal value on the current set of images -
9.61
CO_MIN
— Minimal value on the current set of images -
9.62
CO_REDUCE
— Reduction of values on the current set of images -
9.63
CO_SUM
— Sum of values on the current set of images -
9.64
COMMAND_ARGUMENT_COUNT
— Get number of command line arguments -
9.65
COMPILER_OPTIONS
— Options passed to the compiler -
9.66
COMPILER_VERSION
— Compiler version string -
9.67
COMPLEX
— Complex conversion function -
9.68
CONJG
— Complex conjugate function -
9.69
COS
— Cosine function -
9.70
COSH
— Hyperbolic cosine function -
9.71
COUNT
— Count function -
9.72
CPU_TIME
— CPU elapsed time in seconds -
9.73
CSHIFT
— Circular shift elements of an array -
9.74
CTIME
— Convert a time into a string -
9.75
DATE_AND_TIME
— Date and time subroutine -
9.76
DBLE
— Double conversion function -
9.77
DCMPLX
— Double complex conversion function -
9.78
DIGITS
— Significant binary digits function -
9.79
DIM
— Positive difference -
9.80
DOT_PRODUCT
— Dot product function -
9.81
DPROD
— Double product function -
9.82
DREAL
— Double real part function -
9.83
DSHIFTL
— Combined left shift -
9.84
DSHIFTR
— Combined right shift -
9.85
DTIME
— Execution time subroutine (or function) -
9.86
EOSHIFT
— End-off shift elements of an array -
9.87
EPSILON
— Epsilon function -
9.88
ERF
— Error function -
9.89
ERFC
— Error function -
9.90
ERFC_SCALED
— Error function -
9.91
ETIME
— Execution time subroutine (or function) -
9.92
EXECUTE_COMMAND_LINE
— Execute a shell command -
9.93
EXIT
— Exit the program with status. -
9.94
EXP
— Exponential function -
9.95
EXPONENT
— Exponent function -
9.96
EXTENDS_TYPE_OF
— Query dynamic type for extension -
9.97
FDATE
— Get the current time as a string -
9.98
FGET
— Read a single character in stream mode from stdin -
9.99
FGETC
— Read a single character in stream mode -
9.100
FLOOR
— Integer floor function -
9.101
FLUSH
— Flush I/O unit(s) -
9.102
FNUM
— File number function -
9.103
FPUT
— Write a single character in stream mode to stdout -
9.104
FPUTC
— Write a single character in stream mode -
9.105
FRACTION
— Fractional part of the model representation -
9.106
FREE
— Frees memory -
9.107
FSEEK
— Low level file positioning subroutine -
9.108
FSTAT
— Get file status -
9.109
FTELL
— Current stream position -
9.110
GAMMA
— Gamma function -
9.111
GERROR
— Get last system error message -
9.112
GETARG
— Get command line arguments -
9.113
GET_COMMAND
— Get the entire command line -
9.114
GET_COMMAND_ARGUMENT
— Get command line arguments -
9.115
GETCWD
— Get current working directory -
9.116
GETENV
— Get an environmental variable -
9.117
GET_ENVIRONMENT_VARIABLE
— Get an environmental variable -
9.118
GETGID
— Group ID function -
9.119
GETLOG
— Get login name -
9.120
GETPID
— Process ID function -
9.121
GETUID
— User ID function -
9.122
GMTIME
— Convert time to GMT info -
9.123
HOSTNM
— Get system host name -
9.124
HUGE
— Largest number of a kind -
9.125
HYPOT
— Euclidean distance function -
9.126
IACHAR
— Code in ASCII collating sequence -
9.127
IALL
— Bitwise AND of array elements -
9.128
IAND
— Bitwise logical and -
9.129
IANY
— Bitwise OR of array elements -
9.130
IARGC
— Get the number of command line arguments -
9.131
IBCLR
— Clear bit -
9.132
IBITS
— Bit extraction -
9.133
IBSET
— Set bit -
9.134
ICHAR
— Character-to-integer conversion function -
9.135
IDATE
— Get current local time subroutine (day/month/year) -
9.136
IEOR
— Bitwise logical exclusive or -
9.137
IERRNO
— Get the last system error number -
9.138
IMAGE_INDEX
— Function that converts a cosubscript to an image index -
9.139
INDEX
— Position of a substring within a string -
9.140
INT
— Convert to integer type -
9.141
INT2
— Convert to 16-bit integer type -
9.142
INT8
— Convert to 64-bit integer type -
9.143
IOR
— Bitwise logical or -
9.144
IPARITY
— Bitwise XOR of array elements -
9.145
IRAND
— Integer pseudo-random number -
9.146
IS_IOSTAT_END
— Test for end-of-file value -
9.147
IS_IOSTAT_EOR
— Test for end-of-record value -
9.148
ISATTY
— Whether a unit is a terminal device. -
9.149
ISHFT
— Shift bits -
9.150
ISHFTC
— Shift bits circularly -
9.151
ISNAN
— Test for a NaN -
9.152
ITIME
— Get current local time subroutine (hour/minutes/seconds) -
9.153
KILL
— Send a signal to a process -
9.154
KIND
— Kind of an entity -
9.155
LBOUND
— Lower dimension bounds of an array -
9.156
LCOBOUND
— Lower codimension bounds of an array -
9.157
LEADZ
— Number of leading zero bits of an integer -
9.158
LEN
— Length of a character entity -
9.159
LEN_TRIM
— Length of a character entity without trailing blank characters -
9.160
LGE
— Lexical greater than or equal -
9.161
LGT
— Lexical greater than -
9.162
LINK
— Create a hard link -
9.163
LLE
— Lexical less than or equal -
9.164
LLT
— Lexical less than -
9.165
LNBLNK
— Index of the last non-blank character in a string -
9.166
LOC
— Returns the address of a variable -
9.167
LOG
— Natural logarithm function -
9.168
LOG10
— Base 10 logarithm function -
9.169
LOG_GAMMA
— Logarithm of the Gamma function -
9.170
LOGICAL
— Convert to logical type -
9.171
LONG
— Convert to integer type -
9.172
LSHIFT
— Left shift bits -
9.173
LSTAT
— Get file status -
9.174
LTIME
— Convert time to local time info -
9.175
MALLOC
— Allocate dynamic memory -
9.176
MASKL
— Left justified mask -
9.177
MASKR
— Right justified mask -
9.178
MATMUL
— matrix multiplication -
9.179
MAX
— Maximum value of an argument list -
9.180
MAXEXPONENT
— Maximum exponent of a real kind -
9.181
MAXLOC
— Location of the maximum value within an array -
9.182
MAXVAL
— Maximum value of an array -
9.183
MCLOCK
— Time function -
9.184
MCLOCK8
— Time function (64-bit) -
9.185
MERGE
— Merge variables -
9.186
MERGE_BITS
— Merge of bits under mask -
9.187
MIN
— Minimum value of an argument list -
9.188
MINEXPONENT
— Minimum exponent of a real kind -
9.189
MINLOC
— Location of the minimum value within an array -
9.190
MINVAL
— Minimum value of an array -
9.191
MOD
— Remainder function -
9.192
MODULO
— Modulo function -
9.193
MOVE_ALLOC
— Move allocation from one object to another -
9.194
MVBITS
— Move bits from one integer to another -
9.195
NEAREST
— Nearest representable number -
9.196
NEW_LINE
— New line character -
9.197
NINT
— Nearest whole number -
9.198
NORM2
— Euclidean vector norms -
9.199
NOT
— Logical negation -
9.200
NULL
— Function that returns an disassociated pointer -
9.201
NUM_IMAGES
— Function that returns the number of images -
9.202
OR
— Bitwise logical OR -
9.203
PACK
— Pack an array into an array of rank one -
9.204
PARITY
— Reduction with exclusive OR -
9.205
PERROR
— Print system error message -
9.206
POPCNT
— Number of bits set -
9.207
POPPAR
— Parity of the number of bits set -
9.208
PRECISION
— Decimal precision of a real kind -
9.209
PRESENT
— Determine whether an optional dummy argument is specified -
9.210
PRODUCT
— Product of array elements -
9.211
RADIX
— Base of a model number -
9.212
RAN
— Real pseudo-random number -
9.213
RAND
— Real pseudo-random number -
9.214
RANDOM_NUMBER
— Pseudo-random number -
9.215
RANDOM_SEED
— Initialize a pseudo-random number sequence -
9.216
RANGE
— Decimal exponent range -
9.217
RANK
— Rank of a data object -
9.218
REAL
— Convert to real type -
9.219
RENAME
— Rename a file -
9.220
REPEAT
— Repeated string concatenation -
9.221
RESHAPE
— Function to reshape an array -
9.222
RRSPACING
— Reciprocal of the relative spacing -
9.223
RSHIFT
— Right shift bits -
9.224
SAME_TYPE_AS
— Query dynamic types for equality -
9.225
SCALE
— Scale a real value -
9.226
SCAN
— Scan a string for the presence of a set of characters -
9.227
SECNDS
— Time function -
9.228
SECOND
— CPU time function -
9.229
SELECTED_CHAR_KIND
— Choose character kind -
9.230
SELECTED_INT_KIND
— Choose integer kind -
9.231
SELECTED_REAL_KIND
— Choose real kind -
9.232
SET_EXPONENT
— Set the exponent of the model -
9.233
SHAPE
— Determine the shape of an array -
9.234
SHIFTA
— Right shift with fill -
9.235
SHIFTL
— Left shift -
9.236
SHIFTR
— Right shift -
9.237
SIGN
— Sign copying function -
9.238
SIGNAL
— Signal handling subroutine (or function) -
9.239
SIN
— Sine function -
9.240
SINH
— Hyperbolic sine function -
9.241
SIZE
— Determine the size of an array -
9.242
SIZEOF
— Size in bytes of an expression -
9.243
SLEEP
— Sleep for the specified number of seconds -
9.244
SPACING
— Smallest distance between two numbers of a given type -
9.245
SPREAD
— Add a dimension to an array -
9.246
SQRT
— Square-root function -
9.247
SRAND
— Reinitialize the random number generator -
9.248
STAT
— Get file status -
9.249
STORAGE_SIZE
— Storage size in bits -
9.250
SUM
— Sum of array elements -
9.251
SYMLNK
— Create a symbolic link -
9.252
SYSTEM
— Execute a shell command -
9.253
SYSTEM_CLOCK
— Time function -
9.254
TAN
— Tangent function -
9.255
TANH
— Hyperbolic tangent function -
9.256
THIS_IMAGE
— Function that returns the cosubscript index of this image -
9.257
TIME
— Time function -
9.258
TIME8
— Time function (64-bit) -
9.259
TINY
— Smallest positive number of a real kind -
9.260
TRAILZ
— Number of trailing zero bits of an integer -
9.261
TRANSFER
— Transfer bit patterns -
9.262
TRANSPOSE
— Transpose an array of rank two -
9.263
TRIM
— Remove trailing blank characters of a string -
9.264
TTYNAM
— Get the name of a terminal device. -
9.265
UBOUND
— Upper dimension bounds of an array -
9.266
UCOBOUND
— Upper codimension bounds of an array -
9.267
UMASK
— Set the file creation mask -
9.268
UNLINK
— Remove a file from the file system -
9.269
UNPACK
— Unpack an array of rank one into an array -
9.270
VERIFY
— Scan a string for characters not a given set -
9.271
XOR
— Bitwise logical exclusive OR
- 10 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-5.4.0/gfortran/index.html