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