SlideShare a Scribd company logo
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

What's hot

Perturbation
PerturbationPerturbation
Perturbation
BHAVANAR12
Ā 
Fermi dirac basic part 1
Fermi dirac basic part 1Fermi dirac basic part 1
Fermi dirac basic part 1
kiranmadhale1
Ā 
5 introduction to quantum mechanics
5 introduction to quantum mechanics5 introduction to quantum mechanics
5 introduction to quantum mechanics
Solo Hermelin
Ā 
Postulates of quantum mechanics
Postulates of quantum mechanics Postulates of quantum mechanics
Postulates of quantum mechanics
Student
Ā 
Poisson's equation 2nd 4
Poisson's equation 2nd 4Poisson's equation 2nd 4
Poisson's equation 2nd 4
HIMANSHU DIWAKAR
Ā 
The Basic Model of Computation
The Basic Model of ComputationThe Basic Model of Computation
The Basic Model of Computation
DipakKumar122
Ā 
Postulates of quantum mechanics
Postulates of quantum mechanicsPostulates of quantum mechanics
Postulates of quantum mechanics
NÄÆļęşh PĆ„Å•mĆ„Å•
Ā 
Band theory of semiconductor
Band theory of semiconductorBand theory of semiconductor
Band theory of semiconductor
Md. Hasan Al Roktim
Ā 
Quantum
QuantumQuantum
Quantum
Krupesh Anadkat
Ā 
Zeeman effect
Zeeman effectZeeman effect
Zeeman effect
sheneaziz3
Ā 
B.tech. ii engineering chemistry unit-5 B spectroscopic techniques
B.tech. ii engineering chemistry unit-5 B spectroscopic techniquesB.tech. ii engineering chemistry unit-5 B spectroscopic techniques
B.tech. ii engineering chemistry unit-5 B spectroscopic techniques
Rai University
Ā 
The newton raphson method
The newton raphson methodThe newton raphson method
The newton raphson methodLove Leoann Duran
Ā 
Logical and Conditional Operator In C language
Logical and Conditional Operator In C languageLogical and Conditional Operator In C language
Logical and Conditional Operator In C language
Abdul Rehman
Ā 
Density Functional Theory.pptx
Density Functional Theory.pptxDensity Functional Theory.pptx
Density Functional Theory.pptx
HassanShah396906
Ā 
Chapter 4a
Chapter 4aChapter 4a
Chapter 4a
Gabriel O'Brien
Ā 
Nuclear chemistry B.Sc.III
Nuclear chemistry B.Sc.III  Nuclear chemistry B.Sc.III
Nuclear chemistry B.Sc.III
swapnil jadhav
Ā 
6563.nuclear models
6563.nuclear models6563.nuclear models
6563.nuclear modelsakshay garg
Ā 
Classification of nuclei and properties of nucleus
Classification  of nuclei and properties of nucleusClassification  of nuclei and properties of nucleus
Classification of nuclei and properties of nucleus
hemalathasenthil
Ā 
Black body radiation,planck's radiation, wien's law, stephen boltzmann law in...
Black body radiation,planck's radiation, wien's law, stephen boltzmann law in...Black body radiation,planck's radiation, wien's law, stephen boltzmann law in...
Black body radiation,planck's radiation, wien's law, stephen boltzmann law in...
P.K. Mani
Ā 
Maxwell's equation and it's correction in Ampere's circuital law
Maxwell's equation and it's correction in Ampere's circuital lawMaxwell's equation and it's correction in Ampere's circuital law
Maxwell's equation and it's correction in Ampere's circuital law
Kamran Ansari
Ā 

What's hot (20)

