NBSIR 75-735

An Expandable Total Energy

Data Editor

Richard H. F. Jackson

Applied Mathematics Division

Institute for Basic Standards

Washington, D. C. 20234

Final

June 1975

Issued August 1976

Technical Report to Center for Building Technology

Institute for Applied Technology

Washington, D. C. 20234

Prepared for Department of Housing and Urban Development

Office of Policy Development and Research

Washington, D. C. 20410

NBSIR 75-735

AN EXPANDABLE TOTAL ENERGY

DATA EDITOR

Richard H. F. Jackson

Applied Mathematics Division

Institute for Basic Standards

Washington, D. C. 20234

Final

June 1975

Issued August 1 976

This report covers work done by the Applied Mathematics Division in collaboration with the Center for Building Technology under an inter- division agreement between the Building Environment Division and AMD

during FY 74 and FY 75. The work was in support of the HUD-MIUS Total

Energy project in Jersey City, sponsored by the Department of Housing and Urban Development.

Technical Report to Center for Building Technology

Institute for Applied Technology

Washington, D. C. 20234

Prepared for Department of Housing and urban Development

Office of Policy Development and Research

Wast-iington, D. C. 20410

U.S. DEPARTMENT OF COMMERCE, Elliot L. Richardson, Secretary

Edward O. Vetter, Under Secretary

Dr. Betsy Ancker-Johnson, Assistant Secretary for Science and Technology

NATIONAL BUREAU OF STANDARDS, Ernest Ambler, Acting Director

FOREWORD

The Department of Housing and Urban Development (HUD) is conducting the

Modular Integrated Utility System (MIUS) Program devoted to development

and demonstration of the technical, economic, and Institutional advantages

of integrating the systems for providing all or several of the utility

services for a community. The utility services include electric power,

heating and cooling, potable water, liquid waste treatment, and solid

waste management. The objective of the MIUS concept is to provide the

desired utility services consistent with reduced use of critical natural

resources, protection of the environment, and minimized cost. The program

goal is to foster, by effective development and demonstration, early

Implementation of the integrated utility system concept by the organization,

private or public, selected by a given community to provide its utilities.

A major building-block of MIUS is the on-site generation of electricity

with waste heat recovery, better known as "Total Energy." Although there

are good environmental and energy conservation reasons for adopting Total

Energy systems, specific detailed information on the costs of operating a total energy system for residential use is generally lacking. The Department of Housing and Urban Development has supported the construction of a test facility in Jersey City, N. J. to provide the information needed for

evaluating residential Total Energy.

The National Bureau of Standards, under contract to HUD, is obtaining the

needed data from the operating plant. Temperature sensors and fluid flowmeters measure the hot and chilled water systems and the fuel flow.

System loads, climatic factors, building space heating and cooling loads,

electricity and domestic hot water use, and environmental and economic

data are being monitored. On completion of the first year of operation,

a data base will be available for the first time on the operational

capabilities, limitations and efficiency of a Total Energy system.

Under HUD direction several agencies are participating in the HUD-MIUS

Program, Including the Energy Research and Development Administration,

the Department of Defense, the Department of Health, Education and Welfare,

the Environmental Protection Agency, the National Aeronautics and Space

Administration, and the National Bureau of Standards. The National Academy

of Engineering has provided an independent assessment of the Program.

This publication is one of a series developed under the HUD-MIUS Program

and is Intended to further a particular aspect of the program goals.

Drafts of technical documents are reviewed by the agencies participating

in the HUD-MIUS Program. Comments are assembled by one of the agencies

into a Coordinated Technical Review. The draft of this publication re- ceived such a review and all comments were resolved with HUD.

1
ABSTRACT

This report documents the Total Energy Data Editor as of January 31,

1975. It is a computer program developed to process the data to be

collected by the ongoing Total Energy Project at the National Bureau of

Standards. Consisting of a mix of FORTRAN and RAYTHEON machine language

subroutines, the Editor is a powerful, interactive program written to

be run on a Raytheon 704 minicomputer with two tape drives and a disk

pack. Since this document is also meant as a user's manual, it includes

a dictionary of commands, complete discussions and listings of individual

subroutines, as well as an explanation of the workings of the program.

ii
Contents Page

0. INTRODUCTION: THE TOTAL ENERGY DATA

EDITOR - WHAT IT IS 1

1. THE DATA EDITOR - WHY IT IS

WHAT IT IS 3

2. THE DATA EDITOR - WHAT IT DOES 4

3. THE DATA EDITOR - HOW IT WORKS 6

4. THE DATA EDITOR - HOW TO TALK TO IT 9

5. THE DATA EDITOR - HOW TO USE IT 14

6. THE DATA EDITOR - ITS PARTS (THE SUBROUTINES) 16

7. THE DATA EDITOR - HOW IT TALKS TO YOU 47

8. BIBLIOGRAPHY 50

APPENDIX A: SUBROUTINE LISTINGS A-0

INDEX TO APPENDIX A A-i

APPENDIX B: FORMAT OF RAW DATA INPUT TAPE B-0

APPENDIX C: FORMAT OF 1108 COMPATIBLE OUTPUT TAPE C-0

iii

0. INTRODUCTION: THE TOTAL ENERGY DATA

EDITOR - WHAT IT IS

This report documents the Total Energy Data Editor, as oC the "freeze

date" of January 31, 1975. It is a computer program developed to process

the data from a very specific source, namely the data collection effort

of the Total Energy Project at the National Bureau of Standards (NBS)

.

That project is concerned with investigating the feasibility of the

"total energy" concept (recycling waste heat produced by on-site generation of. electricity) , by studying the performance at a prototype site

consisting of high and low rise apartment buildings with its own power

plant in the central equipment building (CEB) . Approximately 300 electronic sensors were implanted throughout the site, measuring flows,

temperatures, and pressures at key points.

These measuring devices are wired into an automatic data acquisition

system (DAS) which automatically scans the measuring devices and takes a reading from each one every 5 minutes. Hereafter, one of these sets of

readings will be referred to as a "data scan." It is planned for the

data collection effort to operate for a full year. The data collected

in this manner are stored on magnetic tape and, every few days, a full

tape of data is shipped to NBS, edited on the Center for Building

Technology's RAYTHEON 704 minicomputer and then analyzed on the NBS

UNIVAC 1108.* See appendices B and C respectively for the format of a data scan and of a record on the edited tape.

The data editing requirements of the Project reflect the fact that large

quantities of data (3.2 x 10^ data values in the course of the year) are

to be collected, in operational rather than laboratory-like surroundings

(e.g., a power plant), by very sensitive electronic equipment, which

under the circumstances, must be expected to malfunction at times. In

view of these considerations, it was decided to use a hands-on approach

to data editing. Such an approach is clearly too expensive to execute

on a large batch process machine like the 1108, but is economically

feasible on the CBT-owned minicomputer. This is the background of the

decision to develop the package documented below.

The Data Editor program consists of a main program and 49 subroutines,

which are written either in FORTRAN or in RAYTHEON machine language. Its

ability to operate in an interactive mode is provided by certain subroutines which perform instruction interpretation. An extensive set of

instructions is available and provision was made for easy addition of

more at a later date.** It is a very core conscious program, because

throughout most of the Editor's development, the RAYTHEON had only 16,000

words of storage available. It was much later in the project that the

available core size doubled to 32,000. Consequently, some of the

*A more complete description of the Total Energy Project and its analysis phase can be found in [3].

**Since the "freeze" date for this documentation, that capability has

been successfully utilized by D.E. Rorrer of the Center for Building

Technology.

1
early efforts to save core storage which remain, may seem ridiculous

now. The reader is forewarned of this.

Appropriate points of discussion with regard to any computer programming

system are portability and versatility. Although the Data Editor was designed for the CBT-owned RAYTHEON 704, and although much of it had to

be written in machine language for reasons of efficiency, every effort was made to keep the program as general and portable as possible. The

modular construction discussed in the next section was useful in this

respect in that machine language subroutines were written to accomplish

very specific, restricted functions. In most cases, each routine could

be rewritten in another machine language or even in FORTRAN with little

effort, using the subroutine descriptions as a guide. On the other hand,

the Editor is quite versatile with respect to applications to different

data tapes. Some changes will be required in the Phase I programs (see

Section 2), but all are straightforward.

As a final note, it needs to be explained that the monitor referred to in

the next section (the user of the system, if you will) necessarily will be

someone familiar with the Total Energy project and with the kinds of data

problems that will occur. This is necessary in the early stage of the

year-long data processing effort because, as is discussed in Section 1, no one knows exactly what steps will be required in the performance of

a given edit, or in what sequence the steps will be performed. As a result, the Editor was designed to be flexible and to grow through

addition of new functions. As the editing process becomes more routine

in time, additional functions can be added to effect repetitious behavior,

and the familiarity restraint on the user could be removed.

The balance of this report consists of eight sections and three appendices.

Section 1 discusses the design philosophy of the Editor. Section 2 explains

the editing process by elucidating the three phases of an edit. Section 3

presents an "inside" view of the Editor, by explaining the structure of an Editor instruction and discussing how such an instruction gets translated

into an action. Section 4 offers a dictionary of the available instructions.

Section 5 describes what a typical edit might look like. Section 6 presents

each of the subroutines in the Editor with comments on its function. Section

7 explains the error messages that can appear. Section 8 is the bibliography.

Appendix A contains listings of the subroutines. Appendix B presents the

format of a data scan. Finally, Appendix C contains the format of the 1108

compatible output tape.

2
1. THE DATA EDITOR - WHY IT IS

WHAT IT IS

The design concept that was paramount in developing the Editor was flexibility through simplicity. This was required because, by the nature

of the project for which the Editor was developed, many of the data

problems the Editor would need to handle could not be identified in

advance. Those which were classical problems in data collection could

of course be anticipated and allowed for in the program design. It was

recognized, however, that many others would only be discovered once the

data collection, editing, and analysis processes had begun and would

then require resolution in a "real-time" mode.

The Data Editor, therefore, was designed from the top down, and created

from the bottom up. It was designed top-down, in the sense that the

whole data editing operation was looked at from the viewpoint of the person

(hereafter referred to as the monitor ) who will be seated at the RAYTHEON

704 performing the editing, and each of his major processes was then

broken down into its basic elements. (Those processes and their corresponding component elements will be discussed in more detail later.)

Those basic elements were then programmed as individual subroutines.

More subroutines which combine the basic elements were then written to

perform certain elementary functions. And then even more subroutines

were written, to combine these functions so as to satisfy the requirements

of the edit processes. Thus a hierarchy of "levels of subroutining" was developed, starting from the most elementary. These levels of subroutining are explained in greater detail in Section 6.

It is in this structure, and most especially in the breadth of the bottom

level of subroutines as well as in the simplicity of each of the members

of that bottom level, that the requisite flexibility of the Data Editor

resides. As the need for a new function is discovered, in most cases its

accomplishment should only require combining an already existing group of

subroutines. Even if additional bottom level routines are required, these

are by their very nature simple and easy to develop. Also, since everything is written as a subroutine, the inclusion of each new routine (and,

therefore, of the new fxinction being provided) requires almost no re- programming.

This structure should provide effectively for real-time resolution of new,

unanticipated data problems: every effort was made to provide all the

basic tools (in the bottom level of routines) likely to be required, and

the programming/reprogramming required to resolve such new problems should

be minimal.

3
2. THE DATA EDITOR - WHAT IT DOES

As indicated earlier, considerable time was spent in thinking through

what processes would be involved in what came to be called a "data edit."

The overall view of an edit of one raw data tape of information reveals

three phases.

The first phase is one in which each data scan is read; checked for

physical errors (bad format, parity errors, preemptive scans in the

middle of other scans, etc.); converted to binary from EBCDIC; reformatted so that all scans are of fixed length with the extraneous characters removed from each DAS channel measurement, leaving only the actual

measurement; recorded in the table of contiguous times which is later

used as an index into the file; and finally written onto the disk in the

next sequential record location. This continues until all records on the raw data tape have been processed, or until the disk file has been filled.

If any errors appear or occur during the execution of this first phase,

the automatic execution of Phase I stops and control is passed to the

monitor (the person doing the editing), who then corrects the error using

any of the commands designed for that purpose, and restarts the automatic

execution of Phase I.

The second phase of the data edit is the least automatic of the three.

It is also the most amorphous in that the monitor decides what must be

done to the data that is now disk resident. For example, a pass through

the complete data file (or a specific section) can be made to produce

some summary statistics* on the data, or to set certain status flags.

(Every data value has associated with it a status flag which provides information on the quality of the datum.) On the other hand, if the daily

log from the site indicates that a certain transducer appeared to be

recording erratically for a specified time, then the measurements from

that transducer for the time period in question could be printed out,

summarized or have its status flags set, and so on. When Phase I indicates no problems with the data, this phase can be bypassed and the

monitor can proceed with Phase III.

The third phase of the edit process is the one which produces the UNIVAC

1108 compatible output tape as well as an edit summary report. There is some automatic reformatting here, as well as some checking of the data.

Future plans include the installation at this point of much more error checking (e.g. a check to ensure that the times on the output tape are non-decreasing.

)

The edit summary produced during Phase III includes a report on changes

in status flag settings across the data records, and will eventually include such items as summaries of any interpretive comments inserted into

the data stream for clarification,

* STATS, the routine that produces the statistics had not been completed

by the freeze date for publication of this report. See section 6 for

its design specifications.

4
This phase is also automatic, but again, if an error occurs, control is

passed to the monitor who corrects the error, and steps the Editor

through each part of the third phase process until it is "in sync,"

in the sense of being positioned to begin the process of transferring

one data record to the 1108 tape, rather than in the middle of that process. When the Editor is in sync, the monitor can restart the automatic processing.

5
3. THE DATA EDITOR - HOW IT WORKS

The goal of this section is to explain in some detail the inner workings

of the Total Energy Data Editor. It is intended to provide the reader

with a "feel" for the subroutines in the Editor, and the manner in which

those subroutines interrelate. It does this by discussing the relationship between Editor command (listed alphabetically in the next section)

and internal subroutine, and also the relationships between command/subroutine and the phases outlined in the previous section.

The first item of concern to a user of the Data Editor is the structure

of an Editor instruction. The discussion of how the Editor works will

therefore be launched with an explanation of the command structure. The

command structure can also serve as a convenient vehicle for more

detailed explanations of the inner workings of the Editor.

An instruction to the Editor is composed of two basic parts: the command

word, and its parameters. The parameters of an instruction can be of

three types. The first kind of parameter is a "local" parameter, one that

is intrinsic to the particular command word. An example of this is the

"disk buffer print out" command*:

PO, 14, 29

where PO is the command word and 14 and 29 are the parameters which are transmitted to the subroutine POUTBF, and are used by that subroutine to

determine which words of the buffer to print out.

The second and third kinds of parameters in an instruction are, respectively, class variables and day/time references. These appear only in

commands which reference the disk-resident data file and define the

"two-dimensional area of interest" (AOl) block in that file. An example

of a command that requires these parameters is the "set data value"

command

:

SD, 19, X9, 281, 1905, 282, 0145

where 19 is a local parameter, X9 is a class variable (explained

below) , and the rest are the day and time references (also explained

below.

)

Before proceeding further, the concept of a two-dimensional area of interest should be explained. It is convenient here to view the disk

resident data file as a mass of data records, each 640 words long (consisting of 6 words of label information followed by 317 measurement

values followed by 317 status flag words) , all stacked one beneath the

other in space. The up and down dimension is provided by the time

*See Section 4 for a detailed explanation of the commands referenced in

this section.

6
associated with each scan. For example, in the above instruction, the

AOI block is defined to begin with the scan made on day 281 at 1905

hours, and to end with the scan made on day 282 at 0145 hours. But this

only covers one dimension of the AOI block. Since it is not expected

that one would want to change every data value in a particular scan, the

concept of a class variable defining the other ("across the top") dimension was introduced, A class variable is simply a variable that has been

defined (using the CV command) to represent a set of measurement variables

(or rather one or more of the 634 positions in the disk-resident scan)

.

More on class variables can be found in the explanation of the CV command

in Section 4.

Therefore, in the SD instruction given as an example above, the AOI block

is defined in the day-time dimension by 281,1405 and 282,0145, and in

the measurement variable dimension by the set of positions represented by

the class variable X9.

With the format of an Editor instruction presented, the next aim is to

describe what happens inside the editor to that instruction, from the

time it is typed in until the time the operation is complete.

The characters representing an instruction are read in by the MAIN program

in Hollerith format, converted to a special internal format by a call to

subroutine CODIT and the buffer containing those characters is passed to

subroutine GETCOM, which is concerned solely with instruction interpretation. The characters in the instruction are processed one-by-one and

each element of the instruction is built up. The characters in the

command are grouped together, and a function* is applied to the bits

which make up this grouping to produce an index into the symbol table

controlled by subroutine HASH, The parameters in the instruction are then processed one-by-one, independent of their meaning in the sense that

if the parameter is a number, the Hollerith characters representing it are converted to binary digits and the number is built up digit-by-digit.

If the parameter is a variable (see the SV and DV commands in Section 4)

,

its characters are also combined in the same sense that the command

characters were, and a hashing function is also applied to yield an index

into the symbol table, where the value of that variable is retrieved.

This process of parameter processing continues until all are processed.

At this point, control, as well as the buffer containing the interpreted

parameters, is passed back to MAIN which obtains the "command number"

from the symbol table, using the hashed command characters as an index.

This command number is then used in a computed GO TO statement to jump

to a subroutine CALL statement, which begins the next part of the process.

If the command was one of those that do not deal directly with the disk

data file, and consequently do not have the AOI block parameters as part

of the command, then this part of the operation consists simply of a

*Functions such as these are commonly referred to as hash functions.

7
CALL statement directly into the subroutine which perforins the function

requested; e,g, , an RT command causes a direct call to the RDTAPE subroutine.

If on the other hand, the command does have the AOI block parameters in

it and, therefore, requires access to a number of data scans on the disk,

control passes first to subroutine DRIVER. This subroutine's main role

is to interpret the AOI block and retrieve, in succession, the data scans requested. It does this by computing the relative position of each scan

in the data file, using information stored in TABLE, the table of con- tiguous time blocks which is maintained by subroutine UTABLE. Having

determined the position in the file, it causes the record to be read in

by a CALL to DSKRTS. Once the record is read in, DRIVER passes control

to the subroutine which is to perform the desired action; e.g., STDATA

to set data or status flag values, or DATTAP to reformat and output the

record to the 1108 compatible tape. When the subroutine finishes operating on the one record, it sends control back to DRIVER which writes

the edited scan back onto the disk, if necessary, gets the next record

needed, and continues on.

That, in brief, is the flow through the Editor as experienced by an instruction statement as it gets passed around. A more detailed understanding of the individual subroutines can be obtained by reading the

specification sheet for an individual subroutine given in Section 6 or by reading the listings which appear in Appendix A.

8
4. THE DATA EDITOR - HOW TO TALK TO IT

This section contains a dictionary of the Editor commands that had been

built in by the cut-off date for inclusion in this report. As mentioned

earlier, the Editor was designed to be dynamic and constantly growing,

in order to be able to resolve the new data problems as they arise.

This of course means that the list is not all inclusive, even as of the

date of this report; it is expected that updates will be issued periodically.

Section 3 of this report gave some information regarding the general

format of an instruction to the Data Editor. In that section, the

concept of a command word and its associated local and AOI block

parameters was introduced. It should be noted that the exact format of an instruction is the command word followed by a comma, followed by the

local parameters and then the AOI block parameters, all separated by commas. Within this overall structure, an instruction is free form in

that imbedded blanks are ignored and a comma followed by a comma or by a series of blanks and then a comma indicates a parameter with a value of zero. There is no end of line character. Nor is there a line continuation character. The import of the last comment is that all instructions

must fit on one 72 character line of the CRT. This affects only the CV

instruction, and special provision was made to handle more input for

that instruction.

The day-time references mentioned in Section 3 and referred to below as DljTl and D2,T2 have a special format: day (Dl and D2) is given as day

of the year, and time (Tl and T2) is given in the form of the 24 hour

clock. Thus, 9:15 PM November 18 would be input as 322, 2115.

Another point to mention is that by setting system flag 10 on the

RAYTHEON 704 before loading the Data Editor, all output written to the

CRT will be copied automatically when the CRT face becomes filled, provided that the CRT function switch is turned on. When the automatic

copying is complete, the face is erased and outputting continues.

A last point before providing the dictionary is that all instructions

in the dictionary are mnemomic. In what follows, the phrase from which

the mnemonic is formed is given, in most cases, in the first sentence of

its definition with the appropriate letters underlined.

* * *

BK,N,L

This command will cause logical unit L to be b^ackspaced over N records.

If N is negative, the unit will be skipped forward.

9
C8,D1,T1,D2,T2

C^reate the 1108^ tape. This causes all scans from day Dl, time Tl through

day D2, time T2 to be reformatted and written, along with their status

flags, onto the output tape. The data scans copied are currently residing

on the disk; and the output tape is mounted on the tape drive assigned to

logical unit 9. This command also checks the status flag settings across

the scans. If any settings change from one scan to the next, that information is printed out onto the listing device (logical unit 11), which is

normally the CRT.

CN

C^onverts, checks, and reformats the data scan currently stored in the

input buffer, and then rewrites it into the output buffer. The data scan

is converted from individual EBCDIC characters to individual binary

representations of single digits, then grouped into binary values which

represent the measured value, (checked during this process for character

legality), and finally stored in the proper place in the output buffer.

If any illegal characters are encountered during the conversion, a message to that effect is printed on the CRT.

CV,A,S,N1,N2,. , . ,N25

This is the £lass variable processing command. A class variable is one that is used to represent a number or set of measurement variables. The

set could be defined to be all temperature measurements or all pressures,

for example. The representation is by position in the disk data record

and is defined, redefined and "undefined" with the CV command.

Here, A is the name of the variable being referenced or defined. It can be any two characters from the set of letters and numbers, but the first

must be a letter and the resulting name must be different from the

command names as well as all previously defined variable names. S in

the command is a switch. If S"=0, this class variable is being defined

to represent the measurement variables occupying the (not necessarily

contiguous) positions N1,N2, . . . ,N25. If S<0, the class variable A will

be deleted from the class variable table. And if S>0, class variable A

will be expanded to include the additional positions N1,N2 , . . . ,N25 in

its definition along with its previous values. It should be noted that

25 is the upper limit on the nimber of positions in one CV command only

because one line of input from the CRT can contain no more than 72

characters and there is no provision for continuation lines.

DB,N

This command causes the value of the internal variable DEBUG to be set

to the value N. If N>0, the debugging prints associated with subroutine

N will be printed each time that subroutine is entered. The subroutine

numbers are:

10
1. MAIN 2. GETCOM

3. HASH 4. INHASH

5. DEHASH 6. INIT

7. CLASS 8. COMINT

9. ERRPRT 10. RDTAPE

11. CONALL 12. POUTBE

13. HEXDMP 14. UTABLE

15. DRIVER 16. DSKRTS

17. DATTAP 18. EX

-19. STDATA 20. C\TROC

A value for DEBUG of zero, of course, turns off all debugging prints.

DV,A

D_eletes a variable A and its associated value from the symbol table.

See the SV command for more,

EX

This command terminates an editing run and exits to the RAYTHEON system.

Before terminating the run, it performs a clean-up function by tying

off all loose ends in the editing run (e.g. the closing out of the disk

files) . Current plans include extending this routine to allow for

storing enough information to provide a restart capability if it becomes

necessary to abort an edit run before completion.

GS,N

_Gets the data _scan that occupies the N'th position (starting from 1) on the disk file, and copies it into the disk buffer. Note that this works

strictly by position on the disk, not by day and time.

ro,Nl,N2

Provide a h.exadecimal _dump of the characters numbered XI through N2 in

the raw data buffer.

LS,N1,N2,N3

I,eft jhifts by Nl positions, the characters from N2 through N3 of the

raw data buffer. This command also zero fills the positions shifted out

of. CAUTION: It is extremely important not to shift beyond the limits

of the buffer, since this will destroy other areas of core with

untoward consequences.

N¥,N

Sets the value of the internal variable XTAR to N, NVAR represents the

number of DAS channels (measurement variables) that were scanned and

subsequently recorded on the raw data tape that is about to be processed.

If set too large, error messages will appear the first time a record is

read. If set too small, data will not be transferred and will thus be

lost during the transferring in a RT instruction.

11
PO, N1,N2

This coinmand is used to 2.^1nt o^ut the contents of the disk buffer. The

label characters are printed first, followed by the values in positions

Nl through N2. If N2 is G or does not appear, just position Nl is

printed. If neither Nl nor N2 appear, or are both 0, only the label is

printed on the CRT.

RS,N1,N2,N3

Right ^hifts by Nl positions, the characters from N2 through N3 of the

raw data buffer. See the discussion of the LS command for more.

RT,N

Reads one record from the raw data _tape and copies into the raw data

buffer the data in its original vmconverted form (EBCDIC characters - 13 per DAS channel) . N is the number of characters in the record to

skip before beginning the transfer.

RW,L

Rewinds logical unit L.

SD,V,A,D1,T1,D2,T2

This command provides the capability for s^etting the value of d.ata words

