SlideShare a Scribd company logo
1 of 25
Download to read offline
CIVIL HTI
Fortran 77
Series Lectures
Dr. A.M.K. Shaltout
2016
Example 1.
Example 2.
 Write a Fortran program to convert the length
in feet to centimeter. (Recall that lcm=lft x 30)
0.75
1.25
1.5
1.75
2.25
Usually an expression like
"x**y" results in the
compiler inserting code
equivalent to
"exp(y*log(x))".
𝑥
Math
|x|
sin x
cos x
tan x
𝑒 𝑥
ln x
log x
Input and Output Statements
 Basic instructions:
 READ – reads input from a standard input device or a specified device
or file.
 WRITE – writes data to a standard output device (screen) or to a
specified device or file.
 FORMAT – defines the input or output format.
READ Statement
 Format controlled READ:
 Syntax: READ(dev_no, format_label) variable_list
 Read a record from dev_no using format_label and assign results to
variables in variable_list
 Ex: READ(5,1000) A,B,C
1000 FORMAT(3F12.4)
 Device numbers 1-7 are defined as standard I/O devices and 1 is the
keyboard, but 5 is also commonly taken as the keyboard (used to be
card reader)
 Each READ reads one or more lines of data and any remaining data in
a line that is read is dropped if not translated to one of the variables in
the variable_list.
 Variable_list can include implied DO such as:
READ(5,1000)(A(I),I=1,10)
READ Statement – cont’d
 List-directed READ
 Syntax: READ*, variable_list
 Read enough variables from the standard input device (usually a
keyboard) to satisfy variable_list
– input items can be integer, real or character.
– characters must be enclosed in ‘ ‘.
– input items are separated by commas.
– input items must agree in type with variables in variable_list.
– as many records (lines) will be read as needed to fill variable_list and any
not used in the current line are dropped.
– each READ processes a new record (line).
 Ex: READ*,A,B,K – read line and look for floating point values for
A and B and an integer for K.
 Some compilers support:
 Syntax: READ(dev_num, *) variable_list
 Behaves just like above.
WRITE Statement
 Format controlled WRITE
 Syntax: WRITE(dev_no, format_label) variable_list
 Write variables in variable_list to output dev_no using format
specified in format statement with format_label
 Ex: WRITE(6,1000) A,B,KEY
1000 FORMAT(F12.4,E14.5,I6)
 Device number 6 is commonly the printer but can also be the screen
(standard screen is 2)
 Each WRITE produces one or more output lines as needed to write out
variable_list using format statement.
 Variable_list can include implied DO such as:
WRITE(6,2000)(A(I),I=1,10)
Output:
|----+----o----+----o----+----o----+----|
1234.5678 -0.12345E+02 12
WRITE Statement – cont’d
 List directed WRITE
 Syntax: PRINT*, variable_list
 Write variables in variable_list to standard output device using format
appropriate to variable type. Variables are separated by either spaces
or commas, depending on system used.
 Ex: PRINT*,‘X=‘,X,’Y=‘,Y,’N=‘,N
Output:
X= 4.56, Y= 15.62, N= 4
Format Specifiers
 X format code
 Syntax: nX
 Specifies n spaces to be included at this point
 I format code
 Syntax: Iw
 Specifies format for an integer using a field width of w spaces. If
integer value exceeds this space, output will consist of ****
 F format code
 Syntax: Fw.d
 Specifies format for a REAL number using a field width of w spaces
and printing d digits to the right of the decimal point.
 A format code
 Syntax: A or Aw
 Specifies format for a CHARACTER using a field width equal to the
