L0_PUFFT.pdf

(1515 KB) Pobierz
PUFPl UiER'S GUIDE
Hlchael~~.
Shapiro
Purdue University Computing Center
Februa'TY 1971
.
(5/74)
LO PUFFT - I
'Jiilne of Contents
Page
3
3
Introduction
Program Size
Sequencing Rules
Input/Output
System Functions and
Sub~~tlnis
3
4
4
Special Features of PUFFT
A. Subscript
,G6ecklng
B. Addr ... Che'''!'',r
C.
Resident SubprogT,am Library
D.
Hollerith Constants
E. ANSI Stondord Fortron Cooopot!blllty
6
6
-
6
6
7
7
7
Compi
latlon
.nd
execution Output
Control C.rds
.
,-,
A.
T1>e
"Job
Card
B.
"rt4
'.
PUFFlr Card
I •• HooO Opt ion
~.'
HAP
Opt!o,~
:,
3.
UST Opt
!o ..•
.
...
.
OUHP
op
t'i:on~·
5. TABLE OpHon
6. NOCHK Option
C.
Th.
$OPTIONS Card
O. The $LIST ond $UNLIST Cards
E. Other $-Control Cards
Deck Structure
8
8
8
8
9
9
9
9
10
10
10
10
10
PUFFT - 2
INTRODUCTION
PUFFT
is "
very fast
translator for
·the
FORTRAN IV language
descri~! "
,
the IBM document
C28-6390,
Version l3 FORTRAN IV language. It
is •
''One-pass'
c.ompi Ie-end-go" system
'whIch
reads. FORTRAN IV program and compiles
it
into
m.chine language written directly into the IBH 7094 computer memory.
The technique used in PUFFT necessitates introducing"
few
minor
diffe~
ences from the IBM FORTRAN IV. Host of the differences should not concern the
average user at all. The most
import~nt
'
,concerns
the ordering of
certain statements. For example, in progr•
.
,;
VALENCE
statements,
.11 the DIMENSION stat
'
COMMON
statements.
which in turn must .ppe.
·
~
d;lff
.
)
',
DIMENSION, COMMON. and EQUI-
.t
.
ppear before all the
re';.11
the EQUIVALENCE state-
ments. The section of this .. nual on sequen" ing rules contains ful' deuils.
c
PUFFT detects any violation of the sequencing rules and prints an error message
on the program listing.
,
PUFFT accepts only FORTRAN IV source decks.
binary decks.
PROGRAM SIZE
It neither produces nor accepts
PUFFT is designed to handle short to medium length programs. It is diffi-
cult to give e)(act
size~,Jimit.tions,
but. good rule of thumb is that
"
PUFFT jobs
should contain no more than about 1500 source language statements and
.~hPuld
use
no more than 3000 words of storage for arrays. If a program exceeds the storage
limitation of PUFFT, a diagnostic message is written, and execution is deleted.
SEQUENCING RULES
A.
The follOWing statements, if they appear in e
progra~.
e)(ecuteble statements and in the order indicated:
I.
Type
.nd
OIMENS ION.
~st
appear before any
Type
includes COMPLEX, DOUBLE PRECISION, INTEGER, REAL,
and LOGICAL. There is no ordering requirement among the
tj~
and DIMENSION statements.
2.
COHHON.
Labelled and blank COHMON may be intenmixed according to
FORTRAN IV rules.
3.
4.
EQUIVALENCE.
DATA.
This refers to the DATA state.ont as defined in the
FORTRAN IV
IIOn ...
I.'
5.
Arithmetic statement function definitions.
PUFFT - 3
B.
c.
The statements ENTRY
~~!J
~EXT!'RNAl,
and
FORMAT .re included among
the ulbutdl
i'
titlZ
tnts
for
'
the purposes of these sequencing ru1e$.•
i
Only one of the statements FUNCTION, SUBROUTINE. and BLOCK DATA
~y
appear in anyone subprogr... Such a statement must be the first state-
ment in the
subprogr~.
The statement END must be the last statement of each subprogram. It is
translated
.5
a RETURN in
subrout
~
~e5
or funetions and
.5 •
STOP in the
mIIln program.
D.
E.
A BLOCK DATA
subpnllP.~
enters data into a block of labelled COMMON
"
must appear ahead
.~~her subp~r.m
in which that block of labelled
COMMON
is
declared.
</.
0'
F.
A NAMELIST
statement.
if
it
is
used, must appear among the executable
statements of • program, and must precede any use of the
MIme
being deH.ned.:-
I NPIIT/OIITPIIT
PUFFT
uses
the standard tape assignments of Version 13 FORTRAN IV. log i'ca"
unit 5 is the system input tape and unit 6 is the system output tape.
No
other
uni
ts
are avat lab1e.
"
JtEAD n, l and PRINT n, l use the system input and output units and are the
,.
preferred statement forms,:
READ n, L is equivalent to READ(5,n)L
PRINT n, L is equivalent to
WRITE(6
~
n)L
PUFFT accepts quote marks around Hollerith fields in FORHAT statements.
During ccwnpi1ation the field is translated into a standard Hollerith field.
For
exarnp Ie:
'BCD DATA' is translated to
:
008HBCD DATA
The quote mark appears on most keypunches as either a quote mark (') or at
sign
«(ii).
It
is
the 4-8 punch combination. Quote Nrks ar
:-
..-not permitted in
fonnats read in at execution
tj~
or created with DATA stat... nts.
SYSTEM FUNCTIONS AND SUBROUTINES
The PUFFT sy· t_ includes all the standard FORTRAN IV subroutines and func-
s
tions mentioned in Chapter 5 of the Version 13 FORTRAN IV manUlI, except ERF,
GAMMA and AlGAMA. PUFFT includes the built-in functions of figure 8 of that
·
manual. the mathematical subroutines of figure 9 of that
~nual,
and subroutines
such as DUMP and PDUMP mentioned elsewhere in that chapter. DUMP and PDUMP in
particular are especia1.y useful for
p~r
.. debugging.
PUFFT - 4
PUFFT contains the three Mechlne
d..,~d.nt
functions AND. OR. and CO"PL.
as well as corresponding Integer functions
tAND
:
~
IOR~ nd
tCOKPL, documented
in AppendIx H of the IBM .. nual.
Two subroutines provIde date and time infoMmetion:
CALL OATE(A)
returns to A the current date
(month~
dey, year) as a BCD word:
HHOOVY
CALL CLOCK (A)
'returns
to A the current time (hours, minutes, seconds) as a BCD word:
"HIIII55
For exaMple, December
II,
1970 It 7:46:24
pm
is:
121170
194624
,
Note that 24 hour time Is used.
Another PUFFT syste. function is RECDlS, a random nunber generator. It is
designed to supply
pseudo-rand~
floating point numbers with a rectangular distri-
bution in the interval (0.1). Successive numbers in the sequence are supplied
as the values of the function RECDlS(X). X is • dummy variable. and any variable
name may be used in Its p'ace. Thus the state.ent A • RECDlS(X) places the next
random nuMber in A. The statement sequence:
.00
5 I-I,
1000
5 A{I) -
RECOI5(X)
generates a table of 1000 ranOo. numbers
in
the array A.
The random numbers are generated by multiplying a number called RANDO" by
the constant 5**15 (30,517.578,125). The result is. new value of RANDOM which
is then used
-.
;-
the multiplier In generating the next random number. The system
initially sets RANDOM to the same value as the multiplying constant (5**15), but
the user may select a different value of the initial .ultiplier by the statement:
CALL 5TORNH(integer)
where "integer"
is
any positive odd integer less than 2**35, and gruter than one.
The
current value of the
~ltipl1er
RANDOM .. y be retrieved by the stateMent:
CALL GETNM(L)
which p'aces into L the value of
RAN~M
that will next be used as a multiplier.
PUFFT - 5
Zgłoś jeśli naruszono regulamin