Perturbation
PerturbationPerturbation
Perturbation
Ā 
Fermi dirac basic part 1
Fermi dirac basic part 1Fermi dirac basic part 1
Fermi dirac basic part 1
Ā 
5 introduction to quantum mechanics
5 introduction to quantum mechanics5 introduction to quantum mechanics
5 introduction to quantum mechanics
Ā 
Postulates of quantum mechanics
Postulates of quantum mechanics Postulates of quantum mechanics
Postulates of quantum mechanics
Ā 
Poisson's equation 2nd 4
Poisson's equation 2nd 4Poisson's equation 2nd 4
Poisson's equation 2nd 4
Ā 
The Basic Model of Computation
The Basic Model of ComputationThe Basic Model of Computation
The Basic Model of Computation
Ā 
Postulates of quantum mechanics
Postulates of quantum mechanicsPostulates of quantum mechanics
Postulates of quantum mechanics
Ā 
Band theory of semiconductor
Band theory of semiconductorBand theory of semiconductor
Band theory of semiconductor
Ā 
Quantum
QuantumQuantum
Quantum
Ā 
Zeeman effect
Zeeman effectZeeman effect
Zeeman effect
Ā 
B.tech. ii engineering chemistry unit-5 B spectroscopic techniques
B.tech. ii engineering chemistry unit-5 B spectroscopic techniquesB.tech. ii engineering chemistry unit-5 B spectroscopic techniques
B.tech. ii engineering chemistry unit-5 B spectroscopic techniques
Ā 
The newton raphson method
The newton raphson methodThe newton raphson method
The newton raphson method
Ā 
Logical and Conditional Operator In C language
Logical and Conditional Operator In C languageLogical and Conditional Operator In C language
Logical and Conditional Operator In C language
Ā 
Density Functional Theory.pptx
Density Functional Theory.pptxDensity Functional Theory.pptx
Density Functional Theory.pptx
Ā 
Chapter 4a
Chapter 4aChapter 4a
Chapter 4a
Ā 
Nuclear chemistry B.Sc.III
Nuclear chemistry B.Sc.III  Nuclear chemistry B.Sc.III
Nuclear chemistry B.Sc.III
Ā 
6563.nuclear models
6563.nuclear models6563.nuclear models
6563.nuclear models
Ā 
Classification of nuclei and properties of nucleus
Classification  of nuclei and properties of nucleusClassification  of nuclei and properties of nucleus
Classification of nuclei and properties of nucleus
Ā 
Black body radiation,planck's radiation, wien's law, stephen boltzmann law in...
Black body radiation,planck's radiation, wien's law, stephen boltzmann law in...Black body radiation,planck's radiation, wien's law, stephen boltzmann law in...
Black body radiation,planck's radiation, wien's law, stephen boltzmann law in...
Ā 
Maxwell's equation and it's correction in Ampere's circuital law
Maxwell's equation and it's correction in Ampere's circuital lawMaxwell's equation and it's correction in Ampere's circuital law
Maxwell's equation and it's correction in Ampere's circuital law
Ā 

Similar to Fortran 95

1922071042 - Mohammad Saiful Islam - CSE425.5 (MSAH) - Presentation - Fortran...
1922071042 - Mohammad Saiful Islam - CSE425.5 (MSAH) - Presentation - Fortran...1922071042 - Mohammad Saiful Islam - CSE425.5 (MSAH) - Presentation - Fortran...
1922071042 - Mohammad Saiful Islam - CSE425.5 (MSAH) - Presentation - Fortran...
MohammadSaifulIslam63
Ā 
C programming
C programmingC programming
C programming
Jigarthacker
Ā 
C programming course material
C programming course materialC programming course material
C programming course material
Ranjitha Murthy
Ā 
Chapter#01 cc
Chapter#01 ccChapter#01 cc
Chapter#01 cc
abdulbaki3
Ā 
COMPILER DESIGN- Introduction & Lexical Analysis:
COMPILER DESIGN- Introduction & Lexical Analysis: COMPILER DESIGN- Introduction & Lexical Analysis:
COMPILER DESIGN- Introduction & Lexical Analysis:
Jyothishmathi Institute of Technology and Science Karimnagar
Ā 
4 coding from algorithms
4 coding from algorithms4 coding from algorithms
4 coding from algorithmshccit
Ā 
Unit 3.1 Algorithm and Flowchart
Unit 3.1 Algorithm and FlowchartUnit 3.1 Algorithm and Flowchart
Unit 3.1 Algorithm and Flowchart
Bom Khati
Ā 
Compiler presentaion
Compiler presentaionCompiler presentaion
Compiler presentaion
Shady A. Alefrangy
Ā 
265 ge8151 problem solving and python programming - 2 marks with answers
265   ge8151 problem solving and python programming - 2 marks with answers265   ge8151 problem solving and python programming - 2 marks with answers
265 ge8151 problem solving and python programming - 2 marks with answers
vithyanila
Ā 
Intro to c programming with all basic concept with clear explanation and example
Intro to c programming with all basic concept with clear explanation and exampleIntro to c programming with all basic concept with clear explanation and example
Intro to c programming with all basic concept with clear explanation and example
seccoordpal
Ā 
Compiler Construction introduction
Compiler Construction introductionCompiler Construction introduction
Compiler Construction introduction
Rana Ehtisham Ul Haq
Ā 
Computer and programing basics.pptx
Computer and programing basics.pptxComputer and programing basics.pptx
Computer and programing basics.pptx
gaafergoda
Ā 
6272 cnote
6272 cnote6272 cnote
6272 cnote
P Kiran Sree
Ā 
C progrmming
C progrmmingC progrmming
C progrmming
Shivam Singhal
Ā 
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
venkatapranaykumarGa
Ā 
unit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdfunit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdf
DrIsikoIsaac
Ā 
Intro to c++
Intro to c++Intro to c++
Intro to c++
Rafael Balderosa
Ā 
design intoduction of_COMPILER_DESIGN.pdf
design intoduction of_COMPILER_DESIGN.pdfdesign intoduction of_COMPILER_DESIGN.pdf
design intoduction of_COMPILER_DESIGN.pdf
advRajatSharma
Ā 
Chapter 5( programming) answer
Chapter 5( programming) answerChapter 5( programming) answer
Chapter 5( programming) answersmkengkilili2011
Ā 
Phases of Compiler.pptx
Phases of Compiler.pptxPhases of Compiler.pptx
Phases of Compiler.pptx
ssuser3b4934
Ā 