or their associated status code words. In the command string, V is the

value the words will be set to; A is either a number representing the

position in the data scan to be reset, or a class variable (previously

defined) representing a set of positions to be all set to V; Dl and Tl are the day and time of the first data scan on the disk to be thus set;

and D2,T2 are the day and time of the last disk-resident data scan to

be thus set.

SE,N,L

Positions logical unit L past the N'th end-of-file. A message is

printed indicating the number of records skipped (including the ends-offile). The mnemonic is from "s^eek end-of-file".

SK,N,L

Positions logical unit L beyond the N'th record. The mnemonic is from

"skip a record".

SP,N

^ets to N the update £olnter word in the I/O control block of the File

Control System (FCS) . When used in conjunction with the US command, it

allows the writing of the contents of the disk buffer to a specified

record position on the disk.

*Since the freeze date for this report, the option to skip characters

before reading has been installed in a separate command.

12
SV,A,N

Creates a variable, A, and _sets its value at N. Any subsequent commands

in which A appears as one of the arguments will have the value of A (N

in this case) substituted for it. Restrictions on the variable name A, are the same as those described under the CV command.

TR,N,K

Transfers raw data to the disk by traversing, N times, the loop of

reading a raw data record from the data tape, converting, checking,

regrouping, reformatting, indexing, and finally writing the information

on the disk. After every k records are transferred in this manner, the

command produces a message on the CRT indicating this fact.

US

Updates a _s_can by writing the data scan that currently resides in the

disk buffer on the disk as the N'th record on the disk, where N is the

current value of the disk update pointer in the FCS I/O control block.

The update pointer is set explicitly by using the SP command. It can also be set implicitly by the GS command, since every time the OS

command is executed, the update pointer is automatically set to the

position of the record just transferred.

WE,L

Writes three ends-of-file on logical unit L.

WS

Write the data _scan currently disk buffer resident onto the disk in the

next available record position (usually at the end of the file)

.

13
5. THE DATA EDITOR - HOW TO USE IT

In this section, the reader is presented with a typical edit process.

The intent is to provide an understanding of how everything fits together

into a cohesive system which performs the desired data editing function.

No attempt will be made here to explain how to operate the RAYTHEON 704.

The Data Editor is a system resident routine on that machine, and the

monitor will load the program before the editing process begins.

The editing process begins with mounting the raw data tape on the 9 track

tape drive. Having done so, the monitor responds to the Editor's

instruction query (a "?") with a TR command to begin the transfer of

data scans from the tape to the disk. If any errors occur, the program

prints error messages and waits for the monitor to decide what to do

about the errors. If the errors are of the illegal-character-type, the

monitor can attempt to fix the characters by dximplng the content^ of the

EBCDIC input tape buffer to determine what the character should be, and

then setting the proper value with the SD command. If it is impossible

or deemed improper (in order to maintain the integrity of the data) to

fix data values in this way, the monitor can simply use the SD command

to turn on the status flag bits associated with the measurement

containing the illegal character. Having done this, the monitor can restart the automatic transfer by stepping the editor through the

completion of the transfer loop (using combinations of the RT,CN, and

WS commands) until it gets back "in sync", and then by giving another

TR command.

Another problem that can occur at this point is the discovery of a preemptive scan. A preemptive scan is one that results from some alarm

condition at the site and might override the recording of a regular scan,

with the result that the preemptive scan starts in the middle of the

regular one and the tape record is larger than normal size. If this

error occurs, the monitor will fix it by using the RS command to move

the preemptive scan characters out of the normal scan and using the WS

command to store the regular one. Then, by using the BK command to

backspace over the record and the RT command to skip over the good scan characters and fill the buffer with just the preemptive scan characters,

the monitor can reorganize the records so that they conform to format.

Then the Editor is stepped through the transfer loop as outlined above

and restarts the process with another TR command.

Once all the records have been transferred to disk, the Phase II perusail

process tsegins. Any flags or data values that need to be set, will be

set by using the SD command. Anecdotal comments are Inserted, statistics

gathered, and data values perused for correctness.

Once all is considered well with the data, the monitor will give a C8

command. This begins the process of transferring the scans to the 1108

compatible tape which is normally mounted on the 7 track tape drive. The only

error messages that could appear will have to do either. with physical

tape problems (which require mounting a new tape and restarting this phase)

,

14
or with out-of-sequence scan times (which require retyping the C8

command) . When the data have all been reformatted and transferred to

the output tape, the WE command Is used to endflle the tape. The EX

command Is then given to get out of the program and the day's edit is

complete.

15
6. THE DATA EDITOR - ITS PARTS (THE SUBROUTINES)

This section describes the individual subroutines that comprise the

Data Editor, each one in turn, in a "specification sheet" manner. There

is an entry for each subroutine in the system, as well as for routines

that have not been written as of the date of this report. These last are part of the overall design of the Editor, and as such are intrinsic

to any discussion of the work done on it. These unfinished subroutines

appear below with the word "FUTURE" after their names. They are left

as future work on the Total Energy Project.

In an attempt to provide somewhat of an overview, we first present here

a list of all subroutine names, grouped as to whether they are involved

in instruction interpretation, or are level 1, 2 or 3 routines (see section

2) . The names marked with an "*" are machine language routines written by

D. E. Rorrer of CBT.

LIST OF SUBROUTINES

Instruction Interpretation

MAIN

Level 3

CR8TAP-FUTURE

Level 2

ADDTIM-FUTURE

DATTAP

GENTXT-FUTURE

RDTAPE

UTABLE

Level 1

ADRESS*

CLOSE*

CONATE*

CREATE*

. DEHASH

DSKUPD*

HASH

LSHIFT*

OUTINT*

READMT*

SEEKEF*

UNSPLT*

GETCOM

DRIVER

CONALL

DSKRTS

INIT

STATS -FUTURE

BACKSP*

CODIT*

CONETA*

DECDIT*

DSKINT*

DSKWT*

HEXDMP

OPENIT*

OUTTXT*

RSHIFT*

SKIP*

WRITEF*

READIN*

TRNRAW

CVPROC

EX

PDISK-FUTURE

STDATA

CLASS*

COMINT*

CONGRP*

DELETF*

DSKRD*

ERRPRT

INHASH

OUTHEX*

POUTBF

RWNDIT*

SPLITA*

WRITMT*

16
ADDTIM-FUTURE

FORTRAN REFERENCE:

CALL ADDTIM(PAR,MPA)

FUNCTION:

To place a new group of time entries on the KALNDR for a record that had been created previously by one of the nondata record generators,

ERROR CONDITIONS:

Out of space in KALNDR.

COMMENTS

:

KALNDR is a linked list which stores, linked by time, a file reference number and a time associated with that file.

The file referenced is a file of anecdotal or calibration

information which is to be included on the output tape just

before the data scan whose time is the same as that stored

in KALNDR. Those "non-data" files are created by GENTXT.

ADRESS

FORTRAN REFERENCE:

CALL ADRESS (VAR,IADR)

FUNCTION:

To retrieve the absolute address of a variable or subroutine

entry point.

ERROR CONDITIONS:

Variable must be defined within FORTRAN.

COMMENTS

:

Either one or both of the arguments can be array elements.

This is a machine language subroutine.

BACKSP

FORTRAN REFERENCE:

CALL BACKSP(N,L)

FUNCTION:

To backspace N records on unit L.

ERROR CONDITIONS:

Load point reached before completing the command.

COMMENTS

If N<0 on output, the load point was reached. If N 0 on input,

this subroutine is equivalent to the SKIP subroutine. In any case on return, |N| is the number of records skipped over. This routine was written in machine language so that it would

not be necessary to include the RAYTHEON'S FORTRAN tape library

routines which use an amount of core storage inordinate for this

application.

17
CLASS

FORTRAN REFERENCE:

KARCLS = CLASS (K)

FUNCTION:

This integer function subroutine is used by GETCOM to

determine the character class of a given character, for use

in the finite state transition table, (presented in the

documentation of subroutine GETCOM) , which governs the

decoding of an Editor instruction.

ERROR CONDITIONS:

Only as given below,

COMMENTS

:

CLASS (an subsequently KARCLS in the statement

be set as follows :

CLASS = 1, if 10<K<35, (letters)

;

CLASS = 2, if 0<K<9 (digits)

;

CLASS = 3, if K = 36, (comma)

;

CLASS = A, if K = 41, ( $ );

CLASS = 5, if K=38 or K=39, (+ or - signs)

;

CLASS = 6, otherwise (error)

.

This routine is written in machine language.

CLOSE

FORTRAN REFERENCE:

CALL CLOSE (IOT,L)

FUNCTION:

To close out the file referenced in the file control block (lOT)

ERROR CONDITIONS:

As noted below.

COMMENTS

:

This is a machine language routine that sets up to call the

CLOSEFL routine of the RAYTHEON disk File Control System (FCS)

lOT is the Input/Output table described in the documentation

of FCS, and L is a status word set by this routine. If L>0

the operation is complete, no error occurred and L contains

the number of words transferred. If L<0, an error occurred,

and the absolute value of L corresponds to the error codes

given in the FCS documentation (see p. 39 of [l])

.

CODIT

FORTRAN REFERENCE:

CALL CODIT (IBUF1,IBUF2,N)

*See the documentation for subroutine CODIT for more on the internal

coding.

18
are 0 t are 10

is 36,

is 37,

is 38,

is 39,

is AO.

is 41, are 42.

FUNCTION:

To convert the N characters, stored two to a word in IBUFl,

from ASCII to the Editor's internal code and store them one

to a word in IBUF2.

ERROR CONDITIONS:

None, since illegal characters have a code and are dealt with

elsewhere

.

COMMENTS

:

The Editor's internal code is:

0 through 9 A through Z

blank

+

*

$

all others

Note that IBUF2 must be twice the size of IBUFl. The two buffers

may be the same, in which case no more than half of the buffer may

contain data. This machine language routine was written at a time

when both a PDP-IO and the 704 were being used for development of

the Editor and it was necessary to create a machine independent

internal representation.

COMINT

FORTRAN REFERENCE:

CALL COMINT (IBUF,N,IERR,IVAR)

FUNCTION:

To convert the N digits stored in separate continguous words

of IBUF into one binary number, and store it in IVAR.

ERROR CONDITIONS:

If IVAR>32767 or IVAR<-32767, then IERR=99 . If an illegal

character is encountered in IBUF, lERR is set to that character. Otherwise, IERR=0.

COMMENTS:

This is a machine language subroutine.

CONALL

FORTRAN REFERENCE:

CALL CONALL ( INBUF ,MIN , OUTBUF , MOU , lERR)

FUNCTION

:

To convert the data scan stored in INBUF from EBCDIC characters

to individual binary values and store them in OUTBUF.

19
ERROR CONDITIONS:

None that are intrinsic to CONALL. The errors that cari occur and are printed out as a result of a call to ERRPRT from CONALL, are errors that occur in the subroutines that CONALL calls. Those

errors are explained in those subroutines or in Section 7.

COMMENTS:

This is the routine one calls by giving the editor a CN command.

It is a level 2 routine and functions by setting up arguments

required by the level 1 routine it calls which do the actual work

of converting.

CONALL operates first on the 19 EBCDIC characters that form the

header. These are converted into 19 binary values and stored in

OUTBUF by a CALL to CONETA. The first 12 digits representing the

label are then combined into 3 binary values by 3 CALL's to COMINT,

The 3 digits representing the day are then combined into one value

and stored in OUTBUF by another CALL to COMINT. Next, the same

is done to the 3 digits representing time. Finally, CONALL causes each of the 13 character measurement groups to be converted and

combined into the 5-value measurement groups that appear in the

output buffer, OUTBUF. The conversion of the measurement groups

is effected by CALL's to CONGRP.

. .; CONATE

FORTRAN REFERENCE:

CALL CONATE (IBUF1,IBUF2,ICNT,IERR)

FUNCTION:

To convert ICNT ASCII characters from IBUFl to EBCDIC and store

them in IBUF2.

ERROR CONDITIONS:

lERR will be set to the number of illegal characters encountered.

Each such character will be set, in IBUF2, to a zero. COMMENTS

:

IBUFl and IBUF2 may be the same buffer, but in any case are single integer arrays with the data packed two characters per

word. This is a machine language routine.

CONETA

FORTRAN REFERENCE:

CALL CONETA( IBUFl, IBUF2, ICNT, lERR)

FUNCTION:

To convert ICNT EBCDIC characters from IBUFl to ASCII and

store them in IBUF2.

20
ERROR CONDITIONS:

lERR will be set to the number of illegal characters

encountered. Each such illegal character will be set

to an ASCII

COMMENTS

:

This is simply the reverse of CONATE, and all comments there

apply here. This subroutine is written in RAYTHEON 704 machin

language

.

CONGRP

FORTRAN REFERENCE:

CALL CONGRP (IBUF,IGRP,N,IFLAG)

FUNCTION:

To convert the 13 EBCDIC characters, beginning with the Nth

character, of IBUF, into 5 distinct binary values and store

them in IGRP.

ERROR CONDITIONS:

The 4th through the 16th bits of IFLAG will be set according

as any of the Nth through the (N+ 12) th characters of IBUF

are illegal. IFLAG=0 means no errors. If an illegal character appears, the corresponding word of IGRP will be set to

negative zero (1 000 000 000 000 000)

.

COMMENTS:

The values stored in IGRP are as follows:

IGRP(l) = scanner channel number;

IGRP(2) = remote number if data was from a remote, otherwise = -1,

IGRP (3) = the DVM function (M or V)

;

IGRP(4) = the measurement value (including sign over-range fla

and voltage digits) ; and

IGRP(5) = the scale digit.

for more on this, see the listing in the appendix.

This is a machine language routine.

CR8TAP-FUTURE

FORTRAN REFERENCE:

CALL CR8TAP (PAR , MPA, TABLE , MTAl ,MTA2 , OUTBUF ,MOU , CLSTAB ,MCL

)

FUNCTION:

To do everything necessary to transfer from disk and core to

the 1108 compatible tape all information (at this point edited

and clean) associated with the time interval defined in PAR.

It will also have dominion over the production of the edit

summary.

21
ERROR CONDITIONS:

The primary CR8TAP error condition would be an overlap of the

time interval requested with the already-tape-resident time

Interval. There are, of course, many other error conditions

that could occur during the run of this routine, but they occur in lower level routines called by CR8TAP and are

- discussed in the documentation of those routines.

COMMENTS

:

This is a level 3 subroutine (see section 2) and is

consequently one of the more powerful (and important) ones. Its method of operation is first, to check KALNDR for the

first non-data record to be transferred to tape. It will

then have all data records with time-of-scan values less

than the time of that KALNDR entry transferred to the tape.

(DATTAP, the routine called by CR8TAP to effect this, also

produces a summary report on status flag changes over the

records it transfers.) As each non-data record is written

onto the tape, it is also printed out as part of the edit

summary. This processing cycle continues until all information

associated with the time interval stated in the instruction

(stored in PAR) has been transferred.

Upon completion of the transferring function, CRBTAP will

then move into its clean-up phase, wherein all core storage

areas left behand must be cleaned up and "freed" for future

use by the Editor. The KALNDR and possibly the non-data

files must be cleaned up. It is also possible, yet unclear

this point that TABLE, the time table of contiguous times (see

UTABLE write-up) and the data files need to be cleaned up and

their space made available.

CREATE

FORTRAN REFERENCE:

CALL CREATE (IOT,L)

FUNCTION:

To create a disk file as described in the file control block,

(lOT)

.

ERROR CONDITIONS:

As described in documentation of subroutine CLOSE.

COMMENTS

:

This is a machine language routine that provides the linkage

to get to FCS's routine CREATEFL. See subroutine CLOSE for

more

.

22
CVPROC

FORTRAN REFERENCE:

CALL CVPROC(PAR,MPA,CLSTAB,MCL)

FUNCTION:

To define, delete, or redefine a class

the parameters from the CV instruction

CLSTAB is the class variable table.

ERROR CONDITIONS:

There are three error conditions, each

error print. They correspond to error

and are defined in Section 7 (q.v.).

COMMENTS

:

PAR(3) corresponds to S in the CV instruction (see section 4)

.

It is -1,0, or 1 according to whether one wants to delete,

define, or redefine a class variable. PAR(2) contains the

encoded variable name* which is used as an index into the

symbol table controlled by subroutine HASH. The value of

the class variable in the symbol table is a pointer into

CLSTAB to retrieve the set of measurement variable positions

that the class variable represents. PAR(4) through PAR(MPA)

contain the positions. Pictorially, the class table (CLSTAB)

is

:

symbol symbol

table Nl VI V2 VNl table N2 VI V2 W2 -1

index index

where "symbol table index" is PAR(3) above, N1,N2, etc. are

in each case the number of members of the class, and VI, V2,

etc. are the positions. There is a -1 at the end of it all.

A class variable is defined simply by adding its information

to the end of CLSTAB beginning V7ith the position occupied by

-1. A deletion is performed by removing the cells allocated

to a class variable and repacking the table. A redefinition

is performed by adding the additional positions to the end of a class variable definition, and for that reason cdn only be

done on the class variable that is occupying the last physical

positions in CLSTAB. If it is desired to redefine one that is

not last in the list, the user must first delete the variable

and then start all over.

*For more on the encoding, see the CODIT and GETCOM write-ups.

variable. PAR contains

(see section 4) and

with an associated

types 17,18, and 19,

23
DATTAP

FORTRAN REFERENCE:

lERR - DATTAP(PAR,MPA,OUTBUF,MOU,CLSTAB,MCL,WRTSWT,LRECF)

FUNCTION:

To transfer the data record in the disk buffer (OUTBUF) to the

1108 compatible tape. Also, to produce a local edit summary

consisting of changes in status flag settings from the previously transferred data record.

ERROR CONDITIONS:

Error returns from WRIIMT routine which signal an unrecoverable

write error on the output tape.

COMMENTS

;

The status flag check is performed by a bit-by-bit logical

OR over all the status flags in the scan. This "sum" is

compared against the same value for the previous scan sent

out. If different, a message is printed stating that fact.

Of course, this is a valid check only if the flags are stored

in independent positions in the status flag word.

DECDIT

FORTRAN REFERENCE:

CALL DECDIT (IBUF1,IBUF2,N)

FUNCTION:

To convert the N characters stored one to a word in IBUFl from

the internal code back to ASCII and pack them two to a word in

IBUF2.

ERROR CONDITIONS:

None

COMMENTS:

The internal code is explained in doctnnentation for subroutine

CODIT. This is just the reverse of that routine. IBUFl and

IBUF2 may be the same storage area. This is a RAYTHEON

machine language routine.

DELETE

FORTRAN REFERENCE:

CALL DELETE (IOT,L)

FUNCTION:

To delete the file described in the file control block (IDT)

from the disk, and free its space for further use.

24
ERROR CONDITIONS:

See CLOSE documentation.

COMMENTS

:

This is just an interface routine to get to FCS's routine

DELETEFL. See CLOSE documentation for more.

DEHASH

FORTRAN REFERENCE:

CALL DEHASH (KEY)

FUNCTION:

To delete a variable name and value from the symbol table

controlled by the HASH subroutine.

ERROR CONDITIONS:

KEY request not found in symbol table.

COMMENTS

:

This KEY is the very same one used by HASH as an index into

the symbol table.

DRIVER

FORTRAN REFERENCE:

CALL DRIVER (FUNC , PAR , MPA , TABLE , MTAl , MTA2 , OUTBUF , MOU , CLSTAB , MCL)

FUNCTION:

To serve as a controlling point for all routines that require access to the disk stored data scans. It performs all

operations required to translate the day and time requests (see

section 4 on the structure of a command) stored in PAR, into

disk accesses which bring the desired records into core one

at a time. Upon this, control is transferred to the subroutine

name received in argument FUNC.

ERROR CONDITIONS:

Error status is controlled by subroutines that DRIVER calls.

If one of these returns in an error condition, DRIVER closes

out the file and passes control to MAIN which then calls for

another instruction. Disk operation errors could also occur,

but these are explained elsewhere. A last error condition

that DRIVER contains is one where the requested times are just

unknown.

25
COMMENTS

:

TABLE is the table of contiguous times (see subroutine UTABLE)

,

OUTBUF is the disk buffer, and CLSTAB is the class variable

table (see CVPROC documentation) . Note that those arguments

required by the routine that DRIVER will call, must be passed

into DRIVER, so that if new subroutines are added that will

deal with disk stored data scans, and these routines require

parameters not already in DRIVER 's calling statement, then

DRIVER must have its SUBROUTINE statement expanded.

DRIVER maintains a logical variable which tells it whether

to update the disk scan that it had read and passed to the

subroutine requested. This switch (WRTSWT) is set in the

called routine.

DRIVER also maintains a switch (LRECF) which signals that

the currently stored scan is the last one requested, so that the called routine can finish out its operation if

necessary (e.g. STATS).

Note that DRIVER passes off to its routines by a FUNCTION

subroutine reference. Due to the vagaries of the RAYTHEON

704 FORTRAN compiler, this is the only way to pass the name of

a subroutine as an argument in a subroutine CALL.

A future addition to DRIVER will be one to provide for storing

the day-time and class variable requests that appear in PAR,

so that once input, they can be optional in subsequent commands

if the same ones are desired.

DSKINT

FORTRAN REFERENCE:

CALL DSKINT (10T,L)

FUNCTION:

To provide the linkage to FCS's routine INITLIZE which prepares

the disk for use.

ERROR CONDITIONS:

See documention for subroutine CLOSE.

COMMENTS

:

This routine also completely cleans out the disk files there, so that all space is ready for use. Note that this is a function of the linkage routine and is not a service provided

by FCS. For more, see subroutine CLOSE.

26
DSKRD

FORTRAN REFERENCE:

CALL DSKRD (TOT, L)

FUNCTION:

To link up ^n.th FCS's routine GETREC which brings a record,

described in the file control block TOT, into a buffer (in

the Data Editor's case, OLTTBLT) .

ERROR CONDITIONS:

See vrrite-up of CLOSE.

COMMENTS

:

The 27th word of lOT is the one that tells FCS which block on the disk to retrieve. FCS starts counting blocks from zero, so that if one wants the first record that was written to the

disk then I0T(27) = 0, the second record requires I0T(27) = 1,

etc. See CLOSE for more.

DSKRTS

FORTRAN REFERENCE:

CALL DSKRTS (OUTBLT , MOU, N , I COM , lERR)

FUNCTION:

To provide a central routine through which to read, write,

or update a disk record.

ERROR CONDITIONS:

Error returns from DSKRD, DSKWT, DSKLTD, w'hich force an error print from this routine.

COMMENTS

;

In a system as complicated as the Data Editor, it makes good

programming sense always to open, operate on one record within,

and then close out a disk file rather than to open it once in

the beginning of processing and close it at the end of a day's

editing. This principle and the nature of the RAYTHEON'S

disk File Control System, necessitated some seemingly redundant

bookkeeping in the I/O control blocks (lOCBD) . Rather than

have that bookkeeping appear everywhere a disk operation was

required, this level 2 routine was t-rritten to centralize the

disk accessing. See CLOSE for more.

DSKLTD

FORTRAN REFERENCE:

CALL DSKUPD(IOT,L)

27
FUNCTION:

To provide the linkage to FCS's routine UPDATE, which updates

(rewrites, or overwrites) the record on the disk that Is

described In the file control block (lOT)

.

ERROR CONDITIONS:

See CLOSE documentation.

COMMENTS

:

This is the only way to write a record to disk in other than

the next available location at the end of the file. The

pointer used by DSKUPD (or UPDATE in FCS) is I0T(31). It is

automatically set when a DSKRD (or GETREC in FCS) operation is

performed, so that one can read, revise, and immediately

rewrite, without having to set anything. But one can also set

the pointer independently. See CLOSE for more.

DSKWT

FORTRAN REFERENCE:

CALL DSKWT (IOT,L)

FUNCTION:

To link to FCS's routine PUTREC which writes the contents of

the buffer referred to in the file control block (lOT) into

the next available location in the disk file that is also described in lOT.

ERROR CONDITIONS:

See CLOSE write-up.

COMMENTS

:

This routine can only write to the next available space. The

PUTREC pointer described in FCS manual (see p. 26 of [1]) is

in error. It is not possible as indicated there, to PUT a record wherever you want by setting the PUTREC pointer.

For more on this routine, see CLOSE.

ERRPRT

FORTRAN REFERENCE:

CALL ERRPRT(ISUB,MESS, lARGl, IARG2 , IARG3, IARG4, IARG5)

FUNCTION:

To print an error message.

ERROR CONDITIONS:

None

28
COMMENTS

:

The components of an error message are: the name of the

subroutine in which the error occurred, the type number of

the type of error, and the arguments that were relevant to the error. The subroutine name is stored as Hollerith characters

and ISUB is a pointer to the name needed. MESS is the number

of the message (see the appendix) . If the error was a disk

error, EKRPRT also produces a hexadecimal dump of the disk I/O

control block. The arguments through lARGA are printed in

integer form and IARG5 is dumped in hexadecimal format.

EX

FORTRAN REFERENCE:

CALL EX

FUNCTION:

To "clean up" and exit to the system.

ERROR CONDITIONS:

None as yet.

COMMENTS

:

At present, almost no cleaning up is done by EX. Future

plans include options such as the writing out onto disk of

the I/O control blocks used to access the disk, the time

table used as an index into the data scans, perhaps even the

class variable table (CLSTAB) and the hash table (KEYS and

VALUES) . These and others would be stored so that one could reenter the Editor in a restart or continuation mode.

GENTXT-FUTURE

FORTRAN REFERENCE:

CALL GENTXT

FUNCTION:

To add a file of anecdotal information to the non-data area of

the disk.

ERROR CONDITIONS:

No more disk space left for such information.

COMMENTS

;

These anecdotal comments are statements, usually copies of

entries from the site log that would be valuable to

subsequent researchers looking at the data. They might be

coimnents to the effect that a particular measuring device

(e.g. thermocouple no. 634) was taken out and replaced with

a new one at 1345 on day 319. This information is then associated

with a time on KALNDR through the ADDTIM subroutine and merged

29
in the output tape at its appropriate place by the CR8TAP

routine

.

GENTXT works by first creating a file, then switching into

input mode where it requests one line of text at a time from

the CRT. It continues in this fashion until the disk buffer

is full, whereupon it writes that buffer-full into the file,

and starts over requesting input. This cycle continues until

a line with naught but END In cols. 1-3 is encountered, whence

it pads out the remainder of the buffer, writes it out and

sends the message containing the file reference number, to

be used in the ADDIIM subroutine, back to the CRT.

GETCOM

FORTRAN REFERENCE:

CALL GETCOM (COMMND,MCO,FCT, PAR, MPA, FLAG)

FUNCTION:

GETCOM is the heart of the interface between the user's typedin instructions and the Data Editor's subroutine calls. It's

function is to get the command instruction stored as alphanumerics in COMMND, and convert it into a subroutine index

number, stored in FCT, and a set of subroutine parameters,

stored in PAR.

ERROR CONDITIONS:

Reference in the instruction string to an unknown variable,

and incorrect instruction structure. This last is explained

in detail below, but one example is discovering a sign (+ or -)

embedded in a string of digits. In either of these cases,

FLAG is turned on.

COMMENTS:

GETCOM decodes and interprets the instruction string,

character by character, through the use of a finite state

transition table. As each character in turn is removed from

the strings, its character class is determined by a call to

CLASS. Given the class of the character at hand (a number

from 1 to 6), and the current state of the decoding process

(a number from 1 to 9), the two dimensional finite state

transition table yields the new state of the process. In

other words, knowing where we came from and what type of

character we have, the table tells us what to do next.

There are 10 states that GETCOM can be in:

1. ) Idle,

2. ) Command character interpretation,

