Fortran 90/95 Compact Summary Compile file xxx.f90 using g95 -o xxx xxx.f90 Table of Contents Page 1.0 Introduction to Fortran 90 Language 1 2.0 Meta language used in this compact summary 1 3.0 Structure of files that can be compiled 1 4.0 Executable Statements and Constructs 2 5.0 Declarations 5 6.0 Key words (other than I/O) 6 7.0 Key words related to I/O 7 8.0 Operators 8 9.0 Constants 9 10.0 Input/Output Statements 10 11.0 Formats 12 12.0 Intrinsic Functions 14 1.0 Introduction to Fortran 90 Language ISO/IEC 1539:1995 Brought to you by ANSI committee X3J3 and ISO-IEC/JTC1/SC22/WG5 (Fortran) This is neither complete nor precisely accurate, but hopefully, after a small investment of time it is easy to read and very useful. This is the free form version of Fortran, no statement numbers, no C in column 1, start in column 1 (not column 7), typically indent 2, 3, or 4 spaces per each structure. The typical extension is .f90 . Continue a statement on the next line by ending the previous line with an ampersand & . Start the continuation with & for strings. The rest of any line is a comment starting with an exclamation mark ! . Put more than one statement per line by separating statements with a semicolon ; . Null statements are OK, so lines can end with semicolons. Separate words with space or any form of "white space" or punctuation. 2.0 Meta language used in this compact summary means fill in something appropriate for xxx and do not type the "<" or ">" . ... ellipsis means the usual, fill in something, one or more lines [stuff] means supply nothing or at most one copy of "stuff" [stuff1 [stuff2]] means if "stuff1" is included, supply nothing or at most one copy of stuff2. "old" means it is in the language, like almost every feature of past Fortran standards, but should not be used to write new programs. 3.0 Structure of files that can be compiled: program usually file name is .f90 use bring in any needed modules implicit none good for error detection order is important, no more declarations end program block data old common, dimension, equivalence now obsolete end block data module bring back in with use implicit none good for error detection can have private and public and interface end module subroutine use: call to execute implicit none good for error detection end subroutine subroutine (par1, par2, ...) use: call (arg1, arg2,... ) to execute implicit none optional, good for error detection par1, par2, ... are defined in declarations and can be specified in, inout, pointer, etc. return optional, end causes automatic return entry (par...) old, optional other entries end subroutine function (par1, par2, ...) result() use: (arg1, arg2, ... argn) as variable implicit none optional, good for error detection rslt, par1, ... are defined in declarations = required somewhere in execution [return] optional, end causes automatic return end function old function(...) use: (arg1, arg2, ... argn) as variable = required somewhere in execution [return] optional, end causes automatic return end function 4.0 Executable Statements and Constructs: will mean exactly one statement in this section a construct is multiple lines