SlideShare a Scribd company logo
4
Most read
7
Most read
11
Most read
The FORTRAN Programming
        Language




                      Zaahir Salam
How to get FORTRAN 95 Compiler
• Write FTN silverfrost in google and download it for free
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.
• Often referred to as a scientific language, FORTRAN was the
  first high-level language, using the first compiler ever
  developed.
• Prior to the development of FORTRAN computer
  programmers were required to program in machine/assembly
  code, which was an extremely difficult and time consuming
  task, difficult to debug the code.
Significant Language Features
• Simple to learn

• Machine Independent - allows for easy transportation of a program
  from one machine to another.

• More natural ways to express mathematical functions - FORTRAN
  permits even severely complex mathematical functions to be
  expressed similarly to regular algebraic notation.

• Problem orientated language

• Remains close to and exploits the available hardware

• Efficient execution - there is only an approximate 20% decrease in
  efficiency as compared to assembly/machine code.
Areas of Application

• Number crunching - due to the more natural (like it's true
  algebraic form) way of expressing complex mathematical
  functions and it's quick execution time, FORTRAN is easy and
  efficient at processing mathematical equations.

• Scientific, mathematical, statistical, and engineering type
  procedures -due to it's rapid number-crunching ability
  FORTRAN is a good choice for these type of applications.
Basic Elements of Fortran Program
The Fortran Character Set
The following are valid in a Fortran 90/95 program:

alpha-numeric:      a-z, A-Z, 0-9, and _ (the underscore);

arithmetic symbols: +, -, *, /, **

miscellaneous symbols: e.g.
   ,     comma
   .     decimal point
    <    less than
etc
Structure of a FORTRAN Statement

 A program consists of a series of statements
  designed to accomplish the goal.

 There are two basic types of statements:
  Executable statements describe the actions taken
  by the program (additions, subtractions,
  multiplications, divisions).
  Non-executable statements provide information
  necessary for proper operation of the program.
Rules on Fortran statements:
Each line may be up to 132 characters long.
A statement too long to fit in a single line may be
    continued on the next line by ending the
    current line with an & (ampersand). e. g.
output = input1 + input2 ! sum the inputs

Commenting your code is very important. To
    comment in FORTRAN, one uses the
    exclamation point (!)
All comments after the ! are ignored by the
    compiler
Structure of a Fortran Program

A FORTRAN program can be divided into three sections:

Declarations - This section consists of a group of non-executable
     statements at the start of the program.

Execution - This section consists of one or more statements
    describing the actions to be performed by the program.

Termination - This section consists of a statement (or
    statements) telling the computer to stop/end running the
    program.
The program reads two numbers as input,
   multiplies them, and prints out the result
PROGRAM my_first_program
! Purpose:
! To illustrate some of the basic features of a
    Fortran program.
!
! Declare the variables used in this program.
INTEGER :: i, j, k      ! All variables are integers
! Get two values to store in variables i and j
WRITE (*,*) 'Enter the numbers to multiply: '
READ (*,*) i, j
Continued…
! Multiply the numbers together
k=i*j
! Write out the result.
WRITE (*,*) 'Result = ', k
! Finish up.
STOP
END PROGRAM my_first_program
Discussion of Program Above

The first statement of this program begins with the word
     PROGRAM. This is a non-executable statement that
     specifies the name of the program to the FORTRAN
     compiler.

The name may be up to 31 characters long and be any
     combination of alphabetic characters, digits, and the
     underscore.

The first character must be a letter.

The PROGRAM statement must be the first line of the program.
The Declaration Section
This section begins with a comment stating that variable
     declarations are to follow.

The declaration begins with the data type (INTEGER) followed by
     two colons and then the variable name.

A comment follows the variable name. Every variable must be
    commented as to its purpose in the program.

These statements are non-executable.
The Execution Section

The first statement in this section is the WRITE statement
    that tells the user to enter the input.

The second statement will read the input and assign the
    values to the corresponding variables.

The third statement multiplies the two variables and the
    product is assigned to a third variable.

