AnatomyOf

Anatomy of a Fortran file

example.f90
1! A minimal Fortran program -- still compiling since the Eisenhower administration
2program main_program
3 implicit none
4 integer :: i
5 integer, parameter :: limit = 3
6
7 do i = 1, limit
8 if (mod(i, 2) == 0) then
9 print *, "Even:", i
10 else
11 print *, "Odd:", i, "-- real programmers count from 1 anyway"
12 end if
13 end do
14end program main_program
Modern Fortran is a procedural, imperative, and object-oriented language heavily used in scientific and numerical computing.