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

Integration formulas
Integration formulasIntegration formulas
Integration formulas
THE CREATORS ACADEMY
 
Relational operators
Relational operatorsRelational operators
Computer Science Practical File class XII
Computer Science Practical File class XIIComputer Science Practical File class XII
Computer Science Practical File class XII
YugenJarwal
 
Call by value
Call by valueCall by value
Call by valueDharani G
 
Pointer in c
Pointer in cPointer in c
Pointer in c
lavanya marichamy
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
Harshita Yadav
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programming
TejaswiB4
 
C pointer
C pointerC pointer
Branching statements
Branching statementsBranching statements
Branching statements
ArunMK17
 
C standard library functions
C standard library functionsC standard library functions
C standard library functions
Vaishnavee Sharma
 
Unit 3. Input and Output
Unit 3. Input and OutputUnit 3. Input and Output
Unit 3. Input and Output
Ashim Lamichhane
 
Functions in C
Functions in CFunctions in C
Functions in C
Kamal Acharya
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
Nikhil Pandit
 
Conditional Statement in C Language
Conditional Statement in C LanguageConditional Statement in C Language
Conditional Statement in C Language
Shaina Arora
 
Python final ppt
Python final pptPython final ppt
Python final ppt
Ripal Ranpara
 
Looping statement in python
Looping statement in pythonLooping statement in python
Looping statement in python
RaginiJain21
 
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
eShikshak
 
Fourier series
Fourier series Fourier series
Fourier series
Pinky Chaudhari
 

What's hot (20)

Integration formulas
Integration formulasIntegration formulas
Integration formulas
 
Relational operators
Relational operatorsRelational operators
Relational operators
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
 
Computer Science Practical File class XII
Computer Science Practical File class XIIComputer Science Practical File class XII
Computer Science Practical File class XII
 
Call by value
Call by valueCall by value
Call by value
 
Pointer in c
Pointer in cPointer in c
Pointer in c
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programming
 
C pointer
C pointerC pointer
C pointer
 
File handling in c
File handling in cFile handling in c
File handling in c
 
Branching statements
Branching statementsBranching statements
Branching statements
 
C standard library functions
C standard library functionsC standard library functions
C standard library functions
 
Unit 3. Input and Output
Unit 3. Input and OutputUnit 3. Input and Output
Unit 3. Input and Output
 
Functions in C
Functions in CFunctions in C
Functions in C
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Conditional Statement in C Language
Conditional Statement in C LanguageConditional Statement in C Language
Conditional Statement in C Language
 
Python final ppt
Python final pptPython final ppt
Python final ppt
 
Looping statement in python
Looping statement in pythonLooping statement in python
Looping statement in python
 
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
 
Fourier series
Fourier series Fourier series
Fourier series
 

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

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
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
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
 
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
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
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
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
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
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
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
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 

Recently uploaded (20)

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
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
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...
 
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...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
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
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
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 -...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
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
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 

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