The last executable statement prints the product to the
    screen.
The Termination Section

The STOP statement tells the computer to stop
   running the program.
The use of the STOP command is optional here.
The END PROGRAM statement informs the
   compiler that no more statements exist.
Compiling and Executing the FORTRAN Program



Before a program can be run (executed) it must be compiled into
    an executable program.

In this process the code may also be linked to various system
      libraries.
Variables and the IMPLICIT NONE


Checking a constant (e.g.7, 3.14156, 'John'), it is easy to
    determine which type it may be. However, for a variable,
    we must assign a type to that variable.

Assigning a type reserves the memory needed to store the data
    expected (e.g.4 bytes for: 7 , 3.14156 and
   2 bytes/letter for: 'John').
Live Demonstration
Thank You for Your Kind
       attention

More Related Content

PDF
Fortran introduction
PDF
Principles and applications of esr spectroscopy
PDF
Fortran tutorial
PPTX
Fortran - concise review
PPTX
Fermi level in extrinsic semiconductor
PPTX
Introduction to programming
PDF
Fortran 90 Basics
PDF
Schrodinger Equation of Hydrogen Atom
Fortran introduction
Principles and applications of esr spectroscopy
Fortran tutorial
Fortran - concise review
Fermi level in extrinsic semiconductor
Introduction to programming
Fortran 90 Basics
Schrodinger Equation of Hydrogen Atom

What's hot (20)

PDF
Co existence of self and body &amp; needs of self &amp; body
PPT
Laplace equation
PPTX
Kronig penny model_computational_phyics
PPT
HYDROGEN ATOM.ppt
PPTX
Maxwell Boltzmann Velocity Distribution
PPT
Statistical mechanics
DOCX
Features of c language 1
PPT
Pn junction diode
PDF
Basic Electrical Engineering- AC Circuit
PPTX
Quantum chemistry-B SC III-SEM-VI
PPTX
C and its errors
PDF
Problem Solving Techniques and Introduction to C
PPTX
Gouy's method of magnetic susceptibility
PPTX
History of C Programming Language
PPT
Lecture 1- History of C Programming
PPTX
ppt on Elementary Particles By Jyotibhooshan chaturvedi
PPTX
Rules for Variable Declaration
PPTX
Mechanism Of Dry Corrosion
PPTX
Spectroscopy
Co existence of self and body &amp; needs of self &amp; body
Laplace equation
Kronig penny model_computational_phyics
HYDROGEN ATOM.ppt
Maxwell Boltzmann Velocity Distribution
Statistical mechanics
Features of c language 1
Pn junction diode
Basic Electrical Engineering- AC Circuit
Quantum chemistry-B SC III-SEM-VI
C and its errors
Problem Solving Techniques and Introduction to C
Gouy's method of magnetic susceptibility
History of C Programming Language
Lecture 1- History of C Programming
ppt on Elementary Particles By Jyotibhooshan chaturvedi
Rules for Variable Declaration
Mechanism Of Dry Corrosion
Spectroscopy
Ad

Similar to Fortran 95 (20)

