Programming with Fortran

Programming with Fortran/ Fortran Programming Language (Overview)

If you want to learn some basics about Programming with Fortran then you are at the right place. We provide you with a good learning platform for basics about Fortran. It would help you for learning about FORTRAN.

Programming with Fortran:

  • Fortran as a programming language developed by a team led by John Backus at IBM in the early’s 1950s.
  • Fortran is derived from two words FORmula TRANslation.
  • It is a general-purpose programming language used for numeral and scientific computation.
  • Fortran is an imperative programming language used for scientific and engineering purpose applications.
  • Fortran is becoming more popular for high-performance supercomputing.

Easy to Learn:

Fortran is a small language that’s why it is easy to learn. It is used for mathematical and arithmetic operations over a large number of arrays. Fortran is statically strong because it allows the compiler to catch any programming error early for you. Fortran compiler also generates efficient binary code.

Fortran is used for?

Fortran is used for ocean predictions, numerical weather, computational fluid dynamics, applied mathematics, stats, accounting finance, etc. Fortran is used for the design of bridges, airplane structures, factory machine automation, analysis of scientific data, and many more.

Fortran allows users to write code in a style that best fits their problem.

  • Procedural
  • Arrays oriented
  • Object-oriented
  • Functional

In 1966 Fortran was updated and Fortran IV was born. Original versions of Fortran I, II, and III are no longer in use now. Fortran IV and 66 are still in use. The most common versions used today are Fortran 77, Fortran 90, Fortran 90, and Fortran 95. Fortran 77 added strings as a distinct type. Fortran 90 added different types of threading and array processing.

Fortran supports:

  1. Array programming
  2. Generic programming
  3. High-performance computations on supercomputers
  4. OOP concept
  5. Numerical and scientific analysis
  6. Structural programming

Basic Output Program:

program addition

! This simple program adds two numbers
   implicit none
! Declarations
   real :: a, b, result
! Operational statements 
   a = 12.0
   b = 15.0
   result = a + b
   print *, 'The total is ', result
end program addition

After the compilation of the code.

Programming in FORTRAN


Every time the Fortran program started with the program reserved word and ends with the end program. This implicit none statement allows the compiler to check that all your variables are properly declared. (!) the exclamation mark is used for comments in Fortran after this symbol all characters are ignored by the compiler. The print *   command is used to show anything on the screen. Fortran is case insensitive and allows upper and lowercase letters.

An identifier in Fortran must follow the following rules:

  1. The first letter of a name must be a letter.
  2. Names are case-sensitive in Fortran for identifiers.
  3. It cannot be longer than 31 characters.
  4. It must contain alphanumeric characters (letters, and digits) and underscores.

Fortran includes the following data types:

  • Integer type (Includes only integers).
  • Complex type (Includes real and imaginary numbers).
  • Logical type (Only two logical values True, False).
  • Character type (Includes characters and strings).
  • Real type (Includes floating point numbers).

Basic Input Program:

program input
implicit none

   character (len = 15) :: name
   print *,' Enter your Name.' 
   print *,' Up to 20 characters, please'
   read *,name 
   print "(1x,a)",name
end program input

After the compilation of a code.

Programming in FORTRAN


Here read * is used to get input from the user.

If you ask Should I use Fortran?

If you’re writing a program or a library to perform fast arithmetic computation over large numeric arrays, Fortran is the optimal tool for that job.

There is some basic info about FORTRAN. We also provide Java programming platforms and C language  Join us for more programming-related learnings. Thank You!



Leave a Reply

Your email address will not be published. Required fields are marked *