3. ) Argument processing initialization,

4. ) Variable argument processing

5. ) Variable argument value retrieval.

30
60 Numeric argument processing,

70 Argument value storage,

80 Normal termination,

90 Numerical sign processing.

10 0 Error termination.

The six possible character classes are 10» Letter (A - Z)

,

20I Number (0 - 9)

,

30 Comma ( , )

,

AOI End-of-string character ($),

50) Sign (+ or -) , 60) Other.

With the above state and character class definitions in

mind, we present below the finite state transition table

used by GETCOM.

CHARACTER CLASSES

1 2 3 A 5 6

1 2 1 1 10 1 1

2 2 2 3 8 10 10

s

3 A 6 7 7 9 10

T

A

4 4 4 5 5 10 10

T

E

5 4 6 7 7 9 10

S

6 10 6 7 7 10 10

7 4 6 7 7 9 10

8 10 10 10 10 10 10

9 10 6 10 10 9 10

In order to illustrate the use of the transition table

without going into too much detail, one set of state

transitions will be explained here. Consider state 4, the

variable argument processing state. Its transition entries

are: 4, 4, 5, 5, 10, 10. The interpretation is that if the

current state of the system is 4 and the next character in

the instruction string is a letter, then we stay in state 4

and control in the program is transferred (by use of a COMPUTED GO TO using 4) to a section of code that builds up

the variable name. If the next character is a digit, the

31
the same applies since a variable name can consist of any 2 characters so long as the first is a letter, which situation

is guaranteed at this point by the fact that we are already

in state 4. However, if the next character is either a comma

or the end of the string we move to state 5 which attempts to

retrieve the value of the variable from the symbol table by

calling HASH. If the next character is a numeric sign, this

is an, error since imbedded signs are not allowed. Finally, an illegal character also sends control to the error termination

state 10.

When the string processing is complete, GETCOM will have

placed the hashing key associated with the command part of

the instruction into the variable FCT. That key is required

by MAIN. GETCOM will also have stored each one of the

parameters of the instruction in PAR(2) through PAR(N + 1),

where N is the number of arguments in the instruction. PAR(l)

will have been set to N. In the case of variables in the

instruction string, PAR will contain the variable's value that was retrieved from the symbol table. In the case of numeric

arguments in the string, PAR will contain the binary (signed

or unsigned) equivalent of the Hollerith number that was in

the string.

HASH

FORTRAN REFERENCE:

IVAL - HASH (KEY, FOUND)

FUNCTION:

To provide a simple, yet effective method for retrieving

values from the Editor's symbol table.

ERROR CONDITIONS:

Because of the method ^see below) used to index the symbol

table, a KEY value of 0 is not allowed. If this occurs, an error message appears. If the symbol table becomes full, an error is also indicated.

COMMENTS

:

In the case of a full symbol table error, as the error

message given in section 7 Indicates, the operator has two

options: delete some variables from the table, or redimension.

If re dimensioning is chosen, note that the dimension of both

KEYS and VALUES must be a power of 2 and that that power of 2 must be the value of N that is set in the DATA statement.

Note also that if the dimensions are changed, they must be

changed everywhere that the labeled COMMON block, BLK2, appears

viz. in MAIN, HASH, DEHASH, and INHASH.

32
The symbol table is indexed by use of a "hashing function"

applied to the key reference (the variable name or some encodement thereof, which is the case with the Editor). For more on hashing with sjrmbol tables, see p. A3 of [2].

HEXDMP

FORTRA.N REFERENCE:

CALL HEXDMP (INBUF,MIN,IBEG,IEND)

FUNCTION:

To provide a hexadecimal dump of (IBEG-IEND+l) words of the

input tape buffer, beginning with the IBEG'th word.

ERROR CONDITIONS:

None

COMMENTS

:

None

INHASH

FORTRAN REFERENCE:

CALL INHASH (KEY, VALUE)

FUNCTION:

To install a new variable name and value in the symbol

table maintained by subroutine HASH.

ERROR CONDITIONS:

An error obtains if the variable name already exists.

COMMENTS

:

KEY is the same KEY defined in the documentation of HASH.

VALUE is the value that the new variable is to have.

INIT

FORTRAN REFERENCE:

CALL INIT(IFILE,MIF1,MIF2)

FUNCTION:

To initialize the whole Data Editing system.

ERROR CONDITICMS:

Only error returns from the disk operations that are performed.

33
C(MMENTS:

This routine initializes the I/O control blocks that are used

in disk access (see [1]). It also sets up the disk files which

are to be used and installs the command references in the

symbol table. The command reference values are composed of

two parts: the subroutine reference number and the parameter

position number, both of which are packed into the value. The

subroutine reference number has been discussed elsewhere (see

MAIN and GETCOM) . The parameter position number is the index

into PAR where the day-time values of the instruction begin.

For those instructions which do not have day-time references,

this value is zero.

A word of explanation is in order, regarding the key values

used in initializing the commands. They are obtained by

taking the internal code equivalent (see CODIT) , of the

command characters, multiplying the first number by 36 and

adding the second. For example, the first entry in the FCN

table in INIT is for the RT command. The internal code

equivalent of an R is 27, that of a T is 29. And 27 x 36 + 29 - 1001, the first of the two entries in the first column of

FCN. The second entry, 0100, signals that 1 is the subroutine

reference number (the COMPUTED GO TO in MAIN will cause a jump

to its first argument) and that this command has no day-time

references.

Future plans for this routine include options for a restart

where the previous edit run left off. These options could

be very valuable if it develops that one run, because of DAS

recording errors, becomes much less than automatic in that the

person performing the edit must manipulate the data extensively.

If this turns out to be the case and the monitor must quit a run before it is complete, then without some restart capabilities,

all accomplished to that point will be lost, and the monitor

would have to resume from scratch later on.

LSHIFT

FORTRAN REFERENCE:

CALL LSHIFT(IBUF,ICNT,M,N)

FUNCTION:

To perform a left shift by characters (2 to a word) of IBUF.

Words shifted out of are zero filled.

ERROR CONDITIONS:

None

COMMENTS

:

Characters M through N of IBUF are shifted ICNT positions.

CAUTION : be sure not to shift out of IBUF. This is a machine language routine.

34
MAIN

FORTRAN REFERENCE:

None, this is the main program.

FUNCTION:

To provide complete control, through the use of subroutine

calls, over the whole editing process.

ERROR CONDITIONS:

Unknown command function requested.

COMMENTS

:

The MAIN routine functions by calling READIN to get an instruction string brought into core, CODIT to convert the

string to internal code, GETCOM to convert those characters

into a command reference key and list of parameters, HASH to

retrieve the subroutine reference number and parameter position

code, and finally by using the subroutine reference number in

a COMPUTED TO GO to jump to a subroutine call which effects the

operation desired.

New commands are entered by entering the subroutine call here,

and entering the command reference in INIT.

Note that all arrays are dimensioned in MAIN and are in blank

common. This was done to save storage on the RAYTHEON: the

system provides that the Resident loader and blank common begin at the same location, so that by putting all arrays in

common, even if they don't get used that way (in other COMMON

statements in the subroutines) , at least the storage allotted

to the Resident Loader is recovered and rendered useable.

Note also that all the arrays that are passed to the various

routines have their dimensions passed with them by means of a variable which is set to the dimension value in a DATA

statement in MAIN. This allows the user to change the size

of critical arrays with only two program changes in MAIN,

namely the DATA statement value and the DIMENSION statement

value, rather than having to change in each subroutine also.

OPENIT

FORTRAN REFERENCE:

CALL OPENIT (IOT,L)

FUNCTION:

To link to FCS's routine OPENFL, which opens an alreadycreated disk file for use.

35
ERROR CONDITIONS:

See CLOSE documentation.

COMMENTS:

See CLOSE documentation.

OUTHEX

FORTRAN REFERENCE:

CALL OUTHEX (IBUF,N, CODE, SKIP)

FUNCTION:

To output N words of IBUF in a hexadecimal format.

ERROR CONDITIONS:

None

COMMENTS:

The numbers are output in a fixed Z4 format (4 hex characters

per word). See OUTINT and OUTTXT write-ups for more.

OUTINT

FORTRAN REFERENCE:

CALL OUTINT ( IBUF ,N, CODE, SKIP)

FUNCTION:

To output integer numbers to the list device (CRT) . The numbers

are stored in IBUF. N is the number of numbers to be output.

CODE and SKIP are as in OUTTXT.

ERROR CONDITIONS:

None

COMMENTS

:

The numbers are output in a fixed 16 format including sign,

and follow the same concepts outlined under OUTTXT. See the

write-up of OUTTXT for more.

OUTTXT

FORTRAN REFERENCE:

CALL OUTTXT ( IBUF ,N, CODE, SKIP)

FUNCTION:

To output Hollerith text to the list device (CRT) . The text

is stored in IBUF, two characters per word. N is the number of

words to output, CODE is a carriage control code, and SKIP is

the number of blanks to output before starting.

36
ERROR CONDITIONS:

None

COMMENTS

:

This provides for stream-oriented output, and was created

because space was at a premium in the RAYTHEON and the

FORTRAN I/O package required on the order of 2500 words of

storage. This routine (and its sister routines OUTINT and

OUTHEX) together require an order of magnitude less, in

addition to being much easier to use.

CODE, as was mentioned above, is a carriage control which

controls the output as follows (LF = line feed, CR = carriag

return)

CODE = 0, do nothing and return,

CODE = 1, output (LF) (text) (CR)

CODE = 2, output (text)

CODE = 3, output (LF) (text)

CODE = 4, output (text) (CR)

CODE = 5, ouptut (LF) (CR)

CODE = 6, output (CR)

CODE » 7, output (LF)

CODE = other

,

do nothing and return.

Note that if N>72, a CR/LF is inserted before the 73rd

character so that the stream may continue. This requires th

keeping of an internal cursor position which is used only by

OUTTXT, OUTINT, and OUTHEX and is reset to zero only when

a CR is sent to the CRT for any reason (internally because

N>72 or externally through CODE). Thus, unless one ends

with a CR, the next output command may be started in the

middle of a line

.

See the listings of OUTTXT, OUTINT, and OUTTXT in the

appendix for more.

PDISK-FUTURE

FORTRAN REFERENCE:

lERR = PDISK(PAR,MPA,OUTBUF,MOU,CLSTAB,MCL,tsTlTSWT,LRECF)

FUNCTION:

To print out disk records according to the following example

format

:

NO. VAL. FLAG NO. VAL. FLAG et

1 19483 0001 2 15421 0011

37
ERROR CONDITIONS:

Only that the request parameters are out of range.

COMMENTS

:

PAR (2) in this case is a switch, which determines what Is

printed as follows:

0, print whole record;

1, print all values;

If PAR(2) = ^' P^i^^ flags;

3, print values and flags for

class variable in PAR(3)

;

4, print values for class variable;

5, print flags for class variable.

POUTBF

FORTRAN REFERENCE:

CALL POUTBF(OUTBUF,MOV,IBEG,IEND)

FUNCTION:

To print out the contents of the disk buffer area in a formatted way.

ERROR CONDITIONS:

None

COMMENTS

:

This subroutine prints, to the CRT, first a line containing

the label and time information stored in the first 6 words of

OUTBUF, and then a series of lines containing the measurement

values numbered from IBEG through lEND. If IBEG is 0, I.e.,

the instruction PO which calls this routine has no arguments,

then just the header information is printed. If lEND is

less than IBEG, then just the value IBEG is printed after the

header.

RDTAPE

FORTRAN REFERENCE:

CALL RDTAPE (INBUF,MIN,IERR)

FUNCTION:

To effect the reading of one record from the raw data tape.

ERROR CONDITIONS:

RDTAPE checks error returns from the READMT routine and

prints error message accordingly.

38
COMMENTS

:

This is a FORTRAN subroutine which simply sets up to call

READMT: the latter does the work of reading the EBCDIC

formatted tape.

READIN

FORTRAN REFERENCE:

CALL READIN (IBUF,N)

FUNCTION:

To provide variable length input from the keyboard device.

Up to 72 characters from the keyboard (usually CRT) will be

read in and stored in IBUF, 2 characters per word. N will

be set to the number of characters read.

ERROR CONDITIONS:

None

COMMENTS

:

This routine was necessary because no variable length input was allowed from FORTRAN. If a format called for 72 characters

of input, there had to be 72 characters typed in. This

routine pads out the buffer with blanks if less than 72 are typed in. IBUF must be at least 36 words long.

READIN is written in machine language.

READMT

FORTRAN REFERENCE:

CALL READMT(IBUF,ICNT,NCHAR,IERR)

FUNCTION:

To read one record into IBUF from the EBCDIC coded, 9 track,

DAS generated, magnetic tape, referred to elsewhere as the

input tape or raw data tape, and to perform physical,

magnetic tape-type error checks.

ERROR CONDITIONS:

lERR will contain information on the number and type of mag

tape errors that occurred. If lERR = 0, no errors occurred.

If lERR = -1, a single error applying to the entire record

occurred. If lERR = -32767, the record was completely

unreadable. If lERR > 0, then lERR is the number of parity

or other physical tape type errors in the record.

39
COMMENTS

:

When the subroutine is entered, ICNT represents the number of

characters to skip on the input tape record, before beginning

the transfer of data into IBUF. If used, ICNT must be a positive, even integer. The routine sets ICNT to the

number of characters read when it passes control back. If

the sign of ICNT is negative, the record on the tape was too

long and more data needs to be read. If ICNT is zero, an EOF was encountered. Also on entering, NCHAR should be set to

the maximum number of characters to transfer into IBUF from

the tape. NCHAR also must be a positive, even integer.

ICNT and NCHAR were designed in the above way to handle the

possible occurrence of preemptive scans on the data tape.

A preemptive scan is one that occurred in an alarm condition

or simply a manual condition, and could begin in the middle

of a good scan. Were this to happen, an unusually long "scan"

would result, which could, nevertheless, be processed using

this subroutine via the RT command.

For more on this, see the RT command in section 4, and the

listing in the appendix.

This routine is in machine language.

RSHIFT

FORTRAN REFERENCE:

CALL RSHIFT (IBUF, ICNT, M,N)

FUNCTION:

To perform a right shift by characters (bytes) of IBUF. The

opposite of LSHIFT.

ERROR CONDITIONS:

None

COMMENTS

:

See LSHIFT documentation.

RWNDIT

FORTRAN REFERENCE:

CALL RWNDIT (L)

FUNCTION:

To rewind unit L.

40
ERROR CONDITIONS:

None

COMMENTS

:

This routine is written in machine language. It was necessary to do so, rather than just using the FORTRAN

RBs'IND instruction, because of storage problems. As the

Editor is now, no FORTRAN mag tape operations are used. The

whole tape operations section of the FORTRAN library is not

loaded in with the Editor, saving approximately 2000 v;ords of

storage

.

SEEKEF

FORTRAN REFERENCE:

CALL SEEKEF (N,IREC,L)

FUNCTION:

To find N ends-of-file on unit L.

ERROR CONDITIONS:

None

COMMENTS

:

IREC will be set to the number of records passed over. This

includes the EOF's passed over. This is a machine language

routine

.

SKIP

FORTRAN REFERENCE:

CALL SKIP(N,L)

FLTJCTIONr

To skip N records forward on unit L.

ERROR CONDITIONS:

End-of-tape marker reached before completing the command.

COMMENTS

:

If N<0 on entering the subroutine, then this subroutine

functions like the BACKSP subroutine. On leaving the

subroutine, |Nj will be the number of records passed over. If

N<0 here, the EOF was reached. This is a machine language

routine. For more on this routine see the SK command in

section 4, and the listing in the appendix.

41
SPLITA

FORTRAN REFERENCE:

CALL SPLITA (ARG1,ARG2,ARG3)

FUNCTION:

To separate out the bytes of ARGl and right justify them

respectively in ARG2 and ARG3.

ERROR CONDITIONS:

None

COMMENTS

:

None

STATS-FUTURE

FORTRAN REFERENCE:

lERR = STATS (PAR,MPA, TABLE, MTA1,MTA2,0UTBUF,M0U,CLSTAB,MCL)

FUNCTION:

To produce a set of statistics on the portion of the diskstored data defined in the PAR vector by the class variable

and day-time positions, that should give some indication of

whether All is well with the data collection mechanisms.

ERROR CONDITIONS:

None

COMMENTS

:

The statistics to be gathered are all relative ones, which

means among other things that they are dimensionless quantities

whose values will all be between +2. If any value is reported

larger in either direction, that is an indication that some measuring device recorded values larger than expected. (One

would then zero in on the data to determine which device

malfunctioned during what time interval.)

In order to implement this routine, certain types of stored

statistics on the measured values are required. There are,

for each measurement variable:

1) ^ii^p ~ expected minimum value,

2) max =» expected maximum value,

P

3) y^ = typical value,

4) Ay = expected change in y over time,

5) Ay/y » expected relative deviation.

42
The standardized statistics to be reported are:

1. ) standardized min:

(min-Tnln ) / (max-min ) , P P

2. ) standardized max:

(max-min ) / (max -min )

,

P P P

3. ) standardized value:

(y-min ) / (max -min )

,

P P P

4. ) standardized standard deviation (SD)

:

SD/SD , P

5. ) standardized relative standard deviation (RELSD)

RELSD/RELSD . P

These statistics could all be computed in one pass through

the data values, and would be easy to implement. There are more like this that could be useful in providing early

detection of measurement device anomalies, but these would be

developed and implemented on an as-needed basis.

It should be noted that these statistical checks are simple,

gross ones designed to provide the simplest of statistical

data checks, and should not in any way be associated with

providing information on data reliability.

STDATA

FORTRAN REFERENCE:

lERR = STDATA(PAR,MPA,OUTBUF,MOU,CLSTAB,MCL,WRTSWT,LRECF)

FUNCTION:

To provide the ability to set data or flag values over a range of measurement variables and time definitions of the

disk-stored data scans.

ERROR CONDITIONS:

Since one of the parameters in PAR is a class variable or its

degenerate form, a measurement variable number, and since

STDATA must interpret this reference, an illegal variable

reference condition could obtain.

COMMENTS

:

This routine is the one eventually got to by typing in an SD

instruction to the Editor. After DRIVER brings in one of the

records referenced, STDATA interprets the class variable and

sets the data or flag values as required. STDATA sets the

write data switch on, which puts DRIVER in the read and write

mode

.

43
TRNRAW

FORTRAN REFERENCE:

CALL TRNRAW (INBUF,MIN,OUTBUF,MOU, TABLE, MTA1,MTA2,NREC,KPRNT)

FUNCTION:

To provide for the automatic transfer of data from the raw

data tape to core and then to disk.

ERROR CONDITIONS:

None that are endemic to TRNRAW. The errors that can occur,

do so in the subroutines that TRNRAW calls.

COMMENTS

:

This is the routine that one calls by giving the editor a TR

command. It is a level 3 routine (see section 2), and loops

through RDTAPE, CONALL, UTABLE and DSKRTS for NREC records.

It produces monitoring prints after every KPRNT records are transferred.

If an EOF is encountered or any error condition occurs in one

of the routines called by this one, processing terminates and

a message indicating the exact number of records transferred

is printed.

UNSPLT

FORTRAN REFERENCE:

CALL UNSPLT (ARG1,ARG2,ARG3)

FUNCTION:

To reverse the process of subroutine SPLITA. That is, where

SPLITA unpacks bytes into the second and third arguments,

UNSPLT packs the right bytes of ARG2 and ARG3 into ARGl.

ERROR CONDITIONS:

None

COMMENTS

:

None

UTABLE

FORTRAN REFERENCE:

CALL UTABLE (OUTBUF , MOU , TABLE , MTAl , MAT2 , lERR)

FUNCTION:

To update the table of contiguous times (TABLE) with the time

of the record about to be written onto the disk, which record

currently resides in the disk buffer, OUTBUF.

44
ERROR CONDITIONS:

If the number of entries is about to exceed the dimensions

of TABLE, which are MTAl and MTA2, then no entry is made, and

an error message is printed. Also, if an entry is attempted

for a record whose time is out of sequence, that entry is

not made and an error message appears.

COMMENTS

:

The table of contiguous times is used as an index table into

the disk-stored data scans. The idea is to keep a record of

contiguous blocks of data scans whose time differences, At,

from one record to the next are all the same. Given a beginning time for such a group, a record number associated with

that beginning time, the At, and the time of a scan one is

interested in, the record number of the scan of interest can be quickly calculated. This of course means that every

occurrence of a time difference between consecutive records,

that differs from that between the 2 previous records, causes

an entry in the TABLE.

The data for the time table is stored by columns so that

(TABLE(J,NENT) , J=l,6) represent in order: the day of the

first entry for this contiguous group, the time in minutes

for the first entry in the group, the record number associated

with that entry, the day of the last entry in the group, the

time in minutes of the last entry, and finally the time

difference, At, that applies for that group.

WRITEF

FORTRAN REFERENCE:

CALL WRITEF (N,L)

FUNCTION:

To write 3 EOF's on unit L.

ERROR CONDITIONS:

None

COMMENTS

:

See write-up of RWNDIT. Comments there apply here also.

WRITMT

FORTRAN REFERENCE:

CALL WRITMT (IBUF,N,M,IERR,LUN)

To write the contents of the IBUF out to the 1108 compatible

tape mounted on logical unit LUN. N is the number of items

45
(words or characters depending on the value of M) to be

transferred, and M is a format control code,

ERROR CONDITIONS:

lERR will be set <0 if an unrecoverable mag tape error

occurred. Otherwise IERR=0.

COMMNETS

:

This is a somewhat complicated routine, that was designed to

" provide capabilities other than just those required by the

Total Energy Data Editor. The primary requirement for the

Data Editor regarding this routine was to write out the 16 bit

words in IBUF in such a way that the records could be read on NBS's UNIVAC 1108 with a minimal amount of work at both ends

(RAYTHEON and 1108).

For a detailed explanation of what WRITMT does with the various

values of N and M, see the subroutine listing in the appendix.

Suffice it to say, here, that N is the niomber of words to write

out, and M should be equal to -1. These comments are true so long as the output tape is mounted on the 7 track drive

(physical unit 14),

46
7. THE DATA EDITOR - HOW IT TALKS TO YOU

Any Data Editor error message is composed of three parts: the name of

the subroutine that was in control when the error occurred, the error

type number, and a list of arguments. This appendix provides explanations

of the various error types. The number reported in the displayed error message is the one used to determine x-zhich message to read below.

* * A

1. Unknown command function requested. Check command requested, and

retype the instruction.

2. Illegal character in instruction string. ARGl is the position in the

string of this character.

3. A variable argument in the instruction has not been defined previously,

