OCEANOGRAPHY OREGON STATE UNIVERSITY 0735 of

advertisement
22-
of
0735
n;17 5-i
OCEANOGRAPHY
GEOPHYSICAL LIBRARY
SUBROUTINES (*GLIB)
by
Ken Keeling
Michael Gemperle
and
Gerald Connard
Office of Naval Research
Contract N00014-67-A-0369-0007
Project NR 083-102
OREGON STATE UNIVERSITY
Reproduction In whole or In part Is
permitted for any purpose of the United
States Government
November 1975
Reference 7540
Unclassified
TY CLASSIFICATION OF THIS PAGE (When Da:aEntered)
READ INSTRUCTIONS
BEFORE COMPLETING FORM
REPORT DOCUMENTATION PAGE
2. GOVT ACCESSION NO.
1. REPORT NUMBER
3.
RECIPIENT'S CATALOG NUMBER
Reference # 75-20
4.
5. TYPE OF REPORT a P&RIOD CV` ER6O
TITLE (end SobtUie)
GEOPHYSICAL LIBRARY SUBROUTINES
Technical
(* GLIB)
6. PERFORMING ORG. REPORT NUMBER
7.
S. CONTRACT OR GRANT NUMBER(a)
AUTHOR(s)
Ken Keeling
Michael Gemperle and
Gerald Connard
NOOO14-67-A-0369-0007
0. PROGRAM ELEMENT. PROJECT, TASK
AREA S WORK UNIT NUMBERS
9. PERFORMING ORGANIZATION NAME AND ADDRESS
School of Oceanography
Oregon State University
Corvallis, Oregon 97331
NR 083-102
11. CONTROLLING OFFICE NAME AND ADDRESS
12. REPORT DATE
Office of Naval Research
November 1975
Ocean Science & Technology Division
13. NUMBER OF PAGES
Arlington, Virginia 22217
44
14. MONITORING AGENCY NAME & ADDRESS(if different from Controlling Office)
15. SECURITY CLASS. (of this report)
Unclassified
IS.. DECLASSIFICATION DOWNGRADING
SCHEDULE
16. DISTRIBUTION STATEMENT (of this Report)
Approved for public release; distribution unlimited
17. DISTRIBUTION STATEMENT (of the abstract entered in Block 20, if different from Report)
I6. SUPPLEMENTARY NOTES
19. KEY WORDS (Continue on reveres aide if necesaary and identify by block number)
Geophysical Computer Subroutines
20. ABSTRACT (Continue on raveree aide it necessary and Identify by block number)
This report documents the various subroutines in general use by the Oregon
State University Geophysics group.
Included are subroutines for plotting
and date and time conversion and arithmetic functio ns and control
functions.
DD
I JANM73
1473
EDITION OF I NOV 65 IS OBSOLETE
SAN 0102-014-6601 1
Unclassified
SECURITY CLASSIFICATION OF THIS PAGE (When Date Entered)
School of Oceanography
John V. Byrne
Oregon State University
Corvallis, Oregon 97331
Dean
GEOPHYSICAL LIBRARY SUBROUTINES
(*GLIB)
by
Ken Keeling
Michael Gemperle
and
Gerald Connard
Office of Naval Research
International Decade of
Contract N00014-67-A-0369-0007
Oceanography
NAZCA Plate Program
Project NR 083-102
Contract
GX28675
Approved for public release;
distribution unlimited
NOVEMBER, 1975
Reference Number 75-20
GTR 751101
TABLE OF CONTENTS
I.
Introduction
II.
Characteristics Common throughout Library
III.
Description of Individual Subroutines
A.
Plotting Subroutines
PLOTINT
1.
PLOT
2.
PLOTSYMB
3.
4.
ROTATEXY
5.
MERCMAP
6.
MERIDPTS
B.
Date and Time Subroutines
1.
LEAPYEAR
2.
NGDCTIME
3.
4.
5.
6.
7.
C.
Arithmetic
1.
AINT
2.
ATAN2
3.
D.
9
9
10
10
11
11
Functions
AMOD
11
12
12
Control Functions
1.
2.
3.
4.
5.
6.
/.
E.
ITIME
IDTG
ADTG
ARMYTIME
IZB and ZB
8
FWSP
I STATUS
RELEASE
RESET
MI
ZAP
SBJP
13
13
14
14
14
15
Misc Subroutines
1.
2.
SPEED
GETMAiAB
15
15
IV.
Acknowledgments
16
V.
References
17
VI.
Appendix
A.
B.
Source Program Listings
Mathews Table
15
GEOPHYSICAL LIBRARY SUBROUTINES
I.
Introduction
This report describes the various subroutines and functions in general
use by either the Geophysics Group or the present Geophysics Data Reduction
and Plotting Package (Gemperle, et al., 1976) that are not available on the
OS-3 Fortran Library (OS-3 is the operating system on the Control Data
Corporation 3300 computer at Oregon State University).
These subroutines
are available to users of the CDC-3300 on the saved file *GLIB
These subroutines may be classified into five general categories.
1.
Plotting - general purpose plotter driver subroutines and mercator map
projection subroutines.
2.
Date and Time - general purpose date and time conversion from the conventional system of year, month, day and hour, minute, second
(or tenths of minutes) to integer tenths of minutes since
the beginning of the year and the inverses of the above.
These subroutines are generally used in computations involving time differences, time output and plotting.
Various
formats are available.
3.
Arithmetic Functions - standard Fortran Library functions not available
on the OS-3 Fortran Library.
4.
Control Functions - file and operating system control functions peculiar
to the OS-3 operating system.
.5.
Misc Subroutines - subroutines used by more than one geophysics program.
These subroutines perform specific geophysically oriented
functions.
2
II.
Characteristics Common throughout the Library
This library was written to run on a CDC 3300 computer operating under
the Oregon State Open Shop Operating System (OS-3).
As such, several of the
subroutines are only applicable to this system, particularly those within
the Control Function Group.
Because OS-3 is a time sharing system, these subroutines are usually
called by programs which are normally run in an interactive mode on a teletype terminal in our offices.
These subroutines appear on the library because they are of general
enough purpose under OS-3 to be used by more than one program.
Most are
written in CDC assembly language (COMPASS), though some were written in OS-3
Fortran IV when it was applicable to the subroutine.
There are a few conventions made in the documentation of this library.
The "Type" of the parameters may be integer (I) or floating point (F.P.) for
the passing of values or single (A4) or double (A8) word variables used to
pass Binary Coded Decimal (BCD) information.
All function names appear in
the parameter table as the output parameter for the function.
Users of these subroutines and functions should also refer to the CDC
and OSU publications listed in the references relating to the OS-3 operating system, and FORTRAN and COI1PASS languages on the OSU CDC-3300 computer.
3
Description of Individual Subroutines
III.
A.
Plotting Subroutines
The first four subroutines are the plotter drivers and are used to
convert the pen movements in inches specified by the calling program
calls into actual pen movement codes used by the plotter and for initialization and bookkeeping.
There are no limit checks made on any of the plotter
driver subroutine parameters in order to speed up execution, therefore, care
should be used in the calling programs.
The last two subroutines are used
to generate mercator maps on a 30-inch incremental plotter.
Source listings for the first four subroutines are not included in the
Appendix because of their length.
1.
PLOTINT (X, Y, LUN)
PLOTINT is used to initialize the plotter subroutines and define
the location of the origin of the axis.
The parameters X and Y are with
respect to wherever the pen is left by the operator and are assumed to be
within six inches of the left edge of the plotter paper.
The X coordinate
is across the paper and the Y coordinate is in the long dimension of the
paper.
The normal call is:
CALL PLOTINT (-6., 6., 10).
This will cause
the origin to be against the left edge of the plotter paper and at least
six inches away from the last plot.
This is normally followed by a CALL
PLOT (1.0, 0., -3) to redefine the origin one inch from the left edge of
the plotter paper.
The logical unit, e.g. LUN 10, should have already
been defined as a plotter with an OS-3 Control Mode "EQUIP'' statement or
Fortran call to the EQUIP subroutine (see Skinner, 1970).
4
Parameter.
Description
Type
X
F.P.
The location of the X-coordinate of the axis
origin in inches relative to where the pen
was left by the operator.
Y
F.P.
The location of the Y-coordinate of the axis
origin in inches relative to where the pen
was left by the operator.
LUN
Number of the Logical Unit to which the pen
movement codes generated by the plotter driver
are sent
I
2.
PLOT (X, Y, IPEN)
PLOT is used to move the pen to a new X, Y in inches with the pen
either up or down.
If the parameter 'IPEN' is negative, then a new origin is
defined with respect to the last one defined by either PLOTINT or PLOT.
Redefinition of the origin also causes any accumulated pen movements to be
buffered to the plotter file.
This means that the last call in a plotting
program should be a call to PLOT with IPEN negative to insure that the last
record is sent to the plotter.
Parameter-
Type
Description
X
F.P.
The new X-coordinate in inches
Y
F.P.
The new Y-coordinate in inches
IPEN
I
IPEN = 2 pen down prior to movinq
IPEN = 3 pen up prior to moving
IPEN = -3 last call to the plotter subroutines
for this plot. This defines a new origin
for subsequent plotting.
This is the basic pen movement subroutine.
The aigorithim for generating
pen movement codes was taken from CACM Algorithim 162 (Stockton, 1963).
5
3.
PLOTSYMB (X, Y, H, ARRAY, THETA, N)
PLOTSYMB is used to move the pen to the location of a centered
symbol and draw that symbol or to move the pen to the lower left corner of
a label and to write that label.
Figure 1 gives the available centered
symbols and the integer associated with each.
Tyke
Description
F.P.
The new X-coordinate
in inches
F.P.
The new Y-coordinate
in inches
H
F.P.
Height of character or centered symbol to be
drawn in inches
ARRAY
or ISYM
An
or I
Real or INTEGER variable or ARRAY containing n BCD
characters or an integer specifying the centered
symbol to be drawn (see Fig.l)
THETA
F.P.
The angle measured in degrees from the X-axis in a
counter-clockwise direction at which the centered
symbol or label is to be written
Parameter
X
N
N > 0 then N characters will be drawn, pen is lifted
prior to moving to X, Y
N = -1 the pen is lifted prior to moving to draw a
centered symbol
N = -2 the pen is dropped prior to moving to draw a
centered symbol
I
L7 O A
0
7
+
XOP
I
2
3
4
5
6
8
9
10
11
12
13
Figure
1
PLOTSYMB Centered Symbols
14
6
ROTATEXY
4.
ROTATEXY is used to rotate the axis of the plot 90 degrees counterclockwise resulting in the X-axis becoming parallel to the long dimension
of the plotter paper.
A call to this subroutine is irreversible and can
be made only once during the running of a program.
After a call to ROTATEXY
a call to PLOTINT with the parameters (0., -30., LUN) should be made to
reset the coordinate axis to the right edge of the plotter paper.
If used,
this subroutine should be the first plotter subroutine called or should only
be made when the pen is at an origin.
There are no parameters for this
sub-
routine.
MERCMAP
5.
MERCMAP is a general purpose subroutine used to generate an
annotated Mercator grid on the plotter.
It interactively asks the user
for information concerning the latitude and longitude limits, scale in
inches per degree of longitude and grid spacing in minutes as well as the
data file name and plot label (Example 1, Page 7).
printed by the subroutine MERCMAP.
Underlined characters are
MERCMAP will attempt to fit the grid
on the plotter paper with the longitude lines parallel to the length of the
paper.
If the grid will not fit, the program will rotate the grid 90 degrees
and try again.
If the minimum dimension exceeds 26 inches, the program will
ask for the map parameters again, enabling the user to split the map grid into
sections or change the scale.
MERCMAP calls the function MERIDPTS.
Subroutine MERCMAP contains the following declarative statements
for the return of input values back to the calling program:
REAL
MINPTS, MAXPTS, LATINCH, LONGINCH, MAPSCALE
REAL
MSD60, MINLAT, MAXLAT, MINLONG, MAXLONG
COMMON
MINPTS, MAXPTS, LATINCH, LONGINCH, MAPSCALE
COMMON
MSD60, MINLAT, MAXL ;T, MINLONG, MAXLONG
7
Type.
Description
MINPTS
F.P.
MERIDPTS (MINLAT)
MAXPTS
F.P.
MERIDPTS (MAXLAT)
LATINCH
F.P.
MAPSCALE* (MAXPTS-MINPTS)/60.
LONGINCH
F.P.
MAPSCALE* (MAXLONG-MINLONG)
MAPSCALE
F.P.
Inches per degree longitude
MSD60
F.P.
MAPSCALE/60.
MINLAT
F.P.
Decimal degrees for south edge of map
MAXLAT
F.P.
Decimal degrees for north edge of map
MINLONG
F.P.
Decimal degrees for west edge of map (0-360)
MAXLONG
F.P..
Decimal degrees for east edge of map (0-360)
Parameter
LABEL PLOT FOR?
PETERSON
INPUT FILE NAME
Y69FEB
GIVE THE FOLLOWING:
SCALE GRID
ELONG
WLONG
SLAT
3DOOM -4DOOM -90DOOM -BODOOM 4.000 60M
NLAT
DO YOU WANT A RAPIDOGRAPH PEN - YES OR NO
NO
Example 1
MERCMAP OUTPUT
6.
MERIDPTS (ALAT)
MERIDPTS is a real function which returns the value of the merid-
ional parts equivalent to the latitude ALAT according to the Clark spheroid of
1866 from the formula (Bowditch, 1958, p.
1186):
8
L
M = a loge 10 log tan (45° + 2) -
6
4
a(e2sinL + 3 sin3L + 5 sin 5L)
where
M
is the number of meridional parts between the equator and the given
latitude,
a
is the equatorial radius of the earth in minutes of arc,
L
is the latitude in radians,
f
is the flattening of the earth, and
e
is the ellipticity (e =
2f-f2 ).
MERIDPTS is used by the mercator map plotting programs (Gemperle, et.al., 11176)
to determine the location of data points to be plotted and by MERCMAP for drawing
mercator grid.
Parameter
MERIDPTS must be declared a REAL function in the calling program.
Type
Description
ALAT
F.P.
Latitude in decimal degrees
MERIDPTS
F.P.
OUTPUT - equivalent to M above
B.
Date and Time Subroutines
The first five of these date and time subroutines comprise a package
for the conversion of date and time to integer tenths of minutes from the
beginning of the year and back in various
formats.
The sixth gets the current
in
time from the computer in A8 Format and the seventh zeros the blanks
either
A4 or A8 Format BCD variables.
1.
LEAPYEAR (IYR)
LEAPYEAR initializes a month table to a non-leapyear and then
checks the parameter IYR (a two digit year in the twentieth century) to see
if it is a leapyear and, if so, modifies
year.
the month table to reflect the leap-
The month table MTABLE is in LABELED COMMON for use by the rest of
9
the date and time subroutines in this package.
The starting year IYR
modified to become a four digit year is also saved in the same LABELED
COMMON.
This
subroutines
should be the first subroutine called when using these
to initialize MTABLE.
Parameter
Type
IYR
Integer year (two digit)
I
MTABLE
I
ISYEAR
I
2.
Description
OUTPUT - Array dimensioned (12) in LABELED COMMON
which contains the Julian day number of the last
day of the preceeding month
OUTPUT - Integer starting year (4 digit) follows
MTABLE in the LABELED COMMON
NGDCTIME (YRMODAY, HRMN10)
The function NGDCTIME returns the integer tenths of minutes since
the first of the year (ISYEAR).
This function requires that the month
table MTABLE has been initialized by a call to LEAPYEAR.
A fatal error
message is written if the parameters refer to a time later than February 28
of the year following ISYEAR initialized by LEAPYEAR.
DTe
Parameter
Description
YRMODAY
I
Six digit year, month and day
HRMN10
I
Five digit hour, minute and tenths of minutes
NGDCTIME
I
3.
OUTPUT - integer tenths of minutes since the first
of the year specified by LEAPYEAR (ISYEAR)
ITIME (YRMODAY, HRMNSC)
This function is exactly the same as NGDCTIME except that the
second parameter contains seconds instead of tenths of minutes.
returned is still tenths of minutes since the first of the year.
The value
This
initialized by
function also requires that the month table MTABLE has been
a call to LEAPYEAR.
A fatal error message is written if the parameters
10
refer to a time later than February 28 of the year following ISYEAR initialized by LEAPYEAR.
Tyke
Parameter
Description
YRMODAY
I
Six digit integer year, month and day
HRMNSC
I
Six digit integer hour, minute and second
ITIME
I
4.
OUTPUT - integer tenths of minutes since the
first of the year specified by LEAPYEAR (ISYEAR)
IDTG (IYR, ITIME, YRMODAY, HRMN10)
This subroutine converts the two digit year (IYR) and time (ITIME)
since the beginning of the year in tenths of minutes back to year, month,
day (YRMODAY) and hour, minute and tenths of minutes (HRMN10).
The para-
meter ITIME is usually the output from the function NGDCTIME or ITIME.
Type
Parameter
Description
IYR
I
Integer year (two digit)
ITIME
I
Integer tenths of minutes since the beginning of
the year (output from ITIME or NGDCTIME)
YRMODA
I
HRMN10
I
5.
Six digit integer year, month and day
Five digit integer hour, minute and tenths of
minutes
ADTG (YR, ITIME, YRMODAY, HRMN10)
This subroutine is the same as IDTG except that the output is
in BCD; useful, for example, for annotating plots.
The output is BCD with
leading zeros inseeted by the function ZB (see following).
Parameter
YR
ITIME
Type
Description
I
Integer year (two digit)
I
Integer tenths of minutes since the beginning
of the year (output from ITIME or NGDCTIME)
YRMODAY
A6
Six character year, month and day in BCD
HRMN10
A5
Five character hour, minute and tenths of
minutes in BDC
11
6.
ARMYTIME (X)
The subroutine ARMYTIME returns the time of day from the CDC 3300
clock in the real variable parameter "X" in BCD.
where b is
The format is bbHHMMbb
a blank, H is an hour digit and M is a minute digit.
Parameter
Type
X
A8
Description
The time of day between 0000 and 2400 is returned
in BCD
7.
IZB (I) or ZB (A)
This subroutine with entry points for both a real BCD argument or
an integer BCD argument, zeros the blanks of the argument.
For example, it
is used to change blanks to zeros in date and time BCD variables.
Type
Description
I
A4
Integer BCD argument for the integer function IZB
A
A8
Real BCD argument for the real function ZB
IZB
A4
OUTPUT - blanks are zeroed
ZB
A8
OUTPUT - blanks are zeroed
Parameter
C.
Arithmetic Functions
These three arithmetic functions are standard Fortran Library functions
but are not included on the OS-3 Fortran Library.
We have, therefore,
implemented them for the geophysics library.
1.
AINT (X)
AINT returns the integer portion of a floating point number.
is equivalent to:
It
AINT (X) = FLOAT ( IFIX (X)) (McCracken, 1965).
Parameter
Type
Description
X
F.P.
The real argument
F.P.
OUTPUT - the sign times the largest integer less
than or equal to the absolute value of X
AINT
12
ATAN2 (Y, X)
2.
ATAN2 computes the value of the arctangent of Y/X returning a value
between -PI
and +PI.
ATAN function.
It simply extends the range of the single parametered
The OS-3 Fortran Library function ATAN (CDC, 1965)
to compute the arctangent in the range -Tr/2 to +Tr/2.
is used
ATAN2 determines the
proper quadrant and modifies the angles accordingly (IBM, 1968).
Parameter
Type
Description
Y
F.P.
The ordinate
X
F.P.
The abscissa
ATAN2
F.P.
OUTPUT - Arctangent
3.
(Y/X) between -PI and +PI
AMOD (X, Y)
AMOD returns the value of X modulus Y for two real arguments.
This is equivalent to AMOD
(X, Y)=X - AINT (X/Y)*Y.
This is
a real valued,
real parameter version of the MOD function (IBM, 1968).
Tie
Description
X
F.P.
The first parameter
Y
F.P.,
The second parameter
F.P.
Output -
Parameter
AMOD
D.
to X-AINT (X/Y)*Y
Control Functions
These functions interact
to it.
equivalent
They
with the
OS-3 operating system and are peculiar
do succn things as UNEQUIP files, call the operating system, and
zero core memory (also see
Skinner, 1970).
13
1.
FWSP (LUN)
The subroutine FWSP causes the present position of the specified
LUN to advance one physical record.
It is only legal when the LUN is EQUIPPED
to an input device.
Parameter
Type
LUN
I
2.
Description
Logical Unit Number of the input device
to be forward spaced one physical record
ISTATUS (LUN)
This integer function returns the Logical Unit Number status to
the calling program.
Parameter
pe
LUN
I
ISTATUS
I
Description
Logical Unit Number to which the returned status
applies
Bits are returned as defined below
The upper three octal digits contain LUN status as follow:
BITS
40000000
20000000
10000000
04000000
02000000
01000000
00400000
00200000
00100000
STATUS
File protected
Load point
End of data
End of file
Destructive read
Binary record
Abnormal/Unavailable
Seek error
Saved file
The lower four bits contain the hardware type as follow:
0000
Unit not equipped
0001
File
0010
Line printer
Card punch
Card reader
Mag tape
Teletype
Plotter
0011
0100
0101
0110
0111
1001
Null
TV
1010
Random access file
1011
Task
1000
14
3.
RELEASE (LUN)
RELEASE deletes all of the data associated with the Logical Unit
Number (LUN).
The Logical Unit (LUN) should be equipped to a file or an
output device such as a card punch, line printer or plotter.
This function
is useful for killing the data going to the plotter or line printer prior
to unequipping the LUN.
Parameter
Description
Type
LUN
Logical Unit Number of the file or output
device from which the data is to be released
I
4.
RESET
RESET does an OS-3 Control Mode "UNEQUIP" to all logical units
between 0 and 49 inclusive.
It is often used by programs with internal calls
to the EQUIP and UNEQUIP subroutines.
There are no
parameters for this
subroutine.
5.
MI
MI stores the address of the last Fortran call to MI in location
138 enabling a user to resume his program at the point of the last call to
MI by entering OS-3 Control Mode and typing "MI".
It is often used by call-
ing programs to recover from normally fatal errors in the typing of data file
names.
There are no parameters to this subroutine.
6.
ZAP (IPAGE)
This subroutine zeros a page (2048 words) of core on the CDC 3300
running under the OS-3 operating system.
There are sixteen pages of core
(32,768 words) normally available to a user running Fortran, numbered 0-15.
Parameter
IPAGE
Type
I
Description
The page to be zeroed normally 0-15
15
7.
SBJP
SBJP returns the user to OS-3 control mode, effectively terminating the execution of the job.
It is equivalent to "CALL EXIT" except that
the "END OF FORTRAN EXECUTION" message is not sent to the standard output
device.
There are no parameters and the user is left in OS-3 Control Mode.
This subroutine is often used to abort the users job on a fatal error.
E.
Misc Subroutines
These subroutines preform a specific function for geophysics programs.
The first converts the revolutions of the R/V YAQUINA's engines to speed in
knots and the second accesses the Mathews table
(*MATAB) of corrections for
the velocity of sound in water.
1.
SPEED (ISREV, IPREV, NDATE, NTIME)
This subroutine computes the speed in knots of the R/V YAQUINA
given the starboard and port engine revolutions.
meters are used for error messages.
The date and time para-
A new speed function will be generated
for the R/V WECOMA in early 1976.
2
Description
ISREV
I
Starboard engine revolutions
IPREV
I
Port engine revolutions
NDATE
I
Integer date for output with error messages
NTIME
I
Integer time for output with error messages
Parameter
FP.
SPEED
2.
Output
-
speed returned between 0.0 and 10.3 knots
GETMATAB (MZ, ITAB(2), IEND)
GETMATAB reads the Mathews zone table (Bialec, 1966) for the area
"MZ" from the Random Access File (RAF)
"*MATAB", and puts it in the integer
16
array "ITAB".
If the area "MZ" is not on the RAF, "*MATAB", then an error
message is written and the user is aborted.
Presently Mathews zones 23-25
and 41-45 are included on the saved public random access file "*MATAB".
The table *MATAB contains corrections to the velocity of sound assuming an
initial velocity of 1500 meters per second (See appendix B).
A sample
program (ZORK) for reducing fathoms to corrected meters is included on page 43.
Parameter
T
eL
Description
The Mathews zone to be read from the RAF
MZ
I
ITAB
I
OUTPUT - The array (dimensioned (60)) to return
the Mathews zone table
IEND
I
OUTPUT - The integer length of the mathews zone
table "MZ"
IV.
Acknowledgments
This work was supported by the Office of Naval
Research through
contract N00014-67-A-0369-0007 under project NR 083-102, the National
Science Foundation International Decade of Oceanography NAZCA Plate Program
Contract G)(28675, and the OSU School of Oceanography Industrial Cooperative
Program.
17
V.
References
Bialek, Eugene L., 1966, Handbook of Oceanographic Tables, U.S. Naval
Oceanographic Office, Special Pub. 68.
Bowditch, Nathaniel, 1958, American Practical Navigator, U.S. Navy Hydrographic Office Pub. No. 9, 1524 p.
Control Data Corporation, 1965, Computer Systems Library Routines, Control
Data Corporation Pub. No. 60058100, 33p.
Control Data Corporation, 1967,
Compatible Compass, Control Data Corpor-
ation Pub. No. 60174000, A, 62 p.
Control Data Corporation, 1969, FORTRAN Reference Manual, Control Data
Corporation Pub. No. 60057600, Rev. B, 116 p.
Gemperle, Michael, G. Connard and K. Keeling, 1976 (in preparation), Processing & Display of Marine Geophysical Data, Oregon State University
School of Oceanography.
International
Business Machines, 1968, IBM System/360 Fortran IV Library
Subprograms, Form C28-6596-4, 66 p.
McCracken, Daniel D., 1965, A Guide to Fortran IV Programming, John Wiley
& Sons, Inc., 151 p.
Massie, Water
W.
FORTRAN REFERENCE MANUAL.
1973.
Computer Center Pub.
Skinner, David.
1970.
CCM-73-04, August 1973.
OS-3 REFERENCE MANUAL.
Computer Center Pub.
Oregon State University
CCM-70-8.
Oregon State University
59 p.
Stockton, Fred G., 1963, Algorithm 162 XYMOVE PLOTTING Communications of
the ACM, vol. 6(4):161.
APPENDIX A
18
053 FORTRAN
C
3
C
4
C
5
6
C
7
C
C
8
9
11
It
12
13
14
15
16
17
19
1NTEGEP
-
C
19
2'3
21
22
23
24
25
26
27
28
29
C
C
C
30
31
32
33
34
35
36
37
38
39
40
C
C
C
41
42
43
44
45
46
47
48
49
50
11/05/75
2243
SUPDOUTTNF MERCMAP
TT
THIS SU3POUTINE DRAWS A "!EPCATOQ GRID ON THE PLOTTER.
AND
LEAVES
THEM
IN
OUE-PIES THE USER FOR THE MAP PARAMETERS
CD`1MO'a FOR THE CALLING PROGRAM.
SOUTHERN LATITUDES AND WESTERN LONGITUDES APE NEGATIVE.
MERCMAP WILL 410PK ACROSS BOTH THE DATELINE AND GREENWICH
ME?IDIAN.
COAMON MINPTS, MAXPTS, LATINCH, LONIGINCH, MAPSCALE
MS'D6C, MINLAT, MAXLAT, MINION(',.M AXLONG
CO'4IM CN
MINPTS, MAXPTS, LATINCH, LONGINCH, MAPSCALE
REAL
"'Sn60, MINLAT, MAXLAT, MINLONG, MAXLONG
PEAL
LAT, MIN, MERIOPTS
PEAL
0I1FNSION. 300(9), ABCD(10)
DIMENSION IALABEL(2), FORM (4), FORMR(3)
ED'JTVALENCE (ALABEL, IALABEL)
E0'1TVALE.NCE (BCD,A3CD)
1
2
VERSION 3.13
C
PENUP, PENOOWN
FOR RAPICDGPAPH PEN ON THE PLOTTER
FOR'1R (1) = RH MEDIUM
FORMR (2) = 8HRAPIDOGR
FORMR (3) = 9HAPH PEN.
FOR PLOTS LONGER THAN 60 INCHES.
FORM (1) = 8HFOLLOWIN
FOCIM (2) = SHG PLOT
FORM (4) = SH INCHES.
CODES FOR THE PLOT DPIVER SUBROUTINES
PENDOWN = 2
PENUP = 3
PUT GATE A'JD TIME INTO THE LABEL ARRAY
CALL DATE (ABCD(9))
CALL ARMYTIME (ABCD(13))
OON:T GET ABORTED BECAUSE LUNS WERE LEFT ECUIPPEC
CALL KESET
CALL EQUIP (17,8HLP
WRITE (61,105)
LABEL THE PLOT AND LP SO YOU CAN GET IT BACK
1j5 FOz"'AT (t3LADFL PLOT FOR**)
READ (60,104) BCD
WRITE (17,107) ABCD
GET THE DATA FILE
WRITE (61,108)
WRITE (17,109)
108 FORMAT (tCINPUT FILE NAME*)
READ (6,1G4) ANAME
WRITE (17,107) ANAME
CALL EOUIP (1,ANAME)
CALL EQUIP (10,8HPLOT
10 WRITE (61,100)
WRITE (17,100)
LONGS WEST ARE NEGATIVE AND LATS SOUTH ARE NEGATIVE
19
OS3 FORTRAN
1
2
2
56
61
62
63
64
65
66
57
6g
69
70
71
72
73
74
75
76
77
78
79
80
90
91
92
93
94
95
96
97
98
99
100
0
M
WLONG
ELONG
O
0
SCALE GRID#,/,
M
M#)
MAPSCALE, DEC, MIN
(F3.O,X,I2,X,F3.0,X,I2,X,F4.u,>,I2,X,F4.O,X9I2,
1C1 FORMAT
1
X,F2.0,X,F3.3,F4.0)
THIS Tc A FUNNY WAY TO GET MAPSCALE, BUT IT IGNORES THE
DECIMAL FOINT, AS IT MAY NOT BE THERE.
MAPSCALE = MAPSCALE + DEC
WRITE (17,179) MAXLAT, MAXLATM, MINLAT,
MINLAT^", MINLONG, MINLONGM,
1
C
C
2
z
MAXLONG, MAXLONGM, MAPSCALE
MIN
F0"'ATt#+#,F3.0,xDx.I2,tMx,F3.7.#C#.I2,xM#,F4.7,#Dx,I2,
109
C
C
C
C
81
82
83
84
85
86
87
8g
89
M
RE4O (60,131) MAXLAT, MAXLATM, MINLAT, MINLATM,
MINLONG, MINLONGM, MAXLONG, MAXLONGM,
1
55
6
SLAT
"!LAT
2243
11/05/75
100 FORMAT (#CGIVE THE FOLLOWINGS#,/,
51
52
53
54
57
58
59
VERSION 3.13 MEPCMAP
C
tM#,F4.0,#Ox,I2.xMt,F6.3,F4.0)
i
MAKE DECIMAL 'DEGREES OUT OF THE DEGREES ANC MINUTES.
MINLAT = MINLAT + SIGNF (FLOAT(MINLATM),MINLAT) / 60.
MAXLAT = MAXLAT + SIGNF (FLOAT(MAXLATM),MAXLAT) / 60.
60.
MINLONG = MINLONG + SIGNF (FLOAT (MINLONGM),MINLCNG) / 60.
MAXLONG = MAYLONNG + SIGNF (FLOAT (MAXLONGM),MAXLONG) /
IF (MAXLAT LE. MINLAT) GO TO 19
MAKE LONGS 0 TO 363 TO THE EAST
IF (MINLONG LT. 0.) MINLONG = 360. + MINLONG
IF (MAXLONG LT. 0.) MAXLONG = 360. + MAXLONG
TAKE C',RE OF CROSSING GREENWICH - MAKE LONGS GO TO 720 OEGS.
IF (MINLONG LT. MAXLONG) GO TO 12
MAXLONG = MAXLONG + 360.
CALCULATE MAP VARIA9LES
12 MIN = MIN / 60.
MS163 = MAPSCALE / 60.
(MAXLONG - MINLONG)
LONGINCH = MAPSCALE a
MINPTS = MERIOPTS (MINLAT)
MAPTS = MERIOPTS (MAXLAT)
LATINCH = MSD60 * (MAXPTS - MINPTS)
TAKE CARE OF FELT TIP PENS
15 WRITE (61,117)
WRITE (17,117)
YES OR NO*)
117 FORMAT (#G0O YOU WANT A RAPIDOGRAPH PEN READ (60,114) IANS
114 FORMAT (A4)
WRITE (17,116) IANS
116 FORMAT (X,A4)
GO TO 17
IF (IANS .E0. 4HNO
GO TO 16
EC. 4HYES
IF (I.ANS
WRITE (61,115)
WRITE (17,115)
115 FORMAT (#OILLEGABLE RESPONSE - TRY AGAIN*)
GO TO 15
)
)
20
OS3 FCRTPAN
101
102
103
104
105
106
107
10
109
113
111
112
113
114
115
116
117
119
119
120
121
122
123
124
125
126
127
129
129
130
131
132
133
134
135
136
137
133
139
140
141
142
-143
144
145
146
147
148
149
150
C
C
VERSION 3.13 MERCMAP
16 CALL FORMS (17, FORMR)
INITIALIZE THE PLOTTER
17 CALL PLOTINT (-5., 6., 10)
CALL PLOT (1., :., -3)
CALL PLOTSYMR (C., -2., .21,
11/65/75
ABCD, 0.,
2243
80)
INITIALI7-:' PEN POSITIONS
J.
YOPG
C
X0PG=
IF MA,--l WILL FIT WITH LONGITUDES
C
PAPER ROLL GO TO 25
PARALLEL TC THE PLOTTER
IF (LCNGINC-1 .LE. 27. ) GO TO 25
IF M+AP WILL FIT WITH LATITUDES PARALLEL TO THE PLOTTER
PAGER ROLL GO TO 23
IF (LATINCH LE. 27.) GO TO 20
SORRY AOOUT THAT -- GUESS AGAIN
C
WRITE -(61,113)LATINCH,LONGINCH
WRITE (17,113) LATINCH, LONGINCH
113 FORMAT(t MAP IS t,F7.19* BY *,F7.1)
WRITE (61,132)
WRITE (17,102)
162 FORMAT(*- ONE DIMENSION MUST BE LE 27 IN. -- TRY AGAIN*)
GO TO 10
19 WRITE (61,110)
WRITE (17,110)
110 FORMAT (*3ERROR IN LATITUDES -- TRY AGAIN*)
GO TO 10
POTAT= THE X-Y AXIS 90 DEGREES COUNTER CLOCK-WISE
C
23 CALL PLOT (J., 0., -3)
CALL ROTATEXY
YORG = -3C.
XORG = C.
CALCULATE THE LENGTH OF THE PLOT AND LET THE OPERATORS
C
KNOW IF GREATER THAN 63 INCHES.
C
25 A41X = LONGIN'CH
IF (LATINCH GT. LONGINCH) AMAX = LATINCH
ALENGTH = AMAX + 16
ENCODE (8,111,FORM(3)) ALENGTH
111 FORMAT (F9.0)
IF (ALENGTH GT. 63.) CALL FORMS (10,rORM)
GET
THE ORIGIN FOR THE MAP GRID
C
CALL PLOT (XORG, YORG, -3)
CALL PLOT (3., 1., -3)
LETS LAPEL IT AGAIN WITH INFORMATION CONCERNING THE MAP,
C
AREA, DATA, ETC.
C.
WRITE (61,103)
WRITE (17,133)
103 FORMAT (*3GIVE THE PLOT LABEL -- UP TD 80 CHARS.*)
READ (60,134) (ABCD(I),I=1,10)
WRITE (17,107) (ABCD(I),I=1,10)
107 FORMAT (* *,1iA8)
C
C
21
OS3 FORTRAN
151
152
153
154
155
156
157
159
159
160
161
162
163
164
165
166
167
C
FROM HERE TO L.00040 PLOT AND ANNOTATE THE LONGITUDES
GO TO 31
C
PLOT A LONGITUDE FPOM NORTH TO SOUTH
30 YLINE = YLINE + MAPSCALE * MIN
190
191
192
193
194
195
196
197
198
199
200
31 CALL FLOT (YLINE, LATINCH, PENUP)
CALL PLOT (YLINE, 0., PENDOWN)
TEMP = MINLONG + YLINE / MAPSCALE
IF (TEMP GT. 180.) TEMP = TEM° - 360.
ITE:MP1 = TEMP + SIGNF (.01, TEMP)
ITEMP2 = 49S(TEMP - ITEMPI) * 60. + .C1
ENCODE (8,106,ALABEL) ITEMPI, ITEMP2
IF (.NOT. ITEMP2) IALABEL(2) = IALABEL(2) + 608
106 FC-,'1AT (I5,X,I2)
CALL FLOTSYMB (YLINE-.5,-.25,.14,ALABEL,G.,8)
C
173
174
175
176
177
179
179
183
184
185
186
187
183
189
2243
YLINE = 0.
CALL PLOTSYMR (0.,-1.,.21,BC0,C.,80)
172
180
181
182
11/05/7;
1L4 FO-MAT (10A3)
168
169
170
171
VERSION 3.13 MERCMAP
C
C
YLINE = YLINE + MAPSCALE * MIN
IP (MTN EO. C.0) YLINE = LONGINCH
IF (YLINE - LONGINCH GT. .1) GO TO 40
PLOT A LCNGITUOE FROM SOUTH TO NORTH
CALL PLOT (YLINE, O.,PENUP)
CALL PLOT (YLINE,LATINCH, PENDOWN)
TEMP = MINLONG + YLINE / MAPSCALF
IF (TEMP GT. 130.) TEMP = TEMP - 360.
ITEMPI = TEMP + SIGNF (.01, TEMP)
ITEMP2 = ABS(TEMP - ITEMPI) * 60. + .01
ENCODE (P,106,ALABEL) ITEMP1, ITEMP2
IF (.NOT. ITEMP2) IALA5EL(2) = IALABEL(2) + 608
CALL PLOTSYM`i (YLINE-.5,LATINCH+.25,.14,ALABEL,0.,8)
IF (YLINE - LONGINCH LT. -.1) GO TO 30
FROM WERE TO L.00G60 PLOT ANO ANNOTATE THE LATITUDES
40 CALL PLOT (LONGINCH, 0., PENUP)
LAT = MINLAT
GO TO 51
50 LAT = LAT + MIN
51 XLINE = MSO6O * (MERIOPTS (LAT) - MINPTS)
PLOT A LATITUDE FROM EAST TO WEST
CALL PLOT (LONGINCH, XLINE, PENUP)
CALL PLOT (O.,XLINE, PENDOWN)
ITEMF1 = LAT + SIGNF(.01,LAT)
ITEMP2 = ABS(LAT - ITEMPI) * 60. + .01
ENCODE (8,106,ALABEL) ITEMPI, ITEMP2
IF (.NOT. ITEMP2) IALABEL(2) = IALABEL(2) + 608
NOT. ITEMP2) ALABEL = 8H EQUATOR
AND.
IF (.NOT. ITEMPI
CALL FLOTSYM9 (-1.,XLINE,.I4,ALABEL,0.,8)
LAT = LAT + MIN
IF (MIN EQ. 0.0) LAT = MAXLAT
GT. .1) GO TO 60
IF (LAT - MAXLAT
XLINE = MSO60 * (MERIDPTS (LAT) - M:INPTS)
22
OS3 FORT'AN
201
202
203
204
205
206
2C7
20Q
20q
217
211
212
213
C
VE?SION 3.13 4FDCMAP
11/05/75
2243
PLOT A LATITUOF FR^M WEST TO EAST
CALL PLOT (;:.,XLI`1F, PENUP)
CALL PLOT (L^NGT_NCH, XLTNE, PFNOOWN)
ITEMP1 = LAT + SIGNF(.01,LAT)
Ci
ITEMP2 = A3S(LAT - ITEMPI) * 60. +
ENC00E (8,106,ALABEL) ITEMPI, ITEMP2
IF (.NOT. ITEMP2) IALABEL(2) = TALABEL(2) + 6CR
NOT. ITEMP2) ALABEL = 8H EQUATOR
AND.
IF (.NOT. ITEMPI
CALL PLOT SYM? (LONGINCH,X.LINE,.14,ALABEL,0.,8)
IF (LAT - MAXLAT LT. -.1) GO TO 50
60. CONTINUE
RETURN
END
LENGTH OF SU3PROGRAM
LENGTH OF COMMON
017145
0024
23
0S3 FORTRAN
1
2
3
4
5
6
7
9
C
C
C
VEPSION 3.13
2242
FUNCTION MEAIDPTS(LAT)
THIS FUNCTION RFTURNS A VALUE FOP THE HFPICIONAL PARTS
EOUIVALENT TO THE LATITID= ACCORDING TO THE CLARK SPHEROIO OF
(ROWOITCW 1951, PAGE 1196).
1966.
PEAL ME'IDPTS, LAT
QAOLAT = LAT / 57.29579
SINE = SIN(RAOLAT)
MERIOPTS = 7915.704469 * ALOG10(TANF(.7P5391tRAOLAT/2.))
SINE
1
-23.269932
-0.3525000
2
It
12
11/05/75
RETURN
END
LENGTH OF SUBPROGRAM
00076
SINE * SINE * SINE
24
OS3 FORTPA`I
1
2
C
3
C
4
C
5
6
7
11
12
13
14
15
16
29
30
31
2239
0
MTABLE (2) = 31
MTARLE (3) = 59
9
10
27
2R
11/05/75
SURROUTINE LEAPYEAR(YR)
THIS SU9PO!JTINE CHANGES THE MONTH TABLE FOR LEAPYEARS
INITIALIZES MONTH TABLE TO THE NORMAL YEAR SO THAT IT
IS PECALLARLF.
COMMON /MTARLE/ MTABLE(12), ISYEAR
INTEGER YEAR, YR
MTARLE' (1) =
1
17
19
19
20
21
22
23
24
25
25
VEpSION 3.13
C
MTARLE (4) = 90
mT3BLE (5) = 120
MTARLE (6) = 151
MTARLE (7) = 191
MTARLE (R) = 212
MTARLE (9) = 243
MTARLE (IC) = 273
MTARLE (11) = 304
MTARLE (12) = 334
ONLY 2 DIGIT YEAR IN CALL
YEAR = YR + 1900
C
C
ISYFAP IS STARTING YEAR USED BY NGDCTIlE, ITIME, ADTG, ICTG.
ISYEAP = YR
IF (MOD (YEAR, 4)) RETURN
IF (.NOT. MOD (YEAR, 100)) GO TO 30
ADJ 1 TO MONTHS AFTER JAN FOR LEAPYEARS
10 DO 20 I = 3, 12
20 MTARLE (I) = MTABLE (I) + 1
RETURN
30 IF (.NOT. MOO (YEAR, 400)) GO TO 10
RETURN
END
LENGTH OF SU3PROGRAM
LENGTH OF COMMON MTABLE
00127
00315
25
OS3 FnRT- a'l
1
2
C
3
C
4
C
5
C
C
C
6
7
9
273, 31:4, 334)
Y?, r)4Y, HR
EXTRACT THE YEAR, :IONTH AND DAY
YR = YRMODAY / 13000
MON! _ (YRMODAY - YR * 15000) / 100
15
16
29
2234
, 31, 59, 93, 120, 151, 181, 212, 243,
(ISYEAR = 99)
INTEGER YRMODAY, HRMINIC,
C
11/:5/75
"'
DATA
14
23
24
25
26
27
29
_;
FUNrTION N>>rTI""E(YRr1')OaY, HPMIN 1CL )
EXIT WITH
ENTER WITH YEAP MONTH DAY AND HOUR MINUTE a 10.
IF
YEAR
CHANGES
1C) SINCF 3EGIN:NG OF YEAR.
TNTE,E9 (MTN
FRO'a START OF YEAR NGDCTIME IS F?OM FIRST YEAR.
ISYFaP IS THE STARTING YEA?, IT IS SET BY LEAPYEAR.
IF LEAP YEAR IS NOT CALLED, IE FOR ONE TIME PROGRAMS ISYEAR
DEFAULTS TO 1999 NOT A LEAP YEAR
COMMON /MTABLE/ MTABLE(12), ISYEAP
1
11
12
17
1q
1q
23
21
22
-1
DATA (MTABLE
q
10
13
VEVSIONJ
C
C
DAY = MOD (YPMOOAY, 100)
EXTRACT THE HOURS AND TENTHS OF MINUTES
HR = HRMIN1 / 1000
MIN = (HRMIN10 - HR * 1000)
COMPUTE TENTHS OF MINUTES SINCE FIRST OF YEAR
NGDCTIMME = ((MTABLE(MON) + ;)AY-1)
C
C
24 + HR)
600 + MIN
FOR THE SECOND YEAR
* 14400
IF (YR GT. ISYEAR) NGDCTIME = NGDCTIME + (MTABLE(12)+31)
CHECK FOR LATER THAN FEB 29, 23159t50 OF SECOND YEAR
IF (NGDCTIME LT. 6119993) RETURN
WRITE (61, 100)
100 FORMAT (v-TIME LATER THAN FEB 28, 23159150 OF SECOND YRt)
CALL SBJP
ENO
LENGTH OF SUBPROGRAM
LENGTH OF COMMON MTABLE
00135
00015
26
OS3 FCRTRA'J
1
2
C
3
C
4
C
5
C
6
C
C
7
8
9
10
11
12
13
14
C
28
29
33
31
C
C
C
C
11/05/75
2239
FU':CTIr)N ITIMF(YRMOOAY, HRMINSEC)
EXIT WITH
ENTFP WITH YEAR MONTH OAY AND HOUR MINUTE SECOND.
IF YEAR CHANGES
INTEGER (MIN * 1) SINCE BEGINING OF YEAR.
FRO`^ START OF YFAR ITIME IS FROM FIRST YEAR.
ISYFA? IS THE STARTING YEAR, IT IS SET BY LEAPYEAR.
IF LEAP YEAR IS NOT CALLED, TE FOR ONE TIME PROGRAMS ISYEAR
DEFAULTS TO 1999 NOT A LEAPYEA='.
COMMCN /MTA3LE/ MTARLE(12), ISYEAR
DATA (MTABLE = 0, 31, 59, 90, 120, 151, 181, 212, 243,
273, 304, 334)
1
(TSYEAO = 99)
DATA
INTEGER YRMODAY. HRMINSEC, YR, DAY, HR, SEC
EXTRACT YFAP, MONTH AND DAY
YR = YRMODAY / 10003
MO")
15
16
17
18
19
20
21
22
23
24
25
26
27
VERSION 3.13
(YRMODAY - YR * 13000) / 100
DAY = MOO (YRMODAY, 1_0)
EXTRACT HOURS, MINUTES AND SECONDS
HR = HRMINSEC / 13J00
MIN = (HRMINSEC - HR { 10000) / 100
SEC = MOO (HRMINSEC, 103)
CC`1PUTE TIME IN TENTHS OF MINUTES SINCE FIRST OF YEAR
ITIME = MIN * 10 + (SEC * 130 / 60 + 5)/ 10
ITIME = ((MTABLE(MON) + DAY-1) * 24 + HR) * 600 + ITIME
FOR THE SECOND YEAR
IF (YR GT. ISYEAR) ITIME = ITIME + (MTABLE(12) + 31) ' 14400
CHECK FOR LATER THAN FEB 28, 23159:50 OF SECOND YEAR
IF (ITIME LT. 6119998) RETJRN
WRITE (61, 1G0)
160 FORMAT (2-TIME LATER THAN FEB 29, 23:59:50 OF SECOND YRt)
CALL SBJP
END
LENGTH OF SU9PROGRAM
LENGTH OF COMMON MTAOLE
00164
L0015
27
OS3 FORTAA'J
VERSION 3.13
11/G5/75
2240
3
C
SU3ROUTINE IOTG (YR, TIME, YRMODAY, T)
ENTER WITH YEAR, E.G. 72, AND TIME IN TENTHS OF MINUTES
SINCE BEGINNING OF THE YEAR (OUTPUT FROM NGDCTIME OR ITItE).
4
C
EXIT WITH YR MO DAY, HP MINK,.
C
COMMON/MTABLE/MTABLE(12),ISYEAR
INTEGER T, YP, TIME, YRMODAY
T=(MTABLE(12)+31)"144 0
T IS TENTHS OF MINUTES IN THE YEAR
IF(TIME.LT.T)GOTO2
FOR THE SECOND YEAR
YR=ISYEAR+1
1
C
5
6
7
1'l
C
11
12
13
14
15
16
17
11
19
TI4E=TIME-T
2 T=TIME/14400
C
IF(T.LT.MTA9LE(I))GOTO3
C
20
21
22
23
24
25
26
27
23
29
30
T IS INTEGER DAYS
DO 4 I=1,12
C
C
4 CONTINUE
I=13
I IS THE MONTH
3 I=I-1
IDAY=T-MTARLE(I)+1
YRMODAV=YR*10U00+I*100+IDAY
NEW T IS REMAINING TENTHS OF MINUTES OF DAY
T=TIME-T*14400
COMPUTE HOURS AND MINUTES * 10
IHR=T/600
MNT=T-IHR*630
T=IHR*10LO+MNT
RETURN
END
LENGTH OF SUBPROGRAM
LENGTH OF COMMON MTABLE
00153
00015
28
OS3 FORTRAN
3
+
C
C
C
C
FORMAT WITH LEADING ZEROS.
C
C
FOR THE SECOND YEAR
9
IF(TIt1E.LT.T)GOT02
13
12
13
14
15
16
17
19
19
ENTER WITH YEAR, E.G. 72, AND TIME IN TENTHS OF MINUTES
SINCE 9EGINNING OF THE YEAR (OUTPUT FROM NGDCTIME CR ITINE).
OLTPUT IS IN 1A2
EXIT WITH YP MO inAY, HP MIMM AND TENTHS.
INTEGEP T, YR. TIME
T=(MTAOLE(12)+31)*144G0
T IS TENTHS OF MINUTES IN THE YEAR
7
11
YR.=ISYEAR+1
TIME=TIME-T
2 T=TINE/144;;9
C
23
C
21
22
23
24
25
26
27
C
C
21
T IS INTEGER DAYS
DO 4 I=1,12
IF(T.LT.MTA9LE(I))GOTO3
4 CONTINUE
I=13
I IS THE MONTH, J IS YRMODA
3 I=I-1
IDAY=T-MTABLE(I)+1
J=YR*19^CC+I4100+IDAY
NEW T IS REMAINING TENTHS OF MINUTES OF DAY
T=TIME-T*144G0
COMPUTE HOURS AND MINUTES * 10
IHD=T/600
MNT=T-IHR463
T=IHR+'1900+MNT
29
33
C
31
32
33
34
35
36
37
39
39
40
C
CHANGE T TO HOURS MINUTES AND TENTHS OF MINUTES WITH
LEADING ZEROS - *A5t FORMAT
ENCODE (8,100,HRMN T T
100 FORMAT (I5,3X)
79 ZEROES THE BLANKS IN THE REAL ARGUMENT
HRMNT = ZB (HRMNT)
CHANGE J TO YEAR MONTH DAY IN *A62 FORMAT
ENCODE(8,101,YRMODAY)J
101 FORMAT(I6,2X)
RETURN
)
C
C
END
LENGTH OF SUBPROGRAM
LENGTH
224C
COMMON /t-+TAILE/ MTABLE (12), ISYEAQ
6
9
11/05/75
SUIPOUTINE AOTG(Y^,TIMF,YRMODAY,HPMNT)
1
2
VERSION 3.13
OF COMMON MTABLE
00176
00015
ASSEMBLER/0S3
LENGTH OF
V1.0 11/06/75 1417
PRG
PAGE
ARMYTIMF
1
i,0:26
00001 P
2
4
5
6
IOENT
FNTPY
ARMYTIMF
ARMYTIME
}}}}}#}aaf}f}a}aa}#a}aaaaa}a}aaaa}a}}aa}a}#}a}}}#/.}ai}#aa#aiaaaaia#iiiii irF
##}
***
*#*
THIS SUBROUTINE PE" URNS THE CURRENT 24 HOUR TIME
FORMAT TO THE CALLING PROGRAM.
***
THE CALLING SEQUENCE IS?
+
IN 2A9t
7
8
9
10
11
***
12
13
14
***
***
X1
00033
00G01
10uc1
e)JL3 P
01077777
541t;000o P
33002
53010037
03013
17704337
16
17
18
19
20
21
00024
14(4-,33C0
30305
01336
33037
0331
30011
51000724 P
42001112 P
00312
51300025 P
00313
00014
03015
00016
3OC17
00023
01321
13077747
51030)24
42300114
430u3115
25000)22
4550030u
01100))1
00110
60630033
03000012
30165140
30022
00024
30025
430;,J113 P
OC022 2
00022 3
53010022
144t011 C0
P
P
P
P
P
aa}
aaa
O0022 0
NO LINES WITH ERRORS
EQU
ARMYTIME EQU
1
as
ARMYTIME,X1
TMQ
ANQ
3 79
22
ENA,S
0
23
OVA
TEN
24
25
26
27
28
29
SACH
SQCH
A TI ME+3
TMO
2 28
ENA,S
0
LnI
31
32
38
39
40
i
+
aa#VVVV}a}a}}#iaa#a#}aa:FV#a}VVVVV}aaaaaa}as#aa#aaaa}}aaasaiaaiaaia+aaii+aa
UJP
33
34
35
36
37
i
+
THE FORMAT OF THE RETURNED VALUE ISt
t
HHMM Y WHERE HH IS THE HOURS AND MM IS THE MINUTES
30
00023 3
00023 1
i+
CALL ARMYTIME (X)
aa#
*
P60000
- 24
LOAC
*+3
0,X1
1,X1
TEN
P60000
UJP
EOU,C
OCT
OCT
OCT
END
FOR THE RETURN
GET THE HOURS FROM RF 37
SAVE THE BOTTOM 5 BITS
CLEAR A
CONVERT TO DECIMAL
ATIME+2
OVA
SHAG
OVA
SACH
SQCH
STAC,I
ATIME
37B
ENTRY POINT
TEN
GET MILLISECS FROM RF 22
DIVIDE BY 60000
GOT THE MINUTES
CONVERT TO DECIMAL
A TI MET +4
ATIME+5
a
60600000,00006060
OCCOO012
165140
GET THE WHOLE TIME
SEND IT BACK
RETURN
ASSE"BLER/OS3
LNGt4 OF
V1.0 11/10/75 1558
PAGE
1
7.43
G-G23
PRG
00007 P
00003 P
1
IDENT
ZR
2
ENTRY
ENTRY
7n
I7.8
3
5
ENTRY FOR PEAL ARGUMENTS
ENTRY FOR INTEGER ARGUMENTS
}*fi*fifi,aa}a*fia***}fia}aasfia}fi*r}}}}pfifi}fifi}fi**fifi}*fifi}}fia}}}fi}}}}}}}}}}}}s}
fi**
6 *}*
7 ***
}**
8
THIS FUNCTION ZEROS CUT THE BLANKS (6CB*S) OF THE ARGUMENT
IZ_8 FOP AN INTEGER ARGUMENT AND ZB FOR A REAL (DOUBLE WORD)
ARGUMENT.
9 ***
10 ***
11 fi**
CALLING SEQUENCEt
12 }}}
13 ***
9 = 78 (A)
J = IZO (I)
14 ***
}}}*}fifi*}fifi*a*}}}}*fiaafi*}}}}}}}*}*}}}*}}*fififi}}}*}}}a}}}}}}}}}}}}}}}}}}}}
00000
00001
00002
00003
03004
00005
00006
00007
00010
00011
00012
00313
00314
00015
00316
00017
00021
00021
00022
00001
31077777
54100000
215:.300
43000020
37007022
3FCCC023
011;0001
01077777
541000C7
25500300
45000321
P
16
X1
17
I7_B
18
19
20
21
22
EOU
UJP
LOI
LOA,I
1
IZB,X1
0,X1
STA
TEMP
LPA
SCA
UJP
UJP
LDI
BLANKS
TEMP
26
LDAO,I
0,X1
P
1300.3 030
27
28
STAC
SHAG
TEMP
24
37000322 P
36030021 P
29
LPA
30
SCA
BLANKS
TEMP2
130000033
31
32
SHAG
UJP
BSS
BSS
OCT
END
P
P
P
FINISH
23
P
31000004 P
24
25
33
60636060
NO LINES WITH ERRORS
34
35
36
ZB
TEMP
TEMP2
BLANKS
1,X1
**
ZB,X1
24
FINISH
1
1
60606060
ENTRY FOR INTEGER ARGUMENTS
FOR RETURN FROM IZB
GET THE ARGUMENT
AND (ARG, BLANKS)
FOR (ANO (ARG, BLANKS), ARG)
RETURN
ENTRY FOR REAL ARGUMENTS
FOR RETURN FROM ZB
GET THE ARGUMENT
AND (ARG, BLANKS)
FOR (ANO(ARG, BLANKS), ARG)
ASSEMBLER/OS3
LENGTH OF
V1.0 11/06/75 1414
PRG
PAGE
03,066
1
coo C
J
P
4
5
7
9
1J
11
12
6601
00002
00001
10CJ2
00003
0:30+
00005
CLOGS
00007
255.3'__^J
033,9030
P
14
15
16
17
1g
19
Ci7C^.)C6
P
22
C3OC2
01677777
541:'0)61
31100300
01277777
45000344
P
P
310'1)
6iu36, ,52
00011
033,00?6
30013
00314
10015
00016
00017
610 0)56
33200'40
25000?44
12,77763
37-0:47
P
Oo C21
16477777
43000)46
23601344
13277733
P
P
06012
1 CG2i
00022
00723
00124
03025
00026
70027
00033
00031
00032
00333
00034
25000744
P
P
P
P
P
P
536'_3"02
51.200''46
P
311+02306 P
16477777
16577777
0'3700006 P
9 GC35
00036
250003054
P
00040
90041
00042
000+3
)3044
14600656
14700310
P
00046
00047
00053
00052
00054
00056
fff
*x*
***
760o_3075
7762330')
33000377
2 434301
23014303
00000003
41255151
NO LINES WITH ERRORS
42
43
44
45
46
47
49
49
XS
X2
AINT
SUB
54
55
56
57
51
59
EDU
EQU
UJP
LnI
LOAC,I
A7J,LT
RTJ
UJP
UJP
XOA,S
STA
TEMP
ITEM
MASK P
MAX
ONE
ZERO
EMESS
NEGARG
5013
1,X1
*f
ONE
LPA
TAI
ERROR
C,xi
TEMP
SHA
LTONE
AINT,X1
FS9
AZJ,LT
FSB
A7J,GE
LnAC
NEGARG
1
2
ST AC
LnaC
50
51
52
53
$
fff
***
fff THE CALLING SEQUENCE IS:
***
Y = AINT (X)
fff
axff affidFf xxf xfxfafaffixaiFfffs$Offaffffffffxaxfffffafffaxffssaf affsasa***s
31
34
35
36
37
38
39
40
AINT
THIS FUNCTION TRLNC4TES THE FRACTION PORTION OF A FP
ARGUMENT 'Y SHIFTIN2 THE FRACTION PORTION OFF THE END
RFTURNTNG THE INTEGER PORTION.
32
33
13209044
')1133501
21
22
23
24
25
26
27
29
29
IOFNT
AINT
fxxff µaiff ENNTPY
f?'i7faaxxxf
Yff 4iff xffxff xffffffxaaffff tfffffffffaf aff aaafffaa**a
31
16477777
16577777
01103001
30037
AINT
1
LDA
SHAG
LOI
SHAD
UJP,I
XOA,S
XOA,S
RTJ
XOA,S
XOA,S
UJP
LDAC
UJP
ENA
ENO
WPITE
SBJP
BSS
91,3S
OCT
OCT
OCT
OCT
BCD
END
LTONE
TEMP
MAX
ERPOR
INDEX 1
INDEX 2
ENTRY POINT
FOP RETURN
GET ARGUMENT
GHECK FOR NEGATIVE
FOR, POS NUM
RETURN
FOR POS NUMS
CHECK FOR LT. i
GO GET ZERO
CHECK FOR GT. 2**43
MUM TOO LARGE
TEMP
-12
MASK
SAVE 2 OCT DIGITS
X2
777779
ITEMP
TEMP
-449,X2
ITEMP,X2
44B,X2
SU9
777779
777778
SHIFT TO DECIMAL PT
SHIFT BACK
RETURN
SUB
TREAT AS POSITIVE
777779
777778
1,X1
ZERO
COMPLEMENT
RETURN
1,X1
RETURN
EMESS
8
61
ABORT
2
1
00000077
20434000,30030000
20014000,00600000
00000000,00000000
8,-EPPOR IN AINT X > 2**43 ABORT
ASSEMBLER!OS3
LENGTH OF
V1.0 11/06/75 1414
PAGE
00066
PRG
1
00000 P
2
3
4
6
**x
14
Cc:o2
01077777
54107)13 P
255372)1
C, C4
031:331'+ P
255_.JJ00
00001
36033
F,
CCG05
30035
03637
03117
3'iC10
100'12
3013
00014
00015
76016
300;17
70320
00021
06122
03023
3 C25
O026
70327
33)
0
70031
032
0
00033
03034
0335
00336
70037
7C J4
00041
00342
43
03,;;).;42 P
25103 CJ
3210112 P
25000362 P
7iIL'3302
293:O362 P
31/01332
255L0JO)
635JJC1
4SCL0J55 P
03200321
231u0:56
61330304
03230306
25533001
133,)30
03777777
77060056
311(- 0)12
.O)
0362
0
64
ATAN2
1
$
L D I
1,(1.
CASE 2
0,(1.
23
24
LBAC,I
A7J,E0
LBAC,I
AZJ,NE
CASE1
PSIGN
CASE2
AZJ,GE
LEAD
UJP
LOAD
UJP
LBAC,I
FDV.I
ST AC
35
36
37
A7J,GE
P
31
39
P
P
P
34
LCAC
FSB
CASE3
40
41
42
43
44
45
45
47
49
49
57
51
52
53
54
CASE4
X)
EDU
FBU
UJP
AZJ,GE
X
P
LDAC,I
A7J,LT
RTJ
77
PTJ
77
STAG
LBAC,I
AZJ,GE
$}
AT9N2,X1
Y7!=R0
C , KI
}
*
ENTRY TO FUNCTION
PICK UP X
IF (X) CASE2
GET Y
UNDEFINED
IF X = Y = 0.0
ATAN2 = SIGN (Y)
CHECK SIGN OF Y
2,K
GONE WITH CASE1 FOR SIGN (Y) NEG
PI12
PI9'
2,X:.
C,X1
1,X1
YCX
*+2
YOX
TWOP24
CASE1
1 ,X L
CASE4
ATAN
YCX
2,X1
ATAN
VEX
VEX
0,X1
PIIGNZ
DONE WITH CASE1 FOR SIGN (Y) POS
GET Y
DIVIDE BY X
SAVE (Y/X) FOR LATER
NEED THE ABS (YOX)
FOP YDX NEG
GE. 2}*24)
IF (ABS(Y/X)
GET X
LT. 0.0
CASE 4 IF (X)
ATAN2 = ATAN (Y/X)
PI
ENA,S
61
ERROR MESSAGE
5
CLEAR AO
01100/.02
4i 255151
55
57
53
0
0
UJP
2126220
60
2)b 16223
24314000
NO LINES WITH ERRORS
59
61
62
63
ENDS
EMESS
YOX
BCD
ASS
OCT
P102
TWOP24
OPT
OCT
END
E ) I T
PI
+ PI
YCEX
Y/X +- PI
RETURN
21X1
RETURN WITH
2,X1
6..-ERROR IN ATAN2 Y=X=C.0
2
230262200,77324774
2;016220,77324744
23314000,00000000
CASE1
DONE WITH CASE3
ATAN2 = ATAN (Y/X) + SIGN (Y)
YOX IS A TEMP
GET Y
E%IESS
6
WRITE
* PI / 2
P S I G N
ENA
ENO
P
P
P
P
}
}
}
}
YZERO
144"00 c,
1-4500000
73
X1
A = ATAN2 (V,
L0A3,I
30
31
32
IBM S"STEM 360 FORTRAN IV LIBRARY SUBPROGRAMS
THE CALLING SFOUFNCE ISt
33
1 iEc3:50 P
30145
30146
3.)9.55
REFERENCE:
21
26
27
29
ATG.N2
PSIGN2
EXIT
00044
0C 47
$}$
***
}}}
$}$
}**
20
25
1633
LCAC
UJP
LOAC
FAD
UJP
1471^'06
75LL3975
2C
16
17
19
19
10/29/75
THIS COMPUTES THE VALUE OF ATAN (Y/X) RETURNING A VALUE BETWEEN
-PI AND +PI.
IT E.XTENCS THE RANGE OF THE REGULAR ATAN FUNCTION.
P
P
P
P
3:)737;:25 X
77013356
45000356
25560330
3'2.-0,137
25000353
310.CJ4J
25330060
63303255
0_1 7312
ENTFV
01
ATt,N2
ATt,N
FKT
$}$}$$$$$na$$$$$$$$a$+.$$$}$}*$$}$*}}$}}*}$$$}}*$}$*}}}}}}$}}}}*}}}}}}}}fit
q
11
12
13
COSY/
TRENT
***
$$}
10
3u 703
ATAN2
A
7
13301
00003 P
ATAN2
1
0.0 FOR X=Y=0.0
=3.14159265
=3.14159265 / 2.
= 2. ** 24
+P
ASSEMBLER/OS3
LENGTH OF
V1.0 11/06/75 1417
PAGE
AMCO
1
6C635
PRG
1;0003 P
IOENT
ENTRY
EYT
2
3
5
6
AN00
AI07
AINT
}}f}}}}f}}}}}i}}iff}}y}}}A{}f}if}}}}f}}}}}ff}}i}ff}ffiii}ff}}}}1111111}1111
fff
AMOD (X,Y) = X - AINT(X/Y) }
8
Y
7
CALLING SEQUENCE
q
10
11
13
i
LOAO,I
1,X1
A7J,EQ
STAG
ERROR
TEMP
Lr) AC,I
AZJ.EQ
FOV
0,X1
7EROX
TENP
STAG
T1=MP
PTJ
AINT
24
77
TEMP
25
26
27
LOI
A100,X1
1,X1
00 C5
255C100.
30606
02707
00010
OOCil
03012
00013
00014
03030017 P
20
6LJ0021 P
21
22
23
110015
16477777
00316
16577777
6:1530000
01130302
001017
0002)
OC321
00323
00024
00325
00026
00027
00777777 X
77300021 P
54100003 P
625"0001
14630327 P
14730006
76030375
77620300
40255151
NO LINES WITH ERRORS
}}}f}}}}f+f}f}y}f}}f}ff}}}}}}}}}}}}}fi}}}}f}}}ff}f}}}f}}f}f}}}iit}iiiif 1111
EQU
UJP
LnI
00000
00001
33C02
9CC03
OL604
COOL1
01077777
541L0003 P
25500001
03000023 P
45000021 P
45CI 3021 n
Z = AMOD (X, Y)
X1
AMOD
15
16
17
}u
A'OO,XS
FMU,I
XOA,S
X00,5
-3
-0
29
ZEROX
FAD,I
0,1:1
30
31
32
33
34
35
36
37
EXIT
UJP
BSS
ENA
ENO
WRITE
2,1:1
TEMP
ERROR
SBJP
EMESS
BCD
END
ENTRY POINT
ADDRESS OF X INTO X1
GET Y
CHECK FOR ZERO
SAVE IT
X INTO (AO)
FIX FOR WHEN X = 0.
0£VIOE BY Y
TO TRUNCATE
ATNT EATS X1
TRUNCATED X/Y TIMES Y
COMPLEMENT (A)
COMPLEMENT (Q)
SUBTRACK X/YiY FROM X
RETURN
2
EMESS
6
61
ABORT
6,-ERROR IN AMOD Y=0 ABORT
ASSEMBLER/OS3
LENGTH OF
VS.J 11/76/75 1415
PAGE
FWSP
1
OC5C7
PRG
IOENT
ENTRY
1
000Ju P
2
4
5
uxs
vxu
+`+`*
THIS SUBROUTINE EXECUTES A FORWAPO SPACE ON THE LUN
CALLING SEQUENCES
PTJ
1 0011
00000
00001
00032
00003
33304
U0013
03006
01077777
541L000J P
2J500J0J
44003305 P
14730013
72077777
01100001
NO LINES WITH ERRORS
FWSP
iRfi+fV iP 3fi IF4ii+F1 3Y fi+}i fi i:ii-#t+F**4ififif?iF iF ifF+FK iLY if iiOiMitiifiiFtii
7
9
FWS P
FWSP
CALL FWSP (LUN)
10
soa
12
13
14
15
16
17
18
19
20
X1
FQU
FWSP
UJP
sesass.srr+asea+tst%rxax+saaeaaasrasus+sxtf+nssuasustsosYSuussss+ssss
LDI
LUN
i
LOA,I
FWSP,X1
O,X1
SWA
LUN
ENO
1013
CNTL
UJP
1,X1
END
ENTRY POINT
GET THE A00RESS
GET THE LUN
DO THE FWSP
RETURN
ASSEMBLER/0S3
LENGTH OF
V1.0 11/06/75 1419
PRG
PAGE
0,0007
IDENT
00000 P
3
5
6
7
A
9
10
i1
12
13
CIO JG1
IC;''OJ
0001
00303
J0C14
OOCO5
00306
ISTATUS
1
01077777
541:000; P
21500000
44000005 P
14730000
72077777
01100001
15
16
17
19
19
23
21
22
24
25
2
aaa
as
ax
oaa
aaa
aaa
aaa
aaa
see
THIS FUNCTION RETURNS THE STATUS BITS OF THE LUN IN A
ROTH THE LUN STATUS AND THE HARDWARE TYPE ARE AVAILABLE TO
BE MASKEC OFF.
CALLING SEQUENCE2
I = ISTATUS (LUN)
+r+aasaxaasaaasa*aoa*soas+s**s**s*as*a*as*aaaaasa*s*ao*******asas*s*sssaa*ss
X1
EOU
ISTATUS
UJP
LOI
LOA ,I
30
31
32
33
34
35
36
37
3R
39
40
41
42
43
44
45
46
47
49
49
50
52
NO LINES WITH ERRORS
1
as
ISTATUS,XS
LUN
ENTRY POINT
FOP THE RETURN
GET THE LUN
LUN1
ENQ
GET THE STATUS
CNTL
RETURN
asaaaaaaaaaivaasas.vaaaoaarsaaavess*az**sasa+rasaastsa*s**ss*+r*s**a***ss*asa
aaa
aaa
THE BIT ASSIGNMENT` RFTURNEO ARE!
4 0 00J O D
27 7
29
29
ISTATUS
ISTATUS
ENTRY
aacaaaaaaaagaaaaaauaa
aaaaaaaaaaaa*aaaa*aaaaaaa a+aaaa***as*aa********iiai
2303000
'
100[0000
04303003
0%0 0000
a
010'00003
0)430000
00200000
00100000
*
a
aaa
aaa
aaa
aaa
asa
a"*
***
FILE PROTECT
LOAD POINT
END OF DATA
END OF FILE
DESTRUCTIVE READ
BIN RECORD READ
A9NORMAL / UNAVAILABLE
SEEK ERROR
SAVED FILE
THE BOTTOM 4 BITS CONTAIN HARDWARE TYPE AS FOLLOW!
UNIT NOT EQUIPPED
0000
0001
0310
0"11
*a*
LP
CP
0100
0101
CR
MT
0110
0111
PLOTTER
*+ *
1000
1001
aaa
*
*
TTY
NULL
*
TV
RAF
1010
*a*
TASK iF iFa**aa sgFa *iF*7Ftasla*7F
1011
***
***aa**aaaaaaaaaaa*aaaae
if*a*adFfa*a**iLaaaaataa*1F
END
*
FILE
*aa
*aa
aaa
V
*F iF**
ASSE4BLER/OS3
LENGTH OF
V1.3 11/16/75 1416
PRG
PAGE
RELFASF
1
'3GG7
C-031.0
P
1
I9ENT
2
ENTRY
4
5
PFLFASE
RE-EPSC'
aaaa***4*a**a**aaaaaa*axi*aaaaaaaaaaaa*aaaaaaaa*aaaaas a a a as as a as as asassaaas
aaa
aaa
aaa
aaa
THIS SUBPCUTINE FXECUTES AN OS-3 CONTROL HnDE RELEASE
ON THE SPECIFIED SUN.
IE THE LENGTH OF THE LUN BECOMES
THE CALLING SEQUENCE ISt
17
aaa
aaa
aaa
11
12
aaa
aaa
COCCI
01477777
",4000G3 P
44CLOJC4 P
14710003
72077777
14
15
16
17
18
19
X1
OOOG5
541,0710 P
03006
01100001
6
7
R
9
00000
0C CL.
OOC02
33003
01004
NO LINES WITH ERRORS
ZERO.
CALL RELEASE (LUN)
aaaaaaaaaa*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasaaaaaaaeasaaassa
RELEASE
EQU
tJJP,I
LDA,I
1
as
SWA
RELEASE
LUN
ENO
3
GET THE LUN
CNTL
as
RELEASE IT
20
LOI
FOR THE RETURN
21
22
UJP
REi.E'ASE,1
1,:L
LUN
END
RETURN
L/-'.O
ASSEN+RRLER/CS3
LENGTH OF
;k?/06j75 1417
PRG
PAGE
RESET
7
CJ021
IOlEiNi
ENTRY
1
2
p
PFS ET
R4_SET
aT..., are 4u a§:ssT¢.,=.rRaa§v^+iaF'w aaaraaaa+3 iifaa aal=$#v$$$$$$$$$$$$$$$$$$?6$$=ti$
+i
an r
REOLT UNEQUTPS ALL LUNS 0 THROUGH 49 AND RETURNS
THERE APE NO PARAMETERS,
s
$
$
CALLING 80OUENCE
CALL RESET
armaa$aaaaawaaaaaaaaaaaa$$$$$$$a$$ssassssu+caa
C0CC1
CCG2
0000)
00001
00,02
01077777
82003
71888008
DCCJ4
8)5
J'4I,
01Cu0307 P
COCG6
,:0:03315 P
000,7
00010
0N16 007
08880012 P
001111
,1000015 P
00012
1'+100,304
00013
7__00000
1
X1
X2
RESET
LOOP1
1410000?
1 010 C1
04200,62
01L00302 P
01+0000:; P
NO LINES WITH ERRORS
EQU
EOU
UJP
ENI
1'+20000 J
0014 iI u3.882 P
00015.
80016
00017
03020
13
20
21
22
23
2k
25
26
27
28
29
30
31
32
EMI
XREC
TSE
UJP
UJP
ISE
UJF'
UJP
ENI
OK
2
ENTRY POINT
0,X2
2X4.
0,X2
0.X1
a2
0K
1,X1
4, 2
OK
xREC
k,X1
0,X2
UJP
L COP1
TNT
1X2
ISE
5C,X2
UJP
LCOP1.
UJP,I
END
RESET
LUN COUNTER
FOR UNEQUIP
UNEQUIP (X2)
SKIP IF OK
SKIP IF ERROR
NO ERRORS
CHECK FOR UNIT NOT EQUIPPED
FP BUT NOT SAVED
UNIT NOT EQUIPPED
FOR RFP
RFP
TRY AGAIN
FOR NEXT LUN
DONE WITH LOOPi
NO DO NEXT LUN
RETURN
ASS'EEM=3LE?/OS3
LENGTH
OF
V1.L 11/06/75 1416
PRG
-AGE
MT
1
30OC(+
TOENT
ENTRY
1
6060] P
2
4
5
6
7
9
SO
11
12
13
14
MI
MI
ENTRY POINT
}
}
}}f
***
***
}}}
}}f
}}*
THIS SUBROUTINE ALLOWS THE USER TO RETURN TO THE LAST LOCATION
IN A PROGRAM FROM WHICH MI WAS CALLED.
CALLING SEQUENCE:
CALL MI
i
RETURN TO THE CALLING LOCATION IS BY TYPING CNTL A FOLLOWED BY
2MI* AND A CARRIAGE RETURN.
i
}}}844}4}f}}}}}}}ff}i}f}f}}}}}}}fiiifff}}ff}}f}f}f}}ffffif}ifif iiiiiiiiiii
}}f
30000
31077777
16
UJP
-V*
ENTRY
O0031
23000')03 P
2
4JG0J13
LOA
STA
MI
003
17
18
GET CALLING ADDRESS
IN 139 FOR A MANNUAL INTERRUPT
00303
014L0300
19
20
UJP,I
13B
MI
RETURN
END
P
NO LINES WITH ERRORS
i
f
ff*
***
***
$
MI
ASSE4BLER/OS3
LENGTH OF
V1.0 11/16/75 1415
PAGE
7AP
1
OO3C7
PRG
C0300 P
1
IDENT
2
ENTRY
ZAP
ZAP
4
6
i0f
THIS SUBPCUTINF ZEROES A PAGE (2048 WORDS) OF CORE
7
CALLING SEQUENCE t
q
CALL ZAP II)
WHERE I IS THE PAGE NUMBER (C - 15 FOR LOWER CORE).
10
11
12
00"01
O.G02
OCC03
30CO4
00001
01477777
29400000 P
440.0004 P
141000 6
71077777
14
15
16
00005
541,1°JJC) P
20
00006
01100.01
21
22
0000-,
NO LINES WITH ERRORS
17
18
19
X1
ZAP
PAGE
EOU
UJP,I
1
Lr)A,I
ii
ZAP
SWA
PAGE
ENI
6,X1
ii
FOR THE ZAP
ZAP,X1
FOR THE RETURN
1,X1
RETURN
XPEO
LDI
UJP
END
GET THE PAGE NUMBER
ZAP IT
ASSEMBLER/OS3
LENGTH OF
V1.0 11/26/75 1417
PAGE
JJJG2
PRG
c'BOG;i
P
1
Ir)ENT
2
ENTRY
a*aasaaaa*aaaaaa***aaaaa*a*aaa**aa*a**s**a*ae***s*a*oiFSiss+fffssiao*st+FSxsKt
**a
s
5
***
6
saa
7
***
9
1G
11
12
'0JC0 P
01077777
77620000
NO LINES WITH ERRORS
SOJP
SPJP
4
R
00000
00001
SBJP
1
14
15
16
17
*as
***
**a
***
THIS SUOFOUTINE PUTS TIE USED IN OS-3 CONTROL MODE.
s
THE CALLING SECUENCE IST
s
CALL SBJP
t
THERE IS NO RETURN TC THE CALLING PROGRAM
ou*sasa*s*a*ar***saa*sa*asa*f**ssxatsssss**oo*.aacsssss+rftsxsssasxrssss
SBJP
ECU
UJP
SBJP
END
ENTRY POINT
CALL OS-3 CONTROL MODE
41
OS3 FORTRAN
1
2
3
4
5
6
7
8
9
10
11
12
13
14
C
C
C
C
ONE SHAFT OPERATION TABLE
3.7, 3.8, 4.0,
5.2, 5.3, 5.4, 5.6,
2 5.7, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 5.R,
3 6.9, 7.0, 7.1, 7.2, 7.2, 7.3, 7.4, 7.4, 7.5, 7.6, 7.7)
DATA((SP1(I),I=1,40)=3.Q, 3.2, 3.4,
4.1, 4.3, 4.4, 4.6, 4.7, 4.9, 5.0,
C
C
TWO SHAFT OPERATION TABLE
DATA((SP2(I),I=1,40)=4.5, 4.8, 5.0, 5.2, 5.4. 5.6, 5.8,
1 6.0, 6.2, 6.3, 6.5, 6.7, 6.9, 7.1, 7.2, 7.4, 7.5, 7.7,
2 7.3, 7.9, 8.1, 8.2, 8.3, 8.4, 8.6, 8.7, 8.8, 8.Q, 9.0,
3 9.2, 9.3, 9.4, 9.6, 9.7, 9.8, 9.9, 10.-', 17.1, 10.2, 10.3)
IF(IABS(ISREV-IPREV).LE.50)GOT0200
19
C
C
CHECK FOR ONE SHAFT OPERATION
C
IF(ISREV.LT.IQO.OR.IPREV.LT.100)GCT02IO
C
25
26
27
28
C
29
C
30
31
32
C
FOR TWO SHAFT OPERATION,
BUT DELTA S > 50 RPM
C
WRITE(61,290)NDATE,NTIME,ISREV,IPDEV
290 FORMAT(t t,4I7* 2 SHAFT DELTA REVS .GT. 50 RPMf)
CALC SPEED FOR TWO SHAFT OPERATION
C
200 JREV=(ISREV+IPREV)/20 - 27
IF(JRFV.LE.O)GOT022C
IF(JREV.GT.40)JREV=40
SPEED =SP2(JREV)
RETURN
C
C
CALC SPEED FOR ONE SHAFT OPERATION
C
210 JREV=(ISREV+IPREV)/10 - 27
40
IF(JREV.LE.3)GOT0220
IF(JREV.GT.4C)JPEV=40
41
42
43
SPEED =SP1(JREV)
44
45
46
47
48
49
RETURN
50
3.5,
C
18
33
34
35
36
37
33
39
224C
FUNCTION SPEED (ISREV,IPREV,NOATE,NTIME)
FINDS SPEED FROM EMLOG AND ENGINE REVS FOR CNE AND TWO
SHAFT OPERATION DURING YALOC 71 LEG 6
COMMON /DATA/ SP1(40),SP2(40)
1
16
17
23
24
11/005/75
C
15
20
21
22
VERSION 3.13
C
C
FOR RPM
<
270 USE SPEED = 0.0
C
220 SPEED =0
RETURN
END
LENGTH OF SU3PROGRA'I
LENGTH OF COMMON DATA
00175
GL240
42
OS3 FORT°AN
2
C
3
C
4
5
6
C
7
C
9
10
11
C
15
16
17
11
19
20
C
C
C
THIS SUBROUTINE GETS THE MATHEWS 70NE TABLE FOR ZONE tM7t AND
PUTS IT IN THE INTEGER ARRAY tITABt. IF THE DATA FOR THE ZONE
tMZt IS NOT CONTAINED IN THE RAF f-MATABt THEN AN ERROR IS WRITTEN
LUN 51 IS USED TO INPUT DATA
AND THE SUBROUTINE ABORTS THE USER.
FROM THE RAF t*MATA93t. PRESENTLY ZONES 23-25 AND 41-45 ARE INCLUDED.
tTENJt CONTAINS THE LENGTH OF THE TABLE FOR ZONE tMZt.
DIMENSION ITAB (6O, INDEX (2,52)
IF(MZ
OR. MZ
LT. 1
GT. 52) GO TO 15
HAS THE INDEX ALREADY BEEN READ IN
IF (TEND) GO TO 10
NO. ZFAO IN THE INDEX
CALL UNEQUIP (51)
C
C
21
22
23
24
25
26
27
28
2240
SU`1ROUTINF GFTMATAB (MZ, ITAB, IEN14
1
12
13
14
it/05/75
VERSION 3.13
C
C
CALL EQUIP (51, 8H*MATAB
BUFFER IN (51, 1) (INDEX, INDEX(2, 52))
IS THE MATHEWS ZONE tMZt IN THE INDEX
10 IF (INDEX (1, MZ)) GO TO 20
NO. WRITE ERROR AND ABORT
15 WRITE (61,100) MZ
100 FORMAT (t-NO DATA FOR MATHEWS ZONEt,I3,t SEE KEN KEELING)
CALL SBJP
POSITION THE RAF TO THE RIGHT PLACE
20 CALL SEEK (51, INDEX (2, MZ))
GET THE LENGTH OF THE TABLE
IEND = INDEX (1, MZ)
BUFFER IN (51, 1)
RETURN
END
LENGTH OF SU3PPOGRAM
00327
(ITAB,
ITAB(IEND))
APPENDIX B
43
OS3 FORTRAN
2
3
4
C
10
11
12
13
14
15
16
17
19
19
20
21
22
23
24
START ITA9 AT (2) SUCH THAT ITAB (1)
ITAB (1)
7
8
1148
1.;0 FORMAT (I2,I4)
5
q
11/11/75
PRnGRAM 7ORK
3IMENSTON ITAR (6C)
INTEGEP CMETERS
13 READ (6, 13'.) MZ, IFMS
1
6
VERSION 3.13
=
_
0
CALL GETMATAI (MZ, ITAB (2), IEND)
USE 1.87452 IF IFMS ASSUMED 800 FATHCMS PER SEC.
USE 1.98298 IF IFMS ASSUMED 821 FATHCMS PER SEC.
C
METERS = IFMS * 1.97452 + 0.5
C I1 IS INDEX FOR ITA9
I1 = METERS / 200 + 1
LE. TEND) GO TO 20
IF (11
WRITE (61, 1C1) MZ, IS
101 FORMAT (/3MATHEWS ZONE*,I3,* ELEMENT *,I2,* TOO DEEP FOR TABLE*)
CALL SBJP
INTERPOLATE THE CORRECTED METERS USING THE MATHEWS TABLE
C
(ITAB (I1+1)
20 CMETERS = METERS + (METERS - (I1-1)*200)/ 200.
- ITAB (I1)) + :ITAB (I1)
1
WRITE (61, 102) CMETERS
102 FORMAT (* CORRECTED METERS = *,I5)
GO TO 10
C
END
NO ERRORS FOR ZORK
LENGTH OF SUBPROGRAM
00250
44
MATHEWS ZONE
DEPTH
20)
23
-2
2+
-4
25
-5
4
4
400
-6
-7
-9
603
-9
-11
-14
800
1000
1200
1409
-11
-13
-16
-19
-14
-18
-21
-23
-19
-21
-25
-27
1603
1803
-20
-23
-26
-28
-30
-31
2000
2200
-24
-25
-28
-29
-34
-34
2430
-26
-30
-35
260J
2803
-26
-26
-31
-13
-35
-35
3000
-26
-3)
-37
3200
3403
3633
3800
4000
4200
440)
-23
-23
-2'
-18
-17
-12
-R
-4
-29
-2g
-24
-23
-35
-32
-32
-31
-27
-2E
-22
-18
46170
483)
50 00
520)
5400
4
-2J
-17
-14
-9
41
-14
-10
2
-1
-3
-5
-7
-9
42
1
0
-2
-4
-5
-7
-q
43
-1
-3
-6
-7
-9
-12
-14
-16
-18
-20
-21
44
45
0
-5
0
-13
-16
-19
-21
-23
-24
-26
-26
-24
-27
-30
-31
-34
-34
-35
0
-11
-12
-12
-13
-11
-12
-14
-15
-16
-14
-16
-21
-26
-36
-13
-12
-11
-15
-14
-13
-11
-lu
-21
-20
-17
-16
-15
-13
-10
-6
-3
-26
-26
-23
-23
-22
-1R
-6
-11
-21
1
13
20
9
13
17
-9
-3
5
C
-35
-34
-35
-32
-29
-29
-25
-20
-1R
-13
-7
9
7
-3
25
25
16
14
33
30
39
48
56
63
21
29
36
19
27
34
43
50
4
11
19
-9
-7
-5
-3
3
6
a
-8
-5
0
3
6600
71
83
6803
93
38
44
52
60
71
81
90
70 33
7207
7400
133
113
103
116
91
69
79
89
102
1'30
124
127
114
112
760J
138
139
126
7800
149
163
179
193
296
219
235
251
267
265
302
152
165
178
190
139
152
5600
5800
6000
6200
6400
80012
8230
8400
8600
8803
9003
9203
9403
9600
9833
`0003
-R
-13
-17
-20
0
:? 19
45
52
62
71
81
60
24
13
42
51
61
76
g1
Download