Fortran Programming Language



Fortran is a computer programming language that is extensively used in numerical, scientific computing. While out with the scientific community, Fortran has declined in popularity over the years, it still has a strong user base with scientific programmers, and is also used in organisations such as weather forecasters, financial trading, and in engineering simulations. Fortran programs can be highly optimised to run on high performance computers, and in general the language is suited to producing code where performance is important.


Fortran is a compiled language, or more specifically it is compiled ahead-of-time. In other words, you must perform a special step called compilation of your written code before you are able to run it on a computer. This is where Fortran differs to interpreted languages such as Python and R which run through an interpreter which executes the instructions directly, but at the cost of compute speed.


Fortran is imperative programming language compiled for general purpose that are particularly suitable for numerical and scientific computing.


History:

One of the oldest programming languages, the FORTRAN was developed by a team of programmers at IBM led by John Backus, and was first published in 1957. The name FORTRAN is an acronym for Formula Translation, because it was designed to allow easy translation of math formulas into code.


The objective during it's design was to create a programming language that would be: simple to learn, suitable for a wide variety of applications, machine independent, and would allow complex mathematical expressions to be stated similarly to regular algebraic notation. While still being almost as efficient in execution as assembly language. Since FORTRAN was so much easier to code, programmers were able to write programs 500% faster than before, while execution efficiency was only reduced by 20%, this allowed them to focus more on the problem solving aspects of a problem, and less on coding.


FORTRAN was so innovative not only because it was the first high-level language, but also because of it's compiler, which is credited as giving rise to the branch of computer science now known as compiler theory. Several years after it's release FORTRAN had developed many different dialects, (due to special tweaking by programmers trying to make it better suit their personal needs) making it very difficult to transfer programs from one machine to another.


Syntax:

Each program contains one main program and may or may not contain other program units. The syntax of the main program is as follows −

program program_name
implicit none      

! type declaration statements      
! executable statements  

end program program_name

Example:

Let’s write a program that adds two numbers and prints the result −

program addNumbers

! This simple program adds two numbers
   implicit none

! Type declarations
   real :: a, b, result

! Executable statements
   a = 12.0
   b = 15.0
   result = a + b
   print *, 'The total is ', result

end program addNumbers