number of characters, or using exactly w spaces (padded with blanks
to the right if characters are less than w.
Format Specifiers – cont’d
 E format code
 Syntax: Ew.d
 Print value of REAL variable using “scientific notation” with a mantissa
of d digits and a total field width of w.
 Ex:
E14.5 produces for the REAL value -1.23456789e+4:
 You must leave room for sign, leading 0,decimal point, E, sign, and 2
digits for exponent (typically at least 7 spaces)
 If specified width is too small, mantissa precision, d, will be reduced
unless d<1 in which case *** will be output.
 Using nP prefix will shift mantissa digit right by n and reduce exponent
by –n. Ex; 1PE14.5 above yields:
|----+----o----+----o----+----o----+----|
-0.12345E+05
|----+----o----+----o----+----o----+----|
-1.23456E+04
Other FORMAT Features – cont’d
 When the end of the format_specifiers in a FORMAT statement are
reached before all of the variables in the variable_list have been output,
the format_specifiers are re-scanned starting at the first left parenthesis,
(.
 Many other format specifiers are available but are not included in these
notes. These include formats for Binary, Octal and Hexidecimal data,
formats for Double Precision numbers (replace E with D), and formats for
Complex numbers.
 When formatted READ is used, any decimal point in data will override
format specifier. If no decimal is supplied, format specifier will determine
where decimal should be (even though it is not in input data)
|----+----o----+----o----+----o----+----|
Data: 123456 1.23456
READ(5,1000) A,B
1000 FORMAT(2F8.2)
Result: A=1234.56, B=1.23456
OPEN Statement
 OPEN is used to make file available to READ & WRITE
 Syntax: OPEN ([UNIT=]io_unit [,FILE=name])
 Ex:
OPEN (12,FILE=‘D:AEtest.dat’)
Opens file D:AEtest.dat for sequential read&write (default)
and specifies device number 12 for access.
 Ex:
OPEN (14,FILE=‘D:test1.dat’)
CIVIL HTI Fortran 77 Series Lectures
CIVIL HTI Fortran 77 Series Lectures
CIVIL HTI Fortran 77 Series Lectures
CIVIL HTI Fortran 77 Series Lectures

More Related Content

What's hot

Elementary particles
Elementary particlesElementary particles
Elementary particlesSNS
 
Variational Principle
Variational PrincipleVariational Principle
Variational PrincipleAmeenSoomro1
 
Postulates of quantum mechanics & operators
Postulates of quantum mechanics & operatorsPostulates of quantum mechanics & operators
Postulates of quantum mechanics & operatorsGiri dharan
 
CURIE TEMPERATURE PPT
CURIE TEMPERATURE PPTCURIE TEMPERATURE PPT
CURIE TEMPERATURE PPTEsha Garg
 
Quantum mechanics for Engineering Students
Quantum mechanics for Engineering StudentsQuantum mechanics for Engineering Students
Quantum mechanics for Engineering StudentsPraveen Vaidya
 
Quantum mechanics
Quantum mechanics Quantum mechanics
Quantum mechanics Kumar
 
FERROMAGNETIC AND ANTIFERROMAGNETIC MATERIALS.pptx
FERROMAGNETIC AND ANTIFERROMAGNETIC MATERIALS.pptxFERROMAGNETIC AND ANTIFERROMAGNETIC MATERIALS.pptx
FERROMAGNETIC AND ANTIFERROMAGNETIC MATERIALS.pptxTHE CREATORS ACADEMY
 
Schrodinger Equation of Hydrogen Atom
Schrodinger Equation of Hydrogen AtomSchrodinger Equation of Hydrogen Atom
Schrodinger Equation of Hydrogen AtomSaad Shaukat
 
Brief introduction to perturbation theory
Brief introduction to perturbation theoryBrief introduction to perturbation theory
Brief introduction to perturbation theoryAnamika Banerjee
 
Statistical ensembles-b.subha
Statistical  ensembles-b.subhaStatistical  ensembles-b.subha
Statistical ensembles-b.subhaMrsBSubhaPhysics
 
Quantum mechanics a brief
Quantum mechanics a briefQuantum mechanics a brief
Quantum mechanics a briefChaitanya Areti
 
quantum bohr model(1).pptx
quantum bohr model(1).pptxquantum bohr model(1).pptx
quantum bohr model(1).pptxsheneaziz3
 
Rotational Spectra : Microwave Spectroscopy
Rotational Spectra : Microwave SpectroscopyRotational Spectra : Microwave Spectroscopy
Rotational Spectra : Microwave SpectroscopyKhemendra shukla
 
Laplace equation
Laplace equationLaplace equation
Laplace equationalexkhan129
 

What's hot (20)

Elementary particles
Elementary particlesElementary particles
Elementary particles
 
Variational Principle
Variational PrincipleVariational Principle
Variational Principle
 
Zeeman Effect
Zeeman EffectZeeman Effect
Zeeman Effect
 
Postulates of quantum mechanics & operators
Postulates of quantum mechanics & operatorsPostulates of quantum mechanics & operators
Postulates of quantum mechanics & operators
 
CURIE TEMPERATURE PPT
CURIE TEMPERATURE PPTCURIE TEMPERATURE PPT
CURIE TEMPERATURE PPT
 
Quantum mechanics for Engineering Students
Quantum mechanics for Engineering StudentsQuantum mechanics for Engineering Students
Quantum mechanics for Engineering Students
 
UCSD NANO106 - 01 - Introduction to Crystallography
UCSD NANO106 - 01 - Introduction to CrystallographyUCSD NANO106 - 01 - Introduction to Crystallography
UCSD NANO106 - 01 - Introduction to Crystallography
 
Vsepr theory
Vsepr theoryVsepr theory
Vsepr theory
 
Quantum mechanics
Quantum mechanics Quantum mechanics
Quantum mechanics
 
FERROMAGNETIC AND ANTIFERROMAGNETIC MATERIALS.pptx
FERROMAGNETIC AND ANTIFERROMAGNETIC MATERIALS.pptxFERROMAGNETIC AND ANTIFERROMAGNETIC MATERIALS.pptx
FERROMAGNETIC AND ANTIFERROMAGNETIC MATERIALS.pptx
 
Schrodinger Equation of Hydrogen Atom
Schrodinger Equation of Hydrogen AtomSchrodinger Equation of Hydrogen Atom
Schrodinger Equation of Hydrogen Atom
 
Brief introduction to perturbation theory
Brief introduction to perturbation theoryBrief introduction to perturbation theory
Brief introduction to perturbation theory
 
Statistical Mechanics B.Sc. Sem VI
Statistical Mechanics B.Sc. Sem VIStatistical Mechanics B.Sc. Sem VI
Statistical Mechanics B.Sc. Sem VI
 
Statistical ensembles-b.subha
Statistical  ensembles-b.subhaStatistical  ensembles-b.subha
Statistical ensembles-b.subha
 
Quark particles
Quark particlesQuark particles
Quark particles
 
Quantum mechanics a brief
Quantum mechanics a briefQuantum mechanics a brief
Quantum mechanics a brief
 
quantum bohr model(1).pptx
quantum bohr model(1).pptxquantum bohr model(1).pptx
quantum bohr model(1).pptx
 
Cnt application in fed
Cnt application in fedCnt application in fed
Cnt application in fed
 
Rotational Spectra : Microwave Spectroscopy
Rotational Spectra : Microwave SpectroscopyRotational Spectra : Microwave Spectroscopy
Rotational Spectra : Microwave Spectroscopy
 
Laplace equation
Laplace equationLaplace equation
Laplace equation
 

Similar to CIVIL HTI Fortran 77 Series Lectures

2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2Don Dooley
 
Class 12 computer sample paper with answers
Class 12 computer sample paper with answersClass 12 computer sample paper with answers
Class 12 computer sample paper with answersdebarghyamukherjee60
 
sonam Kumari python.ppt
sonam Kumari python.pptsonam Kumari python.ppt
sonam Kumari python.pptssuserd64918
 
The Easytrieve Presention by Srinimf
The Easytrieve Presention by SrinimfThe Easytrieve Presention by Srinimf
The Easytrieve Presention by SrinimfSrinimf-Slides
 
Part III: Assembly Language
Part III: Assembly LanguagePart III: Assembly Language
Part III: Assembly LanguageAhmed M. Abed
 
ABAP Programming Overview
ABAP Programming OverviewABAP Programming Overview
ABAP Programming Overviewsapdocs. info
 
Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02wingsrai
 
Chapter 1abapprogrammingoverview-091205081953-phpapp01
Chapter 1abapprogrammingoverview-091205081953-phpapp01Chapter 1abapprogrammingoverview-091205081953-phpapp01
Chapter 1abapprogrammingoverview-091205081953-phpapp01tabish
 
chapter-1abapprogrammingoverview-091205081953-phpapp01
chapter-1abapprogrammingoverview-091205081953-phpapp01chapter-1abapprogrammingoverview-091205081953-phpapp01
chapter-1abapprogrammingoverview-091205081953-phpapp01tabish
 
Chapter 1 Abap Programming Overview
Chapter 1 Abap Programming OverviewChapter 1 Abap Programming Overview
Chapter 1 Abap Programming OverviewAshish Kumar
 
Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02tabish
 
Chapter Eight(3)
Chapter Eight(3)Chapter Eight(3)
Chapter Eight(3)bolovv
 

Similar to CIVIL HTI Fortran 77 Series Lectures (20)

2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2
 
Class 12 computer sample paper with answers
Class 12 computer sample paper with answersClass 12 computer sample paper with answers
Class 12 computer sample paper with answers
 
C++
C++C++
C++
 
sonam Kumari python.ppt
sonam Kumari python.pptsonam Kumari python.ppt
sonam Kumari python.ppt
 
The Easytrieve Presention by Srinimf
The Easytrieve Presention by SrinimfThe Easytrieve Presention by Srinimf
The Easytrieve Presention by Srinimf
 
Wk1to4
Wk1to4Wk1to4
Wk1to4
 
Managing I/O in c++
Managing I/O in c++Managing I/O in c++
Managing I/O in c++
 
Introduction to Input/Output Functions in C
Introduction to Input/Output Functions in CIntroduction to Input/Output Functions in C
Introduction to Input/Output Functions in C
 
Part III: Assembly Language
Part III: Assembly LanguagePart III: Assembly Language
Part III: Assembly Language
 
1. Ch_1 SL_1_Intro to Matlab.pptx
1. Ch_1 SL_1_Intro to Matlab.pptx1. Ch_1 SL_1_Intro to Matlab.pptx
1. Ch_1 SL_1_Intro to Matlab.pptx
 
7986-lect 7.pdf
7986-lect 7.pdf7986-lect 7.pdf
7986-lect 7.pdf
 
ABAP Programming Overview
ABAP Programming OverviewABAP Programming Overview
ABAP Programming Overview
 
Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02
 
Chapter 1abapprogrammingoverview-091205081953-phpapp01
Chapter 1abapprogrammingoverview-091205081953-phpapp01Chapter 1abapprogrammingoverview-091205081953-phpapp01
Chapter 1abapprogrammingoverview-091205081953-phpapp01
 
chapter-1abapprogrammingoverview-091205081953-phpapp01
chapter-1abapprogrammingoverview-091205081953-phpapp01chapter-1abapprogrammingoverview-091205081953-phpapp01
chapter-1abapprogrammingoverview-091205081953-phpapp01
 
Chapter 1 Abap Programming Overview
Chapter 1 Abap Programming OverviewChapter 1 Abap Programming Overview
Chapter 1 Abap Programming Overview
 
Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02
 
Python basics
Python basicsPython basics
Python basics
 
Chapter Eight(3)
Chapter Eight(3)Chapter Eight(3)
Chapter Eight(3)
 
Cbasic
CbasicCbasic
Cbasic
 

More from Ahmed Gamal

Graduation book - BFRP
Graduation book - BFRPGraduation book - BFRP
Graduation book - BFRPAhmed Gamal
 
hti traininig 2018
hti traininig 2018hti traininig 2018
hti traininig 2018Ahmed Gamal
 
Resource management
Resource managementResource management
Resource managementAhmed Gamal
 
Pert2 management
Pert2 managementPert2 management
Pert2 managementAhmed Gamal
 
Pert management
Pert management Pert management
Pert management Ahmed Gamal
 
Lec 2 construction management
Lec 2 construction managementLec 2 construction management
Lec 2 construction managementAhmed Gamal
 
Earned value management
Earned value managementEarned value management
Earned value managementAhmed Gamal
 
Crash management
Crash managementCrash management
Crash managementAhmed Gamal
 
Cm ch4 scheduling
Cm ch4 schedulingCm ch4 scheduling
Cm ch4 schedulingAhmed Gamal
 
1- construction management
1-  construction management1-  construction management
1- construction managementAhmed Gamal
 
تدريب 2 التجمع الخامس و نادي مدينتي
تدريب 2 التجمع الخامس و نادي مدينتيتدريب 2 التجمع الخامس و نادي مدينتي
تدريب 2 التجمع الخامس و نادي مدينتيAhmed Gamal
 
01 introduction and layout of steel (1)
01 introduction and layout of steel (1)01 introduction and layout of steel (1)
01 introduction and layout of steel (1)Ahmed Gamal
 
الامن الصناعي
الامن الصناعيالامن الصناعي
الامن الصناعيAhmed Gamal
 

More from Ahmed Gamal (20)

Graduation book - BFRP
Graduation book - BFRPGraduation book - BFRP
Graduation book - BFRP
 
hti traininig 2018
hti traininig 2018hti traininig 2018
hti traininig 2018
 
Resource management
Resource managementResource management
Resource management
 
Pert2 management
Pert2 managementPert2 management
Pert2 management
 
Pert management
Pert management Pert management
Pert management
 
Lob management
Lob managementLob management
Lob management
 
Lec 2 construction management
Lec 2 construction managementLec 2 construction management
Lec 2 construction management
 
Earned value management
Earned value managementEarned value management
Earned value management
 
Crash management
Crash managementCrash management
Crash management
 
Cm ch4 scheduling
Cm ch4 schedulingCm ch4 scheduling
Cm ch4 scheduling
 
Cash flow
Cash flowCash flow
Cash flow
 
1- construction management
1-  construction management1-  construction management
1- construction management
 
تدريب 2 التجمع الخامس و نادي مدينتي
تدريب 2 التجمع الخامس و نادي مدينتيتدريب 2 التجمع الخامس و نادي مدينتي
تدريب 2 التجمع الخامس و نادي مدينتي
 
01 introduction and layout of steel (1)
01 introduction and layout of steel (1)01 introduction and layout of steel (1)
01 introduction and layout of steel (1)
 
الامن الصناعي
الامن الصناعيالامن الصناعي
الامن الصناعي
 
7 fatigue
7  fatigue7  fatigue
7 fatigue
 
5 hardness
5  hardness5  hardness
5 hardness
 
4 static shear
4  static shear4  static shear
4 static shear
 
3 bending test
3  bending test3  bending test
3 bending test
 
2 compression
2  compression2  compression
2 compression
 

Recently uploaded

High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 

Recently uploaded (20)

DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 

CIVIL HTI Fortran 77 Series Lectures

  • 1. CIVIL HTI Fortran 77 Series Lectures Dr. A.M.K. Shaltout 2016
  • 3.
  • 4.
  • 5. Example 2.  Write a Fortran program to convert the length in feet to centimeter. (Recall that lcm=lft x 30)
  • 6.
  • 7.
  • 9.
  • 10. Usually an expression like "x**y" results in the compiler inserting code equivalent to "exp(y*log(x))".
  • 11. 𝑥 Math |x| sin x cos x tan x 𝑒 𝑥 ln x log x
  • 12. Input and Output Statements  Basic instructions:  READ – reads input from a standard input device or a specified device or file.  WRITE – writes data to a standard output device (screen) or to a specified device or file.  FORMAT – defines the input or output format.
  • 13.
  • 14. READ Statement  Format controlled READ:  Syntax: READ(dev_no, format_label) variable_list  Read a record from dev_no using format_label and assign results to variables in variable_list  Ex: READ(5,1000) A,B,C 1000 FORMAT(3F12.4)  Device numbers 1-7 are defined as standard I/O devices and 1 is the keyboard, but 5 is also commonly taken as the keyboard (used to be card reader)  Each READ reads one or more lines of data and any remaining data in a line that is read is dropped if not translated to one of the variables in the variable_list.  Variable_list can include implied DO such as: READ(5,1000)(A(I),I=1,10)
  • 15. READ Statement – cont’d  List-directed READ  Syntax: READ*, variable_list  Read enough variables from the standard input device (usually a keyboard) to satisfy variable_list – input items can be integer, real or character. – characters must be enclosed in ‘ ‘. – input items are separated by commas. – input items must agree in type with variables in variable_list. – as many records (lines) will be read as needed to fill variable_list and any not used in the current line are dropped. – each READ processes a new record (line).  Ex: READ*,A,B,K – read line and look for floating point values for A and B and an integer for K.  Some compilers support:  Syntax: READ(dev_num, *) variable_list  Behaves just like above.
  • 16. WRITE Statement  Format controlled WRITE  Syntax: WRITE(dev_no, format_label) variable_list  Write variables in variable_list to output dev_no using format specified in format statement with format_label  Ex: WRITE(6,1000) A,B,KEY 1000 FORMAT(F12.4,E14.5,I6)  Device number 6 is commonly the printer but can also be the screen (standard screen is 2)  Each WRITE produces one or more output lines as needed to write out variable_list using format statement.  Variable_list can include implied DO such as: WRITE(6,2000)(A(I),I=1,10) Output: |----+----o----+----o----+----o----+----| 1234.5678 -0.12345E+02 12
  • 17. WRITE Statement – cont’d  List directed WRITE  Syntax: PRINT*, variable_list  Write variables in variable_list to standard output device using format appropriate to variable type. Variables are separated by either spaces or commas, depending on system used.  Ex: PRINT*,‘X=‘,X,’Y=‘,Y,’N=‘,N Output: X= 4.56, Y= 15.62, N= 4
  • 18. Format Specifiers  X format code  Syntax: nX  Specifies n spaces to be included at this point  I format code  Syntax: Iw  Specifies format for an integer using a field width of w spaces. If integer value exceeds this space, output will consist of ****  F format code  Syntax: Fw.d  Specifies format for a REAL number using a field width of w spaces and printing d digits to the right of the decimal point.  A format code  Syntax: A or Aw  Specifies format for a CHARACTER using a field width equal to the number of characters, or using exactly w spaces (padded with blanks to the right if characters are less than w.
  • 19. Format Specifiers – cont’d  E format code  Syntax: Ew.d  Print value of REAL variable using “scientific notation” with a mantissa of d digits and a total field width of w.  Ex: E14.5 produces for the REAL value -1.23456789e+4:  You must leave room for sign, leading 0,decimal point, E, sign, and 2 digits for exponent (typically at least 7 spaces)  If specified width is too small, mantissa precision, d, will be reduced unless d<1 in which case *** will be output.  Using nP prefix will shift mantissa digit right by n and reduce exponent by –n. Ex; 1PE14.5 above yields: |----+----o----+----o----+----o----+----| -0.12345E+05 |----+----o----+----o----+----o----+----| -1.23456E+04
  • 20. Other FORMAT Features – cont’d  When the end of the format_specifiers in a FORMAT statement are reached before all of the variables in the variable_list have been output, the format_specifiers are re-scanned starting at the first left parenthesis, (.  Many other format specifiers are available but are not included in these notes. These include formats for Binary, Octal and Hexidecimal data, formats for Double Precision numbers (replace E with D), and formats for Complex numbers.  When formatted READ is used, any decimal point in data will override format specifier. If no decimal is supplied, format specifier will determine where decimal should be (even though it is not in input data) |----+----o----+----o----+----o----+----| Data: 123456 1.23456 READ(5,1000) A,B 1000 FORMAT(2F8.2) Result: A=1234.56, B=1.23456
  • 21. OPEN Statement  OPEN is used to make file available to READ & WRITE  Syntax: OPEN ([UNIT=]io_unit [,FILE=name])  Ex: OPEN (12,FILE=‘D:AEtest.dat’) Opens file D:AEtest.dat for sequential read&write (default) and specifies device number 12 for access.  Ex: OPEN (14,FILE=‘D:test1.dat’)