PPTX
1922071042 - Mohammad Saiful Islam - CSE425.5 (MSAH) - Presentation - Fortran...
PPTX
C programming
PDF
C programming course material
PDF
Chapter#01 cc
PPT
UNIT 1: Problem Solving Using Computer
PPTX
UNIT 5 C PROGRAMMING, PROGRAM STRUCTURE
PDF
COMPILER DESIGN- Introduction & Lexical Analysis:
PDF
C Language Made Easy For All 1st Edition Dr Sangram Patil
PDF
4 coding from algorithms
PPTX
Unit 3.1 Algorithm and Flowchart
PPTX
Compiler presentaion
PDF
265 ge8151 problem solving and python programming - 2 marks with answers
PPT
Intro to c programming with all basic concept with clear explanation and example
PPT
Compiler Construction introduction
PPTX
Computer and programing basics.pptx
PDF
C progrmming
PDF
6272 cnote
DOCX
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
PDF
COMPUTER SCIENCE COURSE 204 COMPILER CONSTRUCTION,.pdf
PDF
unit1pdf__2021_12_14_12_37_34.pdf
1922071042 - Mohammad Saiful Islam - CSE425.5 (MSAH) - Presentation - Fortran...
C programming
C programming course material
Chapter#01 cc
UNIT 1: Problem Solving Using Computer
UNIT 5 C PROGRAMMING, PROGRAM STRUCTURE
COMPILER DESIGN- Introduction & Lexical Analysis:
C Language Made Easy For All 1st Edition Dr Sangram Patil
4 coding from algorithms
Unit 3.1 Algorithm and Flowchart
Compiler presentaion
265 ge8151 problem solving and python programming - 2 marks with answers
Intro to c programming with all basic concept with clear explanation and example
Compiler Construction introduction
Computer and programing basics.pptx
C progrmming
6272 cnote
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
COMPUTER SCIENCE COURSE 204 COMPILER CONSTRUCTION,.pdf
unit1pdf__2021_12_14_12_37_34.pdf
Ad

More from Zaahir Salam (20)

PPTX
J&K RTI Act 2009
PDF
How to configure a ZTE Router with easy steps.
PDF
Intorduction to cellular communication
PDF
Modern cellular communication
PDF
Wireless sensor networks
PDF
Magnetic field sensing
PDF
Superhard nanocomposites
PDF
Biological transport of nanoparticles
PDF
Photonic crystals by self assembly
PDF
Piezoelectricity : Think Locally, Act Globally
PDF
Graphene -Applications in Electronics
PDF
Self assembly in photovoltaic devices
PDF
Ferroelectric and piezoelectric materials
PPTX
Transposons(jumping genes)
PPTX
Secondary ion mass spectrometry
PDF
Order disorder transformation( the kinetics behind)
PDF
Xps (x ray photoelectron spectroscopy)
PDF
Graphene a wonder material
PDF
D&euv lithography final
PDF
Nanotechnology in Defence applications
J&K RTI Act 2009
How to configure a ZTE Router with easy steps.
Intorduction to cellular communication
Modern cellular communication
Wireless sensor networks
Magnetic field sensing
Superhard nanocomposites
Biological transport of nanoparticles
Photonic crystals by self assembly
Piezoelectricity : Think Locally, Act Globally
Graphene -Applications in Electronics
Self assembly in photovoltaic devices
Ferroelectric and piezoelectric materials
Transposons(jumping genes)
Secondary ion mass spectrometry
Order disorder transformation( the kinetics behind)
Xps (x ray photoelectron spectroscopy)
Graphene a wonder material
D&euv lithography final
Nanotechnology in Defence applications

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Empathic Computing: Creating Shared Understanding
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Approach and Philosophy of On baking technology
PDF
Electronic commerce courselecture one. Pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Big Data Technologies - Introduction.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
cuic standard and advanced reporting.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation_ Review paper, used for researhc scholars
Empathic Computing: Creating Shared Understanding
MIND Revenue Release Quarter 2 2025 Press Release
Approach and Philosophy of On baking technology
Electronic commerce courselecture one. Pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
NewMind AI Weekly Chronicles - August'25 Week I
Big Data Technologies - Introduction.pptx
Review of recent advances in non-invasive hemoglobin estimation
Mobile App Security Testing_ A Comprehensive Guide.pdf
Chapter 3 Spatial Domain Image Processing.pdf
cuic standard and advanced reporting.pdf

