FORTRAN-SO Programming Manual
Prompt
Preface
Page
Contents
Illustrations
Chapter Programming Guidelines
Glossary
FORTRAN-SO
An Introductory Example
Chapter Introduction to Fortran
Comment Lines
Value Assignment Statement
Type Statement
Input Statements
Output Statements
Executable Statements
Summary Of FORTRAN·SO Statements
Program Termination
Nonexecutable Statements
Order of Statements
Format
Chapter Fortran Concepts
Program Units and Procedures
Fortran Program Structure
Statements and Lines
Prog RAM Statement
Program name
#Pol.1ndSign
Fortran Statement Elements
Character Set
= 8*C + D* *2/E
Constants and Variables
B52
Arithmeticoverflow Error Murphyslaw
#4567Q +#AF2CH
Where
+64101 #14010
Sl#d ...b
Sperim = 4*S Sqarea = S**2
Sqdiag = Sqrt 2*S* *2
Relational Expressions
EXP1 EXP2 operator
If Numb .GT Stop If Pname .EO. Gehrigprint 20, PNAME, AVG
EXP1 operator EXP2
OP1 NOT.OP1 True False False True
Stop
Precedence of Operators
OP1 OP2 OP1 .NEQV. OP2
Scope of Symbols
15/3 + 18/9 = 5 + 2 = 15/3 + 18/9 = 15/3 + 2 = 15/5 =
Call sub arg,arg
Notational Conventions
Call ROUT1A, 3.72
Page
Real Type Statement
Chapter Defining Variables ARRAYS, and Memory
Type Statements
Integer Type Statement
Logical Type Statement
Va,luernustueiA, Qp4
Character * len, name ,name
Len Aryd* len
Implicit Integer I-N, Logical O-l
Array Definition
Implicit REALA-B, D-H, Character C
Character TICTAC3,3 Logical ,3,3
Kinds of Array Declarators
Dimension Statement
Logical Table Integer Array Dimension ,3, ARRAY3,3,3
ARRAY3,MI00LE,THIRD
Referencing Array Elements
Dimension ,3
Properties of Arrays
Ary s ,s
Assignment Statements
ARRAY2,6 = a Arrayi + J, 3 = ARRAYM,M + N,M-N = a + SQRT8
Arithmetic Assignment Statement
= char
= exp
Logical FLAG, ,3
CHARACTER*10 NAMES4, MGR MGR = Stengel NAMES1 = Gehrig
Assign 1010 to LOOP1 Goto LOOP1
Data Statement
Assign stlTO name
R*c
Data I,J,K/10,20,301
Equivalence Statement
Data Zeros 110*0/1,J,K 110,20,301 &NAMES2 Iotti
Array List
Common Statement
Real Fpnumb
Fpnumb
Block Data Subprograms
Block Data name
Block Data Statement
ZEROS/1 0
Unconditional GO to Statement
Program Execution Controls
Transferring Program Oontrol
Computed GO to Statement
Arithmetic if Statement
Assigned GO to Statement
Assign 10TO Start Gotostart Assign 999 to Done
Done = a * *2 .GT **2
Logical if Statement
6 IF, Else IF, and Else Blocks
If Done Pause If .NOT. Done GO to Start
If exp then
Block if Statement
Else if Statement
Else if exp then
If Flag .EO then
Else Statement
END if Statement
Else if Flag .EO then Write 6,40 Fedtax
Operation of a do Loop
Loop Control Statements
Do Statement
Continue
Program Termination Statements
Continue Statement
CHARACTER*12 Pname
Pause
Pause Statement
Stop Statement
Pause BREAK12
Intrinsic and Statement Functions
Chapter Functions and Subroutines
Intrinsic Functions
Intrinsic tunc ,tunc
Intri Nsic Statement
Statement Functions
Intrinsic Sqrt Intrinsic EXP, LOG, LOG10
156.8
External Procedures
Function Statement
Do 100 K = 1
Subroutines
Function Subprogram Limitations
Total = Total + Arrayk 100CONTINUE Return END
Program CALL.. Subroutine
Subroutine Statement
Retu RN Statement
SU Brouti N E subdum,dum
Save lebl ,Iebl
Save Statement
External Statement
External proe ,proe
Arguments And Common Blocks Revisited
Call Statement
Dummy And Actual Arguments
Common Blocks
Association Of Arguments
Agreement Of Argument Lengths
FX, Y
Function FA,B,C
Page
Record Properties
Chapter INPUT/OUTPUT
Records, Files, And Units
File Properties
File Position
File Existence
File Name
External And Internal Files
File Access
Unit Properties
Unit Specifier
File-Handling Statements
Open Statement
1.2 1/0 Status Specifier
File Name Specifier
Error Specifier
File Status Specifier
Access = SEQUENTIAL,FORM = Formatted
Access Method Specifier
Access = Sequential
Formatting Specifier
Form = FORMATTED,RECL=80
Open 3, FILE=CARDS,STATUS=NEW,ACCESS=DIREcr
Blank Specifier
Blank = blnk
Close close-list
Close Statement
Opening a Connected Unit
Close 3, IOSTAT= ERRFLG, ERR=
File Disposition Specifier
Backspace Statement
Rewi N D Statement
Backspace
Read Statement
Data-Transfer 1/0 Statements
Endfile Statement
Endfile arg-list
Read 2 PNAME, AB, Hits
Control Information List
FMT =f
Read 25, Pnam E, AS, Hits
Read 2,25 PNAME, AS, Hits
Assign 25 to Infmt Read 2,INFMT Pname
Implied-DO List
Input List
Write ctl-list out-list
Unformatted Data Transfer
Formatted And Unformatted Data Transfer
Print Statement
Print 120, PNAME, AVG
Formatted Data Transfer
Printing Formatted Records
Format Statement
Stl Format flist
Is Ff
Y1 Y2 Y3
OY1 Y2
± Y1 Y2···Ye
Either a sjgu ora letter indicatingthebas¢
Z5editdesctiptor
Write 7,100
Write 7,100 Itstno Format Thisis the Test NUMBER,2X
Format 1X, A12, 4X, F4.3
Read 2,50 INTNUM, Fpnum
DollytSigfjl$ijitrrrg·
Paint 25, Pname
List·Directed Formatting
List-Directed Input
Format A20, $
List-Directed Output
Page
Program Development
Problem Definition
Chapter Programming Guidelines
Program Documentation
Level One
Refining The Problem Definition
Level Two
Level Three
Otherwise Print Employee Data and Update Totals Else
Final Coding
Write unit, 60 EMP, HRS, GRPAY, Netpay Format flist
GO to Statement
Fortran Coding
Functions And Subroutines
Crossing Unit Lines
= 2217*r* *2
References
Reminders
PI =
Programming Guidelines
Statement Sequence
Appendix a FORTRAN-80 Statement Summary
Statement Summary
ERR = stl
Status =
Iostat =
Stname
Stat
Continue execution provides
END
FORTRAN-80
FORTRAN-80
FORTRAN-SO
Iostat =
Return
Rewind Statement
Subroutine Statement Category Executable Text Reference .2.2
Appendix B Intrinsic Functions
Intrinsic Function Summary
Category Function Arguments
Int-12.8 =
Page
Hollerith Constant
Appendix C Hollerith Data Type
Hollerith As a Data Type
Hollerith Constants In Data Statements
Hollerith Format Specification
AEditing Of Hollerith Data
Standard Extensions To 1977 Subset
Appendix D Extensions to Ansi Fortran
Nonstandard Extensions To 1977 Fortran
More Specific Semantics Than 1977 Fortran
Differences From 1966 Fortran
FORTRAN-80
Page
Ascii Codes
Ascii Codes
Page
Processor Limitations On Language
Appendix F 8080/8085 Processor Dependencies
Compiler Extensions
Call INPUT1, TEST1 Call OUTPUT2
Where the $must be in column
Call Input port, var Call Output port, exp
$REENTRANT
Including Source Files
Default Data Lengths
Interpretation of do Statements
$0077
Unit n = device
F1MYPROG UNIT4 LP, Unit 5 Fosysin
Index
Block Data Function Subroutine
Index
Page
Page
Page
Inter
WED Like Your Comments
Postage will be paid by Addressee
Request for Readerscomments
111111
Page
Inter