Catalog / Fortran Programming Cheatsheet
Fortran Programming Cheatsheet
A quick reference guide to Fortran programming, covering syntax, data types, control structures, and more. Useful for both beginners and experienced Fortran developers.
Fundamentals
Basic Syntax
Program Structure:
|
Comments:
|
Continuation:
|
Case Insensitivity: |
Data Types
|
Whole numbers (e.g., |
|
Floating-point numbers (e.g., |
|
Floating-point numbers with higher precision (e.g., |
|
Numbers with real and imaginary parts (e.g., |
|
Boolean values: |
|
Strings of characters (e.g., |
Variable Declaration
|
Implicit None: |
Operators & Control Flow
Operators
|
Addition |
|
Subtraction |
|
Multiplication |
|
Division |
|
Exponentiation |
|
Equal to |
|
Not equal to |
|
Greater than |
|
Greater than or equal to |
|
Less than |
|
Less than or equal to |
Control Flow
IF Statement:
|
DO Loop:
|
SELECT CASE Statement:
|
Arrays and I/O
Arrays
Declaration:
|
Array Slicing:
|
Array Operations: |
Input/Output
Reading from standard input:
|
Writing to standard output:
|
Formatted I/O:
|
File I/O:
|
Subroutines & Functions
Subroutines
Definition:
|
Calling a Subroutine:
|
Functions
Definition:
|
Calling a Function:
|
Modules
Definition:
|
Using a Module:
|