This is work in progress for an information session on modern Fortran (95, 2003, 2008). Prior knowledge of Fortran 77/90 is assumed.
This section of the repository has been superceeded by two other repositories:
- Fortran for programmers
- Fortran MOOC
ControlStructures
: illustrations of how to use Fortran's control statements (DO
,DO WHILE
,FORALL
,WHERE
,IF
,SELECT CASE
andBLOCK
.Doxygen
: illustration of documenting Fortran code using doxygen.Functions
: illustrates how to define procedures, internal versus module procedures, pure and elemental procedures, recursion, interfaces for using higher order functions. Also contains some code to time arithmetic operations and Fortran intrinsic math fucntions.Integrate
: illustration of extension of abstract type, and implementation of abstract interface.IO
: illustrates Fortran's I/O mechanisms, sequential read/write of formatted and unformatted records, stream read/write of unformatted records.Julia
: illustration of using complex arithmethic and elementary functions.Matrices
: illustrates array operations and intrinsic functions operating on arrays, indexing by slices, as well as allocatable arrays.Miscellaneous
: Dealing with command line arguments, environment variables.modern_fortran.pptx
: Microsoft Powerpoint presentation of modern Fortran features intended for those not familiar with some of the features introduced in Fortran 95, 2003, and 2008, or for those who typically program in C/C++, but want to get a flavor of Fortran's capabilities and particularities.OOProgramming
: an illustration of how to define a tree data structure using classes and inheritance. A second example shows a naive implementation of rational numbers to illustrate operator overloading.Preprocessing
: illustration of how to use the C preprocessor in Fortran.Refactoring
: shows how to fix legacy code with a suboptimal array access pattern by encapsulating the array.Types
: illustrates the various basic data types such asREAL
,COMPLEX
,INT
, and their limits and precision, as well as how to detect numerical overflow and undefined arithmetic operations. Type conversion and user defined types are illustrated as well.