and therefore cannot be used as an argument. ARGl is the number of

the argument in error.

4. Incorrect instruction format. Embedded letters in numbers, or embedded signs, are examples.

5. Symbol table hash key equal to zero. This is a serious error. An

attempt was made to retrieve a value from the symbol table with a reference index of zero. Call a programmer.

6. Symbol table is full. No more variables can be defined until space

is obtained. Either delete some variables, or stop and redimension

the table.

7. Failure in the INHASH routine. ARGl is the value of FOUND. If ARGl

is 1, this simply means an attempt was made to define a variable that

already is defined. Delete the original definition and then insert

the new one. If ARGl is 0, a serious system error occurred. Call

a programmer.

8. Failure in the DEHASH routine, ARGl is the value of FOUND. If ARGl

is 0, an attempt to delete an unknown variable from the syinbol table was made. If ARGl is 1, a serious system error occurred. Call a programmer.

9. An error occurred in reading the raw data tape. Either the character

count (1st argument) is bad, or a magnetic tape error (2nd argument)

occurred.

-32767, if record was unreadable;

-1, if single parity error occurred applying to

entire record;

0, if no mag tape error occurred; or

n, where n is the number of parity errors that

occurred.

47
If ARG2 = 0, the error was with the character count. If ARG1<0,

the tape record was longer than expected and some data was therefore

unread. If ARGl =0, an end-of-flle was encountered.

10. An illegal character was encountered while converting from EBCDIC to

binary the measurement variable group of characters that is physically

the ARGl'th such group in the scan whose day is ARG2 and whose time

is ARG3. ARG5 is the hexadecimal dump of the flag word as explained

in the documentation of CONGRP, which contains pointers to the

position of the illegal characters.

11. Illegal EBCDIC characters were encountered while converting the label

and day-time characters of the scan. ARGl is the number of such

errors.

12. The table of contiguous times (TABLE), used as an index into the

disk, is full. Either redimension or stop transferring data to the

disk, continue on with an edit of the data already transferred, and

then start a new edit from the point left off.

13. A scan request was made for a scan whose time was not found in the

table of contiguous times. Try again.

14. Disk operation error. ARGl is the status word returned from FCS (see

[1], p. 39).

ARG2

0, if operation was other than below;

1, if operation was a read;

2, if a write;

3, if an update.

15. Error return from COMINT. ARGl =99, if resultant number was greater

than 32768, or n if the nth character was other than a digit, a +, a -, or a blank, ARG2 = n if this call was the n'th grouping call from

CONALL. ARG4 is the 16 least significant bits of the value.

16. Illegal measurement variable reference in the instruction. It must

be a class variable or a number between 1 and SJVAR.

17. Out of space in CLSTAB, the class variable storage area. ARGl is the

amount needed for the latest request. ARG2 is the amount of space

left in the table. Either delete a class variable to make room, or

go back and redimension.

18. The class variable referenced was not found.

19. An expansion of a class variable definition was attempted when the

class variable referenced was not physically the last one in the list.

Delete the current definition and start over.

48
20. The input records are out of sequence. The last record whose transfer

was attempted had a day-time value less than the latest one on the

disk. ARGl and AE.G2 are respectively the day and time of the last

record on the disk. Note that the time printed is in minutes, not

hours and minutes.

21. Error return from WRITMT routine. If ARGl = 1, the error occurred

while writing the first record of an output block. If ARGl = 2,

the error occurred on the second (the data) record. ARG2 is the

total number of scans that are on the disk. ARG2 and ARG3 are,

respectively the day and time of the record being written when the

error occurred. This error is an unrecoverable one. It is necessary

to mount a new tape.

49
8 . BIBLIOGRAPHY

Fetzer, M. , "File Control System (FCS) Specification", RAYTHEON

Report nxjmb'er DN 59004CWL, Revision B, November, 1973.

Morris, R. , "Scatter Storage Techniques", Comm. of ACM, vol. II, no. 1, Jan. 1968, p. 43.

Filliben, J.J., Jackson, R.H.F., Kirsch, R.A., Lozier, D.W.,

Orser, D.J., "Progress Report on Applied Mathematics Division

contribution to MIUS-Jersey City Total Energy Project, June 1975.

50
APPENDIX A

A-0

APPENDIX A - SUBROUTINE LISTINGS

This appendix contains a listing of each of the subroutines that comprise

the Total Energy Data Editor as of the freeze date for documentation of

January 31, 1975. Each listing begins a new page and all are in alphabetical order with a few exceptions. The exceptions are due to the fact

that although all subroutines discussed in Section 6 are conceptually

unique, some of the different machine language routines (e.g., BACKSP,

SKIP, SEEKEF, RWNDIT, and WRITEF) were combined into one subroutine with

different entry points, in order to save storage. An index into the

listings is given below.

******

SUBROUTINE NAME PAGE NO.

ADRESS A-1

BACKSP A-3

CLASS A-11

CLOSE A-1

3

CODIT A-66

COMINT A-15

CONALL . . • A-19

CONATE A-20

CONETA A-22

CONGRP A-25

CREATE A- 13

CVPROC A-32

DATTAP A- 34

DECDIT A-66

DEHASH A-35

DELETE A-1 3 DRIVER ..... A-36

DSKINT A-13

DSKRD A-13

DSKRTS A-38

DSKUPD A-13

A-i
DSKWT A-13

ERRPRT A-39

EX A-40

GETCOM A-41

HASH A-43

HEXDMP A-44

INHASH A-45

INIT A-46

LSHIFT A-47

MAIN A-52

OPENIT A-13

OUTHEX A-54

OUTINT A-54

OUTTXT A-54

POUTBF A-64

RDTAPE A-65

READIN A-66

READMT A-73

RSHIFT A-47

RWNDIT ..... A-3

SEEKEF A-3

SKIP A-3

SPLITA A-78

STDATA A-80

TRNRAW A-81

UNSPLT A-78

UTABLE A-82

WRITEF A-3

WRITMT A-83
SUBROUTINE ADRESS

on no 000 7

0001 r!OOA

on OP Qoo-3

000 3 75^0 0

* 000/: 07FF

* 000 5 ^^00

000 6 0007

0007 000^

OOO^T 0000

0000 oooo

• 000 A 0000

00 OB 000 0

1

=

3

^ 4

5

6 ^ 7

8

10 =

1 1 H< 1?? 13

1/-: t.

1 5 AD?.E5S

1 6

If? 10

no

?1

OP

S3 POOL

2 5 I ADR

26

•JHlTHI K'vir. ALiSOLJTIi: ADU..:-JSS Or A vAiilAUL}'.

MAY 13> 197''4

CALL F.'.OM FlOl-.TiiAM''-. VIA:'

CALL AD:'.i::SS < V'A?., I AD. . ) \:-lKAE lADH JiLL BE SET E^^JAL TO TMK ADD.-:^SS

OF vA/aAHLK *;A?%

:jot;::: var must he defi.jed jithi-J For.T-iA.M^

LIBH ADfsESS

DATA POOL

ld;; VAr.

LDX lAD?^

STv; * 0

JSX " ;- .}'.ET

DATA POOL

DATA ^]*0*0

GKT IAD.; ADD:iE55

SET IAD.;

DATA

DATA

e: jd .

000 5 R.FlST

'JO ERRORS

A-1
'^n'-R'-'^; noO'T T^.D?. OOOH POOL 0007 H.:-;ET 0005

pa:-?
SUBROUTINES BACKSP, SKIP, SEEKEF, RWNDIT, AND WRITEF

1

' mo ThPE MISCELLhiNEGUS OPERRTIOHS

2 * 3 * SEPT 10. 1975

4 * 5 i

6 * ALL CALLS

7 * SMB BACKSPML

S t JSX BACKSPML

9 * DATA LOG OF N

10 * DATA LOG OF LUN

11 t RETURN WILL BE HERE

12 * AND

13 * CALL BhCKSP<N.LUN>

14 * CALL SKIP(N.LUN)

1 5 * CALL SEEKEF( N • I REC . LUN > 16 * CALL RWNDIT(LUN)

17 * CALL WRITEF'. N.LUN)

18 t

19 t

20 t FIRST PROGRAM •• 21 t BACKSPACE OR SKIP RECORDS

22 CALL FROM F0RTRAH4:

23 t CALL BACKSPCN.LUN)

24 * OR

25 * CALL SKIP(M,LUN>

26 * 27 t WILL BACKSPACE UNIT "LUN" N RECORDS

29 i OR WILL SKIP N RECORDS FOREWARO.

29 t

30 NOTE= A MINUS N WITH BhCKSP IS EQUIUALENT TO

31 t. CALLING SKIP.

32 t A MINUS N WITH SKIP IS EQUIUALENT TO

33 t- CALLING BACKSP . 34 *

A3
35 * N MILL BE SET TO A NEGATR»E NUMBER IF THE

36 » END-OF-TAPE NAS REACHED ON SKIP OR IF

37 * THE LOAD POINT WAS REACHED ON BACKSP.

38 * THE ABSOLUTE UALUE OF THIS NEW N WILL

39 » BE THE ACTUAL NUMBER SKIPPED OR BACKSP.

49 t

41 t SECOND PROGRAM

42 « SEEK END-OF-FILE<S>

43 t CALL FROM F0RTRAN4=

44 t CALL SEEKEF<N.IR£C>LUN>

45 » 46 t WILL FIND "N" END-OF-FILES ON UNIT "LUN"

47 * <W0 SET IREC TO THE NUMBER OF RECORDS

48* SKIPPED (INCLUDING THE END-OF-FILES >. 49 t

50 * THIRD PROGRAM

51 t REWIND

52 * CALL FROM F0RTRAN4*

53 t CALL RUNOITCLUN)

54 * 55 * MILL REMIND UNIT "LUN"

56 t

57 * FOURTH PROGRAM:

58 * WRITE EHD-OF-FILES

59 » CALL FROM F0RTRAN4:

60 * CALL WRITEF<N,LUN)

61 * 62 * WILL WRITE N END-OF-FILES ON LUN

63 * 64 LIBR BACKSPML

65 LIBR BACKSP, RWNDIT.SEEKEF, SKIP. WRITEF

66 NTRY BACKSPML

67 NTRY BACKSP, RWNDIT/SEEKEF.SKIP.WRITEF

68 4- 69 OPEN EQU 66

A-4
70 STRT

71

72

73

74

75 t

76 BACKSPML

f I 78

79

&-0

81

83 BMLRET

84

EMLPETl

BMLRET2

si OMLENT

92

93

94 PI

9*3 EhCK

"Ht-.

99

1 Cnj

lul

PROC

DhwTA POOL

LOW P( 1

^ JSX SETUP

ENDP

STX

LDN

STlsl LDW

STW

LDW

JMP

LDM

STN

LDX

JMP

JMp

sne

STRT

ECU

JMP

JMP

LDN

DOT

SLL

ShP

JMP

js>=;

JMP

JMP

LDN

HDD

SAUE RETURN

SET H

LUN

t; 0

U

BMLRET

RETNML SET NEW RETURN

* 1 GET LUN

BMLENT

BMLRET2

RETNML RESET RETURN

LUN

t 2 RETURN

BMLRET . R . RET

IREC

BrCKSP-^2

RETURN

SKI

UNIT

WhIT

CHEK

Bl

RETURN

CNTDONN

Nl

A-5
105 JMP SKRET

106

107 SKIP STRT IREC

108 J^tP RETURN

109 JNP Bl

IIG SKI LOW UNIT

1 1

REhDI DOT

112 JSX WAIT

113 CAX

1 14 LOW Uf^IT

115 CLB 0

lie Sf>lE 117 vW'tP DEU0

1 IS CXA

119 SLL 3

120 SAP

121 JMP SK2

122 JSX CHEK

127- wiMP SKI

124 jrip RETURN

12^. SK2 LDN CNTDONN

126 SKRET LD.-< N

127 JMP SERET

128

12J* SEEKEF STRT LUN

130 JMP

131 JMP SE2

132 SEl LOW UNIT

133 F:EhD2 DOT 0.0

134 JSX WAIT

1 SRL 4

136 SAO

137 JMP SEl

138 JSX CHEK

l^S" JMP SEl

A-6
140 SE2 LDX IREC

141 LOW CNTLIP

142 SERET STW *. 0

143 JMP RETURr^

144 t

145 PUNDIT STRT H

14i5 HDP

147 MOP

14S LOW UNIT

149 Rl-iHD DDT 0..O

1 50 JMP RETURN

151 ^ 152 NRITEF STRT IREC

153 JMP RETURN

154 JMP RETURN

155 Nl LDN UNIT

156 I'lEOF DOT 0.0

15-" JSK WAIT

15S JSX CHEK

15? JNP Wl

160 R£T!J;;n LDW UNIT

It'i DISC 01 DOT 0,0

163 RETNMl SMB R.RET

163 JSX R.RET

1 64 DhTh pool

165 t

l'-6 SETUP STX RET

167 cr:< 168 LDM * 0 GET LUN

16? STN LUN3'.'

1 70 OPEN

171 DhTh FIOT

\'.\- NO DhTR 0,N1

173 LUfrEiU DhTh 0

iVA W'J DpTh 9

A-7
175 Nl DA-TA 1 176 STW UNIT

177 STB STATl-H

178 STB STAT2+1

179 AND XOOF0

180 STB DISCOl+l

181 STB DISC02+1

182 OR I N2

183 STB WEOF+1

184 ORl N8

185 STB RWND+1

186 OR I Nl

187 STB BhiCK+1

183 AND xeoF?

189 STB READl+l

190 STB READ2+1

is-i LDN UNIT

192 DISC02 DOT

193 CLR

194 STN CNTDOWN

195 STN CNTUP

196 LDX N

197 LOW t 0

198 LDX RET

199 Sh2

200 JMP $+2

201 Jt-\P ISZERO

202 SAP

203 IXS 1 204 IXS 2

205 NOP

206 SAP

207 CNP

200 ISZLPO STW NCNT

209 JMP t 0
210 t

211 NAIT LDIJ UNIT

212 STh»Tl DIN

213 SRC L

214 SAM

215 JMP WAIT

216 LDN CNTDuWN

217 SUB Ml

2 1 !^ SIN CNTDONN

21? LDN CNTUP

221 STN CNTUP

222 LDN UNIT

223 SThT2 DIN G.. G

224 jrip t

226 CHEK LDN NCNT

SUB Nl

STN NCNT

V 'J CMN HQ

23u SLE

231 JMP 0

JMP 1 277 i

234 N2 DhTh 2

235 N8 DhTr 8

236 DhTh X ' eiGiFO

O "7 "7

< ' ' DhTh ,X ' 80F? ' ^ 'B FET DrTh

246 FIOT DmTh

241 DrTr

242 DhTr

:m 3 DrTh

244 DRTr U

A-9
245 * 246 POOL

247 N

24S I PEC

249 LUN

250 t

251

BE

DATrt 5.0.0

DPiTr 0

Df^TA 0

END

A-10
SUBROUTINE CLASS

1 integeb: FUNCTIOM CLhS3<K>

1974

BE SET rtS FOLLOW5

6

DECENE-.ER 17

4 * CLASS l-ULL

i5 * K<lu 2

r * K<36 1 t K=36 3

9 t K=41 4

10 * K=3E• OR K

11 t ALL OTHER

12

13 LI BR CLASS

14- HTRY CLASS

15

16 CLRSS DATH Pi 1? STU S;«UE

IS CfiK

1? IXS 3

20 Sh'-'E DhTA 0

21 LDX t Q

O -I SXP

23 JMP $-2

24 LOW * 0

25 SAP

26 JMP SET6

27 CMW H41

2t: SLE

2S* JMP SETS

36 SHE

31 JMP SET4

32 CLB

33 SGR

34 JMP SET2

GET K

A-11
r i c- C-f"C< '7"' J» IMC< Jilr ct 1 1 TO r i C' LLb Jb

cue

Jr'.r btT3

r-t LLdD TO

•4*4

*+ IMP OC. 1 O

tC' 1 1 P b

•+ i IMP QPTTT

A-Z- -C 1 o

IMP CC"TTT be. 1 1 1 1 i P

er 4

^_i|IMPIr CCTT

T be. 1 1 1 1 1 P

IMP Jfir CCTTT be. 1 1 1 LLd c.

cr cr IMP OCT

TT c - rr X 

C't 1 1 LLd 41 ^1 bLL CI i 1L Q

Do LUi^ O/M IC 1 AC* o

NOP

'^l Lok t 0

6^

63 JMP

64 STW t e

65 LDX SAME

66 UNM

67 1X3 4

68 N41 41

63 SMB

R . EXEC : (
SUBROUTINES CLOSE, CREATE, DELETF, DSKINT, DSKRD, DSKUPD, DSKWT, OPENIT

1 I FCS HCCFSiE; AND INTEPFhCE SUBROUTINE

^

3 FEBRUhPV 24.. 1975

5 f FnP:TRMN4 Er^TRV hCCESS--

e t ChLl nhme '.: iut.d

8 * Nh^f'iE CRN EE ANV OF THE FOLLOWING AND

9 i THEIR FUNCTION WILL CORRESPOND TO THE

Id t FUNCTION!; DISCRIBED IN THE RAYTHEON FCS

11 t MhNUhL for the " = '• NAME.

12 i CLOSE = CLOSEFL

13 .t • create = CREhTEFL

14 * DELETF = DELETEFL

15 t. DSKINT = INITLIZE

le % DSKRD = GETREC

17 * DSKUPD = UPDATE

IS i: DSKWT = PUTREC

i-? A. OPENIT = OPENFL

2Ci t IDT IS THE LOCATION OF THE FCS L O TABLE

21 * D I SCR I BED IN THE RAVTHEOH FCS MANUAL.

22 i: L IS A CODED WORD WHICH WILL BE SET BV THIS

23 * ROUTINE TO THE FOLLOWING"

24 * L<0 . OPERATION COMPLETE. ERROR

25 ENCOUNTERED.. THE ABS . UALUE

26 t. OF L WILL EQUAL THE ERROR

27 t CODE D I SCR I BED IN THE Rh'.'-

2:s A. THEON FCS NANUhL . 2? i L>-1 .. OPERATION COMPLETE- NO ERROR.

t L=# OF WORDS TRANSFERRED.

31 t: L I BR CLOSE .. CREATE . DELETF .. DSK I NT . DSK RD

33 L I BR DSKUPD .. DSKWT .. OPEN I T .. LOCK I T .. PLhC I

34 NTR'i' CLOSE . CREATE .. DELETF > DSK I NT . DSKRD

A-13
"7*% MTOV N 1 K

DSKUPD .. OSKWT . OPEN I T . LOCK I T .. PLAC

?

ii Z't. I 1 r r UL

UhIH POOL

BEGIN

40 DtiT^^ p<; 1 > 41 ENDP

f- 4^ L-LU zt. I I CLOSEPL

44 L-r LH 1 1. CREATEFL

4

fiCZ i CTTC UtLt > »-

•- rr "t" X DELETEFL

4t" L' r-r 1 li ' C'C. I 1 IHITLli-c

U z-r r U GETREC

Uor U. U CCTT UPDATE

•4- 'I: CTT t ! I PUTREC

Ur c.ri 1 1 HPENFL

1 LULl i 1 LOCKFL

r LH»_- i 1 C STTT

Z't. 1 1 INSERT

^1 ^» CTV RET SWE REFERENCE

~l _l i nv lOT

c - IOTP SET lOT POINTER

cr r«

_• t 58 STW * 4 SET NO ERR ACTION

f'S- STN * 5 SET NO END ACTION

•50 LDX RET GET REFERENCE

61 LDK t GET TRANSFER

•f'2 JSX * 0 TRANSFER TO PCS

6"^ IOTP DATR 0 I/O TAEU-E POINTER

f.4 ..IMP ERROR RETURN IF ERROR

CLR! RETURN IF NORHAL

66 HRRDR CMP FORCE <-> IF ERROR

L

STW t t? SET L

6:^ R.RET

A-14
70 JSX R RET

71 DhTh POOL

•y~i t

RET . DHlrt

74

POi.'iL 4 ,. Q .. 0

7t' lUT n

L DhTh

7"'}* END

BE

A-15
SUBROUTINE COMINT

1

»(- ^3

4

5

6

7

8

10

11

12

13

14

15

16

17

*

t

t

t

t

t

t

*

t

t

t

t

COM I NT - TOTAL ENERGY SUBROUTINE

DECEMBER 18. 1974

C<^LLING SEQUENCE = CALL COMINTaBUF,N,IERR.IUAR)

WILL COWiERT N CODED CHARACTERS STARTING

WITH IBUF INTO A BINARY NUMBER AND

WILL SET lUAR TO SAID NUMBER.

lERR WILL BE SET TO ZERO IF THE RANGE

OF lUAR IS WITHIN -32767 TO +32767.

OTHERWISE. lERR WILL BE SET TO 99 OR

TO THE OFFENDING CHARACTER NUMBER IF

THE CHAR IS NOT A SP.-.+z OR NUMBER.

18 LIBR COMINT

19 NTRY COMINT

20 t. 21 RETURN SMB R.RET

22 J3X R.RET

23 COMINT DATA POOL

24 CLR

25 STW SIGN SET SIGN +

26 STW NUM INITIALIZE NUM

27 CHEfvTHPU STB LDWI+1 SET FIRST CHAR

28 LDM N

29 CMW * e

30 SLS ARE WE THRU?

31 JMP THRU YES

32 LDK IBUF. NO

33 LDWI LOW 0 GET CHARACTER

34 SAP

A-16
35 IMP EPRDP

oo

f IMP Ml JL Ttinn Ml

•J7^J* riVL.U'F: 'J77f SHE

41 JMP rONT I

or nwt- 33

44 IMP PI ij<^

45 CLB 39

46

47 JMP MINUS MINUS

4ft EPPnp CLR

49 LDB

ADD Nl CmLCULCiTE offfndfp

51 r I K I -iH lEPR

5^ SET I ERR

53 LDU NUM

<=^.IGN 55

5h". SXPPMP force PttPTTY

*—'

lUAR

•-'••./ cpj T I lap

59 JMP PFTUPN

61 MINUS LOW $

62 STW SIGN SET SIGN -?

63 JMP CONTIH

64

65 THRU LDX NUM

66 ERROR

3

CLP

67 SKP WAS there ouerflon?

ERR0R2 LLB YES

65 JMP FINISH NO

A-17
70

71 MULTrtDO STW

72 LLe

73 MPY

74 ADD

75 STW

76 CLR

77 SNO

78 JMP

79 DXS

88 JMP

81 LDN

82 SAP

83 JMP

84 STW

85 CONTIN CLR

86 LDB

87 ADD

88 jrF

89 * 90 SIGN DATA

91 Nur-i DATA

92 TEMP DATA

93 Nl DATA

94

95 POOL DATA

96 IBUF DATA

97 N DATA

98 I ERR DATA

99 iuhr DATA

100

101 END

TEMP SAUE NUMBER

10

NUN

TEMP

TEMP

ERR0R2

IERR0R2

TEMP

ERR0R3

NUM

JUST CONTINUE ON NOW

LDWI+1

Nl SET UP FOR NEXT NUM

CHEKTHRU

0

0

0

-

16.0.0

0

0

0

0

A-18
SUBROUTINE CONALL

S LIBR a)NALL

SUBROUTINE CONALL ( IN3UF» M IN ,OUTBUF, MOU , lERR

)

INTEGER INBUF, IGRP,OUTBUF, DEBUG

DIMENSION INBUF(MIN) ,OUTBUF(MOU) , IGRP(5)

. . COMMON /BLK1/NSCANS,NENT»DEBUG,NVAR

INC=M0u/^-3

IERR=0

C CO.-iVEfiT HEADER TO INDIVIDUAL BINARY VALUES.

CALL CONETA( INBUF,0UTBUF, 19, IFLAG)

IERR= I ERR "I FLAG

IF (IFLAG.GT.O) CALL ERRPRT( 1 1 , 1 MFLAG, 0,0,0»0)

CALL CODIT(OUTBUF,OUTBUF, 19)

C COMBINE FIR5T 12 CHARS INTO 3 BINARY VALUES.

DO D 1=1.3

CALL C0MINT(0UTBUF(( I-l)*4+l ) ,4,IFLAG,0UTBUF(I ))

I E RR= I ERR* IFLAG

IF ( IFLAG.GT.O) CALL ERRPRT( 1 M5, IFLAG, 1 ,0,0/)UTBUF( I)

)

5 CONTINUE

C BUILD UP AND STORE THE DAY.

CALL C0MINT(0UTBUF( 13),3, IFLAG , OUTBUF ( 4 )

)

lERR* IERR+IFLAG

IF (IFLAG.GT.O) CALL ERRPRTC II . I 5 » IFLAG, 4, 0 ,0 , OUTBUF( 4 )

)

C BUILD UP AND STORE THE TIME.

CALL C0MINT(0UTBUF( 16),4, IFLAG , OUTBUF ( 5 )

)

IERR=IERR+IFLAG

IF (IFUG.GT.O) CALL ERRPRT( 1 1 , 1 5, IFLAG, 5,0.0 ,OUTBUr( 5 )

)

C CONVERT. BUILD UP. AND STORE EACH OF THE MEASUREMENT GROUPS.