Similar to Fortran 95 (20)

1922071042 - Mohammad Saiful Islam - CSE425.5 (MSAH) - Presentation - Fortran...
1922071042 - Mohammad Saiful Islam - CSE425.5 (MSAH) - Presentation - Fortran...1922071042 - Mohammad Saiful Islam - CSE425.5 (MSAH) - Presentation - Fortran...
1922071042 - Mohammad Saiful Islam - CSE425.5 (MSAH) - Presentation - Fortran...
Ā 
C programming
C programmingC programming
C programming
Ā 
C programming course material
C programming course materialC programming course material
C programming course material
Ā 
Chapter#01 cc
Chapter#01 ccChapter#01 cc
Chapter#01 cc
Ā 
COMPILER DESIGN- Introduction & Lexical Analysis:
COMPILER DESIGN- Introduction & Lexical Analysis: COMPILER DESIGN- Introduction & Lexical Analysis:
COMPILER DESIGN- Introduction & Lexical Analysis:
Ā 
4 coding from algorithms
4 coding from algorithms4 coding from algorithms
4 coding from algorithms
Ā 
Unit 3.1 Algorithm and Flowchart
Unit 3.1 Algorithm and FlowchartUnit 3.1 Algorithm and Flowchart
Unit 3.1 Algorithm and Flowchart
Ā 
Compiler presentaion
Compiler presentaionCompiler presentaion
Compiler presentaion
Ā 
265 ge8151 problem solving and python programming - 2 marks with answers
265   ge8151 problem solving and python programming - 2 marks with answers265   ge8151 problem solving and python programming - 2 marks with answers
265 ge8151 problem solving and python programming - 2 marks with answers
Ā 
Intro to c programming with all basic concept with clear explanation and example
Intro to c programming with all basic concept with clear explanation and exampleIntro to c programming with all basic concept with clear explanation and example
Intro to c programming with all basic concept with clear explanation and example
Ā 
Compiler Construction introduction
Compiler Construction introductionCompiler Construction introduction
Compiler Construction introduction
Ā 
Computer and programing basics.pptx
Computer and programing basics.pptxComputer and programing basics.pptx
Computer and programing basics.pptx
Ā 
6272 cnote
6272 cnote6272 cnote
6272 cnote
Ā 
C progrmming
C progrmmingC progrmming
C progrmming
Ā 
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
Ā 
unit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdfunit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdf
Ā 
Intro to c++
Intro to c++Intro to c++
Intro to c++
Ā 
design intoduction of_COMPILER_DESIGN.pdf
design intoduction of_COMPILER_DESIGN.pdfdesign intoduction of_COMPILER_DESIGN.pdf
design intoduction of_COMPILER_DESIGN.pdf
Ā 
Chapter 5( programming) answer
Chapter 5( programming) answerChapter 5( programming) answer
Chapter 5( programming) answer
Ā 
Phases of Compiler.pptx
Phases of Compiler.pptxPhases of Compiler.pptx
Phases of Compiler.pptx
Ā 

