- GNU Fortran compiler documentation: https://gcc.gnu.org/onlinedocs/gfortran
- Wikipedia article on advection: https://en.wikipedia.org/wiki/Advection
- Wikipedia article on finite differences: https://en.wikipedia.org/wiki/Finite_ difference
Summary
- Building an executable Fortran program consists of the compilation and linking steps.
- There are five program units in Fortran: main program, function, subroutine, module, and submodule.
- A program begins with a
programstatement and ends with anendprogramstatement. - In every program, we first declare the data, and executable code comes after.
- Use
implicitnoneat the top of your declarative code to enforce explicit declaration of all variables. - There are five built-in data types in Fortran:
integer,real,complex,character, andlogical. ifblocks are used to test for conditions and take different execution branches depending on their values.- Use the
stopstatement to abort the program immediately and print a helpful message to the terminal. doloops are used to iterate over sections of the code a specified number of times.- Start, end, and increment values of a
doloop counter can have any integer value. - Fortran’s arithmetic rules are the same as those we learn in school: exponentiation is evaluated first, then multiplication and division are evaluated, and finally addition and subtraction go last; this order can be overruled with parentheses.
print*is an easy way to print the values of any variable or literal constant to the terminal.
Further reading