DO 10 1=1 .INC

OUTBUF( I+6)=0

10 OUTBUF( I+6+INC)=l

N=7

DO 20 1=1 .NVAR

CALL CONGRPdNBUF.IGRP.N. IFLAG) • IERR=IERR*IFLAG

IF (IGRP.(2).GT.O) GO TO 20 _^ , ICHAN=IGRP( 1

)

IF ( IFLAG. EQ.O) GO TO 15

CALL ERRPRT( 1 I , 1 0, 1 , OUTBUF( 4 ) ,OUTBUF( 5) .0. IFLAG)

JF (DEBUG. EQ. 1 1 ) CALL OUT INT( IGRP , 5 . 1 ,0

)

15 IF (ICHAN.LT. lO.OR.ICHAN.GT. 180) GO TO 20

OUTBUF( ICHAN+6)s IGRP(4)

OUTEUF( ICHAN+6+INC)=0

20 COi>*TlNUE

RETURiN

END

C; -

A-19
V SUBROUTINE CONATE

4

cr

10

11

u13

14

1?.

16

17

1"E:

-t <

WHERE

t

A.

';4

COHUERT ASCII TO EECD

FEBRUHF.V 24. 1975

CALL FROM F0RTRMM4 Ulft:

CALL CONATE< IBUFl > IBUF2/ ICNT .. I ERR > ICMT ASCII CHARACTERS FROM IBUFl WILL BE

COf^UERTED TO EBCD AND PLACED IH IBUF2.

IBUFl IBUF2 MAY OR MAY NOT BE SAME.

lERR WILL BE SET TO NUM ILLEGAL CHAR..

EACH OF WHICH WILL BE SET TO ZERO.

LIBR

f^TRY

DATA

LOW

SLL

STW

LOW

SLL

STW

LDX

LOW

STW

CLR

STW

LDK

CK<S

JMP

LDX

LOW

3TW 4-

CONATE

CONATE

POOL

IBUF2

1NXST

IBUFl

1NXLD

ICNT

0

COUNT

ERR

COUNT

1P02

I ERR

ERR

0

SET FIRST STORE

SET FIRST LOAD

SET coutn

SET NO ERRORS

THRU?

NO

YES

SET ERROR COUNT

A-20
35 SriB p. RET

3(5 JS.\ R.RET RETURN TO F0RTRhH4

37 DhTA pool

38 PCi2 st:-<; count

3? LDX NXLD

40 LDB 8

41 IXS 1 42 NOP JUST TO BE SAFE

43 STX NXLD

44 Sm CCITEBCD

45 JSX CCITEBCD

46 LDX NXST

47 STB t 0

4S IXS 1 4? NOP JUST TO BE ShFE

5Q • STK NXST

51 LDX ERR

52 IXS 1 53 HXLD DATA 0

54 CLB 0

55 SNE ERRORS

56 STX ERR YES

57 JMP POl NO

58

51^ COU.HT DATA 0

t-G ERR DATA 0

61 HXST DATA Q

62 ^. 63 POOL DhTh b.0.0

64 IBUFl DATA Q

65 iduf;-: data y

66 ICNT DATA 0

67 I ERR DhTA 0

BE

A-21
( SUBROUTINE CONETA

4

5

6

7

3

10

t

t

t

::t

t

i. WHERE

11

12 * 13 * 14 * 15 * 16 * 17 t

CON'.iERT EBCO TO PiSCII

FEBRUARY 24. 1975

SOURCE ON 9 TRACK TAPE # 5

CALL FROM F0RTRAN4 MIA^

C:ALL CONETAC IBUFl . IBUF2. ICNT. lERR ) ICNT EBCD CHARACTERS FROM IBUFl WILL BE

COHUERTED TO ASCII AND PLACED IN IBUF2.

IBUFl AND IBUF2 MAY OR MAY NOT BE THE

SAME.

I ERR WILL BE SET TO THE NUMBER OF ILLEGAL

CHARACTERS <EACH OF WHICH WILL BE SET TO

AN ASCII IE= X'AA' OR NUMBER 179).

IS * NOTE IBUFl. IBUF2. ICNT, AND lERR MUST

19 t INTEGER LABEL COMMON DATA.

20 t

21 LIBR CONETA

NTRY CONETA

23 t

24 CONETA DATA POOL

25 LDW IBUF2

26 SLL 1 27 STW NXST SET FIRST STORE

2S LDW IBUFl

29 SLL 1 STW NXLD SET FIRST LOAD

31 LDX ICNT

32 LDW 0

33 STW COUNT SET COUNT

34 CLR

A-22
35 STli ERP SET NO ERRORS

36 PGl LDX COIJNT

37" d::s 1 THRU?

3f' JMP Py£ NO

•39 LDK I ERF: VES

4Ci LDW ERR

41 0 SET ERROR COUNT

42 SMB R RET

43 JSM R . RET RETURN TO F0RTRHN4

44 POOL

45 POi* ST*-: COUNT

4ir~ WrLD

47 LDB * 0

4o IXS 1 4? NOP JUST TO BE SAFE

•50 STX n: :ld

51 SMB EBr:DTr:r: 1

c;--. js:-: EBCDTCCl

53 LCX NX3T

54 STB 0

55 i>:s i 56 HOP TO BE ShFE

er-.'

:' :=;TX h:-:?=;t JO ERR

5? i:ks 1 60 n;:ld DhTh 0

•-..1 CLB ' t'

62: SfC ERROR?

63 STX ERR YES

64 JMP POl NO

65

f^.f. COUNT DATh 0

€7 ERP DpTh PI 63 DATh 0

t.L-'

A-23
70 POOL n IE:UF1

ri' IE:UF>

73 I TNT

74 I ERR

rs

EE

DATA b..

y .. DhTh U

DhTh 0

DhTh 0

END
SUBROUTINE CONGRP

1 •CONi.'EPT ML 13 CHAR. GROUPS TO BE USrBLE

2 t

3 * JhNUARV 9. 1974

4 * 5 * CHLL FROM FrjRTRHN4 UIA^

6 * C rtLL COI^GRP-: I BUF . I GRP .N.I FLAG > 7

8 tPESULT^ 13 CHARhCTER EBCDIC GROUPS STARTING WITH

? * THE NTH CHARACTER OF I BUF WILL BE

16 * CONUERTED INTO 5 DISTINCT PARTS. IGRP

11 AND I FLAG NILL BE SET AS FOLLOWS^

12

13 -t: IGRPa.:- WILL BE SET TO A BINARN' NUMBER

14 t: • REPRESENTING THE CHARhCTERS MAKING UP

15 i: THE MEASUREMENT SCANNER CHhNNEL . 16 :f IGRP^"2;:' WILL BE SET TO THE REMOTE

17 * SCANNER CHhNNEL REPRESENTING THE REMOTE

18 * IF DATA WAS FROM A REMOTE. OTHERIS- * WISE. IGRP':. 2 .:' WILL BE SET TO -1 C IF NO^

2G * A REMOTE).

21 * IGRP<3> WILL BE SET TO THE ASCII CHARACTER

22 REPRESENTING THE D'.'M FUNCTION THIS WILL

23 t ' NORMALLY EE AN ASCII Mc X ' CDQO ' =-1305»:" .^^ OR

24 UC.X'DbOO' =-10752) BUT CAN BE ANV OTHER

2!5 t CHhRhCTER ':ERROR=.t=X' AhOO' =-22016

26 t IGRP^4.:' WILL EE SET TO ^ BINARY' NUMBER REF27 t RESEt-^TING THE 6 CHt^RhCTERS CONSISTING OF

25 t POLARITY.. O'-'ER-RANGE FLmG . AND 4 '..:OLTAGE

29 t DIGITS. IF THE OUER-RANGE FLhG IS NOT 0-2

30 t IT WILL BE SET TO 2 AND BIT 10 -'IITH BIT>

31 * OF IFLAG WILL BE SET ON. IF POLARITY IS

32 * OTHER THAfJ h ^ OR -.. IT WILl BE ASSUMED

33 i TO BE + AND BIT 3 lOTH BIT.' OF IFLhG

."'•4 WILL BE SET ON.

A-25
35 * IGRP<5> WILL BE SET TO A BINARY NUMBER

36 t REPRESENTING THE OUM SCALE CHARACTER

3? * IFLAG BITS 3-15 <4TH-1£.TH> WILL BE SET ON

38 * • IF THE NTH THRU N+12TH CHARACTERS ARE NOT

39 t LEGAL OR APPROPRIATE. IF IFLAG=0, NO

40 * ERRORS WERE DETECTED.

41 i

42 t NOTE: IF AN ILLEGAL CHARACTER OTHER THAN NEN43 * TIO^^D ABOUE. APPEARS IN ANY SUBGROUP I NG;

44 *. THE CORRESPONDING IFLAG BIT WILL BE SET

45 * ON AND THE IGRP ELEMENT FOR WHICH IT

46 * WOULD HAUE BEEN A PART WILL BE SET TO

4? * X'SOQO'

48 t

49 LI BR COHGRP

50 NTRY CCtNGRP

51 * 52 * 53 :t: 54 GETT PROC

55 LLB PC 1 > 56 JSX TRAM

57 BYTE P<2>.P<3>

58 ENDP

59 :*: 6ti CALL PROC

61 SMB P<1>

62 JSX P<1>

63 TRUE P<0>>1

64 DATA P<.2>

65 ENDC

66 ENDP

67* ^ 6S CONU PROC

69 CALL DECTOBIN.PC 1

)

A-26
70 JSX CHEK

71 STW P<2>

72 ENDP

73 * 74 COHGRP DhTh POOL

75 LDW IBUF GET BUF

?€ SLL 1 MAKE BYTE

77 LDX N

7S ADD % G UP IT BY N

79 SUB Nl TAKE ONE OFF

80 STW eUFBLUC

SI LDX HOLDREF

32 CLP

83 Pei STB INSTGi+1

84 CLB 16

85 SLE THRU ZEROING

86 JMF P02 YES

87 CLR NO

88 1MST0 STN % O

85 LDB IHSTGi-H

98 ADD Nl

91 JMP P01

92 P02 GETT Q.0.. '9'

93 GETT 1 1 . 9

94 GETT 2.2. '9'

95 GETT 3>6..e

9t. GETT 4.7,0

97 GETT 5.12,0

98 CLB

99 SEQ

1 00 CLB ' n

101 LLB 1

1 02 SEQ

103 STB H0LD5+6

104 GETT 6. 14.0
05 CLB

06 SEQ

07 CLB

OS SEQ

09 LLB

10 STB H0L04

ill LLB 1 L12 SEQ

L 13 STB H0LD5+7

114 GETT 7.15. '2'

115 CLR

116 CMB H0LD5+3

117 LLB •2*

t IS SEQ

. 19 STB H0LD4+1

.£0 GETT 8. 16. '9'

i^i GETT 9. 17. '9'

GETT 10. IS. '9'

GETT 11. 19. '9'

GETT 12.20. '6*

25 COW HOLDl .HOLDl

26 HfiLDREF EQU $-3

"•"7 CONU H0LD2.HnLD2+l

28 CALL DECTriBIN.HnLD4

29 JSX CHEK

t3w LDX IGRP

131 STW % 3 SET IGRP<4

.32 LOW H0LD2

133 CMW XAOrtO

[34 LOW HQLD2+1 GET REMOTE

35 SHE

L 36 LOW NMl WAS NOT A

L 37 STW * 1 SET IGRP<2

.3 ft LOW HOLDl

L3§ STW * 0 SET IGRP<1

A-28
140 LDN HOLD?

141 STW t 2 SET IGRP<3)

142 LDB HOLD?

143 hND N15

144 STW * 4 SET IGRP<5:)

14f. LDX FLAGREF

I4t- CLR

14? STlJ RET

14:?. pfi3 STB INSTF+1

14S' CLB 12

150 SLE THRU?

151 JHP PHH ^'ES

152- CLR NO

157. INSTF LDB d

154 OR I RET

155 SLL 1 15b STW RET

15? LDB INSTF^-1

153 HDD Nl

1 5? JMP PS3

160 P04 LDW RET

161 SRL 1 162 LD>^ I FLAG

163 STW * 0 SET I FLAG

164 CALL R. RET. POOL RETURN TO F0RTRAN4

1 65

166 TRhN STX RET

167 STB INSTl+1 SET BUF LOAD

165 STB IMST3+1 SET FLAG LOG

169 LDW t 0 GET REFERENCES

170 STB INST4+1 SET MA/: NUMBER

in SRL 8

172 STB INST2+1 SET SAME LOC

1 73 LDX BUFBLGC

174 INSTl LDB t U GET DATA

A-29
175 CALL EBCDTCCl

176 LDX HOLDBREF

177 INSTa STB 8 SAUE ASCII

178 STB SAU+1

179 TPl CLB REMEMBER IF ERROR

150 LDX FLAGREF

151 LLB 1 182 SHE WAS IT ERROR'?

183 IHST3 STB * 9 YES

184 CLR NO

185 CMB INST4+1 REMEMBER IF P<;3)=0

186 LDN SAU

187 LDX RET

188 SNE WAS P<3>=e?

189 TP2 JMP * 1 YES

19»3 INST4 CLB Q NO

191 SLE IS DATA < OR « P<3)?

192 CLR NO

193 CLB V YES

194 SLE IS DATA A NUMBER?

195 JMP TP2 YES

196 CLR NO

197 STB INST4+1 MAKE IT LOOK LIKE NO NUMBER

198 LLB 't' GET ERROR INDICATOR

199 JMP TPl

200 * 201 CHEK. SEQ

202 LDW IF BAD

203 JMP * 0 IF GOOD

204 r

205 HOLDl RES 3

2iJG H0LD2 RES 3

207 HnL.D3 RES 1 208 HnLD4 RES 3

209 HOLDS PES 7

A-30
210 BUFBLGC

211 HOLDBPEF

212 FLHGREF

213 Srt',' 214 RET

215 Ml

21t' N15

217 XEiyDO

21 S -.ihPihCi 219 NMl

22e» i

221 POCrL

222 IBUF

223 I GPP

224 H

225 IFLhG

226

BE

DATh 0

DhTh -HGLDl

DhTh .•HOLD^-t-l

DhTr

DnTh u

1 DPTh 15

DhTA

TB<J

DhTA -1

DHlm y

DhTA

DhTki

DhTh

END
SUBROUTINE CVPROC

S LI BR CVPROC

SUBROUTINE CVPROC(PAR.MPA,CLSTAB,MCL)

L(X5ICAL FOUND

INTEGER PAR(MPA) ,CLSTAB(MCL) ,DECRMT,PNTR, DEBUG, HASH

COMMON /BLKI/NSCANS,hENT, DEBUG, NVAR

DATA NEXT/1/

LEFT=MCL-NEXT+1

.^^ARG=PAR( 1 )-2

IF (NARG.GT.LEFT) GO TO 600

C IS THIS A DELETION, CREATION, OR AN EXPANSION.

IF (PAR(3)) 300,100,200

C CREATE A NEW CLASS VARIABLE.

100 CLSTAB(NEXT+l)*NARG

DO no I=1,NARG

110 CLSTAB(NEXT-m-I) = PAR(3+I)

CALL INHASH(PAR(2) ,-NEXT)

CLSTAB(NEXT)^PAR(2)

NEXTsNEXT+NARG*2

CLSTAB(NEXT)«-1

GO TO 900

C EXPAND THE DEFINITION OF THE CLASS VARIABLE.

200 nDEX=-HASH(PAR(2), FOUND)

IF (.NOT.FOUND) GO TO 610

IF (NDEX+CLSTAB(NDEX-»-l )+2.NE.NEXT) GO TO 620

DO 210 I=1,NARG

210 CLSTAB(NEXT-1+I)=PAR(3+I)

NEXT=iNEXT*NARG

CLSTAB(NEXT)»--1

CLSTAB( ND£X* I )«CLSTAB ( ND£X+ 1) NARG

GO TO 900

C DELETE A CLASS VARIABLE AND PACK THE CLASS TABLE.

300 i^DEX=-HASH(PAR(2) .FOUND)

IF (.NOT.FOUND) GO TO 610

CALL DEHASH(PAR(2)) - - DECRMT«CLSTAB(NDEX+1 )'¥2

PNTR^NDEX

320 PNTR=PNTR+2+CLSTAB(PNTR+1

)

IF (PNTR.EQ.NEXT) GO TO 350

CALL DEHASH(CLSTAB(PNTR))

CALL INHASH{CLSTAB(PNTR),DECRMT-PNTR)

GO TO 320

350 NEXT^NEXT-DECRMT

DO 400 I«NDEX,N£XT

400 CLSTAB(I)^CLSTAB(I+DECRMT)

GO TO 900

A-32
C AN ERROR OCCURRED. PRINT MESSAGE AND RETURN.

600 CALL ERR?RT(20, 17, NARG, LEFT, 0,0,0)

GO TO 900

610 CALL EHRPRT(20, 18,0,0,0,0,0)

GO TO 900

620 CALL ERRPRT(20, 19,0,0,0,0,0)

C DE5UGGING PRINTS FOLLOrt.

900 IF ( DEBUG. NE. 20) GO- TO 950

CALL OUTINT(CLSTAB,MCL, 1 ,0)

CALL 01;TINT(NEXT,1,1,0)

CALL 0UTINT(NDEX, 1,1,0)

950 rtciURiN

END

A-33
SUBROUTINE DATTAP

S LI BR DATTAP

INTEGER FUNCTION DATrAF(PAR,MPA,OUTBUF,MOU,CLSTAB,MCL,WRTSwT,

* LHECF)

LOGICAL rtRTS^T,LRECF

INTEGER PARCMPA) ,OUTBUF(MOU) ,SUM,GSUM,FSTBLK( 16) ,DEBUG,CLSTABXMCL)

COMMON /BLKI/NSCANS,NENT, DEBUG, NVAR

COMMON /BLK4/I0CBD(33),I0CBN(33J

DATA GSUM/0/

C COMPUTE THE SUM OF THE STATUS FLAGS.

SUM^O

M6*M0U-6

IERR=0

INC«M6/2*6

DO 50 la! ,NVAR ' 50 SUM«LOR(SUM,OUTBUF( INC+6*!))

C IF SUM CHANGED SINCE LAST TIME, A STATUS FLAG CHANGED. NOTE

C THAT THE CONVERSE NOT NECESSARILY TRUE. PRINT OUT THE STATUS

C FLAGS IN THE CHANGED-SUM CASE.

IF (SUM.EQ.GSUM) GO TO 70

CALL OUTTXTX^FLAG CHANGES IN«',8,3,0)

CALL 0UTINT(0UTBUF,5,4,I)

CALL OUTTXT('PREV. SUM«', 5,3,0)

CALL OUTHEX(GSUM, 1,2,0)

CALL OUTTXTCCUR. SUM»',5,2,2)

CALL OUTHEX(SUM, 1,4,0)

GSUM«SUM

C SET UP THE FIRST RECORD OF THE DATA BLOCK TO BE PUT ON TAPE.

70 FSTBLK(!)«5

FSTBLK(2)^I0CBD(27)

FSTBLK(3)-NVAR , FSTBLK(4)«M6

FSTBLK(5)^0UTBUF(I)

FSTBLK(6)^0UTBUF(2) * FSTBLK(7)=0UTBUF(3)

FSTBLK(8)^0UTBUF(4) - *- FSTBLK ( 9 ) «OUTBUF ( 5

)

FSTBLK(IO)^SUM

FSTBLKdD^l

IF (DEBUG. EO. 17) CALL OUTINT( FSTBLK,9, J ,0)

C PUT THE DATA BLOCK ON TAPE.

CALL nRITMT(FSTBLK,16,-MERR,9)

SUM* I IF (lERR.LT.O) GO TO 150

CALL rtRITMT(0UTBUF(7),M6,-.I,IERR,9)

IF (lERR.GE.O) GO TO 200

SUM«2

150 CALL ERRPRT(17,16,SUM,NSCANS,0UTBUF(4),0UTBUF(5),0)

200 DATTAP=IERR

RETURN '

* END

CI

A-34
SUBROUTINE DEHASH

S LIBfi DEHASH

SUBROUTINE DEHASH(KEY)

C DELETES A KEY AND VALUE FROM THE HASH TABLE.

LOGICAL FOUND

INTEGER VALUES, KEY, KEYS, KEYSAV,KPLACE DEBUG, HASH

COMMON /BLK1/NSCANS,NENT, DEBUG, NVAR

COMMON /BLK2/KEYS(128),VALUES( I28),KEYSAV,KPLACE

K= HASH (KEY, FOUND)

IF (.NOT. FOUND) GO TO 99

IF (KEY.NE.KEYSAV) GO TO 99

KEyS(KPUCE)=0

VALUES (KP LACE )^0

GO TO 900

99 CALL ERRPRT(5,8,F0UND,0,0,0,0)

900 RETURN

END

c;

A-35
SUBROUTINE DRIVER

S LI BR DRIVER

subroutiwb qrivercfunc, pah, mpa, table, mtai ,mta2,0utbuf,m0u,

* clstab,mcl)

logical wrts^t,lrecf

Integer day, time, clsvar, debug, funcclstabcmcd

integer par, mha, table, mtal ,mta2

dimension par(mpa),table(mtai,mta2),nrec(2)

common /blki/nscans, went, debug, nvar

common /blk3/day(2) ,time(2),clsvar

common /blk4/i0cbd(33),i0cbn(33)

C

I0CBD(32)«0

IOCBD(33)^LG'

CALL 0PENIT(I0CBD,L)

CALL ADRESS(OUTBUF,IOCBD( 32))

I0CBD(33)-«M0U

NRTS/iT-. FALSE.

LRECF— vPALSEa

C SEARCH TIME TABLE FOR BOUNDS ON RECORD NUMBERS OF REQUESTED

C RECORDS. THEN, CALCULATE EXACT RECORD NUMBERS FROM INFO THERE.

IF ( DEBUG .^EQ. 15) CALL 0UTINT(DAY,4, 1 ,0)

DO .120 I^ltMTAl

100 IF (TABLE(4,I).LT.DAY(J)) GO TO 120

IF (TABLE(4,I).GT.DAY(J)) GO TO 110

IF (TABLE(5,I).LT.TIME(J)) GO TO 120

1 1 0 N REC ( J ) = ( ( DAY ( J ) -TABLE ( I , I ) ) * 1 440+T I ME ( J ) -TABLE ( 2 , 1 ) ) /TABLE ( 6 , 1

)

NREC( J ) » NREC( J) TABLE (3,1)

IF (DEBUG. EQ. 15) CALL OUTINT( NREC, 2 , 1 ,0)

IF (J.EQ.2) GO TO 125

J«2 . GO TO 100 '

, 120 CONTINUE

C A NO MATCH OCCURRED. PRINT ERROR MESS AND RETURN.

CALL ERRPRT(I5,13,J.0,0,0,0) * GO TO 200

125 L*0 ^ I0CB0(27)aNREC( 1)

J30 IF -(L.GE.O) GO TO 140

IF (L.EQ.-100) GO TO 130

CALL ERRPRT{ 15,14, L, 2, 0,0,0)

GO TO 200

140 CALL DSKRD(IOCBD,L)

150 IF (L.GE.O) GO TO J60

IF (L.EO.-IOOX GO TO 150

CALL ERftPRT( 15, 14, L,l ,0,0,0)

GO TO 200

A-36
C i^ASS CONTROL TO THE SUBROUTINE DESIRED.

160 IERft«FUNC(PAR,MPA,OUTBUF,MOU,CLSTAB»MCL,rtRTSrtT,LRECF)

IF (lERR.LT.O) GO TO 200

C IF NECESSARY, rtRITE OUT THE CURRENT RECORD BEFORE CONTINUING.

IF (rtRTSrtT) CALL DSKUPDC IOCBD,L)

IF (LRECF) GO TO 200

C CHECK IF CURRENT RECORD IS LAST ONE DESIRED.

IF (I0CBD(27) .LT.NREC(2)) GO TO 130

LRECF=.TRUE. - GO TO 130

2C0 CALL CLOSE(IOCBD,L)

RETURN

END

A-37
SUBROUTINE DSKRTS

S LI BR DSKHTS

SUBROUTINE DSKRTS(()UTBUF.MOU,N, ICOM, lERR)

INTEGER OUTBUF(M()U), DEBUG

COMMON /BLKl/NSCANS, WENT, DEBUG, NVAR

COMMON /BLK4/I0CBD( 33) , IOCBN( 33)

IERR«0

IOCBD( 32)^0

I OCBD( 33)^' LG-'

CALL Oi^ENlT(lOCBD,L)

30 IF (L.GE.O) GO TO 40

IF (L.EQ.-lOO) GO TO 30

CALL ERRPRTC 16,14, L, 0,0, 0,0)

IERH=l

GO TO 200

40 CALL ADRESS(0UTBUF,I0CBD( 32))

I0CBD(33)»M0U

IF (DEBUG. EQ..16) CALL OUTHEXC lOCBD, 33, 1 ,0)

GO TO (50,60,70) ,ICOM

50 I0CBD(27)^N-1

CALL DSKRD(IOCBD,L)

GO TO 80

60 CALL DSKrtT(IOCBD,L)

GO TO 80

70 CALL DSKUPD(IOCBD,L)