More from Zaahir Salam

J&K RTI Act 2009
J&K RTI Act 2009 J&K RTI Act 2009
J&K RTI Act 2009
Zaahir Salam
Ā 
How to configure a ZTE Router with easy steps.
How to configure a ZTE Router with easy steps.How to configure a ZTE Router with easy steps.
How to configure a ZTE Router with easy steps.
Zaahir Salam
Ā 
Intorduction to cellular communication
Intorduction to cellular communicationIntorduction to cellular communication
Intorduction to cellular communication
Zaahir Salam
Ā 
Modern cellular communication
Modern cellular communicationModern cellular communication
Modern cellular communication
Zaahir Salam
Ā 
Wireless sensor networks
Wireless sensor networksWireless sensor networks
Wireless sensor networks
Zaahir Salam
Ā 
Magnetic field sensing
Magnetic field sensingMagnetic field sensing
Magnetic field sensing
Zaahir Salam
Ā 
Superhard nanocomposites
Superhard nanocompositesSuperhard nanocomposites
Superhard nanocomposites
Zaahir Salam
Ā 
Biological transport of nanoparticles
Biological transport of nanoparticlesBiological transport of nanoparticles
Biological transport of nanoparticles
Zaahir Salam
Ā 
Photonic crystals by self assembly
Photonic crystals by self assemblyPhotonic crystals by self assembly
Photonic crystals by self assembly
Zaahir Salam
Ā 
Piezoelectricity : Think Locally, Act Globally
Piezoelectricity : Think Locally, Act GloballyPiezoelectricity : Think Locally, Act Globally
Piezoelectricity : Think Locally, Act Globally
Zaahir Salam
Ā 
Graphene -Applications in Electronics
Graphene -Applications in ElectronicsGraphene -Applications in Electronics
Graphene -Applications in Electronics
Zaahir Salam
Ā 
Self assembly in photovoltaic devices
Self assembly in photovoltaic devicesSelf assembly in photovoltaic devices
Self assembly in photovoltaic devices
Zaahir Salam
Ā 
Ferroelectric and piezoelectric materials
Ferroelectric and piezoelectric materialsFerroelectric and piezoelectric materials
Ferroelectric and piezoelectric materials
Zaahir Salam
Ā 
Transposons(jumping genes)
Transposons(jumping genes)Transposons(jumping genes)
Transposons(jumping genes)Zaahir Salam
Ā 
Secondary ion mass spectrometry
Secondary ion mass spectrometrySecondary ion mass spectrometry
Secondary ion mass spectrometryZaahir Salam
Ā 
Order disorder transformation( the kinetics behind)
Order disorder transformation( the kinetics behind)Order disorder transformation( the kinetics behind)
Order disorder transformation( the kinetics behind)
Zaahir Salam
Ā 
Xps (x ray photoelectron spectroscopy)
Xps (x ray photoelectron spectroscopy)Xps (x ray photoelectron spectroscopy)
Xps (x ray photoelectron spectroscopy)
Zaahir Salam
Ā 
Graphene a wonder material
Graphene a wonder materialGraphene a wonder material
Graphene a wonder material
Zaahir Salam
Ā 
D&euv lithography final
D&euv lithography finalD&euv lithography final
D&euv lithography final
Zaahir Salam
Ā 
Nanotechnology in Defence applications
Nanotechnology in Defence applicationsNanotechnology in Defence applications
Nanotechnology in Defence applicationsZaahir Salam
Ā 

More from Zaahir Salam (20)

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

Recently uploaded

Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
UiPathCommunity
Ā 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
Ā 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
Ā 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
Ā 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
Ā 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
Ā 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
Ā 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
Ā 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
Ā 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
Ā 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
Ā 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
Ā 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
Ā 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
Ā 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
Ā 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
Ā 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
Ā 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
Ā 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
Ā 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
Ā 

Recently uploaded (20)

Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
Ā 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ā 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
Ā 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Ā 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Ā 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Ā 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Ā 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Ā 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Ā 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
Ā 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Ā 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Ā 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
Ā 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Ā 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Ā 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Ā 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
Ā 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Ā 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Ā 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Ā 

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