Fortran 95

  • 1. The FORTRAN Programming Language Zaahir Salam
  • 2. How to get FORTRAN 95 Compiler • Write FTN silverfrost in google and download it for free
  • 3. 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. • Often referred to as a scientific language, FORTRAN was the first high-level language, using the first compiler ever developed. • Prior to the development of FORTRAN computer programmers were required to program in machine/assembly code, which was an extremely difficult and time consuming task, difficult to debug the code.
  • 4. Significant Language Features • Simple to learn • Machine Independent - allows for easy transportation of a program from one machine to another. • More natural ways to express mathematical functions - FORTRAN permits even severely complex mathematical functions to be expressed similarly to regular algebraic notation. • Problem orientated language • Remains close to and exploits the available hardware • Efficient execution - there is only an approximate 20% decrease in efficiency as compared to assembly/machine code.
  • 5. Areas of Application • Number crunching - due to the more natural (like it's true algebraic form) way of expressing complex mathematical functions and it's quick execution time, FORTRAN is easy and efficient at processing mathematical equations. • Scientific, mathematical, statistical, and engineering type procedures -due to it's rapid number-crunching ability FORTRAN is a good choice for these type of applications.
  • 6. Basic Elements of Fortran Program The Fortran Character Set The following are valid in a Fortran 90/95 program: alpha-numeric: a-z, A-Z, 0-9, and _ (the underscore); arithmetic symbols: +, -, *, /, ** miscellaneous symbols: e.g. , comma . decimal point < less than etc
  • 7. Structure of a FORTRAN Statement  A program consists of a series of statements designed to accomplish the goal.  There are two basic types of statements: Executable statements describe the actions taken by the program (additions, subtractions, multiplications, divisions). Non-executable statements provide information necessary for proper operation of the program.
  • 8. Rules on Fortran statements: Each line may be up to 132 characters long. A statement too long to fit in a single line may be continued on the next line by ending the current line with an & (ampersand). e. g. output = input1 + input2 ! sum the inputs Commenting your code is very important. To comment in FORTRAN, one uses the exclamation point (!) All comments after the ! are ignored by the compiler
  • 9. Structure of a Fortran Program A FORTRAN program can be divided into three sections: Declarations - This section consists of a group of non-executable statements at the start of the program. Execution - This section consists of one or more statements describing the actions to be performed by the program. Termination - This section consists of a statement (or statements) telling the computer to stop/end running the program.
  • 10. The program reads two numbers as input, multiplies them, and prints out the result PROGRAM my_first_program ! Purpose: ! To illustrate some of the basic features of a Fortran program. ! ! Declare the variables used in this program. INTEGER :: i, j, k ! All variables are integers ! Get two values to store in variables i and j WRITE (*,*) 'Enter the numbers to multiply: ' READ (*,*) i, j
  • 11. Continued… ! Multiply the numbers together k=i*j ! Write out the result. WRITE (*,*) 'Result = ', k ! Finish up. STOP END PROGRAM my_first_program
  • 12. Discussion of Program Above The first statement of this program begins with the word PROGRAM. This is a non-executable statement that specifies the name of the program to the FORTRAN compiler. The name may be up to 31 characters long and be any combination of alphabetic characters, digits, and the underscore. The first character must be a letter. The PROGRAM statement must be the first line of the program.
  • 13. The Declaration Section This section begins with a comment stating that variable declarations are to follow. The declaration begins with the data type (INTEGER) followed by two colons and then the variable name. A comment follows the variable name. Every variable must be commented as to its purpose in the program. These statements are non-executable.
  • 14. The Execution Section The first statement in this section is the WRITE statement that tells the user to enter the input. The second statement will read the input and assign the values to the corresponding variables. The third statement multiplies the two variables and the product is assigned to a third variable. The last executable statement prints the product to the screen.
  • 15. The Termination Section The STOP statement tells the computer to stop running the program. The use of the STOP command is optional here. The END PROGRAM statement informs the compiler that no more statements exist.
  • 16. Compiling and Executing the FORTRAN Program Before a program can be run (executed) it must be compiled into an executable program. In this process the code may also be linked to various system libraries.
  • 17. Variables and the IMPLICIT NONE Checking a constant (e.g.7, 3.14156, 'John'), it is easy to determine which type it may be. However, for a variable, we must assign a type to that variable. Assigning a type reserves the memory needed to store the data expected (e.g.4 bytes for: 7 , 3.14156 and 2 bytes/letter for: 'John').
  • 19. Thank You for Your Kind attention