80 IF(L.GE.O) GO TO 200

IF (L.EQ.-lOO) GO TO 80

CALL ERRPRT( 16, I4,L,IC0M,0,0,0)

IERR= I 200 IF (DEBUG. EQ.I6) CALL OUTHEX( lOCBD, 33, I ,0)

CALL CLOSE( I()CBD,L)

RETURN

END

A-38
SUBROUTINE ERRPRT

S LI BR ERRPRT

SUBROUTINE ERHPRT(ISUB,MESS,IARG1,IARG2,IARG3,IARG4,IARG5)

INTEGER DEBUG

COMMON /BLKI/NSCANS,iN(EiNT,DEBUG,NVAR

COMMOi>i /BLK4/I0CBD( 33) ,IOCBN( 33)

• DIMENSION NAMES(3,20)

DATA NAMES/'MA' ,^IN',' ' ,'GE' , 'TC , 'OM' ,'HA' ' ^,

IN' , 'HA' , 'SH' ,'DE' ,'HA' , 'SH' IN' IT' ,' ' ,'CL' , ' AS' , 'S '

,

*'C0' ,'MI' ,'NT' , 'ER' , 'RP' • 'RT' ,'RD' ,'TA' , 'PE', "CO' , 'NA'

,

x'LL' , 'PO' ,'UT' , 'BF' , 'HE' , 'XD' ,'MP' ,'UT' , 'AB' , 'LE' .'DR' ,' I V

,

^ER'.'DS' ,'KR',''TS','DA','Tr','AP','EX',' ',' ' ,'ST' ,'DA' , 'TA'

*'CV','PR','OC'/

C

CALL 0UTrXT('**ERR0R-',4,3,0)

CALL 0UTrXT(NAMES(1,ISUB),3,2,0)

CALL OUTrXT('TYPE',2,2J)

CALL OUTInTCMESS. 1 ,4,0)

CALL 0UTINT( IARG1,J,3,0)

CALL 0UTINT(IARG2, 1,2,0)

CALL 0UTINT( IARG3, I ,2,0)

CALL 0UTINT(IARG4,I ,2,0)

. CALL 0UTHEX(IARG5, 1 ,4,2)

IF (MESS. NE. 14) GO TO 90

CALL 0UTHEX(0, 0,7,0)

DO 50 1=1 ,33

CALL 0UTINT(I,1,2,0)

CALL OUTHEX(IOCBD( I), 1,2,1)

IF (MODd ,6) .EQ.O) CALL OUTINT(0,0, 5,0)

50 CONTINUE

CALL OUTINT(0, 0,5,0)

90 RETURN

END

C;

A-39
SUBROUTINE EX

LI BR EX

SUBROUTINE EX

INTEGER DEBUG

COMMON /BLK 1 /NSCANS, iMENT , DEBUG , N VAR

COMMON /BLK4/I0CBD(33),I0CBN(33)

CALL DELETF(I0CBD,L)

CALL 0UTrXT(^EXIT',2,.l,0)

CALL EXIT

RETURN

END

A-40
SUBROUTINE GETCOM

S LI BR GETCOM

5U3H0UTINE G£TCOM( COMMND , MCO , FCT, PAR , MHA ,f LAG)

INTEGER ARGCwT, STATE, CHCi^tT,FCT»CHCLS,VAL, PAR, TRANS, CQ?-iMiMD, CHAR

ll^T£3ER F LAG, CHAR I , CODE, CLASS, HASH, DEBUG

LOGICAL FOUND, S IGN

DlMENSIOiNi TRANS ( 6,9 ) ,COMMND(MCO) ,PAR(MPA)

COy-HO;t /BLK 1 /NSCAiNS, .lENT , DEBUG, NVAR

C FINITE STATE TRANSITION TABLE.

DAiA iRANS/

12,1,1,10,1,1,

2 2,2,3,8, 10, 10,

3 4, 6, 7, 7, ,9,10,

4 4, 4, 5, 5,10,10,

5 4, 6, 7, 7, 9,10,

6 10, 6, 7, 7,10,10,

7 4. 6, 7, 7, 9,10,

3 10,10,10, 10, 10, 10,

9 10, 6,10,10, 9,10/

C A N , E S 0

CHAR 1=0

ARGCNT^l

STATE*

CHCNT^O

FCTO

rLAG^O

IF (DEBUG. EQ. 2) CALL OUTTXTCCHAR CLASS STATE' , 9, 1 , 2

)

C GET NEXT CHARACTER OF CORUAND INPUT.

50 CH^AfiI=CHARr-*-l

CHAR=CO}AMND(CHARI)

C IGNORE BLANKS AND CHECK LEGALITY OF CHARACTER.

IF (CHAR. EQ. 37) GO TO 50

IF (CHAR. (jE.O. AND. CHAR. LE. 41 ) GO TO 70

CALL ERRPRT(2, 2, CHARI ,0,0,0,0)

FUG= 1 GO TO 999 . C GET CHARACTER CLASS AND STATE.

70 CHCLS= CUSS (CHAR)

STATE=TRA NS ( CHCLS , STATE

)

IF (DE3UG.r^E.2) GO TO 80

CALL OUTINT(CHAR, 1 ,3,0)

CALL 0UTINT(CHCLS, 1 ,2,0)

CALL 0UTINT(STATE, 1 ,4, 1 )

" C PASS OFF TO SECTION OF CODE DETERMINED BY CLASS AND STATE

C IN THE TRANSITION TABLE.

80 GO TO (100,200,300,400,500,600,700,300,900,1000) STATE

C CHARACTER RECEIVED rtAS NOT A LETTER. IGNORE IT.

ICO GO TO 50

C r-ROCESS THE COMMAND CHARACTERS.

2 CO IF (CHCNT.GE.2) GO TO 50

CHCNT=CHCNT+

FCT=FCT*36+CHAR

GO TO 50

A-41
C GEAR UP TO t^ROCESS THE ARGUMENTS OF THE COMMAND.

30O VAL«0

CHCnT-0

> SIGN*. TRUE.

AHGCNT-ARGCNT+I

GO TO 50

C P3JCESS A VARIABLE ARGUMENT'S CHARACTERS.

400 IF (CHCNT.GE.2) GO TO 50

CHGST«CHCNT*I

VAL=VAL*36*CHAH

GO TO 50

C IF FU.^CXION NOT SV, DV, OR CV, RETRIEVE VARIABLE

, ARGU^ENT'^S J^ALUE FROM_THE _HASH TABLE. _____

500 IF (FCT.EQ. 1039.0R.FCT.EQ.499.0R.FCT.EQ.463) GO TO 700

VAL«HASH(VAL, FOUND)

IF (FOUND) GO TO 700

ARGCNT=ARGCNT-I

CALL ERRPRT(2,3,ARGCNT,0,0,0,0)

FLAG*

GO TO 999

C PROCESS A NUMERIC ARGUMENT'S CHARACTERS.

600 VAL=VAL*10+CHAR

GO TO 50

C EAD OF AN ARGUMENT BUILD-UP. STORE IT.

700 IF (.NOT.SIGN) VAL—VAL

PAR(ARGCNT)=VAL

IF XCHCLS.NE.4) GO TO 300

C STORE NUMBER OF ARGUMENTS AND RETURN.

800 PARC I )*ARGCNT-I

GO TO 999

C PROCESS A SIGN.

900 IF (CHAR. EQ. 39) SIGN-. FALSE.

GO TO 50

C ERROR RETURN.

1000 CALL ERRPRT(2,4,0,0,0,0,0)

- FLAG=I

999 RETURN

END

A-42
SUBROUTINE HASH

S LI BR HASH

INTEGER FUNCTION HASH ( KEY , FOUND)

C HASH TABLE STORAGE ROUTINE. REF CACM,VOL. I 1 ,#1 ,P.43.

LOGICAL FIRST, FOUND

INTEGER rtDSIZE, VALUES, KEYS, KEYSAV,KPLACE, DEBUG

COMMON /BLK 1 /NSCANS , i^iENT , DEBUG, N VAR

COMMON /BLK2/KEYS( 128) ,VALUES( 128) ,KEYSAV,KPLACE

DATA FIRST/. TRUE./

DATA rtDSIZE/16/

DATA N/7/

C

IF (DEBUG. NE. 3) GO TO 20

CALL OUTrXT(^HASH KEY', 4, 3,0)

CALL OUTINT(KEY, I ,4,2)

20 IF (FIRST) GO TO 91

1 IF (KEY.EQ.O) GO TO 98

KEYSAV* KEY

C USE PROD. OF KEY WITH APPROPRIATE MULTIPLIER AS HASH ADDRESS.

KRAND^l

IHASH=0

KEYA=IABS(KEY)

DO n I=l,rtDSIZE,N

11 IHASH*IHASH'^KEYA/(2**(I-1 ))

C CHECK INDICATED PLACE IN TABLE TO SEE IF IT IS EMPTY, OCCUPIED,

C BY THIS KEY, OR OCCUPIED BY ANOTHER KEY, WHICH WOULD REQUIRE

C LOOKING FURTHER.

21 KPLACE=MOD( IHASH+KR AND/4, 2**N) -»-l IF (KEYS(KPLACE) .EO.KEY) GO TO 31

IF (KEYS(KPLACE).EQ.O) GO TO 41

KRAND=MOD ( 5*KRAND ,2**( N+2 )

)

IF (KRAND.EO.l) GO TO 99

GO TO 21

31 FOUND=.TRUE.

riASH= VALUESC KPLACE

)

GO TO 999

41 FOUND* .FALSE.

GO TO 999

91 K=2**N

DO 92 1*1 ,K

92 KEYS(I)=0

FIRST*. FALSE.

GO TO 1 98 CALL ERR?RT(3,5,0,0,0,0,0)

GO TO 41

99 CALL ERRPRT(3,6,0,0,0,0,0)

GO TO 41

999 RETURN

END

C;

A-43
SUBROUTINE HEXDMP

LIBR HEXDMP

SUBROUTINE HEXDMP( INBUF,MIN, IBEG.IEiMD)

INTEGEK DEBUG

DlMENSIOi^ INBUF(MIN)

COMMON /BLK I /NSCANS,NENT, DEBUG, NVAR

MI«(IBEG+l)/2

m2=(IEnD+1 )/2

A3=Ml*l2

IF (M3.GT.M2) M3=M2

CALL OUTINKM.I ,3,0)

DO 20 I='M1,M3

CALL 0UTHEX(INBUF(I),I,2,I)

CALL OUTHEX(0, 0,6,0)

M-M-»'26

Ml^MI*l3

IF (M3.LT.M2J GO TO 10

RETURN

END

A-44
SUBROUTINE INHASH

S LI BR INHASH

SUBROUTINE INHASH(KEY , VALUE)

C INSTALLS A NEa KEY AND VALUE IN HASH TABLE,

LCXJICAL FOUND

I NTEGEtt V ALUE , VALUES , KEY S , KEYSAV , KPLACE , DEBUG , HASH

COMMON /BLK1/NSCANS,NENT, DEBUG, NVAR

COMMON /BLK2/KE YS ( 128), VALUESX 128), KEYSAV , KPLACE

K= HASH (KEY, FOUND)

IF (FOUND) GO TO 99

IF (KEY. NE. KEYSAV) GO TO 9.9

KEYS(KPLACE)=KEYSAV

VALUES ( KPLACE )^VALUE

GO TO 900

99 CALL ERHPRT(4,7»F()UND,0,0,0,0)

900 RETURN

END

C; .

A-45
SUBROUTINE INIT

S LI BR IN IT

SUBROUTINE INIT( IFILE.MIFl ,MIF2)

INTEGER FCN,HASH,IFILE

DIMENSION FCN(2,24),IFILE(MIF-I ,MIF2)

COMMON /BLK4/I0CBD( 33) , lOCBNC 33)

DATA IOCBD/0,0, I ,4*0, 120,640, 0,0, ^NI' ,^FX'' , 'UP' , ''UF^ , 18*0/

DATA IOCBN/0,0, 1 ,4*0, 1 20 ,640, 0,0, 'NI' ,'FX' ,'UP' , 'UF' , 18*0/

DATA FCN/

1 1001,0100,

2 455,0200,

3 416,0300,

4 924,0400,

5 625,0500,

6 479,0600,

.7 537,0700,

8 1028,0800,

9 .1004,0900, . 01 1039, 1000,

11 499, 1.100,

12 859,1200,

13 1033,1300,

14 604,1400,

15 1180,1500,

16 1 108, 1600,

17 440,1701,

13 1071 , 1800,

19 1021,1903,

02 463,2000,

21 1022,2100,

22 1166,2200,

23 784,2300,

24 1000,2400/

C ALLOrtABLE COMMANDS, LISTED IN ORDER OF APPEARANCE ABOVE, ARE«

C RT,CN,BK,P0,HD,DB,EX,SK,Rd,SV,DV,NV,SP,GS,rtS,US,C8,TR,SD,CV,SE,rtE,

C LS,RS«

DO 20 J=l ,24

CALL INHASH(FCN( 1 ,J),FCN(2,J) ) ^ 20 CONTINUE

IFILEC I ,1 )^'TE'

IFILE(2,1 )='FK

IFILE( 1,20 = ''CR'

I FILE (2 2.)='AP'

CALL DSKINT(I0CBD,L)

CALL ADRESS( IFILEd ,2),I0CBN(4))

CALL CREATE(I0CBN,L)

CALL DELETF(I0CBN,L)

CALL ADRESS(IFILE(l,l),I0CBD(4))

40 IF (L.GE.O) GO TO 50

IF (L.EQ.-lOO) GO TO 40

CALL ERRPRT(6, 14,L,0,0,0,0)

50 CALL CREATE(IOCBD,L)

60 IF (L.GE.O) GO TO 90

IF (L.EQ.-lOO) GO TO 60

CALL ERRPRT(6, 14, L, 0,0,0,0)

90 RETURN

END

CI

A-46
SUBROUTINES LSHIFT AND RSHIFT

1 *

2 t

3 t

4 * 5 * 6 t

7 t

8 t

9 t

le

11 *

12 :tc 13 *

14 *

SHIFT BUFFER LEFT AND RIGHT

NOUEMBER ie> 1974

CALL FROM FORTRAh44 UIA = CALL LSHIFT<IBUF.ICNT.M.H>

OR • CALL RSHIFTCIBUF,ICHT.M.N>

WILL SHIFT CHARACTERS M THRU N OF IBUF

LEFT OR RIGHT I CUT POSITIONS. l-iILL

PLACE ZEROS IH POSITIONS SHIFTED OUT

OF AND THROUGH.

15 ttttttttttttttttt:ii;tttttt.tttttttttttttti:^ttt^^^^^

16 **CAUT 1 0^^**CAUT I ON:*c*CAUT I QN*-*CAUT I ON 1^ *:CrUT I ON^:*

17 t:ttttttttttttttXXtttXtXtXttttttt:^tXi-t^^

18 * MEMORY BELOW IBUF WILL BE PROTECTED BY t

19 t THIS PROGPrM.; HOWEUER. IT IS LEFT TO THE t

28 * USER TO INSURE THAT SHIFTS ftRE HOT MADE *

21 * IN OR OUT OF MEMORY LOCATED fHBQUE IBUF. * 22 tttt.ttttr^Xtttttttttttttttttt^^^^^

23 * HCTE= THIS IS THE EQUIUALENT OF A LOGICAL

24 * BUFFER SHIFT BY BYTES LEFT OR RIGHT.

25 *

A-47
26 LIBR

27 NTRY 111 In I 28 %

0053 29 LSHIFT DATA

S04C 30 LOW

0602 "'O'^ri 31 JSX

Www

0664 w 0005 9057 32 LDX

6606 BSOO 33 SUB X

0607 34 JMP

0OOS 35WW PSHIFT DATA

ri0p*'^ E'04D

U05S

066C

00nD — Km? -J • 38WW

w- ww 39w*' ADD t

0flOF • '—'-jv 40

N.-0-Tr 41

r 1 42 CMU

©012 0300 43 SKIP DATA

0013 1021 44 JMP

0014 0130 45 CAX

0015 SO50 46 LDU

0016 F052 47 CM14

0017 5900 48 LDB t

0018 9050 49 LDX

0019 GS90 50 SLE

001A 3S90 51 STB X

60 IB 804F 52 im

001C A04E 53 ADD

LSHIFT, RSH I FT

LSHIFT. RSHIFT

POOL

Nl

SETUP, N/M

ICNT

0

P01

POOL

NMl

SETUP, M,N

ICHT

0

NXST

NXLD

LSLD

X'0800' THRU? <SLS OR SGR

P02 YES

NO

NXST

MINLOC

0

NXST

OK TO STORE IT? . 0 YES

aXLD NO

TMP

A-48
G01D 704F 54

OOIE 0140 55

00 IF rt04E 56

0020 lOOF 57

0021 S05O 58 P02

0022 Fij51 53 P03

0€i23 0300 60 SKIP2

0024 102D 61

0025 »-Q52 62

002$ 0130 63

002? 0100 64

0023 0350 65

0O2^ 3300 66

002A 0140 67

0026 h04E 63

002C 1022 69

002D 07FF 70 P04

0G2E 2020 71

002F 0053 72

0030 6050 73 SETUP

0031 704E 74

0032 OS'iO 75

0033 08 1

0

76

0034 0630 -7-7

1 1 0035 78

0036 3047 79

0037 9056 80

0033 0h31 81

0O3l^ 0501 82

PAGE 2

STW NXLD

CXA

ADO TMP

JMP P01

LDU NXST

CNW LSLD

DATh X ' 0800

THRU ZEROING r (. SLS

JMP P04 YES

CMi4 MINLOC NO

CAX

CLR

SLE OK TO SET A ZERO?

STB * 0 YES

CXA NO

ADO TMP

JMP P03

SMB R.RET

JSX R.RET

DATA POOL

STX NXST

STW TMP

LLB X'40' SLS FOR LSHIFT

SAP

LLB X ' 80 • SGR FOR RSHIFT

STB SKIP+1 SET SKIP MODE

STB SKIP2+1

LDX IBUF

SLL D 1 DXS 1

A-49
003A 0A10 83 NOP

003B 0140 84 CXA

%^ w 7052 85 STW

0630 86 LDX NXST

0R3E 9800 87 LDX * 0

003F 9800 88 LDX * 0

0040 *h800 89 ADO % 0

3041 "^0 ADO TMP

7»')51 STW LSLD

0Pl4'i Bn4F SUB ThF Bin

0i344 93 SUB * 0

0045 9050 94 LDX NXST

6046 98095 LDX * 1 6047 9SO0 96 LDX * 8

0048 ASC-iO 97 f^DO % 9

004 704F 98 STW N>'1_D

004A 9050 99 LDX NXST

004B 1802 100 JMP 4^ 2

101 * 004C 0001 102 Nl DATA 1 0040 FFFF 103 NMl DATA -1

004E 0000 104 IMP DATA e

004F 0000 105 NXLD DATA 0

0050 0000 106 NXST DATA 0

0051 0000 107 LSLD DATA 0

0052 0000 108 MINLOC DATA 0

109 %

0053 0006 110 POOL DATA 6^0^0

JUST TO BE SAFE

A- 50
0054 0000

0055 0000

0056 0000

0057 0000

0055: 0000

0053 0000

111

112

113

114

115

IBUF

ICNT

M

H

DATA 0

DATA 0

DATA 0

DATA 0

END

002E R . RET

NO ERRORS

A-5]
ROUTINE MAIN

S LIBR JI4AIN

C MAIN TEXT EDITOR PROGRAM.

EXTERNAL DATTAP,STDATA

I NTEGER PAR , COMMND , FLAG , HASH , FCT , I NBUF , OUTBUF

I NTEGER K EYS , VALUES , KEYSA V , KPLACE , DEBUG , S YMVAL, TABLE , SUBPAR

IMTEGER DAY, TIME, CLSVAR,FCSRES,CLSTAB

LOGICAL FOUND

COMMON FCSRES (100), OUTBUF (640) ,INBUF( 21 00) ,PAR(25) ,C0JrtMND(74)

COMMON IFILE( 10,5) ,TABLE(6,25) ,CLSTAB(150)

COMMON /BLK1/NSCANS,imENT, DEBUG, NVAR

COMMON /BLK2/KEYS( 128) , VALUES ( 128) ,KEYSAV, KPLACE

CO.MMON /BLK3/DAY(2),TIME(2),CLSVAR

COMMON /BLK4/I0CBD(33),I0CBN(33)

DATA DEBUG,NVAR/0,310/

DATA MIN,M0U,MC0,MPA,MTAl,MTA2,MCL/2l0O,64O,74,25,6,25,150/

DATA MIFl ,MIF2/10,5/

C

CALL OUTTXTCTOTAL ENERGY SYSTEM DATA EDITOR ',16,1,0)

CALL INIT(IFILE,MIF1 ,MIF2)

50 CALL OUTTXT('?', 1,1,0)

C GO GET COMMAND INPUT AND TRANSLATE.

CALL READ IN ( COMMND, N)

CALL CODIT(COMMND, COMMND, N)

C0MMND(N+l)=4l

C0MAiND(N*2)=4l

DO 55 I«l ,MPA

55 PAR(I)«0

C GO DECODE THE COMMAND.

CALL GETCOM(COMMND,MCO,FCT,PAR,MPA,FLAG)

IF (FUG.EQ.l) GO TO 50

SYMVAL=HASH ( FCT , FOUND

)

IF (FOUND) GO TO 60 , CALL ERRPRT( 1,1,0,0,0,0,0)

GO TO 50

C BREAK OUT SUBROUTINE NUMBER AND PARAMETER NUMBER = POSITION

C rtHERE DAY AND TIME BEGIN. (IF » ZERO, NOT APPLICABLE.)

60 SUBPAR*MOD(SYMVAL,IOO)

ISUB«SYMVAL/100

IF (SUBPAR.EQ.O) GO TO 70

C STORE DAY AND CONVERTED TIME. (HHMM GOES TO MMMM).

DAY( 1 )=PAR(SUBPAR*1

)

DAY(2)=PAR(SUBPAR^3)

TIME( I )*PAR(SUBPAR-»-2)-(PAR(SUBPAR+2)/100)*40

TlME(2)=PAR(SUBPAR*4)-(PAR(SUBPAR+4)/100.)*40

70 GO TO (100,200,300,400,500,600,700,300,900,1000, MOO, 1200, 13(X>,

*I4(X), 1500, 1600,1700, 1800, 1900 ,2000, 2 1 00 , 2200, 2300 ,2400) , ISUB

'i

1

A-52
C PASS OFF TO THE REQUESTED ROUTINES.

100 CALL RDTAPEC INBUF,MIN,IERR)

GO TO 50

200 CALL COiNALL(INBUF,MIN,OUTBUF,MOU, lERR)

GO TO 50 ; 300 CALL BACKSh'(PAR(2),PAR(3))

GO TO 50

400 CALL IP0UTBF(0UTBUF,M0U,PAR(2),PAR(3))

GO TO 50

500 CALL HEXDMP(INBUF,MIN,PAR(2),PAR(3))

GO TO 50

600 DEBUG=PAR(2)

GO TO 50

700 CALL EX

300 CALL SiCIP(PAR(2) ,PAR(3))

GO TO 50

900 CALL RrtNDIT(PAR(2))

GO TO 50

1000 CALL INHASH(PAR(2) ,PAR(3))

GO TO 50

MOO CALL DEHASH{PAR(2))

GO TO 50

1200 iWAR=PAR(2)

GO TO 50

1300 I0CaD(3I )=PAR(2)

GO TO 50

1400 CALL DSKrtTS(0UTBUF,M0U,PAR(2) , 1 ,IERR)

GO TO 50

IdOO call UTABLE(0UTBUF, MOU, TABLE, MTAl ,MTA2,IERR)

IF (IERR.GT.O) go to 50

CALL DSKRTS ( OUTBUF , MOU , 0 , 2 , 1 E RR

)

GO TO 50

1600 CALL DSKRTS(0UTBUF,M0U,0,3,IERR)

GO TO 50 • 1700 CALL DRIVER(DATTAP, PAR, MPA, TABLE, MTAl , MTA2, OUTBUF ,MOU ,CLSTAB,MCL)

GO TO 50

1600 CALL THNRArtdNBUF.MIN, OUTBUF, MOU, TABLE, MTAl ,MTA2,PAR(2) ,PAR(3))

GO TO 50

1900 CALL DRIVER(STDATA, PAR, MPA, TABLE, MTAl ,MTA2, OUTBUF, M0U,CLSTAB,MCL)

GO TO 50

2000 CALL CVPROC(PAR,MPA,CLSTAB,MCL)

" GO TO 50

2100 CALL SEEKEF(PAR(2) ,IERR,PAR(3))

CALL OUTINTdERR, 1 ,3,0)

CALL OUTrXT('RECS SKIPPED' , 6, 4, 1

)

GO TO 50 , 2200 CALL rtRITEF(3,PAR(2))

GO TO 50

2300 CALL LSHIFT( INBUF,PAR(2) ,PAR(3) ,PAR(4))

GO TO 50

2400 CALL RSHIFT( INBUF,PAR(2) ,PAR(3) ,PARX4))

GO TO 50

EiND I C;

