The GNU Fortran Compiler
Short Table of Contents
- 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
- 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.1.20
STRUCTURE
andRECORD
- 6.1.21
UNION
andMAP
- 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
EVENT_QUERY
— Query whether a coarray event has occurred - 9.93
EXECUTE_COMMAND_LINE
— Execute a shell command - 9.94
EXIT
— Exit the program with status. - 9.95
EXP
— Exponential function - 9.96
EXPONENT
— Exponent function - 9.97
EXTENDS_TYPE_OF
— Query dynamic type for extension - 9.98
FDATE
— Get the current time as a string - 9.99
FGET
— Read a single character in stream mode from stdin - 9.100
FGETC
— Read a single character in stream mode - 9.101
FLOOR
— Integer floor function - 9.102
FLUSH
— Flush I/O unit(s) - 9.103
FNUM
— File number function - 9.104
FPUT
— Write a single character in stream mode to stdout - 9.105
FPUTC
— Write a single character in stream mode - 9.106
FRACTION
— Fractional part of the model representation - 9.107
FREE
— Frees memory - 9.108
FSEEK
— Low level file positioning subroutine - 9.109
FSTAT
— Get file status - 9.110
FTELL
— Current stream position - 9.111
GAMMA
— Gamma function - 9.112
GERROR
— Get last system error message - 9.113
GETARG
— Get command line arguments - 9.114
GET_COMMAND
— Get the entire command line - 9.115
GET_COMMAND_ARGUMENT
— Get command line arguments - 9.116
GETCWD
— Get current working directory - 9.117
GETENV
— Get an environmental variable - 9.118
GET_ENVIRONMENT_VARIABLE
— Get an environmental variable - 9.119
GETGID
— Group ID function - 9.120
GETLOG
— Get login name - 9.121
GETPID
— Process ID function - 9.122
GETUID
— User ID function - 9.123
GMTIME
— Convert time to GMT info - 9.124
HOSTNM
— Get system host name - 9.125
HUGE
— Largest number of a kind - 9.126
HYPOT
— Euclidean distance function - 9.127
IACHAR
— Code in ASCII collating sequence - 9.128
IALL
— Bitwise AND of array elements - 9.129
IAND
— Bitwise logical and - 9.130
IANY
— Bitwise OR of array elements - 9.131
IARGC
— Get the number of command line arguments - 9.132
IBCLR
— Clear bit - 9.133
IBITS
— Bit extraction - 9.134
IBSET
— Set bit - 9.135
ICHAR
— Character-to-integer conversion function - 9.136
IDATE
— Get current local time subroutine (day/month/year) - 9.137
IEOR
— Bitwise logical exclusive or - 9.138
IERRNO
— Get the last system error number - 9.139
IMAGE_INDEX
— Function that converts a cosubscript to an image index - 9.140
INDEX
— Position of a substring within a string - 9.141
INT
— Convert to integer type - 9.142
INT2
— Convert to 16-bit integer type - 9.143
INT8
— Convert to 64-bit integer type - 9.144
IOR
— Bitwise logical or - 9.145
IPARITY
— Bitwise XOR of array elements - 9.146
IRAND
— Integer pseudo-random number - 9.147
IS_IOSTAT_END
— Test for end-of-file value - 9.148
IS_IOSTAT_EOR
— Test for end-of-record value - 9.149
ISATTY
— Whether a unit is a terminal device. - 9.150
ISHFT
— Shift bits - 9.151
ISHFTC
— Shift bits circularly - 9.152
ISNAN
— Test for a NaN - 9.153
ITIME
— Get current local time subroutine (hour/minutes/seconds) - 9.154
KILL
— Send a signal to a process - 9.155
KIND
— Kind of an entity - 9.156
LBOUND
— Lower dimension bounds of an array - 9.157
LCOBOUND
— Lower codimension bounds of an array - 9.158
LEADZ
— Number of leading zero bits of an integer - 9.159
LEN
— Length of a character entity - 9.160
LEN_TRIM
— Length of a character entity without trailing blank characters - 9.161
LGE
— Lexical greater than or equal - 9.162
LGT
— Lexical greater than - 9.163
LINK
— Create a hard link - 9.164
LLE
— Lexical less than or equal - 9.165
LLT
— Lexical less than - 9.166
LNBLNK
— Index of the last non-blank character in a string - 9.167
LOC
— Returns the address of a variable - 9.168
LOG
— Natural logarithm function - 9.169
LOG10
— Base 10 logarithm function - 9.170
LOG_GAMMA
— Logarithm of the Gamma function - 9.171
LOGICAL
— Convert to logical type - 9.172
LONG
— Convert to integer type - 9.173
LSHIFT
— Left shift bits - 9.174
LSTAT
— Get file status - 9.175
LTIME
— Convert time to local time info - 9.176
MALLOC
— Allocate dynamic memory - 9.177
MASKL
— Left justified mask - 9.178
MASKR
— Right justified mask - 9.179
MATMUL
— matrix multiplication - 9.180
MAX
— Maximum value of an argument list - 9.181
MAXEXPONENT
— Maximum exponent of a real kind - 9.182
MAXLOC
— Location of the maximum value within an array - 9.183
MAXVAL
— Maximum value of an array - 9.184
MCLOCK
— Time function - 9.185
MCLOCK8
— Time function (64-bit) - 9.186
MERGE
— Merge variables - 9.187
MERGE_BITS
— Merge of bits under mask - 9.188
MIN
— Minimum value of an argument list - 9.189
MINEXPONENT
— Minimum exponent of a real kind - 9.190
MINLOC
— Location of the minimum value within an array - 9.191
MINVAL
— Minimum value of an array - 9.192
MOD
— Remainder function - 9.193
MODULO
— Modulo function - 9.194
MOVE_ALLOC
— Move allocation from one object to another - 9.195
MVBITS
— Move bits from one integer to another - 9.196
NEAREST
— Nearest representable number - 9.197
NEW_LINE
— New line character - 9.198
NINT
— Nearest whole number - 9.199
NORM2
— Euclidean vector norms - 9.200
NOT
— Logical negation - 9.201
NULL
— Function that returns an disassociated pointer - 9.202
NUM_IMAGES
— Function that returns the number of images - 9.203
OR
— Bitwise logical OR - 9.204
PACK
— Pack an array into an array of rank one - 9.205
PARITY
— Reduction with exclusive OR - 9.206
PERROR
— Print system error message - 9.207
POPCNT
— Number of bits set - 9.208
POPPAR
— Parity of the number of bits set - 9.209
PRECISION
— Decimal precision of a real kind - 9.210
PRESENT
— Determine whether an optional dummy argument is specified - 9.211
PRODUCT
— Product of array elements - 9.212
RADIX
— Base of a model number - 9.213
RAN
— Real pseudo-random number - 9.214
RAND
— Real pseudo-random number - 9.215
RANDOM_NUMBER
— Pseudo-random number - 9.216
RANDOM_SEED
— Initialize a pseudo-random number sequence - 9.217
RANGE
— Decimal exponent range - 9.218
RANK
— Rank of a data object - 9.219
REAL
— Convert to real type - 9.220
RENAME
— Rename a file - 9.221
REPEAT
— Repeated string concatenation - 9.222
RESHAPE
— Function to reshape an array - 9.223
RRSPACING
— Reciprocal of the relative spacing - 9.224
RSHIFT
— Right shift bits - 9.225
SAME_TYPE_AS
— Query dynamic types for equality - 9.226
SCALE
— Scale a real value - 9.227
SCAN
— Scan a string for the presence of a set of characters - 9.228
SECNDS
— Time function - 9.229
SECOND
— CPU time function - 9.230
SELECTED_CHAR_KIND
— Choose character kind - 9.231
SELECTED_INT_KIND
— Choose integer kind - 9.232
SELECTED_REAL_KIND
— Choose real kind - 9.233
SET_EXPONENT
— Set the exponent of the model - 9.234
SHAPE
— Determine the shape of an array - 9.235
SHIFTA
— Right shift with fill - 9.236
SHIFTL
— Left shift - 9.237
SHIFTR
— Right shift - 9.238
SIGN
— Sign copying function - 9.239
SIGNAL
— Signal handling subroutine (or function) - 9.240
SIN
— Sine function - 9.241
SINH
— Hyperbolic sine function - 9.242
SIZE
— Determine the size of an array - 9.243
SIZEOF
— Size in bytes of an expression - 9.244
SLEEP
— Sleep for the specified number of seconds - 9.245
SPACING
— Smallest distance between two numbers of a given type - 9.246
SPREAD
— Add a dimension to an array - 9.247
SQRT
— Square-root function - 9.248
SRAND
— Reinitialize the random number generator - 9.249
STAT
— Get file status - 9.250
STORAGE_SIZE
— Storage size in bits - 9.251
SUM
— Sum of array elements - 9.252
SYMLNK
— Create a symbolic link - 9.253
SYSTEM
— Execute a shell command - 9.254
SYSTEM_CLOCK
— Time function - 9.255
TAN
— Tangent function - 9.256
TANH
— Hyperbolic tangent function - 9.257
THIS_IMAGE
— Function that returns the cosubscript index of this image - 9.258
TIME
— Time function - 9.259
TIME8
— Time function (64-bit) - 9.260
TINY
— Smallest positive number of a real kind - 9.261
TRAILZ
— Number of trailing zero bits of an integer - 9.262
TRANSFER
— Transfer bit patterns - 9.263
TRANSPOSE
— Transpose an array of rank two - 9.264
TRIM
— Remove trailing blank characters of a string - 9.265
TTYNAM
— Get the name of a terminal device. - 9.266
UBOUND
— Upper dimension bounds of an array - 9.267
UCOBOUND
— Upper codimension bounds of an array - 9.268
UMASK
— Set the file creation mask - 9.269
UNLINK
— Remove a file from the file system - 9.270
UNPACK
— Unpack an array of rank one into an array - 9.271
VERIFY
— Scan a string for characters not a given set - 9.272
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.
• Introduction: | ||
Part I: Invoking GNU Fortran | ||
---|---|---|
• Invoking GNU Fortran: | Command options supported by gfortran . |
|
• Runtime: | Influencing runtime behavior with environment variables. | |
Part II: Language Reference | ||
• Fortran 2003 and 2008 status: | Fortran 2003 and 2008 features supported by GNU Fortran. | |
• Compiler Characteristics: | User-visible implementation details. | |
• Extensions: | Language extensions implemented by GNU Fortran. | |
• Mixed-Language Programming: | Interoperability with C | |
• Coarray Programming: | ||
• Intrinsic Procedures: | Intrinsic procedures supported by GNU Fortran. | |
• Intrinsic Modules: | Intrinsic modules supported by GNU Fortran. | |
• Contributing: | How you can help. | |
• Copying: | GNU General Public License says how you can copy and share GNU Fortran. | |
• GNU Free Documentation License: | How you can copy and share this manual. | |
• Funding: | How to help assure continued work for free software. | |
• Option Index: | Index of command line options | |
• Keyword Index: | Index of concepts |
Next: Introduction, Up: (dir) [Contents][Index]
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-6.4.0/gfortran/index.html