A-53
SUBROUTINES OUTHEX, OUTINT, AND OUTTXT

1

• F0F:TPAN4 TEXT OUTPUT ROUTINES

:: I . 3 % FBRUhRV 24. 1975

4 :* 5 * CALL IMG SEQUENCES^

t. % CALL 0UTHE:==:< HEX. CODE. SKIP)

7 t OR

8 4 CALL OUTINT-: NUM.. N.COOE> SKIP)

? * OR

lei * CALL 0UTTXT< IBUF.N. CODE. SKIP)

U * 12 * NUn = SINGLE INTEGER NUMBER TO BE

13 % CONUERTED TO ASCII AND OUTPUT

14 . AS A DECIMAL NUMBER.

15 * HEX = SINGLE INTEGER NUMBER TO BE

16 CONUERTED TO ASCII AND OUTPUT

17 t. AS 4 HEX CHARACTERS.

IS * SKIP= NUMBER OF SPACES TO OUTPUT BEFORE

\3 % OUTPUT OF TEXT OR 1ST HEX OR NUM.

20 i: IBUF= LOCATION OF FIRST WORD OF TEXT TO

21 * BE OUTPUT.

22 * N = NUMBER OF TNO CHARACTER WORDS OF

2.7 t: TEXT TO BE OUTPUT.. OR THE NUMBER

24 :: OF HEX OR NUMS TO BE CONUERTED

25 * AND OUTPUT.

26 CODE= CARRIAGE CONTROL AS FOLLOWS

27 0-DO NOTHING 8-. RETURN IMMEDIATELY

2S \ 1 -< L^'F X TEXT.' NUM X C 'R > 2^ \ 2- (TEXT'- HUM)

3KL/F.H TEXT/HUM)

:^l t 4- <TEXT''NUMXC/R>

32 5-<L' F) <C/-R>

33 t 6- <C^'R)

34 % 7-<L' F)

A-54
35 * OTHER-DO NOTHING S: RETURN IMMEDIftTELY

36 t

37 t ADDITIUNhL COMMENTS:

38 NUM WILL BE RIGHT JUSTIFIED WITH SPACES

39 :» REPLACING LEhDING ZEROS.

40 i FIELD WIDTH OF NUM (INCLUDING LEADING

41 *: SPhCES and SIGH> WILL ALWAYS BE 6

42 * + SIGN WILL BE OUTPUT AS A SPACE.

43 * - SIGN WILL BE OUTPUT AS A - SIGN AND

44 * WILL BE PLACED IN THE POSITION IMMED4=i * lATELY TO THE LEFT OF THE MOST SIGNIFI46 *: Cant digit of the number. HEX WILL

4? * HA*.'E A FIELD WIDTH OF 4.

48 * SKIP SPhCES will BE PLACED BEFORE THE

43 . TEKT OR BEFORE THE FIRST NUM OR HEK

50 i THE ABSOLUTE tirtLUE OF SKIP AND N WILL BE

51 t USED AS THEIR CCFINED '.iALUE

52 * NOTE=

53 t THE TEXT CONTAINED IN IBUF AND ALL OUTPUT

54 t FROM EACH CARRIAGE RETURN WILL BE

55 *: IN BLOCKS OF EITHER 71 OR 72 IF N>72.

56 * THAT IS. A C R 'i-. UF < IN THAT ORDER .> 57 * WILL BE ADDED BEFORE EACH 72 'ND OR

58 * 73 'RD CHARACTER THIS WILL BE UPDATED

59 * ON EACH CHARACTER AND WILL ONLY BE

60 * RESET WHEN A C-^R IS GIUEN FOR ANY

61 i: REASON.

6"^ ^ 63 t ALL OUTPUT WILL BE ON UMIX WHICH SHOULD

64 * NORMALLY BE ASSIGNED TO THE CRT OR TTY

65 * 66 LI BR OUTHEX.OUTINT.OUTTXT

67 NTRY OUTHEX . OUT INT , OUTTXT

6y i

69 LUN EQU 11

A-55
70

71

72

73

74

75

i t 7S

7'?

80

:?!

S4

y6

J~»7 83

0010

SThT

SPOT

1 Cnj

103

1M4

DOIT

t

TPhN

hDDD

DECR

EQU

EC'U

PROC

DrTr

DRTA

RES

DrTA

RES

ENDP

PROC

STW

CLR

STW

DO 10

STAT

EHDP

PROC

LOW

STW

ENDP

PROC

LOW

ADO

ADD

ENDP

PROC

LOW

sue

STW

EMDP

68

70

P( 1 '.P<2>+X'8f^nPJ'

C0^7..LiJM 5.. 14 43

3

J< ' 8000 •

1

P<1>

PC 2 >+5

P<2>

P< 1 > P<2>

COUNTER

P< 1 > PC1>

P<1>

p<r 2^

PC 1 >

A-56
105 *

lOt. S.ETT

107

1U8

109

lid f

111 UUTHE>:

112 outhe; :i 113

114

115

1 It". 117

11$:

11?

12u NUMEUFR

121

122

123

124 t; 125 OUT I NT

126 OUT I NT

] 27

12S

1 2?

13^

131

13^'

13.3

134

t 3S

i 3r--. 137 Ul.n I NT

1 3:;: 13-3

PPOC

DhTih pool

JS.X SETUP

ENDP

SETT

LDU REPEAT

SAZ

SAP

JMP GETDUT

LDX EUFS'..'

LOl-J *: 0

SMB he:-:tcc

JSX he>-tcc

DhTh f^LlNBUF

TRrN N2.. NCTMP

JSX DOOUT

JMP OUTHEXl

SETT

LOU REPEhT

SrtZ

SAP

JMP GETOUT

LDX EUFSU

LDN t 0

SriB HEXTDEC

JSX HEXTDECNUMBUF

ShM

JMP OUT I NT

LDX NUMBUFBR

LDB -t. 1 CLE *

' SEO
140 JMP 0UTINT3

141 I;^S 1 142 JMP 0UTINT2

143 • JMP OUT INT

144 OUT I NT

3

LLB

14T. STB t 0

14i£: 0UTINT4 TRif^N r43..WCTMP

147 JSX DOOUT

14^5: JMP OUT I NT

14?

l^.fi OUT TXT SETT

151 TRAM XfH0R0..RE

152 JSX DOOUT

153 GETOUT LOW CODESU

154 CLB 2

155 • -SEQ

156 CLB 1 157 SEQ

153 JSX CR

151=" JMP RETURN

l€.fJ 161 DODUT STX DOOUTRET

162 LOW REPEAT

163 CMW ZERO

164 SNE

165 JMP t 0

166 sm

167 JMP D00UT2

168 DOOUTl LDX DOOUTRET

163 LOW WCTMP

1 70 CMW ZERO

171 SGR

172 JMP * 173 LDW COUNTER

174 CMW N71
175 SLS

176 JSX CRLF

177 LDW COUNTER

178 ADD Nl

179 SRL 1 ISO STW COUNTWD

181 LLB 36

182 SUB COUNTWD

183 CMW WCTMP

184 SLE

185 TRAN WCTMP.WC

18t. DECR WCTMP. WC

187

188

to*"" JMP

OUTFIOTl

DOOUTl

189 D0UUT2 STX OFOTIRET

190 LOW BUFSU

191 ADD Nl

192 STW BUFSU

193 TRAH NUMBUFR.FIOTl

194 ADDD WCTMP

195 CMW N72

196 SLE

197 JSX CRLF

198 DECR REPEAT, Nl

199 TRAN WCTMP. WC

200 JMP OFOTIPI

201

202 OUTFIGTj STX OFOTIRET

203 OFOTIPI ADDD WC

204 DOIT COUNTER.. F I OTl

205 LDW FIOTl

206 ADD WC

207 STW FIOTl

20:-: 209

LDX

JMP

OFOTIRET

0
210 *

• - 21

CR CLR

212 STW COUNTER

213 LDW

214 J?1P OUTONE

21^. CRLF ST>^ CRLFRET

2 It. JoX CR

217 LD>>' CRlFRET

2l:=; LF LOW XOOSA

21? OUTONE STX 0FUT2RET

22C1 DOIT ONEBUF..FIOT

221 LDX 0F0T2R.ET

JMP t 0

w. C» 224 SETUP STK SETUPRET

225 LDX CODE

22t» LDX * 0

DXS 5

22§ .IMP SETUPCn

22? IXS 4

27-y ..JMP RETURN

2.T.1 STX CODESU

TRhH lEUF.eUFSU

STW FIOTl

2.34 . LDK N

235 LDW * Ci SrtP

7 CMP

STW WCTMP

23? STW REPEhT

240 LDX SKIP

241 LDW * 0

242 S«P

243 CMP

244 STW SKIPCNT

A-60
245 LOW CODESU

246 SAO

247 JSX LF

248 OUTSKIP LDX SETUPRET

249 S.KIP01 LOW SKIPCNT

2^.»^ CMW Hi

251 LOW COUNTER

252 SHE

253 jmp SKIP02

254

2F.*=. JNP 0

25t. cm N71

257 SNE

JMP SKIP03

Hs* • SLS

2Kri JSX CRLF

261 LDM XAOhQ

2k2 JSX OUTONE

263 DECR SKIPCNT, M2

264 LOW COUNTER

265 ADD N2

266 JMP SKIP04

267 SKIPei2 CMN N71

26y SLE

26? J'z-X CRLF

270 SKIP0.3 LOB XAQrQ

271 SLL P. 272 JSX OUTONE

27-3 DECR SKIPCNT. HI

274 LDW COUNTER

275 ADD HI

276 SKIPe4 STU COUNTER

277 JMP OUTSKIP

279 SETUPGl DXS 3
280 JMP RETURN

2S1 SETnp02 r::s JMP SETUP04

SXE

234 JMP SETUP03

285 js;s CR

2i5it' JMP RETURr^

SETnp03 JSX LF

JMP RETURN

•E.ETUP04 JSX CRLF

230 RETURr^ SMB R.RET

291 JSX R . RET

2-?2 DATA POOL

2*?? t

2?«4 CPLFRET DhTA 8

2'?!5 DOOUTRET DATA 0

2*^»-" OFOTIPET DATA 0

2?r 0F0T2RET DATn 0

29o SE TURRET Data 0

CCUf^TWD DATA 0

300 COLih'TER DATA 0

SOI JKIPChT DATA 0

?0^' DATA 0

?0j' 0

704 OIIEBUF DATA 0

30^. CODE:;:'.' DATA 0

30*:-. flUf'IGUFBR DATA 'HUMBUF

307 BOF'E:'.' DATA 0

308 DATA 0

3i-i3 ZERO DATA 0

310 HI DATA 1 31 I N2 DATA 2

312 H3 DATA 3

31? N? I DATA 71

314 N72 DATA 72

A-62
315

317 XGCioA

31S HUMBUF

313

320 FIOTi

321 FI0T2

322 t

323 POOL

32-4 IBUF

325 N

rnoE

327 S.KIP

328 t 32?

BE

UH 1 H

v>.V A0^O

DrTh <../ DhTh '. .• Uti8iH

PES 3

SPOT Q. WC

SPOT CINEBUF..H1

6.

DhTh 0

DhTh 0

DATA 0

EUD
SUBROUTINE POUTBF

S LI BR POUTBF

SUBROUTINE FOUTBF(OUTBUF,MOU, IBEG, lEND)

INTEGER OUTBUF, DEBUG, SKIP

DIMENSION OUTBUF(MOU)

COMMOiN /BLiCI/NSCANS,NENr, DEBUG, NVAR

C OUTFUr THE HEADER CHARACTERS.

CALL 0UTINT(0UTBUF,5, 1,0)

IF (IBEG.EQ.O) GO TO 90

C OUTPUT THE MEASUREMENT VALUES NUMBERED IBEG TO lEND.

IF (IBEG.LT.IEND) N=N+IEND-IBEG

CALL 0UTINT(0UTBUF(IBEG+6),N, 1,0)

90 RETURN

END

Ci

A>e4
SUBROUTINE RDTAPE

S LI BR RDTAPE

SUBROUTINE RDTAPE( INBUF,MIN. lEHR)

INTEGER INBUF,DEBUG

DIMENSION INBUF(MIN)

COMMON /BLK I /NSCANS

,

nEN T DEBUG , N VAR

»mCHARs2*MIN

IEriR=0

ICNT==0

CALL READMTC INBUF, ICNT,NCHAR, lERR)

IF (ICNT.GT.O.AND.IERR.EQ.O) GO TO 90

CALL ERRPRT( 10,9, ICNT, lERR. 0,0,0)

IERR=I

90 RETURN

END

C;

A-65
SUBROUTINES READIN, CODIT AND DECDIT

1

' repjdih. code, and decode routines

2

7 #. FEBPUhRY 24. 1975

4 :; e * FIRST SUEROUTINE:

7 t THIS IS f< LIBRARY PROGRAM TO READ THE

8 t KEYGOhRD input DEUICE (DEFINED BELOW AS

9 t KEYBORDI > INTO A PREUIOUSLY ESTABLISHED

10 t FORTRAN BUFFER.

11 4

12 * ENTRY IS BY THE FOLLOWING:

13 »: CALL READIN <IARG..N>

14 t: WHERE lARG IS THE FIRST LOCATIO^^ OF A

15 % ' SINGLE INTEGER BUFFER IN WHICH TO PUT

16 t THE ASCII DATA AND N WILL BE SET TO

17 * THE NUMBER OF ASCII CHARACTERS READ

18 t. INTO THE BUFFER. i<iJE- 2 ASCII

19 t CHARACTERS WILL BE PLACED IN EACH

20 t WORD OF BUFFER AND THE UNUSED

21 * PORTION OF THE BUFFER < IF ANY) WILL

22 t. BE SET TO SPACES <UP TO 72).

"•'3 X

24 % NOTE IBUF CAS LOCATED BY I ARC) MUST BE AT LEAST

25 * 72 CHARACTERS (36 WORDS) IN SIZE.

26 %

27 ttriim^^^^^^^^

28 * SECOND SUBROUTINE

29 THIS ROUTINE WILL CODE AN ENTIRE ASCII

30 * BUFFER INTO A SECOND BUFFER OF TWICE THE

Jl t SIZE OF THE ASCII BUFFER. HOWEUER THE TWO

32 BUFFERS NAY BE THE SAME.

33 t

34 t CALL FROM FORTRAfH UIAA-66
35

36

37

33

39

40

41

42

43

44

45

45

47

48

49

5ei

53

54

55

56

57

5S

59

61

t'£

£•3

64

65

66

67

60

69

t

i

i^

*

t.

;:

r

X

:»:

-f.

X

X

NOTE

CALL COD IT C IBUFl.. IBUF2.H>

UHERE IBMFl IS THE LOCATION OF N BUFFER

CONTAINING ASCII DATA PACKED TWO TO A

WORD.. IEUF2 IS THE LOCATION OF A BUFFER

IN WHICH TO PUT THE CODED DATA PACKED

ONE TO A WORD.. AND N IS THE NUMBEf^' OF

ASCII CHARACTERS TO BE CODED.

IBUF2 MUST BE TWICE AS BIG AS IBUFl OR IF

THEY MRE THE SAME. ONLY HALF OF THE BUFFER

CAN CONTAIN ASCII DATA.

CODES ARE=

0 THRU 9

A THRU Z

SPACE

+X

%

ARE 0 THRU 9

ARE 10 THRU 35

IS 36

IS 37

IS 38

IS 39

IS 40

IS 41

ALL OTHER ARE 42

xxx.xxxxx.xx.xxxxxxxxxxxxxxxxxxxxxxxxxxxx

THIRD ROUTINE^

THIS ROUTINE WILL CONUERT N CHARACTERS FR(

THE INTERNAL CODE ABOUE AND REPACK THEM AJ ASCII INTO ANOTHER (OR THE SAME) BUFFER

CALL FROM F0RTRAN4 UIA^

CALL DECDIT UBUF 1,1 BUF2..N>

A-67
?0

71

72

73 * 74

77

78 *

7S' i

NOTE

NHERE IBUFl IS THE LOChTIOH OF H BUFFER

CONTi^lNlUG SINGLE WORD CODED CHrRrCTER3.. IBUF2 IS THE LOCrTION OF R BUFFER

IN WHICH TO PLACE EQUIUhLEHT hSCII

CHARACTERS PACKED TWO TO A WORD.. AND N

IS THE NUMBER OF CHARACTERS TO DECODE

IF N IS ODD.. AN ADDITIONAL ASCII CHARACTER

WILL BE PLACED IN THE LAST HALF OF THE LAST

WORD. THIS CHARACTER WILL BE A SPACE.

O 1 READIN..CODIT..DECDIT

WTRV n 1 In I READ I N . COD I T .. DECD I

S3

84

t

DO 10 EQU 68

85 S'TAT EQU 70

86 KEYBOPDI EQU 10 LUN 10

87

PErDIN D^iTA POOL

8? LOW IBUFl

STW FIOT

91 SLL 1 32. ADD N71

93 STW LAST

94 DOIO FIOT

95 STAT FIOT

be LDX FIOT+4

97 FOl CKA

98 CMW LAST

99 SLE

1 tiM JMP PQZ

101 LLB

102 ! 3800 STB % & SET SPACES

10?: IXS 1 104 JMP P91 IF IN UPPER

A-68
105 JMP POl

1 oe 'P02 LOW FIGTi-4

107 SUB IBUFl

1 OS SUB IBUFl

1 0? LDX IBUr2

1 10 .•:7soo 0

1 1

JMP RETURN

1 12

1 1? COD IT DATA POOL

1 14 CODE EUU COD IT

1 15 LDX \\ IK- LDW t 0

117 DPI X7S00

1 IS STN STNI

11? COEiEIT LOW STNI

120 RND X07FF

121 SUE Nl

1

1 ^7 jrip RETURN

124 OR I X5S00

1 ~ STW LDB I

1 26 ORE X2000

1 -'7 STW STNI

1 ">Cj LDX IBUFl

1 2? SLL D 1

1 70 CLP

IT.l LDEI LDB * Q

crx

DXS 160

134 .JMP

135 JMP GET42

1 DXS lb

.IMP P03

138 IXS 16

1 3? H6 6

SET N (N IS WRG2 HERE

GET COUNT

SET STW t N (ORIG;-

THRU'?

YES

NO

SET LDB * (WORtO

SET STN t ? <WORK>

GET ASCII CHhRrCTER

THIS PHRT OF CODE IT IS J'. TOO MUCH TO EXPLHIN WITH

COMMENTS

A-69
140

141 STB GETITl+1

142 CLR

143 - LDX TAB 1 BR

144 GETITl LDB ^l: 0

145 JMP pei4

1415 P03 DX3 10

14? JMP

148 JMP ADD 10

149 OXS

15»3 JMP $+2

1 -1

IMP GET42

152 DXS 26

153 GET42 LDX N6

154 IXS 26

155 NOP MIGHT NOT SKIP

15t. IXS 16

157 Nl DATA 1 WILL SKIP

158 CXA

15? FCi4 LDX IBUF2

i»:*e STWI STW t SET CODED CHARACTER

It. J JMP CODE IT CONTINUE CtN 162

163 DECDIT DATA POOL

164 DECODE Ei"'U DECDIT

165 LDW IBUF2

166 SLL 1 167 STW IBUF2 MA^rE IBUF2 BYTE

16y LDX N

169 LDW t 0 GET COUNT

1 7U

171 SAP ANYTHING TO DO?

172 JMP RETURN NO

1 73 STW LAST YES-SET LAST REF

174 LDW X3800

A-70
175 STW STBI SET SIB t ei 176 DECODE IT LDU S^BT

177 Xi37FF

17S •rue LrtST

179 ShN THRU?

JMP pMc. YES

ISl «DD LAST NO

1 SI- nDD Nl

IS? or: X3?My

1S4 STN STBI SET STB t ?

185 uRE

ISfc" :=.TM LDX I SET LDX t ?

IV7 LDX IBUFl

18:? LDXI LD^: :lr. e GET CODE

18-? LLB ASSUME BAD CODE

l?fj SXP CODE?

191 JNP PU5 - Sc IS BAD

V?2 41 + MAY BE GOOD

133 Ir<S 41

194 JMP P05 BAD CODE

CKA GOOD CODE

19t. STB GETIT2+1

197 CLR

1 98 LDX TAB2BR

199 GET I TI LDB 3 Pei5 LDX IBUF2

STE:I STB I 0 SET ASCII

JMP DECODE IT ANO'Cur^TINUE ON

POt LDU LhST

ShO

JMP RETURN

LDU STBI

KiDD Nl

Z:»j8 STW STBI>

rjH9 LLB

A-71
210 STEI2 STB t 0 SET SPACE IF ODD

211 RETURN SMB R RET

212 R . RET

213 DmTh POOL

214

215 N71 DATA 71

216 >:07FF DATA X ' 07FF

217 ! !20C«3 DATA X • 2000

! -5000

219 DATA X • A000

220 LAST DATA 0

<.>-

UM 1 M 36

TrBIBR DATA >TAB1

TrtB2BR DATA ^••TAB2

224 FIGT DATA 0 . N36. C0 = 7.. KEYBORDI 5-11

225 RES 5

%

ThBI BYTE 37 , 42 . 42 . 42 . 4 1 , 42 .. 42 . 42

22:? BYTE 42 .. 42 . 40 . 38 , 36 .. 39 . 42 . 42

229 *: ThB2 TEXT ' 0 1 23456789ABCDEFGHIJKL

231 TEKT • MN0PQRSTUUWXY2 .. ' 232

233 POOL DATA 5.0.0

234 IBUFl DATA 0

235 IBIJF2 DATA 0

236 \i DATA 0

237

23ft END

BE

A-72
SUBROUTINE READMT

• READ ML TAPE T ^] TO EbCD "SI^.E" bJFFErit

* (IMTERRUPT n;ERSIO.M)

** JULY 17* 1Q7^

+

* E^JrSR FHOy. FOHTRAMA \Jl^i

* C^LL READMfC IBJF* ICNJr^MCHAR, lErtrt) *

+' VHERE: TBUF T5 AM •'"'JC-J AR + .VCH AH" a»OhD S I E

* SINJGLE TMTEoER bJFFEh.

* ICMf •^JSr CO^rATX' am E^E\' Mjy.dEH OF CHAriAC-

* TERS rO S^CI? OEFOHE ?iJrfI^OG rBEi"! I.N] IbJF.

* TCMT WILL BE SET TO NEGAfWE COUMT IF THE

* RECORD SriLL COMFAINJS UMREAD DATA ANJO TO

* PLUS COU'Jr IF THE RECORD READ wAS

* CC^^PLETED. THE ABSOLUTE J^LJE OF IC'Sil * VILL EQUAL THE MJ'MBER OF CHARACfEHS nEAD

* TMrO IBJF. IF ICMT IS ^.ERO* AM ENJD-OF-

* FILE WAS DETECTED.

* , MCHAR MUST COMIAIM A POSiriVE EvEM IMfEGEri

* MU:^HER EQUAL TO THE .MAKI.-IUM Ev^E.nJ MJ^'It^En * OF CHARACTERS TO BE READ I M TO IBJF.

* y lERR -JILL BE SET TO THE MUr-IBER OF MAG- TAPE

* TYPE ERRORS (-1 IF A SIMGLE ERrvOR APPLf-

* IMG TO THE EMTIRE RECORD, -32767 IF THE

* RECORD JAS UMREADABLE, 0 IF MO ERRORS, OR

* TO THE MUM.-^ER OF CHARACTERS IM POSSIBLE

* ERROR AS A RESULT OF i^T-TYPE ERhORS).

*+ MOTE: IM MO CASE SHO 3LD MCHAR BE LAi-JGER TH.AM

* T.^?TCE THE MUMBER OF -.y/ORDS COMTAIMED IM IBJF

* LTBR READi-lT

MTRY READriT

*DQTO EQU

ST^T EOU 7 0

^:;tut EOlj

DR EOU 1 1 EF EQU 10

DRREF EOU DR + DR + DR + DR + 1 EFRSF EQU EF+ EF+ EF+ EF+ 1 >'.TDE^/ EOij 0

LT STLUM EQU 1 1 i *HETV PRQC

TRUE MTDEV=0

CLR

EM DC

F^LSE "1 TDE'«; = 0

LD;J DEv;

EM DC

EM DP

A-73
nFAPiYT DATA POOL

SrJ ERTRY

I . P < >J0

' STW DRSAVE

LDV EFREF

Sr^; EFSA7E

pni I,n.7 J.JA!T

STV WAIT

ldw erc^jt

cmjJ mo

SME

-IMP P03

SGR

.JMP POS

T.DW CKCNJT

SAP

C^!P

cm;^ ercmt

5LE

hDJ ERCMT

SA7

SAP

.TMP PO*?

POO LDV ERTHY

n<s 1 .IMP P04

P0 3 LDV I ERR

STW * 0

LDW CHCMT

LPy TCMT

STW * 0

LDV MO

LD'V DRSAVE

STW * DRREF

LOW EFSAviE

STW EFREF

SMB R.RET

.TS< R.RET

DATA POOL

PO/: ST^ ERTRY

P05 DIM MTU9*0

SAP

• IMP P0 5

GETv;

DOT MTU^* 1

pOfi DIM MTa'5#0

SLL 1 SAM

.IMP P0 7

DO I 0 F I 0 T

STAT FIOT

SET ERROR FRY COJMTEH

SAVE D.R. LIMK

SAv^E E.F. LIMK

ERCMr=0

ERCMr=-

ERCMT=l OR MORE

FORCE CHCMF +

CHCMr>ErtCMr (OX)

SET ERCMr=I AbSCC^CMD

- OK KERS COR 0)

STILL ERRORS

TRIED 5 TIMES?

MO -TRY AGAIM

YES-TKEY MJSr REALLf tJE SET ERROR COUMT

SET CHARACTER COJMT

REPLACE D.R. LIMK'

REPLACE E.F. LIMK

RETJRM TO FOR TRAM

MT BUSY?

YES

BACKSPACE

IS MT OM LIME?

YES

MO

A-74
* - J i V D T \^ CO \' TROLL Ert READf?

. r-ip

1 i ES

S DEVICE READf?

• I'^^ ^ 7 NJO

T \' T r'ES

SET SKI?

T ^ n DA SET ADDRESS

ST*' * DF.REF SET DA FA L I ,':-< 1 L DV

^ T* jJ t E F ^ E F SET E\'D-F.\' LIX'K 1 CL

s r v FR FLG SET \0 LAST Zr.?.':^?. ^ r J ERC^JT SET \J0 ERRORS

-J i f _f r \i T SET MO DATA

- I • — V i L

DOT READ 1 RECORD

GET SET a? TO «AIT

• J I." J A T T 0\' SO/iETHINJG rO 4APPE

STv ACH SAVE ACR

ST^ I •-'R SAVE I <R

L D'' SKIP

D^S o SAVE DATA?

.'"<? P0<^ n;o L D~^ N^CHAR /ES

LD/ * 0

STV SKIP SET 'lAK 3JF + 2

LD^

T.DW DR^REF

ST^ * DRREF SET DATA LI.\'K

J-'.P P0 5

DI \' r j-^. 1 5 ;iEr DATA AaD F

s r SKI ? SET :>)EJ SKIP

PI 3

* ACR SAJE ACR

s r-'- I '^R 5-^vE I <R

DT \' r 1 5 :Er DATA

L D

'' SKIP

D

S

o IS :2 j F F E R FJLL?

• T/'P NO

LDa" c^c\" r YES

r 0 R C E coj>or

C <? rc :-i INjJS AN]D

ST*' c-'icx" r SET MOT THRU

. 1 .^^ p ? 1

A-75
Pin SKIP

OAD-l

0 sa\;e data

1 MO DATA 0

STY DADR SET >JE'/^ bJrrEK

c^CMr

r<s p

DATA

STX C4CMr IMCKE^ENjf COJ.Nir

DIM MTJl* 0

SAO EkHOR?

.HP PI I MO

LD^" ERCMT /ES

T P

DATA 0

STK ERCMr SET ERRORS JP bf OME

1 . DJ MMl

.HP PIP

PI 1 CLR

srw ERFLG

PI ACR RECOv;£R ACR

I VR recov;er ixr

I MR DR REfJRM TO WHEREn/EH

* DSH DR SKJr DOWM BOTK

. DSH EF IMFERRJPrS

STv/ ACR SA\;E ACR

ST< I VR SAVE IXR

LOW CHCMT

SA^ IS COUMr '.ERG?

,H? P16 MO

DIM MTLI=)# 0 YES

SRL

SAO SMD-OF-FILE?

.IMP P14 MO

L DW SKIP YES

SAT

SAP

.IMP Pl<5 SKIP=0 OR LESS

L DW MMnP767 SKIP=1 OR MORE

,TMP P15

PI 4 LOW NMl

PI 5 STvJ ERCMT

JMP PIQ

P16 LDX DADR

DVS I LD'jJ * 0

CLB 0 REMEMBER LAST CHARACTER

DIM MTLl9#n

* SRL 1

• SAO RATE ERROR?

J^P P17 MO

SEQ YES- WAS LAST A /.EftO?

JMP P14 MO

JMP PlBt • YES

A-76
P 1 7 SEO

JMP P 1 1

LDW ERFLG

SAM

J^IP PI <^ LDY ERCM r SXM

DY5

STX ERCMT

PI « LDy CHCMT

SXP

r ys 1

1 STV CHCMT

P 1 Q LDW JPO 1 STW T

LDW ACR

LDy IXR

* TMR EF

• JPO 1 .JMP POl

• I'V^T T JM^ vJAI T

DATA 0

CHC^JT DATA 0

S'-<TP DATA 0

OADR DATA 0

DR 1 REF DATA DRL 1 DA FA DRL?

^Fl REF DATA EFL I ERFI.fl DATA 0

^CR DATA n

T VR DATA 0

DATA -

NJMTP7'i7 DATA -'^f>767

MP DATA

DRSA'JE DATA 0

efsav;e DATA 0

FALSE y.TDEV

DE7 DATA f-ITDEv;

EM DC

*ftot DATA MZjvc^7R

DATA C 0 : 7 * L

RES S

* DATA y

* DATA 6*0, n TB'JF DATA 0

T CMT DATA 0

MCHAR DATA 0

T ERR DATA 0

EMD

WAS LAST A ^.SHO?

MO

f ES

WAS LAST A ERHOR?

MO

YES

SET ERROR COUNT

SET COUMF DOWM Bf ONE

SET EXI r LIMK

RECOVER ACR

RECO^;ER KR

RETJRM TO WHENCE *E CAME

A-77
SUBROUTINE SPLITA AND UNSPLT

1 * SPLIT AND UNSPLIT INTEGERS

2 t

3 t NOUEMBER 9, 1974

• 4 t

5 t CALL FROM F0RTRAN4=

6 t CALL SPLITA<ARG1.ARG2.ARG3>

7 t OR

8 t CALL UNSPLT<ARG1,ARG2.ARG3)

9 t

10 t ARG2=0.LEFT BYTE OF ARGl C SPLITA

11 t ARG3«0. RIGHT BYTE OF ARGl

12 t OR

13 t ARG1«ARG2,ARG3 < UNSPLT)

14 *

15 LIBR SPLITA. UNSPLT

16 NTRY SPLITA. UNSPLT

17

0017 18 UNSPLT DATA POOL

6001 901C 19 LOX ARG3

0002 8800 20 LDU 4c 0

0003 3020 21 STB SAUE-t-l

0004 901B 22 LOX ARG2

0005 8300 23 LOM 4c e

0006 0A18 24 SLL 8

0007 S«01A 25 LDX ARGl

A-78
1011 26 PI

27 * 00G9 001? 28 SPLITA DATA POOL

000A 901rt 29 LDX ARGl

000B 8300 30 LZM t 0

7016 31 STN SAt;E

0OOD OhOS 32 SRL 8

000E 90 IB 33 LDX ARG2

7S00 34 STW t 0

0010 9010 35 LDX ARG3

0011 502D 36 PI LDB SAUE+1

0012 7800 37 STW » 0

0013 07FF 38 SMB R.RET

0014 2013 39 JSX R.RET

0015 0017 40 DATA POOL

41 t

0016 0000 42 SftUE DATA e

43 t

0017 0005 44 POOL DATA

0018 0000

0015 0000

001« 0000 45 DATA e

001B 0000 46 ARG2 DATA e

001C 0000 47 ARG3 DATA e

48

49 EKD

0014 R . RET

NO ERRORS
SUBROUTINE STDATA

S LI BR STDATA

I NTEGER FUNCT ION STDATA ( P AR , MPA , OUTBUF , MOU , CLSTAB ,MCL , rtRTSrtT

,

If LRECF)

LOGICAL riRTSrtT, LRECF

INTEGER PAR(MPA) ,OUTBUF(MOU) ,CLSTAB(MCL) ,VARNUM,PTR, BEG, ENJ .DEBUG

COMMON /B LK 1 /NSCANS

,

H ENT , DEBUG , NV AR

STDATA»0

WRTSrtT=:.TRUE.

C CHECK IF VARIABLE TO BE CHANGED IS A SINGLE OR A. CLASS VARIABLE.

IF (PAR(3).LT.O) GO TO 1 00

IF (PAR(3).EQ.O) GO TO 300

IF (PAR{3).GT.NVAR) GO TO 300

C PROCESS THE SINGLE VARIABLE.

VARNUMsPAR(3)

OUTBUF (VARNUM*6)» PARC 2) ^ GO TO 900

C PROCESS THE CLASS VARIABLE.

100 PTR=-PAR(3)

BEG«PTR+2

EiND=BEG+CLSTAB(PTR+l )-l

DO 150 I«BEG,END

VARNUM«CLSTAB(I)

- 0UTBUr(VARNUM*6)=PAR(2)

J 50 CONTINUE

GO TO 900

300 CALL ERhPRT( 19, 16,0,0,0,0,0)

900 RETURN

END

c;

A-8G
SUBROUTINE Tf^RAW

S LIER TRNRAfi

SUBROUTINE TR.NRArt (INBUF, M IN , OUTBUF, MOU , TABLE, MTA 1 ,MTA2 ,NREC,KPRNT)

- INTEGER INBUF(MIN) ,OUTBUF(MOU) ,NREC,KPRNT

C BEGIN LOOP TO READ , CONVERT, AND riRITE TO DISK.

DO 50 1=1 ,NREC

CALL RDTARECINBUF»MIN,IERR)

. IF (IE3R.GT.0) GO TO 90

CALL CONALL( INBUF , M IN , OUTBUF , MOU , IE RR

)

IF (lERR.GT.O) GO TO 90

CALL UTA3LE (OUTBUF, MOU, TABLE, MTA 1 ,MTA2, I ERR)

IF (lERR.GT.O) GO TO 90

CALL DS:<RTS(OUTBUF,MOU,0, 2, IERR:

IF ( lERR.GT.O) GO TO 90

i4=I

IF (I .EG. 1 ) GO TO 20

IF (I.EQ.NREC) GO TO 20

IF (KPRNT.EQ.O) GO TO 50

IF (MOD( I ,i<:PRNT) .NE.O) GO TO 50

C OUTPUT MONITORING INFORMATION ON FIRST, LAST, AND

C KPRNT'TH RECORDS TRANSFERRED.

20 CALL OUTTXT(^TRANSFER REC NO. ',8, 3,0)

CALL 0UTINT(N, 1,4.0)

CALL POUTBF(OUTBUF,MOU,0,0)

DO CO.^iTInUE

90 CALL 0UTINT(N, 1 ,3,0)

CALL 0UiTXT(' RECS TRANSFERRED 9 , 4 , 0)

RETUR:>*

END

C;

A-81
SUBROUTINE UTABLE

S LI BR UTABLE

SUBROUTIHE. UTABLE (()UTBUF,MOU, TABLE, MTAI ,MTA2,IERft)

INTEGER DAY, TIME, CLSVAR, DEBUG

INTEGER TABLE, OUTBUF.DELTAT

DIMENSION OUTBUF(MOU) ,TABLE(mTAI ,MTA2)

COMMON /BLK1/NSCAnS,NENT, DEBUG, NVAR

COMMON /BLK3/DAY(2) ,TImE(2),CLSVAR

DATA NSCANS,NENT/0, )/

I£RH=0

i4SCANS=NSCANS'»'l

C CO;H VERT -FROM HHMM TO MM.

A I NTI M« OU TBUF ( 5 ) - ( OUTBUF ( 5 ) / 1 00 ) *40

e IF FIRST TIME THROUGH, GO INITIALIZE TABLE.

IF (NSCANS.EQ.I ) GO TO 900

DELTAT= (OUTBUF ( 4 ) -TABLE ( 4

,

nENT ) ) * I 440+M I NT I M-TABLE( 5 , NENT

)

IF (DELTAT.LT.O) GO TO 960

IF (TABLE(6,«ENT).EQ.O) GO TO 910

IF (TABLE (6, NENT) .EQ.DELTAT) GO TO 920

C CHECK FOR TABLE FULL.

IF (NENT.EQ.MTAI) GO TO 950

NENT=NENT*I

C

900 DELTAT=0

TABLE( 1 ,NENT)«0UTBUF(4)

TA3LE(2,NENT)=MINTIM

TABLE ( 3 , N ENT ) = N SCAN S

910 TABLE(6,NENT)*DELTAT

920 TABLE(4,NENT)«0UTBUF(4)

930 TABLE(5,NENT)=MINTIM

IF (DEBUG. NE.U) GO TO 999

CALL OUTINT(NENT, I ,3,0)

CALL 0UTINT(TABLE( I ,NENT) ,6,4,0)

GO TO 999

950 CALL ERRPRTX I4,I2,MTA2,0,0,0,0) , GO TO 998

960 CALL ERRPRTC 14, 20,TABLE(4,imENT),TABLE(5, NENT) ,0,0,0)

993 IERR«I -

' 999 RETURN

END

A-82
SUBROUTINE WRITMT

1 * NRITE FROM CORE TO A DEUICE

2 * 3 t JANUARY 17. 1975

4

5 * F0RTRAN4 CALLING SEQUENCE

6 * CALL WR I TMTc; I BUF . N . M . I ERR . LUN > 7 * 8 * IBUF IS THE BUFFER CONTAINING THE DATA TO

9 * BE WRITTEN. IF M IS >0. THEN IBUF MUST

10 * CONTAIN ASCII DATA; OTHERWISE. IBUF MAY

11 * CONTAIN ANYTHING.

12 * N IS THE NUMBER OF WORDS TO WRITE IF

13 * M<0 OR N=0.: OTHERWISE, N IS THE NUMBER

14 4c OF ASCII CHARACTERS TO WRITE (IF M>0>

15 i: • IF M>0 AND N IS ODD, AN EXTRA SPACE WILL

le t BE WRITTEN ON THE MAG TAPE AS THE LAST

17 a . ASCII CHARACTER.

18 * N IS A FORMAT CONTROL WORD AS FOLLOWS

19 * M=<->. BINARY FORMAT )|c|cNOTE^M ONLY HAS**

20 * M«<0), SPECIAL FORMAT** REAL MEANING **

21 * M=<+), ASCII FORMAT ** FOR 7-TRK MT ** 22 * lERR WILL BE SET <-> IF A NON-RECOUERABLE

23 * MAG TAPE ERROR WAS ENCOUNTERED > IF THE

24 * WRITE OPERATION WAS COMPLETED WITH NO

25 * ERRORS. I ERR WILL BE SET TO ZERO CQ>

26 * LUN IS THE LUN ON WHICH TO WRITE.

27 * IF LUN IS MINUS. WORD 5 OF THE FIOT

28 * WILL BE SET TO ZERO AND RETURN WILL

29 * BE IMMEDIATE. THIS SIMULATES A REWIND

30 * OF DISK FILE ZERO.

31 * 32 **MaG TAPE FORMAT**

33 * 7-TRACK^

34 * M=-0. ONLY THE FIRST 12 BITS OF EACH WORD IN

A-83
35 * IBUF WILL BE WRITTEN ON THE TAPE. EACH

36 * FRAME OF THE TAPE WILL CONTAIN 6 BITS OF

37 * DATA BEGINNING WITH THE FIRST 6 BITS OF

38 t IBUF<i> FOLLOWED BY THE 7TH-12TH BITS OF

39 * IBUF<n AND 1ST-6TH OF IBUFt 2 > AND SO ON

40 * THRU THE 7TH-12TH BITS OF IBUF<N>.

41 t M«-. THE FIRST TWO FRAMES OF THE RECD WILL BE

42 * ALL rS <12 BITS). EACH 4 FRAMES AFTER

43 * THE FIRST 2 WILL CONTAIN A WORD OF 16 BIT

44 t. MEMORY AS FOLLOWS: <D=DATA BIT)

45 * DODDDD DDDDDD OODD©© 000900

46 % M=+. EACH NAG TAPE FRAME WILL CONTAIN ONE

47 * ASCII CHARACTER WITH ITS FIRST TWO BITS

48 t STRIPPED OFF.

49 * IE= SPACE=X'A0'«10100000=100000

50* • COMMA=X' AC '=10101 100=101100

51 * 1=X*B1 '=10110001=110001

52 * N=X'CE'=11001110=001110

53 * W»X'D7'=11010111=010111

54 ETCETERA

55 * 9-TRACK56 * HAG TAPE FRAMES 14HEN TAKEN TWO AT A TIME WILL

57 * BE A MIRROR IMAGE OF A WORD OF MEMORY.

58 * 59 t HOTE NO PARALLEL PROCESSING MAY TAKE PLACE WHEN

60 .t THE PROCESSOR IS OPERATIt^G WITHIN THIS SUB61 t ROUTINE. THIS SUBROUTINE WILL TAKE CARE OF

62 * NOT ALLOWING IT, THEREFORE THE USER OF THIS

63 :: PROGRAM NEED NOT WORRY ABOUT IT.

64 t"- 65 LIBR WRITMT

66 NTRY WRITMT

67 t

68 DO 10 EG'U 68

69 STAT EQU TO

A-84
"701 r o *

71 1 10 T TMT UK 1 1 n

UH 1 H cnni r UUL72 LUX LUN

7>5

''A PFLlTNn THF ni'^k.'?'

•7 c: IMP'

r 0 n p 1 CO

1 r 0QTIJ1 V* 78 JMP RETURN

f wnnoi' C'i,:n 0

1 1 P

& 1 (-•—> Oil. FIQT+2

ov

Pel SET BUF LOC

1 ny M1

ob i_-i_r. 0 i r MiJ * PFMFMPFP MfinF

00 QTIJ O.Ct\ IF iiS^.I IMF KinT Ck'^r T T 0.7

CkC\ 1 ni.i

11M

*j pni IMT Tn c^pp

Ci i 3 J CI Q MnnF'? nuuc^ r IMC Dfi> 1 rUl KiriT CiCr- T T HULI r i u 1 ASCI I 94 ADD FIOT CALC LAST BYTE LOC

95 CAX

9t- STW LhSTB SAUE LAST BYTE LOC

97 LDW SIGB GET TRIGGER BIT

93 LDB 1 GET LhST BYTE+1

99 STW ShUE SRUE LAST BYTE+1 \m LLB

STB 1 SET LAST BtTE+1 TO SPACE

10^' LDX N JUST IN CASE N IS ODD.

10". LDW 0 GET ASCII COUNT

104 ADD Nl BUMP IT BY ONE AND

A-85
105 SRL 1 FORCE IT EUEN FOR WC

106 P01 STW WDC-HT SET WORD COUNT

107 CLR ASSUME NOT SPECIAL

103 SNE MODE?

109 LDM SIGB SPECIAL

110 STW FIOT+6 NOT SPECIAL-SET FORMAT

111 LDM WCLOC ASSUME ASCII

112 SLE MODE?

113 ORI SIGB BINARY

114 STW FIOT+1 ASCII OR SPECIAL

115 DOIO FIOT WRITE THE BUFFER ON MT

116 STAT FIOT WAIT ON IT TO FINISH

1 17 LOW SAME

lis SAM DID ME CHANGE BUFFER

119 • JMP pe2 NO

120 LDX LASTB YES

121 STB t 1 REPLACE LAST BYTE+1

122 P02 LDX FIOT+S MT STAT TO IXR

123 CLR ASSUME NO ERROR

124 SXE ERRORS?

125 LOW SIGB YES

126 LDX I ERR NO

127 STW * 0 SET ERROR CODE

128 RETURN SMB R.RET

129 JSX R.RET RETURN TO F0RTRAN4

130 DATA POOL

131 : 132 SA«.'E DATA 0

133 LASTB DATA 0

134 SIGB DATA X ' 8000

135 WDCNT DATA 0

136 WCLOC DATA WDCNT

137 Nl DATA 1 138

139 FIOT RES 8

A-86
140 * 141 POOL DhTA i 142 IBUF DrtTH 0

143 H DhTA 0

144 M DhTA 0

145 lERR DrtTrt 0

146 LUN DhTn 0

147 t

14S END

BE

A-87

APPENDIX B

B-0

I
APPENDIX B: FORMAT OF RAW DATA INPUT TAPE

DENSITY: 800 f.p.i.

PARITY: Odd.

TRACKS: 9.

FORMAT: EBCDIC Characters.

LOGICAL RECORD LENGTH: 19 + 13* NVAR, where NVAR = the number

of voltage recording devices scanned by

the DAS.

BLOCKING FACTOR: 1.

NUMBER OF LOGICAL RECORDS: Variable

RECORD INTERPRETATIONS:

POSITIONS MEANING

1-12 twelve digits used as a header,

13-15 day of the year,

16-17 hour of the day,

18-19 minutes of the hour,

20-24 scanner channel number,

25 voltmeter function (M = milivolts,

V = volts)

,

26 polarity (+ or -)

,

27 over-range flag (0,1, or 2),

28-31 voltage reading,

32 characteristic for voltage reading
APPENDIX C

C-0

APPENDIX C: FORMAT OF THE 1108 COMPATIBLE OUTPUT TAPE

The following constitute tentative file formats for the RAYTHEON generated

UNIVAC 1108 compatible magnetic tape file. They are tentative in that not

all block types have been completely defined, and thus their representation

has been left open.

The tape file created by the Data Editor will be used to convey edited

data, comments inserted under control of the Editor, structured textual

information, transducer parameter updates, data order index maps, and any

other information required that will help to make the data tape self

documenting.

Data scans will be in order by time with the other types of information

inserted at that point in time with which they are concerned. Each data

scan, or other block of information, will be written out as two physical

records on the tape. The first record will have a fixed format and length

(currently 16 words) for all block types. The second record will vary in

length and format depending on the block type. Because the physical format

of the type is dependent upon 7-track versus 9-track and other representational variations (see documentation for subroutine WRITMT) , we give here

only the logical format. Numeric values will normally be representable

by 16 bits per character (dependent upon 7-track versus 9-track) . All

data values will be in binary.

The following defines the first record:

RAYTHEON WORD 16 BIT CONTENTS

1 Block Type

2 Sequence Number

3 Number of channels currently

assumed

4 Length of second record of

block

5-7 Twelve digit header stored in

314 format

8 Calendar day of year

9 Time to nearest minute in

HHMM format

10 Condition code check sum

11 Binary/formated switch

12-16 Available for future use.

C-1
Codes for the Block type are as follows:

1. Unstructed text

2. Structed text

3. Index mapping function

4. Transducer parameter update

5. Data scan

For the second record, we give here only the format for the data scan block type. The second record of a data scan block will be 634 words

long. The first 317 words contain the scan data, while the second 317

words contain the corresponding status codes. The sequence order for

the scan data will probably be changed from time to time, but initially

will be (for CEB Channels only) that in which Channel I is stored in

the iTH location, 10<I<180. The remote channels may also be stored

in a similar manner by breaking the DAS code into two indices.

C-2
NBS-lUA (REV. 7-73)

11 Q nPPT kJ&i 1 • OFW 1 COMM w w rri iTj . BIBLIOGRAPHIC DATA

SHEET

1. Fu 13 LiCA i ICJiN UK KhrtjRi NO.

NBSIR 75-735

^. Oov t Accession

No.

3. Recipient's Accession No.

4. TITLE AND SUBTITLE

The Total Energy Data Editor

5. Publication Date Jiine 1975

o. rertormmg Organization Code

7. AUTHOR(S) .

, ^ „ ^ ^ , Richard H, F« Jackson

8. Performing Organ. Report No.

9. PERFORMING ORGANIZATION NAME AND ADDRESS

NATIONAL BUREAU OF STANDARDS

DEPARTMENT OF COMMERCE

WASHINGTON, D.C. 20234

10. Project/Task/Work Unit No.

11. Contract/Grant No.

12. Sponsoring Organization Name and Complete Address (Street, City, State, ^IP)

Department of Housing and Urban Development!

Office of Policy Development and Research | Washington, D. C. 20410 j

13. Type of Report & Period

Covered

Final

14. Sponsoring Agency Code

15. SUPPLEMENTARY NOTES

16. ABSTRACT (A 200-word or less (actual summary of most si^ificant information. If document includes a significant

bibliography or literature survey, mention it here.)

This report documents the Total Energy Data Editor, a computer program developed

to process the data to be collected by the ongoing Total Energy Project at the

National Bureau of Standards. Consisting of a mix of FORTRAN and RAYTHEON machine

language subroutines, the Editor is a powerful, interactive program written to be

run on a Raytheon 704 minicomputer with two tape drives and a disk pack. Since

this document is also meant as a user's manual, it includes a dictionary of commands,

complete discussions and listings of individual subroutines, as well as an explanation of the workings of the program.

17. KEY V'ORDS (six to twelve erfries; alphabetical order; capitalize only the first letter of the first key word unless a proper name; separated by semicolons)

Data editing; computers J energy conservation

18. AVAILABILITY [X Unlimited

1 For Official Distribution. Do Not Release to NTIS

[

' Order From Sup. of Doc, U.S. Government Printing Office Washington, D.C. 20402, SD Cat. No. Cl^

I

' Order From National Technical Information Service (NTIS)

Springfield, Virginia 22151

19. SECURITY CLASS

(THIS REPORT)

UNCLASSIFIED

20. SECURITY CLASS

(THIS PAGE)

UNCLASSIFIED

21. NO. OF PAGES

22, Price

USCOMM-DC 29042-P74