Citation
Automatic computer generation of solution precedures to large sets of nonlinear simultaneous equations via GENDER

Material Information

Title:
Automatic computer generation of solution precedures to large sets of nonlinear simultaneous equations via GENDER
Creator:
Cunningham, James Richard, 1942-
Publication Date:
Copyright Date:
1972
Language:
English
Physical Description:
xii, 511 leaves. : illus. ; 28 cm.

Subjects

Subjects / Keywords:
Algorithms ( jstor )
Data types ( jstor )
Design analysis ( jstor )
Integers ( jstor )
Mathematical independent variables ( jstor )
Mathematical variables ( jstor )
Mathematical vectors ( jstor )
Recordings ( jstor )
Subroutines ( jstor )
Tears ( jstor )
Chemical Engineering thesis Ph. D
Dissertations, Academic -- Chemical Engineering -- UF
Equations, Simultaneous ( lcsh )
Genre:
bibliography ( marcgt )
non-fiction ( marcgt )

Notes

Thesis:
Thesis -- University of Florida.
Bibliography:
Bibliography: leaf 510.
General Note:
Typescript.
General Note:
Vita.

Record Information

Source Institution:
University of Florida
Holding Location:
University of Florida
Rights Management:
Copyright [name of dissertation author]. Permission granted to the University of Florida to digitize, archive and distribute this item for non-profit research and educational purposes. Any reuse of this item in excess of fair use or other copyright exemptions requires permission of the copyright holder.
Resource Identifier:
022656930 ( AlephBibNum )
13924236 ( OCLC )
ADA4871 ( NOTIS )

Downloads

This item has the following downloads:


Full Text














AUTOMATIC COMPUTER GENERATION OF SOLUTION
PROCEDURES TO LARGE SETS OF NONLITNE.AR SIMULT.ANOUS
EQUATIONS VIA GENDER







By




JAMES RICHARD CUNNENGHCAM


A DISSERTATION PRESENTED TO TIC Gi0DUATE
COUNCIL OF THE UNIVERSITY OF FLORID IN PARTIAL
FULFILLMENT' OF THE RE QI IRkMENTS FOR THE DEGREE OF
DOCTOR OF PHILOSOPHY


UNIVERSITY OF FLORIDA
1972



































COPYRIGHT

JAMES RICHARD CUNNINGHAM

1972













ACKNOWLEDGEMENTS


The author wishes to express his indebtedness to the chairman of

his supervisory committee, Dr. A. W. Westerberg, Associate Professor

of Chemical Engineering, for suggesting the research topic and for pro-

viding the necessary guidance. The author also wishes to thank the

members of the supervisory committee: Dr. F. P. May, Professor of

Chemical Engineering, Dr. R. G. Selfridge, Professor of Mathematics and

Director of the Computing Center, and Dr. F. D. Vickers, Associate

Professor of Computer and Information Sciences.

Thanks also are extended to the National Science Foundation, which

provided financial support through grant GK-18633. In addition to

providing the funds for my research assistantship, this grant defrayed

the extensive computer expenses incurred during the debugging of the

135 subprograms constituting the GENDER System.

Without this assistance and support, the development of GENDER would

not have been possible.














TABLE OF CONTENTS

Page

ACKNOWLEDGEMENTS........................................................ iii

LIST OF TABLES................................................... vii

LIST OF FIGURES.................................................. ix

ABSTRACT.......................................................... xi

CHAPTERS:

I. INTRODUCTION.......................................... 1

II. OVERVIEW OF THE CHEMICAL ENGINEERING DESIGN ROUTINES
SYSTEM................... ............................. 5

III. DATA MANIPULATION AND STORAGE......................... 11

III.1. Data Handling................................. 11

III.l.a. Lists............................. 11

III.l.b. Files............................... 14

III.l.c. Memory Allocation................... 14

111.2. Special Data Structures....................... 16

III.2.a Networks ........................... 18

III.2.b Sparse Incidence Matrices........... 18

111.3. Implementation Details........................ 22

*III.3.a. COAST............................... 22

*III.3.b. REMOTE.............................. 33

*III.3.c. NETPAC......... ................. .... 43

*III.3.d. SIMPAC ........... .............. ... 57

IV. DATA BASE....... ...................................... 66

IV.1. Service Module, SECEDE ........................ 66

IV.2. Solution Procedure, GENDER List............... 68










TABLE OF CONTENTS (Continued)
Page

IV.iS. Input/Output Facilities....................... 68

IV.4. Implementation Details........................ 70

*IV.4.a. SECEDE.............................. 70

*IV.4.b. SECIAO.............................. 85

*IV.4.c. GENDER List ......................... 89

*IV.4.d. GENIAO.............................. 98

V. ANALYSIS ALGORITHMS ................................... 101

V.1. Hungarian Output Assignment Algorithm.......... 102

V.2. Speed-Up Precedence Ordering Algorithm........ 103

V.3. Barkley Motard Minimum Tear Algorithm....... 104

V.4. Implementation Details........................ 105

*V.4.a. HASSAL.............................. 106

*V.4.b. SPEDUP .............................. 107

*V.4.c. BEMOAN.............................. 112

VI. INTERPRETATION ........................................ 114

VI.1. Link Editor ................................... 115

VI.2. Converter...................................... 116

VI.2.a. SOLVE............................... 119

VI.3. Interpreter ................................... 120

VI.3.a. MATH ................................ 122

VI.3.b. Subroutines......................... 122

VI.4. Implementation Details......................... 125

*VI.4.a. LINKED .............................. 125

*VI.4.b. COVERT .............................. 126

*VI.4.c. GLINT ............................... 128










TABLE OF CONTENTS (Continued)

Page

VII. USER MANUAL....................................... 130

VII.1. Input Data Preparation ................... 130

VII.2. Program Preparation ......................... 131

VII.3. Additional Algorithms....................... 134

VII.4. GENDER as a Design Tool..................... 134

VIII. EXAMPLES ............................................ 137

VIII.1. A Simple Analysis Strategy.................. 147

VIII.2. Equilibrium Flash.......................... 147

VIII.3. Binary Distillation ......................... 155

IX. CONCLUSION ........................................ 165

IX.1. Convenience Aspects......................... 165

IX.2. Additional Algorithms....................... 166

IX.3. A Final Note on GENDER ...................... 168

APPENDICES...................................................... 169

Appendix A............................................. 170

Appendix B............................................. 498

Appendix C............................................... 501

Appendix D.............................................. 504

BIBLIOGRAPHY..................................................... 510

BIOGRAPHICAL SKETCH............................................. 511














LIST OF TABLES


Table Page

1 COAST Verbs............:................................ 28

2 LEND Components Required by REMOTE ..................... 42

3 Auxiliary Data Fields Required by NETPAC............... 44

4 NETPAC Verbs........................................... 55

5 Data Fields Required for Ordinate Entries.............. 59

6 Data Fields Required for SIM Elements.................. 61

7 Information Block Components Pertinent to the SIM....... 62

8 SIMPAC Verbs.................. ......................... 64

9 Data Fields for SECEDE.................................. 75

10 File Entries for SECEDE ................................ 77

11 SECEDE Files.......................................... 79

12 Information Block Components Pertinent to SECEDE........ 86

13 Data Fields for GENDER................................. 90

14 The List Entries of GENDER ............................. 93

15 Information Block Components.Pertinent to GENDER List.: 99

16 Data Fields for SPEDUP Working Lists................... 109

17 List Entries on SPEDUP Working Lists ................... 110

18 Data Fields for the BEMOAN Working Ordinate............ 113

19 Operator Set ........................................... 121

20 GLINT Error Codes..................................... 123

21 Information Block ...................................... 132

22 The Code Name/Variable Assignmentsfor a
Distillation Tray...................................... 140

23 The Constant/Code Name Assignments for a
Distillation Tray........................................ 141
vii









LIST OF TABLES (Continued)

Table Page

24 Values for Information Block Components................ 149


viii














LIST OF FIGURES

Figures Page

1 GENDER Architecture................................. 9

2 Typical List Structures ........................... 12

3 Typical Hierarchical File.......................... 15

4 A Simple Network.................................. 19

5 Sparse Incidence Matrix.......................... 20

6 A User Mask ...................... .............. 24

7 PUSH................... .......................... 30

8 POPUP............................................. 32

9 File Structure.................................... 34

10 A Record.......................................... 38

11 Trace (Start).................................... 47

lla Trace. (Step 1)..................................... 48

llb Trace (Step 2)..................................... 49

lc Trace (Step 3)................................... 50

lid Trace (Step 4)...................................... 51

lle Trace (Completed)................................... 52

12 Sparse Matrix..................................... 58

13 An Equilibrium Stage............................... 138

14 SECIAO Data for a Distillation Tray................. 142

15 Data for COIN..................................... 148

16 Equilibrium Flash................................... 150

17 SECIAO Data for Equilibrium Flash.................. 153









LIST OF FIGURES (Continued)


Figures Page

18 Data for VARIAO................................... 154

19 Simple Distillation Column ........................ 156

20 SECIAO Data for Simple Distillation Column......... 158









Abstract of Dissertation Presented to the
Graduate Council of the University of Florida in Partial
Fulfillment of the Requirements for the Degree of Doctor of Philosophy


AUTOMATIC COMPUTER GENERATION OF SOLUTION
PROCEDURES TO LARGE SETS OF NONLINEAR SIMULTANEOUS
EQUATIONS VIA GENDER


By

James Richard Cunningham

December, 1972

Chairman: Arthur W. Westerberg
Major Department: Chemical Engineering


Fundamentally, chemical process plant design is the solution of a

large set of nonlinear simultaneous equations. For large and complex

equation sets, it is frequently not possible for the design engineer to

determine readily how the solution should proceed. Algorithms have been

developed which analyze equation sets with respect to solution procedure.

The algorithms do not generally attempt to solve the equation set, but

merely provide the directions for solving to the design engineer. While

computer implementation of certain algorithms analyzing equation sets

has been accomplished, little emphasis seems to have been placed on the

implementation of a complete analysis system integrating a number of

algorithms. This dissertation presents an automatic and machine-indepen-

dent system permitting the design engineer to direct solution procedure

generation and execution via selections from a spectrum of analysis

algorithms.

GENDER is the acronym for General Engineering Design Routines. The

primary objective of GENDER is the development of a complete solution

procedure. To be complete, a solution procedure must reflect (1) decision

variable selection, (2) output set assignment, (3) tear variable selection
xi








and (4) precedence ordering. These attributes are provided to a solution

procedure by GENDER through a minimum tear analysis strategy. While only

the minimum tear strategy has been furnished with the first version of

GENDER, the GENDER System has been designed to readily accept additional

analysis algorithms, expanding the analysis strategy repertoire.

The design engineer, having generated a solution procedure for an

equation set, may perform the translation of the solution procedure into

FORTRAN for execution. However, an interpreter capable of direct

execution of a solution procedure is provided in GENDER. The interpreta-

tion capability, while sparing the engineer from the drudgery of trans-

lation, has a somewhat more noble purpose. If the design problem involves

constrained optimization, the solution procedure will be subjected to a

series of revisions as additions or deletions to the set of binding con-

straints are required. The optimization-solution procedure generation-

execution cycle is potentially faster for interpretation than for FORTRAN

execution owing to the elimination of the translation and compilation steps.

GENDER depends extensively upon list processing techniques. In fact,

the solution procedure has been implemented as a list. In the list format,

the revisions and rearrangements associated with an analysis strategy may

be conveniently performed on a solution procedure. The application of

list processing techniques is not restricted to the solution procedure

alone, but permeates the GENDER System. Linked data structures of note

include a paged storage system (REMOTE) and the sparse incidence matrix.

The former is notable for compatability with mass memory and the latter

for memory conservation (on machines lacking virtual memory).














CHAPTER I


INTRODUCTION


The objective of process design is the determination of equipment

specifications and operating conditions which will meet certain produc-

tion goals developed by management. Process design problems are not

particularly amenable to solution. The equations quantitatively

describing the equipment characteristics may be highly nonlinear, a

situation further confounded by the presence of recycle streams. The

recycle stream is necessary to economic operation, but it imparts a

cyclic character to the design calculations just as it imparts a cyclic

character to the process flow. To these complexities of process design,

yet another must be added. Processing plants are frequently complex

entities, consisting of many individual processing units connected by a

make of piping. This is particularly true if the process engineer

intends to extend the scope of the plant model to include not just the

major features of the process, but all unit operations. That is, the

mathematical model is to resemble the processing plant as closely as

possible.

The availability of large, powerful computers has caused process

engineers to revise the design procedure. Prior to his introduction to

computers, the engineer was forced to simplify the process model to

facilitate the completion of hand calculations in a reasonable amount of

time. While short-cut techniques were developed for some unit operations,

the "assumption" reigned as the arme supreme. Unlike the human brain,








the digital computer is well suited to complex and repetitious calcula-

tions. The engineer could now expect solutions for large and complex

process models without the uncertainties of simplification.

The new exactness permitted to the process engineer by the digital

computer proved to be something less than a complete blessing. The

programs developed by the engineer from the mathematical models all too

frequently either failed to converge, giving no answer, or generated

unreasonable answers. Research, both industrial and academic, determined

that the computational difficulties were characteristic of particular

formulations of a model. Further, certain formulations of a model may

require more information to initiate cyclic calculations than other

formulations. What had developed at this point was a new field of

endeavor for process engineers: the study of process models. This study

begins where the traditional concept of mathematical modeling ends.

The result of mathematical modeling is the development of an equa-

tion set descriptive of, for instance, a unit operation. This set of

equations is not unique. That is, the algebraic rearrangement of one

model produces another equivalent model. It is this rearrangement and

its effects which have captured the attention of the process engineer.

The result has been a variety of algorithms for selecting a particular

model formulation.

The algorithms are rather specific in character, dealing with only

a particular aspect of a process model. Algorithms have been developed

for selecting the output variables for a set of equations, for selecting

the variables for which value estimates are required to initiate cyclic

calculations and for ordering the equations so that the calculation of

each variable value will depend only upon variable values already

calculated. These operations are respectively known as output set


___








assignment, tear variable selection and precedence ordering. The process

engineer employs selected algorithms sequentially to convert the original

model he formulated into an equation set amenable to computer solution.

The particular selection of algorithms may be referred to as an analysis

strategy. The strategy is largely dictated by the objectives of the

design engineer, such as a minimum tear solution or a rapidly converging

solution. Unfortunately, the execution of an analysis strategy must be

primarily manual. Only a few algorithms have been programmed, all of

which are machine dependent and isolated from other analysis capabilities.

The next step in this evolutionary development of process design

would seem to be totally automatic process model analysis. The notion

of automatic design is not original to this work (Kevorkian and Snoek,

1972; Soylemez, 1971; Mahand Rafal, 1971), but has been attempted

previously. It is the limitations of other automatic design systems

which have encouraged the present effort, the General Engineering Design

Routines (GENDER) System. GENDER does not restrict the design engineer

to a single analysis strategy by virtue of a library of analysis algori-

thms. Further, the inclusion of additional algorithms has been made

relatively easy. While it is possible to convert the product of an

analysis strategy, which we shall call a solution procedure, into FORTRAN

code for execution, the GENDER System provides the capability of directly

interpreting the solution procedure to produce a solution to the design

problem. As a feature designed to permit compact problem representation,

GENDER can accept indexed variables and equations. Finally, the GENDER

System affords the design engineer with a problem solving medium permit-

ting the convenient modification of the original design problem during

the execution of the analysis strategy and/or interpretation of the

solution procedure. This feature is essential to constrained





4


optimization where fluidity in the inclusion and exclusion of constraints

is an absolute necessity. While many of these features have appeared

in previous attempts at automatic design packages, they have to date

not all appeared in a single automatic design system.














CHAPTER II


OVERVIEW OF THE GENERAL ENGINEERING
DESIGN ROUTINES SYSTEM


The heart of the GENDER System is the solution procedure and is essen-

tially the set of instructions for solving a set of simultaneous equations.

In order to make possible direct machine interpretation of the solution,

the solution procedure must be explicit and complete. The purpose of

this chapter is to introduce the concept of the solution procedure, its

terminology and its relation to the GENDER System.

In Chapter I and in the proceeding paragraph the term equation was

used for a model constituent. To be more precise, the model constituents

are actually equations and solved equations. That is, the model is

composed of algebraic relations between variables and constants, but

having the form

f(x,y,z,...) = 0

rather than the solved equation form

x = F(y,z,...)

In the solved equation form, the x is called the output variable. An

equation may be transformed into a solved equation by selecting a variable

to be the output and performing the algebraic rearrangement necessary

to place this variable alone on the left-hand side of the equality.

Certain of the equations defining a processing plant may be

constraints. Normally one thinks of constraints as inequalities.

However, inequalities are readily converted to qualities via the intro-


__








duction of slack variables. GENDER, at least in its current version,

is prepared to manipulate equality constraints only. Being identical

to the equations describing the process, the constraints could be

grouped with them without differentiation. However, during constrained

optimization the set of active constraints varies in numbers and

composition. To permit the free inclusion (exclusion) of constraints

into (from) a problem, constraints are regarded as distinct model

constituents and are carefully differentiated from all other model

components.

Normally an equation is permitted but a single output variable,

with one exception. The external routine (ER) is a special model

constituent which may possesses more than one output variable. In

essence, the ER is a subprogram for determining values to output variables

given the values of the input variables. An ER may be encoded in any

acceptable programming language.

To facilitate .the incorporation of existing subprograms in a

plant model, a mechanism for indicating prechosen output variables is

essential. The mechanism selected for GENDER is a weighting scheme with

an integer scale of 0 to 9. Each variable in each equation and ER is

assigned a weight in the 0 to 9 range. This weight is the cost of

assignment as an output variable. Thus, for an existing subprogram,

the output variables are all weighted at 0 while the input variables

are all weighted at 9. This weighting scheme allows the design engineer

to indicate to GENDER his preferences with respect to output set assign-

ment. For instance, similarity of a new model with one or more previous

models may suggest at least a partial output assignment. The weighting

mechanism allows the engineer to guide GENDER in performing the initial

output assignment and may reduce execution t.ne depending on the ultimate








degree of similarity between the solution procedures for the models.

In addition to output set selection, analysis of the equation set

must also order the equations and, if possible, subdivide the functions

into smaller groups. Initially, the plant model is treated as a single

large group of equations. The decomposition of the large problem into

a multitude of smaller problems is obviously advantageous. Equations

which are acyclic in character may be grouped, although the equation

grouping normally reflects the presence of a cyclic character. It is

permitted by GENDER to have groups as members of groups. Thus, we

may have, for example, a cyclic group appearing as a constituent of

another cyclic group, or even as a constituent of an acyclic group.

Once tear variable selection has rendered all cyclic groups apparently

acyclic (by ignoring all occurrences of the tear variables except in the

equations where they are the output), it is possible to order all

members of groups and to order all of the groups so that the information

flow is strictly forward. That is to say, the value of a variable is

never required as the input to a equation before it has been calculated

as the output of a previous equation. This then is the concept of

precedence ordering.

The solution procedure must reflect the output set assignment,

grouping, tear variable selection and precedence ordering. The solution

procedure must also indicate decision variable selection, the decision

variables being the unassigned variables following output set selection.

Numerous strategies exist for acquiring these ingredients to the solution

procedure, but for completeness all must explicitly appear.

The solution procedure is called the GENDER list. The GENDER list

consists of group, each group possessing a body of equations, ER's or

groups. Each equation and ER appears once somewhere on the GENDER list.









Its position on the GENDER list is dictated by precedence ordering.

Space is reserved with each equation and ER to indicate the selected

output variables. Similarly space is reserved for the recording of

the decision and tear variables associated with each group. The

completed solution procedure will.generally be evolved from a skeletal,

random listing of the equations in a single group called the crude GENDER

list.

The completed solution procedure contains all of the instructions

for solving the equation set, but is as yet not amenable to interpretation.

The conversion operation transforms equations into solved equations via

algebraic arrangement. In lieu of destroying the original equation set,

the converter operates on a copy of the equations. This feature of

GENDER preserves the original model should reanalysis of all or a

portion of the solution procedure be required. This eventuality might,

for' instance, be realized if convergence difficulties of a cyclic group

are encountered. Once subjected to conversion, the solution procedure

is transformed into an ordered and grouped list of solved equations

ready for numerical evaluation.

The GENDER System is divided into five major program levels as

shown in Figure 1. The program packages COAST (level 1), REMOTE (level

2), SIMPAC and NETPAC (level 3) are discussed in Chapter III. These

packages provide the capacity to manipulate certain data structures

essential to GENDER. Chapter IV introduces the data base SECEDE and

provides greater detail on the GENDER list. The algorithms available

for problem analysis are discussed in Chapter V. Level 4 of GENDER

is devoted entirely to the analysis algorithms. The highest current

GENDER level is level 5. On this level is found the input/output


__ _


























-- I-I .
f-









C.)


-I I


0







o
a:













o
.--l


0t
F--





CV)


z


C.


E-
2H


E-

1-t


C,3







C-3
-->
... .








facilities and the programs relative to interpretation of the GENDER

list. The description of the input/output facilities has been incorpor-

ated into Chapter IV. The notion of GENDER list interpretation is treated

in Chapter VI. Chapter VII is'a brief user's guide to the GENDER System.

In this chapter the expansion of the repertoire of analysis algorithms

is discussed, as well as the employment of GENDER as a design tool.

Illustrative problems are presented in Chapter VIII. This work is

concluded in Chapter IX with some remarks on the limitations and

possible future of GENDER.

Particularly in the next four chapters, some sections are extremely

detailed. In addition to being difficult to read, they are likely only

of benefit to readers contemplating algorithmic additions or modifications

to the GENDER System. For this reason, these sections are identified

by an in the section number and may be omitted by readers not requiring

the' implementation details of GENDER.













CHAPTER III

DATA MANIPULATION AND STORAGE


III.1. Data Handling

The algorithms for solution procedure development suggest certain

data structures. Effective implementation of the algorithms requires

the availability of these data structures. Unfortunately, the data

structures require vast quantities of on-line memory. A large scale

problem would, by virtue of the data structures developed during problem

analysis, very quickly reach the bounds of on-line memory. Fortunately,

not all of the data structures need exist at one time, making feasible

the sharing of memory. A priori, the. memory required by each phase of

problem solving is unknown. Thus, the simple partitioning of memory is

an infeasible sharing policy.

Two basic and complementary data storage mediums have been provided:

lists and files. The list permits complex data structures which may be

readily rearranged, expanded or contracted. The penalty for this flexi-

bility is high access times. Reaching a particular location may be

accomplished only by stepping through all preceding list locations.

Conversely, the file allows rapid random access of any location. Files

are, however, restricted to a strictly sequential structure. Memory

sharing is accomplished by a dynamic memory allocation procedure. For

readers not familiar with list processing, Knuth (1968) provides a

complete discussion of list processing principles and structures, including

memory allocation.

III.l.a. Lists
Figure 2 is an illustration of three possible list structures. As
11

















































ar


u

4J





*H
cl)










*c4




*Hl









indicated pictorially in Figure 2, the structure of a list is relatively

arbitrary. The arrows in Figure 2 represent the connection between list

entries and are called links. Thus one data item (at least) in a list

entry is a pointer to an adjacent entry on the list. This flexibility

has not been restricted to structure alone. Each entry on a list

possesses the attributes of size, quantity of data and organization of the

data within the list entry. All of these attributes are also arbitrary.

The structure of a list, while arbitrary, is specified by the

programs which generate and manipulate the list. That is, the degrees

of freedom permitted in the selection of a list structure are consumed

by the programmer of a list processing application. Since one of the

objectives was machine independence, and since word size and memory size

vary from machine to machine, it seemed necessary to segregate the

organization of data within list entries from the tailoring of list

structures to meet strictly programming requirements. This has been

accomplished by designing the list processor to accept the data organiza-

tion parameters as data prepared and supplied by the user. These parameters

are further discussed in Chapter VII.

The utility of a list processor lies mainly in the usefulness of

its operations. We shall call the subprograms providing these operations

"verbs." Verbs have been provided for obtaining and releasing list

entries and for making and breaking the links between list entries.

These verbs form the nucleus of the structure manipulation power of the

list processor. Another set of verbs provides the capability for trans-

ferring information to or from a list entry. Of great utility is the

ability to search a list for the occurrence of a particular set of data

values. A verb providing this service is also included in the list

processor.








III.l.b. Files

Figure 3 is an illustration of a typical hierarchical file. The

arbitrariness of structure present in lists has, for files, been reduced

to the specification of the number of levels in the hierarchy. Rapid

access to randomly selected entries at any level is the incentive for the

sacrifice of arbitrariness in structure. Owing to the sequential storage

of file entries in on-line memory, large contiguous blocks of memory

allocation may be required. It is, therefore, vital that the file system

utilize core effectively. However, the sequential nature of the file

entries makes possible the transfer of file data to mass memory devices.

This enables the release of on-line memory normally occupied by files

during problem solution phases not relying on the file data. Further,

even when file data is required, it is possible to retrieve only portions

of a file.

SA file entry is essentially the same as a list entry, except that

the explicit specification of links, as in the list entry, is absent.

The organization of data within a file entry is accomplished identically

as for a list entry. Thus, the file entry shares the same arbitrariness

of data organization provided for the list entry.

Many fewer verbs need be provided for file manipulations than for

lists since link manipulations are not required. In fact, three verbs

are sufficient. One verb is required to provide a file entry and

transfer data into it. A second verb provides the capability for retriev-

al of data from a file entry. Finally, the third verb permits the

searching of a file for a particular set of data values.

III.l.c. Memory Allocation

The particular memory allocation strategy adopted for GENDER

continues the theme of flexibility and arbitrariness. Each phase of





15








problem solving is allocated memory only as it is required. An accounting

mechanism keeps track of the memory assigned to each phase. This mechan-

ism permits the release of memory assigned to a particular phase once its

task is complete. The released memory may then be reallocated to another

phase of problem solving. The allocation, release and re-allocation

capabilities give memory the fluid character essential to providing a

time varying memory distribution in response to the time varying demands

of the solution phases.

The dynamic allocation of memory provides an opportunity for

fracturing memory into small isolated segments. This eventually would

prevent the servicing of a request for a large continuous allocation

of memory. Though procedures such as garbage collection have been

proposed for reclaiming the isolated memory, these procedures have not

been used for GENDER. The need for large blocks of memory has been

avoided by designing the file system so as to utilize only reasonably

sized continuous blocks of memory.

III.2. Special Data Structures

Networks Since the algorithms for solution procedure development

in many instances specify rearrangements of the solution procedure, a list

structure was adopted. Hence, the solution procedure became known as the

GENDER list. During the course of evaluation of the entries on the GENDER

list via the interpreter, an anomaly may be encountered necessitating

reanalysis of a portion of the GENDER list. In fact, all of the GENDER

list from the anomaly to the list end is subject to reanalysis. Consider

the following set of equations.

Y_(,u) = o
(1)
(z,v) = 0
If reanalysis of Y is required, Z would be subject to reanalysis,









although reanalysis of Z would result in no change. Instead of the list

structure, suppose a structure is substituted in which each entry precedes

only those entries that it influences. Then, Y and Z would appear on

parallel paths since they are independent. This structure is a network,

and was adopted for the solution procedure (which is still called the

GENDER list).

Sparse Incidence Matrices (SIMs) Incidence matrices provide a

convenient and lucid medium to express the problem to which an algorithm

is to be applied. In fact, many algorithms for solution procedure gener-

ation are most easily explained in terms of their effect on incidence

matrices. This is to suggest that incidence matrices may be a natural

and effective tool in the implementation of these algorithms. Unfortun-

ately, matrices are relatively expensive in terms of memory requirements.

This is particularly damaging in light of the intention to construct

GENDER so as to be applicable to large scale problems. In chemical

engineering, and perhaps in other disciplines as well, most equations

contain only a small number of variables compared to the total number

of variables in the problem. The average incidence for several chemical

engineering applications examined was approximately three to four variables

per equation. The majority of the incidence matrix elements are null. By

considering the matrix elements to be list entries, and by disregarding

all null elements, the use of incidence matrices is made.possible without

the disadvantage of excessive memory requirements. The elements form the

orthogonal list structure shown previously in Figure 2. For example,

if an equation contained only two variables, then the row would be composed

of only two list entries. The columns represent variables so that each

,of the two row list entries are also members of the orthogonal column

lists as well.





18


III.2.a. Networks

A network is an extension of the forward-backward list structure

to permit each list entry more than a single forward and a single back-

ward link. The capacity for parallelism is furnished by auxiliary lists

called divergers. All list entries other than diverger entries are

referred to as network nodes. Figure 4 depicts a node followed by three

parallel nodes.

Networks have virtually all of the attributes associated with a

forward-backward list structure. The arbitrariness of data organization

within the nodes is somewhat restricted by the requirement that certain

data entries be present as an integral part of the structure. Highly

parallel structures may suffer with respect to access times as a result

of large divergers.

The network verbs implemented are essentially concerned with the

peculiarities of network linkages. The list processing verbs for data

transfer serve equally well for nodes as for list entries. Subprograms

are provided for the connection and for the separation of nodes. A

complementary pair of function subprograms permits the extraction of

linkage data, one for the forward link and one for the backward link.

The policy of providing the capability for searching list structures is

continued here for networks. Finally, a rather special verb is provided

enabling an orderly, predictable tracing from node to node through a

network. This verb, a function called NEXT, has proven to be of consider-

able utility.

III.2.b. Sparse Incidence Matrices

Sparse incidence matrices are actually a hybrid of the orthogonal

list and of the file data structures. Figure 5 illustrates a sparse




















































node node node


Figure 4. A Simple Network.





























































.4



'U
0



H
0
U








incidence matrix consisting of two equations and three variables. The

files required for the sparse incidence matrix are termed ordinates. Each

file entry contains a pointer to a row or column of the matrix. For simplic-

ity, when reference is made in general to a row or column the term vector

will be employed.

Even with the inclusion of the two ordinates, the memory conservation

remains substantial. Consider a system of 1,000 equation in which 1,000

variables are incident. The resulting incidence matrix must contain no

fewer than 1,000,000 words of memory if stored as a standard two dimen-

sion array. Allowing three words per non-null element (for the horizontal

link, vertical link and data item), the elements of a typical sparse

incidence matrix would consume only about 9,000 words. The ordinates

and supporting data structures would require at most approximately 30,000

words. Thus, the memory savings afforded by the sparse incidence matrix

exceeds 960,000 words over the simple two dimensional array. If the

ability to pack information into list and file entries is utilized to

its fullest extent, the size of the sparse incidence matrix may be reduced

by as much as 50% depending upon the word length. The penalty for

memory conservation is increased access time. A matrix vector may be

accessed randomly and relatively quickly by virtue of the ordinates.

Reaching a particular element list entry, however, can be accomplished

only by tracing the selected vector from element to element until the

desired element is accessed.

The nature of the subprograms provided for the manipulation of

sparse incidence matrices are rather specific in character. Each sub-

routine is designed to fulfill the requirement by one or more of the

algorithms for a certain sparse incidence matrix operation.








111.3. Implementation Details

The implementation of the data handling facilities discussed in

Sections III.1 and III.2 has been partitioned into four program packages.

COAST is the name given to the program set providing the core allocation

and list processing capabilities. The subroutines furnishing the file

manipulations constitute the REMOTE system. NETPAC and SIMPAC are

respectively the network and the sparse incidence matrix program sets.

Each of these packages are discussed in detail in the subsections to

follow.

The remainder of Chapter III may be omitted by any reader not

requiring a knowledge of the programming details. A knowledge of

these details is not expected to be generally advantageous except to those

readers planning additions to the algorithm library, alterations to an

existing algorithm, or alterations to the GENDER facilities.

* III.3.a. COAST

To achieve machine independence, FORTRAN was selected as the program-

ming medium. To provide the space required for the development of list

structures, a COMMON declaration was employed to reserve a vector named

ALLOC. The length of ALLOC is a user specified parameter. The position

of a word of memory within ALLOC is referred to as the absolute address,

or simply address, of that word. For example, the fifth ALLOC word has

an address of five.

The memory allocation strategy adopted for GENDER is the buddy system.

To reduce the administrative effort required in supervising the allocation

of ALLOC to user programs, ALLOC is partitioned into multi-word segments.

Segment size is also an adjustable parameter. To permit the allocation

of space in sizes other than a single segment, consecutive segments may

be combined to form buddies. In fact, two contiguous blocks of memory









of equal size may be combined to form a buddy. Requests for space are

satisfied by supplying the smallest buddy satisfying the request. Should

only a larger than necessary buddy be available, a request for a lesser

amount of space may be satisfied by first fracturing (splitting into two

parts) the larger buddy. All of the available buddies of each size are

linked together forming an available space list for each buddy size. The

operations necessary for memory management are provided by the subprograms

C8COMB and C8GIVE.

In order to facilitate the release of ALLOC segments by user

programs, an accounting system is necessary. The accounting device

adopted is a mask. Each bit of the mask represents an ALLOC segment. A

set bit in a user's mask indicates that the corresponding segment is

assigned to that user. Each user program is assigned a user mask on its

initial request for space. Figure 6 is an illustration of a user mask.

A similar mask, established before allocation commences, is provided to

record segments released by user programs. Whenever the buddy available

space lists become sufficiently depleted that a request for core cannot

be honored, then the space represented by the return mask is re-buddied

and returned to the available space lists. This strategy eliminates

execution of the costly re-buddying process unless it is absolutely

necessary. CORN is the program furnished to permit the release of ALLOC

segments by a user. The program LIST accomplishes the update of a user

mask as memory segments are made available to a user program.

A user program requestsspace via a five word vector called a space

utilization record (SPUR). The first word of the vector contains the

address of the user mask. For the initial space request, this word must

contain the integer zero. The second word will contain the pointer to
















-I
-



/ /,/f1$#'



C0)


cC 0
*/ U




Ns.
/ T\ -








ril
El)
_\


\ j1
/ .-'I--\


I








the space provided during allocation. The third and fourth vector

components are respectively the quantity and the size in words of the

requested list entries. The list entries are manufactured from a

buddy of the appropriate size and provided to the user program as an

available space list. The last component of the SPUR indicates the

list type, a subject to be considered later in this section. Several

programs requiring ALLOC space may share a SPUR vector, thereby sharing

the allocated core.

Information is contained within list entries in data fields. A

data field consists of either all or a portion of a list entry word.

Data fields consisting of only a few bits are usually referred to as

flags. A data field appearing in one or more consecutive list entry

words constitutes a data type. The collection of all data types

associated with the entries of a particular list structure constitutes

a list type. The quantitative specification of a data type requires four

parameters. The first two delimit the bounds of the data type within a

list entry. For example, if these parameters are valued at 1 and at 4,

the data fields of this data type appear in words 1 through 4 of the

list entry inclusively. The second pair of parameters delimits the

bounds of the data field within a list entry word. The third word,

called a shift, is the integer by which a list entry must be divided

to place the first bit of the data field in bit position 1 of the

dividend. For instance, if the data field begins in bit position 3,

dividing by a shift of 4 will translate the field the required two

positions. The last parameter is a field mask comprising set bits

indicating the bit pattern of the data field. The field mask should

be right justified to the first bit position of its single word. The

collection of all sets of these four parameter vectors constitutes








the list entry definition (LEND) specifying the organization of data

fields within the list entries of a list type. Thus, a LEND is required

for each data type. COAST utilizes the subroutine COIN to accept the

LEND's from a user as data. COIN is the only COAST routine requiring

data.

In order to accomplish the transfer of information to or from

the data fields within a list entry, the data fields involved in the

transfer operation must be uniquely identified. It is to be permitted

that a single transfer operation may involve many data fields from

many different data types. Thus, the transfer operation requires two

vectors, one reserved for the values of the data fields and a second to

identify the data fields. The latter vector consists of three words per

data type involved in the transfer, plus an additional word specifying

the number of data types. Each three word set comprises a data type,

the'occurrence of the first field for transfer and the occurrence of the

last field for transfer. For example, a three word set (4, 2, 7)

indicates that the data type is 4, the first field transferred will be

the second and the last field transferred will be the seventh. The

transfer for data type 4 will consume six words of the value vector.

All of the COAST verbs performing data transfer operations employ the

vectors described here, except COPY. COPY performs the direct list entry

to list entry transfer of information, and does not require a vector for

value storage.

The first occurrence in a list entry of data type 1 was selected

for the forward link. Similarly, the first occurrence of data type

2 is reserved for the backward link when backward links are required.

Technically, links are simply data fields and may be manipulated as data

fields using the data transfer subprograms. The convention adopted








regarding data types for links permits the creation of faster, more

convenient verbs specific to link manipulations.

It is the nature of the forward-only list to prohibit the access

to the predecessor of a list entry. The absence of the backward link

makes necessary special handling of operations involving the removal

of entries from a forward-only list. In particular, if the last entry

is to be removed, it is not possible to set the forward link in its

predecessor to zero since the address of the predecessor is unknown.

In this situation, the last list entry becomes a private termination

cell, PTC, (Cooper and Whitfield, 1962/3) and is fitted with a forward

link of 1. Thus, a unity forward link is the identifying characteristic

of a PTC. PTC's remain linked into the list but are not otherwise an

active part of the list. If the list entry is to be removed from a

forward-only list, the entry itself cannot be physically removed as its

precursor in the list (which points to it) is not known. However,

by copying the entire contents of the list entry following the one

to be removed into the list entry to be removed, one has created

the effect of removing the chosen entry. The list entry following is

then deleted from the list and added to the user's available space

list.

Table 1 presents a list of the COAST verbs which are the primary

list processing subroutines. Omitted from Table 1 are those COAST

programs which are not of direct utility to the programmer of a list

processing application. Three verbs included in the table require

further attention.

LOCATE, as its name implies, searches a list for the occurrence

of a specified pattern of data field values. The data specification

vector employed in data transfer operations provides LOCATE with the






28











4-'

H- 4-
M O


C) a) 1

a) P4H
Uo co 4> C
m cu H p

co H H H a 41
E *H c r-- E
r O 4-' C I0

a) c *ri 4 p-
(0 U l 0> U- EU

(3 ( r H r K (
m (n 0 m
0) 3 CU ,) U) l: 'CU p) Cw
CU 0 Q) *H Cr H > CU
3 4-' E W H *H 4-' 0



UO CO C 4-' ) )
Pr4 0 :- .H ) 4 4 H E
a) -i ro (v -P 41
H c ) CU H n 0 O rl- H
U) H CU cUi CU >I C) H
Q < 'w q-4 4, 4-!' 0 Cq
- 4-' 'u) C 0 0CU C + 4-
co0 Mw U H ) i C 'o CU n U)
2 -1 U r-l 'H A cu ) a) c 4-' *H r- C
0 0 A m0
w4 > H >) 'U CU C C CU C 04 C i p H
CU 'H $4 fl tC4H > > cU CU a) ui C CU
E .- 'U a) > C 4 4-
<. H o -' *m- CU1 4 p p
0- < ) CV $4 a) C) z) (U)$4X4-'U) u)C















CD CD w co 0 0 0 0r-l
u L 4 -I P





(U
0 0 Cr

oU ) CU $4 co)


4-) N co *z H 4-
CU *H CU CU C(3 )
Z H C cu '
m C 4 CUu

C *H CU *H
(-) -l i--








identification of the data fields to be inspected. LOCATE permits two

modes of operation which are referred to by the descriptors "AND" and

"OR". In the "AND" mode, LOCATE is directed to accept as a match the

first list entry found to contain the specified data pattern in its

entirety. The "OR" mode relaxes this requirement for matching somewhat.

In the "OR" mode, the data pattern is partitioned according to data

type. The partitions are compared individually to their respective

data fields of a list entry. The search is successful when a list

entry is encountered possessing the fields of a data type which match

the corresponding data value partition. In either mode, the search may

be specified to proceed in the forward direction, in the backward direc-

tion or specified to encompass the entire list (accessible from the

specified starting point).

Like LOCATE, the verbs PUSH and POPUP involve both links and

data, but unlike LOCATE result in alterations to the list structure.

The.PUSH operation is pictorially presented in Figures 7.

Although the illustrations are based on a forward-backward list, PUSH

operates essentially the same on forward-only lists with two exceptions.

Owing to the absence of the backward link, the push-up mode and the

insert-before mode cannot be performed per se. If the position of the

data on the list is the important consideration and not the address of

the particular list entry containing the data, then the insert-after

mode and the push-down mode may be taken as the equivalent of the

push up and insert before modes.respectively. The verb POPUP is

essentially the inverse of the verb PUSH. Figure 8 shows the POPUP

operation in the forward direction. In the case of forward-backward

lists, POPUP is symmetrical and will operate equally well in the backward


































































0

:3
'04Q

'o

r.0
.r


Co

:1
00r






31
















o












I I )








k :



)O 4
*)C o m c






32




























a -?f a




o
8




C b"l




--
a+










E-i









direction. Thus, if POPUP from C to B (according to the backward link)

is specified, the entries from B through C in the forward sense will

be transferred to the user available space list. The data source will

be list entry C. In the example of Figure 8, if the operand C were

replaced by Q, POPUP would remove from the list all entries from B to

the end of the list. For a forward only list, B would of course

become a PTC. Again, the symmetry of POPUP allows this mode of operation

for forward-backward linked lists.

As stated at the beginning of this section, machine independence

was a goal of the GENDER system design. Unfortunately, the logical

operations "AND", "OR" and "exclusive OR" are required for the mask

manipulation operations. These logical operations cannot be conveniently

provided directly in FORTRAN, necessitating recourse to assembly language.

These operations are basic machine instructions and required little

effort to prepare for the IBM-360 or 370. This is expected to be true

for all other machines as well.

* III.3.b. REMOTE

Avoidance of dependency of the hierarchical file

storage system, REMOTE, on large continuous partitions of the ALLOC

vector was a paramount consideration in the design of REMOTE. The

design is to require file storage in smaller ALLOC partitions, which

are somehow connected together to give the illusion of being contiguous.

As a further constraint, the linkage mechanism must not seriously

interfere with the intention to permit file storage and retrieval form

mass memory.

Figure 9 shows the structure *adopted for use by REMOTE. The

catalogue consists of a forward-backward linked list of ALLOC segments

(which could contain, say, 32 or 64 words each). The forward and





S 34
register 1


register 2


Figure 9. File Structure.


catalogue


record 1


record 2








backward links are respectively the first and second words of each

catalogue segment. All other catalogue segment words may contain the

address of a register. A register is identical in structure to the

catalogue. Each register segment word (excluding the first and second)

may contain the address of a record segment. The set of all record

segments referenced by a single register constitutes a record. It is

customary, since a one-to-one correspondence exists between registers

and records, to say that the catalogue refers to records.

It is in the record segments that the files are stored. Record

segments may be any desired multiple of the ALLOC segment size. The

size is specified via the SPUR vector introduced in the preceding section.

The continuity of a record (or should we say apparent continuity) is

achieved by virtue of its register. The absolute addresses of all record

segments participating in file storage are kept in the register segments.

Zero contents of a register segment word indicate that the corresponding

record segment has not yet been requisitioned from ALLOC. A negative

integer stored in a register segment word indicates that the contents

of the corresponding record segment are currently resident on mass

memory.

Let us briefly review the objectives and constraints noted in the

first paragraph of this section before pursuing the features permitting

the hierarchical character of file storage. The use of record segments

certainly satisfies the stipulation of eliminating any dependence of

the file system on large partitions of ALLOC. The registers provide

the linkage mechanism for the record segments which is thus segregated

from the records and interference with mass memory operations is

therefore minimal. Further, the linkage mechanism seems to satisfy

the requirement to provide rapid random access and gives the record









apparent continuity to the user. It is important to note, however,

that these objectives were met without creating a support structure

that would require a large amount of memory. For example, consider

an ALLOC segment to be 32 words and a record segment to be 64 words.

A catalogue segment and a register segment, a total of 64 words, can

hold the addresses for up to 30 record segments or a total of 1920

record words. Thus, the support structure (catalogue and registers)

only consumes slightly over 3% of the total memory allocated to a file

storage application.

The responsibility for the hierarchical character of the file

storage system belongs to the directory concept. Consider, if you

will, a file consisting of single word file entries. Into each file

entry place the address of a file. This then is the notion of a

directory. It is a file which refers to subsequent files. One or more

of these subsequent files may also be a directory.giving rise to the

hierarchical property. However, care must be exercised with respect to

the addresses employed in the directory entries. If absolute addresses

are used, the file system would become dependent upon the particular

ALLOC buddies serving as record segments. This would seriously impair

the use of mass memory. An addressing scheme independent of the absolute

addresses of the record segments is required; a relative addressing

scheme is used.

The relative address of a particular word in a record is simply

the integer identifying its sequential position within the record. That

is, the ninth word of a record has for its relative address the integer

9. (We shall adopt the convention that the word "address" appearing

without the modifier relative will be taken to mean "absolute address.")








The absolute address is readily calculated from the relative address

by using the register. If a record segment has 64 words in it then

relative address 132 is in the third record segment, word 4. The

absolute address of the third record segment is kept as the third entry

in the register.

When preparing to add a new file to a record already containing

one or more files, it is necessary to know where the last file ends.

To this end, the first word of each record (the word in relative address

1) is reserved for the relative address of the first empty word in the

record. It is also advantageous, when manipulating a particular file

within a record, to know how many file entries constitute the file and

how mary words each file entry occupies. A special file entry appears

as the first entry of each file containing these two parameters. We

shall call this file entry the parameter entry of a file.

Figure 10 is an example of the contents of a record. In this

example, 16 words are occupied by files, so that the first record word

contains 17. The first file commences in word 2 of the record with its

parameter entry; this special entry is illustrated as occupying two

words. It indicates that the first file contains two single word

entries, whose contents here are 6 and 11. In particular, this first

file is a directory and its entries contain the relative addresses of

two other files. For instance, in word 11 we find the parameter entry

of a file composed of two file entries of two words each.

Quite naturally, the question arises, as to how access to a partic-

ular file entry may be achieved. Access to a particular file entry

entails selecting the appropriate record (ie, the address of its register)

from the catalogue, and then making selections from each directory to

reach the desired file. Once having accessed the file, by using the


























word number
(Relative Address) record Relative address of next
unused entry
1 17
2 Parameter
3 1 Entry directory
F-- 6
5 11
S3 Parameter
7 1 Entry File 1

9

11 2 Parameter
2
Entry
13 File 2

15

17


Figure 10. A Record.








number of words per file entry, reaching any particular file entry has

been reduced to a problem primarily in counting.

The required selections to be made from the catalogue and

directories are specified by a vector, LISTER. The first word of

LISTER is its dimension, or in other words one plus the number of

choices. The record to be selected from the catalogue is indicated in

the second LISTER word. If the dimension of LISTER is N, then the

next (N-3) components of LISTER specify selections from the directory

hierarchy. (There is no requirement that directories need be employed

if a record is to contain only a single file.) Finally, the last LISTER

component, the Nth, identifies the particular entry from the file

selected. For example, if the record shown in Figure 10 is record

number 10, then the LISTER vector (4, 10, 2, 1) will result in the

access of the file entry commencing at relative address 13. (Word 1

indicates the length of the LISTER vector which is 4. The 10 says the

address of the register for this record is in the tenth entry in the

catalogue. The 2 says we are to go to entry 2 of the initial directory

which points us to file 2. The 1 indicates we want the first word of

the file which is word 13.)

The LISTER vector provides sufficient information for accessing

an entry in an existing file, as in the transfer of data from a file

entry. When data is to be stored in a file which until this point has

not existed, supplemental information is required about the size of

any new directories, the size of the new file and the number of words

per file entry. This supplemental information is required to insure

that sufficient space is reserved (since later entries may be added)

for each new directory and file added to a record. This information

is provided by a second vector supplied by the user, the length of which








is 2+ the number of directories. If LISTER(l) is N, then the

number of components in the auxiliary vector is (N-l). Note that it is

necessary only to provide the number of entries in each directory and

not also the directory entry size since by convention the directory entry

size is permanently fixed at unity. Directory sizes account for the

first (N-3) components of the auxiliary vector. The remaining two

components are respectively the number of file entries and the file

entry size. The supplemental information is of utility only for those

directories which have not previously been established. Components

corresponding to existing directories are ignored.

Consider a file processing scheme involving the access of many

entries on a particular file. The catalogue and directory selections,

if repeated for each file entry, would constitute needless repetition

since access of the same file would be the result each time the selection

sequence is executed. Thus, it is desirable to provide the means of

reaching another entry in a file from a file entry that has already

been accessed. The move relative to a given file entry to reach another

is specified by providing the distance (i.e. number of file entries) of

the move and the direction of the move. The LISTER vector is the vector

for this information. LISTER(l) is set to 1, indicating the move-relative

mode. LISTER(2) contains the displacement as a signed integer, with

positive and negative values indicating forward and backward displacements

respectively. The LISTER vector (1, 1) would access word 14 of the

previous example. Repeating with (1, 1) wbuld then accessword 15, and

so forth.

If movement relative to a particular file entry is to be accomplish-

ed, one must know exactly the location of that file entry. Unfortunately,

knowing the location of a file entry involves more than simply knowing








its absolute or relative addresses, though these addresses are certainly

essential. It is also necessary to have available theaddress of the

record segment, the sequence number in the record of the.record segment,

the register segment address and the particular record segment word

referencing the record segment. This is by no means a complete list,

for many other parameters have been found to be of utility in expressing

positions within files or of utility in executing the relative move

itself. To provide a storage medium for these parameters, a vector,

JCLOAD, has been created. This vector consists of 30 components, each

of which is described by the comments to program C4ADRS in Appendix

A. For most users it will be sufficient to know that the vector exists

and is provided by the user, and that user changes to the vector are

prohibited if the relative movement option is to be exercised.

As a result of the sequential appearance of file entries within

the files, no verbs for link manipulations are required. In fact, the

user is provided with only three verbs for performing manipulations of

file storage. These are STORE to store data in a file entry, FETCH

to retrieve a copy of data in a file entry, and FIND to locate a file

entry containing a particular data value pattern. The specification of

the data fields to participate in the data transfer operations is

accomplished identically as in the description in the preceding section

for COAST. REMOTE does require certain restrictions with respect to

data types. Table 2 gives the data types, with their LEND components,

which are necessary. Beyond these four data types, the user is free

to organize the LEND in any convenient fashion. The V in Table 2

indicates locations where the user may exercise choice.

One eventuality of file storage has until now been neglected.

It is possible that a file entry occupying several ALLOC words may not


























.,4


0
,)














0
o,











































m
NC

*O


H

0
41










-C
04-

tH









0)
0

4E1

tkl


0 0. > >
o 4 >"
o o. o






H l Cl ) '~I


o
'0











a



( C
: C









exactly fit at the end of a record segment. Two policies are possible.

One, the file entries are required to be continuous, risking the waste

of a few words per record segment. Two, the partitioning of file

entries between record segments is to be allowed. If the file entries

are not small with respect to record segment size, the latter policy

is clearly more desirable with respect to efficient use of memory.

Since the sizes of file entries and of record segments are choices

permitted to the user, and since the restriction of the user's freedom

to organize a file structure was to be minimized, the partitioning of

file entries is allowed by REMOTE. As with the JCLOAD vector, the

user need not be aware of file entry partitioning to successfully employ

REMOTE. The user may prevent partitioning by a judicious choice of the

record segment size or of the number of words required by the parameter

file entry initiating the file. This latter play is implemented by the

word index selection in the LEND component for data type 4. The parameter

entry (See Figure 10) is structured with data type 4 concluding the

entry. Thus, by adjusting the number of fields subtended by data type

4, it is possible to regulate the size of the parameter entry without

otherwise disturbing its contents.

* III.3.c. NETPAC

The basic network structure has been discussed in Section II.2.a.

As noted there, certain data fields are essential to the network structure.

That is, the links alone are insufficient to adequately define a network

structure.

Table 3 is a list of the data fields augmenting'the link fields.

Of these additional fields, only data type 3 and the first two fields

of data type 5 are ofanessential nature. In order to differentiate

nodes from diverger entries, some unambiguous feature must be provided




























CO






(U
CoC
0-)









M
x
oc






S) O





z





irz












t'
-P
Co

0 V
Cn Co Co

,.) Co 1

'H 0=

Co
444


t0













(is
1:z
*H Co








0)






Co



4-'
1o
(=


to
4 b0o eC
Co C *H V
t *r > 00
$4 > to C 0
> m) H
S4J 4-1
41 0 z r4
Co Co .Co tt o
S. 4-' q
C 4 C *H3
$4 m Co 0;
to 4-' C0 0 $4


00 0 Co 0 0
Co : :
0- $4
*rl C (D O 1 r1


*H C CO 0 0
4 ,M O V $4

VH 0 0 0 0




C ,
tH 444 Q0)




)0



4-1

Co


co
,4





4-.
4o











CO












H r ,
Cr








03
HH >r l,




















1C


I








to each. This feature is a flag, which is zero for a diverger entry.

The first field of data type 3 serves as the flag. The + symbol in the

LEND for data type 3 indicates that the mask may encompass more than

a single bit. The first two fields of data type 5 contain the number

of paths leaving a node in each direction. These fields are absent

from diverger entries.

The remaining data fields listed in Table 3 are not essential to

the network structure, but are required if the network is to be traced

using the verb NEXT.

The trace strategy employed is somewhat involved. Each trace is

assigned a unique trace key. We shall call this key the master trace

key. The purpose of the key is to flag the nodes which have been encoun-

tered by the trace so they may be distinguished from those which have

not yet been reached. This is necessary since several paths may lead to

the same node. Upon the first encounter of a node,which is indicated by

its trace key being unequal to the master trace key, the trace key is set

equal to the master key and the counter in field 3 of data type 5 is

set to unity. Successive encounters with this node will be indicated by

the trace key matching the master key. The counter is incremented by one

at each encounter of the node. When the counter matches the first field

of data type 5 for a backward trace or the second field of data type 5

for a forward trace, a node has truly been "reached." Further, it is

only upon meeting this criterion that the links leading from a node in

the direction of trace may be examined.

The trace strategy was dictated primarily by the needs of the

interpreter in evaluating the components of a solution procedure. No

component may be evaluated until all preceding components have been

evaluated. That is, no node is considered as reached until all paths








leading into the node have been followed. Figures 11 through lle

illustrate the steps in tracing a simple network. The data fields

appear in the nodes shown in the order of their occurrence in Table 3.

For simplicity, each is assumed to occupy an entire word. An appears

beside each node as it is reached.

Let us consider Figure llc. The count does not match the number

of backward paths. This causes the trace procedure to backtrack and

consider the path parallel to B. For more complex networks, it is

necessary to distinguish the parallel paths yet to be considered from

those which have already been inspected. This distinction between paths

is facilitated by an auxiliary push-down list. Each entry on this list

points to a diverger entry. These diverger entries are the first on

their respective divergers which have not yet participated in the trace.

The top member of this list always points to the last parallel path

encountered and the first to trace when the current path terminates.

It may be noted that the sub-nodal network trace key played no

part in the trace illustration. This trace key is the master key for

networks existing as auxiliaries to network nodes. The import of the

network within a network will be pursued in Chapter IV. When the

sub-nodal networks are present in a network structure, the trace pro-

cedure accounts for their presence by entering each auxiliary network

just prior to advancing to the next node on the main list. For

example, if node A of the trace example presented in Figures 11 through

lle possesses a sub-nodal network, node B is not considered to directly

follow A in the network trace. Rather, the first node of the sub-nodal

network follows A in the trace. A unity identification flag identifies

nodes possessing sub-nodal networks. All nodes possessing flags greater

than unity are not permitted sub-nodal networks.











Start
node


Forward
Diverger








Parallel
Paths











End
Node











Backward
Diverger


Figure 11. Trace (Start).




























































Figure lla. Trace (Step 1).



























































Figure lib. Trace (Step 2).





























































Figure llc Trace (Step 3 no node selected).





























































Figure d. Trace (Step 4).
Figure lld. Trace (Step 4).































































Figure lle. Trace (Completed).









As a result of networks within networks, the auxiliary list

employed by the trace procedure must be complicated somewhat. The paths

yet to be inspected at each level in the network must be segregated

from those of all other levels. This segregation is accomplished by a

list composed of one entry per network level. Each entry points to a

list indicating the remaining parallel paths on a particular level.

The manipulation of this auxiliary list structure is not required of

NETPAC users.

The subroutine NEXT is the NETPAC verb providing the trace

capability. NEXT requires only that the user indicate the address

of a current node and the value of the master trace key. NEXT performs

all of the network and auxiliary list manipulations necessary to provide

the user with the address of the next node in the trace sequence.

The COAST verbs require SPUR vectors to indicate the size of list

entries and the list type. In order for the NETPAC verbs to employ the

COAST verbs, it is necessary to provide a battery of SPUR vectors,

since many different sizes of list entries appear in the networks used

in GENDER. One SPUR is required for each list entry size. To satisfy

this requirement, a sequence of SPUR's graduated in sizes from a

single word list entry up to the largest possible list entry size are

stored in a continuous ALLOC partition. It is expected that this SPUR

block will typically be less than the ALLOC segment size.

Having the SPUR block only solves half the problem. To be able

to select the proper SPUR, one must know the sizes of the various list

entries constituting the network. A vector, which we shall call the

information block, contains this data. The values for each information

block component are provided as data by the user. Only three pair of









the 28 information block components are required by NETPAC. These pair

are components 8-9, 20-21 and 22-23, and are associated with networks

employing list types 2, 6 and 5 respectively. Networks have been

restricted to list types 2, 6 and 5 primarily as a programming conven-

ience since the use of NETPAC external to GENDER is doubtful. Information

block components 8, 20 and 22 indicate diverger entry sizes, while

components 9, 21 and 23 are node sizes. The identification flag

distinguishes nodes from diverger entries. Although more than one

type and size of node may appear in a network, NETPAC requires access

only to data types 1 through 5. Since every node contains these data

fields, the SPUR for any node will suffice NETPAC. For the user's

convenience, information block components are reserved for the sizes

of the other nodes permitted to list types 2 and 5. Discussion of the

remaining information block components is deferred to the particular

chapters to which they are relevant.

The information block introduced in the preceding paragraph resides

in ALLOC. The address of this block is recorded in the seventeenth

ALLOC word. Consequently, access to information block data is relatively

simple and the data is available to all GENDER subroutines sharing ALLOC.

It would seem advisable to make similar provisions for the SPUR block.

In fact, a vector, NIMBL, has been invented to contain the addresses

of the network and the SPUR block. NIMBL also contains the value of

the master trace key. The address of the NIMBL, thus, furnishes suffi-

cient data to permit the access and manipulation of a network.

Table 4 is a list of the NETPAC verbs. BREAK and COUPLE appropri-

ately adjust the path counters, as well as performing the necessary

link manipulations. One node to be separated from a second via BREAK


I





























o 10



0a a

$ 'a

C S '
So '4 m4
0 a)

40 0 ,0 .0 a a
S 0 4
4 0 0 05
H 3 M c H
04 o o) +

( 0(
H 0 0 ZH








Z-
1- 0 co E-


maE 0 ; -i


.) 4 aozz










< ci $4 H H
E- u u CD P. w cu













1a C pn H 0C








must be specified by its absolute address. Although the second node

may also be specified by its absolute address, it may be designated by

reference to a path leading from the first node. Referring to Figure

11, node A may be separated from node C by providing BREAK with the

addresses of both A and C, or with the address of A and the integer 2

indicating the second diverger entry. The path specification mode is

available to both forward and backward directions. That is, A may

either precede or follow C. BREAK is designed to provide the calling

program with the path position if the addresses of both nodes are

specified, or with the address of the second node otherwise. This

feature has proven to be of use in the algebraic package, GALAP.

COUPLE requires the specification of the addresses of both nodes

to be connected and the specification of the path positions. While the

order of diverger entries is of little consequence to solution procedure

network, the arrangement of parallel paths is of considerable importance

in GALAP. Consequently, COUPLE has been designed to permit selective

path placement.

The verb SEARCH provides the capability to search a network for

a specified pattern of data values. The data values and the correspond-

ing data fields are provided to SEARCH identically as for the COAST

verb LOCATE. SEARCH employs NEXT in performing the network trace.

Networks possessing a single starting node and a single terminal node

may be readily searched in either direction. However, a network having

multiple terminal nodes cannot be completely searched in the backward

direction. The selection of a terminal node to serve as the initial

trace node excludes from the trace, at the very least, the other terminal

nodes.








* III.3.d. SIMPAC

Section III.2.b provided a glimpse at the sparse incidence matrix

structure. This section will further detail this most important data

structure.

The ordinates of an SIM (sparse incidence matrix) are applications

of REMOTE. However, this need not have been the case. The ordinates

might simply have been continuous partitions of ALLOC. An ordinate of

1,000 entries would require a maximum of approximately 9,000 words.

This would constitute a demand for a buddy unlikely to be available,

except when specially provided. The implementation of the ordinates

as REMOTE records eliminates the requirement for special supervision

of the ALLOC allocation mechanism. Further, the use of a record as an

ordinate entails no further sophistication of the REMOTE facilities.

Figure 12 shows a sparse incidence matrix with the ordinates

detailed as REMOTE records. This matrix is the same as the one in

Figure 5, but shown here in more detail. List type 3 has been selected

for the ordinates. A number of data fields are required for each

ordinate entry. For convenience, these fields are tabulated in Table

5. A few of these fields require further clarification. The status

flag is a relatively small field reserved for use by the solution

procedure generation algorithms discussed in Chapter V. When equal

to one, the dimension flag indicates the substitution of a pointer to

an auxiliary data block for the name in data type 9. The auxiliary

data block contains the name, dimensionality and index values as whole

word entries each. The name is more properly called a code name. The

code name uniquely identifies the occurrence of a function, ER, constraint

or variable in the data base SECEDE. SECEDE and the rationale of code

names is discussed in Chapter IV. Data type 8 has no significance for
































































row ordinate



































tO




4 V


o 0




0 0 *H
0 U CQ


MCO
10 -i-

o4 H


rI
mU


H 0
"e
C4 4J p
*H
4-1O C0

'0


E
0















V
0



08


+


in '0 t- w


0' 0 N CO
1 H- H- -


'o








r4c
tr







O *-

ilJ



a .









o
4-1
tH







0



s4J











co
rlH
0










0 H







oco








the column ordinate entries, since all columns represent only variables.

The group mentioned in Table 5 for data type 8 will be pursued

subsequently in Chapter IV and is more properly called a protected

group. For our purposes in this section, it is sufficient to regard

a protected group and the ER (for external routine) simply as functions.

That is, they are functional relationships involving two or more

variables. If the multiple output flag is set to one, the output

assignment in data type 13 is replaced by a pointer to a list of output

assignments. Two words are required for each list entry. The first

contains the link and the second contains the output assignment. An

output assignment is simply a row or column number depending on whether

the ordinate pertains to columns or to rows respectively.

Each element of a sparse incidence matrix must also carry some

information in addition to the links. In particular, it is necessary

to-know to which column and row an element belongs. This information

is provided by fields reserved for the row and the column indices.

Other fields are required, but are of a more specialized nature. Table

6 summarizes the data fields appearing in each element. The field for

the sensitivity may be omitted at the user's option. The status flag

and output selection cost are required for the output assignment and

other algorithms. List type 4 is reserved for the SIM elements.

The 28 component information block introduced in the preceding

section contains components pertinent to the SIM. Table 7 indicates

the information block partition dealing with the SIM.

As in the case of networks, a SPUR block is essential in construct-

ing and performing manipulations on an SIM. The SPUR's required

correspond to LOAD vector size (30 words), the element size, ordinate


i- -



































10


02
4


4H CO *E

0 4
g '- CO
* > H C
O 0 0 H
> r


+





>> >>>


Hl 'c cC -, LO- so L


02
CO
4-'
CO



i?
E








'41
Co
M






Cl)
'! '0


g- .,-



22
CO
02

(-1
'0
*H
CO


oJ
CO
4-


4-


4-.
0C 'U


ri 0
o3




O
4-
0.2C


















Srl f
4J




.a
CoC
CO





































C-1
0)

o


0c








C w
a r

0
0


0
S P4



o



0
4
cc

P-


C5

0
N

0 ,*H

o

rO,
* S



0 H



P
P 0>


o Z u


0)



0 o

a)

0) *0

c o


0 0
CO



o po
a)


Hr r- r-l








segment size and list ent-iy sizes from a single word up to the largest

required for an auxiliary data block. This largest list entry size is

determined as (2 + maximum dimensionality). The maximum dimensionality

is contained in the fifteenth information block component. The

individual SPUR's appear in the SPUR block in the order of their

enumeration above. The point of reference in the SPUR block was selected

as the sixteenth word of the block. That is, the address used to

access the SPUR block is the first word of the SPUR for a single word

list entry. Decrementing this address by five accesses the SPUR for

an ordinate segment.

Not only has the SPUR block been adapted from NETPAC, the SIMBL is

not unlike the NIMBL. The first two words point respectively to the

column catalogue and the row catalogue. The third SIMBL word points

to the SPUR block. The description of the SIM structure in detail is

completed by stating that the address of the LOAD vectors are contained

in the catalogues. That is, the address of the LOAD vector for the

row ordinate appears in the second catalogue word.

It is permissible for an SIM to be equipped with more than a

single row and a single column ordinate. Working.or temporary ordinates

are frequently utilized by the solution procedure generation algorithms.

Because of the inclusion of the LOAD vector addresses in the catalogues,

all ordinates are odd numbered REMOTE records.

The majority of the SIM verbs are specialized in nature, dealing

with a single, generally repetitive SIM operation. The SIM verbs are

listed in Table 8. The SIM generator, SIMGEN, performs a great deal

more than a simple SIM manipulation. SIMGEN uses the list of functions,

ER's, etc. belonging to a partition of the solution procedure (called
























r-i
0 H



OH
0





010


u O
0t
0
0o






m (O
A0
0
0
ma

Tl 0


So
0 +0




co


ma' C
'0 0
04-' r
00~
H~O


4-


o
0
aH



0
Ik
0








M 4
0



0








4.
0
4-i










C
0 0
o o
.0r1




c '


U)
a)





0
0
H





f
41




0
- 0

cn




















CD
0







C,0


0
0


e




41

cUu
O
00







0
m >
C





00

l





r3 0
0 U

41 0

*r4 0
!H o


(0




0) 0n
U
0-l
01
*H 0






'0 4
0I
4-l'
0 '





65


a group) for which further analysis is required as the basis for SIM

generation. Each functional relationship is assigned a row in the

order of occurrence in the group. SECEDE furnishes SIMGEN with the

incidence and output assignment cost data. SECEDE is described in

Chapter IV. In addition to structuring the SIM, SIMGEN also initializes

the row, column and element status flags at zero. The utility of the

SIMPAC verbs will become more obvious in Chapter IV.














CHAPTER IV

DATA BASE



The information constituting a system of equations and the

associated solution procedure must be readily available. One approach

to the data base would have been the inclusion of all information

relative to an equation set within the solution procedure. As noted

in the proceeding chapter, the network structure was adopted for the

solution procedure for reasons of flexibility and ease of manipulation.

The concept of the unified data base would, during certain operations,

encumber the solution procedure with much more data than required. An

alternative approach involves providing the general information apart

from the specific information pertinent to the solution procedure.

IV.1. Service Module, SECEDE

The general information phase of the data base must at times augment

the information within the solution procedure. For instance, during

generation of a sparse incidence matrix the variables appearing in an

equation must be known. Since this information is not contained within

the solution procedure (as SIM generation is one of the few instances

when it is required), it must be extracted from the general information.

Further, since the equations on the solution procedure are subject to

re-ordering, it seems appropriate to require rapid random access to

the general information.

The file system, REMOTE, described in Chapter III not only fulfills

the requirement for rapid random access, but also permits the release


66








of ALLOC space by the transfer of data not currently required to mass

memory. The application of REMOTE to the storage of information

relative to an equation set is termed the service module (SECEDE).

.The organization of data within SECEDE required careful considera-

tion. First, the construction of a library of data relative to various

processing units is to be permitted. Second, the organization must

permit the deletion or inclusion of units from SECEDE. Finally, SECEDE

should permit the reorganization of the flowsheet (i.e.,connections

between units). All of these considerations are essential if the

employment of GENDER during the synthesis phase of design is to be

feasible. The first two requirements are satisfied by assigning each

unit to a separate record. The third requirement is satisfied by

restricting all of the information on stream connections to a single

record called the zeroth unit. Thus, reorganization of a flowsheet

would involve changes only to the zeroth unit unless additional units

or unit substitutions are involved as well.

It is, of course, not known a priori what position a unit, which

may be from a library, might occupy in the service module. This

necessitates a code name assignment scheme for the variables and

equations which will produce unique codes. The variables and equations

within each unit are sequentially assigned code numbers commencing with

unity. The unique code is developed by adding to the code number, as

assigned within the unit, the unit number multiplied by an arbitrarily

selected scale factor. For instance, variable 5 of unit 9 would be

known by the code 905 if the scale happens to be 100. The code 905

differentiates this particular variable from the fifth variable of all

other units.


67








IV.2. Solution Procedure, GENDER List

For the reasons noted in Chapter III, the solution procedure is

a network application. It is expected that many solution procedures

will involve cyclic calculations. The GENDER list must reflect the

existence of such cycles. Special nodes are provided, called groups,

which represent the occurrence of a special set of functional relation-

ships. These may be cyclic, or may be grouped because of other common

characteristics.

The group node appears in the network as a representation of the

group members. Membership within a group is indicated by the nodes

of a network called the group body. Each group contains the address of

its group body. Groups as well as equations, ER's and constraints may

belong to a group body. The group bodies give the GENDER list a

dimension of depth i.e., networks within networks.

The GENDER list must be a complete specification of the solution

procedure it represents. That is, the GENDER list must reflect decision

variable selection, output set assignment, precedence ordering, tear

variable selection, and selection of the method for resolving cyclic

calculations. Data fields and/or auxiliary lists are provided to store

all of the foregoing information with the exception of the precedence

order. The precedence order is reflected by the arrangement of the

nodes on the GENDER list.

IV.3. Input/Output Facilities

The initial point for a GENDER list is generally expected to be

the crude GENDER list generated by a program called CUDGEL. Each

equation, ER and constraint is represented by an entry on the crude

GENDER list, but missing are the details and auxiliary lists necessary

for a complete solution procedure specification. Though this may be





69


the usual starting point, it will not always be most convenient. For

instance, a solution procedure might be completely developed, but

interpretation prohibited by the lack of a value for an algorithm

selected decision variable. For operation in a batch machine environ-

ment, this eventuality would cause the effort of analysis to be wasted

unless recovery facilities are provided. While one obvious solution is

to require estimates for all variables prior to initiating analysis to

prevent the development of this particular situation, an inordinate

amount of effort would be required from the user. This is but one

instance of when an analysis might be wasted. Others exist, and

enumerating precautions against all is unlikely. The recovery mechanism

has been incorporated into the input/output facilities.

While the recovery provisions are not automatic, they do posses the

virtue of simplicity. When the development or interpretation of a

solution procedure must be abandoned, the service module and the solution-

procedure may be saved for use at a later time in one of two ways. Both

SECEDE and the GENDER list reside in the ALLOC vector. Hence, a copy

of the contents of ALLOC will save SECEDE and the GENDER list. The

second approach involves the output of only SECEDE and the GENDER list.

This latter strategy will greatly reduce the output volume, but this is

not the primary advantage. The format of output may be adjusted to

produce a much more manageable medium. Particular significance will

be attached to each output record and the output records formatted

according to content.

The medium selected for storage of service modules and solution

procedures for later use is punched cards. Thus, when the solution of

a problem must be aborted, the programs SECIAO and GENIAO may be directed

to produce respectively the contents of SECEDE and of the GENDER list









in card form. These cards may later be read by SECIAO and GENIAO to

resume solving the problem. Observe that a solution procedure, complete

in every detail, may be stored in card form as readily as a partially

complete solution procedure. In fact, a library of solution procedures

may be amassed to eliminate repetitive analysis of problems which are

frequently solved.

The format of each card generated by SECIAO and by GENIAO is

presented in Appendix A in terms of data formats. This is permissible

since the input and output formats are identical. For the convenience

of the user, a printed output will always be provided with card output.

In fact, a printed only output mode may be selected for both SECIAO

and GENIAO should the punched card output not be desired.

IV.4. Implementation Details

The remainder of this chapter delves into the implementation details

for SECIAO and for GENIAO. These details will be of utility only to

those users wishing to prepare programs which directly access either

SECEDE or a GENDER list. Most users should find the program comments

for SECIAO adequate to encode properly the statement of the problem as

SECIAO data. The printed output of both SECIAO and GENIAO is preceded

by a table indicating the composition of each type of output line. A

third subprogram, VARIAO, completes the input/output facility package.

VARIAO supplies a user with a list of variables for which values are

required. VARIAO is provided primarily.for use by the interpreter,

GLINT, to indicate variables encountered for which values have not

been provided.

* IV.4.a SECEDE

Basically, the service module, SECEDE, is an application of REMOTE.








The REMOTE system is founded on the premise that all entries of a file

are of the same size. Unfortunately, exceptions to this fundamental

premise may arise. For example, SECEDE is required to store functions

in terms of the variables, operators and constants of which they are

composed. All three entry types require data fields for an identifica-

tion flag and a code name. However, the variable also requires fields

for the dimensionality and, if applicable, the indices. While it

would certainly be possible to insist that all file entries representing

a function be equal in size, the opportunity for wasting considerable

ALLOC space would just as certainly be present. This eventuality would

be realized for all functions containing only a few dimensioned variables

with respect to the total number of entries.

The apparent inconsistency between storing functions as REMOTE

files and efficient memory utilization can be reconciled, albeit

artificially. To each file entry add another data field containing

the length of the entry. Moving from one file entry to the next would

involve adding the file entry length to the current position in the

file. Except for the variations in file entry length, this procedure

is decidedly reminiscent of the relative move capability already present

in REMOTE. In fact, if REMOTE were led to believe that the file entry

length is unity, and if the actual entry length is used as the number

of file entries to advance, then movement can be accomplished via the

REMOTE relative move mechanism.

Before proceeding, we should clearly'differentiate the two types

of entries discussed in the preceding paragraph. When establishing a

file, the JCFINE vector specifies the file entry length. This is a

fixed number and is the length employed in specifying the length of a

file. The entry of variable size is not a true file entry. It is
rather a sequence of one or more words of a file which we choose to









treat as a single entity and to which we attach special significance.

Let us assign the acronym ASE to the adjustable size entries, while

reserving the term file entry to mean true file entry in the REMOTE

sense.

A file composed of ASE's strongly resembles a forward-only list.

That is, the length stored in each ASE serves as the link to the next

ASE. Consequently, we shall refer to this scheme as relative linking,

and to the stored length as the relative link. The last ASE must

contain zero for the relative link just as a terminal list entry must

contain zero for the forward link. Since the identification flag

stipulates the fields within the last ASE, and since the LEND stipulates

field placement within the ASE, the zero length specification presents

no hindrance to data transfer.

A hindrance to data transfer does, however, exist. The file entry

length must be specified as unity to permit relative linking. Normally,

REMOTE will not permit data transfer operations to exceed the bounds

of a file entry. The ASE's are expected to be multi-word entries. To

circumvent this problem, REMOTE was adjusted to permit the violation

of file entry bounds if LOAD(29) isset equal to -1. The user must

ensure that LOAD(29) is properly set before attempting access to any

file. LOAD(29) should be 0 for all files not employing relative linking.

As we noted earlier, an ASE file resembles a forward-only list.

Consequently, it is not possible to randomly access the ASE's. This

need not be the case. Suppose the relative links are removed from the

ASE's and placed at the beginning of the file. The value of the

relative links would, of course, be different since the relative link

is the number of words to advance from the current position to the ASE.








What we have developed is the notion of a directory, employing relative

links instead of relative addresses, which is internal to a file. The

term internal directory shall be employed to describe this placement

of the relative links.

Files containing ASE's in the list format will be called sequential

access files, SAF's. Files containing unlinked ASE's and an internal

directory will be called random access files, RAF's. The RAF does not

provide a storage capability which can not be duplicated by an ordinary

REMOTE file structure without recourse to ASE's. This could be

accomplished by establishing each ASE as a separate file and providing

a directory permitting random access to the separate files. However,

this structure demands that the relative access be accomplished at

the expense of repeating all catalogue and directory hierarchy selections

for each access. The RAF structure permits the access computations to

commence with the internal directory, since this directory and the ASE's

are actually all members of a single file making the REMOTE relative

address capability applicable. That is to say, the RAF access time

would be generally shorter.

SECEDE consists of at least five records, each record containing

from one to five files. These files include all three types; ordinary

REMOTE files of equal sized entries, SAF's and RAF's. Each record

will be given individual attention. In the discussion to follow, the

notation (t i f j) will be used. The letters i and j represent integers

indicating data type and data field respectively. The letters t and f

should be translated as type (i.e.,data type) and field. If we were to

speak of a data field (t5f9), we will be considering the ninth field

of data type 5. On occasion it may be convenient to expand our field

designation shorthand to include a range of fields for a single data








type. For example, (t5f7-9) is translated as fields 7 through 9 of

data type 5.

Armed with the above bit of cryptography we are prepared to inspect

the purpose and contents of record one. Tables 9 through 11 may be of

assistance in this discussion. The first record consists of a directory

and two files. The files contain respectively decision and tear

variables and are of the SAF type. Each of the ASE's contain the data

fields (tlfl-3), plus an additional two words for each degree of

dimensionality. The two word allocation for each index is required to

permit the specification of minimum and maximum of an index range. A

single ASE may represent, for a dimensioned variable, a single component

or many components. Each word reserved for an index contains the fields

(t9fl, tlOfl, tllfl, tl2fl, tl3fl, tl4fl, tl5fl), which correspond to

the seven constituents permitted in an index calculation as discussed

in'Appendix B. These constituents, in the order of the fields, are

mapping flag, mapping index, operator flag (0 for multiplication by

scale and 1 for division by scale), sign flag for scale (0 for positive

and 1 for negative), scale, sign flag for offset (0 for positive and

1 for negative) and the offset. The mapping flag may be either 0 for

no map, or may be 3 indicating mapping to another index of the same

variable. If the mapping flag is 0, data types 10-14 are ignored and

the offset is taken to be the index value. As a matter of convention,

all data structures requiring the seven part indices will employ data

types 9-15 exactly as described here.

The second and third records in SECEDE each contain only a single

file. These files are ordinary REMOTE files composed of file entries

all equal in size. Each file entry contains alphameric characters

forming the name of an operator in the case of record two or the name


































Cl)
H ''
a r
S a
c Ei

o ^
10 a
a) 0.^
g
Q)




Hl R

g,
$41a
0D+

& 0


0r rd
0)


CO 3d


0 n4 >
H Hc





CL| 1-0
0 4-;
o 4>




-4 a)
$4 *HHi-
*rH 0 CO
'0 PL, C)
03
a) 4-' tB
a) 04-
-4-a co

M : 0


H ci co m 'C C 0
H


*i- E
H )

a)

a)-j' a)
0 0V'0
a)i *H 0
Co H- $1 C

4 a) ,0 *)

03 m) 0)
O > w.
Ca ) >;f
$40 aD Ca )
a) a) a).
^i,0 e- a)


:2:> CM 0


0
$4
F:

u) 43




a)
,4 4
a 0) a)

., 1 0 .11
H $4l Cci



*H 0 4
o ca


a) a) -4-i$
*10) [.0 COa




a) a) 0,>
ri E >
rl ^1o crl





0 0 '0 ^
Z Z I-
m *i r
LC1 C) Orl?-
,n ,n cus
e e (u
3 F3 rl3

s; i- r-


r-H H m H H H
r-i r-A r-i H r-


+
0 > > CT
>
S > >


cq H > cq


c Cm "t m


__


























4-J
X H


*H *H

0 0
>4-J X



0 0
,0


M) co 0

o
O. CO ,


mm
=5 co


Hl- r-H H H


H lH H-l -l -I H H Hr- H


r-l -l H H H


r-- oo o
Hl -l -l


0,




o


\'D COm























00

C) 0I
0 0 0 0
4 HE H

4- r
a 0a ,0 0 C (c
,0 ae>
( 0C0 *

4-4 0 0 4-
I pi-0 E u
0) 00U 4-01 Ce
l C1 (U 0O 0 *rl
0' n E' o Z 1.) o


S- C N H-i H H-


'3
C"

C H
H 0'
i-l ck
i 4-i 41'
Q4- *' ;-
4-1' C '0

ft3 34 r44
4-' 4-' 4-' 4-'


4-1 41 41






r-1 C, 4 C,
HH H










r- r- H "


'P 4- 4-' '4 4-1
"C 'od


40 i 0 "H 03 0
LO JC;I I

_-' 4-' 4-' l|-' 4-'1 -
n t n 00 ^--
3 3 "1- 3 3
s i d d jc t
r- ll r- i~ -1 i-


HH H H


' + H


4- C4 004

ft + + H
0 13 -l 4-


CO O '0 00


S0 CH
ll 1-1 H-


o H




0>


r-I c



























cj


0

,n E



> 0


H- r-I r-


l lO l
r-i r- r-I


: +


4-\
0 0
r-l
M *













0 ca



(0 *H 1 0 0 0

W > C) *H a *H H
> -4 0
S> C I O I


r- i r i r ( O U O (1) Wt
H E p 0 CC W 0r :3 :3 0D
H E O O 0 m M m O C C i r-
m m a O *H > -j m m I
> E p C 1 ; IC
*H tB Io n 44 m cz 44 2 IH ql 44 >
H C > O > > i O IT O I O Ci O 0 a
o0 O H- r-H H I0 C 0 HC)
*H > 41 C r 0 *H C- ^ H C C C E 4

*I C C H 0 H C) > 10 0 10 w C i i IC 0 IC
cl E C4 E E VE 9 C
c 0 :3 0 0 oe z; 0 me 0 7 c O m
SE- ) C > H C > C >
H 4I C C C C fl C- U C- *H C- C- C- IC ,0 IC f


CI
Hm
C)

0
H
C) I
'-I


1C)



- 0
o


H\
Hl
C,

0r
H
C)


01

-I
o

O
r

I : I


H\
HI


C)


0,
H


m<
0

H H H
) C4) P4
*- -' *^
a K os


I I I I I H l l lo 'o I I I I


-H I I H N o H -H H H H H -H H io











H H mC t W O W w w) U) w I) m w


H H
1-1 *H



E-I C.)
M-
0A)



















4J






r. *
0 m
O O
0 .5





0 0 0
0O 00







0 0 0
a 00 0t
4+ CD Q)














0 0 0









0
0 0 0 0
H +0 U
H 00 0 0









U *H
SH









4 U) 0
0 0 0 'O 0


















co C 7o 9 +
S00 c00 H .0
o aE li a) O




(H O 4o'
















a a) 0) H
0 0 0





















0 +
1 4 20 0 0
0 0 4H*H 0
4 m1 ++ e








R 3 0
0 0




*H H f H





: 1


of a method in the case of record three. A method is a user prepared

subroutine for supervising the convergence of a cyclic calculation

during interpretation. The notion of a method is further pursued in

Chapter VII. The entries of records two and three may be described as

(tlfn), where n is the number of words per name.

The processing units are regarded in GENDER to be completely

separate entities. To form a processing plant, the units must somehow

be connected together to permit the transfer of material between the

units. This physical connection of units is represented algebraically

by a connection equation. For example, VCN201 = VCN422 is a connection

equation relating variable code name (VCN) 201 to variable code name 422.

If the scale factor for unit numbers employed in developing the unique

code names is 100, then this example indicates the equality of variable

1 of unit 2 with variable 22 of unit 4. It is entirely possible that

a single variable may appear in several connection equations. That is,

many variables may share a common value. This leads to the notion of

a common storage location for the value of all variables sharing a

common value as stipulated by connection equations. Further, if the unit

variables are connected by the sharing of value storage locations, the

need for explicitly stating the connection equations in either SECEDE

or the GENDER list is eliminated.

Unit 0 is contained within record four of SECEDE and is reserved

for common variables. This record contains three files. The first

file is an RAF and contains data relative -to the dimensionality of the

common variables. The similarity of function between this file and

the DIMENSION statement in FORTRAN suggested the name declaration file.

Apart from those containing relative pointers, each declaration file

ASE will contain the fields (tlf(2+d)), where d is the dimensionality.


I








Field (tlf2) contains the dimensionality. The d fields reserved for

the indices indicate the maximums of each index. The field (tlfl) is

the pointer to the value storage location. The field is an absolute

pointer which is'computed by the program SECIAO during the establishment

of SECEDE. In particular, the absolute address corresponds to an entry

of the common variable value file. Although this file is only the

second on the record, a LISTER of (4, 4, 3, 1) must be employed to

permit access. The second directory entry is reserved for the number

of common variables. The variable value file consists principally of

entries of the form (tlfn), where n is the number of words per floating

point value. All values are in floating point format. While a single

entry containing (tlfn) is satisfactory for scalar variables, many such

entries are required for dimensioned variables. If a dimensioned

variable appeared on the file expanded into its components, the access

of any variable, appearing later in the file than the dimensioned

variable, would require knowledge of the number of dimensioned variable

components. That is to say, the random access feature of the file

is greatly compromised. As an alternative, let us consider partitioning

the variable value file into two divisions. The primary division

appears first in the file and contains one entry per variable. For scalar

variables, the primary entry is simply the value. For dimensioned

variables, the primary entry is of the form (tl7fl, tl8fl), with the

fields containing respectively the integer 21 and a relative link to

the first of a sequence of entries in the secondary partition. This

sequence of entries encompasses the values of every component of the

dimensioned variable. The integer 21 is provided as a safety measure

but has proven to be of only occasional utility.


_ _









The third file of unit 0 is the common variable name file and is

referenced by the fourth directory entry. The entries of the variable

name file are identical to those of the operator name and method name

files of records two and three.

Each record following record four is designated as a unit. The

unit records are considerably more complex than any record we have

previously considered.

A unit record comprises eight major file divisions, four of which

are further subdivided by second level directories. The individual

files are all of types we have already considered in the first four

records. The first entry of the first level directory references an

eight entry second level directory. Entries 1, 3, 5 and 7 of the

second level directory reference declaration files for variables, ER's,

equations and constraints. Directory entries 2, 4, 6 and 8 are respec-

tively reserved for the numbers of variables, ER's, functions and

constraints. The four declaration files are essentially the same as the

common variable declaration file of record four.

The variable declaration file requires the addition of a data type

1 field between the value address and the dimensionality, making each

entry of the form (tlf3+d). This additional field is reserved for the

code name of a common variable. When a unit variable is declared

common by a non-zero (tlf2) field, the common variable code name and

value supercede those of the unit variable during preparation and

interpretation of the GENDER list. That is, the common declaration

substitutes for the connection equation. The remaining three declaration

files require only the fields (tlfl+d), where the field (tlfl) is the

dimensionality.








The second and third first level directory entries refer to the

variable and constant value files. The variable value file is identical

to the common variable file of record four. The constant value file

is quite similar to the variable value file, except that all constants

are single entities making the provisions for dimensioned variable

components unnecessary for the constant variable file.

The ER and the variable name files correspond to the first level

directory entries.four and five. The name files are structured identi-

cal to the files of the second and third records.

The first level directory entries remaining correspond to the ER,

equation and constraint files. Let us consider the equations. Each

equation is recorded on a separate SAF. The equation SAF's are recorded

on the equation directory, which is in turn recorded on the first level

directory. For example, the LISTER vector (5, 5, 7, 1, 1) would be

appropriate to accessing the first equation of unit 1. The equation

SAF is not unlike the decision and tear variable SAF's. The first ASE

pertains to the equation and is of the form (tlf3, 2xd). The field

(tlfl) will always be the relative link in an SAF. The fields (tlf2)

and (tlf3) are respectively the number of outputs and the dimensionality.

The indices are recorded exactly as they were for the decision and tear

variables. Each ASE after the first ASE represents a variable, operator

or a constant. A field, (t5fl), is employed as an identification flag

Flag values range from 0 to 2 and correspond in order to an operator,

a variable or a constant. The operator and constant entries are

identical and consist of the fields (tlfl, t5fl, tl6fl), with (tl6fl)

containing the operator or constant code name.

The variable ASE contains the fields (tlfl, t5fl, t7fl, t8fl, tl9fl,

Ixd). In order of appearance commencing with (t7fl) these fields are








an output selection .cost flag, variable code name, dimensionality and

the indices. The algorithm employed for output set assignment permits

the use of weights to influence the output set selection process.

The weights represent a cost of assignment and are scaled from 0 to

10. One word is reserved for each index which are in the seven part

format described for the decision and tear variable files. The ER and

constraint files are identical to the equation files except that

operators and constants do not appear in the ER files.

* IV.4.b. SECIAO

In the previous chapter, it was noted that certain support struc-

tures to the sparse incidence matrix were of utility. Much the same

situation exists here for SECEDE. The file entries are of varying

compositions and sizes, suggesting the use of an information block to

serve as a reference table.

The twenty-five word information block, mentioned in Chapter III

with respect to networks and SIM's, is again pressed into service.

Information block components 1 through 7 are reserved for data pertinent

to SECEDE. Table 12 list these components. It should be noted that

component 2, the length of a floating point value, is uniform throughout

SECEDE. All variables will either all be single precision or all be

double precision.

Apparently all of the ALLOC space required for SECEDE is in the

form of record segments, making the use of a SPUR block a somewhat

dubious feature. This is, however, not necessarily the case. In the

previous section, the description of the variable declaration ASE's

included a field reserved for the address of a storage location. While

this is perfectly satisfactory for scalar variables, a single address

may not be sufficient for a dimensioned variable. In particular, if



























H
n H 4-
Cr



9 0 0 0

t o C) I) C)
Sa, -






D E ) ci 0
O 0 0 C

41 4-.J c Q r



o Hcu


S 4 00 co 41 rl 7- o
C 0 !< C) 0 01


> u ua H
S 04 *H 0 c H 0 C-
M 0 0 cO *


S00 O 0 0 0 CO
Ca X 4r 1 (










( 04-1 c a co *
t 0 ClC 4 u 0



0 C ci
C 0 0 0 co o c iC
M C Wcci ci) C 0 C)0




















ci)
0 H NJ co c- LI) 10 c








0
I-)
1


_








the value locations reserved for a dimensioned variable extend over

several record segments, the single address will be inadequate. This

situation is remedied by establishing for each dimensioned variable a

dimensioned variable address resolution block, DIVARB. It is the

address of the DIVARB which appears in the declaration file for a

dimensioned variable. The DIVARB encompasses (2+d+r) words, where

d is the dimensionality and r is the number of record segments.contain-

ing values of the components to a dimensioned variable. The first word

of the DIVARB contains the dimensionality d. The next d words contain

the ranges of the indices. The (d+2)nd DIVARB word is called the offset.

The offset is the integer which when added to the address of the record

segment containing the first variable component will give the address

of that first variable component. For example, suppose that the values

of a dimensioned variable commence with the 2902 nd word of ALLOC.

Further, suppose the record segment address is 2861. The offset to be

recorded in the DIVARB would be 41. The remaining or DIVARB words

are reserved for record segment addresses. The DIVARB permits rapid

address resolution for a dimensioned variable component. The variable

value file is a linear storage medium necessitating the conversion of

multi-index sets into a single index. That is, the set of indices for

an array component must be converted into the single equivalent index

for the storage of the array as a vector. Except for the length of a

record segment and the number of words per value, all of the data

necessary for both the index conversion and the address resolution is

contained within the DIVARB.

The need for a SPUR block is now some what obvious. The size of

the SPUR block (i.e. the number of SPUR's required), however, is not

clearly defined. The DIVARB size depends not only on the dimensionality,









but also on the number of components of a dimensioned variable. The

dimensionality and number of components will remain unknown to SECIAO

until input of the variable declarations commences. Although it would

be possible to complete variable declaration input before preparing the

SPUR block and establishing the DIVARB's, it is unnecessary to do so

and may even result in the wastage of ALLOC space. A SPUR stipulating

a list entry size larger than one half the ALLOC segment size will

waste a portion of each segment allocated. This cannot be avoided.

However, the SPUR itself can be eliminated. We shall reserve a single

SPUR for all large DIVARB's, employing it by altering the list entry

size contained in the fourth SPUR word. The SPUR block adopted for

SECEDE consists of (2+(ALLOC segment size)/2) five word SPUR's. The

first SPUR is provided for the requisition of DIVARB's larger than one

half of ALLOC segment size. The second SPUR is appropriate to record

segment acquisition. The remaining SPUR's are graduated in list entry

size from 1 to one half of ALLOC segment size. It is the address of

the SPUR for the record segment which is considered to be the address

of the SPUR block.

The use of REMOTE requires a LOAD vector. In particular, two LOAD

vectors are required by SECIAO for manipulating SECEDE. The LOAD vectors

are furnished as a single vector 60 words in length which is called the

LOAD block.

The entire service module is bound together by a service module

block, SECBL. The first word of SECBL contains the address of the

SECEDE catalogue. The remaining SECBL words are pointers to the SPUR

block, the LOAD block and to an allocation of space reserved for index

calculations.




Full Text
xml version 1.0 encoding UTF-8
REPORT xmlns http:www.fcla.edudlsmddaitss xmlns:xsi http:www.w3.org2001XMLSchema-instance xsi:schemaLocation http:www.fcla.edudlsmddaitssdaitssReport.xsd
INGEST IEID EVE5L2XQ8_G5O88E INGEST_TIME 2011-06-09T08:19:48Z PACKAGE UF00098195_00001
AGREEMENT_INFO ACCOUNT UF PROJECT UFDC
FILES


xml version 1.0 encoding UTF-8
REPORT xmlns http:www.fcla.edudlsmddaitss xmlns:xsi http:www.w3.org2001XMLSchema-instance xsi:schemaLocation http:www.fcla.edudlsmddaitssdaitssReport.xsd
INGEST IEID EJFBAPZB8_4I80NM INGEST_TIME 2011-07-15T21:47:17Z PACKAGE UF00098195_00001
AGREEMENT_INFO ACCOUNT UF PROJECT UFDC
FILES



PAGE 1

AUTOMATIC COMPUTER GENERATION OF SOLUTION PROCEDURES TO LARGE SETS OF NONLINEAR SIMULTANEOUS EQUATIONS VIA GENDER By JAMES RICrL\RD CLIn'NINGHAM A DISSERTATION PRESENTED TO THE GR^^DUATE COUNCIL OF THE UNIVERSITY' OF FLORIDA IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF DOCTOR OF PHILOSOPHY' UNIVERSITY OF FLORIDA 1972

PAGE 2

COPYRIGHT JAMES RICHARD CUMINGHAM 1972 C5^

PAGE 3

ACKNOWLEDGEMENTS The author wishes to express his indebtedness to the chairman o£ his supervisory committee, Dr. A. W. Westerberg, Associate Professor of Chemical Engineering, for suggesting the research topic and for providing the necessaiy guidance. The author also wishes to thank the members of the supervisory committee: Dr. F. P. May, Professor of Chemical Engineering, Dr. R. G. Self ridge, Professor of Mathematics and Director of the Computing Center, and Dr. F. D. Vickers, Associate Professor of Computer and Information Sciences. Thanks also are extended to the National Science Foundation, which provided financial support through grant GK-18633. In addition to providing the funds for my research assistantship, this grant defrayed, the extensive computer expenses incurred during the debugging of the 135 subprograms constituting the GENDER System. Without this assistance and support, the development of GENDER would not have been possible.

PAGE 4

TABLE OF CONTENTS Page ACKNOWLEDGEMENTS iii LIST OF TABLES vii LIST OF FIGURES ix ABSTRACT xi CHAPTERS: I. INTRODUCTION. 1 II. OVERVIEW OF THE CHEMICAL ENGINEERING DESIGN ROUTINES SYSTEM 5 III. DATA MANIPULATION AND STORAGE 11 . III.l. Data Handling. 11 III. 1. a. Lists 11 Ill.l.b. Files...... 14 III. I.e. Memory Allocation.... 14 111.2. Special Data Structures 16 III. 2. a Networks........ 18 III.2.b Sparse Incidence Matrices 18 111. 3. Implementation Details. 22 *III.3.a. COAST 22 *III.3.b. REMOTE.. ' 33 r ' *III.3.c. NETPAC . 43 *III.3.d. SIMPAC 57 IV. DATA BASE 66 IV. 1. Service Module, SECEDE 66 IV. 2. Solution Procedure, GENDER List 68

PAGE 5

TABLE OF CONTENTS (Continued) Page IV. '3. Input/Output Facilities 68 IV. 4. Implementation Details 70 *IV.4.a. SECEDE. 70 *IV.4.b. SECIAO 85 *IV.4.c. GENDER List 89 *IV.4.d. GENIAO 98 V. ANALYSIS ALGORITHMS 101 V.l. Hungarian Output Assignment Algorithm 102 V.2. Speed-Up Precedence Ordering Algorithm. 103 V.3. Barkley Motard Minimum Tear Algorithm....... 104 V.4. Implementation Details 105 *V.4.a. HASSAL 106 *V.4.b. SPEDUP.... 107 *V.4.c. BEMOAN... 112 VI. INTERPRETATION. 114 VI.l. Link Editor ....... 115 VI. 2. Converter 116 VI. 2. a. SOLVE.... 119 VI. 3. Interpreter... 120 Vl.S.a. MATH.... 122 V VI. 3. b. Subroutines 122 VI. 4. Implementation Details..' 125 *VI.4.a. LINKED. 125 *VI.4.b. COVERT 126 *VI.4.c. GLINT... 128

PAGE 6

TABLE OF CONTENTS (Continued) Page VII. USER MANUAL.. 130 VII. 1. Input Data Preparation. 130 VII. 2. Program Preparation. 131 VII. 3. Additional Algorithms 134 VII. 4. GENDER as a Design Tool 134 VIII. EXAMPLES.. 137 VIII. 1. A Simple Analysis Strategy 147 VIII. 2. Equilibrium Flash .. 147 VIII. 3. Binary Distillation. 155 IX. CONCLUSION 165 IX. 1. Convenience Aspects 165 IX. 2. Additional Algorithms. 166 IX.3. A Final Note on GENDER 168 APPENDICES 169 Appendix A. l70 Appendix B 498 Appendix C. 501 Appendix D 504 BIBLIOGRAPHY. 510 BIOGRAPHICAL SKETCH 511

PAGE 7

LIST OF TABLES Table Page 1 COAST Verbs... : 28 2 LEND Components Required by REMOTE..... 42 3 Auxiliary Data Fields Required by NETPAC. 44 4 NETPAC Verbs . .. 55 5 Data Fields Required for Ordinate Entries 59 ,6 Data Fields Required for SIM Elements 61 7 Information Block Components Pertinent to the SIM. . . . . . 62 8 SIMPAC Verbs 64 9 Data Fields for SECEDE 75 lb File Entries for SECEDE. .. 77 11 '" _ SECEDE Files , 79 12 Information Block Components Pertinent to SECEDE . 86 13Data Fields for GENDER 90 14, The List Entries of GENDER 93 15; Information Block Components . Pertinent to GENDER List. : 99 16 Data Fields for SPEDUP Working Lists 109 17 List Entries on SPEDUP Working Lists 110 : 18 Data Fields for the BEMOAN Working Ordinate. 113 19 Operator Set. 121 20 GLINT Error Codes 123 21 Information Block. 132 22 The Code Name /Variable Assignments for a Distillation Tray 140 23 The Constant/Code Name Assignments for a Distillation Tray. • • • 141 vii

PAGE 8

LIST OF TiJBLES (Continued) Table Page 24 Values for Information Block Components 149

PAGE 9

LIST OF FIGURES Figures Page 1 GENDER Architecture.9 2 Typical List Structures 12 3 Typical Hierarchical File 15 4 A Simple Network 19 5 Sparse Incidence Matrix. 20 ,6 A User Mask 24 7 PUSH 30 8 POPUP 32 9 File Structure... 34 10 A Record.... 38 11 Trace (Start). 47 11a Trace (Step 1) 48 lib Trace (Step 2)....... 49 lie Trace (Step 3)..... 50 lid Trace (Step 4)........ . . .. ^ 51 lie Trace (Completed) 52 12 Sparse Matrix. 58 13 An Equilibrium Stage 138 14 SECIAO Data for a Distillation Tray 142 15 Data for COIN 148 16 Equilibrium Flash 150 17 SECIAO Data for Equilibrium Flash. 153

PAGE 10

LIST OF FIGURES (Continued) Figures Page 18 Data for VARIAO. 154 19 Simple Distillation Column 156 20 SECIAO Data for Simple Distillation Column 158

PAGE 11

Abstract of Dissertation Presented to the Graduate Council of the University of Florida in Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy AUTOMATIC COMPUTER GENERATION OF SOLUTION PROCEDURES TO LARGE SETS OF NONLINEAR SIMULTANEOUS EQUATIONS VIA GENDER By James Richard Cunningham December, 1972 Chairman: Arthur W. Westerberg Major Department: Chemical Engineering Fundamentally, chemical process plant design is the solution of a large set of nonlinear simultaneous equations. For large and complex equation sets, it is frequently not possible for the design engineer to determine readily how the solution should proceed. Algorithms have been developed which analyze equation sets with respect to solution procedure. The algorithms do not generally attempt to solve the equation set, but merely provide the directions for solving to the design engineer. While computer implementation of certain algorithms analyzing equation sets has been accomplished, little emphasis seems to have been placed on the implementation of a complete analysis system integrating a number of algorithms. This dissertation presents an automatic and machine-independent system permitting the design engineer to direct solution procedure generation and execution via selections from a spectrum of analysis algorithms. GENDER is the acronym for General Engineering Design Routines. The primary objective of GENDER is the development of a complete solution procedure. To be complete, a solution procedure must reflect (1) decision variable selection, (2) output set assignment, (3) tear variable selection

PAGE 12

and (4) precedence ordering. These attributes are provided to a solution procedure by GENDER through a minimum tear analysis strategy. While only the minimum tear strategy has been furnished with the first version of GENDER, the GENDER System has been designed to readily accept additional analysis algorithms, expanding the analysis strategy repertoire. The design engineer, having generated a solution procedure for an equation set, may perform the translation of the solution procedure into FORTRAN for execution. However, an interpreter capable of direct execution of a solution procedure is provided in GENDER. The interpretation capability, while sparing the engineer from the drudgery of translation, has a somewhat more noble purpose. If the design problem involves constrained optimization, the solution procedure will be subjected to a series of revisions as additions or deletions to the set of binding constraints are required. The optimization-solution procedure generationexecution cycle is potentially faster for interpretation than for FOR.TRAN execution owing to the elimination of the translation and compilation steps. GENDER depends extensively upon list processing techniques. In fact, the solution procedure has been implemented as a list. In the list format, the revisions and rearrangements associated with an analysis strategy may be conveniently performed on a solution procedure. The application of list processing techniques is not restricted to the solution procedure alone, but permeates the GENDER System. Linked data structures of note include a paged storage system (REMOTE) and the sparse incidence matrix. The former is notable for compatability with mass memory and the latter for memory conservation (on machines lacking virtual memory).

PAGE 13

CHAPTER I INTRODUCTION The objective of process design is the determination of equipment specifications and operating conditions which will meet certain production goals developed by management. Process design problems are not particularly amenable to solution. The equations quantitatively describing the equipment characteristics may be highly nonlinear, a situation further confounded by the presence of recycle streams. The recycle stream is necessary to economic operation, but it imparts a cyclic character to the design calculations just as it imparts a cyclic character to the process flow. To these complexities of process design, yet another must be added. Processing plants are frequently complex entities, consisting of many individual processing units connected by a maze of piping. This is particularly true if the process engineer intends to extend the scope of the plant model to include not just the major features of the process, but all unit operations. That is, the mathematical model is to resemble the processing plant as closely as possible. The availability of large, powerful computers has caused process engineers to revise the design procedure. Prior to his introduction to computers, the engineer was forced to simplify the process model to facilitate the completion of hand calculations in a reasonable amount of time. While short-cut techniques were developed for some unit operations, the "assumption" reigned as the arme supreme . Unlike the human brain.

PAGE 14

the digital computer is well suited to complex and repetitious calculations. The engineer could now expect solutions for large and complex process models without the uncertainties of simplification. The new exactness permitted to the process engineer by the digital computer proved to be something less than a complete blessing. The programs developed by the engineer from the mathematical models all too frequently either failed to converge, giving no answer, or generated unreasonable answers. Research, both industrial and academic, determined that the computational difficulties were, characteristic of particular formulations of a model. Further, certain formulations of a model may require more information to initiate cyclic calculations than other formulations. What had developed at this point was a new field of endeavor for process engineers: the study of process models, This study begins where the traditional concept of mathematical modeling ends. The result of mathematical modeling is the development of an equation set descriptive of, for instance, a unit operation. This set of equations is not unique. That is, the algebraic rearrangement of one model produces another equivalent model. It is this rearrangement and its effects which have captured the attention of the process engineer. The result has been a variety of algorithms for selecting a particular model formulation. The algorithms are rather specific in character, dealing with only a particular aspect of a process model. Algorithms have been developed for selecting the output variables for a set of equations, for selecting the: variables for which value estimates are required to initiate cyclic calculations and for ordering the equations so that the calculation of each variable value will depend only upon variable values already calculated. These operations are respectively known as output set

PAGE 15

assignment, tear variable selection and precedence ordering. The process engineer employs selected algorithms sequentially to convert the original model he formulated into an equation set amenable to computer solution. The particular selection of algorithms may be referred to as an analysis strategy. The strategy is largely dictated by the objectives of the design engineer, such as a minimum tear solution or a rapidly converging solution. Unfortunately, the execution of an analysis strategy must be primarily manual. Only a few algorithms have been programmed, all of which are machine dependent and isolated from other analysis capabilities. The next step in this evolutionary development of process design would seem to be totally automatic process model analysis. The notion of automatic design is not original to this work (Kevorkian and Snoek, 1972; Soy lemez, 1971; MahandRafal, 1971), but has been attempted previously. It is the limitations of other automatic design systems which have encouraged the present effort, the General Engineering Design Routines (GENDER) System. GENDER does not restrict the design engineer to a single analysis strategy by virtue of a library of analysis algorithms. Further, the inclusion of additional algorithms has been made relatively easy. While it is possible to convert the product of an analysis strategy, which we shall call a solution procedure, into FORTRAN code for execution, the GENDER System provides the capability of directly interpreting the solution procedure to produce a solution to the design problem. As a feature designed to permit compact problem representation, GENDER can accept indexed variables and equations. Finally, the GENDER System affords the design engineer with a problem solving medium permitting the convenient modification of the original design problem during the execution of the analysis strategy and/or interpretation of the solution procedure. This feature is essential to constrained

PAGE 16

optimization where fluidity in the inclusion and exclusion of constraints is an absolute necessity. While many of these features have appeared in previous attempts at automatic design packages, they have to date not all appeared in a single automatic design system.

PAGE 17

CHAPTER II OVERVIEW OF TP GENERAL ENGINEERING DESIGN ROUTINES SYSTEM The heart of the GENDER System is the solution procedure and is essen^ tially the set of instructions for solving a set of simultaneous equations. In order to make possible direct machine interpretation of the solution, the solution procedure must be explicit and complete. The purpose of this chapter is to introduce the concept of the solution procedure, its terminology and its relation to the GENDER System. In Chapter I and in the preceeding paragraph the term equation was used for a model constituent. To be more precise, the model constituents are actually equations and solved equations. That is, the model is / composed of algebraic relations between variables and constants, but having the form f(x,y,z,...) =0 rather than the solved equation form 5C = F(y,z,...) In the solved equation form, the x is called the output variable. An equation may be transformed into a solved equation by selecting a variable to be the output and performing the algebraic rearrangement necessary to place this variable alone on the left-hand side of the equality. Certain of the equations defining a processing plant may be constraints. Normally one thinks of constraints as inequalities. However, inequalities are readily converted to equalities via the intro-

PAGE 18

duction o£ slack variables. CENDER, at least in its current version, is prepared to manipulate equality constraints only. Being identical to the equations describing the process, the constraints could be grouped with them without differentiation. However, during constrained optimization the set of active constraints varies in numbers and composition. To permit the free inclusion (exclusion) of constraints into (from) a problem, constraints are regarded as distinct model constituents and are carefully differentiated from all other model components. Normally an equation is permitted but a single output variable, with one exception. The external routine (ER) is a special model constituent which may possesses more than one output variable. In essence, the ER is a subprogram for determining values to output variables given the values of the input variables. An ER may be encoded in any acceptable programming language. , To facilitate the incorporation of existing subprograms in a plant model, a mechanism for indicating prechosen output variables is essential. The mechanism selected for GENDER is a weighting scheme with an integer scale of to 9. Each variable in each equation and ER is assigned a weight in the to 9 range. This weight is the cost of assignment as an output variable. Thus, for an existing subprogram, the output variables are all weighted at while the input variables are all weighted at 9. This weighting scheme allows the design engineer to indicate to GENDER his preferences with respect to output set assignment. For instance, similarity of a new model with one or more previous models may suggest at least a partial output assignment. The weighting mechanism allows the engineer to guide GENDER in performing the initial output assignment and may reduce execution t?'.me depending on the ultimate

PAGE 19

degree of similarity between the solution procedures for the models. " In addition to output set selection, analysis of the equation set must also order the equations and, if possible, subdivide the functions into smaller groups. Initially, the plant model is treated as a single large group of equations. The decomposition of the large problem into a multitude of smaller problems is obviously advantageous. Equations which are acyclic in character may be grouped, although the equation grouping normally reflects the presence of a cyclic character. It is permitted by GENDER to have groups as members of groups. Thus, we may have, for example, a cyclic group appearing as a constituent of another cyclic group, or even as a constituent of an acyclic group. Once tear variable selection has rendered all cyclic groups apparently acyclic (by ignoring all occurrences of the tear variables except in the equations where they are the output), it is possible to order all members of groups and to order all of the groups so that the information flow is strictly forward. That is to say, the value of a variable is never required as the input to a equation before it has been calculated as the output of a previous equation. This then is the concept of precedence ordering. The solution procedure must reflect the output set assignment, grouping, tear variable selection and precedence ordering. The solution procedure must also indicate decision variable selection, the decision variables being the unassigned variables following output set selection. Numerous strategies exist for acquiring these ingredients to the solution procedure, but for completeness all must explicitly appear. The solution procedure is called the GENDER list. The GENDER list consists of group, each group possessing a body of equations, ER*s or groups. Each equation and ER appears once somewhere on the GENDER list.

PAGE 20

Its position on the GENDER list is dictated by precedence ordering. Space is reserved with each equation and ER to indicate the selected output variables. Similarly space is reserved for the recording of the decision and tear variables associated with each group. The completed solution procedure vvill. generally be evolved from a skeletal, random listing of the equations in a single group called the crude GENDER list. The completed solution procedure contains all of the instructions for solving the equation set, but is as yet not amenable to interpretation. The conversion operation transforms equations into solved equations via algebraic arrangement. In lieu of destroying the original equation set, the converter operates on a copy of the equations. This feature of GENDER preserves the original model should reanalysis of all or a portion of the solution procedure be required. This eventuality might, for instance, be realized if convergence difficulties of a cyclic group are encountered. Once subjected to conversion, the solution procedure is transformed into an ordered and grouped list of solved equations ready for numerical evaluation. The GENDER System is divided into five major program levels as shown in Figure 1. The program packages COAST (level 1), REMOTE (level 2), SIMPAC and NETPAC (level 3) are discussed in Chapter III. These packages provide the capacity to manipulate certain data structures essential to GENDER. Chapter IV introduces the data base SECEDE and provides greater detail on the GENDER list. The algorithms available for problem analysis are discussed in Chapter V. Level 4 of GENDER is devoted entirely to the analysis algorithms. The highest current GENDER level is level 5. On this level is found the input/output

PAGE 22

10 facilities and the programs relative to interpretation of the GENDER list. The description of the input/output facilities has been incorporated into Chapter IV. The notion of GENDER list interpretation is treated in Chapter VI. Chapter VII is 'a brief user's guide to the GENDER System. In this chapter the expansion of the repertoire of analysis algorithms is discussed, as well as the employment of GENDER as a design tool. Illustrative problems are presented in Chapter VIII. This work is concluded in Chapter IX with some' remarks on the limitations and possible future of GENDER. Particularly in the next four chapters, some sections are extremely detailed. In addition to being difficult to read, they are likely only of benefit to readers contemplating algorithmic additions or modifications to the GENDER System. For this reason, these sections are identified by an * in the section number and may be omitted by readers not requiring the* implementation details of GENDER.

PAGE 23

CHAPTER III DATA MANIPULATION AND STORAGE III.l. Data Handling The algorithms for solution procedure development suggest certain data structures. Effective implementation of the algorithms' requires the availability of these data structures. Unfortunately, the data structures require vast quantities of on-line memory. A large scale problem would, by virtue of the data structures developed during problem analysis, very quickly reach the bounds of on-line memory. Fortunately, not all of the data structures need exist at one time, making feasible the sharing of memory. A priori, the, memory required by each phase of problem solving is unknown. Thus, the simple partitioning of memory is an infeasible sharing policy i Two basic and complementary data storage mediums have been provided: lists and files. The list permits complex data structures which may be readily rearranged, expanded orcontracted. The penalty for this flexibility is high access times. Reaching a particular location may be accomplished only by stepping through all preceding list locations. Conversely, the file allows rapid random access of any location. Files are, however, restricted to a strictly sequential structure. Memory sharing is accomplished by a dynamic memory allocation procedure. For readers not familiar with list processing, Knuth (1968) provides a complete discussion of list processing. principles and structures, including memory allocation. III.l. a. Lists Figure 2 is an illustration of three possible list structures. As 11

PAGE 24

12 o I

PAGE 25

13 indicated.pictorially in Figure 2, the structure of a list is relatively arbitrary. The arrows in Figure 2 represent the connection betv>/een list entries and are called links. Thus one data item (at least) in a list entry is a pointer to an adjacent entry on the list. This flexibility has not been restricted to structure alone. Each entry on a list possesses the attributes of size, quantity of data and organization of the data within the list entry. All of these attributes are also arbitrary. The structure of a list, while arbitrary, is specified by the programs which generate and manipulate the list. That is, the degrees of freedom permitted in the selection of a list structure are consumed by the programmer of a list processing application. Since one of the . objectives was machine independence, and since word size and memory size vary from machine to machine, it seemed necessary to segregate the organization of data within list entries from the tailoring of list structures to meet strictly programming requirements. This has been accomplished by designing the list processor to accept the data organization parameters as data prepared and supplied by the user. These parameters are further discussed in Chapter VII. The utility of a list processor lies mainly in the usefulness of its operations. We shall call the subprograms providing these operations "verbs." Verbs have been provided for obtaining and releasing list entries and for making and breaking the links between list entries. These verbs form the nucleus of the structure manipulation power of the list processor. Another set of verbs provides the capability for transferring information to or from a list entry. Of great utility is the ability to search a list for the occurrence of a particular set of data values. A verb providing this service is also included in the list processor.

PAGE 26

Ill.l.b. Files Figure 3 is an illustration of a typical hierarchical file. The arbitrariness of structure present in lists has, for files, been reduced to the specification of the number 'of levels in the hierarchy. Rapid access to randomly selected entries at any level is the incentive for the sacrifice of arbitrariness in structure. Owing to the sequential storage of file entries in on-line memory, large contiguous blocks of memory allocation may be required. It is, therefore, vital that the file system utilize core effectively. However, the sequential nature of the file entries makes possible the transfer of file data to mass memory devices. This enables the release of on-line memory normally occupied by files during problem solution phases not relying on the file data. Further, even when file data is required, it is possible to retrieve only portions of a file. • A file entry is essentially the same as a list entry, except that the explicit specification of links, as in the list entry, is absent. The organization of data within a file entry is accomplished identically as for a list entry. Thus, the file entry shares the same arbitrariness of data organization provided for the list entry. Many fewer verbs need be provided for file manipulations than for lists since link manipulations are not required. In fact, three verbs are sufficient. One verb is required to provide a file entry and transfer data into it. A second verb provides the capability for retrieval of data from a file entry. Finally, the third verb permits the searching of a file for a particular set of data values. III. I.e. Memory Allocation The particular memory allocation strategy adopted for GENDER continues the theme of flexibility and arbitrariness. Each phase of

PAGE 27

15 a

PAGE 28

.16 problem solving is allocated memory only as it is required. An accounting mechanism keeps track of the memory assigned to each phase. This mechanism permits the release of memory assigned to a particular phase once its task is con^jlete. The released memory may then be reallocated to another phase of problem solving. The allocation, release and re-allocation capabilities give memory the fluid character essential to providing a time varying memory distribution in response to the time varying demands of the solution phases. The dynamic allocation of memory provides an opportunity for fracturing memory into small isolated segments. This eventually would prevent the servicing of a request for a large continuous allocation of memory. Though procedures such as garbage collection have been proposed for reclaiming the isolated memory, these procedures have not been used for GENDER, The need for large blocks of memory has been avoided by designing the file system so as to utilize only reasonably sized continuous blocks of memory. III. 2. Special Data Structures Networks Since the algorithms for solution procedure development in many instances specify rearrangements of the solution procedure, a list structure was adopted. Hence, the solution procedure became known as the GENDER list. During the course of evaluation of the entries on the GENDER list via the interpreter, an anomaly may be encountered necessitating reanalysis of a portion of the GENDER list. In fact, all of the GENDER list from the anomaly to the list end is subject to reanalysis. Consider the following set of equations. (1) ZCz,v) = If reanalysis of Y is required, Z would be subject to reanalysis.

PAGE 29

17 although reanalysis of Z would result in no change. Instead of the list structure, suppose a structure is substituted in which each ent"ry precedes only those entries that it influences. Then, Y and Z would appear on parallel paths since they are independent. This structure is a network, and was adopted for the solution procedure (which is still called the GENDER list). Sparse Incidence Matrices (SIMs) Incidence matrices provide a convenient and lucid medium to express the problem to which an algorithm is to be applied. In fact, many algorithms for solution procedure geneiv ation are most easily explained in terms of their effect on incidence matrices. This is to suggest that incidence matrices may be a natural and effective tool in the implementation of these algorithms. Unfortunately, matrices are relatively expensive in terms of memory requirements. This is particularly damaging in light of the intention to construct GENDER so as to be applicable to large scale problems. In chemical engineering, and perhaps in other disciplines as well, most equations contain only a small number of variables compared to the totcQ. number of variables in the problem. The average incidence for several chemical engineering applications examined was approximately three to four variables per equation. The majority of the incidence matrix elements are null. By considering the matrix elements to be list entries, and by disregarding all null elements, the use of incidence matrices is made. possible without the disadvantage of excessive memory requirements. The elements form the orthogonal list structure shown previously in Figure 2. For example, if an equation contained only two variables, then the row would be composed of only two list entries. The columns represent variables so that each ,of the two row list entries are also members of the orthogonal column lists as well.

PAGE 30

18 III. 2. a. Networks A network is an extension of the forward-backward list, structure to permit each list entiy more than a single forward and a single backward link. The capacity for parallelism is furnished by auxiliary lists called divergers. All list entries other than diverger entries are referred to as network nodes. Figure 4 depicts a node followed by three parallel nodes. Networks have virtually all of the attributes associated with a forward-backward list struct-ure. The arbitrariness of data organization within the nodes is somewhat restricted by the requirement that certain data entries be present as an integral part of the structure. Highly parallel structures may suffer with respect to access times as a result of large divergers. The network verbs implemented are essentially concerned with the peculiarities of network linkages. The list processing verbs for data transfer serve equally well for nodes as for list entries. Subprograms are provided for the connection and for the separation of nodes. A complementary pair of function subprograms permits the extraction of linkage data, one for the forward link and one for the backward link. The policy of providing the capability for searching list structures is continued here for networks. Finally, a rather special verb is provided enabling an orderly, predictable tracing from node to node through a network. This verb, a function called NEXT, has proven to be of considerable utility. III.2.b. Sparse Incidence Matrices Sparse incidence matrices are actually a hybrid of the orthogonal list and of the file data structures. Figure 5 illustrates a sparse

PAGE 31

19 node node node node Figure 4. A Simple Network.

PAGE 32

20

PAGE 33

incidence matrix consisting of two equations and three variables. The files required for the sparse incidence matrix are termed ordinates. Each file entry contains a pointer to a row or column of the matrix. For simplicity, when reference is made in general to a row or column the term vector will be employed. Even with the inclusion of the two ordinates, the memory conservation remains substantial. Consider a system of 1,000 equation in which 1,000 variables are incident. The resulting incidence matrix must contain no fewer than 1,000,000 words of memory if stored as a standard two dimension array. Allowing three words per non-null element (for the horizontal link, vertical link and data item), the elements of a typical sparse incidence matrix would consume only about 9,000 words. The ordinates and supporting data structures would require at most approximately 30,000 words. Thus, the memoiy savings afforded by the sparse incidence matrix exce'eds 960,000 words over the simple two dimensional array. If the ability to pack information into list and file entries is utilized to its fullest extent, the size of the sparse incidence matrix may be reduced by as much as 50% depending upon the word length. The penalty for memory conservation is increased access time. A matrix vector may be accessed randomly and relatively quickly by virtue of the ordinates. Reaching a particular element list entry, however, can be accomplished only by tracing the selected vector from element to element until the desired element is accessed. The nature of the subprograms provided for the manipulation of sparse incidence matrices are rather specific in character. Each subroutine is designed to fulfill the requirement by one or more of the algorithms for a certain sparse incidence matrix operation.

PAGE 34

I II. 3. Implementation Details The implementation of the data handling facilities discussed in Sections III.l and III. 2 has been partitioned into four program packages. COAST is the name given to the program set providing the core allocation and list processing capabilities. The subroutines furnishing the file manipulations constitute the REMOTE system. NETPAC and SIMPAC are respectively the network and the sparse incidence matrix program sets. Each of these packages are discussed in detail in the subsections to follow. The remainder of Chapter III may be omitted by any reader not requiring a knowledge of the programming details. A knowledge of these details is not expected to be generally advantageous except to those readers planning additions to the algorithm library, alterations to an existing algorithm, or alterations to the GENDER facilities. * III. 3. a. COAST To achieve machine independence, FORTRAN was selected as the programming medium. To provide the space required for the development of list structures, a COMMON declaration was employed to reserve a vector named ALLOC. The length of ALLOC is a user specified parameter. The position of a word of memory within ALLOC is referred to as the absolute address, or simply address, of that word. For example, the fifth ALLOC word has an address of five. The memory allocation strategy adopted for GENDER is the buddy system. To reduce the administrative effort required in supervising the allocation of ALLOC to user programs, ALLOC is partitioned into multi-word segments. Segment size is also an adjustable parameter. To permit the allocation of space in sizes other than a single segment, consecutive segments may be combined to form buddies. In fact, two contiguous blocks of memory

PAGE 35

23 of equal size may be combined to form a buddy. Requests for space are satisfied by supplying the smallest buddy satisfying the request. Should only a larger than necessary buddy be available, a request for a lesser amount of space may be satisfied by first fracturing (splitting into two parts) the larger buddy. All of the available buddies of each size are linked together forming an available space list for each buddy size. The operations necessary for memory management are provided by the subprograms C8C0MB and C8GIVE. In order to facilitate the release of ALLOC segments by user programs, an accounting system is necessary. The accounting device adopted is a mask. Each bit of the mask represents an ALLOC segment. A set bit in a user's mask indicates that the corresponding segment is assigned to that user. Each user program is assigned a user mask on its initial request for space. Figure 6 is an illustration of a user mask. A similar mask, established before allocation commences, is provided to record segments released by user programs. Whenever the buddy available space lists become sufficiently depleted that a request for core cannot be honored, then the space represented by the return mask is re-buddied and returned to the available space lists. This strategy eliminates execution of the costly re-buddying process unless it is absolutely necessary. CORN is the program furnished to permit the release of ALLOC segments by a user. The program LIST accomplishes the update of a user mask as memory segments are made available to a user program. A user program requests space via a five word vector called a space utilization record (SPUR). The first word of the vector contains the address of the user mask. For the initial space request, this word must contain the integer zero. The second word will contain the pointer to

PAGE 36

/ /

PAGE 37

25 the space provided during allocation. The third and fourth vector components are respectively the quantity and the size in words of the requested list entries. The list entries are manufactured from a buddy of the appropriate size and provided to the user program as an available space list. The last component of the SPUR indicates the list type, a subject to be considered later in this section. Several programs requiring ALLOC space may share a SPUR vector, thereby sharing the allocated core. Information is contained within list entries in data fields. A data field consists of either all or a portion of a list entry word. Data fields consisting of only a few bits are usually referred to as flags. A data field appearing in one or more consecutive list entry words constitutes a data type. The collection of all data types associated with the entries of a particular list structure constitutes a list type. The quantitative specification of a data type requires four parameters. The first two delimit the bounds of the data type within a list entry. For example, if these parameters are valued at 1 and at 4, the data fields of this data type appear in words 1 through 4 of the list entry inclusively. The second pair of parameters delimits^ the bounds of the data field within a list entry word. The third word, called a shift, is the integer by which a list entry must be divided to place the first bit of the data field in bit position 1. of the dividend. For instance, if the data field begins in bit position 3, dividing by a shift of 4 will translate the field the required two positions. The last parameter is a field mask comprising set bits indicating the bit pattern of the data field. The field mask should be right justified to the first bit position of its single word. The collection of all sets of these four parameter vectors constitutes

PAGE 38

26 the list entry definition (LEND) specifying the organization of data fields within the list entries of a list type. Thus, a LEND is required for each data type. COAST utilizes the subroutine COIN to accept the LEND's from a user as data. COIN is the only COAST routine requiring data. In order to accomplish the transfer of information to or from the data fields within a list entry, the data fields involved in the transfer operation must be uniquely identified. It is to be permitted that a single transfer operation may involve many data fields from many different data types. Thus, the transfer operation requires two vectors, one reserved for the values of the data fields and a second to identify the data fields. The latter vector consists of three words per data type involved in the transfer, plus an additional word specifying the number of data types. Each three word set comprises a data type, the" occurrence of the first field for transfer and the occurrence of the last field for transfer. For example, a three word set (4, 2, 7) indicates that the data type is 4, the first field transferred will be the second and the last field transferred will be the seventh. The transfer for data type 4 will consume six words of the value vector. All of the COAST verbs performing data transfer operations employ the vectors described here, except COPY. COPY performs the direct list entry to list entry transfer of information, and does not require, a vector for value storage. The first occurrence in a list entry of data type 1 was selected for the forward link. Similarly, the first occurrence of data type 2 is reserved for the backward link when backward links are required. Technically, links are simply data fields and may be manipulated as data fields using the data trransfer subprograms. The convention adopted

PAGE 39

27 regarding data types for links permits the creation of faster, more convenient verbs specific to link manipulations. It is the nature of the forward-only list to prohibit the access to the predecessor of a list entry. The absence of the backward link makes necessary special handling of operations involving the removal of entries from a forward-only list. In particular, if the last entry is to be removed, it is not possible to set the forward link in its predecessor to zero since the address of the predecessor is unknown. In this situation, the last list entry becomes a private termination cell, PTC, (Cooper and Whitfield, 1962/3) and is fitted with a forward link of 1. Thus, a unity forward link is the identifying characteristic of a PTC. PTC's remain linked into the list but are not otherwise an active part of the^list. If the list entry is to be removed from a forward-only list, the entry itself cannot be physically removed as its precursor in the list (which points to it) is not known. However, by copying the entire contents of the list entry follov/ing the one to be removed into the list entry to be removed, one has created the effect of removing the chosen entry. The list entry following is then deleted from the list and added to the user's available space list. Table 1 presents a list of the COAST verbs which are the primary list processing subroutines. Omitted from Table 1 are those COAST programs which are not of direct utility to the programmer of a list processing application. Three verbs included in the table require further attention. LOCATE, as its name implies, searches a list for the occurrence of a specified pattern of data field values. The data specification vector employed in data transfer operations provides LOCATE with the

PAGE 40

28

PAGE 41

29 identification of the data fields to be inspected. LOCATE permits two modes of operation which are referred to by the descriptors "AND" and "OR", In the "AND" mode, LOCATE is directed to accept as a match the first list entry found to contain the specified data pattern in its entirety. The "OR" mode relaxes this requirement for matching somewhat. In the "OR" mode, the data pattern is partitioned according to data type. The partitions are compared individually to their respective data fields of a list entry. The search is successful when a list entry is encountered possessing the fields of a data type which match the corresponding data value partition. In either mode, the search may be specified to proceed in the forward direction, in the backward direction or specified to encompass the entire list (accessible from the specified starting point). Like LOCATE, the verbs PUSH and POPUP involve both links and data, but unlike LOCATE result in alterations to the list structure. The PUSH operation is pictorially presented in Figures 7. Although the illustrations are based on a forward-backward list, PUSH operates essentially the same on fo]::vard-only lists with two exceptions. Owing to the absence of the backward link, the push-up mode and the insert-before mode cannot be performed per se. If the position of the data on the list is the important consideration and not the address of the particular list entry containing the data, then the insert-after mode and the pushdown mode may be taken as the equivalent of the push up and insert before modes respectively. The verb POPUP is essentially the inverse of the verb PUSH. Figure 8 shows the POPUP operation in the forward direction. In the case of forward-backward lists, POPUP is symmetrical and will operate equally well in the backward

PAGE 42

c

PAGE 43

31 B B 3,

PAGE 44

32

PAGE 45

,33 direction. Thus, if POPUP from C to B (according to the backward link) is specified, the entries from B through C in the forward sense will be transferred to the user available space list. The data source will be list entry C. In the example of Figure 8, if the operand C were replaced by 0, POPUP would remove from the list all entries from B to the end of the list. For a forward only list, B would of course become a PTC. Again, the symmetry of POPUP allows this mode of operation for forward-backward linked lists. As stated at the beginning of this section, machine independence was a goal of the GENDER system design. Unfortunately, the logical operations "AND", "OR" and "exclusive OR" are required for the mask manipulation operations. These logical operations cannot be conveniently provided directly in FORTRAN, necessitating recourse to assembly language. These operations are basic machine instructions and required little effort to prepare for the IBM-360 or 370. This is expected to be true for all other machines as well. *,III.3.b. REMOTE Avoidance of dependency of the hierarchical file storage system, REMOTE, on large continuous partitions of the ALLOC vector was a paramount consideration in the design of REMOTE. The design is to require file storage in smaller ALLOC partitions, which are somehow connected together to give the illusion of being contiguous. As a further constraint, the linkage mechanism must not seriously interfere with the intention to permit file storage and retrieval form mass memory. Figure 9 shows the structure adopted for use by REMOTE. The catalogue consists of a forward-backward linked list of ALLOC segments (which could contain, say, 32 or 64 words each). The forward and

PAGE 46

catalogue ^' 34 register 1 record 1 -1 1 1 register 2 record 2 V Figure 9. File Structure

PAGE 47

35 backward links are respectively the first and second words of each catalogue segment. All other catalogue segment words may contain the address of a register. A register is identical in structure to the catalogue. Each register segment word (excluding the first and second) may contain the address of a record segment. The set of all record segments referenced by a single register constitutes a record. It is customary, since a one-to-one correspondence exists between registers and records, to say that the catalogue refers to records. It is in the record segments that the files are stored. Record segments may be any desired multiple of the ALLOC segment size. The size is specified via the SPUR vector introduced in the preceding section. The continuity of a record (or should we say apparent continuity) is achieved by virtue of its register. The absolute addresses of all record segments participating in file storage are kept in the register segments. Zero contents of a register segment word indicate that the corresponding record segment has not yet been requisitioned from ALLOC. A negative integer stored in a register segment word indicates that the contents of the corresponding record segment are currently resident on mass memory. Let us briefly review the objectives and constraints noted in the first paragraph of this section before pursuing the features permitting the hierarchical character of file storage. The use of record segments certainly satisfies the stipulation of eliminating any dependence of the file system on large partitions of ALLOC. The registers provide the linkage mechanism for the record segments which is thus segregated from the records and interference with mass memory operations is therefore minimal. Further, the linkage mechanism seems to satisfy the requirement to provide rapid random access and gives the record

PAGE 48

36 apparent continuity to the user. It is important. to note, however, that these objectives were met without creating a support structure that would require a large amount of memory. For example, consider an ALLOC segment to be 32 words and a record segment to be 64 words. A catalogue segment and a register segment, a total of 64 words, can hold the addresses for up to 30 record segments or a total of 1920 record words. Thus, the support structure (catalogue and registers) only consumes slightly over 3% of the total memory allocated to a file storage application. The responsibility for the hierarchical character of the file storage system belongs to the directory concept. Consider, if you will, a file consisting of single word file entries. Into each file entry place the address of a file. This then is the notion of a directory. It is a file which refers to subsequent files. One or more of these subsequent files may also be a directory . giving rise to the hierarchical property. However, care must be exercised with respect to the addresses employed in the directory entries. If absolute addresses are used, the file system would become dependent upon the particular ALLOC buddies serving as record segments. This would seriously impair the use of mass memory. An addressing scheme independent of the absolute addresses of the record segments is required; a relative addressing scheme is used. The relative address of a particular word in a record is simply the integer identifying its sequential position within the record. That is, the ninth word of a record has for its relative address the integer 9. (We shall adopt the convention that the word "address" appearing without the modifier relative will be taken to mean "absolute address.")

PAGE 49

The absolute address is readily calculated from the relative address by using the register. If a record segment has 64 words in it then relative address 132 is in the third record segment, word 4. The absolute address of the third record segment is kept as the third entry in the register. When preparing to add a new file to a record already containing one or more files, it is necessary to know where the last file ends. To this end, the first word of each record (the word in relative address 1) is reserved for the relative address of the first empty word in the record. It is also advantageous, when manipulating a particular file within a record, to know how many file entries constitute the file and how mary words each file entry occupies. A special file entry appears as the first entry of each file containing these two parameters. We shall call this file entry the parameter entry of a file. Figure 10 is an example of the contents of a record. In this example, 16 words are occupied by files, so that the first record word contains 17. The first file commences in word 2 of the record with its parameter entry; this special entry is illustrated as occupying two words. It indicates that the first file contains two single word entries, whose contents here are 6 and 11. In particular, this first file is a directory and its entries contain the relative addresses of two other files. For instance, in word 11 we find the parameter entry of a file composed of two file entries of two words each. Quite naturally, the question arises, as to how access to a particular file entry may be achieved. Access to a particular file entry entails selecting the appropriate record (ie., the address of its register) from the catalogue, and then making selections from each directory to reach the desired file. Once having accessed the file, by using the

PAGE 50

38 word number (Relative Address) 1 3 5 7 9 11 13 15 17 record

PAGE 51

39 number of words per file entry, reaching any particular file entry has been reduced to a problem primarily in counting. The required selections to be made from the catalogue and directories are specified by a vector, LISTER'. The first word of LISTER is its dimension, or in other words one plus the number of choices. The record to be selected from the catalogue is indicated in the second LISTER word. If the dimension of LISTER is N, then the next (N-3) components of LISTER specify selections from the directory hierarchy. (There is no requirement that directories need be employed if a record is to contain only a single file.) Finally, the last LISTER component, the Nth, identifies the particular entry from the file selected. For example, if the record shown in Figure 10 is record number 10, then the LISTER vector (4, 10, 2, 1) will result in the access of the file entry commencing at relative address 13. (Word 1 indicates the length of the LISTER vector which is 4. The 10 says the address of the register for this record is in the tenth entry in the catalogue. The 2 says we are to go to entry 2 of the initial directory which points us to file 2. The 1 indicates we want the first word of the file which is word 13.) The LISTER vector provides sufficient information for accessing an entry in an existing file, as in the transfer of data from a file entry. When data is to be stored in a file which until this point has not existed, supplemental information is required about the size of any new directories, the size of the new file and the number of words per file entry. This supplemental information is required to insure that sufficient space is reserved (since later entries may be added) for each new directory and file added to a record. This information is provided by a second vector supplied by the user, the length of which

PAGE 52

is 2+ the number of directories. If LISTER(l) is N, then the number of components in the auxiliary vector is (N-1). Note that it is necessary only to provide the number of entries in each directory and not also the directory entry size since by convention the directory entry size is permanently fixed at unity. Directory sizes account for the first (N-3) components of the auxiliary vector. The remaining two components are respectively the number of file entries and the file entry size. The supplemental information is of utility only for those directories which have not previously been established. Components corresponding to existing directories are ignored. Consider a file processing scheme involving the access of many entries on a particular file. The catalogue and directory selections, if repeated for each file entry, would constitute needless repetition since access of the same file would be the result each time the selection sequence is executed. Thus, it is desirable to provide the means ofreaching another entry in a file from a file entry that has already been accessed. The move relative to a given file entry to reach another is specified by providing the distance (i.e. number of file entries) of the move and the direction of the move. The LISTER vector is the vector for this information. LISTER(l) is set to 1, indicating the move-relative mode. LISTER(2) contains the displacement as a signed integer, with positive and negative values indicating forward and backward displacements respectively. The LISTER vector (1, 1) would access word 14 of the previous example. Repeating with (1, 1) would then access word 15, and so forth. If movement relative to a particular file entry is to be accomplished, one must know exactly the location of that file entry. Unfortunately, knowing the location of a file entry involves more than simply knowing

PAGE 53

4:1 its absolute or relative addresses, though these addresses are certainly essential. It is also necessary to have available tie address of the record segment, the sequence number in the record of the, record segment, the register segment address and the particular record segment word referencing the record segment. This is by no means a complete list, for many other parameters have been found to be of utility in expressing positions within files or of utility in executing the relative move itself. To provide a storage medium for these parameters, a vector, JCLOAD, has been created. This vector consists of 30 components, each of which is described by the comments to program C4ADRS in Appendix A. For most users it will be sufficient to know that the vector exists and is provided by the user, and that user changes to the vector are prohibited if the relative movement option is to be exercised. As a result of the sequential appearance of file entries within the files, no verbs for link manipulations are required. In fact, the user is provided with only three verbs for performing manipulations of file storage. These are STORE to store data in a file entry, FETCH to retrieve a copy of data in a file entry, and FIND to locate a file entry containing a particular data value pattern. The specification of the data fields to participate in the data transfer operations is accomplished identically as in the description in the preceding section for COAST. REMOTE does require certain restrictions with respect to data types. Table 2 gives the data types, with their LEND components, which are necessary. Beyond these four data types, the user is free to organize the LEND in any convenient fashion. The V in Table 2 indicates locations where the user may exercise choice. One eventuality of file storage has until now been neglected. It is possible that a file entry occupying several ALLOC words may not

PAGE 54

42 ^

PAGE 55

43 exactly fit at the end of a record segment. Two policies are possible. One, the file entries are required to be continuous, risking the waste of a few words per record segmeint. Two, the partitioning of file entries between record segments is to be allowed. If the file entries are not small with respect to record segment size, the latter policy is clearly more desirable with respect to efficient use of memory. Since the sizes of file entries and of record segments are choices permitted to the user, and since the restriction of the user's freedom to organize a file structure was to be minimized, the partitioning of file entries is allowed by REMOTE. As with the JCLOAD vector, the user need not be aware of file entry partitioning to successfully employ REMOTE. The user may prevent partitioning by a judicious choice of the record segment size or of the number of words required by the parameter file entry initiating the file. This latter play is implemented by the word index selection in the LEND component for data type 4. The parameter entry (See Figure 10) is structured with data type 4 concluding the entry. Thus, by adjusting the number of fields subtended by data type 4, it is possible to regulate the size of the parameter entry without otherwise disturbing its contents. * III.3.C. NETPAC The basic network structure has been discussed in Section II. 2. a. As noted there, certain data fields are essential to the network structure. That is, the links alone are insufficient to adequately define a network structure. Table 3 is a list of the data fields augmenting the link fields. Of these additional fields, only data type 3 and the first two fields of data type 5 are of an essential nature. In order to differentiate , nodes from diverger entries, some unambiguous feature must be provided

PAGE 56

44 M

PAGE 57

to each. This feature is a flag, which is zero for a diverger entry.' The first field of data type 3 serves as the flag. The + symbol in the LEND for data type 3 indicates that the mask may encompass more than a single bit. The first two fields of data type 5 contain the number of paths leaving a node in each direction. These fields are absent from diverger entries. The remaining data fields listed in Table 3 are not essential to the network structure, but are required if the network is to be traced using the verb NEXT. The trace strategy employed is somewhat involved. Each trace is assigned a unique trace key. We shall call this key the master trace key. The purpose of the key is to flag the nodes which have been encountered by the trace so they may be distinquished from those which have not yet been reached. This is necessary since several paths may lead to the same node. Upon the first encounter of a node, which is indicated by its trace key being unequal to the master trace key, the trace key is set equal to the master key and the counter in field 3 of data type 5 is set to unity. Successive encounters with this node will be indicated by the trace key matching the master key. The counter is incremented by one at each encounter of the node. When the counter matches the first field of data type 5 for a backward trace or the second field of data type 5 for a forward trace, a node has truly been "reached." Further, it is only upon meeting this criterion that the links leading from a node in the direction of trace may be examined. , The trace strategy was dictated primarily by the needs of the interpreter in evaluating the components of a solution procedure. No component may be evaluated until all preceding components have been evaluated. That is, no node is considered as reached until all paths

PAGE 58

leading into the node have been followed. Figures 11 through lie illustrate the steps in tracing a simple network. The data fields appear in the nodes shown in the order of their occurrence in Table 3. For simplicity, each is assumed to occupy an entire word. An * appears beside each node as it is reached. Let us consider Figure lie. The count does not match the number of backward paths. This causes the trace procedure to backtrack and consider the path parallel to B. For more complex networks, it is necessary to distinguish the parallel paths yet to be considered from those which have already been inspected. This distinction between paths is facilitated by an auxiliary push-down list. Each entry on this list points to a diverger entry. These diverger entries are the first on their respective divergers which have not yet participated in the trace. The top member of this list always points to the last parallel path eneountered and the first to trace when the current path terminates. It may be noted that the sub-nodal network trace key played no part in the trace illustration. This trace key is the master key for networks existing as auxiliaries to network nodes. The import of the network within a network will be pursued in Chapter IV. When the sub-nodal networks are present in a network structure, the trace procedure accounts for their presence by entering each auxiliary network just prior to advancing to the next node on the main list. For example, if node A of the trace example presented in Figures 11 through lie possesses a sub-nodal network, node B is not considered to directly follow A in the network trace. Rather, the first node of the sub-nodal network follows A in the trace. A unity identification flag identifies nodes possessing sub-nodal networks. All nodes possessing flags greater than unity are not permitted sub-nodal networks.

PAGE 59

.'A7 Start node Forward Diverger Parallel Paths End Node Backward Diverger Figure 11. Trace (Start).

PAGE 60

* i 48 Figure 11a. Trace (Stepl).

PAGE 61

Figure lib. Trace (Step 2).

PAGE 62

F,0' Figure lie Trace (Step 3 no node selected).

PAGE 63

Figure lid. Trace (Step 4).

PAGE 64

Figure lie. Trace (Completed)

PAGE 65

As a result of networks within networks, the auxiliary list employed by the trace procedure must be complicated somewhat. The paths yet to be inspected at each level in the network must be segregated from those of all other levels. This segregation is accomplished by a list composed of one entry per network level. Each entry points to a list indicating the remaining parallel paths on a particular level. The manipulation of this auxiliary list structure is not required of NETPAC users. The subroutine NEXT is the NETPAC verb providing the trace capability. NEXT requires only that the user indicate the address of a current node and the value of the master trace key. NEXT performs all of the network and auxiliary list manipulations necessary to provide the user with the address of the next node in the trace sequence. The COAST verbs require SPUR vectors to indicate the size of list entries and the list type. In order for the NETPAC verbs to employ the COAST verbs, it is necessary to provide a battery of SPUR vectors, since many different sizes of list entries appear in the networks used in GENDER. One SPUR is required for each list entry size. To satisfy this requirement, a sequence of SPUR's graduated in sizes from a single word list entry up to the largest possible list entry size are stored in a continuous ALLOC partition. It is expected that this SPUR block will typically be less than the ALLOC segment size. Having the SPUR block only solves half the problem. To be able to select the proper SPUR, one must know the sizes of the various list entries constituting the network. A vector, which we shall call the information block, contains this data. The values for each information block component are provided as data by the user. Only three pair of

PAGE 66

the 28 information block components are required by NETPAC. These pair are components 8-9, 20-21 and 22-23, and are associated with networks employing list types 2, 6 and 5 respectively. Networks have been restricted to list types 2, 6 and 5 primarily as a programming convenience since the use of NETPAC external to GENDER is doubtful. Information block components 8, 20 and 22 indicate diverger entry sizes, while con^jonents 9, 21 and 23 are node sizes. The identification flag distinguishes nodes from diverger entries. Although more than one type and size of node may appear in a network, NETPAC requires access only to data types 1 through 5. Since every node contains these data fields, the SPUR for any node will suffice NETPAC. For the user's convenience, information block components are reserved for the sizes of the other nodes permitted to list types 2 and 5. Discussion of the remaining information block components is deferred to the particular cha'pters to which they are relevant. ' The information block introduced in the preceding paragraph resides in ALLOC. The address of this block is recorded in the seventeenth ALLOC word. Consequently, access to information block data is relatively simple and the data is available to all GENDER subroutines sharing ALLOC. It would seem advisable to make similar provisions for the SPUR block. In fact, a vector, NIMBL, has been invented to contain the addresses of the network and the SPUR block. NIMBL also contains the value of the master trace key. The address of the NIMBL, thus, furnishes sufficient data to permit the access and manipulation of a network. Table 4 is a list of the NETPAC verbs. BREAK and COUPLE appropriately adjust the path counters, as well as. performing the necessary link manipulations. One node to be separated from a second via BREAK

PAGE 67

55

PAGE 68

must be specified by its absolute address. Although the second node ' may also be specified by its absolute address, it may be designated by reference to a path leading from the first node. Referring to Figure 11, node A may be separated from node C by providing BREAK with the addresses of both A and C, or with the address of A and the integer 2 . indicating the second diverger entry. The path specification mode is available to both forward and backward directions. That is, A may either precede or follow C. BREAK is designed to provide the calling program with the path position if the addresses of both nodes are specified, or with the address of the second node otherwise. This feature has proven to be of use in the algebraic package, GALAP. COUPLE requires the specification of the addresses of both nodes to be connected and the specification of the path positions. While the order of diverger entries is of little consequence to solution procedure network, the arrangement of parallel paths is of considerable importance in GALAP. Consequently, COUPLE has been designed to permit selective path placement. The verb SEARCH provides the capability to search a network for a specified pattern of data values. The data values and the corresponding data fields are provided to SEARCH identically as for the COAST verb LOCATE. SEARCH employs NEXT in performing the network trace. Networks possessing a single starting node and a single terminal node may be readily searched in either direction. However, a network having multiple terminal nodes cannot be completely searched in the backward direction. The selection of a terminal node to serve as the initial trace node excludes from the trace, at the very least, the other terminal nodes.

PAGE 69

f;7 * Ill.S.d. SIMPAC Section III.2.b provided a glimpse at the sparse incidence matrix structure. This section will further detail this most important data structure. The ordinates of an SIM (sparse incidence matrix) are applications of REMOTE. However, this need not have been the case. The ordinates might simply have been continuous partitions of ALLOC. An ordinate of 1,000 entries would require a maximum of approximately 9,000 words. This would constitute a demand for a buddy unlikely to be available, except when specially provided. The implementation of the ordinates as REMOTE records eliminates the requirement for special supervision of the ALLOC allocation mechanism. Further, the use of a record as an ordinate entails no further sophistication of the REMOTE facilities. Figure 12 shows a sparse incidence matrix with the ordinates detailed as REMOTE records. This matrix is the same as the one in ,, Figure 5, but shown here in more detail. List type 3 has been selected for the ordinates. A number of data fields are required for each ordinate entry. For convenience, these fields are tabulated in Table 5. A few of these fields require further clarification. The status flag is a relatively small field reserved for use by the solution procedure generation algorithms discussed in Chapter V. When equal to one, the dimension flag indicates the substitution of a pointer to an auxiliary data block for the name in data type 9. The auxiliary data block contains the name, dimensionali-ty and index values as whole word entries each. The name is more properly called a code name. The code name uniquely identifies the occurrence of a function, ER, constraint or variable in the data base SECEDE. SECEDE and the rationale of code names is discussed in Chapter IV. Data type 8 has, no significance for

PAGE 70

58 w o o ^ c o c o o o I , >c row ordinate

PAGE 71

59 o o ^ a (V PS to c •H O ft c 6 3 H O CJ o o ^ CO + > rH CO C COO O -H -H '-"^ •H ^-1 -p a< •HOD +J c o G 3 U 0) ^ bD CO c a; e QJ H q; «P o 5^ C Qj e e H 3 O ^ O > > > >. >" >" >^ >^ >" >" >' >" > > « > > p. p 3 3 ^ ra O (U H CD ^ -H e u 3 CC Z > C 3 S & bO 0) H Oh •H 4-> H 4-

PAGE 72

60 the column ordinate entries, since all columns represent only variables. The group mentioned in Table 5 for data t^/pe 8 will be pursued subsequently in Chapter IV and is moire properly called a protected group. For our purposes in this section^ it is sufficient to regard a protected group and the ER (for external routine) simply as functions. That is, they are functional relationships involving two or more variables. If the multiple output flag is set to one, the output assignment in data type 13 is replaced by a pointer to a list of output assignments. Two words are required for each list entry. The first contains the link and the second contains the output assignment. An output assignment is simply a row or column number depending on whether the ordinate pertains to columns or to rows respectively. Each element of a sparse incidence matrix must also carry some information in addition to the links. In particular, it is necessary to 'know to which column and row an element belongs. This information is provided by fields reserved for the row and the column indices. Other fields are required, but are of a more specialized nature. Table 6 summarizes the data fields appearing in each element. The field for the sensitivity may be omitted at the user's option. The status flag and output selection cost are required for the output assignment and other algorithms. List type 4 is reserved for the SIM elements. The 28 component information block introduced in the preceding section contains components pertinent to the SIM. Table 7 indicates the information block partition dealing with the SIM. As in the case of networks, a SPUR block is essential in constructing and performing manipulations on an SIM. The SPUR's required correspond to LOAD vector size (30 words), the element size, ordinate

PAGE 73

61

PAGE 74

62 4-> C 0) c o o

PAGE 75

63 segment size and list entry sizes from a single word up to the largest required for an auxiliary data block. TViis largest list entry size is determined as (2 + maximum dimensionality). The maximum dimensionality is contained in the fifteenth information block component. The individual SPUR' s appear in the SPUR block in the order of their enumeration above. The point of reference in the SPUR block was selected as the sixteenth word of the block. That is, the address used to access the SPUR block is the first word of the SPUR for a single word list entry. Decrementing this address by five accesses the SPUR for an ordinate segment. Not only has the SPUR block been adapted from NETPAC, the SIMBL is not unlike the NIMBL. The first two words point respectively to the column catalogue and the row catalogue. The third SIMBL word points to the SPUR block. The description of the SIM structure in detail is completed by stating that the address of the LOAD vectors are contained in the catalogues. That is, the address of the LOAD vector for the row ordinate appears in the second catalogue word. It is permissible for an SIM to be equipped with more than a single row and a single column ordinate. Working, or temporary ordinates are frequently utilized by the solution procedure generation algorithms. Because of the inclusion of the LOAD vector addresses in the catalogues, all ordinates are odd numbered REMOTE records. The majority of the SIM verbs are specialized in nature, dealing with a single, generally repetitive SIM operation. The SIM verbs are listed in Table 8. The SIM generator, SIMGEN, performs a great, deal more than a simple SIM manipulation. SIMGEN uses the list of functions, ER's, etc. belonging to a partition of the solution procedure (called

PAGE 76

64 +-'

PAGE 77

<^^ a group) for which further analysis is required as the basis for SIM generation. Each functional relationship is assigned a row in the order of occurrence in the group. SECEDE furnishes SIMGEN with the incidence and output assignment cost data. SECEDE is described in Chapter IV. In addition to structuring the SIM, SIMGEN also initializes the row, column and element status flags at zero. The utility of the SIMPAC verbs will become more obvious in Chapter IV.

PAGE 78

CHAPTER IV DATA BASE The information constituting a system of equations and the associated solution procedure must be readily available. One approach to the data base would have been the inclusion of all information relative to an equation set within the solution procedure. As noted in the preceeding chapter, the network structure was adopted for the solution procedure for reasons of flexibility and ease of manipulation. The concept of the unified data base would, during certain operations, encumber the solution procedure with much more data than required. An alternative approach involves providing the general information apart from the specific information pertinent to the solution procedure. IV. 1. Service Module, SECEDE The general information phase of the data base must at times augment the information within the solution procedure. For instance, during generation of a sparse incidence matrix the variables appearing in an equation must be known. Since this information is not contained within the solution procedure (as SIM generation is one of the few instances when it is required), it must be extracted from the general information. Further, since the equations on the solution procedure are subject to re-ordering, it seems appropriate to require rapid random access to the general information. The file system, REMOTE, described in Chapter III not only fulfills the requirement for rapid random access, but also permits the release 66

PAGE 79

of ALLOC space by the transfer of data not currently required to mass memory. The application of REMOTE to the storage of information relative to an equation set is termed the service module (SECEDE). The organization of data within SECEDE required careful consideration. First, the construction of a library of data relative to various processing units is to be permitted. Second, the organization must permit the deletion or inclusion of units from SECEDE. Finally, SECEDE should permit the reorganization of the flowsheet (i.e., connections between units). All of these considerations are essential if the employment of GENDER during the synthesis phase of design is to be feasible. The first two requirements are satisfied by assigning each unit to a separate record. The third requirement is satisfied by restricting all of the information on stream connections to a single record called the zeroth unit. Thus, reorganization of a flowsheet would involve changes only to the zeroth unit unless additional units or unit substitutions are involved as well. It is, of course, not known a priori what position a unit, which may be from a library, might occupy in the service module. This necessitates a code name assignment scheme for the variables and equations which will produce unique codes. The variables and equations within each unit are sequentially assigned code numbers commencing with unity. The unique code is developed by adding to the code number, as assigned within the unit, the unit number multiplied by an arbitrarily selected scale factor. For instance, vari'able 5 of unit 9 would be known by the code 905 if the scale happens to be 100. The code 905 differentiates this particular variable from the fifth variable of all other units.

PAGE 80

68 IV. 2. Solution Procedure, GENDER Lis.t For the reasons noted in Chapter III, the solution procedure is a network application. It is expected that many solution procedures will involve cyclic calculations. The GENDER list must reflect the existence o£ such cycles. Special nodes are provided, called groups, which represent the occurrence of a special set of functional relationships. These may be cyclic, or may be grouped because of other common characteristics. The group node appears in the network as a representation of the group members. Membership within a group is indicated by the nodes of a network called the group body. Each group contains the address of its group body. Groups as well as equations, ER's and constraints may belong to a group body. The group bodies give the GENDER list a dimension of depth i.e., networks within networks. • The GENDER list must be a complete specification of the solution procedure it represents. That is, the GENDER list must reflect decision variable selection, output set assignment, precedence ordering, tear variable selection, and selection of the method for resolving cyclic calculations. Data fields and/or auxiliary lists are provided to store all of the foregoing information with the exception of the precedence order. The precedence order is reflected by the arrangement of the nodes on the GENDER list. IV. 3. Input/Output Facilities The initial point for a GENDER list is generally expected to be the crude GENDER list generated by a program called CUDGEL. Each equation, ER and constraint is represented by an entry on the crude GENDER list, but missing are the details and auxiliary lists necessary for a complete solution procedure specification. Though this may be

PAGE 81

• 6y the usual starting point, it will not always be most convenient. For instance, a solution procedure might be completely developed, but interpretation prohibited by the lack of a value for an algorithm selected decision variable. For operation in a batch machine environment, this eventuality would cause the effort of analysis to be wasted unless recovery facilities are provided. While one obvious solution is to require estimates for all variables prior to initiating analysis to prevent the development of this particular situation, an inordinate amount of effort would be required from the user. This is but one instance of when an analysis might be wasted. Others exist, and enumerating precautions against all is unlikely. The recovery mechanism has been incorporated into the input/output facilities. While the recovery provisions are not automatic, they do posses the virtue of simplicity. When the development or interpretation of a solution procedure must be abandoned, the service module and the solutionprocedure may be saved for use at a later time in one of two ways. Both SECEDE and the GENDER list reside in the ALLOC vector. Hence, a copy of the contents of ALLOC will save SECEDE and the GENDER list. The second approach involves the output of only SECEDE and the GENDER list. This latter strategy will greatly reduce the output volume, but this is not the primary advantage. The format of output may be adjusted to produce a much more manageable medium. Particular significance will be attached to each output record and the output records formatted according to content. The medium selected for storage of service modules and solution procedures for later use is punched cards. Thus, when the solution of a problem must be aborted, the programs SECIAO and GENIAO may be directed to produce respectively the contents of SECEDE and of the GENDER list

PAGE 82

70 , in card form. These cards may later be read by SECIAO and GENIAO to resume solving the problem. Observe that a solution procedure, complete in every detail, may be stored in card form as readily as a partially complete solution procedure. In. fact, a library of solution procedures may be amassed to eliminate repetitive analysis of problems which are frequently solved. The format of each card generated by SECIAO and by GENIAO is presented in Appendix A in terms of data fonnats. This is permissible since the input and output formats are identical. For the convenience of the user, a printed output will always be provided with card output. In fact, a printed only output mode may be selected for both SECIAO and GENIAO should the punched card output not be desired. IV. 4. Implementation Details The remainder of this chapter delves into the implementation details for SECIAO and for GENIAO. These details will be of utility only to those users wishing to prepare programs which directly access either SECEDE or a GENDER list. Most users should find the program comments for SECIAO adequate to encode properly the statement of the problem as SECIAO data. The printed output of both SECIAO and GENIAO is preceded by a table indicating the composition of each type of output line. A third subprogram, VARIAO, completes the input/output facility package. VARIAO supplies a user with a list of variables for which values are required. VARIAO is provided primarily .for use by the interpreter, GLINT, to indicate variables encountered for which values have not been provided. * IV. 4. a SECEDE Basically, the service module, SECEDE, is an application of REMOTE.

PAGE 83

71 The REMOTE system is founded on the premise that all entries of a file are of the same size. Unfortunately, exceptions to this fundamental premise may arise. For example, SECEDE is required to store functions in terms of the variables, operators and constants of which they are composed. All three entry types require data fields for an identification flag and a code name. However, the variable also requires fields for the dimensionality and, if applicable, the indices. While it would certainly be possible to insist that all file entries representing a function be equal in size, the opportunity for wasting considerable ALLOC space would just as certainly be present. This, eventuality would be realized for all functions containing only a few dimensioned variables with respect to the total number of entries. The apparent inconsistency between storing functions as REMOTE files and efficient memory utilization can be reconciled, albeit artificially. To each file entry add another data field containing, the length of the entry. Moving from one file entry to the next would involve adding the file entry length to the current position in the file. Except for the variations in file entry length, this procedure is decidedly reminiscent of the relative move capability already present in REMOTE. In fact, if REMOTE were led to believe that the file entry length is unity, and if the actual entry length is used as the number of file entries to advance, then movement can be accomplished via the REMOTE relative move mechanism. Before proceeding, we should clearly 'differentiate the two types of entries discussed in the preceding paragraph. When establishing a file, the JCFINE vector specifies the file entry length. This is a fixed number and is the length employed in specifying the length of a file. The entry of variable size is not a true file entry. It is rather a sequence of one or more words of a file which we choose to

PAGE 84

treat as a single entity and to which we attach special significance. Let us assign the acronym ASE to the adjustable size entries, while reserving the term file entry to mean true file entry in the REMOTE sense. A file composed of ASE's strongly resembles a forward-only list. That is, the length stored in each ASE serves as the link to the next ASE. Consequently, we shall refer to this scheme as relative linking, and to the stored length as the relative link. The last ASE must contain zero for the relative link just as a terminal list entry must contain zero for the forward link. Since the identification flag stipulates the fields within the last ASE, and since the LEND stipulates field placement within the ASE, the zero length specification presents no hindrance to data transfer. A hindrance to data transfer does, however, exist. The file entry length must be specified as unity to permit relative linking. Normally, REMOTE will not permit data transfer operations to exceed the bounds of a file entry. The ASE's are expected to be multi-word entries. To circumvent this problem, REMOTE was adjusted to permit the violation of file entry bounds if L0AD(29) is set equal to -1. The user must ensure that L0AD(29) is properly set before attempting acces to any file. LOAD (2 9) should be for all files not employing relative linking. As we noted earlier, an ASE file resembles a forward-only list. Consequently, it is not possible to randomly access the ASE's. This need not be the case. Suppose the relative links are removed from the ASE's and placed at the beginning of the file. The value of the relative links would, of course, be different since the relative link is the number of words to advance from the current position to the ASE.

PAGE 85

What we have developed is the notion of a directory, employing relative links instead of relative addresses, which is internal to a file. The term internal directory shall be employed to describe this placement of the relative links. Files containing ASE's in the list format will be called sequential access files, SAP's. Files containing unlinked ASE's and an internal directory will be called random access files, RAF's. The RAF does not provide a storage capability which can not be duplicated by an ordinary REMOTE file structure without recourse to ASE's. This could be accomplished by establishing each ASE as a separate file and providing a directory permitting random access to the separate files. However, this structure demands that the relative access be accomplished at the expense of repeating all catalogue and directory hierarchy selections for each access. The RAF structure permits the access computations to commence with the internal directory, since this directory and the ASE's are actually all members of a single file making the REMOTE relative address capability applicable. That is to say, the RAF access time would be generally shorter. SECEDE consists of at least five records, each record containing from one to five files. These files include all three types; ordinary REMOTE files of equal sized entries, SAF's and RAF's. Each record will be given individual attention. In the discussion to follow, the notation (t i f j) will be used. The letters i and j represent integers indicating data type and data field respectively. The letters t and f should be translated as type (i.e., data type) and field. If we were to speak of a data field (t5f9), we will be considering the ninth field of data type 5. On occasion it may be convenient to expand our field designation shorthand to include a range of fields for a single data

PAGE 86

74 type. For example, (t5f7-9) is translated as fields 7 through 9 of data type 5. Armed with the above bit of cryptography we are prepared to inspect the purpose and contents of record one. Tables 9 through 11 may be of assistance in this discussion. The first record consists of a directory and two files. The files contain respectively decision and tear variables and are of the SAF type.. Each of the ASE's contain the data fields (tlfl-3), plus an additional two words for each degree of dimensionality. The two vrord allocation for each index is required to permit the specification of minimum and maximum of an index range. A single ASE may represent, for a dim.ensioned variable, a single component or many components. Each word reserved for an index contains the fields (t9fl, tlOfl, tllfl, tl2fl, tl3fl, tl4fl, tl5fl), which correspond to the seven constituents permitted in an index calculation as discussed in "Appendix B. These constituents, in the order of the fields, are mapping flag, mapping index, operator flag (0 for multiplication by scale and 1 for division by scale), sign flag for scale (0 for positive and 1 for negative), scale, sign flag for offset (0 for positive and l.for negative) and the offset. The mapping flag may be either for no map, or may be 3 indicating mapping to another index of the same variable. If the mapping flag is 0, data types 10-14 are ignored and the offset is taken to be the index value. As a matter of convention, all data structures requiring the seven part indices will employ data types 9-15 exactly as described here. The second and third records in SECEDE each contain only a single file. These files are ordinary REMOTE files composed of file entries all equal in size. Each file entry contains alphameric characters forming the name of an operator in the case of record two or the name

PAGE 87

75

PAGE 88

76

PAGE 89

77

PAGE 90

$ as

PAGE 91

79 H

PAGE 92

80 H

PAGE 93

of a method in the case of record three. A method is a user prepared subroutine for supervising the convergence of a cyclic calculation during interpretation. The notion of a method is further pursued in Chapter VII. The entries of records two and three may be described as (tlfn), where n is the number of words per name. The processing units are regarded in GENDER to be completely separate entities. To form a processing plant, the units must somehow be connected together to permit the transfer of material between the units. This physical connection of units is represented algebraically by a connection equation. For example, VCN201 = VCN422 is a connection equation relating variable code name (VCN) 201 to variable code name 422. If the scale factor for unit numbers employed in developing the unique code names is 100, then this example indicates the equality of variable 1 of unit 2 with variable 22 of unit 4. It is entirely possible that a single variable may appear in several connection equations. That is, many variables may share a common value. This leads to the notion of a common storage location for the value of all variables sharing a common value as stipulated by connection equations. Further, if the unit variables are connected by the sharing of value storage locations, the need for explicitly stating the connection equations in either SECEDE or' the GENDER list is eliminated. Unit is contained within record four of SECEDE and is reserved for common variables. This record contains three files. The first file is an RAF and contains data relative to the dimensionality of the common variables. The similarity of function between this file and the DIMENSION statement in FORTRAN suggested the name declaration file. Apart from those containing relative pointers, each declaration file ASE will contain the fields (tlf(2+d)), where d is the dimensionality.

PAGE 94

Field (tlf2) contains the dimensionality. The d fields reserved for the indices indicate the maximums of each index. The field (tlfl) is the pointer to the value storage location. The field is an absolute pointer which is^ computed by the program SECIAO during the establishment of SECEDE. In particular, the absolute address corresponds to an entry of the common variable value file. Although this file is only the second on the record, a LISTER of (4, 4, 3, 1) must be employed to permit access. The second directory entry is reserved for the number of common variables. The variable value file consists principally of entries of the form (tlfn), where n is the number of words per floating point value. All values are in floating point format. While a single entry containing (tlfn) is satisfactory for scalar variables, many such entries are required for dimensioned variables. If a dimensioned variable appeared on the file expanded into its components, the access of' any variable, appearing later in the file than the dimensioned variable, would require knowledge of the number of dimensioned variable components. That is to say, the random access feature of the file is greatly compromised. As an alternative, let us consider partitioning the variable value file into two divisions. The primary division appears first in the file and contains one entry per variable. For scalar variables, the primary entry is simply the value. For dimensioned variables, the primary entry is of the form (tlVfl, tl8fl), with the fields containing respectively the integer 21 and a relative link to the first of a sequence of entries in the secondary partition. This sequence of entries encompasses the values of every component of the dimensioned variable. The integer 21 is provided as a safety measure but has proven to be of only occasional utility.

PAGE 95

83 The third file of unit is the common variable name file and is referenced by the fourth directory entry. The entries of the variable name file are identical to those of the operator name and method name files of records two and three. Each record following record four is designated as a unit. The unit records are considerably more complex than any record we have previously considered. A unit record comprises eight major file divisions, four of which are further subdivided by second level directories. The individual files are all of types we have already considered in the first four records. The first entry of the first level directory references an eight entry second level directory. Entries 1, 3, 5 and 7 of the second level directory reference declaration files for variables, ER's, equations and constraints. Directory entries 2, 4, 6 and 8 are respectively reserved for the numbers of variables, ER's, functions and constraints. The four declaration files are essentially the same as the common variable declaration file of record four. The variable declaration file requires the addition of a data type 1 field between the value address and the dimensionality, making each entry of the form (tlf3+d). This additional field is reserved for the code name of a common variable. When a unit variable is declared common by a non-zero (tlf2) field, the common variable code name and value supercede those of the unit variable during preparation and interpretation of the GENDER list. That is, the common declaration substitutes for the connection equation. The remaining three declaration files require only the fields (tlfl+d), where the field (tlfl) is the dimensionality.

PAGE 96

84 The second and third first level directory entries refer to the variable and constant value files. The variable value file is identical to the common variable file of record four. The constant value file is quite similar to the variable value file, except that all constants are single entities making the provisions for dimensioned variable components unnecessary for the constant variable file. The ER and the variable name files correspond to the first level directory entries. four and five. The name files are structured identical to the files of the second and third records. The first level directory entries remaining correspond to the ER, equation and constraint files. Let us consider the equations. Each equation is recorded on a separate SAF. The equation SAP's are recorded on the equation directory, which is in turn recorded on the first level directory. For example, the LISTER vector (5, 5, 7, 1, 1) would be appropriate to accessing the first equation of unit 1. The equation SAF is not unlike the decision and tear variable SAF's. The first ASE pertains to the equation and is of the form (tlf3, 2xd). The field (tlfl) will always be the relative link in an SAF. The fields (tlf2) and (tlf3) are respectively the number of outputs and the dimensionality. The indices are recorded exactly as they were for the decision and tear variables. Each ASE after the first ASE represents a variable, operator or a constant. A field, (tSfl), is employed as an identification flag . Flag values range from to 2 and correspond in order to an operator, a variable or a constant. The operator and constant entries are identical and consist of the fields (tlfl, tSfl, tl6fl), with (tl6fl) containing the operator or constant code name. The variable ASE contains the fields (tlfl, tSfl, t7fl, tSfl, tl9fl, Ixd). In order of appearance commencing with (t7fl) these fields are

PAGE 97

an output selection cost flag, variable code name, dimensionality and the indices. The algorithm employed for output set assignment permits the use of weights to influence the output set selection process. The weights represent a cost of assignment and are scaled from to 10. One word is reserved for each index which are in the seven part format described for the decision and tear variable files. The ER and constraint files are identical to the equation files except that operators and constants do not appear in the ER files. * IV. 4. b. SECIAO In the previous chapter, it was noted that certain support structures to the sparse incidence matrix were of utility. Much the same situation exists here for SECEDE. The file entries are of varying compositions and sizes, suggesting the use of an information block to serve as a reference table. • The twenty-five word information block, mentioned in Chapter III with respect to networks and SIM's, is again pressed into service. Information block components 1 through 7 are reserved for data pertinent to SECEDE. Table 12 list these components. It should be noted that component 2, the length of a floating point value, is uniform throughout SECEDE. All variables will either all be single precision or all be double precision. Apparently all of the ALLOC space required for SECEDE is in the form of record segments, making the use of a SPUR block a somewhat dubious feature.This is, however, not necessarily the case. In the previous section, the description of the variable declaration ASE's included a field reserved for the address of a storage location. While this is perfectly satisfactory for scalar variables, a single address may not be sufficient for a dimensioned variable. In particular, if

PAGE 98

86

PAGE 99

87 the value locations reserved for a dimensioned variable extend over several record segments, the single address will be inadequate. This situation is remedied by establishing for each dimensioned variable a dimensioned variable address resolution block, DIVARB. It is the address of the DIVARB which appears in the declaration file for a dimensioned variable. The DIVARB encompasses (2+d+r) words, where d is the dimensionality and r is the number of record segments . containing values of the components to a dimensioned variable. The first word of the DIVARB contains the dimensionality d. The next d words contain the ranges of the indices. The (d+2)nd DIVARB word is called the offset. The offset is the integer which when added to the address of the record segment containing the first variable component will give the address of that first variable component. For example, suppose that the values of a dimensioned variable commence with the 2902 nd word of ALLOC. Further, suppose the record segment address is 2861. The offset to be recorded in the DIVARB would be 41. The remaining or DIVARB words are reserved for record segment addresses. The DIVARB permits rapid address resolution for a dimensioned variable component. The variable value file is a linear storage medium necessitating the conversion of multi-index sets into a single index. That is, the set of indices for an array component must be converted into the single equivalent index for the storage of the array as a vector. Except for the length of a record segment and the number of words per value, all of the data necessary for both the index conversion and the address resolution is contained within the DIVARB. The need for a SPUR block is now some what obvious. The size of the SPUR block (i.e. the number of SPUR's requii'ed), however, is not clearly defined. The DIVARB size depends not only on the dimensionality,

PAGE 100

but also on the number of components of a dimensioned variable. The dimensionality and number of components will remain unknown to SECIAO until input of the variable declarations commences. Although it would be possible to complete variable declaration input before preparing the SPUR block and establishing the DIVARB's, it is unnecessary to do so and may even result in the wastage of ALLOC space. A SPUR stipulating a list entry size larger than one half the ALLOC segment size will waste a portion of each segment allocated. This cannot be avoided. However, the SPUR itself can be eliminated. We shall reserve a single SPUR for all large DIVARB's, employing it by altering the list entry size contained in the fourth SPUR word. The SPUR block adopted for SECEDE consists of (2+(ALL0C segment size)/2) five word SPUR's. The first SPUR is provided for the requisition of DIVARB's larger than one half of ALLOC segment size. The second SPUR is appropriate to record segment acquisition. The remaining SPUR's are graduated in list entry size from 1, to one half of ALLOC segment size. It is the address of the SPUR for the record segment which is considered to be the address of the SPUR block. The use of REMOTE requires a LOAD vector. In particular, two LOAD vectors are required by SECIAO for manipulating SECEDE. The LOAD vectors are furnished as a single vector 60 words in length which is called the LOAD block. The entire service module is bound together by a service module block, SECBL. The first word of SECBL contains the address of the SECEDE catalogue. The remaining SECBL words are pointers to the SPUR block, the LOAD block and to an allocation of space reserved for index calculations.

PAGE 101

89 * IV. 4. c. GENDER List We have already established that a GENDER list is actually a network. However, the GENDER list is far from being a simple network. This complexity includes, but certainly extends beyond, the concept of depth discussed briefly in Section IV. 2. To assist in describing the details of the GENDER structure, Tables 13 and 14 summarize the data types and list entries embodying a GENDER list. The fundamental GENDER list building blocks are nodes representing equations, ER's or constraints. Nodes in this category contain the fields (tlfl, t2fl, t3fl-2, t4fl-3, t5fl-3, tl6fl, tlVfl, tl8fl, tl9fl, t20fl, 2xd). The fields (t3f2, t4f3, tl6fl, tl7fl, tlSfl, tl9fl,t20fl, 2xd) are additional to fields required of all NETPAC applications. The value of the flag (t3fl) is 2 for these basic nodes. The identification flag (t3f2) indicates the exact character of the node. Its values may range from to 7 and correspond in ascending order to an ER, an evaluated ER, an equation, solved equation, an evaluated equation, a constraint, a solved constraint and an evaluated constraint. A solved equation relates an output variable to a set of one or more input variables. The solved equation is simply an algebraic rearrangement of an equation. The solved constraint has been algebraically solved for a particular variable, making it analogous to an equation. An evaluated equation is best explained by example. Suppose we have, an equation of the form F(x,y,z) =0 If we evaluate the equation for a given set of x, y and z values we obtain F(x,y,z) = f where f represents the value of the equation at x, y and z. If we were

PAGE 102

90

PAGE 103

91

PAGE 104

92

PAGE 105

93

PAGE 106

94

PAGE 107

95 If we were to include a "variable" representing f in the original equation F, and if we were to perform whatever algebraic rearrangement might be required to solve for the "variable" f , the result would be an evaluated equation. The evaluated ER and evaluated constraint are analagous to the evaluated equation. Evaluated equations, ER's and constraints appear only in cyclic calculations where they are employed for adjusting the values of tear variables. In order to consider the algebraic rearrangement of, for instance, a. function, it is necessary to have a list of the components to the equation. This list is called the link editor list, the pointer to which is field (tl6fl). Further discussion of the link editor list is momentarily deferred until the discussion of the nodes currently under consideration has been completed. The fields (tlVfl), (tl9fl) and (it20fl) are respectively the code name (for the equation, etc.), the dimensionality and the number of outputs. Two words are served for each index, to record an index range in the seven part format. The pointer to the output variable list is field (tl8fl). The output variable list consists of fon\?ard-only linked list entries containing the fields (tlfl, t2fl, tSfl, t21fl, d ). Field (t21fl) is the output variable code name . The flag (tSfl) will normally be 0, except when an output variable is also a tear variable and the function, ER or constraint is to be evaluated rather than solved for its output. In this case, the flag will be 2. The dimensionality is recorded in field (t2fl). One word only is reserved for each of the seven part indices. The link editor list of an equation must contain distinct entries for variables, operators and constants. A flag, data field (t3fl), is employed to identify the type of equation component represented by a list entry. The flag values 0, 1 and 2 correspond to operator, variable and

PAGE 108

96 constant list entries. The operator and constant list entries are identically structured as (tlfl, t2fl, t3fl, t21fl). Data type 1 is the forward link, and data type 3 has already been discussed. The field (t21fl) contains the code name of the operator or constant. For the constant, field ^fl) is an absolute pointer to the constant value. For an operator, this field specifies the order of the operator. A variable entry on a link editor list contains the fields indicated for a constant plus the field (t22fl) and one word per degree of dimensionality. The field (t22fl) is the dimensionality. The pointer to the variable value is (t2fl), and the variable code name appears in (t21fl). So far, we have considered variables, constants and operators with respect to the link editor list. One might be tempted to conclude that these three entries are sufficient for all functions, ER's and constraints. However, this is not the case. Recall the notion of an evaluated equation. For an evaluated equation, a link editor list entry must be provided to represent the equation value. This entry is identical in structure to the variable list entry. In fact, the data fields serve the equation precisely as they do a variable. A further entry type may be seen by considering the result of an algebraic rearrangement of an equation or a constraint. In solving for a particular variable (i.e. the output variable), it may be possible to combine some of the constants appearing in the equation or constraint. Rather than expand the constant name and value files, a second type of constant list entry has been invented. It contains only the forward link, the flag and an one or two word field reserved for the constant value. We shall differentiate the constants verbally by naming this

PAGE 109

second type a local constant. The flag values for the equation value and local constant entries are 4 and 5 respectively. The flag value 3 is reserved to indicate which variable (s) is the output of a function, ER or constraint. ' The connection of the basic GENDER building blocks into a network forms what is. termed a group body. The group body is the possession of a node called a group. Generally, a group represents a collection of equations, ER's and consti'aints having a common trait. For instance, the members of a group body might all be participants in a cyclic calculation. A group node is formed of the usual network fields plus (t3f2, t4f3, t7fl-4, t8fl-4), of which it is the field (t7fl) that points to the group body. The flag (t3f2) differentiates between a protected group (set flag) and an unprotected group (flag unset), The unprotected group may be modified by the analysis algorithms included in GENDER, whereas the protected group may not altered. An example of a protected group might be a completed solution procedure, perhaps retrieved from a solution procedure library, requiring no further analysis. The field (t4f3) appears in every GENDER list node and is provided as a programming convenience for GENIAO. The data fields (t7f2-4) and (t8, fl and 4) are, in order, the pointer to the decision variable list, the pointer to the tear variable list, the depth, the pointer to the SIM and the method identifier. The pointers (t8f2) and (tSfS) are reserved for use with the dynamic programming algorithms to be added to GENDER at a future date. The entries of the tear and decision variable lists are identical to the entries on the output variable lists for functions, ER's and constraints, except that t-wo words are reserved for each degree

PAGE 110

98 of dimensionality. Each dimension requires two words so that a minimum and maximum to each index may be specified. This feature permits compactness with respect to dimensioned variables assigned as tear or decision variables. * IV. 4. d. GENIAO The implementation of GENIAO was relatively straightforward, depending heavily on the COAST and NETPAC verbs. As was the case for SECIAO, GENIAO requires the reservation of seven words in the information block for data pertinent to the GENDER list. Table 15 lists these components with their respective contents. The GIMBL is the GENDER information block, and is the analogy of SECBL for SECIAO. The first word of GIMBL points to the GENDER list. The address of the first GIMBL word is recorded in JCC0RE(16). The second GIMBL word points to the SPUR block for list type 2. The SPUR block contains one five word SPUR for each possible list entry size from unity up to and including the largest possible GENDER list entry. The spur's are arranged in the block in ascending order. The third GIMBL word is reserved for the trace key applicable to the GENDER list at level 0. The remaining seven words of GIMBL contain the addresses of vectors employed during index calculations. Each of the seven vectors is equal in length to the maximum possible dimensionality for a function, ER, constraint or variable. This integer is obtainable from the fifteenth word of the information block. Let us label the vectors A through G in the order they are referenced by GIMBL. The vectors A through G correspond exactly to the vectors a through g of Appendix B. Although the GENDER list is principally a NETPAC implementation, REMOTE is employed by GENIAO. For both the input and output of a

PAGE 111

99 c c o &

PAGE 112

100 GENDER list, temporary storage is required for linkage data pertinent to the nodal connections. With rapid access being the paramount consideration, a file structure was selected for the temporary storage. Two files are enployed, one for the current GENDER list level and one for the previous level. As the input of the current GENDER list level is completed, the files are interchanged so that the current level file now becomes the previous level file. Each file entry contains the address of a node and a pointer to an auxiliary list. The list , entries each contain the file entry number of a predecessor node to the node labeled in the file entry.

PAGE 113

CHAPTER V ANALYSIS ALGORITHMS The current selection of algorithms available with the GENDER System is somewhat limited. Though limited, the algorithms nevertheless do permit the development of a complete solution procedure according to a realistic analysis strategy. The selected strategy involves resolving cyclic calculations via minimum tear considerations. Additional algorithms can be relatively easily provided. Several such additions are contemplated for GENDER in the near future. These additions are futher discussed in the concluding remarks of Chapter IX. The rationale for the selection of algorithms for inclusion in GENDER depended upon two principal criteria. First, the algorithm must be of obvious utility with respect to solution procedure' development generally. Secondly, the algorithm should be as simple as possible. This latter criterion arises since the algorithm must currently serve as a test and evaluation vehicle for the support and administrative facilities of the GENDER System. The next three sections of this chapter describe the analysis algorithms selected to perform out put set assignment, precedence ordering and minimum tear selection. Rather than reproduce in this work the algorithms stepwise, reference will be made to the literature source of the algorithm version implemented. To be described in the following sections, then will be the essential characteristics of the algorithms as pertaining to the design engineer and to GENDER. The literature 101

PAGE 114

10? references may be regarded as * flagged sections. V. 1. Hungarian Output Assignment Algorithm The Hungarian algorithm for output assignment selected for GENDER is the version presented by Gupta (1972) in his master's thesis. To each variable in each equation, ER and constraint a cost or weight of selecting the variable as the output must be assigned. The selection of weights will, in general, reflect the design strategy. The design engineer may simply assign equal weights to all variable/ equation incidences. By so doing, he has reduced the Hungarian algorithm to an arbitrary output assignment procedure. This strategy minimizes the effort expended by the design engineer in obtaining an output assignment. A second weight selection criterion, closely allied to the proceeding one, is user preference. The design engineer may wish to influence the Hungarian algorithm to make certain output assignments while avoiding certain other assignments. Thus, he would ascribe low weights to prefeired assignments and high weights to undesired assignments. Although the weight range may be as large as desired the range 0-9 is envisioned to provide sufficient resolution to convey user preference. Although a design engineer may weight each. variable/equation incidence according to preference, it is more likely that a specific weighting scheme would be applied. For example, Lee and Ozawa (1971) and Soylemez and Seider (1972) suggest weighting on the basis of the algebraic complexity of solving for a variable in the event of selection as the output. While this increases the effort expended by the engineer, a more efficient solution procedure will likely result.

PAGE 115

103 A final scheme for weight selection involves the determination of the sensitivities of each variable/equation incidence. If the weight is assigned as the negative of the logarithm of the sensitivity, than the Hungarian algorithm, which seeks to minimize the sum of the weights for a complete output assignment, will be performing output set assignment according to the maximum product criterion (Edie and Westerberg^ 1971). This criterion has been shown to lead to rapidly convergent solution procedures to cyclic equation sets. Chapter VII is a brief user's manual and discusses the use of the Hungarian algorithm. The subprogram performing this algorithm is designated HASSAL. As is the case for all of the analysis algorithms, the passed parameters required by HAS SAL are minimal, being only the address of a group and a unique call statement identification number. The latter is an essential feature of the debug facilities incorporated into COAST and described via comments in Appendix A. HASSAL operates on a single group, although this group may have groups as nodes on its group body. The effect of HASSAL on a group is the substitution of a new output assignment for the previous output assignment. The previous output set may, of course, be null. Unassigned variables at the conclusion of output assignment become decision variables and are recorded in the group. V.2. Speed-Up Precedence Ordering Algorithm The Speed-Up algorithm for precedence ordering is the product of research by Sargent and Westerberg (1964).. Two algorithms are presented in the reference, but only algorithm I has been selected for use with GENDER. The subprogram name is SPEDUP.

PAGE 116

104 SPEDUP performs precedence ordering of a group body on which the output set assignment is recorded. Only the address of a GENDER group and a call statement identification number are required as passed parameters by SPEDUP. The usq of SPEDUP in an analysis strategy is discussed in Chapter VII. The effect of SPEDUP is the reorganization of a group body to reflect precedence ordering. If the group body possesses an unresolved cyclic character, SPEDUP will create a new group containing only the equations which are not acyclic. That is, the cyclic equations are transferred from the original group body to the group body of a new igroup which becomes a member of the group body to the original group. The original group is, therefore, acyclic at the conclusion of SPEDUP. The sub-group into which the cyclic character has been concentrated may now be subjected to tear variable selection. V.g. Barkley Motard Minimum Tear Algorithm The Barkley and Motard (1972) minimum tear algorithm was presented in a paper at the NATO Advanced Study Institute on Decomposition as a tool for solving large problems held in Cambridge, England. The program executing the Barkley Motard algorithm is the subroutine BEMOAN. BEMOAN requires the same passed parameters as HASSAL and SPEDUP. Thie GENDER group on which BEMOAN is to operate must posses an output set assignment. After selection of the. tear variables has been made, the selections are recorded in the group. The deletion from consideration of the tear variables in all functions except where they are the output variables renders the group body acyclic. This strategy and the program SPEDUP are combined to precedence order the group body as the final BEMOAN step.

PAGE 117

105 V.4. Implementation Details Each of the analysis algorithms depends upon the existence of a sparse incidence matrix for the group under analysis. The concept of the SIM and the SIM manipulation verbs of SIMPAC were developed expressly for the implementation of analysis algorithms. Although the SIM is not always the appropriate medium for the execution of an algorithm, it is the most convenient medium for conveying to an algorithm the pertinent data relative to a group body. An important feature shared by the analysis algorithms, and indeed by most of the major GENDER programs, is the high degree of subroutinization. While the delegation of tasks among subprograms can be carried to the extreme, a certain degree of task delegation greatly simplifies the debugging operation and enhances the readability of the code. HASSAL, SPEDUP and BEMOAN are hardly more that supervisor programs directing the operation and interaction of their respective subroutine sets. In addition to the SIM, each of the analysis algorithms expects the existence of certain conditions before execution is attempted. For example, BEMOAN requires an output assignment before it can proceed. To save the design engineer from at least a portion of the details of solution procedure generation; each of the three analysis programs automatically generates missing information before proceeding. A subprogram DFAULT is employed to provide this service and is more fully described in Chapter VII. Continuing the pattern established in previous chapters, the following section provide the implementation details and are generally only of value to readers contemplating modifications to existing programs or expansion of the analysis algorithm repertoire. Before attempting the

PAGE 118

106 next three sections, it is strongly advised that familiarization with the Hungarian, Speed-Up and Barkley Motard algorithms be acquired. Only the adaptation of the algorithms to the data structures available with GENDER will be discussed 'in the ensuing sections. * V.4.a. HASSAL HASSAL is by far the largest and most complex of the three analysis algorithms. Gupta (1972) presents the Hungarian algorithm in the form of two interactive algorithms. One of the algorithms resembles a supervisor directing the utilization of the other algorithm. It is essentially after this supervising algorithm that the program HASSAL is patterned. The steps of the algorithm for performing the output set assignment are parcelled among several subprograms. The major subprograms employed by HASSAL consist of J2ACYC, J2A0SA, J2PATH, J2MARK and J2SWIT. . The subprogram J2ACYC is the acyclic output assignment phase of the algorithm (steps 1 through 4 of Cruptas algorithm). Step 5 represents a decision and transfer of control step exterior to the domains of J2ACYG and of the next algorithmic phase, J2A0SA. Such control steps have been incorporated into HASSAL. Steps 6 through 8 constitute the instructions incorporated within J2A0SA. J2A0SA performs an arbitrary output set assignment. The remaining subprograms under the guidance of HASSAL expand the arbitrary output assignment into a complete assignment. A complete assignment is characterized by output variables assigned to every equation. Not all variables need be assigned; those remaining unassigned become decision variables. J2PATH and J2MARK are both involved in the search for alternative output assignments which will permit the extension of the output set.

PAGE 119

107 J2PATH performs steps 10 through 14 of the assignment algorithm. Alternative assignments are sought via a row and column marking scheme. Marking is also employed by steps 16 through 17, which are embodied in J2PATH. The marking strategy employed by J2PATH is some what more complex than that of J2MARK. Both programs result in the identification of Steward paths. J2SWIT is employed whenever a Steward path is identified to perform the output set adjustments. For paths discovered by J2MARK, J2SWIT must break one output assignment and make two new output assignments. For paths discovered by J2PATH5 three output assignments are replaced by four new assignments. In either case, a gain of one assignment in the output set is noted. HASSAL and its subprograms operate entirely on the sparse incidence matrix. A working ordinate is created for both the rows and columns. The working ordinate file entries are identical to the file entries of the 'primary ordinates. The principal function of the working ordinates is for the recoding of row and column marks. Marks are stored in data type 13, which is the data type employed by the primary ordinates for storage of output assignments. Thus, as a programming convenience, the SIM routine for output set assignment is employed for marking the working ordinates. No other temporary data structures are required for the implementation of the Hungarian algorithm. * V.4.b. SPEDUP The Sargent and Westerberg (1964) Speed-Up I algorithm was by far the easiest and most natural to implement. The algorithm was developed expressly for list processing. The authors propose four list structures for use with the Speed-Up I algorithm. With a sparse incidence matrix available to SPEDUP, two of the four lists need not be generated.

PAGE 120

lOJ List 1 is an unordered list of all equations, ER's and constraints. The row ordinate of the SIM is a file containing references to the functions, ER's and constraints which SPEDUP is to reorder. Consequently, the row ordinate is substituted for list 1. The lists of type 2 are described in the paper as providing data on the linkages between the elements to be precedence ordered. A type 2 list must be provided for each element to be ordered. Let us consider an SIM row. Each SIM row contains an output variable (perhaps several outputs for an ER), one or more input variable and perhaps one or more decision variables. The input variables, by virtue of their not being either outputs in a particular row or decision variables, must each be assigned as outputs to other SIM rows. Thus, the SIM rows furnish the linkage data directly and eliminate the need for creation of the type 2 lists. Note the one to one correspondence between row ordinate file entries and SIM rows. Lists 3 and 4 must be created by SPEDUP. List 4 is employed as temporary storage during execution of the algorithm, with the final precedence ordering appearing on list 3. The algorithm stipulates the transfer of entries from list 4 to list 3 making it necessary to design only a single list entry data format serving both lists 3 and 4. The data format selected was (tlfl, t2fl, t3fl, t2lfl, t22fl), with the list being GENDER type 2. Tables 16 and 17 are provided as a guide to the structure and contents of the entries on lists 3 and 4. Data types 1 and 2 serve as the forward and backward links as is usual with forward backward lists. Data type 3 is a flag serving to differentiate equations (0) from decision variables (l) and groupings of equations (2). The contents of data types 21 and 22 depends upon the flag value. ,

PAGE 121

109 c •H -g O 2: P-i M W 6 CO ;z; o w

PAGE 122

no u

PAGE 123

Ill If the value of the flag is zero, the list entry represents an equation, ER or constraint. In this situation, data type 21 contains the SIM row number and data type 22 contains the address of a row element. In particular, data type 22 refers to the next input of an equation, ER or constraint to be considered by SPEDUP. Data type 22 will ini tally point to the first element of the row. If the value of the flag is two, the list entry represents a grouping of equations, ER's and constraints. Such groupings indicate cyclic information flow patterns among the group members. Data type 21 contains the pointer to a list of grouping members. The list entries on this auxiliary list are each identical to the list 3/4 entry with the flag set to 0. Data type 22 is also a pointer to an entry on the auxiliary list, but not necessarily pointing to the leading entry as is the case for data type 21. Data type 22 points to the first member of the grouping having a non-null input list. This pointer is advanced to the next grouping member when, during SPEDUP execution, the input list of a grouping member is depleted. A flag value of 1 indicates the list entry to be representative of a' decision variable. In this case, only data type 21 contains meaningful data. Data type 21 contains the SIM column number of the decision variable. Data type 22 is ignored. The implementation of the Speed-Up I algorithm does not exhibit the degree of decentralization observed for HASSAL. This is principally due to the design of the algorithm. The majority of the steps are simple; that is, they do not contain instructions to perform complex or extensive manipulations. Further, the overall manipulations demanded by Speed-Up I are much less complex than those required for HASSAL.

PAGE 124

* V.4.C. BEMOAN BEMOAN is the supervisor program for the Barkley and Motard (1972) minimum tear algorithm. The algorithm employs precursor, and interval lists to search initially for self-loops,, then for two-way edges in an effort to reduce to null the set of interval lists. Nullity of the interval list set indicates complete elimination of the cyclic character in a group body by virtue of tear variable selections. Instead of employing separate lists as suggested in the algorithm, the BEMOAN inplementation incorporates the list information into a single column ordinate. This working ordinate is composed of file entries containing the data, fields (tSfl, t4fl, tl4fl). The LEND summary for these data fields is given by Table 18. The field (tl4fl) is a flag whose possible settings of 0, 1 and 2 respectively indicate the file entry to represent the head of an interval, an interval member and a tear variable. Note that the head of an interval is also a precursor either to itself or to another interval. The field (t3fl) contains the column number of the interval to which a variable belongs. This field is only of significance for a flag of 1. The field (t4fl) is used variously, for counting membership of intervals in two-way edges or occurrences in other intervals. The number of occurrences of an interval in the other intervals is useful in selecting a tear variable when neither a self-loop nor a two-way edge is present. If the flag value is 2, both (tSfl) and (t4fl) contain no significant data.

PAGE 125

s •H U O W) C •H -g O i w m 0) o & c E CO ro O >, 2 -H CO s H H ^ CD CO CU CD C +J > CO C •H f-l n-i CD o c 0) rC O

PAGE 126

CHAPTER VI INTERPRETATION The GENDER list contains all of the instructions for solving an equation set. During the course of GENDER list development via the algorithms, no modifications are imposed upon the original equation set. The equation set stored in SECEDE serves only as a source of information. When a design engineer employs GENDER, the ultimate objective is, of course, the solution to the equation set and not merely the instructions for obtaining that solutions. Two choices are apparent at this point. The engineer may impose the algebraic rearrangements and precedence ordering on the equation set as per the GENDER list instructions. He may then program, for instance in FORTRAN, the evaluation of the output variables, including the resolution of cyclic calculations. It is possible to provide a FORTRAN converter as an integral component of the GENDER system. While FORTRAN conversion of the GENDER list could have been provided, it was rejected for the present version because of the difficulty in performing modifications to the FORTRAN source module. Changes to the source module might originate from reanalysis of a cyclic group if convergence problems are encountered, or they might originate from alterations in the active constraint set during constrained optimization. Even assuming that the modification of FORTRAN code could be conveniently accomplished, re-compilation would remain a necessity. The. foregoing considerations ledto the examination and ultimate 114

PAGE 127

selection of an interpreter system. By interpretation we mean execution directly from the GENDER list. The interpretation of a GENDER list is a three step process; link edit, convert and interpret. The link edit step creates for each equation, ER and constraint a list of components with variable value storage locations explicitly addressed. The conversion step performs any required algebraic manipulations on the link editor generated lists. The following sections describe the interpretation capability designed for GENDER. Since the advantages of interpretation will not be fully realized until the advent of a constrained optimization supervisor for GENDER, and since the creation of this supervisor is somewhat distant, the interpretation capability has not been fully implemented. To ensure compatability with the currently implemented GENDER components, the essential features of interpretation have been carfefully analyzed. The remainder of this chapter reflects the results of this analysis. The inclusion of this information in a description of GENDER has been prompted by two factors. (1) It will form the basis for the implementation of the interpreter, and (2) the interpreter (coupled with the notion of constrained optimization) provides an insight into the justification for the implementation of GENDER as a complex, list processing-based system. VI. 1. Link Editor At the completion of analysis, the GENDER list contains all of the instructions necessary to solve an equation set. However, the GENDER list contains only the instructions, for the equation set is stored in SECEDE. As files in SECEDE, the equation set is virtually unavailable with respect to performing the modifications recorded on the GENDER list i.e. algebraic rearrangements. Therefore, it is necessary to generate

PAGE 128

116 a second copy of the equation set in a form amenable to modification. The link editor, LINKED, provides each group body entry with a linked list of the constituents in the equation, ER or constraint represented by the group body entry. Thus, the second copy of the equation set is distributed over the entire GENDER list. This distribution has the characteristic of automatically conforming to the precedence ordering exhibited in the GENDER list. Now let us consider a variable appearing on a link editor list (LEL). In terms of interpretation, the really important aspect of the variable is not its code name, but is its value storage location. Since the variable value files are integrated into SECEDE, the use of REMOTE verbs is necessary to determine value storage addresses. While it is of no consequence for acyclic groups, deferring address determinations until interpretation causes the address of a variable to be determined on ^every iteration during convergence of a cyclic group. Consequently, each LEL entry representing a variable value is provided by the link editor with the address of the variable value storage location. VI. 2. Converter The converter, COVERT, has three primary duties: (1) solve LEL's algebraically for the output variable, (2) install equation, ER and constraint evaluation list entries into LEL's, and (3) provide a method insert to the group bodies of cyclic groups. The converter is programmed to accomplish all three tasks with only a single trace through the GENDER list. A method is a subroutine required to direct the successive selection of tear variable values as a means of accelerating the convergence of cyclic groups. Methods are identified in the GENDER system by the method code. This code is recorded in the data field (t8f4) of each group. A

PAGE 129

code o£ unity indicates a group to be acyclic, while a code of zero indicates that a group has not yet been subjected to the analysis algorithms. Thus, the reference by the method code to actual methods begins with the code 2. All cyclic groups, that is all groups having a method code of 2 or larger, must have a method insert as the last accessible node of the group body. The order of access is, of course, dictated by the verb NEXT. The contents and structure of the method insert has already been presented in Tables 13 and 14in Chapter V. The purpose of the method is twofold: (1) to indicate to the interpreter that repitition of the group body is required and (2) to provide information required by the method subprogram. . In general, a method subprogram requires a vector of values for evaluated equations, ER's and constraints, and a vector of tear variable values. The evaluated entities and the tear variables will be equal in number. The objective of the method subprogram is the selection of tear variable values which drive the values of the evaluated entities as close to zero as practicable. Since some convergence accelerators, i.e. methods, rely on a history of tear variable and evaluation values over several iterations, this data is provided as an auxiliary to the method insert. The current or latest values for both variables and evaluated entities are provided as a linked list containing the addresses of storage values. That is, these lists are essentially LEL's. The old values for both tear variables and evaluated equations, ER's and constraints are provided via an application of REMOTE. A single catalogue references two records. The first record contains a single file of tear variable values. Each file entry contains all of the old values for a particular tear variable. Therefore, if the last 5 values (excluding the current

PAGE 130

118 value) are required, then each file entry will accomodate 5 value fields. To avoid unnecessary shifting of the contents of a file entry when a current value becomes the most recent old value, an indexing scheme is proposed. An index is stored in the method insert which indicates which of the old values is the most recent. For example, an index of 2 indicates the values in the second value field of each file entry to be the most recent. By subtracting unity (modulo 5) one determines the value field to receive the current value just prior to the creation of a new set of current values. The twenty-second word of the information block (whose address is JCC0RE(17)) contains the number of old values to retain. The second record, identical to the first, is reserved for the values of evaluated equations, ER's and constraints. The second of the three functions performed by COVERT involves the addition of evaluation list entries to the LEL's of equations, ER's or constraints. In particular, such modification is performed on entities declaring a tear variable as the output. Further, this modification is only performed if the method code stipulated in the group node is greater than five. The method codes two through five are special cases in which the tear variables are calculated as output variables. Thus, for codes two through five, the method subroutine must rely only on the current tear variable values and perhaps a history of old tear variable values to provide an estimate of the tear variable values for the next iteration. The first of the three COVERT duties enumerated in the first paragraph of this section requires the capability of algebraically manipulating an LEL. All of the LEL manipulative power has been concentrated in a general algebraic package, GALAP. This program package has

PAGE 131

119 been developed expressly for the GENDER system as an independent research effort. The listings for GALAP have been included in Appendix A. User interface with GALAP is via the programs SOLVE and MATH. SOLVE permits the algebraic solution of an equation or constraint for its output, while MATH determines the value of an output variable based on the current value of the input variables to an equation or constraint. As one might suspect, it is SOLVE which is employed by COVERT. VI. 2. a. SOLVE The program SOLVE is employed to solve algebraically for a particular variable. The variable of interest is indicated to SOLVE by the occurrence of a flag value 3 for an output variable or a flag value 4 for an evaluation entry. The evaluation entry is viewed by SOLVE to be identical to an output variable. SOLVE accomplishes the algebraic rearrangement by initially expanding the LEL into a network structure. The algebraic rearrangement is actually performed on the network, which is collapsed back into an LEL after the algebraic manipulations have been completed. Algebraically speaking, SOLVE is not always capable of solving an equation or constraint for its incident variable. If purely algebraic manipulations cannot solve an equation for a particular output variable, then SOLVE must fail. For example, algebraic manipulations alone cannot reduce the equation . X + y = InX to the form X = f(y) SOLVE is, however, empowered to recognize and perform many simplifications. For example, the equation x + y = 2x

PAGE 132

120 becomes X = -y if X is designated as the output variable. Further, the equation 2(x + 2) y = 9 becomes X = y/2 + 2.5 again with x as the output variable. In order to accomplish the combination of constants, the constant entries on the LEL are released and new constants introduced. The new constants are termed local constants. That is, they are constants appearing only in one equation, with each equation having its own set of local constants. Table 19 indicates the operators which SOLVE is capable of recognizing and manipulating. VI. 3. Interpreter Put quite simply, the task of the interpreter is the determination of the values for all variables except the decision variables. However, the size and complexity of the interpreter program GLINT indicates the presence of some latent complexity in this simple task. With respect to acyclic groups, the assignment of values to output variables is relatively simple. Each equation, ER and constraint constituting an acyclic group need be considered once only. The GALAP program MATH is employed by GLINT to effect all output variable evaluations for solved equations and constraints. The presence of an ER on an acyclic group body somewhat complicates the procedure since the calling of the subprogram (i.e. ER) is necessary. The procedure for calling subprograms is the subject of section VI. 3. b. The necessity of calling method subprograms further complicates

PAGE 133

121 H o4 O o CM CM O >, P a w

PAGE 134

122 the resolution of cyclic groups, which by their cyclic character automatically require the repetitive evaluation of all concomitant output variables. The aspect of repetition requires that data be saved which will permit the reinitiation of the calculations at the beginning of a group body should satisfaction of the convergence criterion fail at the termination of an iteration. The program METHOD, discussed in section VI. 3. b, is responsible for evaluating a group with respect to the convergence criterion, unless such a comparison is performed by the method subroutine. If the interpreter encounters an error condition, the interpreter wilL return to the calling program the address of the group under consideration and a code indicative of the particular error. Table 20 lists the error codes which the interpreter is designed to recognize. The executive program prepared by the design engineer must be programmed to follow a recovery procedure for each error code. VI. 3. a. MATH Like SOLVE, MATH is constrained to equations and constraints constructed with the operator set tabulated in Table 19 of section VI. 2. a. MATH exists in two versions; one for single precision floating point arithmetic and one for double precision floating point arithmetic. The design engineer must select the MATH version appropriate to the accuracy demanded for the design computations. Since all variables must be either single or double precision, election to employ double precision may cause a significant increase in memory requirements. In view of the numbers of other machine instructions required to support the interpretation process, selection of double precision should not affect execution times. VI. 3. b. Subroutines The subroutines which the interpreter GLINT must call are ER's and

PAGE 135

123

PAGE 136

methods. The design engineer must provide the programs EXTRA (for ER's) and METHOD (for methods). Essentially, each of these programs is a library of call statements for the various ER or method subroutines. The ER and method code names are employed to access the appropriate call statement via a computed GO TO statement. Note that for an ER, two computed GO TO's must be employed: one conditioned on the unit number and a second conditioned on the ER code name exlusive of the unit number modifier.. This procedure for calling subroutines during GENDER list interpretation may seem somewhat crude. However, in light of the original decision to remain machine independent to the largest possible extent, the use of the call statement libraries EXTRA and METHOD is inescapable. In addition to the library functions of EXTRA and METHOD, these programs must also perform transformations on the data to be provided to an ER or method. That is to say, most ER and method subroutines accept values as data rather than the addresses of values so prevalent in GENDER list interpretation. The value address of interest to EXTRA are distributed within the LEL*s of the ER's. The ER output variables will be indicated by LEL entry flags equal to 3 just as for the output of an equation or constraint. For METHOD, the value addresses are available from an LELtype list and an old value file. One list/file pair will be available for both the tear variables and the evaluated entities (equations, ER's and constraints). Since it is the duty of METHOD to employ a method subroutine for the purpose of returning to GLINT a new set of tear variable values from which new values for the evaluated entities are to be determined, METHOD must update the old value storage files. The nature of the update procedure is suggested in section VI. 2. Finally, METHOD must be programmed

PAGE 137

125 to test for convergence when employing any method subroutine into which a convergence test has not been incorporated. Typically, a convergence test would involve the comparison of the latest tear variable value with its predecessor as for example in a sum of the squares of the differences technique. METHOD indicates satisfaction of a convergence test by returning zero to GLINT in substitution for the address of the method insert. VI. 4. Implementation Details In the subsections to follow, we shall concentrate on the implementation details for LINKED, COVERT and GLINT. As per the pattern established for previous chapters, these sections are marked with an * and may be omitted by all readers not requiring this detailed data. The information of the ensuing subsections is not necessary to the preparation of the programs EXTRA and METHOD. Sections VI. 2 and' VI. 3. b provides, when used in concert with Tables 13 and 14, sufficient information on the data structures involved. The user must thoroughly understand the LEL, method insert and old value storage structures. The programming tools are provided principally by COAST and REMOTE. In accessing LEL entries for an ER, LNKFWD and FRMCEL should be used to effect the advance and data transfer operations rather than POPUP. Although POPUP does perform the advance and data transfer operations automatically, POPUP also destroys the list as it proceeds. Remember that for cyclic groups or in the event of group reanalysis, the LEL's will be utilized repetitively. * VI. 4. a. LINKED LINKED is basically a supervisor program for the link editing step. NEXT is employed to access the group body entries "of either a single group or an entire GENDER list. LINKED utilizes the group body flag

PAGE 138

(tSfl) to identify the particular group body constituents, each o£ which is treated separately. A group on a group body causes no action by LINKED save to access the body of the group via NEXT. Equations, ER's and constraints all carry group body flags of 2. All entries with flags of 2 are referred to the lOPAC program JILEDL for LEL generation. The flag value 3 is reserved for method inserts. The LEL-type list entries, as well as the old value storage files, are released via CORN for later reallocation. The field (tl6fl) is the address of the SPUR employed with CORN. * VI. 4. b. COVERT COVERT, like LINKED, is primarily a. supervisor program. Also like LINKED, COVERT employs NEXT to access the group bodies. For the group body entries representing equations and constraints, COVERT utilizes SOLVE to solve algebraically for the output variable. The output variable list of each group body indicates which of the LEL entries are to recieve flags of 3. Although SOLVE is not generally employed for ER's, the flagging of the output variables on the LEL is performed. An exception to the exclusion of ER's from algebraic rearrangement is the declaration of an ER to be an evaluated ER. Equations, ER's and constraints become evaluated entities when the method code is greater than 5 and when an output variable is also a tear variable. COVERT makes a direct comparison of each output variable list encountered to the tear variable list for all groups having method codes exceeding 5. An evaluated entity receives an additional LEL entry with a flag of 4. This entry represents the value of the evaluated entity. COVERT requisitions a storage location for the value. The convention for including the new LEL entry is (1) place the new entry at the end of

PAGE 139

127 the LEL and (2) add to the new end of the LEL a list entry representing the equal operator. To understand this procedure, we must first recall that the equations and constraints stored in SECEDE conform to the reverse polish notation with the "= 0" implied. Since the LEL's are developed from SECEDE, it follows that the LEL's will also be in reverse polish without the "= 0" actually appearing. Let us now consider the conversion of an equation (written in reverse polish notation) to an evaluated equation. Including the evaluation entry and the subtraction operator, the equation becomes f(x,y,z)F = or in standard notation F = f(x,y,z) COVERT is programmed to release an evaluation entry discovered on LEL prior to the output variable list/tear variable list comparison, the elimination of an evaluation entry is simplified by the use of reverse polish notation for the LEL and by the fact that evaluation entries are encountered only as the algebraic output of the LEL. Thus, an evaluation entry may always be deleted by removing from the LEL the last two list entries; the evaluation entry and the equality operator. The storage location assigned to the evaluation entry is placed on the available space for later reallocation. For groups possessing method codes greater than 1, COVERT must install a method insert as the last accessible node on the group body. The end of the group body is indicated by a change in level following a call to NEXT. COVERT retains the address of the last node to effect the access to the last group body node once a level decrease is noted.

PAGE 140

128 COUPLE attaches the method insert to the last group body entry. COVERT establishes the value storage lists and files discussed previously in sections VI. 2 and VI. 3. b. The tear variable list furnishes the data required for establishment of the storage facilities, necessary for the tear variables. No such list being automatically available, COVERT develops the LEL-type list for evaluated entities as the evaluation entries and the value storage locations are created. Note that this list will not be created for method codes less than 6. The storage facilities of NEXT are employed to store the address of a partially completed list of evaluation entries whenever a level increase occurs i.e. whenever a group is encountered on the group body of another group. * VI. 4. c. GLINT GLINT uses NEXT to trace through either a single group or an entire GENDER list performing numerical evaluations with MATH and EXTRA. At the* conclusion of each group possessing a method code exceeding unity, GLINT must call METHOD. If METHOD returns the address of the method insert, iteration on the current group body is necessary. Conversely, if METHOD returns zero for the address of the method insert, the convergence criterion has been satisfied and consideration of the next group may begin. To facilitate the iteration on group bodies, GLINT uses a temporary list to store the address of the group. If an interior group is encountered, a new entiy is pushed onto the temporary list. The trace of a group body is repeated by first incrementing the group trace key (t4f2) by unity. The trace is begun directly with the first group body entry rather than with the group. This procedure is essential to preserve the temporary lists upon which NEXT depends.

PAGE 141

129 A program called NIMBER serves as an interface betvveen GLINT and MATH. -NUMBER directs MATH In the computation of an output variable value. NUMBER maintains a push-down list for the storage of operands (variables and partial results) in the fashion of . a stack. NUMBER begins with the first LEL entry in computing an output value. Each operand encountered is stored on the push-down list until an operator is encountered. The encounter of an operator causes NUMBER to pop-up from the push-down list (PDL) a number of operands equal to the order of the operator (t21fl). MATH performs the operation of the operator on the selected operands, and the result is placed on the PDL. The computation is complete when both the LEL and the PDL are simultaneously exhausted.

PAGE 142

CHAPTER VII USER MANUAL In this chapter we shall not try to present all of instructions for using the GENDER System. Rather, we shall discuss briefly the essential instructions on a somewhat superficial level. References to text and tables in other chapters will furnish the details. The intent is the creation of a guide to the use of GENDER while repeating information already presented to the smallest extent possible. Two principal areas of activity are required of the design engineer prior to employing GENDER: (1) preparation of input data and (2) program preparation. Each of these very general instructions contain a number of steps and are discussed in the sections to follow. One instruction which fits in both the data preparation and the program preparation areas is the preparation of the information block. The data required to establish the information block may be input either via a READ statement or via a DATA statement. VII. 1. Input Data Preparation The input data may be categorized as follows: (l) the core allocation, list and data field information required by COIN, (2) the information block, (3) SECEDE and (4) an initial GENDER list. Category 4 is optional and would be supplied when the continuation of a previous problem analysis is desired. The data in categories 1, 3 and 4 are input via the programs COIN, SECIAO and GENIAO respectively. The data formats for each of these programs are presented in the comment statements for the respective programs in Appendix A. 130

PAGE 143

131 The data required to initialize the core allocation and list processing package read by COIN furnishes the means by which a design engineer may tailor GENDER to the machine available. If performed with caution and foresight, the preparation of the data for COIN may need be performed only once for a given machine environment. Tables 2, 3, 5, 6, 9 and 13 give the LEND's required for the various list types. The table entries indicated by a V represent variables which the engineer is permitted to choose. Perhaps we should review the definition of a LEND. For example let us consider a data field occupying bit positions 4 through 7 of the second and third words of a list entry. The four LEND components are, in order, the word index of the first field, the word index of the last field, the shift and the mask. For the data type we are considering, the LEND would be (2, 3, 2^=8, 2'^_1=15). The aforementioned tables must be used in conjunction with Tables 10 and 14 for determining the data organization within the list and file entries. It is the data organization adopted by the engineer which will assign integer values to the V's in the LEND tables. Table 21 lists all of the components to the information block. In general, numerical values can be assigned to each of these components only after the data for COIN has been prepared. Since the information block is to be established by the user provided main program, the format for the information block data is a matter of user preference. VII. 2. Program Preparation Program preparation involves the coding of three programs by the design engineer. The programs METHOD and EXTRA are described in Chapter VI. Note that even if no ER's have been included in the problem, a program named EXTRA must still be provided to avoid an unresolved external reference error.

PAGE 144

13 i

PAGE 145

133 The third program which must be supplied by the user is a main program which must be supplied by the user is a main program. This program is the executive routine which will supervise the data input operations, problem analysis and solution, and the output of results. The data input operations might be regarded as an initialization phase prior to attempting to solve the problem. In this phase, the program COIN is called, the information block is established and the program SECIAO is called. If the input of a GENDER list is desired, GENIAO is employed. Note the order of events for the initialization phase, for successful initialization is possible only in this order. Establishment of the information block involves the acquisition, via NEWCEL, of a list entry at least 22 words long. The data may be read directly into this list entry. Finally, the storage of the address of the list entry in JCC0RE(17) completes the procedure. The remainder of the main program is devoted to the analysis and output phases. The analysis strategy is limited to weighted output assignment and then minimum tear for the present. The future expansion of ALPAC (or perhaps additions to ALPAC by the design engineer) will permit alternate strategies. The completed solution procedure (i.e. GENDER list may be output via GENIAO. SECEDE may also be output using SECIAO. To facilitate the resumption of analysis at a future date, punched output of both the GENDER list and SECEDE from GENIAO and SECIAO is available. If direct interpretation of the GENDER list is elected, either VARIAO or SECIAO may be employed to obtain the numerical results of the calculations. Note that the main program must be coded to react properly to any contingencies which may develop during interpretation. This topic of error recovery has already been discussed in Chapter VI.

PAGE 146

; 134 ^ In the event a user may wish to employ output facilities other than those afforded by GENIAO, SECIAO or VARIAO, JCGORE (13) must be set equal to 6 prior to the utilization of any GENDER program. JGGORE (13) serves as a printer carriage control character. The integer 6 indicates that a new line is to be begun for the next output. This internal carriage control does not supercede formated carriage control instructions, but applies only to GENDER generated trace and error messages. VII. 3. Additional Algorithms It was noted in the preceeding section that the algorithm selection currently available permits only a single analysis strategy. While it is planned to expand the algorithm library in the near future, it is unlikely that it will be possible to satisfy the needs of all potential users. Thus, it is likely that a design engineer will wish to program an analysis algorithm himself. Before attempting the expansion of the algorithm library, certain of the * marked sections must be read. In particular, the purpose of an analysis algorithm is to modify a GENDER list. Consequently, the * marked section pertaining to the GENDER list must be understood. If the algorithm to be implemented is to employ a sparse incidence matrix, and particularly if the matrix operations are not presently provided in SIMPAC, the implementation details or SIMPAC must be read. The * marked sections for all data structure manipulation packages must be regarded similarly to SIMPAC whenever the manipulations to be imposed on the data structure are not the standard manipulations provided in GENDER. VII. 4. GENDER as a Design Tool The design of a chemical processing plant is a rather complex procedure. Let us consider the impact of GENDER on the single design phase concerned with the differentiation of processing alternatives.

PAGE 147

i.-^s In response to a proposed raw materials/products set, the design engineer will develop a number of possible processing schemes. By omitting processing elements such as pumps and heat exchangers a simplified flowsheet can be created. The simplified flowsheet should retain only those units essential to the intent of the processing scheme. From the simplified flowsheets, mathematical models maybe developed employing short cut and simplification techniques wherever possible. The equation sets thus developed may be subjected to analysis and interpretation via GENDER. The design engineer has been relieved of the burden of solving the several modes either by hand or by programming the models for computer solution. Frequently, the resolution of the crude models is insufficient to distinguish the best processing scheme from one or two other proposals. Consequently, it may be necessary to perform a run-off comparison between a Subset of the original possible schemes. This second level comparison can afford improved resolution only if the accuracy (and the complexity) of the remaining models is increased. If the re-comparison involves only a few models, the development of models describing the processes to the greatest possible extent may be justified. Again, GENDER is to be employed for solution procedure generation and interpretation. The GENDER list of the model selected as best should be retained for conversion (by hand) to a FORTRAN program. This program should be found to be quite useful as a comparison to actual plant performance. The model may even be of utility in establishing set joints for automatic control. It is realized that the use of GENDER as a design tool is limited by the lack of an optimization supervisor to the GENDER system. A

PAGE 148

136 program package performing constrained optimization would lend a higher degree of credibility to the model comparisons, particularly for the higher resolution models. Futher, it would improve the steady state performance predictions required to select optimally controller set points.

PAGE 149

CHAPTER VIII EXAMPLES In this chapter we shall consider the application of GENDER to two example problems; equilibrium flash and. a simple binary distillation. The equation set describing the behavior of a binary equilibrium flash operation is not dissimilar to the equation set pertaining to a distillation equilibrium stage. Consequently, it is possible to propose a single equation set sufficing, with minor modifications, for both examples. We shall adopt the convention that the tray numbers of a distillation column increase from bottom to top. The letter I will be employed to'represent .the tray number. Figure 13 illustrates the general distillation tray, for which the following equations have been prepared. (2) Kj^2V-\2 = (3) [exp (Z0^(32000) 2.30(7. 6))]/P K^ ^ = (4) [exp (Z2^(39000) + 2.30(8.3))]/P K^ 2 = (^) \lh ' \lh \lh Vl,l^I+l Vl,lVl = ' . (^) ^1,24 ' \2\ \2h h.l ^1-1,2^1 = « (7) L^+Vj-F, -L^,,-V^_^=0 («) ^1,1 ' \i -1 = (^) . ^1,1 "^1,2 1 = (10) h^^^Lj . H^^jVj hp^^Fj \^j^,^^^,^ H,^i_,V^_, Q = (12) "v,i V^i,i) V^^ ^i,i> ^1^1,1 ' ^2(^-^1,1))^ 137

PAGE 150

138 h+l'^I+l,l'^I+l,2'\,I+l ^I»^I,l»^I,2»"v,I ^P^I,P^I,2'^',I h'^I,l'^I,2»\,I » ^I-1'^I-1,1''^ 1-1,2 '^,1-1 Figure 13 An Equilibrium Stage.

PAGE 151

139 This equation set is adapted from the equations presented by Edie (1970) as an illustration of equilibrium flash. Two basic assumptions are implied by this equation set: (l) Raoult's law holds and (2) the pressure is constant throughout the column. For both of the examples, the twelve equations will be regarded as a processing unit. The encoding of the equations for the creation of a unit in SECEDE requires the assignment of code names to each of the variables and constants. Table 22 presents the code name/variable assignments, while Table 23 provides the analagous information for constants. To illustrate the preparation of the data required to establish the twelve equations describing a distillation tray as a unit in SECEDE, Figure 14 is provided. The formats for each of the input cards are given in the prefatory comment statements for the program SECIAO in Appendix A. With respect to the equation files, it must be recalled that the reverse Polish notation is employed. For example, equation 1 written in reverse Polish is Kl,lXl,l * Yi^i = Note that in the reverse Polish notation, all operators appear explicitly. GENDER has been programmed to "assure" the = terms for equations in which an explicit equality is not declared. Thus, equation 1 is encoded for SECEDE as if it were simply Kl,lXl,l * Yi^i In Figure 14, the cards terminating files contain messages indicating their specific function. This is in contradiction with the SECIAO requirement for concluding files with a blank card. The comments were included in Figure 14 for clarity and must not actually appear in the

PAGE 152

140 TABLE 22 The Code Name /Variable Assignments for a Distillation Tray Code Name

PAGE 153

141 TABLE 23 The Constant/Code Name Assignments for a Distillation Tray Code Name Constant 1 0.120 2 32000. 3 2.30 4 7.6 5 39000. 6 8.3 7 1.0 8 2.0

PAGE 154

145

PAGE 156

1 12

PAGE 157

145

PAGE 158

145 1 271

PAGE 159

147 data prepared for SECIAO. VIII. 1. A Simple Analysis Strategy Both of the example problems share a common, simple analysis strategy. This strategy consists of the following steps: 1. Call HASSAL to perform output set assignment 2. Call SPEDUP to precedence order the acyclic equations and to collect the cyclic equations into groups 3. Call BEMOAN to select the tear variables for a cyclic group and to perform precedence ordering within a cyclic group 4. Repeat from step 2 if any cyclic groups remain unanalyzed The analysis strategy is implemented in the main program prepared by the user. In addition to the analysis strategy, the main program must also perform the administrative duties of preparing memory for allocation (via COIN), creating the information block and creating SECEDE (via SECIAO). The data required by COIN is contained in Figure 15. The LEND's selected for these example problems specify all data fields, except those for the seven part indices, to be whole words each. The example problems are sufficiently small to make memory conservation tactics unnecessary for the IBM-370/165. The whole word data items have the distinct advantage of rendering an allocatable core map (i.e. JCCORE) readable. The values of the information block components reflect the use of whole word data fields. These values are presented in Table 24. VIII. 2. Equilibrium Flash An equilibrium flash is essentially a distillation tray for which the Li+i and Vi_i are both zero. This situation is depicted in Figure 16. There are at least two acceptible ways of adapting the 12 equations

PAGE 160

148 32 A 19 1 2 1 2 2 99 3 A 1 1 1 1 1 1 1 3 1 2 5« 22 1 2 3 5 8 1 11 15 1 1 1 1 1 1 1 11 12 13 14 15 5 14 1 2 I 3 1 2 3 4 5 6 . 7 8 9 2 7 1 2 3 4 5 6 7 4000, 32 2

PAGE 161

149 TABLE 24 Values for Information Block Components Component

PAGE 162

150

PAGE 163

describing a distillation tray to the equilibrium flash problem. One method is suggested by the nature of the data required by SEGLAO for establishing SECEDE, Each constituent of an equation (whether it be a variable, an operator or a constant) appears on a separate card. That is to say, an equation is constructed in SECEDE by supplying SECIAO with an ordered sequence of cards, each of which represents a component of the equation. Consequently, it is possible to remove cards to effect the elimination of the variables pertaining to the (l+l) and (I-l) stages. Care must be exercised in editing the equation, set by the simple expedient of removing cards, to avoid the introduction of syntac errors by failing to eliminate the variables associated with the eliminated variables. Aside from the physical editing of the equation set, another alternative is available. If the variables pertaining to stages I+l and i-l could somehow be declared to be decision variables, and if the values of Li+i and Vi_l could somehow be declared to be zero, then the transformation of the distillation tray equation set into the equilibrium flash equation set would be accomplished. If it is desired, the decision variable file and the variable value file supplied as data to SECIAO may be ammended to achieve the above declarations. This procedure, as was the case for the method of the preceding paragraph, entails the alteration of the SECIAO data. If the alteration of the SECIAO data is to be avoided, while still accomplishing the task of declaring the variables Lj^-^ and Vt •, to be decisions valued at zero, recourse to a small amount of programming will be necessary. The program VARIAO must be employed to set the values for Ll+l and Vl_i at zero. This task may be installed in the main program at any point prior to interpretation (or any other use for variable

PAGE 164

; 152 values, such as sensitlvit>analysis). It is suggested that VARIAO precede the use of LINKED. The task of declaring the I+l and I-l stage variables to be decisions must be completed prior -to initiation of equation set analysis. In other words, the declaration must precede the use of HASSAL. Although programs whose names begin with J are not normally recommended for direct user call, the program J2TADV may be employed to obtain de• cision variable list entries for the variables of stages I+l and I-l. These entries, when linked together and installed on the group decision variable list, establish the variables of stages I+l and I-l as decision variables. The modification of the decision variable list is best accomplished immediately after geneation of the crude GENDER list by CUDGEL. If J2TADV and VARIAO are to be employed to effect the tailoring of the distillation tray equations to equilibrium flash, the input data for SECEDE is shown in Figure 17. The symbol TRAY represents the inclusion of the unit data contained in Figure 14. The data required by VARIAO is presented in Figure 18. Should the reader desire to run this problem, using the data from Figures 14, 17 and 18, a comparison of the results obtained may be made with Appendix C. The machine listing presented in Appendix C was created from the GENIAO card output. Since this card output is consistent with the input format expected by GENIAO, the input format described in the prefatory comment cards for GENIAO (Appendix A) should be employed as the key for deciphering Appendix C. The declaration of decision variables without revising the SECIAO data may be extended to other decision variables. For example, the elimination of the I+l and I-l stage variables leaves 16 variables in a

PAGE 165

153 I 125

PAGE 166

154 1 105 +O.0E+0O 1 109 . . -Q -. .__ +0,0E+00 END OF V^lRlABLE VALUE LIST Figure 18 Data for VARIAO

PAGE 167

155 problem involving only 12 equations. Obviously, four of the remaining variables must be decisions. The inclusion of the four decision variables on the decision variable list follows exactly the procedure for the I+l and I-l stage variables. However, unlike L-^., and V__^ , the values for the decision variables supplied to VARIAO via data will in general be unequal to zero. Edie (1970) selected Y ,, P-,, V and F to be the four decision variables reducing the problem to a 12 variable/12 equation problem. Note that the user selection of decision variables is not necessary. HASSAL effects decision variable selection by regarding as decisions all variables remaining unassigned at the conclusion of the Hungarian algorithm. Weighting the variable /equation incidences can force HASSAL to select Y ^, P^ , V and F to be the decisions. In fact, the output assignments selected by Edie (1970) can be duplicated by HASSAL with the prdper weights (based on the maximum product criteria). In retrospect, the key feature presented in this section have been (1) the modification of a general problem formulation to a specific problem and (2) a procedure for the declaration of user selected decision variables, with particular emphasis on procedures for effecting the necessary alterations without recourse to revisions of the SECIAO data. Great importance has been placed on general problem formulations and maintaining the integrity of SECIAO data primarily because the preparation and modification of SECIAO data are tedious operations. A library of general formulations for common processing units prepared as SECIAO data should prove invaluable to the design engineer. VIII. 3. Binary Distillation Figure 19 depicts a three tray distillation column employing a reboiler and a total condenser. The trays have been diagrammed separately

PAGE 168

(unit 1) Figure 19 Simple Distillation Column.

PAGE 169

giving the column a disjointed representation. This has been done to emphasize the designation of each tray as a separate unit. The primary purpose of this example is to illustrate the SECEDE provisions for assembling a collection of units into a processing scheme. Units 1 through 4 are designated as the reboiler and the three trays respectively. Unit 5 represents the partitioning of the overhead vapor into a product and a recycle stream. The equations associated with total condensation are (13) \^-\^^ = (14) Xj,i + X^,2 1 = (15) Lj + D Vj_^ = (16) L^/D R = ; (^«) \i-i-Vi-2 = o The variables R and D represent the recycle ratio and the distillate product flow rate. Two steps are required to declare commonality between variables of several units. First, a common variable value storage location must be reserved in unit 0. This is accomplished with the variable declaration file for unit 0. Second, the code name of the unit variable must be installed in the declaration file entry for each of the unit variables for which commonality is to be established. The second step is accomplished via the variable declaration files for the affected units. The use of the variable declaration files to provide the connections between processing units is illustrated by Figure 20. Figure 20 is the SECIAO data required to establish SECEDE for the three tray distillation column. The variable declaration file appears explicitly in Figure 20 for all units. The remaining files for units 1 through 4

PAGE 170

158 2 3 4 5 6 7 3 9 ^ 10 11 12 13 109 no 111 112 6N0 OF DEClSlOfi VARIABLE FILE / START OF TEAR VARIABLE FILE END OF TEAR VARIABLE FILE / START OF OPERATOR NAME FILE UMARY 1 COMP 2 SIN 3 COS 4 TAN 5 ARCSIN 6 ARCCOS 7 ARCTAN 8 ALOG 9 EXP 10 RECIP :-.--11 -: SQRT -12 SQUARE BINARY 101 = . 102 103 ; / 104 •• OTHER 201 *H 202 »N END GF OPERATOR NAME FILE / START OF METHOD NA.VE FILE END OF METHOD NAME FILE 7 START OF UNIT 47 1 2 3 4 ^ 5 6 7 8 9 10 11 12 13 14 . 15 16 17 18 19 20 Figure 20 SECIAO Data for Simple Distillation Column.

PAGE 171

169 1 21

PAGE 172

160

PAGE 173

161

PAGE 174

162

PAGE 175

163

PAGE 176

164 are indicated by the symbol TRAY. These files for units 1 through 4 are identical to the files presented in Figure 14. Note that unit represents the reboiler, for which the V , , Y ^ and H ^ variables are meaningless. These variables should be eliminated from consideration prior to the algorithmic analysis phase according to the instructions of the proceeding section. As a specific example of commonality, let us consider the variable L^. This particular variable appears in both units 1 and 2. Let us assign the code name 1 to the unit variable we shall employ for the variable L„. An inspection of the variable declaration file for unit 1 reveals a common variable declaration of 1 for the variable L^ , . Similarly, the variable L for unit 2 also carries 1 as the common variable declaration. Consequently, L , for 1=1 and L, for 1=2 share a common value location (with the code name 1) in unit 0. Should the reader wish to run this problem, the fully analyzed GENDER list may be compared with the machine listing in Appendix D. The SECIAO data for the distillation problem may be extracted from Figures 14 and 20. It is recommended that a single copy of the Figure 14 data be prepared and tested with SECIAO. Once the bugs, if any, have been removed, this, card deck should be employed as the master for generating the three additional copies required on a duplicating card punch. When collated with the data prepared from Figure 20, the unit data decks will be integrated into a processing problem. Appendix D, following the example of Appendix C, is the machine listing generated from the GENIAO card output.

PAGE 177

CHAPTER IX CONCLUSION The GENDER System has been developed to assist the design engineer with large scale design problems. This initial version of GENDER, however, is not completely suitable for a production system. Modifications and additions to GENDER have already been planned (l) to improve convenience aspects and (2) to include additional analysis algorithms. IX. 1. Convenience Aspects Let us consider the contact of the design engineer with GENDER. To employ GENDER, an engineer must encode the equation set in the format expected by SECIAO. Further, the output of SECEDE via SECIAO produces code. Similar considerations apply to GENIAO and the GENDER list. The coded input/output is a usable medium for communication with GENDER, but is not a convenient medium. GENDER would be simpler to use, if the input/ output language was already familiar to the design engineer. The adaptation of algebraic equations for the input/output medium is contemplated, perhaps ultimately resembling the input/output language developed by Soylemez (1971). Another aspect of the engineer/GENDER interface involves the user prepared main program. In the current version of GENDER, a main program directs the solution procedure development. This program must be devised to properly react to error conditions recognized as a consequence of analysis or perhaps even interpretation. It is most probable that many of the preconceived error conditions would never be realized for a particular design problem. Thus, the effort of developing a complex error 165

PAGE 178

166 recovery mechanism is somewhat wasted. So far we have been describing the utilization of GENDER in the batch mode. Let us now consider a real time interactive environment. The responsibility for creating the main program would be relieved from the user entirely. Instead the user would employ a console to direct GENDER in performing an analysis strategy. The user need not consider alternative strategies until an error condition has been detected. If a recovery procedure cannot be immediately conceived, the user may temporarily leave the system after employing GENIAO and SECIAO to output the GENDER list and SECEDE. Analysis may be resumed whenever a corrective course of action has been charted. Further, the interactive environment facilitates monitoring either the development or the interpretation of a solution procedure at the discretion of the user. Optimization is an essential factor in design. GENDER has been developed to permit convenient constrained optimization. For the present, the search for optimality has been left to the user. The development of an optimization supervisor to the GENDER System has been proposed. The theoretical foundation for the optimization program has already been established by DeBrosse (1971). The existence of this program should relieve the design engineer of a considerable burden. IX. 2. Additional Algorithms In Chapter VII, we noted that the algorithms provided with GENDER allow only a single analysis strategy. Albeit a realistic strategy, one cannot expect it to suffice in all instances. Several algorithms have been proposed for inclusion in the analysis repertoire. In section V.l. it was pointed out that the weights employed by HASSAL in performing output set assignment could be derrived from a sensitivity analysis. The resulting output set assignment would thus be rapidly

PAGE 179

167 convergent (Edie and Westerberg, 1971). The use of HASSAL to obtain output set assignments enhancing the convergence of a solution procedure is expected to, be relatively simple to implement. However, there is an inherent disadvantage. HASSAL makes no attempt to differentiate between the convergence properties of every output set assignment. An algorithm developed by Edie (1970), based on the creation of a dynamic programming network, selects the best output set from the standpoint of convergence and singularity of the resulting Jacobian. Once implemented, this algorithm should be regarded as something of a last resort since the extensive network manipulations are expected to entail high execution times. The influence of the output set assignment extends beyond the convergence properties of a solution procedure. For a particular design problem, the output set determines the minimum number of tear variables. The. criterion for output set assignment may be arbitrary weights, user preference or sensitivities. Let us consider minimum tear as the criterion for output set selection. With this criterion, the output set selected would be the set for which the minimum number of tear variables would bei the minimum over all possible output sets. The adaptation of this criterion to an algorithm performing both output set and minimum tear selections has been accomplished by Christensen (1970). As in all cases where an improvement in the results of an optimization is expected, the Christensen algorithm is more complex than BEMOAN. In fact, it is vastly more complex. Consequently, a user must cautiously weigh the advantages of perhaps reducing the number of tear variables against the increased execution time over BEMOAN. The algorithms discussed in the proceeding paragraphs already exist in the literature, there remaining only the adaptation to GENDER. Another

PAGE 180

168 algorithm currently being devised focuses on the compaction of GENDER lists via indexing considerations. These considerations parallel the simplification of FORTRAN programs by employing DO statements. As one might suspect, pattern recognition plays a key role in the identification . of indexed GENDER list components in a repeating sequence. Considerable simplification to the GENDER list and to the SIM's is anticipated for all staged and discretized unit processes, such as distillation and absorption. IX. 3. A Final Note on GENDER The current version of GENDER is heavily diagnostic. That is, many more tests, with provisions for diagnostic messages, are performed than are essential to the task of solution procedure manipulation. These tests must be removed before GENDER can begin to assume the configuration of a production system. The tests were originally devised as debugging conveniences. However, by retaining the myriad tests, GENDER affords the research engineer with a convenient medium for developing and testing analysis algorithms, and for studying the influence of analysis strategies on solution procedures.

PAGE 181

APPENDICES

PAGE 182

APPENDIX A

PAGE 183

171 c* •••••»«...«•••»..».••••». ..•••.. ••• • c •••.»• C • GENDER • C • GENERAL • C • INFORMATION • c ....»•• c C SPECIAL INSTRUCTIONS/JOB STEPS C A USER PREPARED MAIN PROGRAM MUST C 1. CALL COIN C 2. ESTABLISH INFORMATION BLOCK C 3. CALL SECIAO C A. CALL GENIAO (OPTIONAL! C 5. EXECUTE ANALYSIS STRATEGY C 6. OUTPUT RESULTS C C SPECIAL INSTRUCTIONS/DEFAULT OPTIONS C THE PROGRAM DFAULT IS PROVIDED TO CREATE THE DATA C STRUCTURES REOUIRcD FOR ANALYSIS AUTOMATICALLY. THE USER C MAY, IF DESIRED, OMIT SIM GENERATION, CRUDE. GENDER LIST C GENERATION AND OTHER PROCEDURES FROM THE USER PREPARED C MAIN PROGRAM. c C CURRENT STATUS C OPERATIONAL, EXCEPT THE INTERPRETER. THE INTERPRETER C IS CURRENTLY IN THE CODE/DEBUG STAGE.

PAGE 184

172 C c«^«» »••• ••..••••••••.•»•••• •.»...•». ••...• C • CFAULT « C • • C PURPOSE C OFAUUT PROVIDES DEFAULT OPTIONS FOR THE GENDER SYSTEM. C C USAGE C CALL DFAULTUCGRUP,JCASIM,JCMOOE,jCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCGRUP = THE ADDRESS OF A GENDER GROUP C JCASIM = THE ADDRESS OF A SIM INFORMATION BLOCK C JCMOOE = AN INTcGfiR HAVING THE FOLLOWING VALUES AND MEANING C = ALL OPTIONS C 1 = PROVIDE GROUP IF JCGRUP = C 2 = OPTION 1 AND PROVIDE SIM IF JCASIH = C 3 = OPTIONS I THROUGH 2 AND PROVIDE OUTPUT SET C IF THE SIM HAS AT LEAST ONE UNASSIGNED ROW C JCCLNO = A USER ASSIGNED CALL STATEMENT PARAMETER C C REMARKS C THE INTEGER I IN THE NAMED COMMON STATEMENT MUST, FOR C SOME MACIHINES, BE REPLACE BY THE VALUE OF JCTCIA. C MORE DEFAULT OPTIONS WILL BE ADDED AS THEY ARE DEVELOPED. C C SUBROUTINE AND FUNCTION SU6P0RGRAMS REQUIRED C CUDGEL C FIND C FRMCEL C HASSAL C J70SUP C SIMGEN C SYSENT C SYSEXT C TOCELL C C ERROR COOES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C C c ••••>«••• SUBROUTINE CFAULT < JCGRUP* JCASIH, JCMODE, JCCLNO) COMHON/ALLOC/JCCOREI 1) DIMENSION S(A),R12),D{1), 0(4) INTEGER S,R.D,0 DATA S/1.8,l.l/,R/1.0/,0/l,13tlf 1/ C ENTER CALL SYSENTd, 6, 1,1, JCCLNO) C MA=ADCRESS OF SPUR FOR GENDER GROUP Ml=JCC0RE(l6)»l . H2=JCC0RE(I7)ta MA=jCC0RE(Kl)*5»JCC0RE«M2)-5 C CRUDE GENDER LIST IF(JCGRUP.EQ.O)CALL CUDGEL (0, JCGRUP, H

PAGE 185

173 IFCJCHODE.EQaiGO TO 99 C SIM CALL FRHCEL(JCCORE(HA),JCGRUPtJCASIH,S,l» IF(JCASIM.EC.O)CALL SIHGEN{ JCGRUP, JCASIM, 1, I) CALL TOCELL(JCCORE(HA), JCGRUP, JCAS1H,S,U IF«JCM00E.EQ.2»G0 TO 99 C MB=ADORESS OF SPUR FOR ORDINATE Ml=JCASIMt2 MB>»JCC0RE(MU-5 C HC^AOORESS OF LOAD FOR ROW HC3j70SU?UCASIH.l,OtO,l) M0=MC»7 C OUTPUT SET ASSIGNMENT R{2)»l-JCC0RE(MD) Ml=l 0(1)=0 CALL FIND(JCC0RE(MB),R,D,0,R,JCC0RE(MC).H1,1) IF( Ml. NE.O) CALL HASSALI JCGRUP, JCASlMtl) IF(JCM00E.EC.3)C0 TO 99 C MORE DEFAULT OPTIONS TO BE ADDED LATER C EXIT 99 CALL SYSEXT RETURN END

PAGE 186

.174 C c«>«»«*«»*****««*«>**«*>« .».».•...•.».» ..».••# ••• c .•»... •••• C • USRPAC • C • GENERAL • C • INFORMATION • C .••••.».•.•»••» c C SPECIAL INSTRUCTIONS/DATA TYPES C LIST TYPES I (SECEDE) AND 2 (GENDER LIST) MUST BE FORHAROC BACKWARD. C C SPECIAL INSTRUCTIONS/LEND C THE FOLLOWING DATA STRUCTURES MUST BE PERMITTED BY THE C LENDS. C SECEDE LIST TYPE 1 C SEE LEND REQUIREMENTS FOR REMOTE. C (1, 5 TYPE FLAG, 7 SELECTION COST, 8 CODE NAME, C 19 DIMENSIONALITY) C (I, 5TYPE FLAG, 16 CODE NAME, 16 ORDER OF C OPERATOR) C GENDER LIST LIST TYPE 2 C SEE LEND REQUIREMENTS FOR NETPAC (IN SUPPAC). C DATA TYPE 6 MUST HAVE A LEND OF (1,0,1,0). C (I, 2. 3, 3 TYPE FLAG, ^,4, 4 WORKING SPACE, 5, 5, C 5, 7 POINTER, 7 POINTER, 7 POINTER, 7 C DEPTH, 8 POINTER, 3 POINTER, 8 POINTER, 8 C METHOD CODE) C (If 2, 3, 3 TYPE FLAG, 4, 4, 4 WORKING SPACE, 5, 5, C 5, 16 POINTER, 17 POINTER, 18 POINTER, 19 C DIMENSIONALITY, 20 NUMBER OF OUTPUTS) C (I, 2, 3, 21 CODE NAME, 22 DIMENSIONALITY) C (1, 3, 23 CONSTANT VALUE) ' c C SPECIAL INSTRUCTIONS/DEBUG C THE FOLLOWING TABLE GIVES THE PACKAGE AND PROGRAM ID. C NUMBERS FOR USRPAC. C PROGRAM PKG. ID./PROG. ID. C lOPAC C GENIAO l/l C SECIAO 1/2 C VARIAO 1/3 C JIARBS 1/4 C JICONS 1/5 C JIDECL 1/6 C JIOIMS 1/7 C JIFILE 1/8 C JIGMBL 1/9 C JILEOL 1/10 C JINAME 1/11 C JIRAFE 1/12 C JIRESO 1/13 C JIVALU 1/14 C JIVARI 1/15 C JIVTVF V 1/16 C INTERP C COVERT 2/1 C GLINT 2/2 C LINKED 2/3 C NUMBER 2/4 C JIFATV 2/5 C

PAGE 187

175 C CURRENT STATUS C lOPAC OPERATIONAL C INTERP COCe/DEBUG C c>««**«*>»**<«*« •••••«. c

PAGE 188

176 C c ...•«•• «..». » • .»« c •••• C • GENIAO • c • c C PURPOSE C GENIAO HANDLES THE INPUT ANO OUTPUT OF THE DATA DESCRIBING C A GENDER LIST. C C USAGE C CALL GENIAO(JCSENS,JCCLNO) C C DATA FORMAT C THE SYMBOLS , AND $ ARE USED TO DELIMIT LOOPS. B C INDICATES A BLANK CARD. THE SYMBOLS *H* 00 NOT APPEAR ON C THE CARDS READ, BUT ARE USED HERE TO INDICATE A CARD TYPE C NUMBER, N, WHICH CORRESPONDS TO THE FOLLOWING DATA FORMATS. C CARD TYPE FORMAT C 1 11,119,3120 C 2 15,120,215,120.15,120 C 3 11,119,2120 C 4 11,119,120 C 5 4120 C C +ILEVEL 0) C IGROUPS) C +1, IDENTIFICATION FLAG (=0), PROTECTION FLAG, OEPTHt C METHOD CODE •!• C * C ^ INDICES •2» (MIN. AND MAX.) C $ C (DECISION VARIABLE LIST) C C + 1, VARIABLE CODE NAME, DIMENSIOMALI TY, SELECTION FLAG C 'S* c C INDICES •2» (MIN. ANO MAX.) C *» c a C (TEAR VARIABLE LIST) c '*.-. . C 1» VARIABLE CODE NAME, DIMENSIONALITY, SELECTION FLAG C •i* C C INDICES -Z* (MIN. AND MAX.) C $$ C B c . $ C +8 C < LINKAGE) C C I, NUMBER OF PATHS OUT OF A NODE (FORWARD), SEQUENCE C NUMBER OF LEADING NODE ">• C C SEQUENCE NUMBERS OF TRAILING NODES 'S* C $$ C +8 . C (LEVEL 1 REPEATED FOR ADDITIONAL LEVELS) C (GROUP BODY ENTRIES MAY BE A GROUP AS IN LEVEL 0) C C 1, IDENTIFICATION FLAG (1 ER, 2 EVALUATED ER, 3

PAGE 189

177 C EUUATION, 4 SOLvEO EQUATIONt 5 EVALUATED EQUATION, 6 C CONSTRAINT, 7 SOLVEO CONSTRAINT, 8 EVALUATED C CONSTRAINT), CODE NAME, OIMESNIONALI TY, NUMBER OF C OUTPUTS »i» -OR1, IDENTIFICATION FLAG (9 METHOD C . INSERT), NUMBER OF ENTRIES •4» C C INDICES COMIT FOR ID. FLAG 9» 'Z* (HIN. AND MAX.) C $ C (OUTPUT VARIABLE LIST OMIT FOR ID, FLAG 9) c ! C +1, VARIABLE CODE NAME, DIMENSIONALITY, SELECTION FLAG C O* c C INDICES •2» C $» C B C (LINK EDITOR LIST OMIT FOR ID. FLAG 9) C C ;1, IDENTIFICATION FLAG 10 OPERATOR, 1 VARIABLE, 2 C CONSTANT, 3 OUTPUT VARIABLE, 4 EQUATION VALUE), C CODE NAME, DIMENSIONALITY (ORDER OF OPERATOR) "l* C C INDICES "a* c $$ C B , C +8 C (LINKAGE) C C l|, NUMBER OF PATHS OUT OF A NODE (FORWARD), SEQUENCE C NUMBER OF LEADING NODE •-!»• c C SEQUENCE NUMBERS OF TRAILING NODES S* c *%s c *a c $ . i C B C B : C C DESCRIPTION OF PARAMETERS C SEE SECIAO C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C NOTE THAT TWO BLANK CARDS IN ADDITION TO THE BLANK C TERMINATING THE LAST LINKAGE INPUT ARE REQUIRED TO C . TERMINATE GENDER INPUT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C CORN C COUPLE C FETCH C FRMCEL . C JIDIMS C JIFILE C JIGMBL C JltEOL C JIVARI C JIVTVF C LNKBNT C LNKFWO C NEHCEL

PAGE 190

178 C NEXT C POPUP C PUSH C STORE C SYSENT C SYSERR C SYSEXT C TOCELL . C." . C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERROR(OATA PROVIDED) C 1 NF NO GIM8L (JCC0REtl6)) C 2 NF NO GENDER LIST ( JCCOREIJCCORE C16) I ) C 3 NF NO ENTRIES FOR LEVEL (LEVEL) C C METHOD C SELF-EXPLANATORY C c . ••••••••«• c SUBROUTINE GENI A0( JCSENS* JCCLNO) COMMCN/ALLOC/JCCORE( 1) DIMENSION S(5),C(5),0I8),L(5),F(2),Z(30),G{13),B(19),U(10),H(4), IK(7),P14),V(7),H(4),E{4),N('V),Y(4),A(4),0(4),X(4),T{30),M(7) INTEGER SfC,C,F,Z,G,BtU.P.V.H,£,Y,A,Q,X,T,SAVEfH DATA S/0f0,1.0,2/,C/0,0,li0.l/f0(l)/l/,L/3il,l,lf0/fF/l,2/,Z(15) 1 /-l/,Z{29)/0/,Z(30)/18/,G/4,3,l,2,7,4,A,8,4,A,7,2,3/,B/6,3,l»2, 2 17.1,ltl9,l,l,20,l,l,I8,lf ltl6,ltl/tU/3.3,1.2.17.1,l,16,I,l/,H/l> 3 6,0>0/,K/2,2l.l.l,22,l.I/>P/l,l.I,l/.V/2,5,2.2.2>l.l/.H/1.7,l,l/. ^ E/I,I.lf2/,N/l,A,3,3/,y/l,l,2,2/,A/l,21,l,l/,Q/l,3,ltI/t 5 X/l,4,l»l/,T(15)/-l/,T«29)/0/,T«30)/18/tW/2,5,l,l,lfl,l/ C ENTER CALL SYSENT«l,5,l,l,JCCLN0) SAVE=JCC0RE(18) C IN OR OUT IF(JCSENS.LT,1)G0 TO I C SET UP GIMBL CALL J1GHBL(HA,MB,MC,1) GO TO 2 C NA^AOORESS OF GIHBL 1 MA=JCC0RE(16) M1 = HA M2»l IF(HA.LE.0)G0 TO 41 C MB=ADCRESS OF SPUR BLOCK Ml=MA*l MB=JCCORE(MI) C MC=MAXIMUH CORE BLOCK SERVICIBLE WITH THE SPUR BLOCK Ml=JCC0RE(I7)*8 MC=JCC0RE(H1) Hl=Hl*l M2=JCC0RE(Ml) Ml=Ml+5 M2 = M2«-JCC0RE(Ml) IFJK2.GT.HC)KC=H2 IF(10.GT.MC)«C=10 C MO=ADORESS OF SPUR FOR GROUP 2 Hl=JCC0RE(17)+3 M0=M8+5»(JCC0RE(Ml)-l) C HE^ADORESS OF SPUR FOR GROUP BODY ENTRY (NO INDICES) Ml-Ml+l ME=HB*5»(JCC0RE
PAGE 191

179 C MF=AODRESS OF SPUR FOR OLD VALUE UPDATE INSERT HF=H8»5»CJCC0RE(HU-l) C MG=ADCRESS OF SPUR FOR METHOD INSERT MG»HB»5»(JCC0RE(U-ll C S(4) Hl=Hl-2 S14)=JCC0RE(MI) C C(4) Ml=Ml-ll C(4l=JCC0RE(Ml) L(2)=l L(3)=l H5)=0 C IN OR OUT IFUCSENS.LT.DGO TO 16 C INPUT C MH=AOCRESS OF SPUR FOR LARGE CORE BLOCKS MH=KB-5 C HI=INPUT DATA SET H1=JCC0REJ10) C MJalNClCATOR MJ=1 C MKaMETHOO LIST HEAOCELL MKsQ C . MM=TEMPORARY LIST ENTRY Ml=Ml+8 M2=SU) S(*)=JCCORE(Hl) CALL NEHCEL(S,MM,1) S<4J=M2 C READ 3 REACJHI, 101X0(1), I'»l, 5) lOl FORMATdlf 119,3120) IF(D(1).EQ.0)G0 TO 10 C TYPE MI*C<2)+1 GO TO (4, 5,5, 5, 5, 5, 5, 5, 5, 7), HI C GROUP A CALL J1FIL6(C,L(MJ),MD,M1,M2,1,F,Z,1) MJ«3 H2=K2-1 IF(C(4).GT.0)CALL J10IHS(M2, 1, 2, 2, 1 , 1 ) D(2)=l 0(6)*0 D(?)=0 M2*0 CALL JlVARIIM2,0U),2,M2,l,l) Call jivari(h2,d(7),2,m2,i,2» call tccell(jcc0re(hd),m1,0(2),g,1) GO TO 3 C GROUP BODY 5 M1 = ME*-0(A)»10 CALL J1FILE(C,L(MJ),M1,M2,M3,1,F,Z,2) MJ=3 H3=M3-D(',)»2fl IF(C(4).CT.0)CALL J1DIMS(M3,0I A) ,2,2, 1,2) D{2)=C(2)-l 0(l)=2 0»6)=-0 0(7I*0

PAGE 192

180 CALL JIVARK JCSPUR.0(6),1,MK,1.3) CALL JILEDL(S,0(7J,HK, 1,0,1) CALL T0CELL(JCC0RE(H1),H2,D,&,2) GO TO 3 C INSERT METHOD 7 CALL JlFILE(C,L(HJ),HG,Hl,M2,l,F,Z,'i) HJ=3 CALL J1VTVF{MG,M1,D«3),1» GO TO 3 C LINKAGE INPUT 10 D(5)=0 0(6)=0 *1N=S(4) Hl=L(2) M2=3-M1 C READ LINKAGE (PART I) 11 REA0(MI,101)M3,H<^,L(3) IF(M3.EQ.0)G0 TO 15 C MODE H3=PM IF(L<3).LE.0)GO TO 12 L<5)=L(3)-Z(8) CALL FETCH 141 CALL TOCELL(JCC0RE(MO),MM,0(5),W,7) GO TO 11 C ITERATE 15 IF((0(1)+M3).EQ.0)G0 TO 40 S(4)=MN L(5)=0 L(3)'=l L(2)-H2 MJ^l GO TO 3 C OUTPUT C MH AND MI ARE OUTPUT DATA SETS 16 MH=JCCORE(ll)

PAGE 193

181 m=ilABS(JCSENS) C MJ AND HK ARE GROUP LIST HEADCELLS MJ»0 MK'O C HL=TAILCELL CORRESPONDING TO HJ ML«0 C HM=LEVEL HM»0 C FILE ENTRY FOR CIM8L D<2)=0 0(31=0 CALL ST0REIC,L,D«2),E,F,Z,1) C MN=FILE ENTRY NUMBER OF CURRENT PARENT MN=l C HO=PARtNT GROUP INDICATOR M0=0 C M M1=JCC0RE117)+13 M13)=JCC0RE(MI) M(4)=M(3» C PREPARE FOR TRACE Ml=JCCORE{MA) M2=2 1F(M1.LE.0)G0 TO 41 M2=NA*2 M2=JCC0RE(M2)+1 H3=0 H4=0 G(3»=2 B13)=2 U(3)=2 M5=Ml M6=-l C PREFACE WRITE(MH,103J 103 F0RHAT(115HITHE FOLLOWING TABLE GIVES THE VARIOUS OUTPUT FIELDS WH IICH MAY APPEAR AS OUTPUT. EACH LINE OF OUTPUT BEGINS WITH A) WRITE(MH,10^) 104 FORHATdlSH LETTER DESIGNATION. THIS LETTER CORRESPONDS TO OnE OF I THE ENTRIES IN THIS TABLE, THUS IDENTIFYING THE VARIOUS FIELDS) WRITE(MH,105) 105 FORHATOOH IN THE LINE OF GENDER OUTPUT.) WRITE(KH,106) , „^ 106 F0RKAT(60H A IDENTIFICATION FLAG, PROTECTION FLAG, DEPTH, METHOD ICODE) HRITt(HH,I07) . , , 107 F0RHATJ107H B MAPPING FLAG, MAPPING INDEX, OPERATOR FLAG, SCALE S IIGN FLAG, SCALE, OFFSET SIGN FLAG, OFFSET (OR INDEX)) HRITE(MH,108) 108 F0RMAT(54H C VARIABLE CODE NAME, DIMENSIONALITY, SELECTION FLAG) WRITE
PAGE 194

182 WR!Te(HH,113) 113 F0RNAT(73H H NUMBER OF PATHS OUT OF A NODE (FORWARD) i SEQUENCE NU IMBER CF NODE
PAGE 195

183 CALL JlVARI(0,D<7),2,0,JCSENSf 5) IF(JCSENS.LT.0iHRITHtHI,119) TEMPORARY GROUP LIST D(5)=Ml 0<7)=NQ CALL PUSH(SiML,CC6),K,2,2) IF(MJ.EQ.O)MJ=HL GO TO 26 ER, ECUATION OR CONSTRAINT 22 CALL FRfCEL(JCC0RE«ME),Ml,0(2!,8,4) Ot2)=D«2»*l WRtTE(HH,12l)(D( n,I = 2,5) 121 FORMAT{AH 4129) IF 123 F0RKATH9H (LINK ECITOR LISTJ) JCC0Re(l3)=6 CALL JlLE0L(0,0(7),0,JCSENS,0i3) IF(JCSENS.LT.0)WRITE(Hi,119) GO TO 26 INSERT 24 CALL FRHCEL(JCC0RE{MG),Ml,0(2)iU,5) 0(2)=.D(2)+8 METHOD 25 CALL FRHCEL(JCC0RE(HG),M1,0(3),M,7) HRirE(HH,l25){0(I),I=2.3) 125 FCRr^AT(4H G 2129) IF(JCSENS.LT.0)WRITE(MI,l01)(D(l)iI»1.3) JCC0RE(13)=6 CALL JlFILE(C,L{4),MF,Ml,M5tO,FfZt8) STORE LINEAR SEQUENCE NUMBER 26 CALL TCC£LL(JCC0RE(MD),M1,MP,N,8) ITERATE M5=H1 M6=-l GO TO 16 NEXT PARENT GROUP 27 IF(HO.EQ.O)GO TO 29 IF{^•K.EQ.O)GO TO 30 MO=NO+l MP=MP*1 HN=MP L(5)=l 28 CALL P0PUP{Sf.HK,HK,DI6),K,l,2) CALL JIFILE(C.L(4),MD,-D(7),M5,0,F,Z,9) CALL FRMCEL(JCC0RE(H0).0(6)fM2iX,8) M5=D(6) «6=HM-1 IFIHO.EC.DGO TO 17 . GO TO 18 LINKAGE OUTPUT PART I 29 «0=2 30 L(5)=1-ZI8)

PAGE 196

184 IF(JCS6NS.LT.0)WRITE(MI,H9) WRITE(MH,126»MM 126 F0RHAT(19H LINKAGE FOR LEVEL 12) JCCCRE{13)=6 . M5=0 M6=0 31 M5 = ."5*l IF(M5.GT.HPJC0 TO 37 CALL FETCH(C»L('» ). 0(3) fE.F.Z, 0,5) L(5)=0 CALL ST0RE(CrL(A),L(5),Y,F,Z,3) IF«0(3).LE.0)G0 TO 32 Kb=fb*l Dt3)=«M6 32 IF(CC4).EQ.0)G0 TO 36 0(2)=0 33 N7=0(A) 0{2)=D(2)+1 D(*)=LNKFWO(StM7,3) IF(DWRITE(MI,l01)J0(n,I = l,3) JCC0R£(13)=6 C LINKAGE OUTPUT PART II S't M8=2 35 M3=^"8^l CALL P0PUPlSfM7,M7,0(M8),A,2i3) IF(((H8-6)»(D(2)*-2-Ma) ).NE.O)GO TO 35 0(2)=D(2)-H8*2 WRITElHH,12a)
PAGE 197

185 GO TO 42 ERROR 41 CALL SYSERR
PAGE 198

186 C c>««»«» • • ••»• ••• c C • SECIAO • c ..«»..•••* c C PURPOSE C SECEDE HANDLES THE INPUT AND OUTPUT OF THE DATA ASSOCIATEO C WITH THE SERVICE MOUULE. C . C USAGE C CALL SECIAOlJCSENSiJCCLNO) C C DATA FORMAT . C THE SYMBOLS , AND $ ARE USED TO DELIMIT LOOPS. B C INDICATES A BLANK CARD. THE SYMBOLS *N» 00 NOT APPEAR ON C THE CARDS READ, BUT ARE USED HERE TO INDICATE A CARD TYPE C NUMBER, N, WHICH CORRESPONDS TO THE FOLLOWING DATA FORMATS. C CARD TYPE FORMAT C 1 11,119,120 C 2 4120 C 3 II, 119, SKIP 14, A6 C 4 11,119 C 5 11,119,120,040.28 C 6 11,119,3120 C 7 I1,I19,'2I20 C 8 11,119,0^0.28 C 9 11,119,11,119,120 C 10 15,120,215,120,15,120 C THE DATA ORGANIZATION FOLLOWS, WITH COMMENTS ENCLOSED IN C PARENTHESIS. C (DECISION VARIABLE FILE) c C +1, DECISION VARIABLE CODE NAME, DIMENSIONALITY -l* C C INDICES "HO* IMIN. AND MAX.) c «$ C B C (TORN VARIABLE FILE) C C +1, TORN VARIABLE CODE NAME, DIMENSIONALITY •!• C C + INDICES •10» (MIN. AND MAX.) C $% C B C (OPERATOR NAME FILE) C C I, OPERATOR CODE NAME, OPERATOR ALPHAMERIC MHE •3» CI C B C (METHOD NAME FILE) C C I, METHOD CODE NAME, METHOD ALPHAMERIC NAME 'S* C $ C B C (UNIT CONNECTIONS) C C +1, NUMBER OF COMMON VARIABLES •4» C (COMMON VARIABLE OECl'AKATION FILE) C C I, COMMON VARIABLE CODE NAME, DIMENSIONALITY 'l* C

PAGE 199

187 C MAXIMUM INDICES 'Z* C $$ C +6 C +tCOMM0N VARIABLE VALUE FILE) C C It VARIABLE CODE NAME, DIMENSIONALITY, VALUE 'S* C C INDICES »2» C $$ C *B C XCOMHON VARIABLE NAME FILE) C C «« 1, COMMON VARIABLE CODE NAME, COMMON VARIABLE ALPHAMERIC C NAME •a* C $$ C B C CUNIT REPEAT AS NECESSARY) C C I, NUMBER OF VARIABLES, NUMBER OF ER'S, NUMBER OF C EQUATIONS, NUMBER OF CONSTRAINTS •6» C +(VARIABLE DECLARATION FILE) C C 1, VARIABLE CODE NAME, COMMON VARIABLE CODE NAME, C DIMENSIONALITY s?* C C MAXIMUM INDICES 'Z* C »$ C +8 C (ER DECLARATION FILE) C C 1, ER CODE NAME, DIMENSIONALITY «1* C C MAXIMUM INDICES "Z* C $$ c a C (EQUATION DECLARATION FILE) C C If EQUATION CODE NAME, DIMENSIONALITY •!• C C *** MAXIMUM INDICES 'Z* C $$ C +8 C (CONSTRAINT DECLARATION FILE) C C I, CONSTRAINT CODE NAME, DIMENSIONALITY »l» C C MAXIMUM INDICES *Z» C $$ C +8 C (CONSTANT VALUE FILE) C C 1, CONSTANT CODE NAME, VALUE sS* C » C B C (VARIABLE VALUE FILE) C C 1, VARIABLE CODE NAME, DIMENSIONALITY, VALUE 'S* C C INDICES •2» ' C $$ C +8 C (ER NAME FILE)

PAGE 200

188 C C I, ER CODE NAMEt ER ALPHAMERIC NAME •3» C $ C (VARIABLE NAME FILE) C C It VARIABLE CODE NAME, VARIABLE ALPHAMERIC NAME •S* C $ C +8 C tER FILE) c »•.•• ^ C * 1, ER CODE NAME, NUMBER OF OUTPUTS, DIMENSIONALITY "T* C C INDICES 'lO* (MIN. AND MAX.) C « C C • It CODE NAME, IDENTIFICATION FLAG, COST JOROER OF C OPERATOR), DIMENSIONALITY •S* C C INDICES "lO* C $* C B C « C +8 C (EQUATION FILE) C C I, EQUATION CODE NAME, NUMBER OF OUTPUTS, DIMENSIONALITY C .T* C C * INDICES •lO* (MIN. AND MAX.) C » C C 1, CODE NAME, IDENTIFICATION FLAG, COST (ORDER OF C OPERATOR), DIMENSIONALITY »9» C C * INDICES "lO" C »» C B C * . C B C (CONSTRAINT FILE) C + C I, CONSTRAINT COCE NAME, NUMBER OF OUTPUTS, C DIMENSIONALITY o?* C C INDICES •10» (MIN. AND MAX.) C * c C 1, CODE NAME, IDENTIFICATION FLAG, COST (ORDER OF C + OPERATOR), DIMENSIONALITY •9» C + C + INDICES »10» C *$ C B C » , C B C S C 6 C C DESCRIPTION OF PARAMETERS C JCSENS = -N, OR I AS RESPECTIVELY PUNCHED (AND WRITTEN) C OUTPUT, WRITTEN ONLY OUTPUT OR INPUT IS DESIRED.

PAGE 201

189 C N » THE CARD PUNCH DATA SET REFERENCE NUMBER C JCCLNO » A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C THE FUNCTIONS AND CONSTRAINTS MUST BE PROVIDED IN REVERSE C POLISH NOTATION WITH =0 UNDERSTOOD. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C JICONS C JIDECL C JINAME C JIRAFE C JIVALU C NEWCEL C STORE C SYSENT C SYSERR C SYSEXT C C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERROR{DATA PROVIDED) C 1 NF NO VARIABLES DECLARED (UNIT NUMBER) C 2 NF NO ER'S, FUNCTIONS OR CONSTRAINTS (UNIT NUMBER) C 3 NF NO UNITS (UNIT NUMBER) C C HETHCC C SELF-EXPLANATORY C c •• ••• c SUBROUTINE SECI A0( JCSENS, JCCLNO) COKfON/ALLOC/JCCOR£« 1) DIMENSION L(7),D{8),F(4),P(4) INTEGER C,F,P,U ENTER CALL SYSENTd, 5, 1,2. JCCLNO) 00 91 1=1,7 91 L(I)=l 00 92 1=1,* F{I)=1 92 P(I)=1 SECBL SET UP IF(JCSENS.LT.1)G0 TO 4 D IS TEMPORARY SPUR IF(JCC0RE{151.GT.0)CALL SYSERR ( 1,JCC0RE( 15 ) ) 0(1)=.0 D(2)=0 0(3)=1 0(4)=60 C(5)=l LOAD BLOCK CALL NEHCEL(D,HB,1) MBA=MB*28 ; SPUR BLOCK Ml=JCCCRE(17) Ml=JCCCR£(Ml) M2»Ml/2*2 D(2)=0 0(4)=M2»5

PAGE 202

190 CALL NEHCELCD,MA,2» INITIALIZE SPUR BLOCK M3'=PA 00 I 1=1. M2 DO 1 J=1.5 JCCCRE(K3)=C(l)»(l/J)*(J/3J*«I-2+Ml»(l/I))««'V/J)»(J/A) 1 H3=K3*l SECBL M1=HA»20 CALL NEWCEL{JCC0RE(MI),M2,3) JCCCRE(15»=M2 M^ = ^^2l JCCCRE=H2 3 H3=NAt5»M4 CALL NewCEHJCC0RE(M3),M2,4) Ml=Hl*l JCCCRE(M1)=M2 MC=INPUT DATA SET HC=JCC0RE{10) GO TO 5 MA=AOCRESS OF SPUR 4 H1=JCC0RE115)*1 MA=JCC0RE(M1) MB=ACCRESS OF LOAD Ml=fl*l HB=JCCCRE(MIJ M8A=MB+28 MC AND MO ARE OUTPUT DATA SETS MC=JCCCREai) HD=IAOS«JCSENS» PREFACE WRITECHClOl) 101 F0R^AT(115HlTHE FOLLOWING TABLE GIVES THE VARIOUS OUTPUT FIELDS WH IICH MAY APPEAR AS OUTPUT. EACH LINE OF OUTPUT BEGINS WITH A) WRITE(MC,102) 102 FORMATdlSH LETTER DESIGNATION. THIS LETTER CORRESPONDS TO ONE OF 1 THE ENTRIES IN THIS TABLE, THUS IDENTIFYING THE VARIOUS FIELDS) WRITE
PAGE 203

191 WRITE(HCil06) 106 FORMAT (30H C WRITE(HC,107) 107 FORMAT (30H C WRITE(WC,108) 108 F0RMAT(62H 6 1 INCEX) HRITE(MC,109) 109 FORMAT (ASH F WRITE(MC,110) 110 FORMATOOH G WRITEtHClIl) 111 FORMAT{83H H CODE NAME, ALPHAMERIC NAME) NUMBER OF COMMON VARIABLES) MAXIMUM INDEX, MAXIMUM INDEX, MAXIMUM INDEX, MAXIMUM VARIABLE CODE NAME, DIMENSIONALITY, VALUE) INDEX, INDEX, INDEX, INDEX) NUMBER OF VARIABLES, NUMBER Of ER'S, NUMBER OF EQUAT IIONS, NUMBER OF CONSTRAINTS) WRITE(HC,112) VARIABLE CODE NAME, COMMON VARIABLE CODE NAME, DIMEN CONSTANT CODE NAME, VALUE) CODE NAME, NUMBER OF OUTPUTS, DIMENSIONALITY) CODE NAME, IDENTIFICATION FLAG, COST (ORDER OF OPERA 112 F0RfAT(65H I ISIGNALITY) WRITE(HC,113) 113 F0RMAT(29H J WRITEJMCllA) llA F0Rf'AT(48H K WRITElHCllS) 115 F0RPAT(76H L ITOR), CIMENSIONALITY) WRITE(fC,ll6) 116 F0R.VAr(7HlSeCE0E) HRITE(NC,ll7) 117 FORI^AT(23H0CECISION VARIABLE FILE) JCCCRE(13)=6 DECISION VARIABLE FILE 5 L(l)=4 F«l)=2 JCCCRe(M8A)=-l CALL JlRAFe(L,l,JCSENS,F,l) IF(JCSENS.LT.0)WRITE(M0,118) 118 FORMAT (IH ) TEAR VARIABLE FILE LC3)=2 L('.) = l IF(JCSENS.EC.l)GO TO 51 WRITE(WC,119) 119 F0RyAT(l9H TEAR VARIABLE FILE) JCCCREtl3)»6 51 CALL J1RAFE(L,1,JCSENS,F,2) IFtJCSENS.LT.0)WRITE(M0,118) OPERATOR NAME FILE L(l)=3 L(2)=2 L(3)«l L(4)=l F(l)=l Ml=JCC0RE(17)+2 F(2)=JCC0RE{M1)+1 JCCCREtMBAl^O IFt JCSENS.EC.DGO TO 52 HRITE(MC,120) 120 FORfAT(l9hOCPERATOR NAME FILE) JCCGRE(13)=6 52 CALL JINAME
PAGE 204

192 IFCJCSENS.EC.DGO TO 53 WRlTE(fC,l2l) 121 FORfAT(l7H0METHOD NAME FILE) JCCCR£{13)=6 5-3 CALL J1NAHE(L,JCSENS|F,2J lFCJCStNS.LT.O)WRITE(H0,118) UNIT CONNECTIONS IF(JCS£NS.EQ.1)G0 TO 54 WRITE(^1C,122J 122 F0RMAT121H0UNIT = CONNECTIONS) JCCCRE(13)»6 NUMBER OF COMMON VARIABLES 54 L(2)=4 L(3J=2 F(l)=4 F(2)=l IFtJCSENS.LT.lJGO TO 6 INPUT REA0{WC,123)H1,H2 123 FORfATCIl, 119, 3120) IF(Ml.EC.OJGO TO 8 CALL STCRE( JCC0RE(MA),L,M2fPfF,JCCORE(MB),l) GO TO 7 OUTPUT 6 Kl*l CALL FETCH! JCCORE
PAGE 205

193 JCCCRE(13J=6 73 CALL JlNAHcCL.JCSENSiFfB) Tt IF(JCSENS.LT.0)WRITe(HD,ll8) C UNIT 8 U=0 9 U«U*l LCl)=4 L<2»=4»U L(3)=l F(l)=8 F<2)=8 F(3»=l P('H=8 JCCCRe(KBA)=-l IFIJCSENS.lt. DGO TO 11 C INPUT DC 10 I=li8 10 0(n=0 REA0(HCil23)Ml,0{2)i0(4),0(6lt0(8) IF(r'l.EC.O)GQ TO 19 CALL STCREl JCC0RE(MA),L,0,P,F,JCC0RE«MB),2) GO TO 12 C OUTPUT 11 Ml=l CALL FETCH( JCC0RElHA),L,DiPtF,JCC0REtHB)iHl,2) IF^^'l.EQ.-^)GO to 20 HRITE(HC,128)U 128 FCRf(AT(8H0UMT = 15) WRITE(MC»129)0(2)tC(4),0(6).0(8) 129 F0RHAT(AH H 4I29J lF(JCSENS.LT.O)WRITE(M0,l23)Ml,D(2)fD(4),O(6J,Dt8) C VARIABLE DECLARATION FILE 12 L(H = 5 F(3»=C(2> IFJJCSENS.EQ.DGO TO 1201 WRITe(MCtl30) 130 F0RNAT{26H VARIABLE DECLARATION FILE) JCCCR£(13)=6 1201 CALL JlDECLtL,JCSENS,F,2) IFIJCSEKS.LT.O)HRITE(MO,118) C ER DECLARATION FILE L(4)=3 LI5)=1 F«3)=C(A) IFCJCSENS.EO.DGO TO 1202 WRITE(I^Cil31) 131 F0RMATI20H ER DECLARATION FILE) JCCCRE(13)=6 1202 CALL JlCECL(LtJCSEhS,F,3) IF IJCSENS.LT.O) WRITE (MDf 118) C EQUATION DECLARATION FILE L(4)=5 L(5)=l F{3)=C(6) IFIJCSENS.EQ.DGO TO 1203 WRITE(MCfl32) 132 F0RHAT126H EQUATION DECLARATION FILE) JCC0RE(13)=6 1203 CALL J1DECL(L,JCSENS.F,A) IF(JCSENS.LT.0)HRITElHCtll8» C CONSTRAINT DECLARATION FILE LU)=»7

PAGE 206

194 L(5)«l F(3)=0(8» IFCJCSENS.EQ.DGO TO 1204 MRITE(MC»133) 133 FOR^'AT(^^H constraint declaration FILE) JCCCRE(l3)-6 1204 CALL JICECL=4 LC4)=1 F{2)=C(4) Ml=Ml*l F(3)=JCC0RE(M1)*1 IFCJCSENS.EC.DGQ TO 1207 WRITE(HC,136) 136 F0RMAT{13H ER NAME FILE) JCCCREa3) = 6 1207 CALL J1NAKE(L,JCSENS,F,4) IF(JCSENS.LT.0)WRITE(MD,118) ; VARIABLE NAME FILE L(3)=5 F{2)=D(2) IFtJCSENS.EQ.DGO TO 1208 HRITE(HC,137J 137 FORf^ATiigH VARIABLE NAME FILE) JCCCR£«13)=6 1208 CALL J1NAME1L,JCSE.NS.F,5) IF(JCSENS.LT.01WRITE(HD,118) : ER FILE L<1)=5 Lt3)=6 LC5)=l F(2)=C(4) F«3)=l JCCCRE(K8AJ=-l IFIJCSENS.EQ.DGO TO 13 HRITE{KC,138) 138 F0RKAT(8H ER FILE)

PAGE 207

195 JCCCRE(13)=6 13 IF((L(*».GT.F12I).AND.(JCSENS.LE.0»»G0 TO 14 CALL JlRAFE(L,2fjCSENSiF.3) IF(JCSENS.LT.0)HRITE(M0,H8) L(4)=iL(4)*l IF(L{4).GT.1)G0 TO 13 14 IFUCSENS.LT.0>HRITE(M0,118) EQUATION FILE L(3)=7 L(4J=l F(2)=C(6) IFUCSENS.EQ.liGO TO 15 WRITEJMC,139) 139 FOR^ATllAH ECUATION FILE) JCCCRE(13>=6 15 IF((H4).GT.F(2)).AND.(JCSENS.LE.0)>G0 TO 16 CALL JIRAFE{L,2,JCSENS,F,4) IF(JCSENS.LT.6lHRITE(MD,118) U«4)=L(4)+1 IFlL(4).GT.l)G0 TO 15 16 IF(JCSENS.LT,0)WRITE(M0,118) CONSTRAINT FILE L(3J=8 L(4)=l F(2)=C(8) IFtJCSENS.EQ.DGO TO 17 WRITE(HC,140) 140 FORMAT (16H CONSTRAINT FILE) JCCCRE«13)=6 17 IFl tLl4).GT.Ft2)).AND.(JCSENS.LE.0))G0 TO 18 CALL JlRAFE{L,2iJCSENStF,5) IF(JCSENS.LT.0)WRITE(MD,118) L(4)=LJ4)*1 IF(L(4).GT.1)G0 TO 17 18 IFtJCSENS.LT.O)HRITE(M0,lie) END OF UNIT L{1)=4 L14)=1 IF(JCSENS.LT.l)GO TO 9 IF(D(2).LE.0)CALL SYSERRUiU) IF((0(4)+D(6)+F(8)).LE.0)CALL SYSERR(2,U) GO TO 9 END OF SECEDE 19 IF«U.LE.1)CALL SYSERR<3,U) 20 IF(JCSEKS.EQ.11G0 TO 21 WRITE(KC,141) 141 FORMAT {14H.0 END OF SECEDE) JCCCREC13)=6 IF{JCSEKS.LT.O)WRITE(MO, 118) EXIT 21 CALL SYSEXT RETURN END

PAGE 208

196 C C«*«>«>* •...«o«. *• •««««•» • ..•»..».»»••••• C • VARIAO • c ••• »• c C PURPOSE C VARIAO HANDLES THE INPUT AND OUTPUT OF VARIABLE VALUES AND C NAMES WHEN INPUT OR OUTPUT OF THIS INFORMATION ONLY IS C DESIRED. C C USAGE C CALL VARlAO(JCLENT,JCHaDE,JCSENS,JCCLNOI C C DATA FORHAT C SEE TEAR AND DECISION VARIABLE FILE INPUT. IN SECIAO. .0 • C DESCRIPTION OF PARAMETERS C JCLENT = THE ADDRESS OF A GROUP. AN AUXILIARY LIST HEADCELL Q OR 0. IF C» THE SOURCE OR DESTINATION OF THE DATA C IS SECEDE. IF JGLENT IS THE ADDRESS OF A LIST C HEACCELL, THE VARIABLES WHOSE VALUES ARE TO BE C WRITTEN ARE SPECIFIED BY THE LIST ENTRIES, IF C . JCLENT IS THE ADDRESS OF A GROUPf THE DECISION AND C TEAR VARIABLE NAMES WILL BE WRITTEN. C JCMOCE = -2, -1, OR N, WHERE N IS A NON-NEGATIVE INTEGER. C IF JCKODc = -1, OUTPUT OF THE VARIABLE NAMES IN C THE DECISION AND TEAR VARIABLE FILES OR LISTS C (DEPENDING ON JCLENT) IS REQUESTED. WHEN JCHODE C IS NON-NEGATIVE THE OUTPUT OR INPUT WILL CONSIST C OF VARIABLE VALUES. THE SOURCE OR DESTINATION CF C THE VALUES IS INDICATED BY JCLENT. THE N IS THE C UNIT NUMBER WHEN JCLENT = 0. IF JCMOOE = -2 i C VARIABLE VALUES FOR EVERY UNIT WILL BE INPUT OR C OUTPUT. C JCSENS = SEE JIDIMS. JCSENS CAN NOT EQUAL -I. C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C THE AUXILIARY LIST. WHEN USED, MUST CONTAIN LIST ENTRIES OF C THE SAME SIZE AND PATTERN OF THE GENDER TEAR AND DECISION C VARIABLE LISTS. C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINESt C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C JCSENS MUST BE IF JCLENT IS POSITIVE OR JCMODE IS C NEGATIVE. C THE FOLLOWING TABLE SHOULD ASSIST IN EXPLAINING THE VARIAO C MOOES OF OPERATION. (A=AUXILIARY LIST HEADCELL, G=GROUP C AND N=NON-NEGATIVE INTEGER) C VARIAO CALL PARAMETERS C RESPCNSE/SOURCE SECEDE GENDER AUX. LIST C NAMESIOUTPUT) I0,-1,0,N) (G,-1,0,N) C VALUES(INPUT) 10. N,l,N) C VALUES(OUTPUT) (0, N,0,N) (A, 0,0, N) C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FRMCEL C JIRAFE C JIRESO C JIVALU C JlVARl

PAGE 209

197 c

PAGE 210

198 Ml=JCKQOE tC2)=Ml*4 M3=JCCCRE(l5)+l M2=JCCCREIH3) M3«^<3l H3=JCC0REJM3) 3 H4=l CALL FETCHlJCC0RE(H2»,LfH5fP,F,JCCCRE(M3),M4,l) 1F(N<».EC.-1>G0 TO 14 IF(JCSENS.GT.O)GO TO 4 M4=JCCCRE{ll» HRITE(H4,104)H1 104 F0RNAT(26H0VARIABLE VALUES FOR UNIT 15) 4 CALL JlVALUlLiJCSENS,F,l), 1F(H1.£<3.JCHQ0E>GQ TO 14 Hl=Ml*l GO TO 3 MODE 5 IF(JCMGCE.NE.-1)G0 TO 7 LIST Ml=JCCCRE(16)+l H2=JCCQRE(l7»+8 Ml=JCCCRE(Ml)+5»JCCaRE(M2»-5 DECISION AND TEAR VAR lABLE LI STS CALL FRMCELIJCCORE(MI),JCLENT,CfV,l) Hl^JCCOREdl) WRITE(M1,105) 105 F0RfATl23H0CEClSI0N VARIABLE LIST) M2=l 6 CALL JlVARIl0,0(H2)f2,0t0il) M2=>2*1 IF(I'2,NE.2)G0 TO 14 HRITE«M1,106) 106 F0RNATI19H0TEAR VARIABLE LIST) GO TO 6 AUXILIARY LIST 7 Ml=JCCCRE(16)+l H2=JCCORe(17)tlO Ml=JCCCRE(Hl)*5»JCC0REJM2)-5 M2=JCC0RE(M2) HS^JCCOREdT)*! Q(4)=JCCCRt(M3) MO=>JCCCRE(ll) HRITE«H0fl07) 107 FORr'ATH6H0VARIABL£ VALUES) M3=JCC0REtl5)+2 M4=JCCCRE(M3) M3=f3-1 M3=JCCCREIM3) M5=Kl+3 M5=JCCCRE(M5) H6=JCC0RE(16)+8 M6=JCC0RE(H6) «7«!JCLENT 8 CALL FRKCELtJCC0RE(H2),H7iC,A,2) IF(C(1).EC.0)G0 TO 10 H3 = f«7*M5 M9 = 4 9 CALL J7ICOM(MlfH8,0,OtOfM9i0(l)t0iMl0,l) 1F(M10.EC.-1)GO TO 13

PAGE 211

199 IF(^f9.EC.-4)G0 TO 11 10 M10'=012)/H2 L(2)=M10*4 L(l»=5-A/L(2l Mll=LCU Ll*)=l LGO TO 13 Mll=M3*D(l)-l WRITE(M0,109»(JCC0RE(I),I=M6,Hll) 109 F0Ri>
PAGE 212

200 c C«»«««<>«*«>*«»* •• ..»»« •••••••••••••••••••••• c •••••••••• C • JIARBS • c C PURPOSE C JIARBS SETS UP THE DIMENSIONED VARIABLE ADDRESS RESOLUTION C BLOCKS (DIVARB'S), PROVIDES SPACE ALLOCATION FOR VARIABLE C VALUE STORAGE AND ESTABLISHES THE ABSOLUTE LINKAGES BETWEEN C THE DECLARATION AND VALUE FILES. C e USAGE C CALL JlAR8S(JCLIST,JCFINEtJCCLN0) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C SEE JIRAFE C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C NEHCEL C STORE C SYSENT C SYSEXT C TOCELL C C ERROR COCES FOR THIS PROGRAM C CODE FATAL ERRORtOATA PROVIDED) C 1 NF COMMON VARIABLE WITHOUT LINKAGE (CODE NUMBER) C C METHOD C SELF-EXPLANATORY C C •••»»••»»• c SUBROUTINE JIARBS( JCLIST, JCFINE, JCCLNO) • COMMCN/ALLOC/JCCOREtl) DIMENSION JCLISTl6),JCFINE(3),L(7),C(6),0(3),W(4),P(4),R(5)fA{7) INTEGER C,0,W>P,R,A DATA L/5,0,l,l,l,l,0/,C/4,4,l,l,l,0/,W/l,l,l,l/,P/l,l,l,l/,R/l,l, I I, l,-l/,A/2, 17,1, 1,18,1,1/ C ENTER CALL SYSENTd, 5,1, A, JCCLNO) JCLIST(5)=1 C HA=AOCRESS OF SPUR Hl=JCC0RE<15)+l HA=JCC0RE(H1) C MB=ADCRESS OF LOAD Ml=Ml*l HB=JCCOREtMl) MC=MB*5 . MD=KB+4 ME=MB*26 MF»M8*20 M6=Ha»30

PAGE 213

201 M2=^'G^•28 JCC0RE(M2>3-1 C L W0=5-A/JCLIST(2) L(l)=MO LC2»=JCLIST(2) L(4)»l C MH=CONTROL PARAMETER MH=l-4/L(2) C W<4) H(A)=2+MH C MJ=NUHBER OF VARIAOLES MJ=JCFINE(2) C MK=AODRESS OF WORKING SPACE FOR INDICES Hl=Ml*l MK=JCCaRE(Ml) C DO LOOP 00 7 1=1, HJ C GET REtATIVE POINTER L
PAGE 214

202 H4=M1 1F«KI.LE.(M3/2))G0 TO 3 M'»=M3/2 + l H5=HA*5»M4*3 JCCCRE(M5)=MI SPUR FOR DIVARB 3 M5=MA+5«M4 GET OIVARS CALL NEWCEL(JCC0RE(M5),HN,l) STORE RANGES JCC0Re(MN»=R(4l M4=MN+l M5 = HK M6=R14) 00 4 J=1,M6 JCC0RE(M4)=JCC0RE(M5) M4=M4*1 4 M5=M5+l . STORE RECORD ADDRESSES M5=M4*l M6 = HN«-Ml-1 JCLIST(6)=D(2) DO 5 J=M5,M6 CALL STORE( JCCORE«MA),JCLlST(5»,0tR(5),JCFINEf JCC0RE(MB»,2) JCLIST(6)=M3/JCLIST«3) . 5 JCCCRE(J)=JCCORE(MC) STORE OFFSET JCC0RE ADDRESS LAST COMPONENT JCLIST<6)=(M2-(M6-M5>»M3+JCC0RE(H4))/JCFINE(3)-l CALL ST0RE(JCCORE(MA),JCLIST(5),D,R(5),JCFINE,JCC0RE(MB),3) STORE ADDRESS OF OIVARS 6 CALL T0CELL(JCCQRE{HAl,MM,MN,Pi2) 7 CONTINUE EXIT CALL SYSEXT RETURN END

PAGE 215

203 C C»***«**«>*««*«»«B«»
PAGE 216

204 C IN OR OUT MF«1 JCLIST(5)=1 JCLIST(6)=l V«4)=JCFINE(3» IFIJCSENS.LT.DGO TO 2 C INPUT 1 REA0«MC,101)MI,M2. VALUE 101 F0ftMAT(H,I19,0<»0.28) IF(Ml.EC.O)GO TO 3 C STORE VALUE CALL ST0RE(JCC0RE«HA),JCLIST(MF),VALUE,V,JCF1NE,JCC0RE(HB»,1) MF=5 GO TO 1 C OUTPUT 2 Ml=l CALL FETCH( JCC0RE(MA),JCLIST(MF),VALUE,V,JCFINE,JCC0Re(M8l ,Ml.l) MF=5 IF(Ml.EQ.-l)GO TO 3 C WRITE OUTPUT WRI TE(HC, 102 )JCCORE JCC0RE{13»=6 IF(JCSENS.LT.O)WRITE(HE,10I)M1,JCCORE(MBA), VALUE . C ITERATE IF(JCCORE(MBA».LT.JCCORE(MBB))GO TO 2 C EXIT 3 CALL SYSEXT RETURN END

PAGE 217

205 C C •.•••• a •• C C • JIDECL • C •• c C PURPOSE C JIDECL HANDLES THE INPUT AND OUTPUT OF VARIABLE, ER, C FUNCTION AND CONSTRAINT DECLARATIONS. c C USAGE C CALL JlDECLCJCLIST,JCSENS,JCFINE,JCCLNO) c C DATA FORMAT C SEE SECEDE C C DESCRIPTION OF PARAMETERS C SEE JIRAFE C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C JIOIMS C STORE C SYSENT C SYSEXT C ,J C ERROR CODES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C c SUBROUTINE JIOECL ( JCL 1ST, JCSENS, JCFINE, JCCLNQ) COMMQN/ALLOC/JCCOREd) DIMENSION JCLISTtTJ.JCFINEJAJ.DCtJtm^j.PCS) INTEGER P,0,W DATA W/I,l,l,l/,P/l,l,l,l,-l/,D(l)/l/ C ENTER CALL SYSENT(l,5,l,6,JCCLN0J om=i JCLIST(6)=l C MA=ADDRESS OF SPUR Ml=JCC0RE(l5)*l MA=JCCORE«MU C MB=AOCRESS OF LOAD Ml=Ml*l MB=JCC0RE{M1) ' HH=KB»4 MC=«B*26 • M0=MB«-20 C " ME=INPUT DATA SET ME=JCC0RE«10) C MF AND MG ARE OUTPUT DATA SETS MFxJCCOREIlI) MG=IABS(JCSENS) C W

PAGE 218

206 Ml=4/JCLIST(l) M2=l/JCLIST(^) H«3) = l+fn + ( 1-M1)»M2 W«4)=W(3)+(l-Ml)»M2 M1=H(4)-W(3)*3 C IN OR CUT 1FIJCSENS.lt. DGO TO 2 C INPUT Hl=JCLIST(l)-2 M^=«^fl2 C READ DECLARATION 1 REAOCMEtlODJOCDf l=l,HI) 101 FORMATIU, 119, 2120) IF(D(1).E0.0) GO TO 5 C ACCESS RELATIVE POINTER CALL STCRE(JCC0RE(MA),JCLIST,D,P<5),JCFINE,JCC0RE(Ha),l) C STORE DATA M3=JCC0RE(MHJ JCC0RE{K3)=JCC0RE(MD)-JCC0RE,W,JCFINE,JCCORE(Ma),0,3) D(2)=JCLISTCMl) C WRITE DATA 1F(MI.EQ.^)G0 TO 4 WRlTE(MF,l02»(D(n,I = 2,3) 102 FORHATCiH A 2129) GO TO 5 4 WRITEjHF,l03)(0(n,I = 2,4) 103 F0RMAT(4H I 3129) 5 IF(JCS£NS.LT.0)WRITE(MG,101)(D( I),I=ltMn JCLISTt7)=W(4) JCC0RE(13)=6 IF(D(MI).GT.O)CALL JIDIMS( JCLISTJ 7 ) ,DI MI ) , 1,0, JCSENS,2) C INCREMENT JCLIST(M1)=JCLIST(MI)+1 IF(JCLIST(Ml).LE.JCFINE(M3))G0 TO 3 C EXIT 6 CALL SYSEXr RETURN END

PAGE 219

207 C c* ••..••«.«..» ••••« ••»»• .».«• c •• C • JIOIHS* c "•• c C PURPOSE C JIOIMS HANDLES THE INPUT AND OUTPUT OF INDICES. C C USAGE . C CALL J10IMS(JCP0FP,JC0IMS,JCM00E,JCTYPE,JCSENS,JCCLN0» C C DATA FORMAT C SEE SECEDE C C DESCRIPTION OF PARAMETERS C JCPOFP = THE NUMBER OF WORDS TO ADVANCE TO REACH THE FIRST C INDEX Oft THE ADDRESS OF THE FIRST INDEX (SEE MODE) C JCDIMS = THE DIMENSIONALITY C aCMODE = 1 OR 2 AS RESPECTIVELY THE INDEX STORAGE MEDIUM IS C SECEDE OR GENDER C JCTYPE = Of 1 OR 2 AS RESPECTIVELY THE INDICES ARE WHOLE C WORD, SINGLE SEVEN PART OR D0U9LE SEVEN PART C JCSENS = -N, OR 1 AS RESPECTIVELY PUNCHED (AND WRITTEN) C OUTPUT, WRITTEN ONLY OR INPUT IS DESIRED C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FRMCEL C STORE C SYSENT C • SYSEXT C TOCELL C C ERROR CODES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C C SUBROUTINE J IDIHSI JCPOFP, JCDIMS, JCMOOE .JCTYPE. JCSENS, JCCLNO) COMf'CN/ALLOC/JCCOREd) DIMENSION L(2),W(4).X(22), 0(7) INTEGER X.D.W ;. .^ DATA L(l)/l/»W/l,l,l,l/,X/7,9,l,l,lO,l,l,ll,l.I,12,l.ltl3,l,l,l4, 1 l,1^15,l,l/ C ENTER CALL SYSENTd, 5, 1,7, JCCLNO) C MA=ADORESS OF SPUR M1=JCCCRE(15)+1 MA=JCCOREIMl) C MB=AOCRESS OF LOAD Ml=Kl+l HB=JCCORE(Hl) LC2)=JCP0FP

PAGE 220

208 HC=INPUT DATA SET MC=JCC0RE(10) MO ANC ME ARE OUTPUT DATA SETS MD=JCCORE(ll) ME=IABS(JCSENS) TYPE OF INDEX IF(JCTYPE.GT.OIGO TO A WHOLE WORD Hl=JCOIHS 1 M2»'» IF(Ml.LT.4)H2»Ml Ml=«l-M2 U(4)=H2 IF(JCSENS.LT.l)GO TO 2 INPUT REA0(MC,10l)«D( !M»1,M2) 101 F0RMAT{4I20» CALL STORE(JCCORE(HA)fLiOfW,L,JCCORE(MB)tl) GO TO 3 OUTPUT 2 CALL FETCH{ JCCORE{MA),L,D,W,Lf JCCORE(HB)fO,U IF{jCSENS.LT.0)WRITE
PAGE 221

209 C c •.«••••«»• C • JIFILE • c C PURPOSE C JIFILE ENTERS THE OCCURRENCE OF A LIST ENTRY ONTO THE C TEMPORARY FILE. C C USAGE ,,, , C CALL J1FILE{JCSPUR,JCLIST,JCSPRG,JCP0FP,JCP0SP,JCSENS, C JCFINE.jCLOAOf JCCLNOI C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPUR = THE SPUR FOR THE FILE C JCUST = THE LISTER VECTOR C JCSPRG = THE ADDRESS OF A GENDER LIST SPUR C JCPOFP = THE ADDRESS OF THE LIST ENTRY C JCPDSP = THE ADDRESS OF THE LIST ENTRY LAST WORD C JCSENS = SEE JIOIKS C JCFINE = THE FINE VECTOR C JCLOAO = THE LOAD VECTOR C JCCLNO = A USER ASSIGNED CALL STATEMENT 10. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCTA MUST. FOR SOME MACHINESt C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C NEWCEL C STORE C SYSENT C SYSEXT C C ERROR CODES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C Q •••«••••»• C SUBROUTINE JIFILEJ JCSPUR, JCLlST,jCSPRG.JCpOFP,JCPOSP. JCSENS. 1 JCFINE. JCLOAD.JCCLNOJ COKKON/ALLOC/JCCORE( 1) DIMENSION JCSPUR(5),JCLIST(3I,JCFINE(2J,JCLOAO(30),0(2)»F«4) INTEGER D,F DATA D(2)/0/»F/l.l.l,2/ C ENTER CALL SYSENT(l,5.l,8,JCCLNO) C GET LIST ENTRY IFIJCSENS.GT.OCALL NEWCEL I JCCORE( JCSPRG) , JCPOFP, 1 ) Ml=JCSPRG+3 JCPCSP=JCCORE(Ml)+JCPOFP-l C ENTER ON FILE D(l)=JCPOFP CALL STOREl JCSPUR, JCL 1ST, O.F, JCFINE, JCLOAD.l J C EXIT CALL SYSEXT

PAGE 222

210 RETURN END

PAGE 223

211 C c •••• C • JIGMBL • C •••• c C PURPOSE C JIGMBL SETS UP THE GIHBL. C C USAGE C CALL J1GM8L(JCGIMB,JCSPBL,JCMAXB,JCCLN0) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCGIM6 = THE ADDRESS OF THE GIM8L C JCSP8L = THE ADDRESS OF THE SPUR BLOCK C JCMAXB = THE MAXIMUM CORE BLOCK SERVICIBLE WITH THE SPUR C BLOCK C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C . „ C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C NEWCEL C SYSENT C SYSEXT C C ERROR COOES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C c ••««•»•••• c SUBROUTINE JIGMBL (JCGIMB.JCSPBL, JCMAXB, JCCLNO) COMf'ON/ALLOC/JCCOREd) DIMENSION S(5J INTEGER S DATA S/0,0,l,0,2/ C ENTER CALL SYSENTd, 5, 1,9, JCCLNO) c s S(I)=0 S(2)=0 Ml = JCCCRE(l7)+-8 M2=JCCORE(Hl)+2 M1=M1+1 H3=JCC0RE(M1) Ml=Ml*5 M3=M3+JCC0REIM1)»2 * IF(M3.GT.M2)M2=M3 IF(M2.LT.10)M2=10 JCMAXB=M2 S(*)=»5»M2*5 . C SPUR BLOCK CALL NEWCELCS,M2,l) Ml=S(4)/5 JCSPBL=M2*5

PAGE 224

212 DO 1 I=1»H1 00 1 J=l,5 JCC0RE(H2) = S(J) + (J/A)»J'V/J)*C1-S14)-1) 1 H2=K2*l GIM8L Ml=JCSPBLM5 CALL NEWCEL(JCC0RE(M1),JCGIMB,2) JCC0RE(16)=JCGIMB MI=JCGIK3 DO 2 1=1,10 JCC0R6(Ml)=(I/2)»«2/I)»JCSPBL 2 Ml=f
PAGE 225

213 C c »••••«•« • •».».»•.. »••« c •• C JILEOL • C »....»»«•» c C PURPOSE C JILEOL HANDLES THE INPUT AND OUTPUT OF LINK EDITOR LISTS. C C USAGE C CALL JlLEDL(JCSPUR,JCFIRSf JCMTHO.JCSENS.JCERFC.JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPUR = THE SPUR FOR THE TEMPORARY LISTS C JCFIRS = THE ADDRESS OF THE FIRST LIST ENTRY C JCMTHD = THE METHOD TEMPORARY LIST C JCSENS = SEE JIOIMS. JCSENS MAY = +M, WHERE H IS AN ER. C EQUATION OR CONSTRAINT CODE NAME, WITH THE DATA C SOURCE BEING SECEDE. C JCERFC = THE GROUP BODY IDENTIFICATION FLAG C JCCLNO a A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FRMCEL C FSTLNK C JIOIHS C J7C0MV C LNK6HD C NEWCEL C PUSH C STORE C SYSENT C SYSERR C SYSEXT C TOCELL C C ERROR COOES FOR THIS PROGRAM C CODE FATAL ERRORtOATA PROVIDED) C I NF ILLEGAL ENTRY ON LINK EDITOR LIST (ID. FLAG) C C METHOD C SELF-EXPLANATORY C . c •••«.«.».• c SUBROUTINE JlLEOLi JCSPUR, JCFIRS, JCMTHD, JCSENS, JCERFC, JCCLNO) COH^ON/ALLOC/JCCOREd) DOUBLE PRECISION VALUE DIMENSION JCSPURJ5),0ia),Ell6),TI7),P«5),L(9),Ca7),XI4),Vt4) INTEGER D,£,T,P,C,X,V . DATA D(l)/0/,E/5,l,l,li2,l.l,3,l,lf2l,l»l,22,l,l/,T/2,21,l, 1 l,22,I,l/fP/l.l,l,l»-l/,C/2,l,l,l,5,l,l,2,8,l,l,19,l,l,15,l,l/, 2 L/0,0,0,0,0,I,1,1,0/,V/1,23,1,1/ C ENTER

PAGE 226

214 CALL SYSENTClf5il,10,JCCLN0) C M4»VARIABLE SIZE WITHOUT INDICES (LINK ED.) Ml=JCCaRE
PAGE 227

215 ACCESS CONSTITUENT 3 CALL FETCH( jCCORe(MG)fL(6),0(2)tC,LtJCCOREiMH),0i2» Hl=C(2) H3"=2 TYPE 4 H2=0(3)»l GOTO (5r6,8,6,9,82,20,20)tH2 OPERATOR 5 IFCJCSENS.GT.UCALL FETCHC JCCORE(HG) ,H 8) ,0(A) ,C (14) ,L, JCCORE CHH) , 1 , 3 » 0(2)-0(4) *D14)=0(5) D(5)=0 M2=WC LC7)=ME8 E«l)=4 GO TO 10 VARIABLE 6 IF(JCSENS.EQ.l)GO TO 61 CALL FETCH{JCCORE
PAGE 228

216 0(2J=«0 GO TO 10 83 READ(HJ,1010)VALU6 lOlO fORHAT(e40.2aj CALL T0CELLtJCC0RE C TEST FLAG M2=D(3)*1 H3=3 GO TO (15,16^17,16,18,171,20,20),M2 C OPERATOR 15 0(5)*D(4) D(4)=012) M2a4 GO TO 19 VARIABLE 16 M2=»5 GO TO 19

PAGE 229

217 : CONSTANT 17 M2»4 D«5)=0 GO TO 19 : LOCAL CONSTANT 171 0(2»=l CALL FRMCELlJCC0RE(ML)tME.VALUefVt3) WRITE(MF,1020.>VALUE 1C20 FORMAT H5H LOCAL CONSTANT, £40.28) JCCCRE(13»=6 IFCJCSENS.GE.OGO TO 14 HRITE(MG, 101)0(2), C(3I HRITE(MG,1010)VALUE GO TO 14 ; VALUE OF ER, FUNCTION OR CONSTRAINT 18 M2=5 ; WRITE DATA 19 0(2)=1 WRITE(MF,102)(0«I),I=3,M2) 102 FORMAT (4H £ 4129) IF(JCSENS.LT.O)WRITE(MG,101)iO(I),I='2,H2) JCCCRE(13)=6 IF(D(3).EQ.0)G0 TO 14 IF(0(5).GT.0)CALL JIDIHS ( M1,D( 5) , 2, 1, JCSENS,2) GO TO 14 ; ERROR 20 CALL SYSERR(1,(M2-1J) GO TO (1,2,14),H3 ; EXIT 21 CALL SYSEXT RETURN END

PAGE 230

218 c . C«>«»*o><.« C • JINAME » c •••• c C PURPOSE C JINAHE HANDLES THE INPUT AND OUTPUT OF NAHE FILES. C C USAGE C CALL JlKAME(JCLIST,JCSENStJCFIHEtJCCLNO) C C DATA FORMAT C SEE SECEDE C C DESCRIPTION OF PARAMETERS C SEE JIRAFE C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT FOR SOME MACHINES. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C STORE C SYSENT C SYSEXT C C ERROR CODES FOR THIS SUBPROGRAM C NONE C C METHOD C SELF-EXPLANATORY C C ••••••«••• c SUBROUTINE JINAME( JCLIST, JCSENSt JCFINEt JCCLNO) COMf CN/ALLOC/JCCORE( 1 1 OIMENSICN JCLIST(6>tJCFINE(3)fNlA),D{5) INTEGER DATA N/l,l,l,l/fD(l)/l/ C ENTER CALL SYSENT(l,5,lillfJCCLN0) JCLIST(5)=l JCLIST(6)=l MI=JCLISTC1)-1 N14)=JCFINEIM1) C MA=ADCRESS OF SPUR Ml=«JCCCREJ15) + l MA=JCCCRE(Mn C MB=ACCRESS OF LOAD Ml^MlH HB=JCCCRE(Ml) C HC=INPUT DATA SET MC^JCCOREdO) C MO AND ME ARE OUTPUT DATA SETS HD = JCCCRE(n) ME=IABS(JCSENS« C IN OR OUT MG»N(4»-l MH=MG*2

PAGE 231

219 MF=1 1F(JCSENS.LT.I)G0 TO 5 INPUT 1 GO TO (2,3),MG 2 REAC(MC,101)tOt I),I=li4) 101 FCRfAT(Il,n9,I14,A6) GO TO A 3 REA0(MCil02l«0( I), 1 = 1,5) 102 F0Rr'AT(Il,U9,n4,A4,A2l 4 IFIC11).EQ.0)G0 TO 8 D(3)=D(2) CALL STCRE(JCC0RE(MA),JCLIST(MF),0C3),N,JCFINE,JCC0RE{HB),1) MF=5 GO TO 1 OUTPUT 5 Ml«l . CALL FETCH(JCC0RE(MA),JCLISTlMF),0(2),N,JCFlNE,jCC0Re
PAGE 232

,220 C €••• .....««...«.•..« .....••>• •»» Q «• •••0B»»» C • JIRAFE c c PURPcse C JIRAFE HANDLES THE INPUT ANO OUTPUT. OF FILE ENTRIES C CONTAINING RELATIVE POINTERS. C C USAGE C CALL JlRAFE(JCLIST,JCMODE,JCSENStJCFINE,JCCLNO) C C CATA FORHAT C SEE SECEDE C C DESCRIPTION OF PARAMETERS C JCLIST = THE LISTER VECTOR C JCHOOE = I IF THE FILE IS THE TEAR OR DECISION VARIABLE C FILE, 2 IF THE FILE IS A FUNCTION, ER OR C CONSTRAINT FILE, OR 3 IF THE ENTRIES ARE INCIDENCE C FILE ENTRIES C JCSENS = SEE JIDIMS C JCFINE = THE FINE VECTOR C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT FOR SOME MACHINES. C C SUBROUTINE ANO FUNCTIOIJ SUBPROGRAMS REQUIRED C FETCH C JIOIMS C STORE C SYSENT C SYSEXT C C ERROR CODES FOR THIS SUBPROGRAM C NONE C C f.ETHCD C SELF-EXPLANATORY. C C SUBROUTINE JIRAFEI JCLIST, JCMOOE, JCSENS, JCFINE, JCCLNO) C0^'^'CN/ALL0C/JCC0RE(1) DIt'ENSICN JCLIST « 7), C( 4), 0(29), 0(5), JCFINE (4) INTEGER C,0,D DATA C/ 1, 1, 1, 3/, 0/3, 1,1, 1,16, I, 1, 5, 1,1, 16, 2, 2, 5, 1,1, 1, 8, 1, 1, 5, 1,X. 1 7,1,1,19,1,1/ C ENTER CALL SYSENTd, 5, 1,12, JCCLNO) C(l)=l JCLIST{6)=1 C MA=ADCRESS OF SPUR >'l = JCCCRE(15)*l MA=JCCOREtMl) C H8=ADCRESS OF LOAD MI=»Hl + l MB=JCCCREIMI) HG=f
PAGE 233

.221 MC=INPUT DATA SET MC=JCCCRE(10) MO ANC ME ARE OUTPUT DATA SETS MO=JCCCRE(ll) ME=IABS(JCSENS) MODE HF=l IF(JC^'0CE.GT.2)G0 TO 5 IN OR OUT 1F(JCSENS.LT.1»G0 TO 3 INPUT 1 IF(JCLIST(l).EQ.5)G0 TO H REA0{KC,101)(0( I)»I=1>3) 101 FCRNATCIl, 119, 2120) GO TO 12 11 REAC(MC.101)C(l).M2,(0(n, Is2,3) 12 IFtCdJ.GT.OGO TO 2 IF(JCKCCE.GT.1)JCLIST(4)=0 IF(^F.EC.l)GO TO 10 GO TO 9 2 0(1)=3»2»D(3) CALL STCRE( JCC0RE(HA),JCLIST{HF),0,C,JCFlN6tJCC0RE(MB),l) JCLISTI7)=3 M1=JCCCRE(MG) IF(C(3).6T.0)CALL J1DIMS( JCLISTI 7) ,0( 3 ) ,l,2t li 1 ) MF=6 GO TO (1,5),JCM0DE OUTPUT 3 Ml=l CALL FETCH( JCCORE(MA),JCLIST(MF),D,C,JCFINEtJCCORE(MB),Ml,l) IF(C,1.6E.0»60 TO 31 IF(JCH0CE.GT.1)JCLIST(4)=JCFINE(2) GO TO 10 31 M3=C{1) 0(1)=1 IFUCLIST<1).EQ.5)G0 TO 4 WRITe(NC,102)(0(n,I=2,3) 102 FORNAT(AH A 2129) IFtJC5ENS.LT.0)WRITE«ME,10n(D(I),I = l,3) GO TO 41 4 WRIT£(MC»103)JCLIST(4),|D( I),I=2,3) 103 FCRf,(DtI),I=2,3) 41 JCLIST(7)=3 JCCCREJ13)=6 IF{C(3).GT.0)CALL J1DIMS( JCLISTC 7) ,0( 3) , li2, JCSENS,2) IF(r^3.EC.0)G0 TO 10 GO TO (3,5),JCM00E IN OR OUT 5 ff2=JCC0RE(17)+4 MH=JCC0RE(H2) H2=H2-1 HI=JCCaRE(M2)-MH IF(JC$EKS.LT.1)G0 TO 8 INPUT 6 REA0(MC.10A)(0(n.I=l,5) 104 FORHATdl, 119, 11,119,120) IFtC(l).GT.0)GO TO 7 IFJNF.EC.DGO TO 10 GO TO 9 7 H2=l

PAGE 234

222 IF«C(3).EQ.1)M2=14 0(l)=3 IFJC(3}.EQ.03O(l)=4 0U)=MH + lM2/l'»)»tMI*2»D»5) )+0(l)-3 CALL STCRE(JCC0RE(HA),JCLIST(HF),0,0(M2),JCFINE,JCC0RE(M8),2) JCLlST(7)=MH*JH2/14)»Ml+0( l)-3 M1=JCC0RE(MG) IF,lfltlt3) MF=6 GO TO 6 OUTPUT 8 Ml»l CALL FETCHlJCC0RECHA),JCLIST(MFJ,D,0fJCFINE,JCC0RElMB)tMl,2J IF(H1.EC.-1)G0 TO 10 KF = 6 D(l>«l M2=l IF(C13).EQ.1)M2=U 0(l)=3 lF(C(3).EC.0)d(l)=»4 JCLIST17)=0 IF(K2.EC.1^)CALL FETCH( JCCCREC HA J , JCLI ST(6) tO,0! 14) , JCFINE, 1 JCCCRE<«B),0,3) H3=3*2»(«2/1A) HRITEJHC,105)(0{n,I=2fH3) 105 FCRKATCAH L 129, 1 14i 2 129) JCCCRE(13)=6 IF
PAGE 235

223 €••• • »••* •• ..««•.» •».! C •••• C • JIRESO • C ••••a»»««« C PURPOSE C JIRESO PERFORMS VARIABLE VALUE ADDRESS RSOLUTION C C USAGE C JlRESO(JCARBL»JCINOC,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCARBL » THE ADDRESS OF A DIVARB C JCINDC = THE ADDRESS OF AN INDEX SET C JCCLNO = A USER ASSIGNED CALL STATEMENT 10. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C NONE C C ERROR COOES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY c , c •»•>•••«•• c FUNCTION JIRESOIJCARBL, JCINDC, JCCLNO) COMMON/ALLOC/JCCOREI I) C ENTER CALL SYSENTdfS, 1,13, JCCLNO) C MA=DIMENSIONALITY-l MA=JCCORE( JCARBL )-l C COMPONENT M1=JCARBL*MA M2=JCINCC*MA-1 H3=M2H H3=JCC0RE(M3) IFCKA.LE.OGO TO 2 00 1 1=1, MA M3=M3*JCC0REJM1)»(JCC0RE(M2)-I) Ml=Ml-l 1 M2=)^2-l C MA=A0CRESS OF OFFSET 2 MA=MA+2»JCAR8L C MB=WORDS PER VALUE Hl=jCC0RE(17)tl HB=JCC0RE(Mn C WORD M1=JCC0RE(MA)*MB»(M3-1) C SEGMENT . M2='JCC0RE(17) M3=Ml/H2 H4=HA+M3»1 M4=>JCC0REIM4)

PAGE 236

224 JIRESO J1RES0=M4*MI-M3«M2 EXIT CALL SYSEXT RETURN END

PAGE 237

225 C c««»>*«* ••• • •• ••••»• •• c •••»» C JIVALU » c C PURPOSE C JIVALU HANDLES THE INPUT AND OUTPUT OF VARIABLE VALUE FILES C C USAGE C CALL JlVALU(JCLIST,JCSENSiJCFIN£tJCCLNO) c C DATA FORMAT C SEE SECEDE C C DESCRIPTION OF PARAMETERS C SEE JIRAFE C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FRHCEL C JIARBS • C JIRESO C STORE C SYSENT C SYSERR C SYSEXT C TOCELL C C ERROR COOES FOR THIS PROGRAM C CODE FATAL ERRORtOATA PROVIDED) C IF VARIABLE NOT DECLARED (VARIABLE CODE NAME) C 2 F DIMENSIONALITY MISMATCH (VARIABLE CODE NAME) C C METHOD C SELF-EXPLANATORY C c •..«•••»•• c SUCRQUTINE J1VALU( JCLIST, JCSENS, JCF INE. JCCLNO) COMMON/ ALLOC/JCCORe( I) DIMENSION JCLIST (6), JCF INE (3), 0(6), V( 4), A( 4), L( 7), P (4), R 14) INTEGER C,V,A,P,R DATA L/0,0,l,l,l.ltO/,V/l,l,l,l/,A/l,l,l,3/,P/l,l,l,l/,R/l.lflfl/ DOUBLE PRECISION VALUE C ENTER CALL SYSENTd, 5, 1,14, JCCLNO) C MA=ADCRESS OF SPUR M1=JCC0RE(15)+1 HA=JCC0RE(Ml) C MB^^AOCRESS OF LOAD Hl=Hi+l MB*JCCORE(Ml) C MC«=AOCRESS OF INDEX STORAGE Ml=Ml*l MC=»JCCORE(Ml) C L L(l)=5-4/JCLlST(2) L(2)=JCLIST{2)

PAGE 238

226 L(5J=l C HD»INPUT DATA SET M0=JCC0RE(10) C ME AND HF ARE OUTPUT DATA SETS ME^JCCOREdl) HF=IABS(JCSENS) C V(4) V(4)=JCFINEt3) Ml=H8»21 M2=KB*22 M3=JCCQRE{Ml)*JCC0RE(M2)*l M^=(M3/2J»2 IF(((V(4»-l)»(H3-M4)»JCSENS).GT.0)JCC0R£(MU=JCCORE(Hl)*l M2=MS»28 JCC0RE(H2)=— I C R(41 R(4)=«L(l)-2 MG=>R(4»*3 C IN OR OUT 0(l)=l IFIJCSENS.lt. DGO TO 3 C INPUT CALL JlARBSCJCLIST.JCFINEfl) C READ 1 READtM0,10l)(Dt I). I = 1.3),VALUE • 101 FORHATJI1,I19,I20,C40.28) IF(Dtl).EQ.0)GO TO 10 C INDICES 1F«D(3).EQ.0)G0 TO 2 MI=KC+D13)-1 READ(MD,l02l(JCC0RE(I)tI=MCfHlJ 102 F0RHAT(4I20» C DECLARATION 2 Hl=L(l> L«H1)=0(2) CALL FETCHl JCCORE « MA ) , L , L I 7 ) , P ,L , JCCORE ( MB ) ,0, 1 ) IF(H7).LE.0)CALL SYSERR(1,0« 2 J ) CALL FETCH( JCCORE (HA), L( 6), D('t),R,L, JCCORE 1MB >, 0,2) IF(0(3).NE.D(HG))CALL SVSERR(-2.D( 2) ) C DIMENSIONED IF(D(3).GT.0)D('t) = JlRES01D{A),Meil) C STORE VALUE CALL TOCELL ( JCCORE ( MA ),D( 4), VALUE, V,l) GO TO 1 C OUTPUT C ACCESS DECLARATION 3 Ml»l CALL FETCH( JCC0RE(MA),L,L(7),P,L,JCC0RE(MB),M1,3) IF(M1.EQ.-1>G0 TO 10 IFJL(7).LE.0)GO TO 9 CALL FETCH( JCC0RE(MA),Lt6),D(<»)tR,L,JCC0REIHB),0,4) C D<2) AND 0(3) Ml=L(l) 0(2)=L(H1) 0(3)=D(MG) C DIMENSIONED M1=0 IF(C(3).EQ.0)G0 TO 6 M2=MC*0(3)-l C SET INDICES TO 1 00 4 I=MC,M2

PAGE 239

227. 4 JCC0RE(I)'=1 C ADDRESS OF VALUE 5 0(4)=JlRESO(HltHC,2) C VALUE 6 CALL FRMCELCJCCOREtMAj.DCVlrDlSJtV.l) M3=V(4)t4 IF((O<5)*D(M3)).EQ.0)GO TO 7 CALL FRHCELEC.0)G0 TO 8 JCC0RE(M3)=JCC0RE(M3)*l M6=0 IFIJCC0RE(M3).LE.JCC0RE{H4))G0 TO 8 M6=l JCC0REtM3)=l M3=H3-1 M4=K4-l 8 CONTINUE C ITERATE IF(M6.E0.0)GO to 5 C INCREMENT L(L(l)) 9 MI=L{1) L{H1)=L(M1)*I 1F(L(M1).LE.JCFINE(2))G0 TO 3 C EXIT 10 CALL SYSEXT RETURN END

PAGE 240

228 C C»« ••.••••..•..B«.a»».«.« •»•• Q ••«»•»••>• C • JIVARI » C C PURPOSE . „ C JIVARI HANDLES THE INPUT AND OUTPUT FOR VARIABLE LISTS. C C USAGE C CALL JlVARICJCSPURf JCFIRS,JCHOOEtJCMTHD,JCSENS,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPUR = THE SPUR FOR TEMPORARY LIST C JCFIRS =' THE ADDRESS OF THE FIRST LIST ENTRY C JCMOOE = 1 FOR AN OUTPUT LIST AND 2 OTHERWISE C JCMTHO = THE METHOD TEMPORARY LIST C JCSENS = SEE JIDIMS C JCCLNO » A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FRMCEL C FSTLNK C JIOIHS C NEWCEL C SYSENT C SYSEXT C TOCELL C C ERROR CODES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C SUBROUTINE JIVARH JCSPUR, JCFIRS, JCHOOE.JCKTHD, JCSENS, JCCLNO) COMMON/ ALLOC/JCCOREC I) DIMENSION V113),D(4),JCSPUR»5),L(5J,PC4) INTEGER V,D,P . DATA V/4,l,t,l,2l,l,I,2,l,l,3,l,l/,0(l)/0/.P/l.l,l,l/,MH/0/ CENTER CALL SYSENTU,5,l,15,JCCLN0» C MA=SIZE WITHOUT INDICES Hl=JCC0REI17)tl0 MA=JCC0RE(M1I C MB = ADDRES"S OF SPUR Ml«JCC0RE(16)tl MB=JCC0REtMU + 5»(HA-l» c in or out if(jcsens."lt.i)go to 3 C INPUT C MC^TEMPORARY STORAGE HC='0 C MO»INPUT DATA SET H0=*JCC0RE«10)

PAGE 241

229 C ME-AOORESS OF SPUR Ml=«JCC0RE(l5)*l ME=JCC0REIM11 C MF»AOCRESS OF LOAD MF=JCCORE(HlJ C HG=SCALE FOR UNIT NUMDER Ml='JCCQRE{17)+6 MG=JCCORE(Ml) C READ 1 READ(M0,101)Ml,(DU)f 1 = 2,4) 101 FORMAKHf 119,2120) IF(m.EQ.0)GO TO 5 C GET LIST ENTRY Ml=HB*5»D»3)»JCM00E CALL NEHCELIJCC0RE(M1),H2,1) C LINK IF(JCFIRS.EQ.0)JCF!RS=M2 IF(HC.GT.O)CALL FSTLNK( jCCORE(Hl) tHCiM2,l) MC=M2 C STORE DATA CALL T0CELL(JCCaRE(Ml),M2,D,V,l) 1F{0(3).EQ.O)GO TO 2 Ml=H2+HA CALL JXDlMS(MlfD(3),2,JCM00E,l,l) C TEMPORARY LIST 2 IF(D(<^).ME.2)G0 TO I L<2)=D(2)/HG L(3)=l L(<») = 1 Ml=5-l/(L(2)+l) L«I)=M1 L(HI)=D(2)-MG»L(2) L(2)=LI2)+'> CALL F£TCH(JCCORE(ME),L,Ml,P,L,JCCORE{HF),0,l) CALL PUSH(jCSPURiJCMTHDfMl.V(4),l.l) IF(MH.EQ.O)HH=JCMTHD GO TO I C OUTPUT C MC=CURRENT LIST ENTRY 3 MC=JCFIRS C MO AND ME ARE OUTPUT DATA SETS HD=>JCCaRE(ll) HE=IA3S(JCSENS) C GET DATA 4 IF(MC.LE,1) GO TO 6 CALL FRMCeL(JCCORE(Ha),HC,P,V,l) C WRITE DATA M1=MC*HA HC=Otl) D(I)=1 WRITE(MD,102)(0CALL J IDIMS(M1,D( 3 ) » 2, JCMODEi JCSENS,2) GO TO 4 C UPDATE JCMTHO . 5 JCMTHD=HH C EXIT 6 CALL SYSEXT RETURN

PAGE 242

230 ENO

PAGE 243

231 C ...,„.. C »••• ..«»»•••# • ii»..«.o •••• C • ALPAC • C • GENERAL • Q » INFOKMATION • C • c C SPECIAL INSTRUCTIONS/DEBUG .^ C THE FOLLOWING TAOLE GIVES THE PACKAGE AND PROGRAM ID. C NUMBERS FOR ALPAC. ALL ARE ON LEVEL 4. C PROGRAM PKG. IF. /PROG. ID. C HASSAL l/l C J2ACYC 1/2 C J2AQSA 1/3 C J2CNZS 1/4 C J2G0PT 1/5 C J2MARK 1/6 C J2MINC 1/7 C J2N0FZ 1/8 C J2PATH 1/9 C J2SHIT I/IO C J2T0SA l/ll C SPEDUP 2/1 C J2F0UR 2/2 C J2GRUP 2/3 C J2PREC 2/4 C J2R0WP 2/5 C J2TACV 2/6 C BEMAON 3/1 C J2CP0T 3/2 C J2ELEM 3/3 C J2RECU 3/4 C J2SPRe 3/5 C J2T0WY 3/6 C C CURRENT STATUS C OPERATIONAL ADDITIONAL ROUTINES TO BE PROVIDED. C .•«,,•..».». c

PAGE 244

232 C €•••• • • • • •...•...•••••• C C • HASSAL • c c C PURPOSE C HASSAL PERFORMS THE WEIGHTED HUNGARIAN ASSIGNMENT ALGORITHM c • C USAGE C CALL HASSAL(JCGRUPiJC0FLT,JCCLNO) C C CATA FORKAT C N/A C C OESCBIPTICN OF PARAMETERS C JCGRUP = THE ACDRESS OF A GENDER GROUP. IF JCGRUP IS 0, C CUCGEL WILL BE USED TO GENERATE A CROUP. C JCOFLT = IF CALL BY OFAULT AND OTHERWISE C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C CUDGEL C CFAULT C FETCH C FIND C J2ACYC C J2A0SA C J2CNZS C J2HARK C J2MINC C J2N0FZ C J2PATH C J2SWIT C J2T0SA C J7CSUP C SINCIN C SIMGEN C SIMOPT C STORE C SYSENT C SYSERR C SYSEXT C C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERROR{DATA PROVIDED) C I NF IMPOSSIBLE TO MAKE COMPLETE ASSIGNMENT (ADDRESS C OF SIM8L) C C f-ETHOO C HASSAL AUTOMATICALLY PROVIDES A GENDER LIST AND/OR AN SIM C IF NECESSARY. C c ••««• c SUBROUTINE HASSAL( JCGRUP, JCDFLT,JCCLN0» COf^CN/ALLOC/JCCOREU) DIMENSION G(A),0(10),C(4),C(4),P(7),N(4),F(A),L(2)

PAGE 245

233 INTEGER G.O.CfOtPtF DATA G/l,8,l,l/,0/3f 12,1,1,13, If It 5, 1,17, C/l, 6 a, l/tO/O, 0,0,0/ 1 I P/2,5,l,l,6,l,l/,N/l,10,l,l/,F/l,5,l,l/,L/l,0/ C ENTER CALL SYSENT«l,A.l,l,JCCLNOJ C ACCESS GROUP AND SIM KA=JCCFLT IF(JCDFLT.eQ.O)CALL DFAULT J JCGR'JP,HA,2, 1 ) C MB=ACCRESS OF SPUR FOR ORDINATE il=HA*2 MB=JCCQREtMl)-5 C MC-ADDRESS OF SPUR FOR ELEMENT MC^KB-5 C MO=ADCRESS OF LOAD FOR ROW MAIN MO='J70SUP(MA,l,0,0,l) C HE=»ADCRESS OF L0AD(8) FOR ROW MAIN ME=fD*7 C HH=ADCRESS OF LOAD FOR COLUMN MAIN MH=J70SUP(MA,1,1,0,3) C MISADDRESS OF L0AD(8) FOR COLUMN MAIN Mis MH^7 C ZERO THE OUTPUT ASSIGNMENT H2) = l-JCC0REtME» 1 Ml = l CALL FETCH! JCC0RE'0PT(MA,JCCCREIHEI,C(2),-I,l) C ITERATE IF(C(1).EO.O)GO TO 1 Kl=JCCCREiMl) .' IFCKl.GT.OJGO TO 2 GO TO I C DUPLICATE MAINS 4 CALL SIMCUPCMA, 1,3,0, 1» CALL SIl'CUPtMA, 1,3,1,2) C SUBTRACTION STEP MI=0 Al M2=f«0 M3=KE M0=0 5 L«2)=1-JCC0RE{M3) . M4=JCC0RE(H4) DO 8 1=1, M4 CALL FETCh«JCC0RE(KB),L,D,P,L,JCC0RE(M2),0,2) IF(C(1).EC.O)GO TO 6 0(l)-0 GO TO 7 6 M5*0 IF(Ml.NE.2)M5=>J2MIKC(MC,D(2),M0,l)

PAGE 246

234 0(11=J2NCFZ{HC,0(21,M5,MO,1» 7 L{2»=0 CALL STGREI JCC0RE(na),LtD,NtLtJCC0RE(M2),l) 8 L(2)-l GO TO (81.41r'})tHl 81 M2=MH H3=fl M0=1 GO TO 5 C ACYCLIC ASSIGNMENT 9 CALL J2ACYC(MA,2tl) C TEST FOR COMPLETE OUTPUT ASSIGNMENT 10 L(2)=l-aCC0Re(MEJ H2=l CALL FIND(JCC0RE(Me),LiD(3),F,L,JCC0RE(MD),Hl,l) IFIMI.EC.OGO TO 16 GO TO (11.12)iH2 C ARBITRARY ASSIGNMENT 11 CALL J2ACSA{MA,H1,1) M2=2 IFtKl.EC.OGO TO 10 CALL J2ACYC(MA,1,2> GO TO 11 C MARK ROWS AND COLUMNS 12 CALL J2MARK{MA,Hl,H3tl) IFIM1.EC.0)G0 TO 13 CALL J2SWIT(MA,M1,M3,1.1) GO TO 10 C SEARCH FOR STEHARO PATH 13 CALL J2PATH
PAGE 247

.235 C C » »»»»O«0#. •••» ••••••••• c C • J2ACYC • C •• c C PURPOSE C J2ACYC IS THE RUDD AND WATSON ACYCLIC ASSIGNMENT ALGORITHM. C C USAGE C CALL J2ACYC(JCSPTR,JCHO0E,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCKOOE = I FOR COLUMNS ONLY OR 2 FOR BOTH ROWS AND COLUMNS C SEE J2MINC C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUSTt FOR SOME MACHINES. C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FIND C FRMCEL C J70SUP C LOCATE C SIMCIN C SIMFLG C SIHOPT C STORE C SYSENT C SYSERR C SYSEXT C TOCELL C C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERROR(DATA PROVIDED) C 1 NF NO ELEMENT WITH ZERO COST (-ROW NUMBER OR C COLUMN NUMBER) C 2 NF ELEMENT SHOULD HAVE POSSESSED NON-ZERO FLAG C (-ROW NUMBER OR COLUMN NUMBER) C C METHOD C SELF-EXPLANATORY C c •»•••••••» c SUBROUTINE J2ACYC( JCSPTR, JCMODE, JCCLNO) COMMON/ALLOC/JCCOREH ) DIMENSION P(2),S(2),Z(7),N(
PAGE 248

i236 HB=J70SUP(JCSPTRilf0f0il) C MC=ADORESS OF LOAD FOR COLUMN MC=J70SUPUCSPTR, 1,1,0,2) C MD=AOCRESS OF L0AD(8) FOR ROW MD»MB*7 C • MEsAODRESS OF L0AD(8) FOR COLUMN HE=HC»7 C MF=ADDRESS OF SPUR FOR ELEMENT HF=HA-5 C INITIALIZATION MPC=MD MS=HC MSC=ME C MG=INCICATOR HG=«1 IF(JCMG0E.EQ.1)G0 TO 5 C HH=NUHBER OF ER ASSIGNMENTS THIS PASS MH=0 C FIND PRIMARY WITH ONE ZERO 1 P(2)=1-JCC0RE(MPC> N(2>=5-MG 2 Hl = 3 CALL FINDJJCC0RE(MA),P,0,Z,P,JCC0RE(MP),H1,1) IFJH1.EQ.0)G0 TO 5 C LOCATE ELEMENT WITH ZERO COST P(2)=0 CALL FETCHl JCC0RE(MA),P,M1,C(4),P,JCC0RE(HP),0,1) 3 CALL LOCATE(JCCORE(MF),Ml,H2,0(2),C,MG,l) IF(M2.EQ.0JGO TO 6 •C GET SECONDARY ENTRY NUMBER " CALL FRMCELIJCC0RE{MF),M2,S(2),N,1» S(2»=S12)-JCC0RE{HSC) C GET SECONDARY FLAG CALL FETCH(JCC0RE(MA),S,Hl,ZI4),S,JCC0RE(MS),0,2) IFIMI.NE.OGO TO 7 C OUTPUT ASSIGNMENT Ml=JCCORE(MD) H2=JCC0RE(ME) CALL SIM0PT(JCSPTR,M1,M2,1,U P(2I=0 . CALL FETCHlJCC0RE(MA),P,M3,0,P,JCC0REtMB),0,3) IF(K3.GT.0)GO TO 4 CALL SIKCIN(JCSPTR,Ml,0,-l,l,D(2),C(4),l) CALL SIMFLG(JCSPTR,M1,0,2,0,I) GO TO 41 . 4 HH=MH+1 41 CALL SIMCIN(JCSPTR,M2,l,-l,l,D(2J,C(4),2) CALL SIMFLG(JCSPTR,M2, 1,2,0,2) C ITERATE P(2)=l GO TO 2 C LAST PASa 5 IF(
PAGE 249

237 GO TO I ABORT PRIMARY M1=JCCCRE«M0)»(-1)»«MG CALL STORE(JCCORE(MA),P,DJ2»,2(A)tPtJCCORE(MB),l) CALL SYSERR(ltHl) P(2»=l GO TO 2 ABORT SECONDARY CALL T0CELL(JCC0RE«MF),M2,HltZ<4),l) Ml=-jCCORE(ME)«(-l»i>»MG CALL SYSERR(2,Ml) Hl»M2 GO TO 3 EXIT CALL SYSEXT RETURN ENO

PAGE 250

23 8 C c«»» •••• •• •••»» • ....».»•. c •«••. C • J2A0SA • C • c C PURPOSE C J2A0SA MAKES AN ARBITRARY OUTPUT ASSIGNMENT C C USAGE C CALL J2A0SA(jCSPTRf JCSORF.JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPTR = THE ADDRESS OF THE SIMBL C JCSORF = I FOR SUCCESS OR FOR FAILURE C JCCLNO = A USER ASSIGNED CALL STATEMENT 10. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FIND C FRHCEU C J70SUP C LNKBWO C LOCATE C SIHCIN C SIMFLG C SIHOPT C STORE C SYSENT C SYSERR C SYSEXT C C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERROR(DATA PROVIDED) C 1 NF ELEMENT IN COLUMN WITH ZERO COST AND ZERO FLAG C CANNOT BE FOUND (COLUMN NUMBER) C 2 NF ROW COES NOT HAVE ZERO FLAG (ROW NUMBER) C 3 NF NO ROW WITH ZERO FLAG FOUND (COLUMN NUMBER) C C . METHOD C SELF-EXPLANATORY C c •••••••••• c SUBROUTINE J2A0SA( JCSPTR, JCSORF, JCCLNO) COMKON/Al.LOC/jCCORE{ I). DIMENSION V12),F(4),C(4),E(7),R(4),B(7),D(4),H(2) INTEGER V,F,C,E,R,C,B,H DATA V/U0/,F/l,5,I,l/,C/l,10.l,l/,E/2,5,l,l,6,l,l/,R/l,3,l,l/, I B/2,5,1>1, 10, 1,1/, D/0, 0,0,0/, H/ 1,0/ C ENTER CALL SYSENT(l,'t. 1.3, JCCLNO) C MA*A0CrESS of spur FOR ORDINATE Ml=JCSPTR+2 HA=JCC0RE(Ml)-5

PAGE 251

239 C MB=ADDRESS OF LOAD FOR ROW MB»J70SUPCJCSPTR, 1,0,0,1) C HC=ADDRESS OF LOAD FOR COLUMN MC=J70SUP(JCSPTR, 1,1,0,2) C MO=ADDRESS OF L0AD(8) FOR ROH M0=MB*7 C ME=AOORESS OF L0A0(8) FOR COLUMN ME«HC*7 C HF=AOCRESS OF SPUR FOR ELEMENT HF=MA-5 C MG=MINIHUH COUNT HG=0 C MH=COLUHN NUMBER MHaO C MI=MINIMUM COUNT MI=0 C MJ=ROW NUMBER MJ=0 C FIND A VARIABLE WITH FLAG V(2)=1-JCC0RE«M£) 1 JCSORF^l CALL FIND{JCCOSEIMA),V,0,F,V,JCCORECMC).JCSORF,1) IF«JCSORF.EQ.0)GO TO 2 C UPDATE MINIMUM COUNT V(2)=0 CALL FETCH(JCCORE(MA),V,Ml,C,V,JCCORE(MC),0il) V(2)-l IF((MG»(M1-HG+1)).GT.0)G0 TO 1 MG=M1 MH=JCC0RE(Mc» GO TO I C END OF SEARCH FOR VARIABLE 2 IF(MG.EC.0>GO TO 8 V<2)=MH-JCC0RE{HE) CALL FETCH{JCC0RE(HA),V,M1,E(4),V,JCC0REIMC),0,2) C LOCATE ELEMENT DO <, 1 = 1,MG IF1M1.EG.0)G0 TO A CALL LOCATEtJCCORE(HF),Hl,M2,O.E,2,l) IF(M2.EQ.0)G0 TO 5 CALL FRMCELC JCC0RE(MF),M2,H(2),R,U H(2J=H(2)-JCC0R£{HDJ CALL FETCHIJCC0RE(MA),H,D(3),B,H,JCC0RE(MB),0,3) IFIDt3).NE.0)G0 TO 6 IFC(MI»(D14)-MItl) ).GT.O)GO TO 3 Ml=0(4) MJ=JCCORE(MO) 3 Ml=LNK0WD(JCCORE(HF),M2,l) tf CONTINUE C END OF SEARCH FOR EQUATION IF«MI.EG.0)G0 TO 7 C OUTPUT ASSIGNMENT CALL SIK0PT(JCSPTR,MJ,HH,1,1) CALL SII-CINIJCSPTR,MJ,0,-l»l»0,E(4).l) CALL SIHFLG{JCSPTR,MJ,0,2,0,l) CALL SIHCIN(JCSPTR,MH,1,-1,1,D,E<4),2» CALL SIMFLGIJCSPTR.MH, 1,2,0,2) JCSCRF=l 60 TO 8 5 Ml^-O 0(4)=MG-I*1 ABORT REMAINDER OF COLUMN

PAGE 252

240 0(3)=0 IF(0(4).EQ.MG)0
PAGE 253

241 C . . c»» • •••• •••*•••..» c •••• C • J2CNZS • C ..»o«.»»o» c C PURPOSE C J2CNZS CREATES NEW ZERO COST ELEMENTS FROM THE UNASSIGNEO C BALANCE OF THE SIM. C C USAGE C CALL J2CNZS
PAGE 254

242 MC=M8+7 C H0=AODRESS OF LOAD FOR ROW WORKING HD=J70SUP(JCSPTR,3,0,bt2) '< C HE=ADCRESS OF LOADIB) FOR ROW WORKING ME=KD*7 C HF=ADORESS OF LOAD FOR COLUMN MAIN MF=J70SUP(JCSPTR,l,lf0f3) C MG=ADCRESS OF L0A0I8) FOR COLUMN MAIN MG=KF*7 C MH=ADDRESS OF LOAD FOR COLUMN WORKING HH=J70SUP(JCSPfR,3f IfC't) C MISADDRESS OF L0AD(8) FOR COLUMN WORKING MI=KH*7 C MJ=iAOORESS OF SPUR FOR ELEMENT MJ=MA-5 C INITIALIZATION JCSORF=0 0(1)=0 012)=0 N{2)=4 C ML=MINIMUM COST ML=-l C FIND ROW WITH NO MARK 1 L(2)=.1-JCC0RE(ME) 2 M5=«l , . CALL FINDtJCC0RE(MA),Lf0fHiLtJCC0RE(M0)iM5,l) IFCMS.EQ.OSGO TO 7 C LOCATE UNMARKED ELEMENT LC2)=0 . CALL FETCHt JCCORE(HA),L.M5,CfLtJCCORE(MO)fOtH 3 CALL FRnC£LIJCC0RE(MJ),H5,L(2)iN,1) L(2J=L{2)-JCC0REtHI) CALL FETCHlJCC0RElMA),L.D<3).M,L,JCC0RE(MH),Ot2) 1F<(0(3).£Q.I).CR.(0(*).GT.O))GO TO 4 JCSOftF=l CALL FRMCEL ( JCCOREt MJ ) , H5, M6,C, 2 ) IFt(HL»(M6-ML)).LT.0JML=M6 C ITERATE 4 M5=L«3» IFCMS.GT.OGO TO 3 5 L(2)=l GO TO 2 C SUBTRACT ML FROM ALL UNMARKED ELEMENTS r ADO ML TO ALL DOUBLY MARKED ELEMENTS C LEAVE SINGLY MARKED ELEMENTS UNCHANGED 7 L(2J=1-JCC0RE(MC) N(2)=4 8 Ml=l C MM=NUM8ER OF ZERO'S IN ROW CALL FETCH( JCC0RE(MAJfLtMM,K,L,JCC0R£IHB)tMl,3) IF(Ml.£Q.-l)GO TO 14 C GET ROW FLAG AND MARK L(2)=JCC0RE(NC)-JCC0R£IHE) CALL FiiTCH(jCC0RE(MA),LfD,M,L,JCC0RE(M0),0,4) IF(D
PAGE 255

>43 GET COLUMN MARK AND FLAG LJ2)=0U)-JCC0RE(Mn CALL FETCH(JCC0RE(MA),L,0t3),M,LtJCC0RE(MH),0,6) IF«C(3».E0.1)G0 TO 12 M3-M1 IF{0(4».GT.0)M3=H3*l H4=l IF(M3.EQ.1)G0 TO 12 ADJUST ELEMENT, COST CALL FRMCEL(JCC0REG0 TO 9 L(2)=0 CALL ST0RElJCC0RE(MA),LfMM,K,L,JCCORE(Ha),2) 13 L(2)=l GO TO 8 . EXIT 14 CALL SYSEXT RETURN END

PAGE 256

244 C C**«>>«*«*»>«>»0*>«»«»«« •».... o«* • • ••• C • J2G0PT • C • •••» c C PURPOSE C J260PT ESTABLISHES GROUP BODY OUTPUT VARIABLE LIST ENTRIES C C USAGE C j2G0PT(JCFUNCf JCVARI,JCFLAG,JCMOOE,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCFUNC = THE FUNCTION AUXILIARY BLOCK OR IF UNOIMENSIONEO C JCVARI= THE VARIABLE AUXILIARY BLOCK OR THE VARIABLE NAME C IF UNDIMENSIONcD C JCFLAG = THE ROW FLAG „ ,, C JCMOCE » IF THE VARIABLE IS UNOIMENSIONEO AND 1 OTHERWISE C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER c . ' C REMARKS . ,, C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C J7C0MV C J7IC0H C NEWCEL C RETURN C SYSENT C SYSEXT C TOCELL c • C ERROR COOES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C C •»...»••• c FUNCTION J2G0PT( JCFUNC, JCVARI, JCFLAG, JCMOOE, JCCLNO) COHKON/ALLOC/JCCORE( 1 ) DIMENSION L(6),D(2),F(7>,N(4),X{4),G110) INTEGER D,F,X,G , , . ^ ., DATA L/5,C,0,0,l,0/,F/2,5,l,l,l,l,I/.N/l,8,l,l/,X/l,l,l,l/,G/2, 1 21, 1«I. 2, 1,1, 21, 1,1/ C ENTER CALL SYSENTd, 4, 1,5, JCCLNO) C HA=DISPLACEMENT FOR OUTPUT M1=JCC0RE(17)*10 MA=JCC0RE(M1) C , MB=A0DRESS OF SPUR FOR OUTPUT H8=JCCCRE(16)*1 MB=JCC0RE(H3)*5»MA-5 C MC=UNIT SCALE Ml=Ml-4 MC=JCC0RE«H1)

PAGE 257

245 C MD«AODRESS OF SPUK FOR SECEDE Ml=JCC0RE(15)*l MO=JCCORE(Ml) C ME=ADDRESS OF LOAD FOR SECEDE 11) Hl=Hl»l ME=JCC0RE(M1) H1=ME*28 JCCCRE(MH = -1 C HF=ADDRESS OF LOAD FOR SECEDE t2) MF=M1*2 C ADJUST CURRENT VALUE POINTER IN GIMBL Hl=JCC0REtl6)*8 KG=JCC0RE(H1) JCC0RE(M1»=JCFUNC*3 C HH=LENGTH OF A SCALAR VARIABLE Ml=JCC0RE(l7)*3 MH=JCC0RE(Hl> C GET J2G0PT Hl=JCVARI+2 Hl=fB*5»JCC0RE(Ml)«JCH00E CALL NEHCEL(JCC0RE(Hl),J2G0PT,l) IF(M1.EQ.MB)G0 TO 71 IFIJCFUNC.EQ.O)GO TO 5 c t Hl=JCFUNCtl L(2)=JCC0RE(M1J/MC H3) = JCFLAG+6 L(A)=JCC0RE(M1)-HC«L(2) C ACCESS FUNCTION CALL FETCHtJCCQRElM0J,L,L(6),F(4),L,JCC0RE(ME),0,l) C ACCESS CONSTITUENT 1 CALL FETCHt JCC0RE(M0»,L15),0,F,L,JCC0RE(HE),0,2> 1FID<1).NE.I)G0 TO 3 C GET NAME L(6>=0 CALL FETCHt JCCORE(MD),LtO,N,Lf JCCORE(HE)f0f3) Dll)=0(l)+HC»L(2I CALL J7COHV{MD,0(l>.MFil) Ml=JCVARI+l IF(C(1).NE.JCC0RE(M1))G0 TO 3 C COMPUTE INDICES Ml=Ml»l CALL J7ICOMtM0fHH,MBf J2G0PT»MA,l,JCC0RE(Hl),ME,M2,l) M2=J2G0PT*HA-l H3=0 M4=JCC0RE(Hl) DO 2 1=1, M4 IFIM3.EG.1)G0 TO 2 H1=M1*1 H2=M2*1 IF(JCC0RE(M1),NE.JCC0REJM2))H3=1 2 CONTINUE IF(M3.E0.0)G0 TO 4 . C ITERATE IFlD{2).GT.0)D(2)=i 3 L(5)=0(2) lF(Ll6).Gt.0)G0 TO 1 C ERROR Ml=JCFUNC*l CALL SYSERR(l,JCCORE{Ml)) Ml=JCVARI+2 Ml«MB*JCC0RE(Ml»»5

PAGE 258

246 CALL R6TURN(JCC0RElHl),J2G0PT,J2G0PT,n J2G0PT»0 GO TO 8 TRANSFER INDICES FROM SECEDE 4 L(&» = l-H
PAGE 259

247 C C><»««>«»*«* »• • » * .». .•••••••! c • C • J2MARK » c •• c C PURPOSE C J2MARK PERFORMS HARKING OF ROWS AND COLUMNS WITHOUT A FULL C OUTPUT ASSIGNMENT. C C USAGE C CALL J2MARK(JCSPTRf JCRNUM.JCCNUM.JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPTR = THE ADDRESS OF THE SIMBL C JCRNUM = OR THE ROW NUMBER OF AN ELEMENT FOUND TO BE C TRIPLY MARKED C JCCNUM = ANALOGOUS TO JCRNUM, BUT FOR THE COLUMN C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C . C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FIND C FRMCEL C JTOSUP C J70TPT C LOCATE C SIMINT C SYSENT C SYSEXT C C ERROR CODES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C , c .».•••••». c SUBROUTINE J2MARK( JCSPTR, JCRNUM, JCCNUM, JCCLNO) COKf^CN/ALLOC/JCCOREd) DIMENSION Pt2),S(2),FU),C(4J,N(7),D«8),M(lO),L('^) INTEGER P,S,F,C,0 DATA P/l,0/,S/l,0/,F/l,5,I.l/,C/l,6,l,l/,N/2,4,l,l,5,l,l/,0/0,0t 1 0,0,0, 0,0,0/, M/3, II, I, It 12, I, 1,13, 1,1/, L/1, 1,1,1/ C ENTER CALL SYSENfd, 4, 1,6, JCCLNO) C HA=ADCRESS OF SPUR FOR ORDINATE HlsJCSPTR+2 MA=JCC0RErHl)-5 C MB=A0CRESS OF LQAD FOR ROW MAIN HB=J70SUPiJCSPTR,l,0,0,l) i C MC=A0DRESS OF LOAD FOR COLUMN MAIN MC=J7OSUP«JCSPTR,l,l,0,2) j C MD=ADDRESS OF LOAD FOR ROW WORKING

PAGE 260

.248 MD»J70SUP(JCSPTR,3,0,0,3) C ME-AOCRESS OF LOAD FOR COLUMN WORKING ME=J70SUPtJCSPTRt3,ltO,4) C MF=ADCRESS OF L0ADC8) FOR ROW MAIN MF=HB*7 C MG»ADCRESS OF L0A0(8) FOR COLUMN MAIN MG=KC*7 C MH-ADCRESS OF L0AD(8) FOR ROW WORKING HH=MD^7 C MI=ADCRESS OF L0A0(8) FOR COLUMN WORKING HI=HE*7 C MJ-ADDRESS OF SPUR FOR ELEMENT MJ=MA-5 C MK=INDICATOR MK— 1 C INITIALIZATION JCRNUM=0 JCCNUM=0 C FIND PRIMARY WITH ZERO FLAG 1 P<2)=l-JCC0RE(MF) N(2»=5-MK L(2)=MK 2 Ml = I CALL FIND(JCC0RE(MA),P,0,F,P,JCC0RE(M3)tMl,l» IFIMI.EQ.OGO TO 12 C GET POINTER P(2)«0 CALL FETCHCJCCORE(HA)iP,MltCfPf JCCORE(MQ),Oil) C LOCATE ELEMENT WITH ZERO COST 3 CALL L0CATE(JCC0RE(HJ),M1,M2,D,C,MK,1) IF(M2.EQ.0IG0 TO 11 C GET SECONDARY NUMBER AND STATUS FLAG CALL FRMCEL(JCCORE«MJ),M2,D(2»tN,l) IF{D(3).EQ.l)G0 TO 10 C GET SECONDARY MARK S(2) = D(2)-JCCORE(Hn CALL FSTCH(JCC0RE(MA),S,Dl2),M,SiJCC0RE(ME),0f2) IF((0(4)»(MK-1) ).EQ.O)GO TO 8 C GET OUTPUT OF SECONDARY 4 SU) = JCCORE(MI )-JCCORE(MG) CALL FETCH( JCCOR£(MA),StD(5),M,StJCCORElMC»i0i3) IF(D(7).EQ.0)G0 TO 8 IF(0(6).EQ.0)GO TO 6 C ACCESS OUTPUT ASSIGNMENT (AND MARK OF OUTPUT) M1=DI7)*1 5 D(7)=JCC0RE(H1) 6 P(2)=D(7)-JCC0RE{HH) CALL FETCH< JCC0RElHA),PfD(8)fM(7),P,JCCORE(HD)f0.'») IF(0I8).GT.0)G0 TO 7 C ITERATE IF(0(6).EQ.O)GO TO 8 M3=Ml-l M1=JCC0RE(H3) • IF(M1.GT.0)G0 TO 5 CO TO 8 C TRIPLE MARKED 7 JCCNUH=JCOORE(Mn JCRKUM=JCCORE(MH) IFCHK.EC.IIGO TO 8 JCCNUH=JCCORE(MHJ JCRNUM=JCCORE(Mn C MARK SECONDARY

PAGE 261

249 8 IF(D(4).GT.0)G0 TO 9 CALL SIMINT(JCSPTR,l,3,Ml,l» CALL J70TPTlJCSPTR,JCCORe{Mn,Ml,2tJCCORE(HF),l) CALL SIMINT{jCSPTR,l,3tMl,2» ITERATE 9 IF( JCRNUM.GT.O)GO TO 13 10 CALL FRMCELlJCC0RE
PAGE 262

250 C C • .0«0«««B»##,0»«»..« ••• C •• C • J2HINC • C • c C PURPOSE C J2HINC FINDS THE MINIMUM COST ELEMENT OF A ROW OR COLUMN. C C USAGE C J2KINClJCSPURtJCFIRStJCR0RC,JCCLN0) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPUR = THE ADDRESS OF THE SPUR FOR ELEMENTS C JCFIRS = THE ADDRESS OF THE FIRST ELEMENT C JCRORC = FOR ROHt 1 FOR COLUMN C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINESf C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FRMCEL C SYSENT C SYSEXT C C ERROR CODES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C c ••••«•»••• c FUNCTION J2M INC J JCSPUR, JCF IRS t JCRORC, JCCLNO) COMMON/ ALLOC/JCCOREl IJ DIMENSION C(I0),D(3) INTEGER CD DATA C/3fltltli5,l,l,6,l,I/ C ENTER CALL SYSENTCl,*, 1,7, JCCLNO) C INITIALIZATION J2HINC=-l CC2)=1+JCR0RC M1=JCFIRS C EXAMINE ELEMENT 1 CALL FRMCEL
PAGE 263

251 C c»»» • ..••.».*..»». •< c ••• C • J2N0FZ • c «•«•..».•• c C PURPOSE C J2N0FZ PERFORMS THE SUBTRACTION AND COMPUTES THE NUMBER OF C ZERO'S. C C USAGE C J2N0FZtJCSPUR, JCFIRS.JCMINCJCRORCJCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCMINC = MINIMUM COST FOR ROW OP. COLUMN C SEE J2MINC FOR ALL OTHER PARAMETERS C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME HACHINESt C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FRMCEL C SYSENT C SYSEXT C TOCELL C C ERROR CODES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C c •••••»««.• c FUNCTION J2N0FZ(JCSPUR,JCFIRS,JCMINC,JCR0RC,JCCLN0) COMMCN/ALLOC/JCCOREd) DIMENSION C(10),D(3I INTEGER CO DATA C/3,l,ltl,5«l,It6,l>l/ C ENTER CALL SYSENTd.'t, 1,8, JCCLNO) C INITIALIZATION J2N0FZ=0 C(2)=1*JCR0RC M1»=JCFIRS C EXAMINE ELEMENT 1 CALL FRMCEL{JCCORE(JCSPUR),Ml,D,C,l» IF(0(i2J.NE.0>G0 TO 2 D(3»=D(3»-JCMINC |FID(3).EQ.0)J2N0FZ=J2N0FZ*l CALL T0CELL(JCC0RE(JCSPUR).Hl,D«3),C(7),l) 2 Ml=0(l) IF(Ml.GT.Q)Ga TO I C ^ EXIT . CALL SYSEXT RETURN END

PAGE 264

2 52 C c»«**«»»*« • • •••• • c •••• C • J2SHIT • C •...» c C PURPOSE C J2SW1T PERFORMS THE OUTPUT ASSIGNMENT ADJUSTMENTS FOR A C STEWARD PATH. C C USAGE C CALL JZSHITtJCSPTRf JCRNUM.JCCNUH.JCMODEtJCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCMOOE = I OR 2 AS RESPECTIVELY THE TRIPLE MARK HAS C DISCOVERED BY J2MARK OR BY. J2PATH C FOR THE OTHER PASSED PARAMETERS SEE J2MARK. C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. c ' C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FIND C J70SUP C J70TPT C LNKFHD C LOCATE C SIMCIN C SIMFLG C SIMINT C SIMOPT C SYSENT C SYSERR C SYSEXT C C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERROR(OATA PROVIDED) C I NF NO OUTPUT FOR MARK ( ROW NO. OR COLUMN NO. » C 2 NF NO MARK FOR OUTPUT (+ ROW NO. OR COLUMN NO.) C C METHOD C J2SHIT ELIMINATES THE APPROPRIATE ROW AND COLUMN MARKS. C c ••• c SUBROUTINE J2SWIT( JCSPTR.JCRNUM.JCCNUM, JCMOOE, JCCLNO) COMMON/ALLOC/JCCORE( 1) DIMENSION L<2),H(71iK(4),0{3),R{2),C«2>,E(lO),F(7) INTEGER C,0,R,E,F DATA L/lr0/,M/2,l2,l,l.l3,l,l/.K/l,6,l,l/,D/0,O,0/,E/3,12,l,1.13, 1 1, 1,13, 1,1/, F/2, 2, I, I, 2, 1,1/ C ENTER CALL SYSENTd, 4.1. lOiJCCLNO). C MA=ADCRESS OF SPUR FOR ORDINATE Hl=JCSPTR*2 MA=JCC0RE(Ml)-5 C MB=ADCRESS OF LOAD FOR ROW MAIN

PAGE 265

253 MB=J70SUPCJCSPTR,1,0,0,IJ MC=ADDRESS OF LOAD FOR C3LUHN HAlN MC=J70SUP(JCSPrR,l,l,0,2) MD=AOCReSS OF LOAD FOR ROW WORKING MO=J70SUP{JCSPTR,3iO,0,3) HE=AODR£SS OF LOAD FOR COLUMN WORKING Me=J7CSUPlJCSPTR,3,l,0,4) MF=AOCRESS OF LOA0(8) FOR ROW MAIN MF=HB«-7 MC=MCt7 MH-MO+7 MI=ME*7 MJ=l HK=1 MG^AOORESS OF L0AD{8) FOR COLUMN MAIN MH=ADCRESS OF L0AD(8) FOR ROW WORKING MI=ADORESS OF L0ADJ8) FOR COLUMN WORKING MJ=INOICATOR MK=INDICATOR INITIALIZATION E(l)=JCMODE*l ML=JCRNUM MM=JCCNUM MN=0 F(1)=JCM0DE BREAK OUTPUT ASSIGNMENT 1 CALL SIMFLG(JCSPTR,HL,0,0,1,1) CALL SIKCIN(JCSPTR,ML,0,1,1,D,K,I) CALL SIMFLGJJCSPTR.MM.l.OtliZ) CALL SIMCIN(JCSPTR,MH,l,l, 1,0,K,2) CALL SIMOPT(JCSPTR,ML|MH, -1,1) IF(HK.EQ.3)C0 TO 6 GET MARKS 2 M1=HL M2=MD M3 = MH 3 L12)=MI-JCC0RE(M3) CALL FETCHJ JCCORE(HA),L,D<2),M,L,JCCORE(M2),0,l) IF(D(3).EQ.0)G0 TO 12 IF(D12).EQ.0)G0 TO <» Ml=0(3)+1 0<3)=JCC0RE(H1» 4 C(MJ)=0t3) IFJM2.EC.MD)R(MJ)=C
PAGE 266

254 MN=0t3)*l 0(3»=JCC0RE
PAGE 267

255 IFIK5.EC.0)G0 TO 20 22 CALL J70TPT(JCSPTR,JCC0RE
PAGE 268

"256 C c»«««»» • ••• • • • c • ••• C • J2T0SA • c c C PURPOSE C J2T0SA TRANSFERS AN OUTPUT SET ASSIGNMENT FROM AN SIH TO A C GENDER GROUP. C C USAGE C CALL J2T0SA(JCGRUPtJCSPTRtJCCLN0) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCGRUP = THE ADDRESS OF THE GENDER GROUP C JCSPTR = THE ADDRESS OF THE SIHBL C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FORSOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FIND C FRMCEL C FSTLNK C J2C0PT C J2TA0V C SEARCH C TOCELL C SYSENT C SYSEXT C C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERRORIDATA PROVIDED) C 1 NF NOT ENOUGH GROUP BODIES (NUMBER OF ROWS) C 2 NF NO OUTPUT ASSIGNMENT (RUW NUMBER) C 3 NF TOO MANY OUTPUTS (ROW NUMBER) C 4 NF INCOMPLETE OUTPUT ASSIGNMENT (ROW NUMBER) C C METHOD C J2T0SA MUST NOT BE EMPLOYED IF REARRANGEMENT OF THE BODY OF C JCGRUP HAS OCCURRED SINCE SIM GENERATION. C c SUBROUTINE J2T0SA( JCGRUP, JCSPTR, JCCLNO) COMMON/ ALLOC/JCCORE( 1) DIMENSION R(2),C(2),K(4),GJ7),F('i),H(19),Vtl0),P(4),D(ll),SU). I 0(4) INTEGER R,C,G,F,H,V,P,0,S,0 DATA R/l,O/,C/lf0/,K/l,1.1/,P/1. 2 l8,l,l/rS/l,7,2,2/,0/l,20,I^l/ C ENTER CALL SYSENTd, 4, 1,11, JCCLNO) C MA=ADCRESS OF SPUR FOR ORDINATE M1=JCSPTR»2

PAGE 269

257 MA=JCC0RE(Ml)-5 C MB=ADCRESS OF LOAD FOR ROW MB=J70SUP(JCSPTR,l,0.0,l) C R Hl=M8*7 RI2)=l-JCC0RE(Ml) C MC=NUMBER OF ROWS Hl = KUl MC=JCC0RE(H1) C MO«ADCRESS OF LOAD FOR COLUMN ' H0=J70SUP(JCSPTRilf l.OiZ) C ME^AOCRESS OF L0AD{8» FOR COLUMN HE=K0*7 C MF=ADCRESS OF SPUR FOR GROUP BODY M1=JCC0RE(16)+1 K2=JCC0R£(17)*9 MF=JCC0REIMl»+5»JCC0RE(H2»-5 C HG=TRACE KEY CALL FRKCEL{JCCORE(MF),JCGRUP,HG,K,l) C MH=TEMPORARY LIST POINTER MH=0 C HI=LEVEL H1=0 C HJ=LEVEL OF PROTECTED GROUP MJ=»0 C MK=CURRcNT LIST ENTRY MK=JCGRUP C ML=OVER-RIDE INDICATOR HL=0 C DO LOOP 00 10 1=1, MC IFIHL.EQ.DGO TO 3 C LIST ADVANCE 1 Ml=f«K M2=-l D(l)=l DI2)=2 CALL SEARCH(JCC0REI16),M1,MK,D,G,MG,M2.H1.HH,1) 1F{H2.EC.0)G0 TO 11 2 1F((MJ»(HJ-MI)).LT.O)GO TO I MJ=0 IF(M2.E0.2)G0 TO 3 C GROUP CALL FRMCEL(JCC0RE(MF),MK,M1,F,2) IF(Ml.E0.1)MJ=MI GO TO I C GROUP BODY C SIM ACVANCE 3 CALL FETCH1JCC0RE(«A),R,D13),H,R,JCC0RE(MB),0,1» IF(0(6).GT.0)CALL SYSERR( 't, JCCORE( HE ) ) C PREPARE FOR J2G0PT CALL ML=0 M2=0 IFC0(4).LT.3)G0 TO 4 ML=1 GO TO 10 4 M1=0 IF(D(3).GT-0)M1=D(5) CALL FRMCEL(JCC0RE(MF),MK,016),0,3) C«2)=Dt8) IF(D(7).EQ.0JG0 TO 6 5 M3=D«8)*1

PAGE 270

258 C(2)=JCC0REJM3» 6 IF«C(2).E0.O)GO TO 12 C(2)=C12)-JCC0RE(ME) b(6)=D{6)-l C ACCESS OUTPUT CALL FETCH(JCCORE(MA),C,0(9),V,CtJCCQRE(HO»f0i2» C CALL J2G0PT H3=H2 M2=J2G0PT(H1,D« 11 ) ,D( A) ,D( 10) , I ) C LINK . IFCM3.GT.0)G0 TO 7 M3=M2 CALL TOCELL( JCC0RE(HF),HK,M3fPtl) GO TO 8 7 CALL FSTLNKUCC0RE(MF),M3,H2,l» C ASSIGNMENT FLAG M3=0 IF(D19).E0.1)H3=1 CALL T0CELL(JCC0RE(HF),H2,M3,G«4),2) C ITERATE 8 IF(0(7».EQ.O)GO TO 9 H3=0(8) D(8)=JCC0RE(M3) IF(0(8).GT.0)GO TO 5 C END OF LOOP 9 IF(0(6).NE.0)G0 TO 13 10 R(2)=l C(2)=l-JCCaRE(ME) 0(l)=0 MH=0 101 Ml=l CALL FIN0(JCC0RE(MA),C,D,Hn6),C,JCCORE(HO)fHl,l) IF(M1.EQ.0)G0 TO 102 C12)=0 CALL FETCH(JCCORE«MA),C,0(2),V,C,JCCORE(HD),0,3) Ml=J2TACV(0{4)tO(2),0(3)il) CALL FSTLNK{JCC0RE(MF»,M1,MM,2) MM=H1 CI2)=1 GO TO 101 C EXIT 102 M1 = JCC0REU7)*8 M2=JCC0RE5»(M2-Ml» CALL T0CELL(JCC0RE(Ml),JCGRUPtMM,S,3) CALL SYSEXT RETURN C NOT ENOUGH GROUP BODIES 11 CALL SYSERR(ltMC) GO TO 10 C NO OUTPUT ASSIGNMENT 12 CALL SYSERR<2,I) . GO TO 8 ^ C MISMATCH OF NUMBER OF OUTPUTS 13 CALL SYSERR(3,JCC0RE(HE)) GO TO 10 • END

PAGE 271

259 c c»»» •«•»«• •••• •«..».» ••••••••««••• c ••» C • SPEDUP » c C PURPOSE C SPEOUP PERFORMS THE SARGENT AND HESTERBERG SPEED-UP 1 C ALGORITHM. C C USAGE C CALL SPEOUPCJCGRUPf JCMODEiJCCLNO) C C DATA FORMAT C N/A C C USAGE C JCMODE =» OR 1 AS RESPECTIVELY THE SIM IS OR IS NOT TO BE C RELEASED AT THE CONCLUSION OF SPEDUP C SEE HASSAL FOR ALL OTHER PASSED PARAMETERS. c C REMARKS C THE NUM3ER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C SPEOUP UTILIZES CUDGEL, SIMGEN AND HASSAL TO AUTOMATICALLY C PROVIDE ANY LIST STRUCTURE OR FEATURE REC3UIRED FOR THE C SPEED-UP 1 ALGORITHM. c C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C BSTLNK C CORN C OFAULT C FETCH C FIND C FRHCEL C FSTLNK C J2F0UR C J2GRUP C J2PREC C J2R0HP C J70SUP C LNKOHD C LHKFWD C LOCATE C POPUP C PUSH C RETURN C SETLNK C STORE C SYSENT C SYSEXT C TOCELL C C ERROR CODES FOR THIS PROGRAM C NONE ' C C METHOD C SELF-EXPLANATORY C c ..»»• c SUBROUTINE SPEOUP! JCGRUP, JCMODE, JCCLNO)

PAGE 272

260 COH^•ON/ALLOC/JCCORE^1) „... DIMENSION S(4),T(5),R(2),F<4),P<4),E(10».C(*»,V(10),0(4),G17),BC1I 1 .L(<>)tZ(l)tO(3) INTEGER S,T,RfF,Pf EfC,V,0,G,B,Z,0 DATA S/l,8,l,l/,T/0,0,l,C,2/,R/ltO/,F/l,l2,l,l/,P/lf6,l,l/,E/3,?, 1 l,l,21,l,1.22,l,l/,C/l.O/,V/3,4,l.l,5,i,l,3,ltl/tO/1.13,lil/.G/2, 2 3.1»lf3,ltl/iB/0/,L/l,l,ltl/tZ/-l/ C ENTER CALL SYSENT(li<»f 2,1, JCCLNO) C DEFAULT CALL 0FAULT(JCGRUP,MB,3,l) C MC=AODRESS OF SPUR FOR ORDINATE H1=M8*2 HC=JCC0REtHl)-5 C MO=ADDRESS OF SPUR FOR ELEMENT HD«HC-5 C M£=ADCRESS OF LOAD FOR ROM HE=J70SUPlMB,l,0,0,l) MF=HE*7 MC=NF*1 MG=JCCORE(MG) C HH=ADORESS OF LOAD FOR COLUMN MH=J70SUP{MB,1,1,0,2) H1=HH*7 C T , . T(l)=0 T(2)=0 M2=JCCOREtl7)*ll T(4)=JCC0R6(H2) C REPLACE OUTPUT WITH POINTER (ROUS ONLYI HAA=0 CALL J2R0WP(JCGRUP.MC,ME,T,HAA,l) C MJ=LIST 'I HEAOCELL HJ=0 C MK=LIST 3 HEADCELL MK=0 C ML=LIST 3 TAILCELL HL»0 C MM=GROUPING LIST HEADCELL MM»0 C START 00 99 1=1, MG C STEP n R(2)=I-JCC0RE(HF) C STEP III CALL FETCHC JCCORElMC)fR,Ml,F,R,JCCORE(HE»fO,l) C B IFtMl.EQ.DGO TO 99 C c CALL J2F0UR(T,MJ,MCf0,HE,l,l) C A CALL J2GRUP(T,MM,MJ,U C STEP IV A IFlMJ,EC.O)GO TO 99 CALL FRKCEL(T,HJ,0,E,2J C STEP V 5 IF(C(l».EQ.l)GO TO 4 C STEP VI . 6 MN=KJ IF(0(I).EQ.O)GO TO 62 HN=D(3» «0*MJ

PAGE 273

2 61 61 CALL FRHr.EL(T,MN,0(3),EI7)t3) 62 IFID(3).GT.0)G0 TO 63 IF(C(1).E0.0)G0 TO 9 MN=LNKFHOtTtHNil» CALL T0CELL(T,MG,MN,E(7),2) IFIMN.GT.OGO TO 61 GO TO 9 ' 63 MP=0(3) D(3)=LNKFWDIJCCORE(MO),HP,2) CALL TCCELL(T,HN,0(3),E(7»,3» C STEP VII 7 CALL FRHCELlJCC0RE(MD)»MP,C(2)fV,4) 1F(C<3).GE.3)GQ TO 62 C(2)=C«2)-JCC0RE(HI) CALL FETCHlJCCORE(MC),CiRl2)tO,C,JCCORECMH),0,2) C A IF(R(2».GT.0JG0 TO 71 C12)*0 CALL FETCH! JCCOREJ MO.Cf Ml, F,C,JCCORE(MH), 0,21) IFIMl.GT.OGO TO 62 Ml = l CALL STCRE(JCC0RE«MC),C,M1,F,C,JCC0RE(MH),10) CALL J2F0UR(T,MJ,0,0,HH,3,2) GO TO 62 C B C 2 71 IF(Rt2).EQ.ClA))G0 TO 4 R(2)=R(2)-JCC0RE(MF) CALL FETCH( JCC0RE(MC),R,M1,F,R,JCC0RE«HE),0,3) IFIMl.EQ.DGO TO 62 C I R(2)=0 CALL J2F0UR(T,M1,MC,R(2),ME,2,3) CALL J2GRUP(T,MM,M1,2) C 3 E(l)=2 CALL FR^'CEL(T,M1,D,E,5) CALL L0CATE(T,HJ,M2,D,E,l,l) E(l)=3 C B IFtH2.GT.0)GO TO 8 C A CALL SETLNK(T,M1,HJ,1) MJ=M1 GO TO 4 C STEP VIII C A 8 HQ=MJ MJ=LNKFwD(T,H2,3) CALL FSTLNKtT,M2,0,lJ HR=Ml C B Dll)=l 0{2)=2 m=po > 81 H2=-l CALL L0CATE{T,M1,M3,D,G,M2,2) IF(H3.EC.0)G0 TO 8A «l=LNKFKD(T,M3,4) IFG0 TO 82 CALL SETLNK(T,H3,HJ,2) MJ=H3

PAGE 274

262 M2=LNKBWDtTtMJ,l» CALL S6TLNK(T,M2,Ml,3l GO TO 81 82 CALL FRMCEL(T,M3,M2fE(4)i6) H4=LNKBWD(TfH3,2) CALL SETLNK(T,M4,M2,3) CALL RETURN(T,M3,M3,l) CALL LCCATE(T,M2,M«fB,L,lt3) CALL ScTLNK(T,M4,Ml,4) CALL L0CATE(T,MH,M2,M3,E<4),lt4» IF(M2.EQ.0)G0 TO 33 IF{M2.EQ.MH)MH=LNKFWD(T,HMf5) CALL P0PUP(TrM2,M2,M4,ZtliH 83 IF(Hl,GT.O)Ga TO 81 84 CALL SETLNK(T,MR,MJ,5) HJ=«R CALL PUSH(TtMM»MJ,E(4),l,l) C D(l)=2 0C2)=MQ D(3)=MQ CALL TOCELL(T,MJ,D,e,A) E GO TO 4 STEP IX 9 CALL FRHCEL(TfMJ,D,e,7) IF(Dtl».EQ.l)GO TO 93 IF(0(l).EQ.O)Ga TO 92 A 91 Ml=0(2) CALL FRMCEL(T,M1,0(2),E{4),8) 92 R|2)=D{2)-JCCORE(HF) D(2)=l CALL STOREt JCC0RE(HC),R,0{2J,F,R,JCCORE(ME)il» lF(D(l).Ne.2)G0 TO 93 D(2)=LNKFW0«T,M1,6) lFJDt2).GT.0)G0 TO 91 B 93 CALL SETLNK(T,ML,MJ,6) IF(MK.EQ.O)HK=HJ NL=MJ MJ=LNKFWD(T,MJ,7J CALL FSTLNK(T,ML^0,2) IF(WJ.GT.O)CALL BSTLNK
PAGE 275

263 EXIT CALL SYSEXT RETURN END

PAGE 276

264 C c*>>*«**** • »..•.. ••..». • c •••«...»•• C • J2F0UR • C •••* • c C PURPOSE C J2F0UR ACQUIRES LIST ENTRIES FOR LIST FOUR. C C USAGE C CALL J2FOUR(JCSPUR,JCHDCL,JCSPTR,JCOISP,JCLOAO,JCMODE, C JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPUR = THE SPUR VECTOR FOR LIST FOUR C JCHDCL = THE ADDRESS OF THE HEAOCELL FOR LIST FOUR C JCSPTR = THE ADDRESS UF THE SPUR VECTOR FOR ROW ORDINATE C JCOISP = THE DISPLACEHE^4T TO BE APPLIED TO THE LOAD VECTOR C TO REACH THE DESIRED ROW C JCLOAO = THE ADDRESS OF THE LOAD VECTOR FOR ROW ORDINATE IF C JCMODE = I OR 2. OR FOR COLUMN ORDINATE IF JCHOOE C 33 C JCMODE = AN INTEGER VALUED AT 1, 2 OR 3. IF EQUAL TO 1 OR r 2 THE NEW LIST ENTRY REPRESENTS AN SIM ROW WHICH r IS OR IS NOT THREADED ONTO LIST FOUR RESPECTIVELY. C IF EQUAL TO 3. THE NEW LIST ENTRY REPRESENTS AN C SIM COLUMN AND IS THREADED ONTO LIST FOUR. THE C PASSED PARAMETERS JCSPTR AND JCDISP ARE IGNORED IF C JCMODE = 3. C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUM3ER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C • REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C NEWCEL C SETLNK C SYSENT C SYSEXT C TOCELL C C ERROR COOES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C SUBROUTINE J2F0UR( JCSPUR, JCHDCL, JCSPTR ,JCOI SP, JCLOAO, JCMODE, 1 JCCLNO) COMMON/ ALLOC/JCCOREd) DIMENSION JCSPURl5»,D(3J,L(iq),RI2),P('») INTEGER C,R,P DATA L/3,3,l,l,21,l,1.22,l,l/,R/l,0/,P/l,6,l,l/ C ENTER CALL SYSENT(1,4,2,2,JCCLN0J

PAGE 277

265 C D(1)=FLAG 0(H=JCMO0E/3 C 0(3)=«P0INTER TO TYPE 2 LIST 0(3)=0 IF(JCH0DE.GT.2)GO TO I R(2J=JCDISP . ,. CALL FETCH(JCC0RE(JCSPTR),R,0(3)iPtRf JCCOREUCLOAO.Ofl) C DC2)=C0DE NUMBER 1 Ml^JCLOAO*? 0(2)=JCC0RE(H1) C GET NEW LIST ENTRY CALL NEHCELlJCSPUR.Ml.l) CALL TCCeLL(JCSPURiMl,0,LtU 1F(JCM0DE.EQ.2)G0 TO 2 C THREAD ONTO LIST 4 CALL SETLNKt JCSPUR.Ml, JChOCL.l) C SET JCHOCL 2 JCHDCL=Ml C EXIT CALL SYSEXT RETURN END

PAGE 278

•266 C c • •• ••••••• c • C • J2GRUP • C c . C PURPOSE C J2GRUP REPLACES A LIST FOUR ENTRY BY A GROUPING IF POSSIBLE C C USAGE C CALL J2GRUP(JCSPUR.JC6RUPf JCFOURiJCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPUR = THE SPUR FOR THE TEMPORARY LISTS C JCGRUP = THE ADDRESS OF THE GROUPING LIST HEAOCELL C JCFOUR = THE ADDRESS OF THE LIST FOUR ENTRY C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COHMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C COPY C FRMCEL C LNKFWD C LOCATE C SYSENT C SYSEXT C C ERROR COOES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C r •«••••••«• C SUBROUTINE J2GRUP( JCSPUR, JCGRUP, JCFOUR, JCCLNO) COHHON/ALLOC/JCCORE< l» DIMENSION JCSPUR{5),TtlO) INTEGER T DATA T/3^3, 1,1,21,1,1,22, 1,1/ C ENTER CALL SYSENTI1,*,2,3,JCCLN0» C GET DATA IF(JCGRUP.EQ.O)GO TO 3 CALL FRMCEL(JCSPUR, JCFOUR, MA, T(A),1) C SEARCH ' MB=JCGRUP 1 CALL FRMCEL(JCSPUR,MB,MC,T(A),2) CALL FRMCEL( JCSPUR, MC,MD,Tl<»), 3) CALL LCCATt( JCSPUR.MO,Ml,HA,T(A),l,l) IFtHl.GT.OIGO TO 2 MB= LHKFWDi JCSPUR, MB, H IF(KB.GT.O)GO TO 1 * GO TO 3 C GROUPING FOUND 2 CALL COPY(JCSPUR, HC, JCFOUR, T, I)

PAGE 279

C EXIT 3 CALL SYSeXT RETURN END 267

PAGE 280

268 C ....... C****»»»*» * • •«.•»• c C • J2PREC • c ••• c C PURPOSE C J2PREC REARRANGES A GROUP BODY ACCORDING TO THE PRECEDENCE X ORDER INDICATED BY LIST THREE. C CALL J2PREC(JCGRUPiJCSPUR,JCL0DR.JCL0DC,JCTSPRf JCTHREt C JCTEMP.JCCLNO) C C.; DATA FORMAT C N/A C DESCRIPTION OF PARAMETERS C JCLOOR = THE ADDRESS OF THE LOAD FOR ROWS C JCLODC = THE ADDRESS OF THE LOAD FOR COLUMNS C JCTHRE = THE ADDRESS OF THE LIST THREE HEADCELL C FOR ALL OTHER PASSED PARAMETERS SEE J2R0HP. C f RPMARK^ C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C BREAK C COUPLE C FETCH C FRMCEL C FSTLNK C J2TACV C LOCATE C NEWCEL C POPUP C • PUSH C RETURN C SYSENT C SYSEXT C TCCELL C C ERROR CODES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C SUBROUTINE J2PREC(JCGRUP.JCSPUR. JCLOOR, JCLODC, JCTSPR, JCTHRE* 1 JCTEMP.JCCLNO) COHr'CN/ALLOC/JCC0RE( I) , . ^.,. DIHENSICN JCTSPR(5»,D(5),G(7),R(2),A{*),C(4),T{7),LI10),B('.),FC7), I V(2),P(10) INTEGER 0,G,R,A,C,T,B,F,V,P ,, . , DATA G/2,3,ia,21,l.l/.R/l,0/,A/l,13,l,l/.C/l,5.1,2/,T/2,21,l,l, 1 22,l,l/,L/3»3,l,l,8,4,4,7,2,2/,B/l,7,l,l/,F/2,3,l.l.3,l,l/,V/l,0/ 2 ,P/3, 9, 1,1, 5, I, 1,7, 1,1/ C ENTER CALL SYSENTll,4,2,A,JCCLN0) C MA=ADDR£SS OF SPUR FOR GENDER GROUP

PAGE 281

269 M1=JCC0RE(16)*1 H2=JCCCR6(17)*e MA=JCC0RE(Ml)+5»JCC0RE«H2)-5 C MB=CURRENT GROUP MB=JCGRUP C HC^GRCUP BODY HEAOCELL MC=0 C HD'-PREVIOUS GROUP BODY ENTRY M0=0 C HE=CURRENT GROUP BODY ENTRY C MF=CURRENT LIST THREE ENTRY MF=JCTHRE C HG=GROUP LIST HEAOCELL HG«0 C MH=DECISION VARIABLE LIST MH«0 C NEXT ENTRY ON LIST THREE 1 1F C BREAK LINKS CALL FRMCEL(JCC0RE(MA),ME,D,C,1) M1=0(1) IFtKl.EC.OGO TO 4 DO 3 1=1, Ml 3 CALL 8REAK( JCC0RE(16),HE,0,1,0,1) 4 Ml=0(2) IFJUl.eC.OGO TO 6 DO 5 1=1, Ml 5 CALL BREAKIJCC0RE(16),0,ME,1,0,2) C SET LINKS 6 IFIMD.GT.OGO TO 7 HC=ME CALL tOCELL(JCCORE(MA),MB,HC,B,l) CO TO 8 7 CALL CCUPLEJJCC0RE(16),M0,ME,O,0,O,l) 8 MD=ME IF(M1.GE.0)G0 TO 1 MB=-M1 HC=0 «0=0 MF»=D(2» GO TO 1 C GROUPING 9 DC3)=H8 0<4)=KF CALL PUSH(JCTSPR,MG,0(3»,T,l,l) CALLNEWCEL(JCC0RE(MAI,M1,1» M3=Ml*JCC0Re(M2)-l D(3)=l 0U)=1 0(5)=MH CALL T0CELL(JCC0RE(MA),M1,0(3),L,2) HE=M1 Hl>=-Hl HH=0

PAGE 282

270 GO TO 6 END OF GROUPING 11 IF(KG.EQ.O)GO TO 13 HD=HB CALL P0PUP(JCTSPR»HG,HG,0(3)iT»1.2) MB=0(3) MF=D(Al GO TO 1 DECISION VARIABLE 12 IF(NF.EQ.0)GO TO 11 Hl=-1 0(3)=b 0C4)=2 CALL LOCATE (JCTSPR,HF,M3,0( 3»,F, Ml, 1) IF(H3.EC.0)G0 TO 11 IFIHl.EC.DGO TO 1 Ml=JCL0CC+7 V(2)=0C2)-JCC0RE(M1) CALL FETCH( JCCOREJ JCsPUR),V,D{3),P,V,jCCbRE(JCL00C),0t2» Fl=J2TA0V(D(3),DJ4),Ot5),l) CALL FSTLNK«JCC0RE(HA),M1,HH,1) MH=M1 GO TO 1 RELEASE GROUPS ON TEMPORARY LIST 13 IFUCTEMP.EC.OGO TO 14 • CALL POPUPJ JCTSPR, JCTEMP,JCTEMP,M1,G»'»),1,3) CALL RETURN(JCC0RE(MA),M1,M1,1I 60 TO 13 EXIT 14 CALL SYSEXT RETURN END

PAGE 283

271 C c »••.•• ••• •••• ••••>••••••>» •••••I c ••• • C • J2R0WP • c •••••••••• c C PURPOSE C J2R0WP REPLACES THE ROW OUTPUT WITH A POINTER TO A GROUP C BODY, ENTRY. C C USAGE C CALL J2R0WP(JCGRUPtJCSPUR,JCL0AD,JCTSPR,JCTEHPfJCCLN0) C C DATA FORMAT C N/A C • C DESCRIPTION OF PARAMETERS C JCGRUP = THE ADDRESS OF A GENDER GROUP C JCSPUR = THE ADDRESS OF THE SPUR FOR SIM OROINATES C JCLOAO = THE ADDRESS OF THE LOAD FOR ROWS C JCTSPR = THE TEMPORARY LIST SPUR C JCTEMP = A LIST REFERRING TO INNER UNPROTECTED GROUPS C JCCLNO » A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUSTi FOR SOME MACHINESi C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FRMCEL C NEXT C PUSH C STORE C SYSENT C SYSERR C SYSEXT C C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERROR(DATA PROVIDED) C I NF END OF GROUP BODY (CURRENT ROW NUMBER! C C METHOD C SELF-EXPLANATORY c SUBROUTINE J2R0WP( JCGRUP, JCSPURt JCLOAO, JCTSPRt JCTEMP, JCCLNO) COHKCN/AULOC/JCCOREJ 1) DIMENSION R(2),K(<»),0(2),F{4),GIA),A(7),JCTSPR(5) INTEGER R,0,F,G,A DATA R/ 1, 0/, K/ 1, 4, I, 1/, F/ 1,3, If 2/, G/ 1,21, 1,1/, A/2. 13, 1,1, 12, 1,1/ C ENTER CALL SYSENTtl, ',2,5, JCCLNO) C MA=AODRESS OF SPUR FOR GENDER (GROUP) M1=JCC0RE(16)*1 H2=JCC0REtl7)+a MA=JCC0REIHl)*5*JCC0RE(M2)-5 C MB=KEY CALL FRMCEL(JCCORE(HA),JCGRUP,Ma,K,l) C MC=LEVEL HC=0 C MD=INCICATOR

PAGE 284

272 c

PAGE 285

273 C •,•••, C*»«>«i>«*»««» ••• c • C • J2TADV » C .•«....••• c C PURPOSE C J2TA0V PREPARES A TEAR OR DECISION VARIABLE LIST ENTRY FOR C A GROUP. C C USAGE C J2TA0V(JCVARI,JCFLAG,JCMO0E,JCCLN0) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS .„„„>.,, or .m ctM C JCVARI = A VARIABLE CODE NAME OR THE ADDRESS OF AN SIH r AUXILIARY DATA BLOCK IF JCHODE=l C JCFLAG = FOR ALGORITHMIC SELECTION AND I FOR PRECHOSEN r JCHODE = FOR UN0IM6NS I0N60 AND 1 OTHERWISE C JCCLNO = A USER ASSIGNED CALL STATEMENT 10. PARAMETER C C "^^"^THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C NEWCEL C SYSENT C SYSEXT C TOCELL C C ERROR COOES FOR THIS PROGRAM C NONE C C METHOD C " SELF-EXPLANATORY C c • FUNCTION J2TADV(JCVARI,JCFLAGfJCM00E, JCCLNO) COHMON/ALLOC/jCCOREd) DIMENSION D(3).V(10) INTEGER 0,V DATA V/3,2,1,1,3,1,1,21,1,1/ C ENTER CALL SYSENT(1.'»,2.6,JCCLNQ) C HA=OISPLACEMENT FOR OUTPUT M1=JCC0RE(17)+I0 MA=JCC0RE(M1J Q MB=ADCRESS OF SPUR FOR OUTPUT MB=JCC0RE(16)*I M8=JCC0RE(MB)*5«MA-5 IF(JCM0DE.EQ.0)G0 TO 1 Ml=JCVARl*l MB=MB+5«JCC0RE(M1» C GET LIST ENTRY I CALL NEWCEL{JCCQRE(M0),J2TADV,l) C STORE DATA Dll)=0 D(2)=JCFLAG

PAGE 286

274 0C3)=JCVARI IF(JCM0D(:.E0.0)GO TO 3 D«U = JCC0REIM1) 0(3)=JCC0RE
PAGE 287

275 C C« •• • o....» •.••»>«ei C o.».. C * BEMOAN • C c C PURPOSE C BEMOAN PERFORMS THE BARKLEY AND HOTARO MINIMUM TEAR C ALGORITHM. C C USAGE C CALL BEMOAN(JCGRUPiJCMODE,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C SEE SPEDUP c C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C HEMOAN EMPLOYS OFAULT AT OPTION LEVEL THREE. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C OFAULT C FETCH C FRMCEL C FSTLNK C J2CP0T C J2SPRE C J2TACV C J2T0WY C J70SUP C RETURN C SIKRTV C SPEDUP C STORE C SYSENT C SYSEXT C TOCELL C C ERROR CODES FOR THIS PROGRAM C NONE c. C METHOa C SELF-EXPLANATORY C C SUBROUTINE BEMOAN( JCGRUP, JCMODE, JCCLNO) COMMON/ ALLOC/JCCORE( U DIMENSION L(A),D(3),F(2),Z(10),G(4),T(7),N(7) INTEGER D,F,Z,G,T DATA L/3,5,l,l/,F/l,0/,Z/3,l't,l,l,3,l,l,4,l,l/,G/l,7,3,3/, I T/2,.l,l»li2,ltl/.N/2,7,l,l,9,l,l/ C ENTER CALL SYSENTJ If 'ff3i I, JCCLNO) C MA=AODRESS OF SPUR FOR GROUP M1 = JCC0RE«16)H H1=JCC0REIH1J H2=JCC0RE(17)*8

PAGE 288

276 MA*Hl*5«JCCORE(M2>-5 C MB=AODRESS OF SPUR FOR TEAR VARIABLE M2>H2»2 MB=Hl»5»JCC0REtH2)-5 C MC=AOCReSS OF SIMBL CALL DFAULTCJCGRUP.HCfOf 3t 1) C MD=ADORESS OF SPUR FOR ORDINATE m=>HC*2 MD=JCCCRE(Kl)-5 C ME=AOCRESS OF LOAD FOR COLUMN WORKING , ME»J70SUP(MC>5f 1.0,1) MF=ME»7 C ESTABLISH WORKING ORDINATE MG=J70SUP(MC^l. It0i2) MH=MG*7 Ml=HG+a DO I 1=1,3 1 01I)=0 H2=JCC0RE(M1) Ml = m+13 FI2>=JCC0RE(M1) DO 2 1=1, H2 . CALL STORE(JCCORE(H0),L(Ml),D,Z,F,JCCORElHE),l) 2 Ml»3 . L{1)=1 C RELEASE CURRENT TEAR VARIABLES CALL FRMCEL(JCCORE(MA»,JCGRUP,Ml,G,l) IF(Ml.EQ.O)GO TO 4 3 CALL FRMCEL
PAGE 289

277 C LARGEST NUMBER OF INTERVALS H2=J2CP0T(MCtMEtU IF(M2.GT.0)G0 TO 7 C UPDATE JCGRUP CALL T0CELLCJCC0REIHA»,JCGRUPfMI,G,2) C ADJUST SIM CALL S I MRTV( JCGRUP, H C PRECEDENCE ORDER CALL SPEOUPC JCGRUP, JCMOOE.JCCLNO) C EXIT CALL SYSEXT RETURN END

PAGE 290

278 C €«•••••• •• ••••• * C ••• C • J2CP0T • C •••• c C PURPOSE C J2CP0T FINDS THE INTERVAL APPEARING IN THE MAXIMUM NUMBER C OF OTHER INTERVALS. C C USAGE C J2CP0T(JCSPTRtJCL0DW,JCCLN0) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C SEE J2RE0U C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C CORN C FETCH C FIND C FRHCEL C J2RECU C J70SUP C LNKBWO C LNKFWO C LOCATE C POPUP C PUSH C SYSENT C SYSEXT C C ERROR COOES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C c FUNCTION J2CP0T(JCSPTR,JCL0DW,JCCLN0J COHMON/ALLOC/JCCOREdl DIMENSION L(2),F('f),D(3),P(7),R(^),C(4»,0(4),T(5),NU) INTEGER F,0,P,R,C,0,T DATA L/l,0/,F/lf l'f,l.l/,D( l)/0/,P/2, 13, 1,1 ,6,1 , l/,R/l ,3,1 , 1/,C/1 , I 4,l,l/,0/l,13,l,l/,T/0,0,l,3,3i/,N/l,l,3,3/ C ENTER CALL SYSENT{1,4,3,2,JCCLN0) C MA=ADCRESS OF LOADIB) FOR COLUMN WORKING MA=JCL00W*7 C MB=AOCRESS OF LOAD FOR COLUMN MAIN MB=J70SUPlJCSPTR,l,l,0,l> MC=MB*/ C M0=>A0DRESS OF LOAD FOR ROM MAIN MD=J70SUP(JCSPTR, 1,0,0,2) i HE=HD*7

PAGE 291

279 C MF^AODRESS OF SPUR FOR ELEMENT Hl=JCSPTR*2 JCSPR0=JCC0RE
PAGE 292

GO TO I a CALL CORN(Ttl) EXIT CALL SYSEXT RETURN END 2 80

PAGE 293

2 81 C *...... C*««»*>««*«>**«*««*« •••••• ..•...*.«••».••. c •••• C • J2ELEH » r ••'•o»»»i»»C C PURPOSE C J2ELEM USES THE OUTPUT OF A COLUMN TO FIND A PRECURSOR TO C THE COLUMN. C C USAGE C J2ELEM(JCSPTR,JCL0DWtJCN0RA,JCH00E,JCR0WN,JCCLN0) c C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C. JCSPTR = THE POINTER TO THE SIHBL C JCNORA = A COLUMN NUMBER IF JCMODE « 0, OR THE ADDRESS OF r AN ELEMENT IF JCMODE = I C JCMODE = TO ACCESS THE FIRST ROW ELEMENT AND 1 TO ACCESS C THE NEXT ROW ELEMENT GIVEN THAT A ROW HAS ALREADY C BEEN ACCESSED C JCROWN = THE ROW NUMBER C FOR ALL OTHER PASSED PARAMETERS SEE J2REDU C C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT, c C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FRMCEL C J2RE0U C J70SUP C LNKFWD C • SYSENT C SYSEXT C C ERROR COOES FOR THIS PROGRAM C NONE C " . C METHOD .,,..c:u C JCMODE IS AUTOMATICALLY CHANGED FROM TO 1J2ELEM C RETURNED AS INDICATES FAILURE. C c •••• c FUNCTION J2ELEM( JCSPTR, JCLODW, JCNORA, JCMODE, JCROWN, JCCLNO) COMMON/ ALLOC/ JCCORE ID DIMENSION L(2), 0(4), P(4),E(*) INTEGER 0,P,E DATA L/l,0/,0/I,l3,l,l/,P/l,6,l,l/,E/l,4,l,l/ C ENTER CALL SYSENT(1,4,3,3,JCCLN0) C MA=ADCRESS OF LOAD FOR COLUMN MAIN HA=J70SUP(JCSPTR, 1,1,0,1) MB=HA*7 . C MC=ADCRESS OF LOAD FOR ROW MAIN MC=J70SUP« JCSPTR, 1,0,0,2) MD=MC*7 C INITIALIZATION OF J2ELEM

PAGE 294

282 J2EtEM=>0 C HE=AOCRESS OF SPUR FOR ELEMENT Hl»JCSPTR*2 JCSPR0=JCC0RE(MlI-5 M£»JCSPR0-5 C MODE 1F(JCN0RA.EQ.0)G0 TO A IF(JCH0DE.EQ.lJGO TO 2 Q GET OUTPUT OF COLUMN H2J=JCNCRA-JCC0REIMB) CALL FETCH( JCCOREC JCSPRO)fLtHliO.Lf JCCORE(HA»,0,1) IFCMl.ee.OGO TO 4 C ACCESS ROW L(2)=Ml-JCCaRE(H0) ,. „ ,. CALL FETCm JCCORE{JCSPR0)iLfJCN0RA,PfL,JCCORE(MC) t0f2) C ACCESS ELEMENT 1 IFCJCNORA.EQ.OOO TO 4 CALL FRMCEL(JCC0R£(ME),JCN0RA,M2,E,1) C REDUCE M2 M3=J2RECU(JCSPROiJCLODW,M2tl) JCHOOE=l 1FIM3.GT.O)GO TO 3 C ADVANCE 2 JCNORA=LNKFHDCJCCORE(ME)iJCNORA,l) GO TO I C SUCCESS 3 JCROWN=JCCORE
PAGE 295

283 C C»«»«»t •••.«•• .•••• ...«•«•.«•• «..»« c •••• C • J2PATH • C •• ••• c C PURPOSE C J2PATH DEVELOPS STEWARD PATHS. C C USAGE C CALL J2PATHIJCSPTR,JCRNUM,JCCNUM,JCCLN0) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C SEE J2HARK C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C SEE J2MARK C C ERROR CODES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C c • •• c SUBROUTINE J2PATM( JCSPTR, JCRNUM, JCCNUM, JCCLNO) COMMON/ALLOC/JCCOREJ I) OIMENSICN F(7), 0(71, R«A),C12),ZC'»),N(10),L(4), 0(4) INTEGER F,0,R,C,Z,C DATA F/2.l2,l,l,5, l,l/,0/2,12,l,l.l3,l,l/tR/l,0,0/,C/l,0/,Z/l,6,l, 1 l/,N/3,3,l.l,4,l,l,3.1f l/.L/l,l.l,l/ C ENTER CALL SYSENTd.-^, 1,9, JCCLNO) C MA=AOORESS OF SPUR FOR ORDINATE MI=JCSPTR*2 HA=JCC0RE(Ml)-5 C M8=ADCRESS OF LOAD FOR ROM MAIN MB=J70SUP(JCSPTR,l,0,0,l) C . MC=AODRESS OF LOAD FOR COLUMN MAIN MC=J70SUP( JCSPTR, 1,1, 0,2 I C HD=A0CRESS OF LOAD FOR ROW WORKING MD=J70SUP(JCSPTR,3,0,0,3) C ME=ADDRESS OF LOAD FOR COLUMN WORKING ME" J70SUP( JCSPTR, 3, 1,0,4) C MFsAOCRESS OF L0AD(8) FOR ROW MAIN MF=M8*7 C MG=AOOR£SS OF L0A0(8) FOR COLUMN MAIN MG«HC*7 C . MH=ADORESS OF L0AD(8) FOR ROW WORKING MH=M0*7 C MI«ADDftESS OF L0AD(8) FOR COLUMN WORKING MIaME*7 C MJ^MARK MJ»0

PAGE 296

2 84 C INITIALIZATION JCRNUM=0 JCCNUM=0 C MK^INCICATOR MK=0 C ML=INDICATOR HL=«0 c hm=aooress of spur for element C ' " FIND ROW WITH OUTPUT ASSIGNMENT 0«l)=l 0(2)=2 R12)=1-JCC0RE(MF) 1 Ml=~l CALL FIND(JCCORE(MA),R,D,F,R,JCCORE(MB),Ml,l) IF(Hl.EQ.O)GO TO I'i C GET ROW MARK MO=JCCORE{HF) R«2)=JCC0RE(MF)-JCC0RE
PAGE 297

285 5 CALL FETCH(JCC0RE(MA)fC.H9>ZiCtJCC0RE(M2)t0tA} 6 H2»=KK CALL L0CATE«JCC0REtHM),H9,Hll,D,ZVMK,l) IF(MH.EQ.O)GO TO 7 CHECK OUTPUT CALL FRMCEL(JCC0R£(HM),M11,R<2),N,1) CC2)=RI3)-JCC0RE(MG) CALL FETCH( JCCORE(MA),C,H12iO«A),Cf JCC0RE(MC)f0,41) IF(M12.EG.R(4))G0 TO 61 CHECK MARKING R<2>»=RC2)-JCC0RE(H7I CALL FETCH( JCCORE(MA),R,M12tO(4),Rf JCC0RE(M3),0f5) IF(M12.EQ.0JG0 TO 8 61 CALL FRMCEL(JCC0RE(MH),M11,M9,L,2) IF CALL FETCH( JCC0REJHA),R,D(3),0,R,JCC0RE(Ml),0i6) 1F(0J4).EQ.0160 TO II M10=0 IF(0(3).EQ.0)G0 TO 10 MlO'OCt) 9 Mll=MlO+l HlO=JCCaRE(M10) D{4)=JCC0RE(Nll) MARKS 10 C(2)=Di4)-JCC0REIM8) CALL FETCHt JCC0RE(MA),C,Ml2,O(4),C,JCC0RE(M4),Ot7) IF«M12.GT.0)G0 TO 13 ITERATE IF«M10.GT.O)GO TO 9 11 IF(HL.EQ.O)GO TO 12 MN=ML GO TO 2 12 R«2)=M0-JCC0RE{HF)tl 60 TO 1 TRIPLE HARK 13 JCRNUH=JCC0RE(M5I JCCNUM=JCC0RE(M8) IF{MK,eq.2)G0 TO 14 JCRNUH^JCCNUM JCCNUM=JCC0RE«H5) EXIT 14 CALL SYSEXT RETURN '^ END

PAGE 298

286 C c»<»»»»« •••• •••••» c ••••• C • J2RE0U • c •..«•..... c C PURPOSE C J2RE0U REDUCES A PRECURSOR TO AN INTERVAL. C C USAGE C J2R£0U(JCSPRO,JCLO0W,JCCNUM,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPRO = THE ADDRESS OF THE SPUR FOR ORDINATE C JCLODW = THE ADDRESS OF THE LOAD FOR THE WORKING ORDINATE C JCCNUM = THE COLUMN NUMBER OF THE VARIABLE OF INTEREST C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C fiPMARK^ C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C SYSENT C SYSEXT C C ERROR CODES FOR THIS PROGRAM C NONE -.x C METHOD C SELF-EXPLANATORY C C ..•«»o»«.» FUNCTION J2REDU(JCSPR0,JCL0DW,JCCNUM, JCCLNO) COKfON/ALLOC/JCCOREl I) DIMENSION L12>.P«7),D(2) INTEGER P,D DATA L/l,0/iP/2fl*tl,lf 3f Itl/ C ENTER CALL SYSENT«l,^i3»A, JCCLNO) C MA^ADCRESS OF L0ADI8) MA=JCL0DW+7 ' ' . C L L(2)=»JCCNUM C INITIALIZE J2RE0U J2REDU=JCCNUH C ACCESS FILE ENTRY 1 L(2)=L(2)-JCC0RE
PAGE 299

2 87 C»» • .»..•••.•..•••...» • ..— C • J2SPRE • C "• c C PURPOSE C J2SPRE FINDS AN INTERVAL WITH A SINGLE PRECURSOR. C C USAGE C CALL J2SPRE(JCSPTRtJCLOCW,JCINTE,JCPREC,JCCNUM,JCCLNOI C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPTR = THE POINTER TO THE SIMBL C JCINTE = THE INTERVAL C JCPREC = THE SINGLE PRECURSOR OF JCINTE C JCCNUM = THE COLUMN NUMBER AT WHICH THE SEARCH IS TO C COMMENCE C SEE J2RE0U FOR ALL OTHER PASSED PARAMETERS C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME HACHlNESt C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FIND C FRMCEL C J2ELEM C SYSENT C SYSEXT C C ERROR CODES FOR THIS PROGRAM C NONE C C METHOD C J2SPRE WILL PERFORM A SECOND SEARCH FROM THE BEGINNING OF C THE ORDINATE IF ON THE INITIAL PASS THE SEARCH FAILS. IF C THE SECOND SEARCH ALSO FAILS, J2SPRE IS RETURNED AS ZERO. C

PAGE 300

c •••••••••• c SUBROUTINE J2SPRE( JCSPTR, JCLODW, JCINTEt JCPRECi JCCNUM, JCCLNO) COK>^CN/ALLOC/JCCORE(l) OIKENSICN L(2),F(4),Dll),0«4),CU) INTEGER F.OiO.C DATA L/lrO/,F/l,l4,ltl/tO/0/tO/l,l3,l,l/tC/l,4,l,l/ C ENTER CALL SYSENT(1,4,3,5,JCCLN0) C MA=AOORESS OF LOAD! 8) FOR COLUMN WORKING MA«JCLO0M*7 C L L(2)=JCCNUM-JCC0REIHA) C MB^CURRENT COLUMN MB=0 C MC» INDICATOR NC=0 C MD-COUNTER M0=0 C ME=PRECURSOR ME=0 C MF=AODRESS OF LOAD FOR COLUMN MAIN HF=J70SUPiJCSPTR,l,l,0tl) HG=HF*7 C JCSPRO Ml=jCSPTR+2 JCSPR0=JCC0RElMl)-5 C JCSPRS JCSPRS=JCSPR0-5 C INITIALIZATION JCINTE=0 JCPREC=0 C FIND COLUMN WITH ZERO FLAG 1 Hl»=l CALL FINoCJCCORE(JCSPRO).L,D,F,L,JCCORE(JCLODW),Ml,l) IF(M1.EC.0)60 TO 5 C • J2ELEM HB=JCC0RE«MA) H1 = MB M2=0 2 H3=J2ELEM(JCSPTR,JCL0DW,Hl,H2,M4,l) IF(M3.GT.0)GO TO 4 GO TO 6 C ITERATE 3 L(2)=He*l-JCC0RE{MA» M0=0 ME=0 GO TO I C TEST
PAGE 301

289 C TEST FOR LEGITIMATE SELF-LOOP 51 CALL FRHCEL(JCC0RE(JCSPRS)tMl,M5,C,l) IF(HB.EC.H5)G0 TO 2 ME=MB C SUCCESS 6 JCINTE=H8 JCPREC^iHE C EXIT 7 CALL SYSEXT RETURN END

PAGE 302

290 C €••••• •...•«o.»«#. ...»••...• •»••• C • C • J2T0WY • C •••..».».« c C PURPOSE C J2T0HY ENUMERATES TWO WAY EDGES AND SELECTS THE MAXIMUM. C C USAGE C J2T0WY(JCSPTR,JCL00W,JCCLN0> C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C SEE J2SPRE C C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FIND C J2ELEH C STORE C SYSENT C SYSEXT C C ERROR CODES FOR THIS PROGRAM C NONE .€ • C METHOD C SELF-EXPLANATORY C c • ••• 'C FUNCTION J2T0WY(JCSPTR,JCL0DW,JCCLN0) COMyON/ALLOC/JCCoREd) DIMENSION L(2),C(A)fD(l),F(4) INTEGER C,D,F DATA L/ 1,0/, C/l, 4,1,1/, D/0/,F/l, 14, 1,1/ C ENTER CALL SYSENTd, 4,3,6, JCCLNOS C JCSPRO Ml=JCSPTR*2 jCSPR0=JCC0RE(Ml)-5 C MA=AO0RESS OF L0A0{8) FOR COLUMN WORKING HA»JCL0CW*7 C MB«=NUMBER OF COLUMNS MB=MA»l MB=JCCOREtMB) C ZERO COUNTS L(2)=1-JCC0RE(MA) DO 1 1=1, KB CALL STORE(JCCORE(JCSPRO»,L,D,C,L,JCCORE(JCLODW),1) I H2I=0 C MC=PRIMARY MC=0 C MD=SECONOARY M0»0

PAGE 303

2 91 C L LC2)»l-JCC0RE(MA) C ME^CURRENT MAXIMUM COUNT ME»«0 C INITIALIZE J2T0WY J2T0HY=0 C FIND COLUMN WITH ZERO FLAG 2 Ml = l CALL FINO(JCCORE(JCSPRO)iLtD.F,LtJCCORE(JCLOOH)tHlil) IFJMl.EC.OJGO TO 6 C PRIMARY MC=JCCORE(MA) LC2)=0 CALL FETCH(JCCORE(JCSPRO)tL,MF,C,L,JCC0RE(JCLOOH),0,l) IF(JCC0RECMA).EQ.MB)G0 TO 5 M1=MC H2=0 3 M3=J2ELEH(JCSPTR,JCL0DW,Ml,M2.MA,l) IF(M3.EQ.0)G0 TO 5 IF(M3.LE.«C)G0 TO 3 C SECONDARY M0=M3 M5=0 4 M6=J2ELEM(JCSPTR,JCLO0W,M3,M5iM7,2) IF(M6.EQ.0)G0 TO 3 IF(M6,NE.MC)C0 TO A C INCREMENT SECONDARY L(2)=MD-JCC0REIMA) CALL FETCH( JCC0REL.M8,CtL>JCC0RE(JCL00W).2) C INCREMENT PRIMARY HF=MF*1 GO TO 3 C END PRIMARY 5 L(2)=MC-JCC0RE(MA)*1 IFIMF.LE.MEJGO TO 2 ME = MF J2TCMY=MC 60 TO 2 C EXIT 6 CALL SYSEXT RETURN END

PAGE 304

192 C ^ c»»**»«« ••• • • ••.«..» ..».»•• c C • SUPPAC C • GENERAL • C • INFORMATION • C ••.#*.•• •• c C SPECIAL INSTRUCTIONS/LIST TYPE C ALL LIST TYPES EMPLOYED WITH SUPPAC MUST BE FORMARDC BACKWARD. SIHPAC USES LIST TYPES (A REMOTE APPLICATION) C AND A. GALAP USES LIST TYPE 6. NETPAC MAY BE USED WITH C ANY LIST TYPE. c C SPECIAL INSTRUCTIOnS/LENO C THE FOLLOWING DATA STRUCTURES MUST BE PERMITTED BY THE C LENDS. C SIHPAC LIST TYPE 3 C SEE LEND REQUIREMENTS FOR REMOTE. r (5 STATUS FLAGt 6 POINTER, 7 DIMENSION FLAG, 8 C TYPE FLAG, 9 CODE NAME, 10 INCIDENCE COUNT, C 11 NUMBER OF OUTPUTS, 12 MULTIPLE OUTPUT FLAG, C 13 OUTPUT) C SIHPAC LIST TYPE A C (1 HORIZONTAL LINK, 2 VERTICAL LINK, 3 ROW C NUMBER, 4 COLUMN NUMBER, 5 STATUS FLAG, 6 C ASSIGNMENT COST, 7 SENSITIVITY) C NETPAC C (I LINK, 2 LINK, 3 ID. FLAG, 4 KEY, U KEY, C 5 PATH COUNT, 5 PATH COUNT, 5 WORKING COUNT) C GALAP „^„ r SEE LENC REQUIREMENTS FOR NETPAC INNER KEY NOT REQ. C (1, 2, 3, 4, 5, 5, 5, 6 WORKING LEND, 7 NIO CODE, C 8 VALUE OF CONSTANT, 9 VARIABLE OF INTEREST C FLAG, 9 TYPE FLAG) C ^ C SPECIAL INSTRUCTIONS/DEBUG C THE FOLLOWING TABLE GIVES THE PACKAGE AND PROGRAM ID. C NUMBERS FOR SUPPAC. ALL ARE ON LEVEL 3. C PROGRAM PKG. 10. /PROG. ID. C CUDGEL l/l C SIMPAC C SIMCIN 2/1 C SIMCPY 2/2 C SIMOUP 2/3" C SIMEIN 2/'i C SIHFLG 2/5 C SIMGEN 2/6 C SIMINT 2/7 C SIMOPT 2/8 C . SIKRTV 2/9 C J7B00Y 2/10 C J7C0HV .2/11 C . J7IC0M 2/12 C J7L0DV 2/13 C J70SUP 2/lA C J7QTPT 2/15 C J7VARI 2/16, C NETPAC C BREAK 3/1 C COUPLE 3/2 C LNKBNT 3/3

PAGE 305

2 93 LNKFNT

PAGE 306

294 C c «•..••< • •••• • ,.•..••••.•«. c •• C • CUDGEL • C C PURPOSE C CUDGEL IS THE CRUDE GENDER LIST GENERATOR. c C USAGE C CALL CUOGELUCUNIT.JCGRLIP.JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCUNIT = UNIT NUMBER OR FOR ALL UNITS IN SECEDE C JCGRUP = ADDRESS OF NEH GROUP IF JCUNIT = 0, OR THE C CONTENTS OF JCC0RE(16) OTHtRWISE. C JCCLNO = A USER ASSIGNED CALL STATEMENT 10. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT FOR SOME MACHINES. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FSTLNK C J7IC0M C LNKFMO C NEWCEL C SETLNK C STORE C SYSENT C SYSERR C SYSEXT C TOCELL C C ERROR CODES FOR THIS SUBPROGRAM C CODE FATAL ERRQR(OATA PROVIDED) C 1 NF JCC0R£(16) NOT EMPTY (JCC0RE(16)) C 2 F NO UNIT (JCONIT) C 3 F NO GROUP BODY J ADDRESS OF GROUP) C C METHOD C CUDGEL GENERATES A GENDER LIST WITHOUT PARALLELISM. EACH C UNIT OF SECEDE IS INCORPORATED INTO THE GENDER LIST. C c •*• c SUBROUTINE CUOGEL( JCUNIT, JCGRUP, JCCLNO) CO^^'CN/ALLOC/JCCORE( I) DIHENSICN P14),S(4),N(A),T« 10),F{'V),V(',),B(4),G(l6),0t7),L(9) INTEGER P,S,T,F,V,C,G,D DATA P/l,l,l,l/,S/l,l,2,3/,N/l,l,
PAGE 307

2 95 HAA=JCCCRE(M1) Ml^t'l + l HAB=JCCCRE(Ml) «l=KA8*28 JCCCRe(m)=-l JCGRUP=0 ML=0 KA=l M0=JCC0RE(16) IF(MD.EC.O)GO TO 1 KE=JCC0RE(M1) IF(JCUNiT.EQ.O)CALL SYSERR(l.MO) JCGRUP=MC GO TO 2 1 CALL JIGHBL(M0.ME.MX,1) JCGRUP=0 2 Hl=JCCCRE(17)+8 HB=I'E+5»(JCC0RE(H1)*1) Ml=l'l + 1 HC=fE*5»(JCC0RE(Hl)-l» HCC=JCCCRE(Ml) IF(JCUNIT.GT.0)HA»JCUNIT GROUP 3 CALL NEWCEL(JCC0RE(M8),MF,X) CALL TCCELL(JCCCRE(MB),MF,P,T(7),l» IF(JCUNIT.EC.O)JCGRUP=MF jeCCRE(HO)=MF ACCESS RECORD I L(6)=l Hl=JCCCR£(l7)+6 MG=1 MH=JCC0RE(M1) HK=JCCCRE117)*10 MK=JCCORE(MK) ACCESS DECISION VARIABLE FILE MJ*0 5 L(n=4 L(2»=l LI3)=l L(4)=l HI = l St3)=l INSPECT DECISION VARIABLE 51 CALL FETCH( JCCORElMAA),L(MI),0,S,L,JCCORE(MAB),HG,lJ IFJKG.EG.-DGO TO 8 Ml=C(2»/MH IFnMl.NE.O).AND.«Ml.NE.MA))GO TO 71 ADO DECISION VARIABLE TO LIST HI^fK+asDO) M2 = ^^E5•(m-l» CALL NEKCELIJCC0REIM2),M3,2J CALL TCCELL(JCC0RE(M2l,M3tD(2»,T,2> IF(C{3).EC.0»GO TO 52 N(4)=3+CI3) M1=K3*HK CALL"FETCH(JCC0RE(MAA),Lt6),JCC0RE(Ml),N,L,JCC0RECMA8),0,2) SET LINKS 52 IFIFJ.NE.OGO TO 6 CALL TCCELL(JCCCRE(MB),MF,H3,V,3)

PAGE 308

296 GO TO 7 6 CALL FSTLNK(JCC0RE(M2)tMJ,M3fll 7 MJ«»'3 71 HI=6 L(7)=«C<1I IFIL(7).GT.0)G0 TO 51 C ACCESS UNIT 8 L(5)=>1 S(3)=2 0(4)=2 0(6)=1 L(3)=5 L(7)=0 H2J=HA+4 L(l)=3 Kl=l CALL FETCH(JCCaRE(MAA),L,0,PtL,JCCORE{MAB)fMl,3) 1F(MI.EC.-1)G0 TO 17 9 L<3)=L«3)*1 0(5)=L(3)-6+(L(3)/7>+(L(3)/8)»2 L(A)=1 Hll=4 Ml=l CALL FETCHt JCCORE(MAA),LfO,P,Lf JCC0RE{MAB),H1,A» IF(«1,EC.-1)G0 TO 16 C ACCESS ER, FUNCTION OR CONSTRAINT 10 L«l»=5 Mt=l CALL FETCH(JCCORE(HAA),L,0,S,L,JCCORE{HAB),H1,5» IF(H1.EC.-1)GG TO 16 0<3)=MAoMH+L{4) C ACQUIRE BROUP BODY ENTRY 11 M2=fL ML=1 CALL .J7IC0M(HAA,3fMEtMLtMCCi3fD<2),HAB,M5,l) IF(K5.EC.-UG0 TO 15 C SET LINKS 12 1F«M2.GT.0)G0 TO 13 0(7»=0 CALL TCCELLlJCC0RE«MB),MFfMLfB,4) GO TO 14 13 0(7)=1 CALL SETLNK(JCCaRE(MC)iM2,ML,l) C STORE CATA 14 CALL TCCELL(JCC0RE(MC).ML,CtGt5) IF(C(2».EQ.0)G0 TO 15 MR=— 3 GO TO 11 C NEXT ERf FUNCTION OR CONSTRAINT 15 LC4)=L(4)+1 GO TO 10 C ADVANCE TO NEXT FILE 16 IFIL(3».LT.8)G0 TO 9 C ADVANCE XO NEXT UNIT IFJPA.EQ.JCUNIT)GO TO 18 HA=FA-H IFIKG.GT.OGO TO 5 GO TO 8 . C LAST UNIT 17 IFIfA.EC.JCUNITlCALL SYSERR1-2,MAI 18 B(2)=5 0(U=0

PAGE 309

2 97 1F«ML.EC.0)CALL SYSERR(-3,MF ) IF(HL.GT.O»CALL TOCELL( JCCORE( HC) f HL.O.Bf 81 EXIT CALL SYSEXT RETURN END

PAGE 310

2 98 C C»i c c c c c c c c c c c c c c c c c c c c c c c c c c c c • c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c • SIMCIN • PURPOSE SIMCIN ADJUSTS THE COUNT OROINATES TO REFLECT THE REMOVAL OR REINSTATEMENT OF A ROW OR COLUMN. USAGE CALL SIMCIN (JCSPTR.JCENUH.JCRORCtJC SENS, JCMODE, LION, LOCALf JCCLNO) OATA FORMAT N/A DESCRIPTION JCSPTR JCENUM JCRORC JCSENS JCHOCE LION LOCAL JCCLNO OF PARAMETERS = THE ADDRESS OF THE SIM3L = THE ORDINATE ENTRY NUM3ER OF THE SUBJECT ROW OR COLUMN = FOR ROW AND 1 FOR COLUMN = +1 FOR REINSTATEMENT OR -I FOR REMOVAL = 0, 1 OR -1. WHEN EQUAL TO 0, SIMCIN OPERATES ON ELEMENTS WITH A STATUS FLAG OF 0. WHEN NOT EQUAL TO 0, SIMCIN OPERATES ON ELEMENTS WITH STATUS FLAG AND OATA ITEMS WHICH HATCH THOSE IN LION. WHEN POSITIVE, JCMOOE REQUIRES ALL DATA ITEMS TO MATCH LION. WHEN NEGATIVE, JCMOOE REQUIRES ONLY ONE OATA TYPE TO MATCH. = A VECTOR OF DATA ITEM VALUES = SEE COPY = A USER ASSIGNED CALL STATEMENT ID. PARAMETER REMARKS THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, REPLACE THE 1 IN THE NAMED COMMON STATEMENT. SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED FETCH FRMCEL J5C0MP J70SUP STORE SYSENT SYSERR SYSEXT ERROR CODES FOR THIS PROGRAM CODE FATAL ERROR(OATA PROVIDED) 1 NF COUNT ALREADY ZERO (ENTRY NUMBER) 2 NF NEGATIVE COUNT FOR JCENUM (JCENUM) HETHCD SIMCIN BREAKS NOR SETS ANY LINKS. REINSTATEMENT AND REMOVAL ARE ONLY APPARENT. SIMCIN OPERATES ONLY ON ELEMENTS WITH A STATUS FLAG OF 0. SUBROUTINE SIMCIN! JCSPTR, JCENUM, JCRORC , JCSENS, JCMOOE , LION, LOCAL, 1 JCCLNO)

PAGE 311

299 CO^^'CN/ALLOC/JCCORE ( 1 ) DIMENSION H2),Ot3),PU0),C(4),LION(l»,LOCALm INTEGER D.P.C DATA U/ 1,0/, P/ 3 f 5, I, 1,6, 1,1 f 0,1,1/ iC/1, 10, 1,1/ ENTER CALL SYSENT(l,3,2,l,JCCLN0) P(5)=6 P(8»=10 MA=JCSPTR*2 MA=JCC0RE{MA)-5 . MB=KA-5 MC=J70SUP(JCSPTR, l.JCRORCCl) M2=KC*7 L(2I=JCENUH-JCC0RE(M2) RETRIEVE POINTER AND STATUS FLAG CALL FEtCH( JCCORE(MA),L,D,P,L,JCCORElMC),0,l) 1F10(1).NE.0)G0 TO < TRACE CHAIN H1=1-JCR0RC HF=J70SUP(JCSPTR,l,Ml,0,2) «D=C{3J HE=MF+7 P(l)=3 Pl5)=JCR0RC*l PC8)=.^-JCR0RC EXAMINE ELEMENT 1 IFID(2).EQ.0)G0 TO 3 H3=D(2) CALL FRKCEL(JCC0RE(HB),M3,D,P,1) IF«D(1).NE.0)G0 TO 1 IF(JCHGOE.EQ.O)GO TO 11 Hl=JCMOCE CALL J5C0HP(JCCGRE(MB),M3, LION, LOCAL, HI, M2,l) IF(M2.EQ.0)G0 TO 1 11 M0=H0+JCSENS L(2)=D{3)-JCCORE(M£) 0J1)=0 CALL FETCHUCC0RE(MA),L,0,C,L,JCC0REIMF),0,2) 0(l) = Da)+JCSENS L(2)=0 IF(0(1).GE.0)G0 TO 2 0(l)=0 CALL SYSERRa,D(3») 2 CALL ST0RE(JCC0RE(KA),L,D,C,L,JCC0RE(HF),1) GO TO 1 SET CHAIN COUNT 3 IF(PD.GE.O>GO TO 31 H0=0 CALL SYSERR(2,JCENUM) 31 L(2)=0 ,. ,. CALL ST0RE(JCC0REtMA),L,MD,C,L,JCC0RE(MC),2) EXIT 4 CALL SYSEXT RETURN END

PAGE 312

.300 c c • C • SIMCPY • c ••"• c C PURPOSE C SIMCPY TRANSFERS DATA FROM ONE ORDINATE TO ANOTHER PARALLEL C ORDINATE. C C CALL SIHCPY(JCSPTR,JCSNUM,JCRNUM,JCRORC,LOCALSiLOCALR, C JCFINE.JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPTR = THE ADDRESS OF THE SIMBL C JCSNUM = THE NUMBER OF THE SOURCE ORDINATE C JCRNUM = THE .NUMBER OF THE RECEIVER ORDINATE C JCRORC = FOR ROW, 1 FOR COLUMN AND 2 FOR BOTH ROW AND C COLUMN C LOCALS = THE LOCAL VECTOR FOR THE SOURCE C LOCALR = THE LOCAL VECTOR FOR THE RECEIVER C JCFINE = THE FINE VECTOR FOR THE RECEIVER C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C SIMCPY CAN TRANSFER UP TO 15 DATA ITEMS AT A TIME. THE C LOCAL VECTORS SHOULD NOT SPECIFY MORE THAN 15 DATA ITEMS. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C J70SUP C STORE C SYSENT C SYSEXT C C ERROR COOES FOR THIS PROGRAM C NONE C C KETHOO C SELF-EXPLANATORY C c «••••••••• SUBROUTINE S IMCPYI JCSPTR, JCSNUM, JCRNUM, JCRORC, LOCALS, LOCALR , 1 JCFINE.JCCLNO) COKKON/ALLOC/jCCOREdJ ,^,.^.,. DIMENSION S(2),R(4).Da5),L0CALS(l),L0CALR(l),JCFINEa) INTEGER S,R,0 DATA S/1^0/,R/3, 0,1,0/ C ENTER CALL SYSENT<1,3.2,2,JCCLN0J C MAxADCRESS OF SPUR FOR ORDINATE Ml=JCSPTR+2 MA=JCC0RE{Ml)-5 C HB^ROW/COLUMN INDICATOR HB=iJCRGRC-2 •( JCRORC/ 2 t

PAGE 313

'3 01 C HC'ADCRESS OF LOAC FOR SOURCE 1 MC=J70SUP(JCSPTR,JCSNUM,MB,0,l) c s M1»^'C7 S«2)*l-JCC0RE(H1) C MD=ADORESS OF LOAD FOR RECEIVER M0=J70SUPIJCSPTR,JCRNUM,MB,0,2) C R IF(JCC0RE(M1J.NE.-1)G0 TO 2 ME«1 RI2t=jCRNUM GO TO 3 2 ME=3 Ml=H0*7 Rt4)=l-JCC0RE(M1) C MF=LIMIT 3 Ml=KC*8 MF=JCCCREJMl) C DATA TRANSFER 00 4 I^l.HF CALL FeTCH(JCCORE(MA),StD, LOCALS, S,JCCORE(MC)fOfl) CALL STGRElJCCORE(MA),R
PAGE 314

3 02 C €•••• •.»».» •••••••••«••»•• • »• C •.».» C • SIMDUP • c •••• c C PURPOSE C SIMDUP DUPLICATES THE CONTEfJTS OF ONE ORDINATE IN A SECOND C PARALLEL ORDINATE. C C USAGE C CALL SIHOUP(JCSPTRf JCMSTRtJCDUPLf JCRORCtJCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPTR = THE ADDRESS OF THE SIHBL C JCMSTR = CATALOGUE ENTRY NUMBER OF THE MASTER ORDINATE C JCOUPL = CATALOGUE ENTRY NUMBER OF THE ORDINATE TO RECEIVE C THE CONTENTS OF THE MASTER C JCRORC = FOR VERTICAL AND 1 FOR HORIZONTAL OROINATES C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C J70SUP C NEWCEL C RETURN C STORE C SYSENT C SYSEXT C TOCELL C C ERROR COOES FOR THIS PROGRAM C NONE C C METHOD C SIMDUP DUPLICATES THE CONTENTS OF EACH MASTER ORDINATE C SEGMENT IN THE CORRESPONDING DUPLICATE ORDINATE SEGMENT. C DATA TRANSFER IS WORD FUR WORD. C Q •••••»«!>»» c SUBROUTINE SIMDUPC JCSPTR, JCMSTR, JCDUPL tJCRORCf JCCLNO) COHMCN/ALLOC/JCCORE( 1) 01 MENS I ON . H 1 4 ) , F ( 4 I , L ( 4 ) INTEGER W,F ' DATA H/l.l,l,l/,L/3. 0/1,1/ C ENTER CALL SYSENTM,3,2,3,JCCLNO) C SETTING UP PARAMETERS HA=JCSPTR*2 MA=JCC0RE(MA)-5 M8=J70SUPtJCSPTR,JCMSTR,JCR0RC.0,l) MC"J70SUPI JCSPTR, JCDUPL, JCRORC.O, 2) C ACCESS MASTER ORDINATE LI2I=JCMSTR

PAGE 315

303 CALL FETCH(JCCaRE{KA»,LfMl,W,W,JCCORE, JCCORE (Ml), F» 2) t JCCORE (M2)f2) RE-SET PRE-FILE PARAMETERS IN LOAD VECTORS JCC0RE{MD»=F<1) jCCCREJME)='Ft2) JCC0REIMF)=F(1) JCCCRE(MG)=F(2) JCCCREtMHJ^O JCC0RE{MI1=0 W(A)=l CALL FETCHC JCCORE t MA ),L,M I, W,F, JCCORE! MC), 0,3) L(2)=JC^STR CALL FETCHC JCCORE (MA), L, Ml. WfF, JCCORE (MB), 0,4) RETURN TEMPORARY STORAGE CALL RETURN! JCC0RE(MA),HJ,NJ,1) EXIT CALL SYSEXT

PAGE 316

3 04 RETURN END

PAGE 317

3 05 C .........o.. C«»B**>* ..»•. ••««.»..«»• • • c .*••• C • SIMEIN » C ..»•»••«»• c C PURPOSE C SIMEIN SETS ALL NON-UNITY ROW, COLUMN AND ELEMENT STATUS C FLAGS TO ZERO. C C USAGE C CALL SIMEIN(JCSPTR,JCCLNO» 'C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPTR = ADCRESS OF THE SIMBL C JCCLNO = A USER ASSIGNED CALL STATEMENT 10. PARAMETER C i^ ftPM A RKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FRMCEL C STORE C SYSENT C SYSEXT C TOCELL C C ERROR CODES FOR THIS PROGRAM C NONE C . f METHOD r SIMEIN REINITIALIZES THE ROW AND COLUMN STATUS FLAGS FIRST. C EACH ROW IS TRACED. ALL ELEMENTS ENCOUNTERED Wl TH A STATUS C FLAG GREATER THAN UNITY ARE FITTED WITH ZERO FLAGS. C c SUBROUTINE SIME IN{ JCSPTR, JCCLNOJ COMMON/ALLOC/JCCORE( 1 J DIMENSION P(7),E(7),D(2),L{AJ INTEGER P,E,D „ , . „. DATA P/2, 6, 1,1, 5,1,1/, E/2, lilt l,5t I, l/,L/3, 1,1,0/ C ENTER CALL SYSENTdf 3t2f ^tJCCLNO) C SETTING UP PARAMETERS MA=JCSPTR*2 MA=JCC0REJHA)-5 MB=MA-5 Ml=l MC=J70SUP( JCSPTR, 1,1. 0,1) H2=HC*7 , H3=MC»8 L(4I=0 C RESET COLUMN STATUS FLAGS 1 CALL FETCH(JCC0RE(MA),HMU,0,P14),L,JCC0RE(HC),0,1) IF(Otl).GT.l)CALL ST0RE(JCC0RE(MA),L(3),LIA),P(4),L,JCC0RE(MC>,1» Ml=2

PAGE 318

3 06 IF(JCCaRE(M2).LT.JCCORE(H3))GO TO 1 C RESET PARAMETERS Hl=l HC=J70SUP{JCSPTR,l,0,0,2) M2=fC*7 M3=»HC*8 C RESET ROW STATUS FLAG 2 Call FETCH( JCC0RE(MA),L(Ml)tD,P,L,JCCORE(MCl,Ot2J 1F(DI2).GT.1)CALL STORE ( JCCORE (HA » ,L ( 3 ) ,L (4) ,P(4) ,L, JCCORE (MO ,2) Ml=2 C RESET ROW ELEMENT STATUS FLAG 3 IF(D(l».EQ.O)GO TO 4 M'V=D(1) CALL FRMC£L(JCCORE(MBJ,M'nO,Eil) IF(D(2).GT.1)CALL TOCELL( JCCORE(MB ) ,H4.L{4) ,E(4) ,1 ) GO TO 3 C LAST BOW * IFIJCC0RE(M2).LT.JCC0RE(H3))G0 TO 2 C EXIT CALL SYSEXT RETURN END

PAGE 319

307 C ...,o»« c •.»•.««.«««••••• • • c • C • SIHFUG • C • • C PURPOSE C SIHFLG SETS THE ORDINATE AND ELEMENT STATUS FLAGS TO A C SPECIFIED VALUE FOR A ROW OR A COLUMN. C C " CALL SlMFLG(JCSPTR,JCENUM,JCRORC,JCFLAG,JCMODE,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPTR = THE POINTER TO THE SIM8L C JCENUM = THE ORDINATE ENTRY NUMBER C JCRORC = FOR ROW AND I FOR COLUMN C JCFLAG = THE NEW FLAG VALUE C JCMODE = OR 1 AS RESPECTIVELY AN ELEMENT STATUS FLAG IS r ALWAYS RESET OR ONLY RESET IF THE STATUS FLAG C ORTHOGONAL TO JCRORC IS UNEQUAL TO THE CURRENT C ELEMENT STATUS FLAG C JCCLNO » A USER ASSIGNED CALL STATEMENT 10. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FRHCEL C J70SUP C STORE C SVSENT C SYSERR C SYSEXT C TOCELL C C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERROR! DATA PROVIDED) C I NF ENTRY STATUS FLAG IS UNITY (ENTRY NUMBER) C C METHOD C NO UNITY STATUS FLAG IS ALTERED. C . c •• ^ SUBROUTINE S1MFLG( JCSPTRrJCENUM, JCRORC , JCFLAG, JCMOOE, JCCLNO) COHKGN/ALLOC/JCCORE( U DIMENSION L(2),D(3),P(10) INTEGER D,P DATA L/ 1,0/, P/ 2. 5, 1,1, 5, It 1,3, 1.1/ C ENTER CALL SYSENT(1,3,2,5,JCCLN0) C INITIALIiE SPUR POINTER HA=JCSPTR»2 MA=JCC0R£(MA)-5 C INITIALIZE L VECTOR MB=J70SUP< JCSPTR, 1,JCR0RC, 0,1) M2»M8»7

PAGE 320

308 L(2)=JCeNUM-JCC0RE«M2» M2=1-JCR0RC HC=J70SUP(JCSPTR,1,H2,0,2) M0=HC*7 HE=MA-5 SET ORDINATE ENTRY FLAG P(l)=2 P(2>=6 CALL FETCHC JCCORE(HA),LtO.PiLtJCCORE(HB),0,l) L(2)=0 IF(D(2).NE.1)G0 TO 1 CALL SYSERR(l.JCENUM) GO TO 2 1 CALL STORE( JCC0RE(HA),L,JCFLAG,P«4)iLtJCC0RE(MB)il) 2 1F(DII).GT.0)G0 TQ 3 GO TO 5 SET ELEMENT STATUS FLAGS 3 Pt2)=JCR0RC*l P(l)=2*JCHO0e P(a)=A-JCRORC 4 M1=0(1) CALL FRHCEL(JCCORECME),Ml,0,Ptl) IF(jCMaCE.EQ.O)GD TO 41 L(2)=0{3)-JCCORE(MC) CALL FETCHt jCC0RE(MA),L,M2,P(4),L,JCC0RE«HC)f0t2> IFlH2.EQ.0(2))D(2)=l , , 41 IF(C(2>.NE.l)CALL TOCELLC JCCORE(ME ) ,M1 , JCFLAG,P(4) , l> IF{C(1).GT.0)G0 TO 4 EXIT 5 CALL SYSEXT RETURN END

PAGE 321

309 C ,,, c •««.«••«»•••• ••» Q • SIHGEN • c C PURPOSE C SIMGEN GENERATES AN SIM FOR A SPECIFIED GENDER GROUP. C C USAGE C CALL SIMGENJJCGRUP.JCSPTRf JCCLNO) c C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS Q JCGRUP = THE ADDRESS OF THE GENDER GROUP C JCSPTR = THE ADDRESS OF THE SIHSL C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER c C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FRMCEL C J7B0CY C J7ICCM C J70SUP C J7VARI C NEWCEL C NEXT C POPUP C TOCELL C SYSENT C SYSERR C C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERROS{OATA PROVIDED) r 1 F NO GROUP BODY NOT PROTECTED (ADDRESS OF GROUP) r 2 NF NO GROUP BODY PROTECTED (ADDRESS OF GROUP) C 3 NF JCGRUP NOT FOUND BY POST SET-UP TRACE (JCGRUP) c C F£THCO f SIMGEN INCLUDES IN THE SIM EACH ER, FUNCTION, CONSTRAINT C AND PROTECTED GROUP ENCOUNTERED IN THE GROUP BODY OF C JCGRUP. ALL GROUP BODY INSERTS ARE IGNORED, BUT OTHERWISE C THERE IS A CNE TO ONE CORRESPONDENCE OF SIM ROWS TO GROUP C BODY ENTRIES. DIMENSIONED ENTRIES ARE PLACED IN THE SIM r WITH INDICES VALUED AT THEIR MINIMUMS. GROUP BODY ENTRIES C WITH PROTECTED GROUPS ARE INSPECTED OVER THE ENTIRE INDEX C . RANGE DURING SIM CONSTRUCTION. ALL ENTRIES ARE INSPECTED C OVER THE ENTIRE INDEX RANGE DURING THE POST SET-UP TRACE. C c c SUBROUTINE S IMGEN( JCGRUP, JCSPTR, JCCLNO ) COMfCN/ ALLOC/ JCCORE ( I ) DIfEKSICN G(10),F(AI,S(A),T(4),D(8),L(5),0(2),RC7) INTEGER G,F,S,T,D,0,R ^ .. ,„ ^ « „. DATA G/3,3,2,2,7,l,A,A,l,l/,F/l,3,l,l/,S/l,8,l,l/,T/l,6,0,0/, 1 D/0,0,l,0,3,0,0,0/,L/5,0,0,Of l/,0/l,0/,R/2,7,l,l,9,l,l/

PAGE 322

310 ENTER CALL SYSENTtl,3i2,6,JCCLNO) PARAMETERS Kl*JCCCRE(l6)*l >'l=JCCCRE(Ml) M2=JCCCRE(17) R('») = JCCCRE'3-1 ME=ADCRESS OF SPUR FOR GROUP BODY M2=>'2+1 M3=^2+5 M3=JCCCRE(M3) ME=fl»5»CJCC0REJM2)+M3-l) TEST JCPOFP FOR SIM CALL FR^CEL(JCCCRE(HC)iJCGRUP.JCSPTR.S,l) IFIJCSPTR.GT.OGO TO 36 SET UP SPUR BLOCK IF(t^3.EC.b)M3=l Kl=K3+5 0C4)=Hl«5 CALL NEWCEL(C,M5,1) MF=AOCRESS OF SPUR BLOCK HF=K5*15 HG=t'F-5 MG = ACDRESS OF SPUR FOR ORDINATE INITIALIZE SPUR BLOCK H2=K5 M5=f4*2 00 I I=l»Hl JCCCRE(H2)=C«1) M2=f'2*l DC I J=2i5 JCCGREJI'2)=J2/J)»t I/Ml)»D(2)*(3/J)«(J/3) + (4/J)«(J/4)«(I+(l/n»32t 1 (2/I)»(I/2)»(JCC0RE(M5)+l)+t3/n»(I/3)»JCC0RE(M4)-3)+(J/5»»(3+ 2 (2/n«(I/2)) 1 M2=r'2+l C SET UP SIMBL M1=HF»10 CALL NEWCEL(JCC0RElMl),JCSPTRf2) CALL TCCELL
PAGE 323

311 HK-JCGRUP HL=0 MM=0 MJ=OEPTH MK»AOCRESS OF CURRENT LIST ENTRY HL=OVER-RICE INDICATOR MH»TEHPORARY LIST HEADCELL C GROUP 3 CALL FRHCELIJCC0RE(MC).MK,C,G,2» IF(«0(l)+CJ2)+ML).EQ.0)CALL SYSGRR (-1 t MK) IF{10(1)*HL).GT.D(2)»CALL SYSERR<2,MK) IF(f'L.GT.O)KL=MLtl IF{C(5).GT.0)MJ=D«5) IF«(ML.GT.O).OR.(«ML^D<1)).EC1.0))GO TO 4 C PROTECTED GROUP C MN=ROH NUMBER CALL J7BCDYlMCiPK,JCSPTRiHN.ltl) GO TO 6 C NOT PROTECTED GROUP OR AN INNER PROTECTED GROUP 4 IF(C(5).EC.0)G0 TO 6 Hl=5 5 M2=MK+HD CALL J7IC0M(MC,K2,f*Ff0t0,Ml,HJ,DtH3tl) 1F(»*3.EC.-UG0 TO 8 C NEXT LIST ENTRY 6 «I=MK D(l)=KJ 0(2)=MK MK=NEXr«JCC0REll6),Ml,D(6),l,MI,MM,D,4,l) IF(HI.GE.H2)G0 TO 10 C COMPLETE CURRENT GROUP MI=MJ-DH» HJ=C(1) M2=l 7 K3=5-K2 1F(C«M3).GT.0)CALL J7VARI ( MEtO(H3 J t JCSPTRi KN,H2,D,0,1) M2=K2*1 IF(t'2.EC.2)G0 TO 7 1F(CML»H1»MJ).EC.0)G0 TO 9 MK=CC2) GO TO 5 8 HK=K4 9 IF(t'L.GT.O)HL^HL-l lF(f I.EC.OGO TO H IFCCK.EC.OJGO TO 6 C TEST CROUP BODY LIST ENTRY FLAG 10 CALL FRKCEL{JCC0REtHE),MK,MI,F,3) IF(Hl.EC.l)GO TO 3 IF(f'l.NE.2)G0 TO 6 C FUNCTIONt ER OR CONSTRAINT Hl'2 IF(fL.GT.0)Hl=3 CALL J7eODY(ME,l'K,JCSPTRfMN,MIt2) GO TO 6 C PHASE 11 ELEMENTS C BEGIN WITH LAST ENTRY ON VERTICAL ORDINATEC MO=ACCRESS OF LOAD VECTOR FOR ROW ORDINATE 11 MC»J70SUP(JCSPTRf IfOfOf I)

PAGE 324

312 KEY=0{6) Hl=f0*7 0(2»=MN-JCC0RE(M1J GC6)=« C ACCESS ROW ORCINATE ENTRY 12 CALL FETCH(JCCORE(KG),0fHl,S,F,JCCORE(MO),0,l) 0«2)=0 1F(M1.GT.2)G0 TO 13 C FUNCTION, ER OR CONSTRAINT CALL J7eODY(MC,0,JCSPTR,HN,5,3) GO TO 22 C GROUP ON SIM 13 CALL FETCH( JCCORE(KG),I,D,R,F,JCCOREtMOI,C,2l KK=C(2J HJ=0 C PREPARE FOR TRACE 14 IF'I.G£.H2)G0 TO 21 C DECREASE IN LEVEL M1=PJ-C(1J MJ=Cll) IF((NJ«f
PAGE 325

313 ACCESS GENDER GROUP M1=JCCCRE(16» HK=JCCCRE(Hl) M1=K1*2 MJ=«0 G(6)=2 D(8)=JCC0RE(M1)*1 IF(KEY.E(3.0(8))C<8) = 018)*1 DESTROY REMNANTS OF TEMPORARY LIST KB=KB-10 23 IFtfM.EC.OJGO TO 2A . CALL P0PUP(JCCORE«MB),MH,MM,Ml,T,l,2) IFIMl.GT.OCALL RETURN( JCCORE( MA ),MlfOt 2) GO TO 23 NEXT LIST ENTRY 24 Hl=PK M2=MI 0(A)=HJ 0(7)=MK MK=NEXT(JCC0RE116),H1,0(8),1,HI,MM,D(A),4,3) IF(NI.GE.M2)G0 TO 29 DECREASE IN LEVEL 25 Ml=f«J-0(4) MJ=D(4) H2=6 26 IF(C(M2J.GT.0)CALL J7VARI{ME,D(H3) , JCSPTR,0,6,D,0t2 J M2=N2-l IF(K:2.EC.5)G0 to 26 IFCfl.EC.OJGO TO 28 Ml=-5 H4=MK MK=CC7) GO TO 31 27 HK=K4 28 IFJfL.GT.OGO TO 33 IF((MK+yM).EQ.O)GO TO 34 TEST FLAG 29 CALL FR^CEHJCC0RE(WE),MK,M1,F,61 IFiMl.EC.UGO TO 30 IF(F1.NE.2)G0 TO 24 FUNCTION, ER OR CONSTRAINT CALL J7B0DY(ME,MK,JCSPTR,0,6,5I GO TO 24 GROUP 30 IFlfK.EC.JCGRUPlGO TO 32 . CALL FRfCEL(JCCCRE(HC),MK,D(5),G(4),7) IFJC17).EC.0)G0 TO 24 INDICES MJ=D17J Ml = 5 31 M2=KK*MD CALL J7ICOMIMC,H2,MF,0,0,M1,HJ,0,H3,3) 1FJK3.EQ.-1)G0 TO 27 IFJML.GT.OGO TO 25 JCPOFP FOUND 32 MB=KB*10 T(4)=T(4)+6 HL=1 REMOVE HEAOCELL 33 IF(^M.EC.OIGO TO 35 CALL PCPUP(JCC0RE(HB),MM,MM,0,T,1,3» H1=0

PAGE 326

314 IF(CCl).GT.O)CALL RETURN! JCCORE (MA J ,0( I) ,Ml ,3) 60 TO 25 C ERROR 34 CALL SVSERROf JCGRUP) C SET KEY 35 H1=JCCCREH6)>2 JCCCRE(M1)=C(3) C EXIT 36 CALL SYSEXT RETURN END

PAGE 327

.315 C c C • SIHINT • f ••••»»»»•• C C PURPOSE C SIMINT INTERCHANGES TWO PARAtLEL ORDINATE VECTORS. C C CALL SIMINT(JCSPTR,JC0NOO,JCaNOT,JCRORCtJCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPTR = THE POINTER TO THE SIM3L C JCONOO = THE NUMBER OF ONE ON THE ORDINATES C JCONOT = THE NUMBER OF THE OTHER ORDINATE C JCRORC = FOR ROW OR 1 FOR COLUMN C JCCLNO = A USER ASSIGNED CALL STATEMENT 10. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME HACHINESt C REPLACE THE 1 IN ThE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J70SUP C SYSENT C SYSEXT C C ERROR COOES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C c .«.•••».« c SUBROUTINE SIMINT ( JCSPTR, JCONOO, JCONOT, JCRORC, JCCLNO) COMKON/ALLOC/JCCORE(l» C ENTER CALL SYSENT(l,3,2,7,JCCLNO) C OBTAIN ADDRESSES MZ = 1 MY=»1 00 I 1=1,2 Ml=jCCNC0+I-2 HA=J70SUP( JCSPTR, Ml, JCRORC, MZ, n Ml=JC0N0T+I-2 M2=I+2 MB= J70SUP( JCSPTR, Ml, JCRORC, MY, M2) C PERFORM INTERCHANGE JCCORE(MZ)=MB I JCCORE(MY)=MA C EXIT CALL SYSEXT RETURN END

PAGE 328

316 C .,.,„•.. €•«•••• • • ' ••• C ••••• C • SIMOPT • c •• •• c C PURPOSE C SIHOPT RECORDS OR ERASES AN OUTPUT ASSIGNMENT IN BOTH THE C HORIZONTAL AND VERTICAL OROINATES. C C USAGE C CALL SIMOPTtJCSPTRf JCRNUM.JCCNUM.JCSENStJCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPTR = THE POINTER TO THE SIMBL C JCRNUH = THE ROW NUMBER C JCCNUM = THE COLUMN NUMBER C JCSENS = +N TO ASSIGN OUTPUT OR -I TO ERASE OUTPUT. N = I C OR 2 AS COUNT INITIALIZATION IS OR I S NOT DESIRED, C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C RFMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J70TPT C SYSENT C SYSEXT C C ERROR CODES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C c • • SUBROUTINE SIHOPTI JCSPTR, JCRNUM, JCCNUM, JCSENS, JCCLNO) C ENTER CALL SYSENTd, 3,2,8, JCCLNO) C SERVICE ROW IFCJCRNUM.GT.OICALL J70TPT ( JCSPTR, JCRNUM,0, JCSENS, JCCNUM, 1 ) C SERVICE COLUMN IF(JCCNUM.GT.O)CALL J70TPT ( JCSPTR, JCCNUM, 1 .JCSENS, JCRNUM, 2) C EXIT CALL SYSEXT RETURN END

PAGE 329

317 C r »«««•»•••» C • SIMRTV • c • "••• c C PURPOSE C SIHRTV SETS THE ELEMENT STATUS FLAGS OF TEAR VARIABLES TO C THREE. C C USAGE C CALL SIMRTV(JCGRUP,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCGRUP = ABSOLUTE ADDRESS OF GENDER GROUP C JCCLNO = A USER ASSIGNED CALL STATEMENT 10. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FIND C FRMCEL C J7L0CV C STORE C SYSENT C SYSERR C SYSEXT C TCCELL C C ERROR COCES FOR THIS PROGRAM C CODE FATAL ERROR(DATA PROVIDED) C 1 NF NO SIM IJCGRUP) C 2 NF NO TEAR VARIABLES (JCGRUP) C 3 NF TEAR VARIABLE NOT FOUND (VARIABLE CODE NAME) C C SIMRTV TRACES THE TEAR VARIABLE LIST OF JCGRUP. EXCEPT FOR C THE ELEMENT REPRESENTING A TEAR VARIABLE AS AN OUTPUT, ALL C TEAR VARIABLE ELEMENTS ARE FITTED WITH STATUS FLAGS OF 3. C C ••.».«.«•• c SUBROUTINE SlMRTV( JCGRUP, JCCLNO) COKf'CN/ALLOC/JCC0Re( I) DIKENSICN 0{3),V(3),G(17),P(4).N(7),E(10),L(3),0(4) INTEGER C,V,G,PfE,0 . , ,. .,,-, -, i , o DATA G/3,l,Ul,2,l,l,2l,l,l,2,7,3,3,8,l,l/,P/l,6,l,l/,N/2,7,I,l,9, I l,l/,£/3,2,I,l,5,l,l,3,l,l/,L/l,l,0/,0/l,l3,l,l/ C ENTER CALL SYSENT(1,3,2,9,JCCLN0) Q SETTING UP REQUIRED PARAMETERS MA=JCCCRE(l6)+l Ml=JCCCREri7)t8 HA=JCC0RE(MA) + 5«(JCC0RE{M1)-Ir) C ACCESS GROUP CALL FRMCEL (JCCORE( MA), JCGRUP, V,G( 11), I) Ml = l

PAGE 330

318 lF(Vt2).EQ.0)G0 TO 9 m=2 IF(VC1).BO.O)GO TO 9 GC15)=1 GC16JS3 ; ACCESS SIM8L Hl=Vt2)*2 HB=JCCCRE(Ml)-5 HC=KB-5 MC=V«2) HE=J70SUPlMC»l,li0il) M2=2 C ""^''E*^ SECURE WORKING AREA FOR INDEX CALCULATIONS M5=JCCCRE(17)+14 KL=0 IFUCC0RE(M5).EC.O)GO TO 1 MK=»H8*5«JCC0RE( M5) +10 CALL NEWCEL(JCC0REIHK),ML,1) HH=»'L*l C WN=f'L+2 RETRIEVE DATA FROM TEAR VARIABLE LIST ENTRY 1 M<»=V(l) CALL FRKCEL(JCC0RE(MA),MA,V,6,2» IFCV(2».NE.0)GO TO 8 C SCALAR VARIABLE CALL FIND»JCC0RECMB),L(M2),V(2),N,N,JCC0RE»ME),M5,1) 2 H2=l IF(P5.NE.0)G0 TO ^ 3 CALL SYSERR{3.V(3)I GO TO 7 C ACCESS OUTPUT 4 V(2)=?0 CALL%ETCH(JCCORElJ'B),Ll2)tVt2),0,L,JCCORE{ME),0,H H3'4 r TRACE ELEMENTS IN COLUMN CALL FETCH(JCC0RE(M8),L(2).0,PtL,JCC0RElHE),0t2) 6 lF(Ca).EG.0)GO TO 7 C EXTRACT DATA FROM ELEMENT M5=C(1) . CALL FRKCEL{JCC0RE(HC)iM5,D,E,3) IF{c!3)!NE*.V(2)icALL TOCELLUCCQRE -l . ., .. CALL FRHCEL(JCCCRE(fK),M4,JCC0RE(MN),G(14),A) JLOCATE DIH£NSI0NED VARIABLE CALL J7LCCV(MD,L(H2).MK,M5,MF,1) GO TO 2

PAGE 331

319 C NO SIH OR OUTPUT LIST 9 CALL SYSERR(M1,JCGRUP) C EXIT 10 CALL SYSEXT RETURN END

PAGE 332

320 C c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c J7B00Y • PURPOSE J7BO0Y HANDLES ER'Sf FUNCTIONS AND CONSTRAINTS WITH RESPECT TO SIH GENERATION. USAGE CALL J7B0DYJJCSPRG,JCP0FP,JCSPTR,JCR0WN,JCM00E,JCCLN0> CATA FORMAT N/A JCPOFP JCSPTR JCROWN JCHODE ETC.) DESCRIPTION OF PARAMETERS JCSPRG = THE ADDRESS OF THE SPUR FOR GENDER THE ADDRESS OF THE ENTRY
PAGE 333

321 CALL SYSENT(lt3t2,lO,JCCLNO) 0U)=0 DC2)=JCP0FP 0(3)«3 D(4l=0 0(5)«=0 D(&}»1 PARAMETERS FOR SECEDE Ml=JCC0RE(l5)*l HAA=JCCORE(Mll Ml=Pl*l MAB=JCCGRE(M1) m = HABt28 JCCORE(Ml)=-l MA=AODRESS OF SPUR BLOCK Ml=JCSPTR+2 MA=JCCORE(Ml) MB=ADCRESS OF SPUR FOR ORDINATE MS=MA-5 HC=0 IF((JCMODE.GT.2).AND.(JCM0DE.NE.5))GO TO I MO=AODRESS OF LOAD VECTOR FOR ORDINATE HC»l MD=J70SUP(JCSPTR,l,Of0.l) H2=K0+7 IF(JCM00E.EQ.5)G0 TO 31 HE=3 MI=HD*1A IF(JCCORE(Hl).EQ.-l)ME=l M1=K0*8 L(4)=JCC0RE(Ml)-JCC0RE(M2)»l Ml = JCCCRE(l7)H8 F12)=JCC0RE(MI) MODE FOR J7VARI CALL 1 MH=JCMOCEtl DATA MI=5-4»«1/JCH0DE) CALL FRMCELIJCC0REJJCSPRG),JCP0FP,D,G»M1),I) DIMENSION CHECK IF(D<1).GT.O)GO TO 2 GO TO (5»5,8,6,6l,8>f JCMODE INDICES 2 Ml=JCCOREll7)+9-(l/JCMO0E) HI=JCPOFP+JCCORE(Ml) M2=A+1/JCM0CE 3 CALL J7ICOM(JCSPRG,HI,HA,MC,2tH2,D(l)tL,Hl,l) IF(Ml,NE.l)GO TO 9 GO TO K,4,8,6,61,e)iJCM00E ACCESS ROW ORDINATE 31 MH=5 L(4)=JCR0WN-JCC0RE«M2> CALL FETCH(JCC0REtMB)iL«3),D,R.F,JCC0REtMD),0tl) Hl=0 IF(0(1).EQ.O)GO TO 61 MZ=l M1=D(2) 012)=JCCORE(M1) M2=JCC0RE(l6)+8 M3=JCCORE(M2) JCC0REtM2)=Ml*2 GO TO 61 ADD TO ORDINATE

PAGE 334

322 4 IF(JCH0DE.eQ.l)D(2)=JCP0FP JCC0RE«KC)=0(2» Ml=HC*l JCCORE(Ml)=0(l) 0(1)=1 0(2»=MC 5 D(3)=(U<3)+2)/3+2»(2-JCMODE» IF(C(4).EQ.1)D(6)=0 M1=D(5) D(5J=l/JCMaDE . CALL STORE( JCCORE(MB),LlME),0,R,F,JCCOREtMD).l) JCR0WN=JCC0RE(H2) IF(JCM0DE.EQ.1)G0 TO 9 IF«C(1>.EQ.1)0(2)=JCC0RE(MC) 0(5)=Ml GO TO a ACCESS FUNCTION IN SECEDE 6 IF(M2.LT.0)G0 TO 7 61 HI==JCC0RE«l7)*6 MI=JCCaR6(Ml) S(2)=D(2)/M1 S«4)=0(2)-S(2)»M1 HS=S(2) S<2)=S(2)t4 S(3)=D(3)+6 7 CALL FETCH{JCC0RE(MAA),S,0(5),P,F,JCC0RE(MA8),0,2) J7VARI CALL IF(b(5).EQ.0)G0 TO 9 CALL J7VARI(«AA,0(5),JCSPTR,JCROWN,HH,MAB,MS,l) 1F((JCM0DE«MZ).EQ.5)JCC0RE(M2)=M3 MZ=0 GO TO 9 8 IF{Ot5).EQ.0)GO TO 9 CALL J7VAR1(JCSPRG,D(5),JCSPTR,JCR0WN,MH,MAB,HS,2) IF{JCMCDE.LE.2)G0 TO 9 ITERATE H2=-^IF(0(1).GT.0)G0 TO 3 EXIT 9 CALL SYSEXT RETURN END

PAGE 335

323 C c>«««**»« • • ...»•».• .»••••.•«».•...• c ••» C • J7C0MV • c C PURPOSE C J7C0MV CHECKS A VARIABLE FOR POSSESSING A COMMON VARIABLE C CECLARATION. C C USAGE C CALL J7C0MV«JCSPURiJCVNAM,JCL0A0,JCCLN0) c C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPUR = THE ADDRESS OF THE SPUR FOR SECEDE C JCVNAM = THE VARIABLE NAME. IF THE VARIABLE IS FOUND TO BE C COMMONt UPON RETURN JCVNAM WILL CONTAIN THE NAME C OF THE COMMON VARIABLE. C JCLOAD = THE ADDRESS OF THE LOAD FOR SECEDE C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINESt C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C SYSENT C SYSEXT C C ERROR CODES FOR THIS PROGRAM C NONE C c Mrrnco ^ C SELF-EXPLANATORY c c SUBROUTINE J7C0MV( JCSPUR, JCVNAM, JCLOAD, JCCLNOl COMMCN/ALLOC/JCCORE( 1 ) DIMENSION PCtJ.VC^J.LIS) INTEGER P,V,D DATA P/l,l,l,l/,V/l,l,2,2/,L/5,0,l,l,0/ C ENTER CALL SYSENT(l,3,2,ll,JCCLNO) C SETTING UP LISTER VECTOR Hl=JCL0AD+28 JCC0RE(M1)=-1 M1=JCC0RE(17)*6 HI=JCCCRE(HI) . L(2»=JCVNAM/Ml IF(L(2).EQ.0)G0 TO 104 LC5»=JCVNAM-Ml»L(2) LC2)'=L(2)*4 C RETRIEVE NAME Of^ COMMON VARIABLE CALL FETCHIJCCOREJ JCSPUR), L,M2,P,L,JCC0RE(JCL0AD), 0,1) " H5)=M2 CALL FETCH(JCCORE( JCSPUR), L(4),M2,V,L,JCC0RE(JCL0AD), 0,2) IFJM2.GT.0)JCVNAM=M2

PAGE 336

C EXIT 104 CALL SYSEXt RETURN END 324

PAGE 337

325 • J7IC0M » PURPOSE J7IC0M PERFORMS INDEX COMPUTATIONS. USAGE CALL J7IC0H(JCSPURiJCP0FP,JCSPBL,JCPOSP,JCSKIP,JCMOOE, JCDIMSiJCLOAD.JCSORF.JCCLNO) DATA FORMAT N/A DESCRIPTION JCSPUR = JCPOFP = JCSPBL JCPOSP JCSKIP JCHOOE JCOIHS JCLOAO JCSORF JCCLNO OF PARAMETERS THE ADDRESS OF THE SPUR FOR SECEDE IF JCPOFP = N, OR FOR GENDER LIST OTHERWISE THE NUMBER OF WORDS TO PROGRESS IF DIMENSIONED ENTITY IS IN SECEDEf OR JCPOFP IS THE POINTER TO A GENDER LIST COMPONENT INDICES THE ADOKESS OF THE SPUR BLOCK THE ADDRESS OF THE STORAGE LOCATION FOR THE INDICES. IF JCPOSP IS PASSED AS I, STORAGE WILL BE AUTOMATICALLY PROVIDED. IF JCPOSP IS PASSED AS 0, THE OPTION OF JCPOSP POINTING TO INDEX STORAGE IS WAIVED. THE NUMBER OF WORDS OF JCPOSP TO SKIP BEFORE COMMENCING INDEX STORAGE AN INTEGER EQUAL IN MAGNITUDE OF 1 THROUGH 5 AS RESPECTIVELY THE INDICES TO BE COMPUTED REFER TO A VARIABLE (REMOTE). A VARIABLE (LIST), A FUNCTION (REMOTE), A FUNCTION (LIST) OR A GROUP. IF JCMODE IS NEGATIVE, INCREMENTING THE CURRENT INDEX SET BY 1 IS INDICATED. IF POSITIVE, JCMODE INDICATES THE COMPUTATION OF THE MINIMUM, CURRENT (ECiUAL TO THE MINIMUM) AND MAXIMUM OF EACH INDEX IS DESIRED. THE DIMENSIONALITY OF A VARIABLE OR FUNCTION, OR THE DEPTH (SEE REMARKS) OF A GKOUP THE ADDRESS OF THE LOAD VECTOR FOR SECEDE REFERENCING THE INDICES 1 OR -1 AS RESPECTIVELY THE FIRST INDEX IS WITHIN ITS MAXIMUM LIMIT A USER ASSIGNED CALL STATEMENT ID. PARAMETER REMARKS THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, REPLACE THE 1 IN THE NAMED COMMON STATEMENT. THE DEPTH OF A GROUP DIFFERS FROM ITS LEVEL IN THAT PARENT CROUPS NOT INDEXED CO NOT ENTER INTO DETERMINING A GROUP'S DEPTH. USE THE FUNCTION MODE FOR VARIABLES POSSESSING MINIMUM AND MAXIMUM LIMITS (AS SELF-MAPPING IS ALLOWED). SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED FETCH FRHCEL NEWCEL RETURN SYSENT SYSEXT

PAGE 338

326 C C ERROR COOES FOR THIS PROGRAM C NONE C C HETHCO C J7IC0M EMPLOYS THE INDEX STORAGE VECTORS PROVIDED BY CUDGEL C FOR THE GENDER LIST. JCLQAO MUST REFER TO THE BEGINNING OF C THE FILE-STORED INDICES. J7IC0H EMPLOYS A LISTER OF (l.N) C INITIALLY AND (1,1) THEREAFTER. C r •••»•»»•»• SUBROUTINE J7IC0M( JCSPUR, JCPOFP, JCSPBL, JCPOSPt JCSKIP, JCMOOE . 1 JCOIMSf JCLOADt JCSORF.JCCLNO) COMMON/ALLOC/JCCOREI I > DIMENSION D(7),G(22),L(2),P(3,A) INTEGER OtGtP DATA G/7,9,l,l,10,l,l,llf Itlfl2,ltlfl3,l,l,14,l,l,15,l,l/.L/1,0/ C ENTER CALL SYSENT(1.3,2,12,JCCLNO) C PARAMETERS Ml=JCCQREll6)+2 00 I I=lr2 H2=5-I DO 1 J=lt.M2 M1=MI*1 1 P{I,J)=JCCORElMl) Ml=P(lf4)*JC0IMS-I IF(JCM0CE.EQ.5)JCC0RE(M1)=JCP0FP MA=1 H8=0 L(2)=JCP0FP C MODE MC=JCCIMS MD=IA8S(JCMO0E) IFtHD.E0.5)MC=l MC=JCSPBL+5*tMC*JCSKIP-l) ME=JCPOSP ^r.. . IFl(JCPOSP.EQ.n.OR.l(MD.LE.2).AND.«JCPOSP.LE.0)))CALL NEWCELI 1 JCC0RE«MC),ME,1) IF( JCOIMS.EC.OGO TO 11 P(3t2)=ME*JCSKlP MF = 3 IFIND.LE.2JG0 TO 2 MF=2 IF(M0.EC.5)MF=l IF(JCMODE.GT.0)GO TO 2 C INCREMENT JCSORF=-l DO 101 I=lt JCOIMS IFtJCSORF.EO.DGO TO 101 M1=JCDIMS-I M2=P(MF,2)*Ml M1=P(MF,3)+Ml JCS0RF=1 JCC0R£IM2)=JCC0RE(M2)+1 IF(JCCCRE{H2).LE.JCC0RE(M1))G0 TO 101 JCS0RF=-1 MA=I MB=l 101 CONTINUE C MODE

PAGE 339

327 IF(MB.EC.O)GO TO 11 IF(JCSORF.GT.O)GO TO 2 RETURN ME 1F((JCPOSP.E0.1).OR.IIMO.LE.2».AND.(JCPOSP.LE.O)))CALL RETURN( 1 JCCORE(MC)tME,Me,l) GO TO 13 MIN, CURRENT AND MAX 2 DO 10 I=MAi JCDIMS Hl = 2 3 GO TO (4,5,4»5,7),M0 REMOTE * CALL FETCH(JCCORE(JCSPUR)fLiDtG,L,JCCORE«JCLOAD)tO,l) L(2)=l 60 TO 8 LIST 5 M2=JCP0FP*2*I-l+Ml/3 6 CALL FRKCEL(JCCQRE{JCSPURt,M2,D,G,l) GO TO 3 GROUP 7 H2=P(l,A)*I-l M2=JCCORE(H2)*Ml/3 GO TO 6 CURRENT OR MAX B IF(D(1).EQ.0)G0 TO 9 H2=C(1)+(0(1)/3)»(HF-D{1)) ,, ,, Ol7)=((-l)*»D('t))»(P
PAGE 340

328 C c»«»» • • ..•«...».».•. C • J7L00V • Q »»•••««•»• C C PURPOSE C J7L0DV SEARCHES AN ORDINATE FOR A DIMENSIONED VARIABLE. C C USAGE C CALL J7L0DVIJCSPTR, LISTER, MASTER, INDICJCORON.JCCLNo) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPTR = THE ADDRESS OF THE SIMBL C LISTER = SEE C4ADRS DOCUMENTATION. RESTRICTED TO LISTERJl) C E«UAL TO I. C MASTER ' ADDRESS OF THE BLOCK OF WORDS CONTAINING VARIABLE C NAME, DIMENSION AND INDICES. C INDIC = 1 FOR SUCCESS AND FOR FAILURE OF THE SEARCH C JCORCN = THE ADDRESS OF THE ORDINATE LOAD VECTOR C JCCLNO = A USER ASSIGNED CALL STATEMENT lOi PARAMETER C C REMARKS C . THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C ' FETCH C FIND C SYSENT C SYSEXT C C ERROR CODES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C SUBROUTINE J7L0DV( JCSPTR, L I STER, MASTER , INDIC, JCORDN.JCCLNOJ COMMON/ALLOC/jCCOREd) DIMENSION L1STER(2»,L(7) DATA L/l»7,Ul,9,l,l/ ENTER CALL SYSENTtl,3,2,13,JCCLNO) HA=JCSPTR*2 MA=JCC0RE(MA)-5 INDIC=0 MB=0 Hl=JC0RDN*7 M2=JCC0RE(MU FIND A DIMENSIONED VARIABLE 1 HB=MBtl 2 CALL FIND(JCC0REJMA),LISTER,LjL,L,JCC0RE(JC0RDN),M8,l) IF(KB.NE.O)GO TO 3 LISTER(2)=M2-JCCORE(Hl»-l IFiMB.EC.DGO TO 1 GO TO 5

PAGE 341

329 COMPARE INDICES LISTER(2»=0 CALL FETCHiJCCOREIMAJ.LISTER.Ma.LCHfL.JCCOREtJCORONI.O.l) LISTER(2)=3-2»MB IF(H3.LE.0>G0 TO 2 M<»=HASTER*l M'r = JCC0RE(H4) H5=0 H6=MASTER 00 ^ 1 = 1, M'r IF{M.5.GT.0)G0 TO 4 IFCJCC0RE{M3).NE.JCC0REtM6)»M5'=l H3=M3tl M5=H6»l CONTINUE IF(M5.GT.0)G0 TO 2 EXIT IN0IC=1 CALL SYSEXT RETURN END

PAGE 342

330 C c • • • ..•••• .••••••» c C • J70SUP • c ••• c C PURPOSE C J70SUP ESTABLISHES THE LOAD VECTOR FOR AN ORDINATE. C C USAGE C J70SUP(JCSPTR,JC0NUMf JCRORC,JCAOCE,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPTR = THE PUNTER TO THE SIHBL C JCONUM = THE ORDINATE NUMBER C JCRQRC = FOR ROW OR 1 FOR COLUMN C JCAOCE = THE ADDRESS OF THE CATALOGUE ENTRY OR IF THIS C VALUE IS NOT DESIRED C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST. FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C C4A0RS C NEWCEL C RETURN C SYSENT C SYSEXT C C ERROR COOES FOR THIS PROGRAM C NONE c C METHOD C THE ADDRESS OF THE LOAD VECTOR IS STORED IN THE CATALOGUE C WORD IMMEDIATELY FOLLOWING THE WORD APPROPRIATE TU ORDINATE C NUMBER JCONUM. J70SUP INITIALIZES THE X5TH AND 30TH WORDS C OF THE LOAD VECTOR. C r ••«»•••«•• C FUNCTION J70SUP(JCSPTR, JCONUM, JCRORC, JCAOCE, JCCLNO) COMMON/ ALLOC/JCCORE( 1 ) DIMENSION L(2),K(A) C ENTER CALL SYSENT(l,3,2,l't,JCCLNO) C ACQUIRE SPACE FOR LOAD VECTOR MA=JCSPTR*2 MA=JCC0RE(MA)-15 CALL NEWCEL{JCC0RE(MA),MB,1) C INITIALIZE LOAD VECTOR FOR CAADRS CALL HI=MB+29 JCCCR£(Ml)=JCSPTR-JCRORC*l M1=MB+I3 JCCORE(Ml)=l H1=MB*14 JCCCRE(M1)=1 C ACCESS LOAD VECTOR POINTER

PAGE 343

331 L(U = 2 tJ2)=JC0NUM»l MC=MA+10 CALL CAORSiJCCOREtHO.LiK.K.K.K.K.JCCOREtMBJ.O.l) H2=JCC0R£CHBJ 1F(JCA0CE.NE.0)JCA0CE=M2 IF(JCC0R£CM2).GT.0)G0 TO I C INSTALL JCCORE(MB) AS LOAD VECTOR JCC0RE(M2)=MB J7CSUP=HB JCCCRE
PAGE 344

332 C ,^..^ C»i>*****«>* ..«»• • ••».......»•.. •••» C • J70TPT • C ••• c C PURPOSE C J70TPT RECORDS OR ERASES AN OUTPUT ASSIGNMENT, C C USAGE C CALL J70TPT(JCSPTR,JCENUM,JCRORC,JCSENS,JCOTPT,JCCLNO» C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPTR = THE POINTER TO THE SIHBL C JCENUM = THE ORDINATE ENTRY NUMBER C JCRORC = FOR ROW OR 1 FOR COLUMN C JCSEnS = SEE SIMOPT C JCOTPT = OUTPUT ENTRY NUMBER C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED QY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C J70SUP C NEWCEL C RETURN C STORE C SYSENT C SYSERR C SYSEXT C C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERRORtOATA PROVIDED) C I NF NEGATIVE NUMBER OF UNASSICNED OUTPUTS (ENT. NO) C 2 NF UNASSIGNEO OUTPUT COUNT GREATER THAN UNITY C (ENTRY NUMBER) r 3 NF OUTPUT DOES NOT MATCH JCOTPT I ENTRY NUMBER) C 4 NF JCOTPT NOT FOUND ON OUTPUT LIST (ENTRY NUMBER) C C METHOD C . SELF-EXPLANATORY C C ••»..•.»•• c SUBROUTINE J70TPT( JCSPTR, JCENUM, JCRORC, JCSENS, JCOTPT, JCCLNO) COMMON/ ALLOC/JCCOREI 1 ) DIMENSION C(4),0(7),0(.2),L<2) INTEGER CO.D DATA C/l»H,l,l/.0/2,I2,l,l,13,l,l/,L/l,0/ C ENTER CALL SYSENTd, 3,2, 15, JCCLNO) C INITIALIZE SPUR. POINTERS Ml=JCSPTR+2 Ml=JCCORE{Ml) HA=Ml-5 M8=Kl*5

PAGE 345

333 C INITIALIZE LOAD VECTOR POINTERS HC=J70SUP«JCSPTRfl,JCR0RC,C,l) HE=2 C INITIALIZE L VECTOR H1=WC*7 L 1 2 ) =» JCENUH-JCCORE ( HI ) M2=0 C SERVICE COUNT ORDINATE 1 IF(IABS(JCSENS).EQ.2)G0 TO A CALL FETCH(JCCORE(MA),LiMl.C.LiJCCORE'1 H1=M1-JCSENS/IABS(JCSENS) IF(Ml.GE.O)Ga TO 2 CALL SYSERRdf JCENUM) Hl=0 GO TO 3 2 IF((Ml»JCRORC).LE.JCR0RC)GO TO 3 CALL SYSERRI2,JCENUM) Hl=l 3 CALL ST0RE=JC0TPT IFIJCSENS.GT.OGO TO 5 IF(Hl.N£.U(2))CALL SYSERR( 3, JCENUH ) 6 CALl'sT0RE(JCC0R£«MA),L,D«2),0(A),L,JCC0RE(MC),ME) GO TO 11 C MULTIPLE OUTPUT 7 D(1J=1 M1=C(2) H2=0 IF(JCSENS.LT.O)GO TO 9 C ASSIGN OUTPUT CALL NEHCELUCC0REIMB»,012),1> CALL ST0RE(JCC0RE(MA)tLiDf0,L,JCC0RE(MC),3J M2=0(2) JCCCRE(M2J=MI H2=^'2+l JCCGRE(M2)=JC0TPT GO TO 11 C ERASE OUTPUT 8 H2=M1 M1=D(2) 9 1F(HI.GT.0)G0 TO 10 CALL SYSERR(4,JCENUM) GO TO 11 10 D(2)=JCC0RE(Ml) M3=Ml*l IF(JCC0REtM3).NE.JC0TPT)G0 TO 8 CALL RETURN t JCCORE( MB), Ml, M 1,1) HE^'V IFIM2.EQ.0)G0 TO 6 _ JCC0RE(H2)=C(2) C EXIT 11 CALL SYSEXT RETURN

PAGE 346

334 END

PAGE 347

335 C c«»« • • • ••• ••* •••••• » C • J7VARI • C ••• c C PURPOSE C J7VAR1 HANDLES VARIABLES WITH RESPECT TO SIH GENERATION. C C USAGE C CALL J7VARI(JCSPURiJCP0FP.JCSPTRtJCR0WN,JCH00EiJCL0A0i C JCUNIT,JCCLNO» C C CATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPUR = THE ADDRESS OF THE SPUR FOR SECEDE IF JCMODE = 5f C OR FOR GENDER OTHERWISE C JCPOFP = THE DISPLACEMENT TO THE FILE ENTRY IF JCMODE = 5t C OR THE ADDRESS OF A LIST ENTRY C JCSPTR = THE ADDRESS OF THE SIMBL C JCROWN = THE ROW NUH8ER C JCMODE = A POSITIVE INTEGER HAVING THE FOLLOWING STATES. C 1 = TEAR VARIABLEf ROW ORDINATE SET UP C 2 = DECISION VARIABLEt ROW ORDINATE SET UP C 3 = OUTPUT VARIAOLEi NOT PROTECTED GROUPi ROW C ORDINATE SET UP C 4 = OUTPUT VARIABLE, PROTECTED GROUP, ROW ORDINATE C SET UP C 5 » INCIDENCE VARIABLE C 6 = DECISION VARIABLE, POST SET UP INITIALIZATION C 7 » OUTPUT VARIABLE, POST SET UP INITIALIZATION C JCLOAO * THE ADDRESS OF THE LOAD VECTOR FOR SECEDE C JCUNIT ' THE UNIT NUMBER C JCCLNO » A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C 8STLNK C FETCH C FIND C FRHCEL C FSTLNK C J7C0MV C J7IC0M C J7L0DV C J70SUP C J70TPT C LNKBWD C LNKFWD • C NEKCEL V C RETURN C SIHCIN C SIMT=LG C SIMOPT C STORE C SYSENT C SYSEXT

PAGE 348

336 C TOCELL C C ERRCR CODES FOR THIS PROGRAM C NONE C C METHCC C SELF-EXPLANATORY C c SUBROUTINE JTVARK JCSPUR, JCPOFP, JCSPTR, JCR01.N, JCHODE , JCLOAD, 1 JCUNITf JCCLNO) COMt'CN/ALLOC/JCCOREll) ,, „,^, ^,^, „, ., OIMENSICN L(5),F(3),G(7),S{16I,E(13),N(7),C(7),P(4».0(6),0(4) INTEGER F,G,S,E,C,P,C,a , „ , , „ , , -, i DATA L/3,l.Ul.0/,Ftn/l/,G/2,2,l.l,21,l,l/,S/5,l9,l,l,8,l,l,7,l. 1 I,5,l,l.l.l»l/.E/A,6,l,l,5.l,lt3,l,l,4,l,l/.N/2,7,l,l,9,I,l/.C/l, 2 lO.l.l.llf l»l/iP/lf6ilfl/.0/l,l3il,l/ C ENTER CALL SYSENT(1,3,2.16,JCCLN0> r PARAMETERS C MA»ACCRESS OF SPUR'S FOR SIM Ml=JCSPTR*2 >'A=JCCCRE(M1) C MB=ADCRESS OF SPUR FOR ORDINATE MB»MA-5 C HC«ADCRESS OF SPUR FOR ELEMENT t»e=KA-10 C ORDINATE M0=J7CSUPlJCSPTR,lf ItOtl) HE=1 Ml=fD*l4 IF(JCCORE(Hl).NE.-l)HE=* HF=K0+7 MG=MD+8 M1=JCCCRE(17)*18 F(21=JCC0RE(Hl» MAA=0 C MH=NUMBER OF VARIABLES HH=0 C MS=ADORESS OF LOAO-II FOR SECEOE MS=JCLCAD+30 M1=HS*28 JCCCRE(Hl)=-l C HU^UNIT SCALE MU=JCCCRE(l7)+6 MU=JCCORE«MU) C DATA IF(JCH0DE.EC.5)GO TO 1 99 CALL FRMCEHJCCCRE(JCSPUR),JCPOFP, 0,6,1) K1=JCCCRE(17)*10 H2=JCPCFP GO TO 2 1 L(3)~JCPCFP CALL FETCH{JCCORE(JCSPUR),L(2).0,S,F,JCCORE(JCLOA0),O,U JCPCFP=C(5) Lt3)=l IFCCCfl.NE.UGO TO 31 M1=JCCCRE<17)*3 M2=0 C COMMON CHECK DJ2)=«0(2)+JCUNIT»MU

PAGE 349

337 CALL J7C0MVIJCSPURtD«2»,MS,l» C DIMENSION CHECK C MI»INCICATOR 2 I1I«0 IF(D(1J.EQ.0)G0 TO 11 C DIMENSIONED C MI=MOCE FOR J7IC0M CALL C HJ=JCPGSP FOR J7IC0M CALL MI=«V HJ=1 MN=M2*JCCCRE«Hl) GO TO 17,7,6,6,3,5,4),JCM00E C MOOE'^l 3 HI=»1 GO TO 7 C HaCE=2 4 Ml»2 C GET SPACE (HJ) 5 H2=JCCCRE«17)*14 M2=KA*5»{JCC0Re(H2)tl) CALL NEHCEL«JCC0RE(M2),MJ,1) GO TO 7 C H0CE=2 6 MI=2 C COMPUTE INDICES 7 CALL J71C0M( JCSPURfMN,MA,MJ,2,MI,D(l)tJCL0A0,M2tl) IF(K2.EC.-1)G0 TO 95 GO TO (8,14f l'».lAf 8t8,8)fJCMODE C SEARCH 8 H2=0 IF(fE.EC.l)GO TO 9 JCCCRE(KJ)=C(2) M2=MJ*1 JCCCRE(M2)=C(1) CALL J7LCDV(JCSPTR,L(4),HJ,M2,MDtl) 9 M2=JCM0CE*7«M2 GO TO (14,l4,l*,14,l=JCCCRE(HG)-JCC0R6(HF)tl CALL STCRElJCC0RE(MB),L(ME),DIM3).NfF,JCC0RE(H0)tl) H5)=0 HE=4 1F(JCM0CE.EC.4)G0 TO 16 C NUMBER OF OUTPUTS = 1

PAGE 350

338 CALL STCRE(JCCQRE(MB)fL(A).FiC(4),FtJCC0RE(H0)t2) GO TO (151.16,18,16,22t20>20)>JCM00E 151 F(l)=4 C COLUMN STATUS FLAG = 1 16 CALL STCRE,3) F(n=i GO TO (17,32,18,18,22, 32, 95),JCM0DE C OUTPUT ASSIGNMENT COLUMN ONLY 17 CALL J7CTPT(JCSPTR,JCC0R£(NF),l,2,JCROWN,l) GO TO 32 C OUTPUT ASSIGNMENT BOTH ROW AND COLUMN 18 Kl=2 19 CALL SII'CPT(JCSPTR,JCROWN,JCCORE(MF),Ml,l) IF(JCM0CE.EQ.5IG0 TO 21 GO TO 95 C GET CURRENT STATUS FLAG 20 CALL FETCH( JCC0RE(M8),Lt4),Ml,E(*),Ff JCC0RE(M0),0,2> 1F(JCMCCE.EC.5)G0 TO 23 C TEST FLAG IFIKl.NE.DGO TO 21 CALL SYSERR(l,JCCbRE{MF)) GO TO 32 C REMOVE COLUMN 21 CALL SIMCIN(JCSPTR,JCCORE(MF), 1,-1,0, F,F,1) CALL SIMFLG(JCSPTR,JCCOREtMF),l,F,0,l) 1F(JCM0CE.EQ.5)G0 TO 30 GO TO 16 C ACQ ELEMENT TO SIM 22 0U)»0 0(5)=JCR0HN D(6)=JCCCRE(MF) C GET SPACE (MK) CALL NEUCELUCC0RE,H1-,P,F,JCC0REIML),0,5) L(5)=«0 M2=0 M3=0

PAGE 351

339 1F(K1.GT.0>G0 TO 27 C FIRST ELEMENT IN ROW 25 CALL STORE(JCCORE«.M8J,L(A),HK,P,F,JCeoRE(ML)t51 C LINK FK TO NEXT ELEMENT 26 CALL FSTLNK(JCC0REi0,7) IF(M2.GT.0)G0 TO 31 CALL SIfCINtJCSPTR,JCR0HN,Ct-lf0tF,F,2) CALL SIKFLG(JCSPTRiJCROWNi0iF,0t2) F(3)=l C NEXT CONSTITUENT 31 IF(JCPGFP.EC.O)GO To 35 IF((D(l».GT.0».AND.lD(4).ECl.l))JCPOFP = l GO TO I 95 JCPCFP=LNKFWDt JCCORE«JCSPUR)f JCP0FP,2) IF(JCP0FP.EC.0)G0 TO 34 GO TO 99 C ITERATE 32 IF(D(1).EQ.0)G0 TO 95 33 MI=-IAeS{MI) GO TO 7 C RETURN MJ 34 1F(JCM0CE.LT.6)G0 TO 35 M2=JCCCRE117)+14 H2=KA+5»(JCC0RE(M2)+1) CALL RETURN(JCC0RE(M2)fHJ,MJ,2) C EXIT 35 CALL SYSEXT RETURN ENO

PAGE 352

340 C ...... C*«*>*«»«*« ••<...#»..o..«»»....»»o»»»» ••• c "*** Q • BREAK » C •».•...••• c C PURPOSE C BREAK DESTROYS THE LINKAGE BETWEEN TWO SPECIFIED NODES. C C CALL BREAK(JCNTWK,JCP0FPtJCP0SP.JCP0SN,JCA08N,JCCLN0) C , C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCNTWK = THE ADDRESS OF THE NETWORK INFORMATION BLOCK C JCPOFP = OR THE ADDRESS OF THE FIRST NODE C JCPOSP = OR THE ADDRESS OF THE SECOND NODE C JCPOSN = SIMILAR TO JCPOSF OF COUPLE, EXCEPT THAT JCPOSN C REFERS TO WHICHEVER NODE (IF ANY) IS ASSIGNED A Q JCPO P OF 0. IF NEITHER JCPOFP OR JCPOSP ARE Ot C JCPOSN SHOULD BE ASSIGNED A VALUE OF -I. C JCAOBN = SEE COUPLE • ,^„ C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FRMCEL C FSTLNK C RETURN C SYSENT C SYSERR C SYSEXT C TOCELL C C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERROR(OATA PROVIDED) r 1 NF NODES ARE NOT LINKED (ADDRESS OF NODE) Q 2 NF NODE ON DIVERGER (IDENTIFICATION FLAG OF NODE) C C EITHER ERROR CAUSES BREAK TO ABORT. POSSIBLE MODES OF C OPERATION ARE ( A, A,-l) , ( A.O.M) OR (O.A.H) FOR (JCPOFP, C JCPOSP, JCPOSN), WHERE A IS AN ADDRESS AND M IS -1,0 OR A C POSITIVE INTEGER. C SUBROUTINE BREAK( JCNTWK, JCPOFP, JCPOSP, JCPOSN, JCADBN, JCCLNO) COKKON/ALLOC/JCCOREd) DIMENSION P(7),G(10),0(3) INTEGER P,G,0 DATA P/2,ltl»l.5.1,l/,G/3,l,l,lf2,l,l,3,l,l/ C ENTER CALL SYSENT(l,3,3,l,JCCLNO) C SPUR Hl=JCNTWK+l Ml=JCCORE(Ml)

PAGE 353

341 H2=Kl't'4 M2=JCC0RE(l7)t7*U»/5»-2«lJCC0RE(H2»/6) MA=Pl*5»lJCC0RE{H2J-l) H2=M2+l MAA=Ml*5»(JCC0RE(M2)-l) ; MODE MB=JCPOFP MC=JCPOSP IFCJCPCSN.EQ.0»JCP0SN=1 KD=JCPOSN MH=0 IF((M8.GT.0).ANO.(MC.GT.0))HO»-l IF(MD.EQ.-l)MH=l PCl)=2 P(2)=l P16)=-1 PJ7)«1 IF{MB.GT.O)GO TO 2 C REVERSE 1 Ml=»HB HB=PC MC=H1 P{1)=2 P(2)=3-P«2) P«6)=P(2) P(7)=P12) , C EXAMINE LINK FROM NODE 2 ME=0 MF»0 MG=1 CALL FRHCEL(JCC0RE(MAA),H8,D,Pil) HI=D«2)-1 P(l)=l IFCDID.EQ.OGO TO U C FLAG CALL FRMCEL(JCC0RE(MA),D(l)tMl,6(7),2) IF(M1".EO.O)GO TO 4 C NODE TO NODE D(2)=0 IFtDtD.EQ.MOGO TO 8 IF(MC.GT.O)GO TO 11 MC=Da) GO TO 8 C DIVERGER 3 IF(D(1).EQ.O)GO TO 10 MG=KG*l * HE=MF MF=D(IJ „ . CALL FRHCEL(JCC0RE(MA),MF,0,G,3) IF(0(3».NE.0»GO TO 12 C TEST 1FC(D(2).NE.HC).AND.(MG.NE.H0))G0 TO 3 C SUCCESS 5 MC=D(2) CALL RcTURN(JCCORE(MA),HF,MF,l» IFIME.EQ.OGO TO 6 C NOT FIRST CALL FSTLNK(JCCORE(MA),Me,OCL»tH GO TO 7 C FIRST 6 CALL TOCELL(JCCORElHA),MBfD(l»iPil) 7 IFIJCAOBN.GT.OIGO TO 9

PAGE 354

142 TEST FOR SINGLE PATH CALL FRMCEL(JCC0RE{HA),MB,ME,P,4) IFIME.EC.OJGO TO 9 CALL FRMCEL(JCC0RE(MA»,ME,D,G,5) 1F(D(1).GT.0)G0 TO 9 REMOVE DIVERGER ENTRY IF(D(3J.NE.0)G0 TO 12 CALL RETURN(JCC0RE(MA),HE,ME,2) 8 CALL TCCELLlJCC0RE(MAl,MB,D(2)fPf 2» SECOND PASS 9 CALL T0CELL(JCC0RE(MAA)fMBfMI,P<4»t3) IFIP(2).EQ.2)GQ TO 91 JCPCFP=HB JCPOSP=MC IF((MH»JCPOSN).LE.O)GO TO 93 GO TO 92 91 IF((MH»JCPOSN).GE.O)GO TO 93 92 JCPOSN=MG KH=0 93 IF(K2.LT.0)GO TO 13 MD=-l M2=-l GO TO I NO CONNECTION 10 IF(MC.GT.O)GO TO 11 JCPCSN=HG GO TO 5 11 CALL SYSERRntHB) GO TO 9 NODE CNDIVERGER 12 CALL SYSERR(2f 0(3)) GO TO 9 13 CALL SYSEXT RETURN END

PAGE 355

343 C C «• ...«.••»»•»•••• .•«•..«•••.».• c •» C • COUPLE • c ••* c C PURPOSE C COUPLE JOINS TWO SPECIFIED NODES. C CALL COUPLEtJCNTWK.JCPOFP.JCPOSP.JCPOSF.JCPOSS.JCADSN, C JCCLNOJ C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCNTWK = THE ADDRESS OF THE NETWORK INFORMATION BLOCK C JCPOFP = THE ADDRESS OF THE FIRST NODE C JCPOSP = THE ADDRESS OF THE SECOND NODE r jCPOSF = -1, OR N. IF JCPOSF IS -I OR Oi THE NEW PATH C FROM JCPOFP IS POSITIONED AT THE END OR BEGINNING r OF THE DIVERGER RESPECTIVELY. IF EQUAL TO N, C JCPOSF INDICATES THE POSITION IN THE DIVERGER THAT C THE NEW PATH IS TO OCCUPY. C JCPOSS = THE SAME AS THE JCPOSF, BUT FOR THE REVERSE PATH C FROM JCPOSP TO JCPOFP C JCADBN = OR I AS RESPECTIVELY A DIVERGER IS NOT OR IS C ALWAYS REQUIRED BETWEEN NODES C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C THE NUMBER REPRESENTED BY JCTCiA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FRHCEL C FSTLNK C LNKFWO C NEWCEL C SYSENT C SYSEXT C TOCELL C C ERROR CODES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C SUBROUTINE COUPLE( JCNTWK, JCPOFP, JCPOSP, JCPOSF, JCPOSS, JCADBN, 1 JCCLNO) COMMON/ ALLOC/JCCOREI I) DIMENSION P«7I,GI10),D(5) INTEGER P,"G,D DATA P/2,l,Ul,5,l,l/.G/3,l,l.,l,2,l,l,3,l,l/,D(3)/0/ C ENTER CALL SYSENT(1,3,3,2,JCCLN0» C SPUR Hl=JCNTWK+l

PAGE 356

344 Hl=JCCORE(Hl) H2=m+4 M2=JCC0RE(17)+7+14»{JCC0RE(M2)/5)-2»CJCC0RE(M2J/6) MA=«l*5»(JCCORE(H2J-l) M2=M2*l MAA=M1*5»(JCC0RE«M2)-1) M2=0 C FORWARD PATH P(l)=2 P«2)=l P{6)»1 Pt7)=l MB=JCPQFP 0(2)=»JCP0SP MC=JCPOSF C CURRENT LINK 1 CALL FRMCEL(JCC0R£{MAA),M6,0(4),P,1) D(5)=D(5)+l CALL TOCELL ( JCCORE ( MAA ) , MB , 0( 5 J , P ( A ) , 1 ) P(l)=l D(l)=0l4) IF(MC.E0.0)MC=1 MD=0 1F10(IJ.GT.O)GO TO 2 C END OF PATH IF(JCADBN.GT.0»GO TO 5 C NO DIVERGER REQUIRED ME=0(2) GO TO 6 C FIND POSITION 2 CALL FRMCELJJCC0R£(MA»,C{l).MlfG(7>,2) IFIMl.EQ.OJGO TO A C NODE TO NODE Hl=0(2) D(2J=0(U H2=l GO TO 5 C CONTINUE 3 0(2»=M1 Dtl)=ME M2=0 C DIVERGER 4 IFIHC.EQ.IJGO TO 5 HD=D(1) MC-J'.C-l D(1)=LNKFW0(JCCCRE(MA)|HD,1) IF{0(1».GT.O>GO TO 4 C GET DIVERGER ENTRY 5 CALL NEWCEL(JCCOREJMA),He,l) C STORE CATA CALL T0CELL(JCC0RE(HA)fMEiD.G.2) IF(K0.E0.0)G0 TO 6 C THREAD INTO DIVERGER CALL FSTLNK(JCCORE(MA),HD,HEfl) GO TO 7 C SET NODE LINK 6 D(4)=ME CALL TOCELL(JCCORE(MAA),K0f0(4),Pt3> 1FJM2.EQ.1)G0 TO 3 7 IF(MB.EQ.JCPOSP)CO TO 8 C BACKWARD PATH

PAGE 357

345 D<2)=MB HB=JCPOSP *1C=JCP0SS P(l)=2 P(2)=2 PI6)=.2 P(7»»2 GO TO 1 EXIT 8 CALL SYSEXT RETURN END

PAGE 358

346 C c«*««««> ••• ••• • ••»••• •• r »»»»«•»»» C • LNKBNT » C • c " C PURPOSE C LNKBNT RETRIEVES THE BACKWARD LINK FROM A SPECIFIED NODE. C C USAGE C LNKBNTtJCNTWK,JCPOFP,JCPOSP,JCHHDE,JCCLNO» C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCNTHK = THE ADDRESS OF THE NETWORK INFORMATION BLOCK C JCPOFP = THE ADDRESS OF A NODE OR DIVERGER ENTRY C JCPOSP = THE ADDRESS OF THE NEXT DIVERGER ENTRY r JCWHDE = -If OR N, WHERE N IS A POSITIVE INTEGER. IF C JCPOFP IS A NODE, N IS THE SEQUENCE NUMBER OF A C DIVERGER ENTRY. IF JCPOFP IS A DIVERGER ENTRY, Q N IS THE NUMBER OF ENTRIES TO ADVANCE BEFORE C RETRIEVING THE ADDRESS OF A NODE (I.E. LNKONT). C IF JCWHDE = 0,-THE FIRST PATH IS TO BE SELECTED. C IF JCWHDE = -I, THE LAST PATH IS TO BE StLECTEO. C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J7LINK C SYSENT C SYSEXT C C ERROR CODES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C C C ••«•»••••• FUNCTION LNKBNT (JCNTWK, JCPOFP, JCPOSP, JCWHDE, JCCLNO» COMMON/ ALLOC/JCCORE( 1 ) C ENTER CALL SYSENT(l,3,3,3,JCCLN0) C GET LINK LNKBNT=J7LINKt JCNTWK, JCPOFP, JCPOSP, JCWHDE, -1,1) C EXIT CALL SYSEXT RETURN END

PAGE 359

347 C €•••• ..«•••• » »»»..«.»«..»»»»i C •••• C • LNKFNT • C .•«.•••••• c C PURPOSE C LNKFNT RETRIEVES THE FORWARD LINK FROM A SPECIFIED NODE. c C USAGE C LNKFNTCJCNTWK,JCPOFP,JCPOSPtJCHHOE,JCCLNOI C C DATA FORMAT C N/A C C . DESCRIPTION OF PARAMETERS C SEE LNK8NT C C REMARKS C THE NUMBER REPRESENTED 8Y JCTCIA MUST, FOR SOME MACHINESt C REPLACE THE I IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C SEE LNKBNT C C ERROR CODES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY c FUNCTION LNKFNT(JCNTwK,JCPOFP,jCPOSPt,JCWHDEtJCCLNO) COMHON/ALLOC/JCCOREIl) C ENTER CALL SYSENT(1.3i3,4,JCCLNO» C GET LINK LNKFNT=J7LINK(JCNTWK,JCP0FPtJCP0SP,JCWHDE,Ifl) C EXIT CALL SYSEXT END

PAGE 360

348 c ,,.». c • .«.».<•...»•• ..»«.... ••• c • • C • NEXT • C ••««.•.»•• c c ''"'^''next specifies the next node in a trace given the current C NODE. c C USAGE C NEXTlJCNTWK,JCPOFP,JCTKEY,JCDOFT,JCLEVL,JCHOCLtLION,JCOATA, C JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS ^ C JCNTWK = THE ADDRESS OF THE NETWORK INFORMATION BLOCK C JCPOFP = THE ADDRESS OF THE CURRENT NODE C JCTKEY = THE TRACE KEY C JCDOFT = +N FOR FORWARD TRACE OR -N FOR BACKWARD TRACE, f WHERE N IS A POSITIVE INTEGER. IF N > I, THE NODE C JCPOFP IS INSPECTED WITH RESPECT TO KEY AND COUNT r HATCH. IF N = 2, NEXT WILL ALWAYS ADVANCE FROM C JCPOFP UNLESS JCPOFP IS THE LAST NODE. C JCLEVL = -1 OR A NON-NEGATIVE INTEGER N. IF JCLEVL EQUALS C -I, NEXT WILL NOT ENTER A NODE TO INSPECT SU8C NODES. IF JCLEVL EQUALS N, N IS THE LEVEL OF THE r CURRENT NODE. C JCHDCL = THE ADDRESS OF THE TEMPORARY LIST HEAOCELL r LION = A VECTOR OF DATA FOR STORAGE IN THE TEMPORARY LIST C WHEN NEXT MUST ENTER A SUB-NODE LIST. C JCOATA = THE NUMBER OF DATA ITEMS IN LION (0 IF NONE) C JCCLNO » A USER ASSIGNED CALL STATEMENT ID. PARAMETER c . r THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINESt C REPLACE THE I IN THE NAMED COMMON STATEMENT. C IF THE TRACE IS COMPLETE, NEXT IS RtTURNED AS 0. C THE LEVEL PASSED TO NEXT IS THAT APPROPRIATE TO JCPOFP, C WHILE UPON RETURN THE JCLEVL IS THAT OF THE NODE INDICATED C BY THE VALUE OF NEXT. C WHEN NEXT ENTERS A SUB-NODE LIST, INFORMATION IS C TRANSFERRED FROM LION TO A TEMPORARY LIST ENTRY. UPON C COMPLETION OF A SUB-NODE LIST, INFORMATION IS TRANSFERRED C FROM THE TEMPORARY LIST ENTRY TO LION. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FRMCEL C LAND C J7L1NK C POPUP C PUSH C SYSENT V C SYSERR C SYSEXT C TOCELL . C C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERRORIOATA PROVIDED) Q I NF COUNT MISMATCH WITH NULL TEMPORARY LIST

PAGE 361

349 C (ADDRESS OF NODE) C C METHOD C THE KEYS AND COUNTS MuST MATCH FOR NEXT TO ASSUKE THE C ADDRESS OF A NODE. NEXT TRAVERSES A PATH THROUGH THE C NETWORK UNTIL IT IS FORCED TO BACK-TRACK BY END OF PATH OR C COUNT MISMATCH. BACK-TRACK DATA IS STORED IN THE C TEMPORARY LIST. IF THE KEYS AND COUNTS MATCH FOR JCPOFP, C AND JCLEVL IS NON-NEGATI VEf NEXT WILL ENTER ThE SUSNOOE C LIST FOR JCPOFP. C c FUNCTION NEXTIJCNTWK, JCPOFP. JCTKEY.JCDOFTf JCLEVL, JCHDCL, LION, 1 JCDATA.JCCLNOI COMMON/ ALLOC/JCCOREI I) DIMENSION N(19»,P(4),Q( H2=MU4 HA=JCC0RE>.GT.l)GO TO 6 IF(NEXT.EQ.0)GO TO 5 TEST NEXT 2 CALL FRMCEL(JCC0REJMA),NEXT,0',N,U IF(iD(l).EQ.0)GO TO 6 NODE 1F(D«3).EQ.JCTKEY)G0 TO 9

PAGE 362

3 50 SET KEY 0»3)=JCTKEY 0(4)=1 CALL TOCELL(JCCORE«HA),NEXTtOC3),N<7)tl» COMPARE COUNT 3 IF«Dl4).GE.Dt5) )G0 TO 12 H1=NEXT NEXT=0 ME=l REMOVE LIST ENTRY 4 IF«JCH0CL.EC.0).GO TO 11 CALL FRMCEHJCC0RE,JCH0CL,JCHOCL,D,P,lt2) REDUCE LEVEL NEXT=D(2) JCTKEY=DI3) IFINEXT.EQ.OGO TO 12 JCLEVL=JCLEVL-1 MG=1 ADVANCE 6 Hl=NEXT NEXT=J7LINKCJCNTWK,Ml,MF,0,JCD0FT,l) M£=0 IFINEXT.EQ.OGO TO 4 ADD LIST ENTRY IFIMF.LE.OGO TO 2 MAIN IFIJCHDCL.GT.OJGO TO 8 DI2)=JCTKEY 7 0(1)=0 D(3)*JCTKEY JCTKEY=Dt2) 0(2)=«MD CALL pUSH(JCCORElMa>,JCHDCL,0,P,l,l) CALL T0CELL(JCC0RE(MB),JCHDCL,LI0N,Q,3I IFIMF.EQ.OJGO TO 2 AUXILIARY 8 CALL FRNCEL«JCCORE(MO),JCHDCL,H1,R,4) CALL PUSH(JCC0RE1MC),MI,MF,R,1,2) CALL T0CELL(JCC0RE«M8)f JCHDCL,Ml,R,)C0 TO 10 1FI014).GE.D(5) JGO TO 6 D(4)=C('V)*1 CALL TCCELL(JCC0RE(MA),NEXT,0 IF(C(2).EQ.0)G0 TO 10 NEXT=«0(6»

PAGE 363

351 MF=0 JCLEVL=JCLEVL+1 GO TO 7 FAILURE 11 IFCME.NE.DGO TO 12 H2=JCNTHK+1 M2=JCCCRE(M2)»4 IF(JCC0Re(H2).NE.6)CALL SYSERRd.Hl) EXIT 12 CALL SYSEXT RETURN END

PAGE 364

3 52 C .,„. C .o.. ..«..»••• .»»..... r »»••»•»»•» C • REMOVE • C • c C PURPOSE C REMOVE RETURNS TO THE APPROPRIATE AVAILABLE SPACE LISTS A C SPECIFIED SEQUENCE OF NODES. C C USAGE C CALL REK0VE(JCNTHK,JCP0FPtJCPOSN,JCD0FT,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS r JCNTWK = THE ADDRESS OF THE NETWORK INFORMATION BLOCK C JCPOFP = THE ADDRESS OF THE NODE AT WHICH THE OPEKATION IS C TO COMMENCE r JCPOSN = IF JCPOFP IS TO BE REMOVED, AND -I OR A POSITIVE C INTEGER N TO INDICATE WITH WHICH PATH FROM JCPOFP r THE REMOVE OPERATION IS TO COMMENCE. C JCOOFT = -I OA *l AS RESPECTIVELY BACKWARD OR FORWARD TRACE C OF THE NODES FOR REMOVAL IS DESIRED C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS .^ . ^, C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE I IN THE NAMED COMMON STATEMEI^T. C REMOVE SHOULD BE EMPLOYED FOR GENDER AND DYNAMIC C PROGRAMMING NETWORKS ONLY. c C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C BREAK C CORN C FRMCEL C J7L1NK C LNKBWD C LNKFWD C POPUP C PUSH C RETURN C SYSENT C SYSEXT C C ERROR CODES FOR THIS PROGRAM C C REMOVE BEGINS WITH JCPOFP FOR JCPOSN = 0, OR WITH THE NODE r FOLLOWING JCPOFP OTHERWISE. EACH NODE ENCOUNTERED IN THE C DIRt^CTION OF TRACE IS RETURNED, PROVIDED it POSSESSES AT C MOST ONE REVERSE LINK. THE REVERSE LINK STOPPING CRITERIA C PREVENTS THE INADVERTENT DESTRUCTION OF NETWORK FEATURES C OTHER THAN THOSE SPECIFICALLY INTENDED. FOR GENDER C NETWORKS, REMOVE ENTERS EACH GROUP AND RETURNS THE GROUP C BODY ALONG WITH ALL APPENDAGES. • C c ••" c SUBROUTINE REMOVE ( JCNTWK, JCPOFP, JCPOSN, JCDOFT, JCCLNO) COMMON/ ALLOC/JCCOREll)

PAGE 365

353 DIMENSION F(^),G(T),Q(lO),VU),El<»).H(10),T(4),Ct2) tl«*).0(6l INTEGER F.G.B.V, E,T, CO . . ,,, , ,. , „ , , DATA F/l,3,Ul/,G/2,7,l,3,8,l,3/,Q/3illflflt9tliltl2,l,l/iV/l,2,l, I l/,E/I,22.1»l/fM/3,l7,l,l,16,l,l,13,l,l/,T/l,6,0,0/,I/lt3t2,2/ C ENTER CALt SYSENTtl,3,3f7,JCCLN0) C SPUR'S GENERAL Hl=JCNTHK* 1 MA=JCCORE(Hl) Ml=HA*4 MB=JCCORE(Hl) Ml=JCC0RE(l7)t7 + l'V»(M8/5)-2»
PAGE 366

3 54 5 CALL FR^?CEL{JCC0RE(HD»,C(l),D,G|2) 6 CALL RETURN(JCCORE(MD),C(l).C(l)tl) IF(M8.NE.2)Ga TO 3 C DECISION VARIABLE LIST Hl*2 7 IF«0«Ml).EQ.O)GO TO 8 CALL FRMCEHJCC0RE(MF),D(Ml),M2tVf3) H2=MF>5»M2»(l+Ml/2) M3=0(H1) 0(Ml)=LNKFHD(JCCORE(M2)tM3f 1) CALL RETURN(JCCORE(M2),M3,M3,21 GO TO 7 C TEAR VARIABLE LIST 8 Hl=Ml*l IF(H1.EQ.2>G0 TO 12 IF(M1.EC.3)G0 TO 7 C SIM HI=A 9 IF(0(H1).EQ.0)GQ TO 10 M2=D
PAGE 367

355 18 1F(0(MH.EQ.0)G0 TO 19 M2=D(M1I M3=MA+5«(D(3)-i) CALL RETURN«JCC0RE(M2),H2,M2,7) FUNCTION VALUE BLOCK 19 Ml^Ml*! IF(M1.EQ.2)G0 TO 18 GO TO 3 EXIT 20 CALL SYSEXT RETURN END

PAGE 368

356 C ,,.••»« C»«««« • •#•..•« •••••»..•..» .•.«» c C • SEARCH • c • ••» c C PURPOSE C SEARCH SEARCHES A NETWORK FOR A SPECIFIED PATTERN OF DATA C ITEM VALUES. C C ^ CALL SEARCH(JCNTWK,JCPOFP,JCPOSP, LION, LOCAL, JCTKEY.JCDOFS, C JCLEVL,JCHDCL,JCCLNO) C C CATA fORHAT C K/A C C DESCRIPTION OF PARAMETERS C JCNTWK = THE ADDRESS OF THE NETWORK INFORMATION BLOCK C JCPOFP = THE ADDRESS OF THE NODE ON WHICH THE SEARCH IS TO C COfHENCE C JCPOSP = THE ADDRESS OF THE NODE FOUND TO CONTAIN THE DATA Q PATTERN, OR FOR SEARCH FAILURE r LICN = THE VECTOR OF CATA ITEM VALUES C LOCAL => THE VECTOR SPECIFYING THE LOCATION WITHIN THE NODE C OF THE CATA ITEMS C JCTKEY " THE TRACE KEY . .^^ C JCOOFS = SEE THE LOCATE DOCUMENTATION. JCDOFS ABSOLUTE r VALUES OF 1 AND 2 CAUSE JCPOFP TO BE FIRST NODE C INSPECTED, WHILE 3 AND 'i CAUSE NEXT NODE AFTER C JCPOFP TO BE FIRST NODE INSPECTED r JCLEVL = SEE THE NEXT DOCUMENTATION C JCHDCL » THE ADDRESS OF THE TEMPORARY LIST HEAOCELL C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C ^"'tHE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C THE SEARCH MAY BE SPECIFIED AS EITHER FORWARD OR AS C BACKWARD ONLY. C SUBRCUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5C0MP C NEXT C SYSENT C SYSEXT C C ERRCR CODES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C c • •••••••••• ) ^ SUBROUTINE SEARCHJ JCNTWK, JCPOFP, JCPOSP , LION, LOCAL, JCTKEY.JCDOFS, 1 JCLEVL, JCHCCL, JCCLNO) COMMCN/ALL-OC/JCCOREC I) OIHENSICN LION( n.LCCALd) C ENTER CALL SYSENT(l,3,3,7,JCCLN0) C SET TEMPORARY PARAMETERS

PAGE 369

3 57 JCPCSP=0 KA=IABS(JCDOFS) MA=-(-U««MA"-(-1)»»(HA/0*HA/4) MB=JCPQFP SPUR Cf LARGEST POSSIBLE NODE Hl=JCNTWKtl Ml=»JCCCRE{Ml) M2=JCCCRE(M2) >'3 = JCCCRE(17)+8 MC=f3*lA»(M2/5)-2»(M2/6) KC=JCCCRE(MC» IF(K2.NE.2)G0 TO 1 K2=^'3^ M3=K3*6 M2=JCC0RE{M2)«-JCC0RE(M3) 1F(H2.GT.MC)MC=M2 GET NEXT NODE M1 = KB MB=NEXr(JCNTWK,Ml,JCTKeY,MA,JCLEVLiJCH0CL,LION,0il) IFnMB.EC.O).A.NC.( JCHDCL.EC.O) )G0 TO 3 TEST CONTENTS OF NODE CALL J5COMP(JCC0RE(MC),MB,LION,LOCALf JCDOFS.Ml.l). !F(Ml.EC.O)GQ TO 2 SUCCESS JCPCSP=fB IF(JCDCFS.LT.0)JCD0FS=M1 EXIT CALL SYSEXT RETURN END

PAGE 370

358 •••e»«>B** c c«« Q • J7LINK » J. •»#»»««••• C r PURPOSE C J7LINK RETRIEVES A LINK FROM A SPECIFIED NODE. C C "^*"7LINK(JCNTHK,JCP0FP,JCP0SP,JCWHDE,JCF0RB,JCCLN0) C C DATA FORMAT C N/A C " C DESCRIPTION OF PARAMETERS „ .„„ , ,»,« C JCFORB = -1 FOR BACKWARD OR +1 FOR FORWARD LINK ^ FOR ALL OTHER PASSED PARAMETERS SEE LNKBNT C C '^^''^THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FRMCEL C LNKFWD C SYStNT C SYSERR C SYSeXT C ERROR COOES FOR THIS PROGRAM r CODE FATAL ERROR(DATA PROVIDED) „.^o. I 1 NF JCWHDE TOO LARGE (NUMBER OF DIVERGER ENTRIESI C C METHOD C SELF-EXPLANATORY C c c »••»•••••• FUNCTION J7LINK(JCNTWK,JCPOFP,JCP0SP, JCWHDE, JCFORB, JCCLNO) COMMON/ALLOC/JCCORE( I) DIMENSION F(7),P(4),012) INTEGER F,P,D DATA F/2,3,l,l.l.ltl/,P/lt2,l,l/ C ENTER CALL SYSENT(1,3,3,3,JCCLN0) C "" PREPARE SPUR ADDRESSES M1=JCNTWK+1 Ml=JCCORElMl» !2=JCC0REH7)+7+lA.(JCC0RE(M2)/5)-2«(JCC0RElM2)/&) MA=Ml+5»(JCC0RE(M2)-l) C TEST JCPOFP Fm=2 F(5)=l IF(JCF0RB.LT.0)F(5)=2 CALL FRMCEHJCCOREIMA), JCPOFP, 0,F,l» JCP0SP=0 . IFIC(1).EQ.0)G0 TO 7 C JCPOFP IS A NODE F«U»1 1F<0(2).EQ.O)GO TO 6

PAGE 371

3 59 CALL FRMCEL(JCC0RE(MA),0(2».Ml,F,2) IF(Kl.NE.O)GO TO 6 C FIND CIVERGER ENTRY 1 MB=1 2 IF((MB.GE.JCWHDE).ANO.(JCWHOE.GE.O))GO TO 3 Hl=D«2) 0(2)=LNkFWD(JCC0RE(MA),M1,1) IF(Ct2».GT.0)GO TO 2 D(2l=Ml IF( JCWHDE.lt. 0)GO TO A C ERROR NOT FOUND H2=MB-l CALL SYSERR(1,M2) C FOUND 3 JCPOSP=UNKFWD( JCC0RE(MA),D12»,2) 4 CALL FRMCEL
PAGE 372

360 C €••••• * •»•«•. »• • • Q •<«••*•••• C • DATIVE • C •• c C PURPOSE C DATIVE PERFORMS DECISION AND/OR TEAR VARIABLE FILE UPDATE C FROM THE GENDER DECISION AND TEAR VARIABLE LISTS. C C USAGE C CALL DATIVE(JCGRUP,JCDTOB,JCCLNO» j C ; C DATA FORMAT C N/A C ; . C DESCRIPTION OF PARAMETERS i C JCGRUP = THE ADDRESS OF A GROUP OR Q IF THE ENTIRE GENDER C LIST IS TO PARTICIPATE ! C JCDTOB =0, 1 OR 2 AS RESPECTIVELY JOECI SION ONLY, TEAR ONLY C OR BOTH DECISION AND TEAR IVARIABLE FILES ARE TO BE C UPDATED C C REHARKS C THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES, C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FETCH C FRHCEL C LNKFWD C SEARCH C STORE C SYSENT C SYSEXT C TOCELL C C ERROR COOES FOR THIS PROGRAM C NONE . C C METHOD C WHEN JCGRUP IS 0. THE ENTIRE SELECTED FILES ARE COMPLETELY C REWRITTEN. WHEN JCGRUP REFERS TO A GROUP, THE SELECTED C FILES ARE EXPANDED BY THE GROUP'S DECISION AND/OR TEAR C VARIABLE LISTS. C c SUBROUTINE OAT I VE« JCGRUP, JCDTOB, JCCLNO) COMNON/ALLOC/JCCOREC I » DIMENSION L(8),S('V),D(3J,F('»),T«2),G(4),V(7»,N(4» INTEGER S,D,F,T,G,V DATA S/l,l,l,3/,L/4,l,l,l,l,l,I,I/,F/l,3,l,l/,G/l,7f2,3/,V/2,2l,li I X,2,l,l/,N/l,1.4,0/,MH/I/,MI/l/ C EMTER CALL SYSENTd, 3, 4,1, JCCLNO) C • MA=ADORESS OF SPUR FOR GROUP H1=JCC0RE{16)*1 M2=JCC0RE(H1) M3=JCC0RE(17)*8 HA=M2*5»JCC0REIM3)-5 C MB=AD0RESS OF SPUR FOR DECISION AND TEAR LIST ENTRIES

PAGE 373

361 MBA=JCC0RE(H3>-1 M8=M2*5»MBA C MC=AO0RESS OF SPUR FOR SECEDE H2=JCC0REI15)+1 MC=JCC0RE(M2) C HO=AOORESS OF LOAD VECTOR I H2=H2*l M0=JCC0REIH2) M3iMD*28 JCC0R£(M3)=-l C ME=ADORESS OF LOAD VECTOR 2 HE=HD«-30 M3=HE*28 JCCCRE(M3)=-l C MF=CURRENT GROUP MF=JCGRUP IFIHF.GT.OJGO TO 1 Hl=Hl-l MF=JCC0RE(M1} C MG=KEY Hl=Ml+2 HG=JCCOREJMl)+l C MH AND HI ARE INDICATORS C MJ=LEVEL HJ=0 C HK=TEMPORARY LIST HEADCELL MK=0 GO TO 7 C FIND END OF FILECS) 1 IF(JCDT0B.EQ.2)G0 TO 4 H1=M0 2 H2=l H3=I 3 CALL FETCH( JCC0RE(MC)tL
PAGE 374

362 M2=H0 M3=>H LIST 10 IF«T(M4).EQ.0)G0 TO 12 CALL FRKCEL(JCC0RE(MBl,TlM4),0«2)iV,2J D(l>=3+0(3) CALL STQRE{ JCCORE I MO , L ( H3 ) ,0, S, V( 5 ) , JCCORE I M2 ) 1 1 » M3=5*2«(M4-l) M5=^'3l IF(0(3).EQ.0)G0 TO 11 M6=«BA*T(M4) L(H5J=0 N('i> = D(l» . . ». CALL ST0RE{JCC0RE«MC),L{M3»,JCC0RE(M6),N,V<5),JCC0REtM2)i2) 11 L(M5)=0ll) T ( MA )=LNKFWO( JCCORE ( MB ),T(M4),1) GO TO 10 TEAR 12 IF«HA.EQ.UMH=M3 IF(HA.EQ.2)HI=M3 IF((H4.EQ.2).0R.(JC0T0B.EQ.l)»GO TO 14 13 M2='ME M3=M1 MA=2 GO TO 10 ITERATE lA IF(MF.NE.JCGRUP)GO TO 8 ZERO LAST RELATIVE LINK 15 IF(KH.EQ.1)G0 TO 16 M1=M0*4 JCC0RE(M1)=0 16 IFtHI.EQ.DGO TO 17 H1=ME*A JCCCRE(H1)=0 EXIT 17 CALL SYSEXT RETURN END

PAGE 375

3 63 SUBROUTINE JORTRN( NIBLG.NSPURi IPTR, lOCALL) comhon/alloc/jccore( n DIMENSION NSPURIl) LOCAL VECTORS REQUIRED. DIMENSION L0CPTR(A),L0CT0p(7),Nr0Pl2)tL0CNPEI4» DATA L0CPTR/l,7f 111/ LOCTOP 2 ITEMS. TYPE FLAGf NOP DATA L0CT0P/2,9,2,2,5,l.l/ DATA LOCNPE/1,5,2,2/ CALL SYSENT(l,3,5,l,IDCALL) LN=IPTR SET UP HEACCELL FOR PUSHDOWN LIST. LHC=0 10 CALL FRMCELI NSPUR.LN.NTOP, LOCTOP, 2) N0P=NT0P«2) 00 30 1=1, NOP LNK^^O CALL BREAK(NIBLG,LN,LNK, 1,0,4) IF(NTOP(l).LE.l) GO TO 20 CALL PUSH (NSPUR.LHCLNK.LOCPTR, 1,6) GO TO 30 20 NWKEND=iLNK 30 CONTINUE CALL R£TURN(NSPUR,LN,LN,8) IFUHCECO) 60 TO 40 CALL P0PUP(NSPUR.LHC,LHC,LN,L0CPTR,1,10) GO TO 10 40 CALL FRKCEL(NSPUR,NWKEN0fNPE,LOCNPE,12) IF(NPE.EQ.O) CALL RETURN(NSPUR,NhKEND,NWKEN0,14) CALL SYSEXT RETURN END

PAGE 376

364 SUBROUTINE JOSVIF(NIBLG,NSPUR, ICNT.NIOVI.IDCALL) COKKON/ALLOC/JCCOREi I) DIMENSION NSPUR(l) OIKENSION IDQP(2) LOCAL VECTORS REQUIRED DIMENSION L0CNH7)iL0CVIF(*),L0CNPEI4) ; LOCNl 2 ITEMS, TYPE FLAG, NID DATA L0CNl/2.9,2,2,7,l,l/ DATA LOCVlF/1,9,1,1/ DATA L0CNPE/l,5,2t2/ : CALL SYSENTtl,3,5,2,I0CALL) ICNT=0 NIBLG3=NIBLG*2 JCCCRE(NI6LG3)=JCC0RE(NIBLG3)*1 LHC^O „„ C CLEAR ALL VIF FLAGS. LNK=JCCOREINIBLG> 10 NWKEND=LNK ,^ ,. CALL T0C6LL{NSPUR,LNK,0.L0CV1F,2) , ur o n Al LNK =NEXTtNIBLG,LNK ,JCC0RE{NIBLG3», 2,-lt LHC.O.O, 4» IF(LNK.GT.OI GO TO 10 , 20 If «N^O^^-|?-°\J%J° J3„eER OF NODES ENTERING NWKEND. CALL FRMCELCNSPUR.KWKE^^^^^^^ C INTEREST. IF IT IS. TRACE BACKWARD THROUGH NETWORK C SETTING VIF FLAGS. DO 50 I=1»N LNK=LNKBNTINIBLG,NHKEN0,NU,I,8) CALL FRMCEL(NSPUR,LMK, IDOP, LOCNl, lOJ^ ,„tcdi:<:t C CHECK IF OPERAND IS VARIABLE OF INTEREST. IF(ID0P(1).NE.1.0R.ID0P12).NE.NI0VI) GO TO 50 Q VARIABLE OF INTEREST FOUND. 30 CALL T0CELLtNSPUR.LNK,I,LOCVlF,l2) IF«LNK.EQ.JCC0RE(NIBLG1 > GO TO 40 LNK=LNKBNTCNIBLG,LNK,NU,1, 14) GO TO 30 40 1CNT=ICNT*1 50 CONTINUE 60 CALL SYSEXT RETURN END

PAGE 377

3 65 SUBROUTINE HATH(NIC,A,B,C, lOCALL) COMMON/ALLOC/jCCOREd) CALL SYSENTH,3f5,3,I0CALL) I:«JCC0REU7)*l IFIJCCCREd I.NE.l) CALL SYSERRi 2t JCCOREC I ) ) IFlNID.LT.l) GO TO 200 J=NI0/100 IF(J.GT.2) GO TO 200 K=NID-100»J IF(K.EQ.O) GO TO 200 J=J*1 GO TO(l00Of2000t3000>.J 10 CALL SYSEXT RETURN 200 C=0.0 CALL SYSERR(liNIO) GO TO 10 : UNARY OPERATORS 1000 IF(K.GT.IO) GO TO 200 ..^„, „ GO T0( 1010, 1020, 1030, 10
PAGE 378

366 FUNCTION HATHCP(NIO,A,B,IDCALL) COMH0N/ALL0C/JCC0R£( I) CALL SYSENT{l,3,5,'i,IDCALL) I=JCC0RE(17)+1 lFUCCORE«n.NE.U CALL SYSERR (2. JCCORE ( I ) > IF(NID.GT.307.0R.NID.LT.301) GO TO 200 HATHCP=l K=NID-NIO/100»100 GO TO(10^20,30|40t50,60t70).K 10 IF(A.LT.O) GO TO 90 GO TO 100 20 IFIA.LE.B) GO TO 90 GO TO 100 30 IF(A.EQ.B) GO TO 90 GO TO 100 40 IFCA.NE.B) GO TO 90 GO TO 100 50 IFtA.GE.B) GO TO 90 GO TO 100 60 IF(A.GT.B) GO TO 90 GO TO 100 70 IF(A-B) 80f90tl06 80 HATHCP=-1 GO TO 100 90 MATHCP=0 100 CALL SYSEXT RETURN 200 CALL SYSERR(l.NID) GO TO 100 END

PAGE 379

367 SUBROUTINE ROPA(AtD) DOUBLE PRECISION A B=A RETURN ENO

PAGE 380

368 SUBROUTINE JORLSE(N I BLG.LHCIOCALL) COMMON/ALLOC/JCCOREd) CALL SYSENT(l,3,5,5,I0CALL) IF(LHC.EO.OJ GO TO 10 C SET LI AND L2 TO SPUR BLOCK POINTERS NEEDED. Ll=JCC0REINIBLG+3)*5 L2«Ll*15 £ SET L3 TO POINTER TO AUXILLIARY LIST. L3 = JCC0R£(H-2)*LHC L3=JCC0RE(L3) C RETURN LHC AND AUXIALLARY LIST. CALL RETURN(JCC0RE(L2)iLHC,LHC,2) LHC=0 L4=0 IF(L3.GT.0I CALL RETURN( JCCORE (LI) i L3|L4tAJ C 10 CALL SYSEXT RETURN END

PAGE 381

369 FUNCTION JOCPNDIITEMl, lTEM2f lOCALL ) DIMENSION ITEMlll),ITEM2(l» CALL SYSENT(li3,5,ll,IDCALLI lF(ITE«l(l)-lTcH2( 1)) 40,10,60 10 IFdTEMKD.EQ.O) GO TO 30 lF(ITEHll2)-ITEH2{2)) AO, 20,60 20 IFnTEMll3)-ITEM2(3)) 40,50,60 CONSTANT 30 IF(MATHCP(307,ITEMlt4),ITEM2(4»t2)) 40,50,60 40 J0CPND=-1 GO TO 70 50 JOCPND=0 GO TO 70 60 J0CPN0=1 70 CALL SYSEXT RETURN END

PAGE 382

370 SUBROUTINE J0MTCH(N1BLG,NSPUR, NODE, LOW . N.LI STtLIONtLNKIXtLNKPTt 1 IDCALL) COMHON/ALLOC/JCCOREd) DIMENSION LIST(l),LION(l) DIMENSION NSPUR(l) DIMENSION NCAT(6» C LOCAL VECTORS REQUIRED. C LOCALL 5 ITEMS, VIF, TYPE FLAG, NOP, NIO. VALUE. OIKENSICN L0CALL(13) DATA L0CALL/<»,9,l,2,5,l,l,7,l,l,8,l,0/ CALL SYSENT(1,3,5,12,I0CALL) L=LOH*l LNK1X=0 LNKPT=0 IF(L.GT.N) GO TO 30 I=JCC0RE(l7)*l L0CALL113»=JCC0RE(I) DO 20 I=L,N LNK=LNKFNT (NIBLG, NODE, NU, 1,2) CALL FRMCEL(NSPUR,LNK,NOAT, LOCALL, A) DO 10 J=l,^ IF«LIST(J).EQ.l.AN0.LION«J).NE.NOAT«J)> GO TO 20 ^° IF(LIST(5).EQ.I.AND.HATHCP(303,LION15),NDAT(5),6).NE.O) GO TO 20 C MATCH IS FOUND. LNKIX=l LNKPT=LNK GO TO 30 20 CONTINUE C NO MATCH IS FOUND. MRITE(6,900) N0DE,L0W,N,LNKIX,LNKPT,aiST(I),LI0N(I),I=«l,6) ^^ 900 F0RHAT(1X,'J0MTCH-N0DE,L0H,N,LNKIX,LNKPT, LIST, LION', 5110,/, 12110) JCC0RE(13)=6 RETURN END

PAGE 383

371 SUBROUTINE JONTPS( NIBLG.NSPUR, PSPUR, IPS.NWKENO, IDCALL) COMMON/ ALLOC/JCC0RE( 1 » INTEGER PSPURiPSPURCfPSPURV.PSPURO oUenSiSn US51IlOCNJ13),L0CPS(10).LOCC(7I,LOC0IM(4),L0COPR{10» DATA LCCN/4,9,2t2t7,lt 1»5, l.lf 8,1,0/ DATA L0CC/2f 3,1,1,23,1,0/ DATA L0CDIH/I,22.l,l/ DATA LOCOPR/3,3,l,l»2,l,l,21fl,l/ DATA LQCPS/3,1, 111 I 3f 1.1.22,1,1/ C . CALL SYSENT(1,3,5,13,IDCALL) I=JCC0RE«17)+1 L0CN(13J=JCC0RE(1) L0CC(7)=L0CN(13) C POINTER TO SPUR BLOCKS CALCULATIONS C PSPURC CONSTANTS (LOCAL) r PSPURO OPERATORS C PSPURV VARIABLES (NO INDICES) 1=1-2 PSPURV=(JCCORE( H-12)-n«5+PSPUR PSPURC=(JCCORE( I+8)+JCC0R£( I*2>-1)»5-I-PSPUR PSPURO=(JCCORE( I+11)-1J»5*PSPUR ^„„„^„ r TRACE NETWORK BACKWARDS USING THE VERB NEXT. THE ORDER C OF SUCH A TRACE IS IN A REVERSE POLISH ORDER. LHC=0 LNKsJCCOREINIBLG) NIBLG3=NlBLG+2 JCCCR£(NIBLG3)=JCCCRE(NIBLG3)*l JPS=0 ,. 10 CALL FRHCELI NS PUR,LNK,N00E,LaCN,2 ) JTYPE=N00E(1)+1 GO TO(20r30,'»0»,JTYPE C CONSTANT FOUND. 20 N0DE(3)=5 CALL NEWCEL(JCC0RE(PSPURC),NC,4) CALL T0CELL(JCC0RE(PSPURC),NC,NODE(3»,LOCC,4) GO TO 50 C VARIABLE FOUND. 30 CALL FRMCEL( JCCORE( PSPURV ) ,NOOE( 2 ) ,NDIM,L0C01M,6) ISPT=N0IM»5+PSPURV CALL NEWCEL( JCCORE( ISPT ) , NC,8 ) CALL COPY(JCCORE( ISPT), N00E{2),NC, 0,10) GO TO 50 C OPERATOR FOUND. 40 NOOEll)=0 CALL NEWCEL(JCC0RE(PSPUR0),NC,14) CALL TOCELL ( JCCORE ( PSPURU ) ,NC, NODE , LOCOPR . 14) 50 CALL FSTLNK(JCC0RE(PSPURV),NC,JPS,12) JPS=NC C GO TO NEXT ENTRY IN NETWORK. LNK =NEXT(NIBLG,LNK , JCC0RE(NIBLG3 ) , 2,-1. LHC,0,0,16) IF(LNK.GT.O.AND.LNK.NE.NWKEND) GO TO 10 CALL J0RLSE(NI0LG,LHC,17) C RELEASE NETWORK CALL J0RTRN(NIBLG,NSPUft,JCCORE(NIBLG),18) C RELEASE OLC POLISH STRING. 50 CALL FR«CEL(JCC0RE(PSPURV),IPS,N0DE,L0CPS,20) J=N0DE(2)+1 GO TOI70,80,70,80,80,90),J C OPERATOR OR MODULE CONSTANT 70 K«=PSPURO

PAGE 384

372 GO TO 100 C VARIABLE 80 K»5«N0Dei3)+PSPURV GO TO 100 C LOCAL CONSTANT 90 K«PSPURC 100 CALL R6TURN(JCC0RE(K)f IPS.IPSt22) lPS=NaDE(l» IFIIPS.GT.O) GO TO 60 IPS=JPS CALL SYSEXT RETURN END

PAGE 385

373 SUBROUTINE JOPSTN( N IBLCNSPUR, PSPUR, IPS.NWKENO.NIDVI , lOCALL) COMMON/ALLOC/JCCOReCl) DIHENSION NSPUR(l) INTEGER PSPURfPSPURV OIMENSICN LI0N(6)iNCHK(2)fLI0Nl(3> C LOCAL VECTORS REQUIRED DIHENSICN L0CNll3)fL0CP(16),LCLPTR(4) OIMENSICN LCCNPECtJ.LOCNZlTI.LOCPKlO) DATA LCCN/^i9,l,2,7,l,l,3f If ItSil.O/ DATA LQCP/5,2X.l,lf3,I.li2tltlf22f Iflf23flt0/ DATA LCLPTR/lfTilf 1/ DATA LOCNPE/1,5,2,2/ DATA L0CN2/2,9,2,2,7,l,l/ DATA L0CPl/3.3,ltl.2f lilf22fl»l/ DIMENSION NCST(6).NEQl6) DATA NCST/OiO,0,l,0,0/ DATA NEO/C,2,101fliO,C/ C . CALL SYSENT(If3i5fl4fIDCALL) 1 = JCC0REU7)-1 PSPURV=(JCCORE{ I+12)-1»«5+PSPUR ISIZ=JCC0RE(PSPURV*3J I=JCC0RE(I*2) L0CN(13)=I L0CPI16)=I C OBTAIN END CELL FOR NETWORK CALL NEWCEL(NSPURfNWKEND,2) C SET FLAG TO INDICATE NETWORK NODE CALL TCCELUNSPURtNWKENDf ltL0CN(7).3) NI=0 LNK=1PS C OBTAIN CONTENTS OF NEXT ENTRY ON POLISH STRING. 10 CALL FRMCEL(JCC0R£(PSPURV),LNK,LI0N,L0CPt4) NOP=LIONll) JTYPE=LI0N12)*1 NI0=LI0N(3I NDIK=LICNt'») CALL NEHCEL(NSPUR,N2,6J GO TO(20,'»0il0Oi40il2O.110),JTYPe C OPERATOR 20 L1QN12)=2 1 = 1 . 30 CALL P0PUP(NSPURtNl,Nl,N3,LCLPTR,l,8) CALL COUPLElNIBLG,N2,N3,-l,OiO,10) 1=1+1 IF(I.LE.NOP) GO TO 30 GO TO lAO C VARIABLE FOUND C *^ CONTINUE ^^^^^ ^^ ^^^^ VARIABLE HAS OCCURRED BEFORE IN NETWORK. CALL FRMCEL( NSPURiNWKcND, NPE, LOCNPE, 12) IF(NPE.EQ.O) GO TO 85 DO 80 1=1, NPE LCHK=LNK3NrtNiaLG,NWKEND,NU,If 14) CALL FRKCEL(NSPUR,LCHK,NCHK,L0CN2, 16) IFCNCHKt D.NE. I) GO TO 80 C VARIABLE FOUND. COMPARE WITH CURRENT VARIABLE TO SEE IF CALL FRMCELt JCC0RE(PSPURV),NCHK(2),LI0Nl,L0CPltl8) C COMPARE TYPE, NIO, AND DIMENSIONALITY. DO 50 J=l,3 IFILIONU+D.NE.LIONUJ)) GO TO 80

PAGE 386

374 50 CONTINUE C COMPARE INDICES FOR VARIABLES IF(NDIM.EQ.O) GO TO 70 Jl = NCHK(2)«-ISIZ J2=LNK»ISIZ 00 60 J=ltNOIM IF(JCC0RE(Jl).NE.JCC0RE(J2)) GO TO 80 Jl=Jltl 60 J2=J2*l C VARIABLES ARE THE SAME 70 LI0N(3)=NCHK«2) GO TO 90 80 CONTINUE 85 LI0N(3)=LNK 90 IF( JTYPE.EQ.4) NIOVI=LION( 3) LI0N(2>=1 GO TO 130 C MODULE CONSTANT FOUND. 100 CALL MATH(101,JCC0Rt(MI0)tNUtLI0N(5),20) C LOCAL CONSTANT FOUND. 110 L1CN(2»=0 C ^° ^° \ FUNCTION FOUND (IF FOUND, IT IS THE VARIABLE OF INTEREST C ALSO). 120 LI0N(3>=LNK LI0N(2l=l NIOVI=LNK C 130 CALL C0UPLE(NIBLG,N2,NWKEND, 0,0, 0,221 C STORE ITEM DATA IN NETWORK NODE. 140 LI0N<1»=0 H0N(A>=1 CALL T0CELL{NSPUR,N2,LI0N,L0CN,2A> C OBTAIN NEXT ITEM ON POLISH STRING. LNK=LNKFWD(JCC0RE(PSPURV),LNK,26) IF(LNK.LE.O) go TO 150 CALL PUSH(NSPUR,N1,N2,LCLPTR,1,28» GO TO 10 C CHECK IF LAST ELEMENT WAS =. 150 IF(LICN(2).Eg;2.ANC.LlON{3).EQ.lOl) GO TO 160 C ATTACH ZERO, EQUAL TO NETWORK, CALL NeHCEL(NSPUR,NZERO,30) CALL R0PA(0.D0,NCST(5) ) CALL TCCELHNSPUR,NZERO,NCST,LOCN,32) CALL NEWCEL(NSPUR,NH0UAL,3A) CALL TOCELL(NSPUR.NE0UAL,NEQ,LaCN,36) CALL CaUPLEtNIBLG,NZESO,NHKEND, 0,0,0,381 CALL CCUPLE(NiaLG,NEQUAL,N2, 0,0, 0,^0) CALL COUPLE
PAGE 387

375 FUNCTION jOCPCO(NIDLG,NSPURf lOPl.lOPZ.IOCAUL) COHKCN/ALLOC/JCCOREC U DIMENSION NSPUR(l) DIMENSION LST1(5),LST2{5) C LOCAL VECTORS REOUIREO. „. „, C tOCNl * ITEMS, TYPE FLAG. NID, NUMBER OF OPERANDS, j; VALUE OF CONSTANT. DIMENSION L0CNl(13) DATA LOCNl/'*. 9, 2, 2, 7, 1, 1,5,1, 1,8,1,0/ c CALL SYSENT(1,3,5,21,IDCALL) NIBLG3=NIBLG*2 JCC0RE(NIBLG3)=JCC0RE(NIBLG3»*1 I=JCC0RE(17)+1 L0CN1113)=JCC0RE(1) LHI=0 LH2=0 JOPl-IOPl JOP2=10P2 C COMPARE NOCES. 10 CALL FRMCELINSPUR,J0P1,LSTI,L0CN1,2I CALL FRMCEL(NSPUR,J0P2,LST2,L0CN1,<,> J=J0CPNDtLSTl,LST2,6> IF(J.NE.O) GO TO 20 Q BOTH NODES EQUAL. GO TO NEXT iJODE PAIR. J0Pl=NcXT(NlELG,J0Pl,JCC0RE{MlBLG3), 2,-1, LH1,0,0, 8) J0P2=NEXTINIBLG,J0P2,JCC0RE(NIBLG3), 2,-1, LH2,0,0,10) JQP2 -^tXM^^o 0,^ ^^^j^^^ OPERAND HAS TERMINATED. IF NOT COMPARE C NEXT NODE PAIR. (NOTE IF EITHER OPERAND TERMINATES, C BOTH MUST TERMINATE.) IF(JOPl.NE.O) GO TO 10 20 JOCPCO=J C RETURN LISTS LHl AND LH2. CALL J0RLSE
PAGE 388

376 SUBROUTINE JOORCRC NIBLG.NSPURt IOPR» IDCALL) COMMON/ ALLOC/JCCOREd) OIHENSION NSPURll) DIMENSION M00EU3) C LOCAL VECTORS REQUIRED. C LOCNl 3 ITEMS, TYPE.NOPt NIO. DIMENSION L0CTYP(4),L0CN1« 10) DATA LaCTYP/1,9,2,2/ DATA L0CNl/3»9,2,2,5,l,l,7il,l/ c CALL SYSENT(l,3,5,31,IDCALL) LHO=0 C TRACE THE OPERAND FORWARD TO ALL OF ITS TERMINAL NODES. Q PLACE EACH ONE FOUND AT THE TOP OF THE CONVERGER FOR THE C END NODE OF THE NETWORK, NWKENO. NIBLG3=NIBLG*2 JCCCRE(NlBLG3)=JCC0REtNlBLG3)*l LNK=I0PR NWKEND=0 C CHECK NODE TO SEE IF IT IS A SIMPLE OPERAND. 10 CALL FRHCEL(NSPUR,LNK,ITYPE,L0CTYP,2I IFlITYPE.GT.l) GO TO 20 C SIMPLE OPERAND NWKEND=0 CALL BREAK(NIBLG,LNK,NWKEND, 1,0,4) CALL C0UPLE«NIBLG,LNK,NHKEND,0,0,0,6) 20 LNK »NEXT(NIBLG, LNK, JCCCRE{NIBLG3) , 2,-1, LHO,0,0, 8) IFILNK.NE.O.ANO.LNK.NE.NWKEND) GO TO 10 CALL JORLSE(NIBLG,LHO,ll) C TRACE BACKHARDS. AT EACH NODE REACHED, ORDER THE NODES C OF THAT OPERAND USING ALGORITHM IB. JCC0RE(N18LG3)=JCC0RE(NIBLG3)*-1 KEY=JCC0RE(NIBLG3) LNK=NHKEND 30 LNK=NEXT(NIBLG, LNK, KEY, -2, -l.LHO, 0,0,10) C ALGORITNM IB. C SET N TO THE NUMBER OF OPERANDS TO NODE LNK. CALL FRMCELCNSPUR, LNK, NODEl, LOCNl, 12) N=NC0E1(2) « .. ,„ ^„ ,„ IF((N00El(l).EQ.2.AND.N0DEl(3)/100-LT.2).OR.N.EQ.l) GO TO 70 40 IFLAG=0 C PICK UP OPERAND I OF LNK. I0Pl=LNKFNTtNIBLG,LNK,NU,l,14) 00 60 1=2, N C PICK UP OPERAND I FOR NODE LNK. I0P2=LNKFNT(HI8LG,LNK,NU,I,16) C COMPARE OPERANDS. IF(JOCPCO(NIBLG,NSPuR, lOPlt IOP2,18).LE.O) GO TO 50 C OPERAND I LESS THAN OPERAND I-l. REVERSE THEIR ORDER IN C FORWARD OIVERGER OF OPERAND BEING ORDERED. I0P2=0 CALL BREAKINIBLG, LNK, I0P2, 1,0,20) CALL COUPLE(NIBLG, LNK, I0P2, 1-1,0,0,22) IFLAG»1 60 TO 60 , C DEFINE OPERAND 1 AS CURRENT OPERAND 2 50 I0P1=I0P2 . C TEST IF ORDERING PROCESS IS DONE. If NOT START AGAIN. IFIN.GT.2.AND.IFLAG.NE.0) GO TO AO C END OF ALGORITHM IB.

PAGE 389

377 C CHECK NODE LNK. IF IT IS NOT OPERAND BEING ORDEREOf C REPEAT FROM LABEL 30. 70 IFILNK.NE.IOPRI GO TO 30 CALL J0RLSE(NIBLG,LH0i24) CALL SYSEXT RETURN END

PAGE 390

378 SUBROUTINE JORULSI rJIBLCNSPURtNWKEMD.NIOVI ,NRUL, IDCALU) COMKON/ALLOC/JCCOREd) DIMENSION NSPUR(l) DIMENSION LL(2f3) DIMENSION N0DEl(6),M00H2(6),N0DE3(6),NODE4C6» INTEGER RHS,RHSL,RHSR,Pl,P2fEQUAL.VlF LOGICAL LEX,REX,LMUL,RMUL C LOCAL VECTORS REQUIRED DIMENSION LOCALLdaJ.LOCNIOefl.LOCVIFCV) DATA L0CALL/4i9,1.2i5,ltli7,l, If8,li0/ DATA L0CNID/l,7tl.l/ DATA LOCVIF/1,9,1,1/ „. .„.,... cwk, C RHS NID TABLE FOR LIST 1/COMP, ARCSIN.ARCCOS.ARCTAN.SIN, Q COSfTANfEXP,ALOG,RECIP/ DIMENSION LIRHS(IO) DATA NLI/10/,LIRHS/1,5,6,7,2,3,A,9,8,10/ ^ ^ ,. . C DATA VECTOR FOR SEARCHING FOR VIF FLAG USING JOMTCH. DIMENSION LIST15) DATA LIST/1,0,0,0,0/ _^ C DATA VECTORS FOR SEARCHING FOR EXP,»», AND "N DIMENSION LISTl(5),LI0fJl('»),LI0N2(4),LI0N3(4) DATA LISTl/l,l,0,l,0/,HONl/l,2,0,9/,LION2/l,2,0,l04/ DATA LI0N3/U2, 0,202/ C DATA VECTOR TO CONSTRUCT A NEW OPERATOR NODE C L0CN3 3 ITEMS, TYPE FLAG, SEARCH KEY, NID DIMENSION LOCN3(10),NOPTV{3» DATA L0CN3/3^9,2,2,3,1,1,7,1,1/ DATA NOPTV/2,1,0/ C DATA VECTOR TO CONSTRUCT A NEW CONSTANT NODE C LOCN* 3 ITEMS, TYPE FLAG, SEARCH KEY, VALUE DIMENSICM LCCN4U0),NCST(4) DATA LCCN4/3>9,2,2,3,1,1,8,1,0/ DATA NCST/Otl,0,0/ C CALL SYSENTCl, 3,5, Al.IOCALL) 9999 CONTINUE I=JCC0RE(17)*l I=JCCORE(I) L0CN4{10)"I L0CALL(13)=I NRUL=>-1 C SET VIF FLAGS FOR NETWORK CALL J0SVIFJNIBLG,NSPUR,ICNT,NIDVI,1) IF(ICNT.EQ.O) GO TO 50 C OBTAIN RIGHT AND LEFT HAND SIDE OPERANDS OF EQUAL SIGN. EQUAL=JCCORE{NIBLGJ LHS=LNKFNT(NIBLG,EqUAL,NU,l,2» RHS=LNKFNTlNieLG,E0UlL,NU,2,2) CALL FRMCEL(NSPURfLHS,N0DEl,LOCALL,4) CALL FRMCELINSPUR,RHS,N0DE2,L0CALL,5) C DETERMINE WHICH OPERAND OF EQUAL HAS VIF SET. IFINODEKD.NE.O) GO TO 30 C LHS IS Ql, RHS CO.NTAINS VARIABLE OF INTEREST. C CHECK IF RHS IS AN OPERAND (THE VARIABLE OF INTEREST ONLY) IF(NODE2(2).EQ.l) GO TO 700 C RHS IS AN OPERATOR J»N0DE2(A>/100+I GO TO (100, 20, 200), J C RHS IS A BINARY OPERATOR. C RETRIEVE RIGHT AND LEFT HAND SIDE OPERANDS FOR IT. 20 RHSL=LNKFNT(NIBLG,RHS,NU,1,3) RHSR=LNKFNT(NIBLG,RHS,NU,2,4)

PAGE 391

379 CALL FRKCeL(NSPUR,RHSLiNODE3fLOCALLf8) CALL FRMCEL(NSPURtRHSR,N00E'nL0CALL,9| J=iNC0E2('i)-l01 + 3»NCDE3{l)*6»N0DEA(n „„^^ C NEITHER LHSVIF RHSVIF BOTH C / 2 5 8 11 C •• 3 6 9 12 GO TOJ50»5O, 50, AOO.AOO, 600, 300, 300, 500, 2900, 2100,40), J C LHS CONTAINS VARIABLE OF INTEREST. CHECK RHS. 30 IF(N00E2(l).EQ.l) GO TO 900 C USE THIS EXIT IF RULES U NEEDED BUT THEY FAIL. t,0 NRUL=0 50 CALL SYSEXT RETURN C ••• •••» RULES S SORTING DONE ••• ••• C C RULE S-1 C =,c)i,Ll(COMP'SIN'COS'TAN«ARCSIN'ARCCOS'ARCTAN«ALOG«EXP«RECIP» C ,P1 BECOMES C s,(LirCOMP«ARCSIN«ARCCOS'ARCTAN»SIN'COS'TAN'EXP;ALQG«RECIP), C «1),P1 C C 3^ EQUAL C Ql LHS,N00E1 r OP RHS,N00E2 C PI WILL BE IN PI 100 P1=0 CALL 8REAK(NI8LG,RHS,Pl,l,0,10) »-HS=0 ^ ,,. CALL BREAK{NIBLG,ECUAL,LHS,1,0,111 CALL CCUPLE(NIBLG,E0UAL,Pl,2,l,0,12) CALL COUPLe(NlBLG, RHS, LHS, 0,0, 0,13) ^„.,„„ C REPLACE UNARY OPERATOR WITH NEW UNARY OPERATOR. I«NCDE21A) , .^ .,. CALL T0CELL(NSPUR,RHS,LIRHSJI),LDCNI0,IA) NRUL=1 GO TO 50 C C RULE S-2 C »,QI,LI(»N«*N),L01(N,ANY=P1) BECOMES C »,Ll(/'-),LU»N-l'*N-l),LOHN-l, DELETE PI), 01, PI C r s ECUAL Q 01 LHS,N0DE1 r OP RHSfN0De2 C PI WILL BE IN RHSL 200 NJUL^ ^^^ ^^p^^^^^^^P^^^jj^2(3),LIST,l,IL,RHSL,15) r CHECK IF MORE THAN 1 OPERAND CONTAINS VARIABLE OF INTEREST CALL J0MTCH«NIBLG,NSPUR,RHS,IL,NODE2(3),LIST,l,IR,RHSR,16) IF(IR.NE.O) GO TO 2200 Pl-O . CALL BREAK(NI8LG,RHS,P1,IL,0,17) LHS»0 ' „ ' CALL BREAK(NI8LG,ECUAL,LHS,1,1,18) RHS»0 .». CALL BREAKtNI8LG,EQUAL,RHS,l,l,l9)

PAGE 392

3 80 s

PAGE 393

3 81 >».(«otRECIPtQ2>QlItPl Ql • • Q2 PI EQUAL LHS.NODEl RHS,NO0E2 RHSLtN0i;E3 RHSRfNOOE't 500 600 610 NRUL=5 LHS=0 ,. CALL BftEAK(NIBLG, EQUAL, LHStltl.35) P1=0 CALL BREAK(NIBLG,RHS,Pl.2,0,36) RHSL=0 CALL BREAKlNIBLG.RHSfRHSL, 1.0,37) OBTAIN A NEWCELL TO PUT RECIP OPERATOR INTO. • CALL NEWCEL(NSPUR,N0PR,37) N0PTV(3)=10 CALL TOCELL{NSPUR,NOPR,NOPTV,LOCN3,38) COUPLE »»,COMP AND C0MP,Q1 AND EQUAL, PI CALL CCUPLE(NIBLG,RHS,LHS, 0,0, 0,38) CALL COUPLE (NX BLG,RHS,UOPR, 0,0, 0,39) CALL COUPLE 1NIBLG,NOPR,RHSL,0,0,0,AO) CALL COUPLEINIBLGf EQUAL, PX, 2,0,0, 'D GO TO 50 • RULE S-6 =,Q1,«»,PI,Q2 BECOMES =,«/,AL0G»Q2,AL0G,Ql),Pl a EQUAL Ql LHS.NOOEl •• RHS,N00E2 PI RHSL,NO0E3,THEN PI Q2 RHSR,N00E4 NRUL=6 LHS=0 CALL BREAKCNIBLG,EQUAL,LHS,l,l,A2) Pl=0 CALL bREAK(N1BLG,RHS, Pi, 1,0,43) RHSR^O CALL BREAK(NIBLG,RHS,RHSR, 1,0,44) OBTAIN 2 NEWCELLS AND STORE ALOG OPERATORS IN BOTH. N0PTV(3)=8 00 610 1=1,2 NOPL=NOPR CALL NEWCEL(NSPUR,N0PR,45) CALL T0CELL(NSPUR,NaPR,NOPTV,LOCN3,45) CHANGE •• TO / CALL TOCELL(NSPUR,RHS,103,LOCNID,46) COUPLE N0PL,02 AND NOPK.Ol AND /,NOPR AND /.NOPL AND =,P1 CALL C0UPLE(NI3LG, NOPL, RHSR. 0,0, 0,47) CALL COUPLE«NIBLG,NOPR,LHS, 0,0, 0,43) CALL COUPLE I NIBLG,RHS,NQPR, 0,1, 0,49) CALL COUPLE (NIBLCRHS, NOPL, 0,0, 0,50) CALL C0UPLE(NIBLG, EQUAL, PI, 2t0, 0,51) CO TO 50 RULE S-7

PAGE 394

3 82 c

PAGE 395

3 83 Q L2 RHSRtNOOE^ 2100 IF(NOOE3<2).NE.2.0R.NODEAl2).Nt.2) GO TO 40 LEX=N0CE3(*».eQ.9 REX=»N0CE4( GO TO 2300 2110 L2PTR=RHSR IF(REX) GO TO 2120 ^ CALL J0KTCHlNI8LG,NSPURtRHSR,0fN00E4(3),LlSTl,Ll0Nl,L2,L2PTRf63) IFIL2.EQ.0i GO TO 2300 C SUCCESS. RULE U-1 APPLIES. 2120 NU=0 .... CALL BREAKJNIBLG.NU.LIPTR, 1.0.641 L3=0 CALL 6REAKCNIBLG.L2PTR.L3. 1.0.70) CALL C0UPLE(NI3LG.L2PTR.L1PTR, 1.1. 0.711 CALL CQUPLElNiaLG.LlPTR.L3. 2. 1.0,72) CALL T0CELHNSPUR.HPTR,102,L0CNI0.73) NRUL=101 GO TO 50 C C RULE U-2 (HAYBE) C •N.L01(N,ANY=tEXP,Pl).ANY=tEXP.P2)) BECOMES C .N-l,L01(N-1.0ELETE(EXP.Pl).OELETECEXP,P2),ADO(EXP(£XP.+2.Pl.P2)) C C C •N RHS,N00E2 EXP RHSL C EXP RHSR C C ICONTROL COMES FROM S-2.) 2200 1F(N0DE2(4).EQ.201) GO TO 2500 . ^ ,. ,, . CALL JOMTChInIBLG, NSPUR.RHS.il. N00E213),L1STI.L10NI.L. RHSL. 74 CALL J0MTCH«NiaLG.NSPUR.RHS,IL.N0OE2(3).LISTl,LIONl.IR.RHSR,75) IF(IR.EO.O) GO TO 2400 C SUCCESS. RULE U-2 APPLIES. RHSL=0 , . CALL BREAK(NlBLG.RhS.RHSL,l,0,76) P2='0 CALL 8aEAKlNIBLG,RhSR.P2.1.0.77) CALL COUPLEINIBLG, RHSR. RHSL. 1.1.0.78) CALL CCUPLE(NiaLG,RHSL.P2.2.1.0.79) CALL TOCELL(NSPUR,RHSL,201.LOCNID.80) NRUL=102 GO TO 50 C C RULE U-3 (HAYBE) C /,L11«».P1.RQ1'»N.L0HN,AMY=(«»,P1.RQ1)).L2(»».P2.RQ1' C .M.L02(H.ANY«I»».P2,RQ1)) BECOMES C L1(NULL«/»»N-1.L01(N-1,D6LETE<«».P1.RQ1)).L2(»«,-.P1.P2,QI« C •M,L02(H,DELETE(»«.P2,Q1),A0DI»».-,P1.P2,QI)) C

PAGE 396

384 c / RHs.Nooea C Ll RHSLtNODES C L2 RHSRfN0DE4 C C I ENTRY IS FROM RULE U-U) 2300 LEX=NaOE3(4).EQ. 104 REX=N0CeA(L1PTR.1.0.88) LQ1L=0 CALL BREAK I NIOLG, LIPTR, LQIL, 2, It 89) LP2=0 CALL BREAK(NIBLG,L2PTR,LP2, 1,1,90) CALL CCUPLE(NIBLG,L2PTR,L1PTR, 1,1,0,91) CALL C0UPLE(NIBLG,L1PTR,LP2, 2, 1,0,92) CALL TQCELLINSPUR, LIPTR, 102, LOCNID, 93) CALL J0RTRN(NIBLG,NSPUR,LQ1L,94) NRUL=103 GO TO 50 C C RULE U-4 (MAYBE) C C •N,L01(N,ANy=(»»,Pl,RQl),ANY=(»»,Pl,RQl)) BECOMES C •N-1,L01(N-1,DELETE<»»,P1,RQ1),0ELETE««»,P2,RQ1),A00I»», C 2,Pl.P2,Ql)) C • C » EQUAL C LHS, NODE! C ' RHS,N00E2 C •• WILL BE IN RHSL C •• WILL BE IN RHSR C Ql WILL BE IN LQIL C Ql WILL BE IN LQIR C C I CONTROL COMES FROM RULE U-2,)

PAGE 397

385 2400 CALL J0MTCH(Nl[JLG,NSPURtRHS,0,NOOE2t3»,LISTl,LION2tLl,RHSL,99» CALL JOMrCH(NIBLGtNSPURtRHS,LltNOOE2(3).LlSn,LI0N2,L2,RHSRtl00) IF CALL T0CELL{NSPURtRHSL,201,L0CNID,ll3) NRUL=104 GO TO 50 C C RULE U-5 (MAYBE) C C NtLCHN,ANY=RPl AND ANY=RPl) BECOMES C C N-ltLOUN-lfDELETE PlfOELETE PI, ADD •2.2.0>P1) C C *N RHS,N00E2 C PI RHSL(DIVtRG6R POSITION ILJ C PI RHSRtOIVERGER POSITION IR) C C (CONTROL COMES FROM RULE U-2.) 2500 Pl=»RHSL P2=RHSR CALL JOOROR(NIBLG,NSPUR,RHSL,114I CALL J0aRDRRHSL,RHSR,I16).NE.O) GO TO 2600 C SUCCESS. RULE U-5 APPLIES. RHSR=0 CALL BREAK(NIBL6,RKS,RHSR, IR, 0(117) RHSL=0 CALL BREAK(NI6LG,RHS.RHSL, IL, 0,1181 CALL J0RTRN(NIBLG,NSPUR,RHSR,119) C CREATE NEW OPERAND STRING WITH * AND 2.0 IN IT. CALL NEWCEL(NSPUR,RHSR,120) N0PTVI3)=202 CALL T0CELL(NSPUR,RHSR,N0PTV,L0CN3,121) CALL .NEWCEL(NSPUR,NCC,122> CALL ROPA(2.000,NCSTi3)) CALL T0CELL(NSPUR,NCC,NCST,L0CN4,123) CALL C0UPLE(NI8LG,NCC,NViKEN0, 1,1, 0,124) CALL COUPLE (NIBLG,RHSR,NCC, 1,1,0,125) CALL C0UPLE(NIBLG,RHS,RHSR,l,l,0,126) CALL COUPLE(NIBLG,RHSR,KHSL, 2, 1,0,127) NRUL=105 . GO TO 50 C C RULE U-6 (MAYBE) C

PAGE 398

386 C N,»N|.L01(N,ANY=«RP1),RP1 BECOMES C C N-l,»2,*2i«N-l,L0U«N-l,DECETE PDtl.O.Pl C C *H ftHStN00E2 C 'N RHSL* WILL BE IN N00E3 (OIVERGER POSITION C ID C PI RHSR (OIVERGER POSITION IR» C C (CONTROL COMES FROM U-5.) 2500 K«0 2610 CALL FRMCEL
PAGE 399

3 87 C C Ni«NtL01(N,ANY=RPl),»M,L02(M,ANY=RPl» BECOMES C C -fN-l.^Z.+af'N-l.LOKN-l, DELETE PI) , •M-1 ,L02 (M-1 , C DELETE PI), PI C C N RHS C 'N RHSR C "M RHSL C RPl OF «N P2 C RPl OF "M PI c , C tCONTROL COMES FROM U-7.) 2800 IF{P1.EC.RHSL.0R.P2.EQ.RHSR) GO TO 40 C COMPARE PI AND P2. IF(JOCPCO(NIBLG,NSPUR,P1,P2,X46).NE.O) GO TO *0 C OPERANDS ARE THE SAME. RULE U-8 APPLIES. CALL BREAKINIBLG, RHS, RHSR, NU,0,1'^7) CALL BREAK(NIBLG, RHS, RHSL, NU, 0,148) Pl=0 CALL BREAK(NIBLG,RHSL,Pl, ILl.0,149) P2=0 CALL BREAKtNIBLG, RHSR, P2,IL2, 0,150) CALL J0RTRN(NIBLG,NSPUR,P2, 160) C CONSTRUCT •, OPERAND, C • IS IN NCC, tlN NCI. 00 2810 1=1,2 CALL NEWCEL(NSPUR,NCC,161) N0PTV(3)=20O*I CALL T0CELL(NSPUR,NCC,N0PTV,L0CN3,162) IF(I.EC.l) NC1=NCC 2810 CONTINUE CALL CCUPLE(NIBLG,NCC,Pl,l,l,l,163) CALL COUPLE (NIBLG, NCC, NCI, 1,1, 0,164) CALL CCUPLE
PAGE 400

C -f<+N,»N,Pl),l+M,PlJ BECOMES C -»l»N»(»2»J-tl.0,»N-l),Pl),+M-l C C -ft+Nr«N,Pl)f«*H, •«,?!) BECOMES C -.(N-ll,(*M,»2tC-,»N-l, •«-!), PI) C C RHS,N0DE2 C LEFT OPERAND RHSLfN0DE3 C RIGHT OPERAND RHSR.NOOE* 2900 LHlfl)=RHSL LH2tl)=RHSR 00 2910 I=lf2 DO 2910 J=2t3 2910 LL(UJ)=0 00 2940 1=1 f 2 IFINOOE3(2).NE.2.0R.NODE3«4).NE.20l) GO TO 2920 CALL J0MTCH(NIBLG.NSPURtLL(I,l)tOt'NODE3(3)tLISTl.LION3tNUiLL(It2) I »167» IF(NU.EQ.O) GO TO 2920 CALL J0HTCH(NIBLG,NSPURtLL(I,2)t0tN00E3(3)fLIST,l,NU,LL(1.3),16a) 2920 DO 2930 J=lf4 2930 N0CE3{J)=N0DE4(J) 2940 CALL JOCRDR{NIBLG,NSPUR,LL< 1,1), 169) C COMPARE OPERANDS AT EACH LEVEL 00 2960 1=1,3 IF(LL(l,I).EQ.O) GO TO 40 DO 2950 J=l,3 IF(LL(2,J).EQ.O) GO TO 2960 IF(J0CPC0(NIBLG,NSPUR.LL(1.I),LL(2,J),170I.NE.0) GO TO 2950 IREH=I JREK=J GO TO 2970 2950 CONTINUE 2960 CONTINUE GO TO 40 C C SUCCESS, RULE U-8 APPLIES. 2970 I=IREM J=JREH NRUL=108 C DELETE PI ON LEFT HAND SIDE. NU=0 CALL BREAK {NIBLG,NU,LL( 1,1), 1,0, 171) CALL J0RTRNJNIBLG,NSPUR,LL(l,I),172) C BREAK INTO-Pl LINK ON RIGHT HAND SIDE. NU=0 CALL BREAK(NIBLG.NU,LL(2,J),I,0,173) IF«I.EQ.3.0R.J.EQ.3) GO TO 2990 C RETURN PI FROM RIGHT HAND SIDE. CALL J0RTRN{NI8LG,NSPUR,LL(2,J),174) IFJJ.EC.2) GO TO 50 IF(I.EQ.2) GO TO 2930 C CHANGE IN RHS TO O.O-NWKENO AND EXIT. CALL R0PA(0.0D0,NCST(3l) CALL T0CELL(NSPUR,RHS,NCST,L0CN4,175) CALL COUPLEINIBLG, RHS, NWKENO, 0,0, 0,176) GO TO 50 C CHANGE IN RHS TO COMP, THEN EXIT. 2980 CALL TOCELL (NSPUR, RHS, l.LOCNIO, 177) GO TO 50 C CREATE • WITH TWO OPERANDS OF AND PI, 2990 CALL NEHCEL (NSPUR, LASTR, 177 )

PAGE 401

389 NOPTV(3)=202 CALL TOCELLt NS PUR, LASTR,N0PTV|L0CN3, 178) CALL NEHCEL(NSPUR, MINUS, 179) N0PTVC3)=102 CALL TOCELUNSPUR, MINUS, N0PTV,L0CN3, 180) CALL C0UPLEtNIBLG,LASTR,LL«2,J),0,0,C,18l) CALL COUPLE (NiaLCLASTR, MINUS, 0,0, 0,182) IF(J.NE.3) GO TO 2992 C BREAK ,» LINK OF ORIGINAL RHS AND THEN COUPLE ,LASTR C AND Minus, •. NU=0 CALL BREAK(NIBLG,NU,LL(2, 2), 1,0,133) CALL CCUPLECNIBLG, MINUS, LH 2,2), 0, 0,0. 184) CALL COUPLE ( NIBLG, LL ( 2, D.LASTR, 0,0, 0,185) IF(I.NE.3) GO TO 2994 C BREAK ,» LINK OF ORIGINAL LHS. COUPLE MINUS,*. 2992 NU=0 CALL BREAK! NIBLG, NU,LL I 1,2), 1,0, 186) CALL COUPLE (NIBLG, MINUS, LL( I, 2), 0,0, 0,186} C IF APPROPRIATE, COUPLE TO LASTR. IFJJ.LT.3) CALL COUPLE ( NIBLG, LL ( 1 , 1 ) .LASTR ,0,0 ,0, 187) IF(I.EQ.J) GO TO 50 C CREATE A 1.0-NWKEND AND COUPLE TO MINUS, TOP POSITION. 2994 CALL NEWCELINSPUR, NONE, 188 ) CALL RDPAd. COO, NCST(3)) CALL TCCELLINSPUR, NONE, NCST,L0CN4, 189) CALL CCUPLECNIBLG, NONE, NWKEND, 0,0, 0,190) CALL COUPLE (NIBLG, MINUS, NONE, 0,0, 0,191) C IF J=l, CHANGE TO COHP IN RHS. IF(J.EQ.l) CALL T0CELL(NSPUR,RHS,1,L0CNID,192) GO TO 50 END

PAGE 402

3 90 SUBROUTINE JORULTi NIBLG.NSPURt lOOPR . IDCALL J CO^!M0N/ALL0C/jCC0RE(l» OIMENSICN NSPUR(l) DIMENSION N0DEI(6),N00E216),N0DE3{6) INTEGER RHS.RHSR DOUBLE PRECISION ZERO, ONE LOGICAL RHSC,LHSCfRHSZ,LHSZ,RHSO,UHSO C LOCAL VECTORS REQUIRED C LOCALL 5 ITEMSiVIF.TYPE FLAG,NOP,NID, VALUE. DIMENSION LOCALLdaj.LOCVIFCl.LOCNIOetJ.LOCVALC*) DATA LCCALL/4,9,l,2,5,l,I,7,l,i,8,l,0/ DATA LCCVIF/1,9,1,1/ DATA LOCNID/1,7,1,1/ DATA LOCVAL/l,a,l,0/ C CALL SYSENTd, 3,5, A2,IDCALL) I=JCC0RE<17)+1 L0CALL<13)=JCC0RE( I) L0CVAL(4)=LCCALL(i3) UHDCL='J NIBLG3=NIBLG+2 CALL ROPAtO.DO.ZERO) CALL R0PA(l.DO,ONE» 5 IFLAG=1 C CLEAR VIF'S CALL j6SVIF(NIBLG,NSPUR, ICNT,0,1) 10 IF(IFLAG.EQ.O) GO TO 7000 15 CALL J0RLSE(NIBLG,LHDCL,1) IFLAG=0 C OBTAIN FIRST NODE IN NETWORK LNK=IDOPR JCC0RE(NIBLG3)=JCC0RE(NIBLG3)+l GO TO 25 C NEXT ENTRY ON OPERAND TO BE CHECKED FOR SIMPLIFICATION. 20 LNK =NEXT(NIBLG, LNK, JCC0REINIBLG3) , 2,-l,LHDCL ,0,0,2) IF(LNK.EG.O) GO TO 10 C • DETERMINE CONTENTS OF NODE. 25 CALL FRMCELCNSPUR, LNK, NODEl, LOCALL, 3) C DETERMINE IF ANY SIMPLIFICATION RULES SHOULD BE APPLIED. C IF AN OPERAND OR CONSTANT, GO TO NEXT NODE. C IF VIF FLAG IS SET, GO TO NEXT NODE. (THE VIF FLAG IS C USED TO INDICATE WHICH NODES HAVE BEEN ALTERED DURING C THE LAST PASS THROUGH THE NETWORK) IF«NODEl(l).NE.0.OR.NODEl(2).LT.2) GO TU 6000 LNB=LNKBNT{NIBLG,LNK,NU,1,4) J»NODEl(4)/lOO*l IFtJ.GT.l.AND.NOOEl(3).E0.1) GO TO 500 GO TO(30,'»0,90),J C UNARY OPERATOR. OBTAIN OPERAND. 30 LHS=LNKFNT(NIBLG,LNK,NU,1,5) CALL FRMCEL(NSPUR,LHS,M0bE2, LOCALL, 6) C IS IT A CONSTAriT, APPLY RULE T-20 IF SO. 1F(N0DE2(2).EQ.0) GO TO 2000 C CHECK IF UNARY OPERATOR IS COMP FOLLOWED BY -. IF(N00Elt',).NE.1.0R.N0DE2(2».NE.2.0R.N00E2(*).NE.l02) GO TO 6000 GO TO laoo C BINARY OPERATOR. OBTAIN TWO OPERANDS. 40 tF(N00El(*).EQ.l01» GO TO 600.0 LHS=LNKFNT(NIBLG,LNK,NU,1,7) RHS=LNKFNT(NI8LG,LNK,NU,2,8) CALL FRMCEL(NSPUR,LHS,N0DE2, LOCALL, 9) CALL FRMCEHNSPUR,RHS,N00E3, LOCALL, 10)

PAGE 403

3 91 C SET INDICATORS AS TO WHETHER OPERANDS ARE C CONSTANTSt ZEROi OR ONE. LHSC=N0DE2J2).EQ.O . . . ^^ „ LHSZ=LHSC.ANO.MATHCP(303,iERO,NODE2(5),ll).EQ.O LHSC=LHSC.ANO.MATHCP(303,ONE,NOOE2(5),12).EO.O RHSC=NOOE3(2).EQ.O RHSZ=RHSC.AND.MATHCP(303,ZERO,NODE3(5),l3).EQ.O RHSC=RHSC.AND.MATHCP(303,0NE,N0DE3(5),14).EQ.0 J=NC0E1(A)-101 IF(LHSC.AND.RHSC) GO TO 1900 GO TO(50f70,80)tJ C BINARY OPERATOR IS 50 IF(LHSZ) GO TO 600 IFCRHSZ) GO TO 700 ^ ^ C NEITHER IS ZERO. IS EITHER OPERAND COMP 1F(N00E2I2).EQ.2.AND.N0DE2( AJ.EQ.l) GO TO 800 IF«NO0E3(2).EQ.2.AN0.NO0E3tA).£Q.l) GO TO 900 60 L'NCDE1K)*99 1F(NODE2(2).EQ.2.ANO.NOOE3(2).EQ.2.ANO.NODE2(4).EQ.L.ANO. 1 NO0E3(<>).EQ.L) GO TO 2100 IFINOD£3(2).EQ.2.ANO.NOD£3(A).EQ.NOOE1I4)) GO TO 2400 IF(NO0E2(2).EQ.2.AND.Na0E2»4).E«.NODEH4)) GO TO 2500 GO TO 6000 C BINARY OPERATOR IS / 70 IF(LHSO) GO TO 1200 IF(RHSO) GO TO 1300 IFIRHSZ) 60 TO 1400 IF(LHSZ) GO TO 1500 C IS EITHER OPERAND RECIP IFJN0DE3(2).EQ.2.AND.N00E3(4).EQ.10) GO TO 1600 IF«NODE2«2).EQ.2.AND.NODE2(4).e«.10) GO TO 1700 GO TO 60 C BINARY OPERATOR IS «• 80 IF(RHSZ.OR.RHSO) GO TO 1000 IF(LHSZ.OR.LHSO) GO TO llOO GO TO 6000 C MULTIOPERAND OPERATOR 90 N=NC0E1(3) K=N0DElU)-99 RHS^O C SEARCH OPERANDS FOR APPROPRIATE PATTERNS DO 130 I'l.liN 10X=I LHS=LNKFNT(NIBLG,LNK,NU.If 15) CALL FRMCEL(NSPUR,LHS,N00E2,L0CALL,16) LHSC=NaDE2t2).EQ.0 . .,. ^„ „ LHSZ=LHSC.ANO.HATHCPl303,ZER0,NOOE2(5),17).EQ.0 LHSO=LHSC.A.ND.MATHCP(303,ONE,NO0E2l 5), 18).EQ.O IF(N00e2(2).E0.2.AN0.rj0DE2(4).EQ.K) GO TO 2300 1F(N00E1(4) .EQ.201) GO TO 120 C OPERATOR IN LNK IS »N IF(LHSZ.OR.LHSO) GO TO 150 C IS LHS OPERAND HEADED BY RECIP 1F(N0DE2(2) .EQ.2.AND.NQDE2(4).EQ.10) GO TO 200 C IS OPERAND A CONSTANT 100 IF(.NCT.LHSC) GO TO 130 IF(RHS.NE.O) GO TO 2200 DO 110 J=lf 5 110 NOOE3(J)=NOOE2(J) RHS=LHS CO TO 130 C OPERATOR IS N

PAGE 404

3 92 120 IFCLHSZ) GO TO 300 IF(NOOE2(2).EQ.2.ANO.NO0E2(4).EQ.l) GO TO 400 GO TO 100 C END OF 00 LOOP TO LOOK AT OPERANDS 130 CONTINUE CO TO 6000 C c C RULE T-l C C •N,L01(N,ANY=Ll(0.0'1.0)) BECOMES C C L1(0.0*
PAGE 405

,3 93 CALL J0RTRN(NIBLG|NSPUR,LHS.30» GO TO 5000 RULE T-4 N,L01IN,ANY=C0KP,02) BECOMES -t02f*N-liL0l(N-l, DELETE C0HP,02) LNKtNOOEl LHS,N0DE2 LINK BACK FROM N N COHP LNB *00 K=102 GO TO 210 RULE T-5 C»l»»l»-l'/l'»»l)i01 BECOMES 01 OP LNK 01 WILL BE IN LHS 500 NU=1 LHS=0 BREAK LNB, LNK AND LNK, 01 LINKS 510 CALL BREAKINIBLG, LNB, LNK, LNBPOS, 0,31) CALL BREAK«NI8LG,LNK,LHS,NU,0,32J RETURN OPERATOR CALL RETURN(NSPUR,LNK,LNK,33» COUPLE LnBiOI CALL COUPLE (NIBLG, LNB, LHS, LNBPOS, 0,0. 34) LNK=LHS GO TO 4990 RULE T-6 -,0.0,01 BECOMES 01 LNK.NOOEl 0.0 LHS,N00E2 01 RHS,N0DE3 600 CALL BREAK(NIBLG,LNB, LNK, LNBPOS, 0,35) NU=0 CALL BREAK(NI8LG,LNK,NU,2,0,36) CALL J0RTRN(NIBLG,NSPUR,LNK,37) CALL COUPLE I NIBLG, LNB, RHS, LNBPOS, 0,0, 38) LNK=RHS GO TO 4990 RULE T-7 -,01,0,0 BECOMES C0MP,01 700 K=l 01 0.0 LNK, NODE 1 LHS,N00E2 RHS,N0DE3

PAGE 406

3 94 710 m=o CALL BREAK«NIBLG,LNK,NU,2,0i39) C CHANGE TO COHP CALL TOCELL C NS PURf LNK i K , LOOM IDt 40) CALL JORTRN(NlBLG,NSPUR,RHSt'»l) GO TO 5000 C C RULE T-8 C C -,C0MP,0li02 BECOMES C C 2,01,02 C C LNK C COMP UHS C 02 RHS C 01 HILL BE IN LHSl 800 K=201 810 LHSl=LNKFNT(NIBLG,LHS,NU,l,A2) CALL BREAKINIBLG, LNK, LHS.NU, 1,43) CALL BREAKINIBLG.LHS, LHSl, NU, 0,44) CALL CCUPLEINIBLG.LNK.LHSI, I, 1,0,45) C CHANGE TO CALL T0CELHNSPUR,LNK,K,L0CNI0,46) CALL RETURN(NSPUR,LHS,LHS,47) GO TO 5000 C C RULE T-9 C . ,C -, 01, COMP, 02 BECOMES C C COMP, +2, 01, 02 C LNK C 01 , LHS C COMP RHS 900 K=201 910 CALL BREAKINIBLG, LNK, LHS, NU, 0,48) CALL T0CELL(NSPUR,LNK,N0DE3«4),L0CNID,49) CALL T0CELL(NSPUR,RHS,K,L0CNID,50) CALL C0UPLE(NIBLG, RHS, LHS, 1,1,0,51) GO TO 5000 C C RULE T-10 C C ••,01,LUO.O«1.0) BECOMES C C LKO.O'l.O) C •• LNK C 01 LHS C tO.0'1.0) . RHS 1000 GO TO 600 c C RULE T-ll . C . C ••.LKO.O'l.O), 01 BECOMES C C Llll.0'01) c C • • LNK C (O.O'l.O) LHS

PAGE 407

3 95 1100 1110 1120 01 RHS CALL BREAK»0.0,01 I 0.0 01 LNK LHS RHS BECOMES LNK LHS RHS BECOMES LNK LHS RHS BECOMES < ERASE ENTIRE OLD EQUATION) LNK LHS RHS 1500 CALL BREAK(NIBLG,LNB, LNK, NU, 0,58) CALL TOCELL(NSPUR.LNK,101,LOCNIO,59) CALL J0RTRN(NIBLG,NSPUR,JCC0REtNIBLG),60)

PAGE 408

3 96

PAGE 409

3 97 C C OP LNK.NODEl C CI LHS.N00E2 2000 CALL MATH(NODEl{4),N00E2(5).NU,NODE2(5),65) CALL TOCELH NSPUR, LHS , N00E2 ( 5 ) , LOCVAL , 66) GO TO 510 C C RULE T-21 C C Ll(/«-),Llf •N«+N),L01CN,ANY=R0l),Ll(»H«+HI, C L02«HrANY=R0n BECOMES C C Ll(»N-l«*N-l),L01(N-l, DELETE 01 ) ,L1( •«-! •+«-!) tL02IH-l, C DELETE OH C C (/'-) LNK.NODEl C <»N«+N) LHS.N0DE2 C (•M»*H) RHS.N0DE3 C C J=l FOR AND 2 FOR /. C CHECK IF AN OPtRAND IN THE LHS IS THE SAME AS AN OPERAND C ON THE RHS. FIRST PUT BOTH OPERANDS INTO FUNDAMENTAL C FORM. 2100 CALL JOORDR(NIBLG, NSPUR, LHS. 67» CALL J00R0R(NI6LG, NSPUR. RHS. 681 C SEARCH BOTH OPERAND LISTS TO FIND EQUIVALENT OPERANDS. Nl»l MI = 1 LNl=LNKFNT
PAGE 410

.398 2300 RULE T-23 LH»N»*N)»L0HN,ANY=(Ll(/«-).01),02) BECOMES LI (/•-), 01, LI ( N ' +N I.LOICN.DELETECH (/•-), 01, 02 ),A00 02) (•N'>N) LNK.NODEl (/•-) LHS,N00E2 02 MILL BE IN RHS LHS=0 CALL BREAKtNIBLG,LNK,LHS,IDX,79) CALL BREAK(NIBLG,LNB,LNK,LMBP0S,80) RHS=0 CALL BREAKJNIBLG,LHS,RHS,2,81) CALL C0UPLE(HIBLG,LNB,LHS,LNBP0S,l,0,a2) CALL COUPLE(NIBLG,LHS,LNK, 2, 1,0,83) CALL CCUPLE(NIBLG,LNK, RHS, IDX, 0,84) LNK=LHS GO TO 4990 RULE T-24 Ll(/«-),01,Ll(/«-),02,03 BECOMES H(/'-),H(»«*),0l,02,03
PAGE 411

3 99 C INCREMENT KEY 5000 JCCORE(NI8LG3>=JCCCRE(NIBLG3)*l C CLEAR FLAGS OF EARLIER OPERATORS TO INDICATE OPERAND C HAS BEEN ALTERED AND HAY REQUIRE FURTHER SIMPLIFICATION C AT A LATER PASS. CALL T0CELL(NSPURtLNK,0tL0CVIF,95) NLEV=0 5020 CALL T0CELL(NSPURfLNB,0tLOCVlF,96) IF(NLEV.GE.l) GO TO 5030 NLEV=NLEV+l LNB=LNKBNT(NIBLG»LNBfNU.l»97) IF(LNB.GT.O) GO TO 5020 5030 CONTINUE IF(IFLAG.EQ.2) GO TO 15 IFLAG=l GO TO 20 C SET VIF TO INDICATE OPERAND LNK UNCHANGED THIS PASS. 6000 CALL TOCELLINSPUR,LNK,1,LOCVIF, 98) GO TO 20 C 7000 CALL SYSEXT RETURN END

PAGE 412

400 SUBROUTINE SOLVE( PSPUft . IPSt NIBLGt lOCALLI CO^•^'ON/ALLOC/JCCORE(l» DATA INIT/0/ INTEGER PSPUR DIMENSION ISPUR(5) DATA lSPUR/0,0iltl3,6/ C CALL SYSENT(l,3,5,5l,I0CALL) _ ,, ,, C OBTAIN CORE FOR THE NETWORK INFORMATION BLOCK IF IT IS C NOT ALREADY SET UP. IFIINIT.NE.O) GO TO 30 INIT=.l N=«JCC0RE(17)*19 L£N=JCCOREIN)*'» IF(JCC0RE
PAGE 413

401 C c»»»*>»»«*»**>«««««*»»«»«*>*>*»*« • »..•••• c •• • C • REMOTE • C • GENERAL • C INFORMATION • C •«.»•.•»•..»••• c C SPECIAL INSTRUCTIONS/LIST TYPE C ALL LIST TYPES EMPLOYED WITH REMOTE MUST BE FORWAROC BACKWARD. C C SPECIAL INSTRUCTIONS/LEND C THE FIRST DATA TYPE MUST HAVE A LEND OF (1,0,1,0). THE C SECOND DATA TYPE MUST HAVE A LEND OF (2,0,1,0). THE THIRD C AND FOURTH DATA TYPES INDICATE THE NUMBER OF FILE ENTRIES C AND THE NUMBER OF WORDS PER FILE ENTRY RESPECTIVELY. THE C LEND FOR THE THIRD DATA TYPE MUST HAVE 1 AS THE SMALLER C WORD INDEX. THE FOURTH DATA TYPE MUST HAVE AS THE LARGER C WORD INDEX OF ITS LEND THE NUMBER OF WORDS IN THE PRE-FILE C PARAMETER SET. C C SPECIAL INSTRUCTIONS/DEBUG C THE FOLLOWING INDICATES THE ORDER FOR OPERATIONAL CHECKS C OF THE REMOTE SYSTEM. THE PROGRAMS OF LEVEL THREE, FOR C INSTANCE, CALL ONLY SUBPROGRAMS FROM LEVELS ONE AND TWO. C SIMILARLY FOR ALL OTHER LEVELS. C SUBPROGRAM LEVEL PROGRAM ID. NUMBER C SUPPLY C C«TUP I 10 C C4ADR1 2 6 C C4ADR3 3 8 C C4NEXT 3 9 C C4A0R2 4 7 C CAAORS 5 5 C CATRAN 6 11 C FETCH 7 1 C FIND 7 2 C STORE 7 3 C C SPECIAL INSTRUCTIONS/COAST C REMOTE MUST BE SUPPORTED BY THE COAST SYSTEM, AS REMOTE IS C ESSENTIALLY A LIST STRUCTURE COMPOSED OF LIST ENTRIES WHICH C ARE EQUAL TO OR LARGER THAN A CORE SEGMENT. THE CATALOGUE C AND REGISTER SEGMENTS ARE EQUAL IN SIZE TO A CORE SEGMENT. C THE SIZE OF THE RECORD SEGMENTS IS SPECIFIED BY JCSPUR(4). C THE LIST TYPE INDICATED BY JCSPUR(5) MUST BE FORWAROC BACKWARD. C C SPECIAL INSTRUCTIONS/OFF-LINE STORAGE C . ONLY RECORD SEGMENTS MAY RESIDE ON OFF-LINE STORAGE. THE C RECORD SEGMENT ADDRESS CONTAINED IN THE REGISTER WILL BE C NEGATIVE FOR AbL RECORD SEGMENTS ON OFF-LINE STORAGE. THE C ABSOLUTE VALUE OF THESE NEGATIVE INTEGERS MAY BE UTILIZED C AS AN AIDE TO INFORMATION RETRIEVAL. FOR THE PROGRAM C SUPPLY, A PROGRAM MUST BE SUBSTITUTED TO PERFORM THE C RETRIEVAL OPERATION IF OFF-LINE STORAGE IS TO BE EMPLOYED. C SUPPLY IS THE ONLY MACHINE DEPENDENT ROUTINE WITHIN REMOTE. C JCSPUR(4) SHOULD BE SET EQUAL TO THE RECORD LENGTH IN WORDS C FOR THE OFF-LINE STORAGE DEVICE UTILIZED. THE CORE SEGMENT C SIZE AND JCSPUR(A) NEED NOT BE EQUAL, BUT JCSPUR(A) MUST C NOT BE LARGER THAN THE LARGEST ALLOWED CORE BUDDY.

PAGE 414

402 C C CURRENT STATUS C OPERATIONAL C C •»•••».••. 4 c

PAGE 415

403 C „ €• • »«»»»»»««o. • »«.•»•.•.•.•••••••»•• C ••»•••»••• C • C4ACRS • C •*••«.»••• c C PURPOSE C C4ADRS COMPUTES THE ABSOLUTE ADDRESS OF A FILE ENTRY C SPECIFIED BY A LISTER VECTOR. C4ADRS ALSO COMPUTES THE C MODEL AND LOESS VECTORS. C CALL C4A0RS(JCSPUR, LISTER, LOCAL, LOESS, MODEL, IODINE, JCFINE, C JCLOAD,JCSORF,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS ^ C JCSPUR = A VECTOR CONTAINING THE POINTER TO THE USER.S CORE C ASSIGNMENT MASK, THE POINTER TO THE USER'S C AVAILABLE SPACE LIST HEAOCELL, THE NUMBER OF r SEGMENTS REQUESTED, THE NUMBER OF WORDS PER C SEGMENT, AND LASTLY THE INDEX SPECIFYING THE LIST C TYPE. THE JCSPUR VECTOR MUST CONTAIN THESE FIVE C ENTRIES IN THE INDICATED ORDER. C LISTER = AN N DIMENSIONAL VECTOR SUCH THAT, LlSTER{l)=N, C LISTER! 2J IS THE RECORD NUMBER. THE NEXT N-3 r WORDS OF LISTER CONTAIN THE INTEGERS FOR DIRECTORY C SELECTION. LISTER(N) IS THE FILE ENTRY NUMBER. C IF LISTER(N)=0, THE ADDRESS COMPUTED WILL BE THAT r OF THE FIRST FILE WORD OF THE FILE SELECTED BY r LISTER{N-l). NO OTHER LISTER WORDS MAY BE ZERO. r IF LISTER! l)=l, LISTER(2) CONTAINS THE NUMBER OF C FILE ENTRIES FROM THE CURRENT ONE TO ADVANCE. THE C DIRECTION OF MOVEMENT IS INDICATED BY THE SIGN OF Q . LISTER12), FOR FORWARD ANDFOR BACKWARD, C LOCAL » A USER SUPPLIED VECTOR INDICATING THE DATA TYPES C FOR TRANSFER. THE FIRST WORD INDICATES THE NUMBER r OF DIFFERENT DATA TYPES, AND IS FOLLOWED BY THAT C NUMBER OF SETS OF THREE WORDS EACH. THE FIRST OF r A THREE WORD SET IS THE DATA TYPE NUMBER FOR THIS f LIST TYPE, WHILE THE REMAINING TWO WORDS ARE r INDICES INDICATING THE FIRST AND LAST OCCURRENCE C OF THE DATA TYPE FOR TRANSFER. IF THE THIRD WORD r OF THE SET IS ZERO, THE LAST ITEM TRANSFERRED WILL r BE THE LAST ITEM INDICATED IN THE LEND COMPONENT r (DATA LOCATION ARRAY) FOR THE CURRENT DATA TYPE. f IF LOCAL! 1)=-1 NO DATA TRANSFER OCCURS, AND IF C LOCALIl)=0 ALL DATA IN THE FILE ENTRY IS C TRANSFERRED. C LOESS » A FOUR WORD VECTOR PATTERNED AFTER LOCAL. LOESS C CONTAINS THE INFORMATION SPECIFYING THE DATA ITEM r FOR TRANSFER IN SUCCEEDING FILE ENTRY PARTITIONS. C MODEL » A FOUR WORD VECTOR PATTERNED AFTER LOCAL. MODEL C APPLIES TO THE DATA ITEM FOR TRANSFER IN THE C CURRENT FILE ENTRY PARTITION. C IODINE » A PARAMETER INDICATING THE THREE WORD SET IN LOCAL r FROM WHICH LOESS AND MODEL ARE TO BE FORMED. C JCFINE = A VECTOR CONTAINING (L 1 STER ( l)-l » COMPONENTS. THE C FIRST (LISTER! 1J-3S WORDS CONTAIN THE NUMBER OF C FILE ENTRIES IN THE RESPECTIVE !LI STERd )-3)

PAGE 416

404 C c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c DIRECTORIES. TH6 LAST TWO WORDS OF JCFINE CONTAIN RESPECTIVELY THE NUMBER OF FILE ENTRIES AND THE NUMBER OF WORDS PER FILE ENTRY OF THE FILE ULTIMATELY SELECTED BY LISTER. THIS IS A USER PROVIDED VECTOR, WHICH NEED CONTAIN MEANINGFUL INFORMATION ONLY FOR THOSE DIRECTORIES AND FILES WHICH HAVE NOT BEEN PREVIOUSLY ESTABLISHED. JCLOAD = A THIRTY WORD VECTOR. THE WORDS OF JCLOAO HAVE THE FOLLOWING USAGE. 1 = ADDRESS OF CATALOGUE OR REGISTER SEGMENT WORD 2 = ADDRESS OF CATALOGUE OR REGISTER SEGMENT 3 = SEQUENCE NUMBER OF CATALOGUE OR REGISTER SEGMENT 4 = ENTRY NUMBER IN CATALOGUE OR REGISTER SEGMENT 5 = ADDRESS OF RECORD SEGMENT WORD 6 = ADDRESS OF RECORD SEGMENT 7 = WORD NUMBER IN RECORD SEGMENT 8 = FILE ENTRY NUMBER 9 = NUMBER OF FILE ENTRIES IN FILE 10 = NUMBER OF WORDS PER FILE ENTRY 11 = ADDRESS OF FIRST WORD OF FILE 12 = NUMBER OF FILE ENTRIES OR SEGMENTS TO ADVANCE 13 = VARIOUS 14 » FOR DATA TRANSFER INTO A FILE ENTRYt AND FOR DATA TRANSFER FROM A FILE ENTRY 15 = MODE INDICATOR 16 = FIRST WORD OF LOCAL FOR NUMBER OF FILE ENTRIES 20 = BASE ERROR CODE 21 = RELATIVE ADDRESS OF FIRST EMPTY WORD IN RECORD 22 = NUMBER OF WORDS IN PRE-FILE PARAMETER SET 23 = FIRST WORD OF LOCAL FOR NUMBER OF WORDS PER FILE ENTRY 27 = RELATIVE ADDRESS OF CURRENT FILE ENTRY 28 ADDRESS OF FIRST RECORD WORD 29 = FOR FILE ENTRY BOUNDARY ENFORCEMENT, AND -1 FOR ALLOWED BOUNDARY VIOLATION 30 = ADDRESS OF POINTER TO FIRST CATALOGUE SEGMENT JCSORF = SEE FETCH JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER REMARKS THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE COMMON STATEMENT FOR SOME MACHINES. IF JCLOAD HAS NOT BEEN INITIALIZED, JCLOADdS) MUST BE SET TO -I BY THE USER PRIOR TO CALL FOR ANY REMOTE SUBROUTINE. JCL0AD129) MUST NOT EQUAL -I UNLESS VIOLATION OF FILE ENTRY BOUNDARIES IS TO BE PERMITTED. THE FIRST RECORD WORD CONTAINS THE RELATIVE ADDRESS OF THE FIRST EMPTY RECORD WORD. THIS ROUTINE IS NOT INTENDED FOR DIRECT USER CALL. SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C4ADR1 C'VADR2 CfADRS SYSENT . SYSERR SYSEXT TOCELL

PAGE 417

405 C ERROR COOES FOR THIS PROGRAM C CODE FATAL ERROR(DATA PROVIDED) C I F ILLEGAL LISTER VECTOR (JCL0AD(5)) C 2 F ILLEGAL LOCAL VECTOR UCLOAD(ll)) C 3 F EXCEEDED BOUNDS OF FILE ENTRY (JCLOAOtSJ) C 4 F ZERO DIRECTORY ENTRY tJCLOAO(llJ) C C f'ETHOD C CiADRS USES LISTER TO COMPUTE THE ABSOLUTE ADDRESS OF THE C SELECTED FILE ENTRY. JCL0A0(5) IS THIS ADDRESS. C c c SUBROUTINE C4A0RSJ JCSPUR.L ISTER, LOCAL, LOESS, MODEL, lODI NE .JCFINE, 1 JCLOAC.JCSORF.JCCLNO) COMKON/ALLOC/JCCOREC 1> DIMENSION JCSPUR(1),LISTER(1), LOCAL! DfLOESSd), MODEL! 1), 1 JCFINea),JCLOAD(l) ENTER CALL SYSENT(l,2,l,5,JCCLNO) SELECTING PROPER MODE IF(LISTER(1).GT.1)G0 TO 1 IFILISTERIU.LE.OCALL SYSERRC -1, JCLOADl 5) ) ADVANCING FROM CURRENT FILE ENTRY MODEL«l)=-l LOESS«l)=-l JCL0AD(12)=LISTER(2) JCLCAD(I5)=4 CALL C4A0R2< JCS PUR, JCL0AD,JCS0RF,1) IF(JCSORF.EQ.-UGO TO 104 Ml=JCLOA0(28) JCCCRE(KU = JCLOADJ 21) GO TO 9 FURTHER MODE SELECTION 1 IF(JCL0AD(l5).GT.0)GO TO 3 INITIALIZATION OF JCLOAD 00 2 1=1,13 JCLOAD(I)»0 JC0UM1=I+14 2 JCL0ACIJC0UM1)=0 Ml=JCSPUR(5)*20 JCLCAD122)=JCC0RE(M1)*13 Ml=JCLCAC(22) JCCUMI=JCC0RE(M1) JCLOAD ( 22 )=JCC0RE(M1*1) JC0UM1 = JCL0AD(22)-JCDUHI«-1 JCLCA0(16)»l JCLCAC(17)=3 JCLCAD(18)=1 JCL0ADI19)=l JCLOAOI21)=2 JCLCAD(23)*1 JCLOAD t 24 )=4 JCL0AD«25)=JCDUM1 JCLCAD(26)=JCDUMr JCLOAD 1 28 )=0 ACCESSING CATALOGUE SEGMENT POINTER TO REGISTER 3 JCL0AD(1)=JCL0AD(30) JCLCA0(4)=LISTER(2) JCL0A0(12)=0 JCL0AD(15)=1 CALL CAADRKJCSPUR, JCLOAD, JCSORF, I)

PAGE 418

.406 1F(JCS0RF.EQ.-1)G0 TO 104 IF(LISTER(1).LE.2)G0 TO 104 PREPARING TO STEP THROUGH DIRECTORIES JC0UM2=3 JC0UM3=O JCLCA0tl5)=il JCL0AD<27J=2 JCDUMl=LISTER(l)-2 WORKING THROUGH DIRECTORIES DO 8 I = 1,.JCCUH1 IF(JCS0RF.EQ.-11G0 TO 8 IF(JCDUK2.NE.2»GO TO 4 ADD NEW FILE TO END OF RECORD M1=JCL0AD(5» JCC0RE{M1)=JCL0AD<21) JCLCAD(27)=JCL0A0(2l) SAVING ADDRESS OF POINTER 4 JCOUM3=JCLOAD15) COMPUTING ABSOLUTE ADDRESS OF SELECTED FILE 5 CALL C4A0R3IJCSPURf JCL0AD,JCS0RF,1» IFUCSORF.EQ.-DGO TO 8 IF(JCDUM2.Nc.2)G0 TO 6 JCDUM4=JCSPUR(4)-JCL0A0(7)*l IF(JCDUM4.GE.JCL0AC{22) )G0 TO 6 INSUFFICIENT SPACE FOR PRE-FILE PARAMETER SET JCLOAD(27)=JCLOA0(27)+JC0UM4 JCC0RE(JCDUM3)=JCL0AD(27) JC0UM2=l JCL0AD115)=2 GO TO 5 PREPARING TO COMPUTE ADDRESS OF FILE ENTRY 6 JCLCA0{ll)=JCL0AD(5) IFJI.GT.DGO TO 13 JCLCAD(28)=JCLOAD{ ll)-l M1=JCL0ADI28) JCLCAD(21)=JCC0RE(M1» IF(JCLCADt21).LE.l)JCL0AD{2l)=2 IF(JCL0AD(2l).EQ.2)JC0UM2='l 13 JCLOAO(a)=0 JCLCAD(15)=3 IF(JC0UM2.EQ.3)G0 TO 7 INITIALIZING PRE-FILE PARAMETER SET CALL TOCELLCJCSPUR.JCLOAOi ll)tJCFINEn)tJCL0AD(16),l) JCL0AD(9)=JCFINE(I) JCLCAD(lO)=l IF(I.EC.JCOUMl)JCLOA0( 10)='JCFINE( I + 1 » CALL T0CELL( JCSPURiJCLOAD( U),JCLOAD(lO)tJCLOAD(23) i2» JCLOAD(21)=JCLOAD(27)<-JCLOAO«22)+JCLOA019)»JCLOAO(10) JCL0A0(15)=4 COMPUTING ABSOLUTE ADDRESS OF FILE ENTRY 7 IF(ILISTER(I+2).LT.0).0R.I ( LISTER( 1+2) .EQ.O) .AND. ( JCDUMl.GT.I ) ) > 1 CALL SYSERRt-2,JCL0A0(ll)) JCLCA0(12) = LIST£R{ 1*2). CALL C4ACR2(JCSPURf JCL0A0,JCS0RF,2) IF((I.EQ.JC0UMI).OR.(JCS0RF.EQ.-l) )G0 TO 8 RETRIEVING RELATIVE ADDRESS FROM DIRECTORY Hl^JCLOAOLS) JCL0A0C27l=JCC0RE(Hl) JC0UM2=3 IF(JCL0AD<27).6T.0)GO TO 71 JC0UH2=2 IF(JCLOA0(14).GT.O»GO TO 71

PAGE 419

407 JCSCRF=-JCSORF IF(JCSORF.EQ.O)CALL SySERR«-4t JCLOAD( IIJ) 71 JCL0ADH5) = 2 8 CONTINUE IF(JCSORF.EQ.-l)GO TO lOA M1=JCL0AD128) JCCaRE(Hll=JCL0A0(21J IF(LISTER(JCDUM1+2).LE.0)G0 TO 104 PREPARING LOESS AND MODEL 9 MO0EL(l)=-l LOESSG0 TO 104 MO0EL(l)=5l JCDUM1=3»(100INE-1)»2 Ml=JCSFUR(5)+20 JCL0A0(13)=JCC0RE(Ml)t4»(LCCAL(JCDUMl)-l)*l t«0DELC2) = L0CAL( JCDUMll M00EL(3»=L0CAL(JC0UMl+l) M1=JCL0A0(13) JC0UM2=JCSPUR(4)-JCL0AD(7)-JCC0RE(Hl)-M0DEL{3»*3 M00EL«41=L0CAL(JC0UMl+2) IF(MODEL«4I.GT.O)G0 TO 10 M00EL(4)-JCC0RE(Mltl) IF(M0DEL«4).EQ.0)H0CEL(4)=JCL0A0ll0) M00EL(4) = MQDEL(4>-JCC0RE(Ml)*-l 10 JCOUM3=JCLOAO{lO)-JCCORE(Ml)-MODEL(A)*l IF((JC0UK3.LT.0).AN0.1JCL0A0129).NE.-H)CALL SYSERR<-3 , JCLOADISI) JC0UM3=MCDEL(4)-M0CEL{3)+1 IF( JCOUM2.GE.JCOUH3)GO TO 104 PARTITIONED FILE ENTRY . IF(JC0UM2.GT.O)60 TO 11 MODEL(l)=»-l L0ESS(3)=il-JC0UH2 GO TO 12 11 L0ESS(3)=1 12 LOESSll)=l LOcS5t2)=MOCEL(2) L0ESS(4>=K0DEL(4)-JCDUM2-H00EL(3»*1 MO0EL(4)=MODEL(3)*JC0UM2-l EXIT 104 CALL SYSEXT RETURN END

PAGE 420

408 C C»»*****> •...••. o.»..« •• •••••••••• c ••••..»..• C • C4ACRI • c c C PURPOSE C C4A0R1 PROVIDES THE CALLING PROGRAM WITH THE ABSOLUTE C ADDRESS OF A POINTER WITHIN A CATALOGUE OR REGISTER C C USAGE C CALL C4ACRl{JCSPURijCL0ADf JCSORF,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPUR = A VECTOR DESCRIBED IN THE CtADRS DOCUMENTATION C JCLOAD A VECTOR DESCRIBED IN THE C4ADRS DOCUMENTATION C JCSORF = SEE FETCH C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT FOR SOME MACHINES. C THIS ROUTINE IS NOT INTENDED FOR DIRECT USER CALL. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C CfSTUP C SYSENT C SYSERR C SYSEXT C C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERROR(DATA PROVIDED) C IF BACKWARD LINK FROM POINTER tJCLOADd)) C . 2 F BACKWARD LINK BEYOND FIRST SEGMENT (JCL0AD(2)I C 3 F SEGMENT CONTAINING POINTER TO DESIRED C INFORMATION NOT IN CORE (ADDRESS OF LAST C POINTER) C 4 F NO LINK FROM POINTER (JCLOADd)) C 5 F BACKWARD LINK TO DESIRED SEGMENT CANNOT BE C ACCOMPLISHED (ADDRESS OF LAST POINTER) C C METHOD C TWO MODES OF OPERATION ARE ALLOWED, JCL0AD(15)=1 AND C JCLOAD(I5) = 2. THE FORMER REQUIRES COMPONENTS l.^VaZilA AND C 15. FROM JCLOA0(4) AND JCL0A0(12), THE NUMBER OF SEGMENTS C TO ADVANCE AND THE CORRECT ENTRY NUMBER WITHIN THAT SEGMENT C ARE COMPUTED. JCLOAO COMPONENTS 1,2,3,^ AND 12 CARlRY THE C RESULT OF THE ADDRESS CALCULATION. WHEN JCLOAO ( 15) =2 , THE C ADDRESS CALCULATION BEGINS WITH THE REGISTER (OR CATALOGUE) C SEGMENT SPECIFIED BY JCL0A0(2) AND JCL0A0I3). C c •••• • c . SUBROUTINE CAADRK JCSPUR, JCLOAO, JCSORF, JCCLNO) COMMON/ALLOC/JCCOREd) DIMENSION JCSPUR(l),JCLOAD(lf C ENTER CALL SYSENT(l,2,l,6,JCCLN0) C COMPUTING NUMBER OF SEGMENTS TO ADVANCE

PAGE 421

409 JCDUM6=JCSPUR(4) JCSPUR(4)=JCC0RE(3I JCOUHl = (JCLOAOU)-l)/(JCCORE«3»-2) JCDUM2=JCDUM1+JCL0AD< 12)*2-JCLOAO( 15» JCDUM3=IABS(JC0UM2> IF(JCDUH3.NE.0»G0 TO 1 IF(JCLOAO{15).NE.1JGO TO 5 JCSCRF=-JCSORF IF(JCSORF.SQ.-l)GO TO 6 CALL SYSERR«-^.JCLOAD(l)) GO TO 5 JC0UM2=(JCDUM3-JC0UH2)/{2»JCDUM3) IF(JC0UK2.EG.OIGO TO 2 IF(JCL0A0(15).EQ.1)CALL SYSERR «-l, JCLOAOC 1 ) ) IFJ JC0UM3.GE.JCLOA0(3) )CALL SYS£RR(-2, JCL0AD(2) ) JCLCAC{12)=JCDUM3 JC0UM5=JCL0A0{1) IF(JCL0A0(l5).EQ.2)JCDUM5=JCLOAD(2) ACCESSING PROPER SEGMENT DO U I=ltJCCUH3 IFIJCSORF.EQ.-DGO TO A jCL0A0(2)=JCC0RElJCDUM5tJCDUM2) IF(JCL0A0(2).GT,0)G0 TO 3 JCSCRF=-JCSORF IF(JCSORF.EQ.-1)GO TO 6 IF(JCLCA0(14).LT.0ICALL SYSERR«-3i JC0UM5) IF(JCDUH2.EQ.1)CALL SYSERR(-5, JC0UM5) JCL0A0(2»=JCCUM5 CALL C4STUP(JCSPURf JCLOAD.l) JCLCA0(2)=JCC0RE(JCDUM5+JCCUM2) JCLOADl3)=JCL0ADi3)»(JCL0ADll5)-l)+l-2*JCDUM2 JCOUM5=JCLOAD(2) JCL0AD(12)=JC0UH3-I JCL0AD(15)=2 IF(JCS0RF.EQ.-1)G0 TO 6 COMPUTING THE ENTRY NUMBER JCLOA0(Al=JCLOAD(4)-JCDUMl«(JCCORE(3)-2) JCLCA0(1»=JCL0AD(2)+JCL0AD(A) IF ( JCL0AD(4 ) .GT.O ) JCLOAO( 1 ) =JCLOAD( 1 )4^1 EXIT JCSPURIA>=JC0UH6 CALL SYSEXT RETURN CNO

PAGE 422

410 C ........ C • • • •• »••••.»•»• ..••••••••»•.. c •• C • C4ACR2 » c •• •• c C PURPOSE C C4A0R2 PROVIDES THE CALLING PROGRAM WITH THE ABSOLUTE C ADDRESS OF A FILE ENTRY. C C USAGE . C CALL C4A0R2(JCSPURtJCLOAO,JCSORF,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPUR = A VECTOR DESCRIBED IN THE C4A0RS DOCUMENTATION C JCLOAD = A VECTOR DESCRIBED IN THE C4A0RS DOCUMENTATION C JCSORF = SEE FETCH C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT FOR SOME MACHINES. C THIS ROUTINE IS NOT INTENDED FOR DIRECT USER CALL. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C C4ADR3 C FRMCEL C SYSENT C SYSERR C SYSEXT C TOCELL C C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERROR«OATA PROVIDED) r IF IMPROPER MODE (JCLOAD(ll)) C 2 T NEGATIVE FILE ENTRY NUMBER JJCL0AD(11)» C 3 F DESIRED FILE ENTRY BEYOND LIMITS OF FILE C (JCLOADdD) ,; 4 F FILE ENTRY CANNOT BE ADDED TO FILE (JCLOAOllD) C C TWO MODES OF OPERATION ARE ALLOWEDi JCLOA0(15)=3 AND C JCL0A0(15»=4. JCLOAD COMPONENTS 1-7,11-I2t AND 14-27 ARE C REQUIRED FOR MODE 3. JCLOAD COMPONENTS 9 AND 10 ARE C RETRIVED FROM THE PRE-FILE PARAMETER SET. THE ABSOLUTE C ADDRESS OF THE FILE ENTRY NUMBER SPECIFIED IN JCL0AD(12» IS C COMPUTED. FOR JCLOADdA) 0, ADDITIONAL FILE ENTRIES WILL C AUTOMATICALLY BE ADDED TO THE FILE PROVIDED THE FILE IS THE C LAST ON THE RECORD. MODE 4 REQUIRES COMPONENTS 8,9, AND 10 C AS WELL AS THOSE REQUIRED FOR MODE 3. JCLOAD (12J IS THE C NUMBER OF FILE ENTRIES TO MOVE FROM THE CURRENT FILE ENTRY. ' c ^ '' c .••.»*•... c SUBROUTINE C4ADR2( JCSPUR, JCLQAD, JCSORF, JCCLNO) COMMGN/ALLOC/JCCORE( I) DIMENSION JCSPURlDtJCLOADll) C ENTER CALL SYSENT(l,2,l,7,JCCLN0)

PAGE 423

411 SELECTING PROPER MODE JCOUM2=JCLOAD(l5) GO TO (l,1.2»3).JCCUM2 1 CALL SYSERRt-l.JCLCADdD) MODE =3 2 CALL FRMCEL(JCSPUR,JCLOAD(ll),JCLOAD(lO)f JCLOAD(23)tl) CALL FRHCEL{JCSPUR,JCLaA0*JC0UH4 IFlJC0UM6.GT.0)GO TO 5 JCSORF=-JCSORF IF(JCSGRF.EQ.-1)G0 TO 104 CALL SYSERR(-2,JCL0A0( ID) v 5 1FUCDUM6.LE.JCL0ACJ9J )G0 TO 8 FILE ENTRY BEYOND LAST FILE ENTRY IF(JCLCA0(14).GT.0)G0 TO 6 JCSORF=-JCSORF IF{JCSCRF.EQ.-l)GO TO 104 CALL SYSERR{-3tJCLCAD(ll)) 6 JCDUM7=JCLOADl27)+JCDUM3+(JCLOA0(9)-JCLOAD(8)*JC0UM5)»JCLOAD(10l IF( JC0UM7.EC.JCL0AC(21) )G0 TO 7 FILE NOT LAST IN RECORD CALL SYSERR(-4,JCLCA0(ll)) INCREASING SIZE OF FILE 7 JCLCA0(21)=JCLOAD(21)+( JCOUM6-JCLOAD(9))»JCLOAO(10) JCLeA0(9)=JC0UM6 CALL TOCELH JCSPUR.JCLOA0( 11), JCLOAOl 9) , JCLOAO( 16) ,I» COMPUTING RELATIVE ADDRESS OF FILE ENTRY 8 JCLCA0(27) = JCLOAD(27)«-JCDUM3+JCLOAD«12)»JCLOAOC10) JCLCAD(8)=JCDUH6 COMPUTING ABSOLUTE ADDRESS OF FILE ENTRY JCLOAOl 15)=2 CALL C4ADR3(JCSPUR,JCL0A0, JCSORF.l) EXIT 104 CALL SYSEXT RETURN END

PAGE 424

412 • CAAoaa • PURPOSE C4A0R3 CONVERTS THE RELATIVE ADDRESS FROM JCL0AD127) INTO AN ABSOLUTE ADDRESSi UPDATING JCLOAO COMPONENTS 1-7. USAGE CALL C4ADR3{JCSPUR,JCL0A0tJCS0RFf JCCLNO) DATA FORMAT N/A DESCRIPTION Or PARAMETERS JCSPUR ^ A VECTOR DESCRIBED IN THE CAADRS DOCUMENTATION JCLOAO = A VECTOR DESCRIBED IN THE C4ADRS DOCUMENTATION JCSORF = SEE FETCH JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER REMARKS THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE COMMON STATEMENT FOR SOME MACHINES. THIS ROUTINE IS NOT INTENDED FOR DIRECT USER CALL. SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED CAAORl C4STUP SYSENT SYSEXT ERROR COOES FOR THIS PROGRAM I F RECORD SEGMENT ABSENT (ADDRESS OF POINTER) HETHOO SELF EXPLANATORY SUBROUTINE CifADR3{ JCSPURiJCLOAD, JCSORF, JCCLN01 COMMON/ ALLOC/JCCORE( 1) DIMENSION JCSPUR(1)>JCL0AD(1) ENTER CALL SYSENT(l,2,l,8,JCCLN0) COMPUTING RECORD AND REGISTER SEGMENT NUMBERS JCDUMl=»(JCL0AD(27)-l)/JCSPURCA) JCDUM2=JCDUMl/(JCSPUR(4)-2)+l JCDUM3=JCL0A0(3) IF(JCL0AD(l5).£Q.l)JCDUM3=l JCL0A0(12)»JC0UM2-JCDUM3 JCLOADlA)=JCCUMl-( JCDUM2-1 ) •( JCCORE( 3)-2H-l ACCESSING POINTER TO RECORD SEGMENT CALL C<»AORltJCSPURtJCLOADi JCSORF,!) IF(JCSORF.eQ.-l)GO TO 2 JCL0ADtl5J=3 ACCESSING RECORDSEGMENT JCOUM2=JCLOAD<1) IFIJCC0REIJCDUM2).GT.0>G0 TO 3 IF(JCCCRE(JCDUM2).LT.0)GO TO 4 IFCJCL0A0(14).GT.O)CO TO 4

PAGE 425

r » • 413 JCSORF=-JCSQRF IF«JCSO«F.EQ.-1)GO TO 2 CALL SYSERR(-1,JC0UM2) *t CALL CfSTUPtJCSPUR.JCLOADtl) 3 JCLOA0(6)=JCCaRE
PAGE 426

414 C ^^ „••.« ••.••...••••»•••••••••••' c "** I '""JInEXT returns in JCLOAOtS) THE ABSOLUTE ADDRESS OF THE C NEXT RECORD SEGMENT. C C """all C4nEXTCJCSPUR,L0ESS,H0DEL.JCL0A0.JCCLN0) C DATA FORMAT C N/A C DESCRIPTION OF P*^*!^"^^^,„ igpo i^ THE CrAORS OOCUMcNTATION <^ I'nPcf : ; llclol ollcllllo N ?Hi C4ADRS DOCUMENTATION ^ hnni I A vIctSS SeSCRIBeO N THE C^AORS DOCUMENTATION C T^L A uPrrnJ SlsCR BED IN THE C^ADRS DOCUMENTATION I S?SS : i IlEJ^'ASS^NEi'cALrSTATEHENT ID. PARAMETER i ''"*!hI NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE ^ COMMON STATEMENT FOR SOME "ACHINES. THIS ROUTINE IS NOT INTENDED FOR DIRECT USER CALL. C C c C . SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C C^ADRl r CASTUP C J5TST1 C SYSENT C SYSERR C SYSeXT r ERROR CODES FOR THIS PROGRAM S -CODE FATAL ERRORt DATA PROVIDED) ..r,o»,M,.» C CODE FATAL c^^^^^ SEGMENT NOT ASSIGNED IJCLOAOIDl J ;S|/,°r.RT"5o"lS CAUULATEO. LOESS IS THEN UPOAItD. *^ SUBROUTINE CANEXTI JCSPUR.LOcSS, MODEL. JCLOAO.JCCLNOJ SSlSNTcSpS?nltiESS.l..MODELa..JCLOADtl, r ENTER CALL SVSENT(l.2.l,9.JCCLN0i,^ ^^^^^^^^ ^^^^^^^ ^^^^^ jCLOADIA)=JCLOADtA)tl JCL0ADU2»=0 JCLCAO( 151=2 .„ „ ,, CALL CAADRllJCSPUR.JCLOAD.O.l) Ml^JCLOADIU JCL0A0(5)=JCCOR£(Ml) 1FIJCLOA015J.GT.O)GO TO 2 r RECORD NOT IN CORE IF«JCLOA0«5).LT.0)GO TO I

PAGE 427

415 1F( JCLOADt 14 ) .LT.O )CALL SYSERR t-l, JCLOAOC I ) I ACQUIRING RECORD SEGMENT 1 JCL0A0(15)=°3 CALL CASTUP(JCSPUR,JCUOAD, II Kl'JCLOADdl JCLCAD<5)=JCC0RE
PAGE 428

416 C .. C»»«»i»****«*«**»« ••• • • .•••••• c * C • C4STUP • c •••• c C PURPOSE C C4STUP ADDS EMPTY CORE SEGMENTS TO A CATALOGUE i REGISTER OR C RECORD. C C USAGE C CALL C*STUP(JCSPUR.JCLOAO,JCCLMO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPUR « A VECTOR DESCRIBED IN THE C4A0RS DOCUMENTATION C JCLOAO = A VECTOR DESCRIBED IN THE CiADRS DOCUMENTATION C JCCLNO ' A USER ASSIGNED CALL STATEMENT ID. PARAMETER c C REMARKS . , ^ C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT FOR SOME MACHINES. C THIS ROUTINE IS NOT INTENTED FOR DIRECT USER CALL. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C NEMCEL C SUPPLY C SYSENT C SYSERR C SYSEXT C C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERRORCDATA PROVIDED) C I NF NOT AN EMPTY LOCATION (ADDRESS OF POINTER) c • C THREE MODES OF OPERATION ARE POSSIBLE. JCL0AD(15)=1 AND C JCLOA0(15) = 2 CORRESPOND TO THE TWO MOOES FOR C'fAORl. THE C THIRD MODE, JCLOAO( 15)=3, IS FOR THE ADDITION OF A RECORD C SEGMENT TO A RECORD. FOR MODES I AND 3, JCLOAO(l) IS THE r ADDRESS OF THE POINTER FOR WHICH CORE IS REQUESTED. IN C MODE 2i CORE SEGMENTIS) ARE LINKED TO THE SEGMENT NAMED BY C JCL0AD(2). C4STUP MAKES NO CHANGES IN JCLOAO. JCLOA0(20) C IS THE BASE ERROR CODE. JCL0AD(12)=NUMBER OF SEGMENTS. C c ••• • c SUBROUTINE C4STUP( JCSPURt JCLOAO, JCCLNO) COHMON/ALLOC/JCCOREd) DIMENSION JCSPUR(l),JCLOADll) C ENTER CALL SYSENT(l,2.l,10,JCCLN0) C SELECTING PROPER MODE JCDUM8=JCSPUR(2» IF(JCLOADil5).NE.3)JCSPUR{2)=0 JCDUM9=JCSPUR(3) JCDUMI = JCL0AD( 15) ': JCDUM2=JCL0A0(l) JCDU10=JCC0RE(JCDUM2) JCDUMA'>JCL0AD(12)

PAGE 429

417 GO TO (3,l,2),JC0UMl 1 JC0UH2=JCL0ADI2) JC0UM3=JC0UM2 GO TO 3 2 JCDUH4=»l C VACANCY TEST 3 IF(JCC0RE(JC0UM2).LE.0)G0 TO 4 CALL SYSERR(liJCDUM2) GO TO 104 4 JCSPUR(3)»JCCUH4 00 8 I=1»JCDUM4 C SEGMENT ACQUISITION CALL NEWCEL(JCSPUR,JCDUM5,l) C • SETTING LINKS JCC0RE(JC0UM2)=JCDUM5 GO TO (7,6.3),JCDUM1 6 JCDUM6=JC0UM5*l JCCCRE ( JCDUM6 J = JC0UH3 7 JC0UM2=JC0UM5 JC0UM3=JCDUM5 8 CONTINUE JCCCRE (JC0UH5)=0 IF( (JCDUMl.NE.3>.OR.(JC0U10.GE.0))GO TO 104 JCDUMl= I ABS IJCDUIO ) CALL SUPPLYJ JC0UM1,JC0UM5,JCSPUR<4)|1) 104 IF(JCL0AD(15).NE.3)JCSPUR(2)=JC0UH8 JCSPUR13)=JCDUM9 C EXIT CALL SYSEXT RETURN END

PAGE 430

418 C ^ ..•.,••» C»«»»»» •• • ••»••••• c •••»•«•••• Q • C4TRAN • c ••• • c C PURPOSE C C4TRAN PERFORMS THE DATA TRANSFER FOR FETCH AND STORE. C " . C CALL C-VTRANIJCSPUR, LISTER, LION, LOCAL, JCFINE.JCLOAO.JCSORF, C JCCLNO) C C DATA FORMAT C N/A C , ' C DESCRIPTION OF PARAMETERS C JCSPUR = A VECTOR DESCRIBED IN THE CkAORS DOCUMENTATION C LISTER = A VECTOR DESCRIBED IN THE ChAORS DOCUMENTATION C LION = A VECTOR WHICH CONTAINS THE DATA ASSOCIATED WITH r A TRANSFER OPERATION. THE DATA ITEMS ARE PLACED C OR REMOVED FROM LION IN THE ORDER DICTATED BY C LOCAL = A VECTOR DESCRIBED IN THE CVADRS DOCUHcNTATION r JCFINE = A VECTOR DESCRIBED IN THE CfAORS DOCUMENTATION C JCLOAD = A VECTOR DESCRIBED IN THE C'»ADRS DOCUMENTATION C JCSORF = SEE FETCH C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER . C • f* ' RBHARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT FOR SOME MACHINES. C THIS PROGRAM IS NOT INTENDED FOR DIRECT USER CALL. C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C C4ADRS C C4NEXT C FRMCEL C SYSENT C SYSEXT C TOCELL C C ERROR COOES FOR THIS PROGRAM C NONE C C ** "if JCL0AD(14)=-1, FRMCEL IS EMPLOYED. IF JCL0ADH4) = l, C TOCELL IS EMPLOYED. C c ••• ** SUBROUTINE C4TRAN( JCSPUR, LISTER, LION, LOCAL, JCFINE t JCLOAD, JCSORF, I JCCLNO I COMMON/ ALLOC/JCCOREI I) ,,, ^,,. .^.„.„,,, DIMENSION jCSPURt 1 »,L I STER
PAGE 431

419 JC0UH7=JC0UHl fF(JCOUMl.CT.O)GO TO 3 C EITHER NO DATA TRAMSFER OR EVERYTHING IN FILE ENTRY JCOUMl»l IF(L0CAL(1).LT.0)G0 TO 3 C ENTIRE FILE ENTRY WORD FOR WORD IFCLISTER(1).LE.1)G0 TO I C RETRIEVING NUMBER OF WORDS PER FILE ENTRY L0CAL(1)=>-1 CALL C4A0RS (JCSPUR.LISTERi LOCAL, LOESSf MODEL i If JCFINEtJCLOAOfJCSORF I tl) IFJJCSORF.EQ.-DGO TO 16 C RESETTING LISTER TO AVOID REPEATING ADDRESS CALC. L1STER{1)=1 LISTER(2)=0 C SETTING UP LOCAL TO TRANSFER EACH FILE ENTRY WORD 1 DO 2 I=lf3 2 L0CAL(I)=1 L0CAL(4)=JCL0A0(10) C SERVICING DATA ITEMS IN LOCAL 3 JC0UM2=l 00 15 I=1,JC0UMX IFCJCSORF.EQ.-DGO TO 15 JC0UM431 C ADDRESSING FILE ENTRY CALL C4A0RS(JCS PUR, LISTER, LOCAL, LOESS, MODEL, I, JCFINE.JCLOAOtJCSORF I .2) IF(JCSORF.EQ.-l)GO TO 15 4 IF(KODEL(l».LE.O)GO TO 7 C TRANSFERRING DATA ITEM IF(JCL0AD(14).LT.0)C0 TO 5 CALL T0CELL«JCSPUR,JCLOAD(5),LION(JCDUM2),M00ELtl) GO TO 6 5 CALL FRMCEL(JCSPUR,JCL0A0(5),LI0N(JCDUM2),H0DEL,l) 6 JCDUM2=JCDUM2+M0DEL(4)-M00EL(3»+l 7 1FIL0£SS(1).LE.0)G0 TO 11 C PARTITIONED FILE ENTRY 60 TO (8,10)»JCOUH4 C SECOND PARTITION 8 JCDUH4=2 Ml=JCL0AD<13) JCDUM5=JCC0REIM1» JCCCRE(M1)=1 00 9 J=l,5 9 JCDUHY(J)»JCLOAO
PAGE 432

420 END

PAGE 433

421 C ..„....•••••• •• C» • •••• ••••• c Q :• FETCH • C •••••.••• c C ^^^^yll PURPOSE OF FETCH IS TO RETRIEVE DATA ITEMS FROM A FILE C ENTRY. C C "^*"aLL FETCHtJCSPUR, LISTER, lion, LOCAL, JCFINE.JCLOAO^JCSORF, C JCCLNO) c C DATA FORMAT C N/A I "'^'^JsJISVa 'vEcJSfoESCRIBEO IN THE C.ADRS DOCUMENTATION C LISTER = A VECTOR DESCRIBED IN THE C^AORS DOCUMENTATION C LION = A VECTOR DESCRIBED IN THE C4TRAN DOCUMENTATION C LOCAL = A VECTOR DESCRIBED IN THE CVADRS DOCUHtNTATION C JCFINE = A VECTOR DESCRIBED IN THE C4ADRS DOCUMENTATION C JCLOAD = A VECTOR DESCRIBED IN THE CVADRS DOCUMENTATION C JCSORF = *l OR -I AS THE FETCH OPERATION IS OR IS NOT^ r SUCCESSFUL WHEN JCSORF IS PASSED AS !. IF THE ^ TEST FOR SUCCESS OR FAILURE IS NOT DESIRED, JCSORF C JCCLNO » A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C '*^"*;j^ NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT FOR SOME MACHINES. C JCL0A0(29) MUST NOT EQUAL -1 UNLESS VIOLATION OF FILE ENTRY C BOUNDARIES IS TO BE PERMITTED. C CARE MUST BE EXERCISED IN USING THE SECOND MODE OF C OPERATION (SEE METHOD) TO INSURE THAT THE JCLOAD VECTOR HAS C BEEN UNALTERED SINCE THE STORE OR FETCH CALL ADDRESSING THE C SS^LIST^YPE^SPECIFIED BY JCSPURIS) MUST BE FORWAROC ?5ls"pR0GRAM, FIND AND STORE ARE THE ONLY REMOTE ROUTINES C RECOMMENDED FOR DIRECT USER CALL. „„,»,^„o m tuc C JCLOADOO) MUST CONTAIN THE ADDRESS OF THE POINTER TO THE C CATALOGUE. C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C C4TRAN C SYSENT C SYSEXT C C ERROR CODES FOR THIS PROGRAM C NONE c . C ''""POSTER MAY BE USED TO ADDRESS THE DESIRED FILE ENTRY VIA C CATALOGUE AND/OR DIRECTORY SELECTIONS, OR MAY SPECIFY THE C FILE ENTRY VIA LISTERLl)=l AND LISTER{2)=THE NUMBER OF FLE C ENTRIES TO MOVE FROM THE CURRENT FILE ENTRY. IF LOCALil) C IS -1, ONLY THE ADDRESSING OPERATION IS PERFORMED. IF C LOCALd) IS OR LARGER, FETCH PERFORMS AS WOULD FRMCEL. C A RECORD SEGMENT MAY BE RETRIEVED FROM OFF-LINE STORAGE IF

PAGE 434

422 C REQUIRED. NO OTHER ABSENCES OF SEGMENTS FROM ALLOCATABLE C CORE ARE TOLERATED. SUBROUTINE FETCH(JCSPUR, LISTER, LION.LOCAL, JCFINE .JCLOAO.JCSORF, I JCCLNOJ SrMENS;S!;TspSR?u:USTER.l..LION.l..LOCAL.l,.JCFINE.l.»JCLOAD.n C ENTER CALL SYSENT(l,2,l,l.JCCLN0) C PREPARING FOR DATA TRANSFER JCL0AD(14)='-l ^ CALL C4TRANtJCSPUR, LISTER, LION, LOCAL, JCFINE, JCLOAD,JCSORF,l> C EXIT CALL SYSEXT RETURN END

PAGE 435

423 C C»»» •• •»••• ••••...••.••••• c •..».••» C • FIND • C •••••••• c C PURPOSE „ . ^..^ C FIND SEARCHES A FILE IN A SPECIFIED DIRECTION FOR A FILE C ENTRY CONTAINING A SPECIFIED PATTERN OF DATA VALUES. C C CALL FINOtJCSPUR, LISTER, LION, LOCAL, JCFINE.JCLOAO.JCDOFS, C JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPUR = A VECTOR DESCRIBED IN THE C<,AORS DOCUMENTATION C LISTER = A VECTOR DESCRIBED IN THE C^AORS DOCUMENTATION C LION = A VECTOR DESCRIBED IN THE C4TRAN DOCUMENTATION C LOCAL = A VECTOR DESCRIBED IN THE CfAORS DOCUMENTATION C JCFINH = A VECTOR DESCRIBED IN THE C4ADRS DOCUMcNTATION C JCLOAD = A VECTOR DESCRIBED IN THE CtADRS DOCUMENTATION C JCDOFS = A PARAMETER EQUAL IN MAGNITUDE TO 1 , 2 , OR 3 AS r RESPICTIVELV IT IS DESIRED THE SEARCH PROCEED IN C THE FORWARD DIRECTION ONLY, BACKWARD DIRECTION r ONLY OR THE SEARCH IS TO ENCOMPASS THE ENTIRE r FILE. IF JCFOFS IS NEGATIVE, THEN THE SEARCH IS C SUCCESSFUL IF ANY DATA TYPE DESCRIBED IN THE LOCAL r VECTOR HATCHES THE CORRESPONDING VALUES INDICATED C IN LION. WHEN JCDOFS IS NEGATIVE, THE PARTICULAR r DATA TYPE FOUND TO MATCH IS RETURNED TO THE USER r VIA THE JCDOFS PARAMETER. FOR A POSITIVE JCDOFS C ALL DATA TYPES IN LOCAL MUST MATCH. JCDOFS IS SET C EQUAL TO ZERO IN THE CASE OF FAILURE. C . JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT FOR SOME MACHINES. C JCL0AD(29) MUST NOT EQUAL -I UNLESS VIOLATION OF FILE ENTRY C BOUNDARIES IS TO BE PERMITTED. C CARE MUST BE EXERCISED IN USING THE SECOND MODE OF C OPERATION (SEE METHOD) TO INSURE THAT THE JCLOAD VECTOR HAS C BEEN UNALTERED SINCE THE FIND, FETCH OR STORE CALL C ADDRESSING THE CURRENT FILE ENTRY. C THE LIST TYPE SPECIFIED BY'JCSPUR(5) MUST BE FORWAROC BACKWARD. , _. C THIS PROGRAM, FETCH AND STORE ARE THE ONLY REMOTE ROUTINES C RECOMMENDED FOR DIRECT USER CALL. C JCLOADOO) MUST CONTAIN THE ADDRESS OF THE POINTER TO THE C CATALOGUE. ^ „.,. C THE FILE ENTRY NUMBER OF THE FILE ENTRY CONTAINING THE DATA C PATTERN IS RECORDED IN JCLOAOIB), AND ITS ABSOLUTE ADDRESS C IN JCL0AD15J. IF JCDOFS IS 0, THE SEARCH HAS FAILED. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C C4TRAN C SYSENT C SYSERR C SYSEXT

PAGE 436

424 C C ERROR CODES FOR THIS PROGRAM C CODE FATAL ERROR(DATA PROVIDEDI C I NF LOCALd) = -I (JCL0AD(5)) C C LISTER MAY BE USED TO ADDRESS THE DESIRED FILE ENTRY VIA C CATALOGUE AND/OR DIRECTORY SELECTIONS. OR MAY SPECIFY THE C FILE ENTRY VIA LISTER(1) = 1 AND L ISTER (2 J =THE NUMBER OF FILE C ENTRIES TO HOVE FROM THE CURRENT FILE ENTRY. FIND BEHAVES C ESSENTIALLY AS DOES LOCATE. A RECORD SEGMENT MAY BE C RETRIEVED FROM OFF-LINE STORAGE. NO OTHER ABSENCES OF C SEGMENTS FROM ALLOCATABLE CORE ARE TOLERATED. C c ••••• c SUBROUTINE FIND tJCSPUR, LISTER, LION, LOCAL, JCFINE .JCLOAO.JCDOFS, I JCCLNO) COMMON/ALLOC/JCCORECl) .1^..^.,. ./..r.»r.,,i DIMENSION JCSPUR(l),LISTER(I),LION(l),LOCAL{l),JCFINEU).JCLOAO(l) lrJCDUMY(l5),JCLIMT{l5) C ENTER CALL SYSENT(l,2,l,2,JCCLNO) C PREPARING FOR DATA TRANSFER JCSORF=l JCL0A0(IA)=-1 JCDUM2=0 JCDUH7=LISTERll) JCDUM3=LISTER«2) JC0UM9=-(-l)»*IA8S(JC00FS) C TRANSFERRING DATA ^^^ ,, 1 CALL C4TRAN(JCSPUR,L ISTER, JCDUMYf LOCAL, JCFINE,JCL0A0,JCS0RF,1) IF(JCSORF.EQ.-1)GO TO 82 IF(JCDUM2.GT.0»G0 TO 6 JCDUM3=L0CALtl) JC0Ul0=JCLOAD«8) LISTER(l)=l LISTER(2)=JCCUM9 IF(JCCUM2.LT.0)G0 TO 6 1F(JCCUM3.GT.0IG0 TO 2 IF«JC0UM3.LT.0)CALL SYSERRI I, JCLOADI 5) ) JCDUH3=1 JCLIHT(l)=JCLOAD(lO) GO TO 5 2 DO 4 I=l>JC0UM3 JC0UM4=3»I+1 IF(L0CAL«JCCUM4).GT.0)G0 TO 3 JC0UM5=JCSPUR(5)+20 JCDUM5=JCC0RE«JCDUM5)t*»{L0CAL(JCDUH4-2»-l)*l JCLIMTI I)=JCCQREIJCDUM5+1) IFIJCLIMT(I».EQ.0)JCLIMT(I)=JCL0AD(10) JCLIMT(n=«JCLIMTII)-JCC0Re(JCDUM5)*l-L0CAL(JC0UM4-l)*l GO TO 4 ... 3 JCLIMT(I)=L0CAL(JCCUM4)-L0CAHJC0UH4-l)*l h CONTINUE 5 JCDUM2=l -^ 6 JCDUM4=0 JCDUM5=0 JCCUll=JC00FS 00 8 I=I^JCDUH3 1F(«JCDUH5»JCDUII).GT.0)G0 TO 8 JCDUM5«0

PAGE 437

425 JCDUM6=JCLIMTII) 00 7 J»lrJCCUM6 JC0UM4=JCCUM4+l 7 IF(JCDUMY(JCDUM4).NE.LI0N( JC0UM^))JCDUM5=1 IF((JC0OFS.GT.0).OR.(JC0UM5.E0.l))GO TO 8 JC0UM5»-l JeDOFS=I 8 CONTINUE IF
PAGE 438

426 C c»»»»»» • • • •••• •• c • • C • STORE • C • c C PURPOSE C THE PURPOSE OF STORE IS THE STORAGE OF DATA ITEMS IN A FILE C ENTRY. C C USAGE C CALL STOREtJCSPUR, LISTER, LION, LOCAL, JCFlNEtJCLOAO,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSPUR = A VECTOR DESCRIBED IN THE C4ADRS DOCUMENTATION C LISTER = A VECTOR DESCRIBED IN THE C4ADRS DOCUMENTATION C LION = A VECTOR DESCRIBED IN THE CfTRAN DOCUMENTATION C LOCAL = A VECTOR DESCRIBED IN THE C4ADRS DOCUMENTATION C JCFINE = A VECTOR DESCRIBED IN THE C^ADRS DOCUMENTATION C JCLOAO = A VECTOR DESCRIBED IN THE CVADRS DOCUMENTATION C JCCLNO = A USER SPECIFIED CALL STATEMENT 10. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT FOR SOME MACHINES. C TO FACILITATE THE PROPER INITIALIZATION OF THE JCLOAO C VECTOR, JCLOADdS) MUST EQUAL -I FOR THE FIRST CALL TO C SUPPLY. C JCL0AD(2g) MUST NOT EQUAL -1 UNLESS VIOLATION OF FILE ENTRY C BOUNDARIES IS TO BE PERMITTED. C CARE MUST BE EXERCISED IN USING THE SECOND MODE OF C OPERATION (SEE METHOD) TO INSURE THAT THE JCLOAD VECTOR HAS C BEEN UNALTERED SINCE THE STORE OR FETCH CALL ADDRESSING THE C • CURRENT FILE ENTRY. C THE LIST TYPE SPECIFIED BY JCSPURIS) MUST BE FORWAROC BACKWARD. C THIS PROGRAM, FETCH AND FIND ARE THE ONLY REMOTE ROUTINES C RECOMMENCED FOR DIRECT USER CALL. C JCL0A0{30) MUST CONTAIN THE ADDRESS OF THE POINTER TO THE C CATALOGUE. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C CfTRAN C SYSENT C SYSEXT C C ERROR COOES FOR THIS PROGRAH C NONE C C METHOD C LISTER MAY BE USED TO ADDRESS THE DESIRED FILE ENTRY VIA C CATALOGUE AND/OR DIRECTORY SELECTIONS, OR HAY SPECIFY THE C FILE ENTRY VIA LISTER(n=l AND LI STER«2 ) *THE NUMBER OF FILE C ENTRIES TO MOVE FROM THE CURRENT FILE ENTRY. IF LOCALdl C IS -I, ONLY THE ADDRESSING OPERATION IS PERFORMED. IF C LOCALtl) IS OR LARGE'r, STORE PERFORMS AS WOULD TOCELL. C CATALOGUE, REGISTER AND RECORD SEGMENTS ARE ACQUIRED FROM C ALLOCATABLE CORE AS REQUIRED TO PERFORM THE ADDRESS C COMPUTATION. RECORD SEGMENTS ON OFF-LINE MEMORY HILL BE

PAGE 439

427 C RETRIEVED AS REQUIRED. C c c SUBROUTINE STORE(JCSPUR, LISTER , LION, LOCAL, JCFINE.JCLOAD.JCCLNO) COMMON/ ALLOC/JCCORe( 1 ) 01 HENS ION JCSPUR(l),LISrER(li,LION(i),LOCAL(l>,JCFINE(l) rJCLOAO(l) C ENTER CALL SYSENT(I,2,1.3,JCCLNO) C PREPARING FOR DATA TRANSFER JCLOADI 14)^1 Ml=0 C TRANSFERRING DATA CALL C4TRAN(JCSPUR. LISTER, LION, LOCAL, JCFINE.JCLOAD, HI, 11 C EXIT CALL SYSEXT RETURN ^ END

PAGE 440

428 C c«»*«»«*«<«««*»»>»>»***««««*«*»<»** •.••• • ...»••••••• c •••• C • SUPPLY • c c C PURPOSE C THE PURPOSE OF SUPPLY IS THE RETRIEVAL OF DATA C CORRESPONDING TO A RECORD SEGMENT. C C USAGE C CALL SUPPLY(JCPKEY,JCFWOR,JCNWPR,JCCLNO» C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCPKEY = A POSITIVE INTEGER KEY IDENTIFYING THE INFORMATION C TO BE PLACED IN A RECORD SEGMENT C JCFHOR = THE ABSOLUTE ADDRESS OF THE FIRST WORD OF THE C RECORD SEGMENT C JCNWPR = THE NUMBER OF WORDS PER RECORD SEGMENT C JCCLNO = A USER ASSIGNED CALL STATEMENT ID.. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT FOR SOME MACHINES. C THE CURRENT VERSION OF SUPPLY DOES NOT RETRIEVE INFORMATION C FROM OFF-LINE STORAGE. THIS VERSION ONLY PRODUCES AN ERROR C SUBROUTINE CALL WHICH IS NORMALLY FATAL. IF A USER WISHES C TO EMPLOY OFF-LINE STORAGEt SUPPLY MUST BE MODIFIED TO C OPERATE AS DESCRIBED IN METHOD. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C SYSENT C SYSEBR C SYSEXT C C ERROR COOES FOR THIS PROGRAM C CODE FATAL ERRqRJOATA PROVIDED). C IF ATTEMPTED RETRIEVAL FROM MASS MEMORY (JCFHOR) C C METHOD C SUPPLY RETRIEVES AN ENTIRE RECORD SEGMENT FROM OFF-LINE C STORAGE. THE USER MAY UTILIZE ANY STORAGE DEVICE DESIRED. C THE INFORMATION IS TRANSFERRED TO ON-LINE MEMORY AS WHOLE C WORDS. PARTIAL RETRIEVAL OF RECORD SEGMENTS IS NOT C PERMITTED, C C •••••••••• c SUBROUTINE SUPPLY( JCPKEY, JCFWORf JCNWPR , JCCLNO) COMNQN/ALLOC/JCCOREIll C ENTER CALL SYSENTd, 2, LiA, JCCLNO) CALL SYSERR(-I,JCFWOR) C EXIT CALL SYSEXT RETURN END

PAGE 441

429 COAST GENERAL INFORMATION SPECIAL INSTURCTIONS/COIN THE COAST SUBROUTINt COIN MUST BE CALLED PRIOR TO USING ANY OTHER OF THE COAST SUBROUTINES. SPECIAL INSTRUCTIONS/DEDUG THE FOLLOWING INDICATES THE ORDER FOR OPERATIONAL CHECKS OF THE COAST SYSTEM. THE PROGRAMS FOR LEVEL TWO, FOR INSTANCE, CALL ONLY SUBPROGRAMS FROM LEVELS ONE OR A. SIMILARLY FOR ALL OTHER LEVELS. SUBPROGRAM

PAGE 442

430 C AN ERROR MESSAGE IS OF THE FOLLOWING FORM, C ERROR N ( f ( t * ) E C WHERE EACH INDICATES IN ORDER OF OCCURRENCE C 1 THE NUMBER OF SUBROUTINES CURRENTLY ENTERED C 2 THE SYSTEM 10. NUMBER C 3 THE LEVEL lU. NUMBER C 4 THE PACKAGE ID. NUMBER C 5 THE PROGRAM ID. NUMBER "C 6 THE CALL NUMBER C 7 THE ERROR CODE ^ _..„^ „„ C 8 THE DATA PROVIDED TO AID IN DETERMINING THE NATURE OR C CAUSE OF THE ERROR C FIELDS 2 THROUGH 6 UNIQUELY IDENTIFY A PROGRAM CALLING THE C SYSERR ROUTINE. FIELDS 7 AND 8 ARE PASSED TO SYSERR. A C NEGATIVE ERROR CODE INDICATES A FATAL ERROR. TERMINATING C EXECUTION. EXECUTION CONTINUES FOR A POSITIVE ERROR CODE. C JCC0RE(14) PROVIDES THE MEANS FOR OVER-RIDING THE SIGN OF C AN ERROR CODE. WHEN SET AT ZERO, JCCORE(l^) HAS NO EFFECT. r IF -1 IS THE VALUE OF JCCORE(l'r), THEN ANY ERROR COMMITTED C IS FATAL. IF ! IS THE VALUE, ANY ERROR MILL BE NON-FATAL. C C SPECIAL INSTRUCTIONS/DUMP C IF A DUMP OF JCCORE IS DESIRED WHEN AN ERROR CONDITION IS C ENCOUNTERED, JCC0RE(19) MUST BE SET EQUAL TO A NON-ZERO r INTEGER. IF POSITIVE, ONLY PRINTED OUTPUT WILL BE C PROVIDED. FOR BOTH PRINTED AND PUNCHED OUTPUT, JCCORE (19) C MUST BE SET TO -N, WHERE N IS THE DATA SET REFERENCE NUMBER C FOR THE CARD PUNCH. JCC0REH9)=0 SUPPRESSES THE DUMP. C C . SPECIAL INSTRUCTIONS/LAND, LEOR, LOR r LAND, LEOR, AND LOR ARE RESPECTIVELY THE FUNCTION NAMES FOR C THE LOGICAL OPERATIONS 'AND', 'EXCLUSIVE OR', AND 'OR'. C THESE FUNCTIONS MUST BE PROVIDED IN OBJECT DECK FORM. THE C CURRENTLY INSTALLED OBJECT DECK IS COMPATABLE WITH THE C FOLLOWING MACHINES. C IBM 360 H LEVEL f* * T RM ^70 C THE TWO ARGUMENTS REQUIRED BY EACH FUNCTION ARE PROVIDED AS C PASSED PARAMETERS. C C SPECIAL INSTRUCTIONS/TRACE ^.^.. ^.,.c« C THE CODING REQUIRED FOR TRACING THROUGH EACH CALLED C SUBPROGRAM IS PROVIDED. THIS OPTION MAY BE INSTALLED OR C REMOVED BY REMOVING OR INSTALLING THE COMMENT C ON EACH OF C THE AFFECTED CARDS. WHEN INSTALLED, THE TRACE IS C CONTROLLED BY JCC0RE(20) AS FOLLOW. C JCCORE(20) =» NO TRACE r N TRACE MESSAGE FOR ALL SUBPROGRAMS r ENTERED UP TO THE POINT AT WHICH N r SUBPROGRAMS ARE CURRENTLY ENTERED. THE r TRACE RESUMES UPON EXITING A SUFFICIENT , NUMBER OF SUBPROGRAMS SO THAT THE r NUMBER OF CURRENTLY ENTERED IS N OR C LESS. C WHEN TURNING A TRACE OFF (BY SETTING JCC0RE(20) TO C), SET C JCC0RE(13) TO 6. C C CURRENT STATUS C OPERATIONAL C •••••••• c»*»»*«*** • •».••••••••• c

PAGE 443

,431 C c • •.»••»• ••• •...».••.••.•.• .•••••••••• c ••.•..•• C • COIN • c c C PURPOSE C THIS SUBPROGRAM IS THE COAST SYSTEM INITIALIZATION ROUTINE. C C USAGE C CAtt COiN(JCINPT,JCOTPT» C C DATA FORMAT C JCNBPW.JCTCIA.JCCSSZ.JCMAXB CARD TYPE I *I20 C JCNOUT 2 '^120 C JCNOOI.JCFOFB 3 'HZO C JCDFWI.JCDLWI.JCSHFT.JCMASK 4
PAGE 444

432 C C METHOD C SELF EXPLANATORY C C C SUBROUTINE CQIN( JC INPTf JCOTPT) COMHON/ALLOC/JCCOREd) JCCORE(10)=JCINPT JCCOREC 11 J= JCOTPT 00 3 I=12t20 3 JCCOREU)=0 JCC0RE113)=6 1 F0RKATIAI20) C INPUT OF PARAMETERS REAO«JCINPT,l)(JCCORE(I),I = lf'») READ(JCINPTil)JCNOLT JC0UMl=2l*JCN0LT C INPUT OF DATA LOCATION ARRAY 00 2 I»1»JCN0LT REAO(JCINPT,l)JCNOCI,JCCORE(JCOUMl) JCCCRE(20*n=JCDUMl JC0UH2=JCDUMl*l JCDUHI = JCDUM1+A^»JCN00I READ( JCINPT , I) UCCOREJ J ) , J=JC0UM2, JCOUMl ) 2 JC0UM1=JC0UM1+1 . ^ C CALCULATION OF LOCATIONS OF AVAILABLE SPACE LIST AND C RETURN MASK JCC0RE«5)=JCDUH1 JCCORE<6) = J5IPOTlJCC0REK),l,OI JCCCREU) = 2«»JCC0RE(6) JCCGRE«7)=JCC0RE(5)*JCC0RE(6)+l JC0UH1=JCC0RE(2)/JCC0RE(3) JC0UM2=JCC0RE( 1)-1 JCC0RE(8)=j5NUMB(JC0UMltJCDUM2,0) JCC0REJ9)=JCC0REI7)*JCC0REt8> C PREPARATION OF AVAILABLE SPACE LIST JC0UH1=JCC0REI7) JCCCRc(JCOUMl)=-l JC0UM1=JCC0RE(9) JCDUM2=JCC0RE12) 00 4 I=JCDUMltJCDUM2 4 JCCORE(I»=-I CALL C3C0HB(0) RETURN ENO

PAGE 445

433 C c ••••••••• • • I c ••••••>• C • CORN • C n •••••••• c C PURPOSE C THE PURPOSE Qf= THIS SUBPROGRAM IS TO RETURN TO THE SYSTEM C CORE SPECIFIED BY A USER SUBPROGRAM. C C USAGE C CALL CORN(IAUASLtJCCLNO) C C DATA FORMAT C N/A CC DESCRIPTION OF PARAMETERS C SEE THE DOCUMENTATION FOR LIST C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE e COMMON STATEMENT, C AN lAUASL VECTOR MAY BE CREATED FOR THE PURPOSE OF PARTIAL C CORE RETURN. THE ARTIFICIAL USER CORE ASSIGNMENT MASK C WOULD INDICATE THE CORE SEGMENTS TO BE RETURNED. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5TST1 C LOR C SYSENT C SYSEXT C C ERROR CODES FOR THIS SUBPROGRAM C NONE C C METHOD C • ALL CORE RETURNED TO CORN IS INDICATED BY A RETURN MASK, C THIS CORE REMAINS UNUSED UNTIL ALL OF THE AVAILABLE CORE C HAS BEEN EXHAUSTED. THE BUDDY SYSTEM SUBPROGRAM C8C0M8 C WOULD THEN BE AUTOMATICALLY CALLED TO MAKE THE CORE C INDICATED BY THE RETURN MASK AVAILABLE FOR ALLOCATION. c . ' c •••••••• c SUBROUTINE CORN« lAUASL, JCCLNO) COMMON/ ALLOC/JCCORE( U DIMENSION IAUASL(5) CALL SYSENT(lil,l,2,JCCLN0) JC0UM1=JCC0RE(8) JCDUM2=IAUASL(1) IF(JCDUM2.EQ.0)GO TO 2 C IS MASK LEGAL CORE ASSIGNMENT CALL J5TST1{JCDUM2,1) JC0UM3=JCCaRE«7J C UPDATING RETURN MASK AND CLEARING USER MASK 00 I I=l»JCDUMl JCCORE ( JC0UM3 ) = LOR ( JCCOREI JCDUM3 ) , JCCORE ( JCDUM2 ) ) JCC0RE(JCDUM2)=0 . JC0UM2=JCDUM2+l I JC0UM3=JCDUM3*l C SETTING MASK AND HEADCELL POINTERS TO ZERO IAUASL(l)-0

PAGE 446

434 2 IAUASL(2)=0 CALL SYSEXT RETURN END

PAGE 447

435 C €••••• • •••..•..•••. ••.••• • ••••••••»•• C >••••••• C • LIST • C •••••••• c C PURPOSE C THE PURPOSE OF THIS SUBPROGRAM IS TO FURNISH THE CALLING C PROGRAM WITH THE REQUESTED CORE. C C USAGE C CALL LIST(IAUASL.JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C lAUASL = A VECTOR CONTAINING THE POINTER TO THE USER'S CORE C ASSIGNMENT MASK, THE POINTER TO THE USER'S C AVAILABLE SPACE LIST HEADCELL, THE NUMBER OF LIST C ENTRIES REQUESTED, THE NUMBER OF WORDS PER LIST C ENTRY, AND LASTLY THE INDEX SPECIFYING THE LIST C TYPE. THE lAUASL ARRAY MUST CONTAIN THESE FIVE C ENTRIES IN THE INDICATED ORDER. lAUASL MAY BE A C COLUMN FROM A MATRIX STORING THE ABOVE INFORMATION C FOR EACH USER MAINTAINED AVAILABLE SPACE LIST. IN C THIS CASE THE PASSED PARAMETER WOULD BE THE MATRIX C ELEMENT AT THE TOP OF THE COLUMfj DESCRIBING THE C PARAMETERS PERTAINING TO THE SELECTED USER ASL. C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C C8GIVE C J5MUP0 C JSNUMB C J5REDY C SYSENT C SYSERR C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM C CODE FATAL ERROR(OATA PROVIDED) C . IF BUDDY TOO SMALL TO USE AS A MASK (ADDRESS OF C BUDDY) C 2 F BUDDY TOO SMALL FOR USER (ADDRESS OF BUDDY) C 3 F NEGATIVE MASK WORD INDEX (ADDRESS OF MASK) C 4 F ILLEGAL FIRST WORD OF BUDDY (ADDRESS OF BUDDY) C C METHOD C THE BUDDY SYSTEM IS UTILIZED TO SECURE CORE FOR THE C SATISFACTION OF REQUESTS BY CALLING PROGRAMS. THE CORE C ACQUIRED BY LIST IS THREADED USING THE FORWARD LINK OF THE C SPECIFIED LIST TYPE. THE CREATION AND UPDATING OF USER C CORE ASSIGNMENT MASKS ARE AUTOMATIC FUNCTIONS PERFORMED BY C LIST. C C •••••••• c

PAGE 448

436 SUBROUTINE L 1ST ( lAUASL, JCCLNO) COHMON/ALLOC/JCCORE( 1 ) DIMENSION IAUASL(5) CALL SYSENT(i,lilt3, JCCLNO) IS THIS FIRST CALL OF LIST IF(IAUASL(1).NE.0)G0 TO 1 PREPARATION OF REQUEST FOR CORE ASSIGNMENT MASK JCDUMl=l JCDUH2=J5NUMB(JCCORE(8)iJCCORE(3)il) JC0UH3=JCDUM2 JCERRC»-01 GO TO 3 PREPARATION OF REQUEST FOR CORE 1 JCNOCT=0 JCERRC=— 02 IAUASL(2I=0 JC0UM1=2 JC0UM2 = j5NUMB(IAUASL('V),JCC0REC3)f2) 2 JC0UM4=(IAUASL(3)-JCN0CT)»IAUASL(A) HAS USER REQUEST FOR CORE BEEN SATISFIED IFIJCDUM4.LE.0)G0 TO 104 JC0UH3=J5.NUMB{JC0UM4,JCC0RE{3)t3» REQUEST FOR CORE 3 CALL C8GIVt«JCH0CL,JCNSIB,JCDUM3.JC0UM2,lJ 1F(JCNSI8.LT.JCDUM2)CALL SYSERR( JCERRC , JCHOCL) ' GO TO (4,6),JCDUH1 ESTABLISHMENT OF USER CORE ASSIGNMENT MASK 4 IAUASL(l)=JCHDCL JCDUH5=JCC0REI8) 00 5 lalrJCDUMS JC0UM6=JCHCCL+I-l 5 JCC0R£tJCDUM6)=0 UPDATING OF THE USER CORE ASSIGNMENT MASK , 6 JCDUM3=(JCHDCL-JCC0RE(9) )/JCC0RE(3) IF( JC0UM3.lt. 0)CALL SYSERR (-3i JCHOCL ) JC0UM4=JCDUH3»JCC0RE(3)+JCC0RE(g| IF(JCDUM4.NE.JCHDCL)CALL SYSERR(-4, JCHOCL) JCDUM3=JCDUM3*l CALL J5MUPD(JC0UH3>JCNSIB.lAUASL(l)tl) IFUCOUMl.cQ.DGO TO 1 THREADING OF THE CORE PER USER REQUEST CALL J3REDY
PAGE 449

437 C c»»»«»» •• »•••• • •• •• c ••••••»••• C • C8C0MB • c •••• • c C PURPOSE C THE PURPOSE OF C8C0MB IS TO ESTABLISH AN AVAILABLE SPACE C LIST STRUCTURE WHEN CALLED EITHER BY COIN OR BY C8GIVE. C C USAGE C CALL CSC0M8(JCCLN0) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCCLNO = A USER SPECIFIED CALL STATEMENT 10. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C THERE ARE NO PASSED PARAMETERS AS ALL INFORMATION REQUIRED C BY C8C0MB IS AVAILABLE FROM THE COMMON CORE. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5IP0T C J5MUPD C J5NEXT C J5RE0Y C J5SAME C J5SAVE C J5TST7 C SYSENT C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM C ^ NONE C C METHOD C WHEN CALLED BY COiNt C8C0MB PREPARES THE CONTINUOUS CORE C FROM THE FIRST ALL0CATA6LE WORD TO THE LAST FOR ALLOCATION. C AN AVAILABLE SPACE LIST IS PREPARED FOR EACH BUDDY SIZE UP C , TO THE USER SPECIFIED MAXIMUM. A BUDDY WILL ALWAYS BE C COMPOSED OF AN INTEGER POWER OF TWO NUMBER OF SEGMENTS. C WHEN CALLED BY CSGIVEf THE AVAILABLE SPACE LISTS ARE C PREPARED FROM THE RETURN MASK. c . c ••••«••••• C SUBROUTINE CBCOHBJ JCCLNQJ COMNCN/ALLOC/JCCORE( 1) CALL SYSENTd, 1,2, If JCCLNO) JCDUMl= IJCCOREJ 2)-JCC0RE( 9 )! ) /JCCOREI 3) JCDUH2=JCCORE(7J C IS CALL BY COIN OR C8GIVE IF(JCC0RE(JCDUM2).GE.0)GO TO 3 C CALL BY COIN JCDUM3 = JCC0RE(6J<-1 JCDUM4=«JCC0RE(5)-l C ZEROING POINTERS TO ASL HEAOCELLS 00 1 I»lrJCDUM3

PAGE 450

438 JC0UM4=JC0UM4*l 1 JCCCRE)G0 TO 6 C DETERMINATION OF FEASIBILITY OF NEXT LARGER BUDDY JCDUM6=JC0UM1-JCDUH3-JCDUM4 IF(JCDJM6.LT.0)GO TO 6 JCDUM6=(JCDUH3-1)/JCDUH4 JCDUM6=(JC0UM6/2)»2-JCDUM6 IF(JCDUH6.LT.0)G0 TO 6 C TEST FOR PRESENCE ON RETURN MASK OF ALL SEGMENTS IN C UPPER HALF OF NEXT LARGER BUDDY JCDUM6=JC0UM3f JC0UH4 JC0UM6=J5TST7(JC0UH6,JCDUMA,JCDUH2,1J IF(JCbUM6.£C.2)G0 TO 6 JC0UMi»=2»JCDUM4 JCDUM5aJCDUM5*l CO TO 5 C ADD THE LAST FEASIBLE AND COMPLETE BUDDY TO ThE C APPROPRIATE AVAILABLE SPACE LIST 6 JC0UM6=(JCDUM3-l)»JCCORE(3)*JCCORE«9) JCDUM5 = JCOUM5*JCCORE( 5 ) CALL J5SAM£tJCDU»7»JCC0RE(JCDUH5)tJCOUM6,l) JCCORE(JC0UM5>=JCDUM6 JCDUM3»JCDUH3+JCDUM4

PAGE 451

439 GO TO 4 ZEROING ALL WORDS OF THE RETURN MASK 7 JC0UMI»JCC0RE<8I 00 8 I=l,JCOUMl JCC0RE(JCDUM2J=0 8 JC0UH2-JC0UM2»l CALL SYSEXT RETURN END

PAGE 452

440 C c*«*«««*«>» • • • • * .•••«•••••» c ••••• C • C8GIVE • C ••• c C PURPOSE C C8GIVE IS RESPONSIBLE FOR SUPPLYING THE SUBPROGRAM LIST C WITH THE NECESSARY BUDDIES OF AVAILABLE CORE TO SATISFY C USER DEMANDS FOR CORE. C8GIVE ALSO WILL AUTOMATICALLY CALL C C8C0MB IN THE EVENT A CORE REQUEST FROM LIST CANNOT BE C HONORED. C C USAGE C CALL C8GIVE(JCH0CL,JCNSIB,JCNOSD,JCMNOStJCCLNOl C C CATA FORMAT C N/A C IC DESCRIPTION OF PARAMETERS C JCHDCL = THE POINTER TO THE FIRST WORD OF A BUDDY C JCNSIB = THE NUMBER OF SEGMENTS IN THE BUDDY C JCNOSD = THE NUMBER OF SEGMENTS DESIRED BY LIST C JCMNOS » THE MINIMUM NUMBER OF SEGMENTS WHICH A BUDDY MUST C CONTAIN TO BE ACCEPTABLE. C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C THIS SUBPROGRAM IS NOT DESIGNED FOR DIRECT CALL BY USER C SUBPROGRAMS. ALL REQUESTS FOR CORE SHOULD BE MADE VIA THE C LIST SUBPROGRAM. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C C8C0MB C J5IP0T C J5SAME C J5SAVE C SYSENT C SYSERR C SYSeXT C C ERROR CODES FOR THIS SUBPROGRAM C CODE FATAL ERRORCOATA PROVIDED) C I F NO AVAILABLE CORE REMAINING (JCMNOS) C C METHOD ,, ,, C IF THE SMALLEST BUDDY SATISFYING THE REQUEST FROM LIST IS C EITHER AVAILABLE OR CAN BE MANUFACTURED FROM A LARGER C BUDDY, THEN THIS SMALLEST BUDDY HILL BE ISSUED TO LIST, C IF ONLY BUDDIES SMALLER THAN THE REQUESTED SUE ARE C AVAILABLE, THE LARGEST OF THESE WILL BE PASSED TO LIST C PROVIDING IT CONTAINS AT LEAST JCMNOS SEGMENTS. IF NO C ACCEPTABLE BUDDY IS AVAILABLE, C8GIVE CALLS CSCOMB AND THE C SEARCH FOR AN ACCEPTI8LE BUDDY IS REPEATED. A SECOND C FAILURE TO HONOR THE LIST REQUEST FOR CORE TERMINATES C PROGRAM EXECUTION. C c •»••••••.• C r SUBROUTINE CBGIVEI JCHDCL, JCNSIB, JCNOSD, JCMNOS, JCCLNO)

PAGE 453

441 COMMON/ ALLOC/JCCORE( 1 ) CALL SYSENT(l,l,2,2,JCCLN0J JCDUHI«0 JC0UM2=JCC0RE(2l)+l C CALCULATION OF SIZE OF BUDDY JUST SATISFYING REQUEST JCDUM3= J5IP0TI JCNOSD, 2i 1 ) IF(JC0UM3.GT.JCC0RE(6) »JC0UM3xJCC0RE(6J JC0UM^=2««JCDUH3 1 JC0UM5=2 JC0UM63JC0UH3 JCNSIB=JCDUM4 JC0UH7=O 2 JCDUM8=JCC0RE(5)*JC0UH5 C CHECKING ASL FOR AVAILABILITY OF BUDDY JCHDCL=JCCORE( JC0UM8 ) IFIJCHCCL.NE.OGO TO 7 GO TO «6,3f
PAGE 454

442 C C • • c ••«.»•.».. C • BSTLNK • C ••• c C PURPOSE C THIS SUBPROGRAM PERMITS THE SETTING OF THE BACKWARD LINK C OF A GIVEN LIST ENTRY C C USAGE . C CALL BSTLNK(IAUASL,JCPOFP,JCBLNK,JCCLNOJ C C DATA FORMAT ^ C N/A C C DESCRIPTION OF PARAMETERS _ ^^ C lAUASL = A VECTOR CONTAINING THE POINTER TO THE USER'S CORE C ASSIGNMENT MASK, THE POINTER TO THE USER'S C AVAILABLE SPACE LIST HEADCELL, THE NUMBER OF LIST C ENTRIES REQUESTEDt THE NUMBER OF WORDS PER LIST C ENTRY, AND LASTLY THE INDEX SPECIFYING THE LIST C TYPE. THE lAUASL ARRAY MUST CONTAIN THESE FIVE C ENTRIES IN THE INDICATED ORDER. lAUASL MAY BE A C COLUMN FROM A MATRIX STORING THE ABOVE INFORMATION C FOR EACH USER MAINTAINED AVAILABLE SPACE LIST. IN C THIS CASE THE PASSED PARAMETER WOULD BE THE MATRIX Q ELEMENT AT THE TOP OF THE COLUMN DESCRIBING THE C PARAMETERS PERTAINING TO THE SELECTED USER ASL. C JCPOFP = THE POINTER TO THE FIRST WORD OF THE LIST ENTRY C JCBLNK = THE VALUE AT WHICH THE BACKWARD LINK IS TO BE SET C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER C C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. ^,, .,„ C SET jCCOREd-V) AT -I IF ALL ERRORS COMMITTED WITHIN BSTLNK C ARE TO BE NONFATAL. THESE ERRORS ARE FATAL OTHERWISE. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5SAME C SYSENT C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM C NONE C C THE LIST MUST BE FORWARD-BACKWARD TO USE THIS SUBPROGRAM. C c •••.»••••• c SUBROUTINE BSTLNK( lAUASL, JCPOFP, JCBLNK, JCCLNOI COMMON/ALLOC/JCCOREC I) DIMENSION IAUASL(5» CALL SYSENTCl, 1,3, I, JCCLNO) JCTOLD = IAUASL(5) C TEST FOR LEGAL JCPOFP CALL J5TSTl(JCP0FP,l) " , ^ C TEST FOR FORWARD-BACKWARD LIST STRUCTURE CALL J5TST3( JCTOLD, JCPOFP, I) JCOUHl=JCCORE( JCTOLD+aO )*5

PAGE 455

443 CALt J5SAM6 TO SET THE LINK CALL J5SAHE(JC0UMi.JCBLNK,JCP0FP.l) CALL SYSEXT RETURN END

PAGE 456

444 C ,.. C*>***>»>*«« • • • ••o»«««.««« c • C • COPY • c .••••••• c C PURPCSE C THE PURPOSE OF COPY IS TO TRANSFER ALL OR ONLY A PART OF C THE INFORMATION STORED IN ONE LIST ENTRY TO ANOTHER LIST C ENTRY. C C USAGE . C CALL COPYIIAUASL.JCPOFPtJCPOSPtLOCALiJCCLNOI C C DATA FORMAT C N/A C ' C DESCRIPTION OF PARAMETERS C lAUASL = A VECTOR DESCRIBED IN THE BSTLNK DOCUMENTATION C JCPOFP = THE POINTER TO THE FIRST WORD OF THE LIST ENTRY Q CONTAINING THE INFORMATION TO BE TRANSFERRED C JCPOSP = THE POINTER TO THE FIRST WORD OF THE LIST ENTRY C TO RECEIVE THE INFORMATION C LOCAL = A USER SUPPLIED VECTOR INDICATING THE DATA TYPES r FOR TRANSFER. THE FIRST WORD INDICATES THE NUMBER C OF DIFFERENT DATA TYPES, AND IS FOLLOWED BY THAT C NUMBER OF SETS OF THREE WORDS EACH. THE FIRST OF C A THREE WORD SET IS THE DATA TYPE NUMBER FOR THE C LIST TYPEt WHILE THE REMAINING TWO WORDS ARE WORD r INDICES STATING THE FIRST AND LAST DATA ITEM OF C THE CURRENT TYPE FOR TRANSFER. IF THE THIRD WORD r OF THE SET IS ZERO, THE LAST ITEM TRANSFERRED WILL r BE THE LAST ITEM INDICATED IN THE DATA LOCATION r ARRAY FOR THE CURRENT DATA TYPE. IF LOCALdI IS C -1 NO INFORMATION WILL BE COPIED, AND IF LOCAL(l) C IS ALL OF THE DATA IN JCPOFP WILL BE REPRODUCED C . IN JCPOSP. C JCCLNO « A USER SPECIFIED CALL STATEMENT ID. NUMBER C C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. „ .„„ C TESTING FOR PRIVATE TERMINATION CELLS (PTC) IS, FOR FOHARD C ONLY LISTS, ACCOMPLISHED AUTOMATICALLY. COPYING FROM A PTC C IS NOT A FATAL ERROR, THOUGH IT COULD BE MADE SO BY SETTING C JCCORE(l<^) EQUAL TO +1. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5TSTI C J5TST2 C J5TST4 C LAND C LEOR C LOR C SETLIH C SYSENT C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM C NONE C C METHOD

PAGE 457

445 C THE VECTOR LOCAL DETERMINES THE DATA ITEMS TO BE COPIED. c c ••• c SUBROUTINE COPYCIAUASL.JCPOFP.JCPOSP, LOCAL, JCCLNO) COKMCN/ALLOC/JCCOREd) DIMENSION L0CAL{l),IAUASL(5) CALL SYSENT(l,li3,2,JCCLNO) JCT0L0=IAUASL(5) JCSUE=IAUASL(4) C ARE JCPOFP AND JCPOSP LEGAL CALL J5TST1 JCCORE( JCTOtO*20 ) IF(JCCQRE{JC0UM1>.EQ.2)G0 TO 1 C TESTING JCPOFP AND JCPOSP FOR PTC CALL J5TST2t2,JCT0L0, JCPOFP, I) CALL J5TST2{I,JCT0LD, JCPOSP, 2) 1 JCDUMI=L0CAL(1) C COPY NONE, ALL OR PART JC0UM2=J5TSTA(JC0UM1,IJ GO TO <10'»,2,5),JCCUM2 t COPY ALL, WORD FOR WORD 2 DO 3 I=1^JCSI2E JC0UH2=JCP0SP+l-I JCDUMS^JCPOFP*!-! 3 JCCOREtJCOUM2»=JCCaRE(JCOUM3) GO TO 104 C COPY PART, ONE DATA TYPE AT A TIME 5 00 6 l3l,.JCDUMl C SETTING THE LIMITS FOR THE COPYING DO LOOP FOR THE C CURRENT DATA TYPE CALL S£TLIM(IAUASL,JCPOSP,LOCAL,I,JCMNLH,JCHXLM,JCSHFT,JCMASK,ll JCDUM2=JCSHFT»JCMASK JC0UM3=JCP0FP-JCP0SP C THE COPYING OPERATION, ONE DATA ITEM AT A TIME FOR C . EACH DATA TYPE 00 6 J=JCMNLM,JCMXLH JC0UM5=J*JC0UH3 JC0UH*=JCC0RE(JC0UM5) IF(JCCUM2.NE.0)JC0UM«=LANO(JCOUM2,JCDUM*) JC0UM5=JCCORE{J) IF(JC0UM2.NE.0)JC0UM5*LAND« JCDUH2,JC0UM5) JC0UM5=LE0Rl JCDUM5,JCC0RE{ J)) 6 JCC0R£IJ)=L0RCJCDUMA,JC0UM5l 104 CALL SYSEXT RETURN END

PAGE 458

446 C , £•••• •• •.»••.. ••••....»••»•.••••••••••• C • C • FRMCEL • C .»••••«••« C C PURPOSE C THE PURPOSE OF FRMCEL IS TO EXTRACT ALU OR PART OF THE C INFORMATION STORED IN AN INDICATED LIST ENTRY. C C USAGE -> . C CALL FRMCELIIAUASL.JCPOFP, LION, LOCAL, JCCLNO) C . C DATA FORMAT C N/A C DESCRIPTION OF PARAMETERS C lAUASL = A VECTOR DESCRIBED IN THE BSTLNK DOCUMENTATION C JCPOFP » THE POINTER TO THE FIRST WORD OF THE LIST ENTRY C CONTAINING THE DESIRED INFORMATION C LION = A VECTOR INTO WHICH THE DATA EXTRACTED FROM THE C INDICATED LIST ENTRY IS STORED. THE DATA ITEMS C EXTRACTED ARE PLACED IN LION IN THE ORDER THEY C ARE EXTRACTED. C LOCAL « A VECTOR INDICATING THE DESIRED DATA ITEMS. SEE C THE DOCUMENTATION FOR COPY FOR A COMPLETE r DESCRIPTION OF LOCAL. C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER C f* RPMARkS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C REQUESTING INFORMATION FROM A PTC IS NOT FATAL. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5TSTI C J5TST2 C J5TST4 C LAND . C SETLIM C SYSENT C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM C NONE C C THE VECTOR LOCAL DETERMINES THE DATA ITEMS WHICH ARE TO BE C EXTRACTED FROM THE LIST ENTRY AND REPRODUCED IN THE VECTOR C LION. C c •• •• c SUBROUTINE FRMCELC lAU/ISL, JCPOFP, LION, LOCAL, JCCLNOI COMHON/ALLOC/JCCOREC I) DIMENSION LIONdl, LOCAL (I), IAUASL( 5) CALL SYSENTU, 1,3,3, JCCLNOJ JCTCLD=IAUASL(5) JCSIZE=IAUASL(A) C IS JCPOFP LEGAL CALL JSTSTK JCPOFP, I) JCDUMl=LOCAL(l)

PAGE 459

.447 JC0UM2=JCC0RE( JCTOLD+20 ) IS LIST STRUCTURE FORWARD OR FORHARO-BACKHARO IF(JCCORE(JCOUH2}.E0.2)GO TO 1 IS JCPOFP A PTC CAUL J5TST2(2,JCT0L0,JCP0FP,l) EXTRACT NONEt ALL OR PART 1 JC0UM3=J5TST4(JCCUH,l,l) GO TO «10'f,2t5),JCDUH3 EXTRACT ALL, A WORD AT A TIME 2 DO 3 I=^^JCSI^e JCDUM3=JCP0FP«-I-l 3 LION(I)=JCCORE( JCDUM3) GO TO 104 EXTRACT PART, ONE DATA TYPE AT A TIME 5 JCDUM2=0 00 6 I=l»JCOUMl SETTING THE LIMITS FOR THE DATA EXTRACTION 00 LOOP FOR THE CURRENT DATA TYPE CALL SETLIMtlAUASL, JCPOFP, LOCAL, I, JCMNLM,JCMXLM,JCSHFT,JCMASK, II 00 6 J=JCHNLM,JCMXLH THE DATA EXTRACTION OPERATION, ONE DATA ITEM AT A TIME FOR EACH DATA TYPE JCDUM2»JCDUM2*1 LI0NIJC0UM2)=JCC0RE(J) 6 IF(JCMASK.NE.0)LION(JC0UM2)=LAND(JCMASK,LION(JC0UM2)y:JCSHFT) 104 CALL SYSEXT RETURN END

PAGE 460

448 C •.„•..••. C******* • ••••• • • c •*• C FSTLNK • c ••* •• c c ''"'^''Jhis subprogram permits the setting of the forward link C OF A GIVEN LIST ENTRY. c C CALL FSTLNKlIAUASLfJCPOFP,JCFLNK,JCCLNO» C C DATA FORMAT C N/A I °""J"Air=°A ;E??SrDEtcRIBED IN THE BSTLNK DOCUMENTATION C JCPOFP = THE POINTER TO THE FIRST WURO OF THE LIST ENTRY C JCFLNK » THE VALUE AT WHICH THE FORWARD LINK IS TO BE SET C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER c C "^^^^THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5SAHE C J5TSTI C SYSENT C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM C NONE C C METHOD C SELF EXPLANATORY C c •• •• SUBROUTINE FSTLNK t lAUASL, JCPOFP, JCFLNK, JCCLNO) COMMON/ALLOC/JCCOREI I) DIMENSION IAUASL(5» CALL SYSENT(1,1.3,4,JCCLN0) C TEST FOR LEGAL JCPOFP CALL J5TSTl(JCP0FP,l) JCTCL0aIAUASL(5) JC0UHl=JCCORE( JCTOLO+20 )+l C CALL JSSAHE TO SET THE LINK CALL J5SAME(JC0UHl, JCFLNK, JCPOFP,!) CALL SYSEXT RETURN END

PAGE 461

449 C c»»»»» ..•...•..•..».• • .»•..••• •••• c •••• C • J5C0MP • c ••••• c C PURPOSE C J5C0MP COMPARES GIVEN DATA AGAINST THE CONTENTS OF A LIST C ENTRY AS PER A LOCAL VECTOR. C C USAGE C CALL J5COMP(JCSPUR,JCP0FP,LI0N,LOCALiJC0OFS,JCINDCtJCCLN0) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCINOC = FOR MATCH FAILURE OR I FOR MATCH SUCCESS C FOR THE REMAINING PARAMETERS SEE LOCATE. NOTE THAT JCSPUR C IS THE lAUASL. C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST. FOR SOME MACHINES. C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5TST4 C SETLIM C SYSENT C SYSERR C SYSEXT C C ERROR CODES FOR THIS PROGRAM C COCE FATAL ERROR(OATA PROVIDED) C I NF LOCAL! I) » -1 (JCPOFP) c" C MEtHOD C SEE LOCATE. c ' . c ••.»..••• c SUBROUTINE J5C0MP( JCSPUR. JCPOFP, LION. LOCAL .JCOOFS.JC I NDCJCCLNO) COMKON/ALLOC/JCCOREd) DIMENSION LION! I), LOCAL! U.JCSPURt I J INTEGER SFT C ENTER CALL SYSENT(l.l.3.15.JCCLN0) C NONE. ALL OR PART OF DATA JCINDC=0 Ml=LOCAL(l) M2=»J5TST4(Ml,l) H3=0 GO TO (1.2.4).H2 C NONE 1 CALL SYSERRd. JCPOFP) GO TO 8 C ALL 2 Ml=JCSPUR(4) DO 3 1=1. Ml H2=JCP0FP»I-l 3 IF(JCCORE
PAGE 462

450 PART 4 M4-0 M5=0 00 6 I'>I,H1 SETTING LIMITS FOR 00 LOOP CALL SETLIM(JCSPUR,JCPOFP,LOCALtI|HINtHAX,SFTiMSKflJ COMPARE 00 5 J=HIN,HAX M'tsK'V+l M6=JCC0RE(J» IF(MSK.NE.0)M6=LAN0(HSK,M6/SFT» 5 IF
PAGE 463

•451 C c»« ••• •• ••••• •• • • •• c C • J5INCX • c •• »• c C PURPOSE C THE FUNCTION J5IN0X DETERMINES THE USER AND RETURN MASK C KORO INDEX CORRESPONDING TO A SPECIFIED CORE SEGMENT. C C USAGE C JSINDX(JCSNUM,JCCLNOi C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C • JCSNUM = THE SEGMENT NUMBER. THE SEGMENTS ARE NUMBERED C CONSECUTIVELY STARTING WITH THE FIRST SEGMENT OF C THE ALLOCATABLE CORE. C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. • , C THE AOVANCEC USER MAY USE THIS FUNCTION WHEN ESTABLISHING C A USER RETURN MASK FOR PARTIAL CORE RETURN. FOR THE MOST C PART THIS FUNCTION IS NOT INTENDED FOR USER UTILIZATION. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C SYSENT C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM C NONE C SEE SUBPROGRAM ERROR FOR A COMPLETE SYSTEM ERROR LISTING. C C METHOD C THE WORD INDEX IS BASED ON MASK WORDS CONTAINING ONE LESS C BIT THAN THE ACTUAL COMPUTER WORDS POSSESS. THE FIRST WORD C FOR A MASK CARRIES THE LARGEST WORD INDEX, AND ITS BITS C CORRESPOND TO THE ALLOCATABLE SEGMENTS HAVING THE LARGEST C SEGMENT NUMBERS. THE FIRST BIT OF MASK WORD INDEX I C REPRESENTS THE FIRST ALLOCATABLE SEGMENT. C c •.••••»•» c FUNCTION J5INDX( JCSNUM, JCCLNO) COMMON/ALLOC/JCCORE( 1) CALL SYSENTd, 1,3, 16, JCCLNO) C CALCULATION OF THE WORD INDEX J5INDX=JCSNUH/( JCCORE( l)-l) JCDUMl=J5INDX«( JCCORE(l)-l) C ADJUST J5INDX IF CORRECT BIT IS THE LAST MASK HORO C BIT IF(JCOUM1.EC.JCSNUM)GO TO IDA J5INDX=J5IN0X+l 104 CALL SYSEXT RETURN END

PAGE 464

452 C €•••••••>•••••• • • •••..••» •••• •••« C ••••• C • J5IP0T • C • •••• c C PURPOSE C THE FUNCTION J5IP0T CALCULATES THE INTEGER EXPONENT OF TWO C CORRESPONDING TO A SPECIFIED NUMBER OF SEGMENTS. C C USAGE C J5IP0TCJCN0FStJCL0ST,JCCtN0) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCNOFS = NUMBER OF SEGMENTS C JCLOST » A PARAMETER USED TO INDICATE IF TWO TO THE J5 1 POT C POWER IS TO BE LESS THAN OR EQUAL TO JCNOFSt OR C IS TO BE GREATER THAN OR EQUAL TO JCNOFS. JCLOST C WILL BE 1 IF THE FORMER IS DESIRED, OR 2 IF THE C LATTER IS DESIRED. C JCCLNO « A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C THIS FUNCTION MAY BE UTILIZED BY THE USER. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C SYSENT C SYSEXT C C ERROR CODES FOR THIS SUBPROGRAM C NONE c • C METHOD C SELF EXPLANATORY C C •••• c FUNCTION J5IP0T
PAGE 465

453 C .. €•••••••••• ••••.. •• ...•*...• ••• ••«••• C •• C • J5MUP0 • c •• ••• c C PURPOSE C THE SUBROUTINE J5MUP0 UPDATES A USER CORE ASSIGNMENT MASK C UPON ADDITIONAL ALLOCATION Of CORE TO THE USER. C C USAGE ». C CALL J5MUPD(JCSNUM,JCN0FSf JCFWOM.JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSNUM = THE SEGMENT NUMBER OF THE FIRST SEGMENT OF THE C BUDDY ISSUED TO LIST BY C8GIVE TO SATISFY THE C USER'S REQUEST FOR CORE C JCNOFS = THE NUMBER OF SEGMENTS IN THE BUDDY C JCFWOH = THE FIRST WORD OF THE USER CORE ASSIGNMENT MASK C JCCLNO » A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C THIS SUBPROGRAM IS NOT INTENDED FOR USER UTILIZATION. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J51N0X C LOR C SYSENT C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM C * NONE C C METHOD C THE USER'S MASK EMPLOYS HOROS CONSISTING OF ONE BIT PER C WORD LESS THAN THE ACTUAL COMPUTER WORDS POSSESS. c c •..••••••• c SUBROUTINE J5MUPD( JCSNUM, JCNOFS, JCFWOM,JCCLNO» COMMON/ ALLOC/JCCORE( I » CALL SYSENTd, 1,3, 18, JCCLNO) C OBTAIN MASK WORD INDEX JCDUM1 = J5IN0X< JCSNUM, I ) JCDUM2=t JCCOREC U-l)»( JCOUMl-U JCDUK3=2»»( JCSNUM-JC0UM2-n C HOW MANY BITS CAN BE SET IN THIS MASK WORD JCDUM<»=JCCORE( I )-JCSNUM+JC0UM2 JCDUM5=JCFH0M+JCC0RE18»-JC0UMI JCDUM2='0 I JCDUM6=JCN0FS-JCDUM2 ^ ,^^ C DOES THIS WORD CONTAIN ALL BITS WHICH MUST BE SET IF(JCDUM4.LT.JCCUM6)JC0UM6=JCOUM* JCDUM7=JCDUM3»i 2»»JCDUM6-1 ) C MASK UPDATE ONE WORD AT A TIME JCC0RE(JCDUM5)=L0R(JCC0RE(JCDUM5),JCDUM7) JCDUM5=JCDUM5-l

PAGE 466

:454 JC0UM2 = JCIXJM2*JCDUM6 JCDUM3=1 JCOUM^=JCCORE(l)-l MUST ADDITIONAL BITS BE SET IF(JC0UM2.LT.JCN0FS»GO TO I CALL SYSEXT RETURN END

PAGE 467

455 C ,,, , C« .o««..»..» ••• • • •• c C • J5NEXT • C •• c C PURPOSE C THE FUNCTION J5NEXT PROVIDES C8C0HB WITH THE SEGMENT NUMBER C OF THE NEXT SEGMENT INDICATED ON THE RETURN MASK. C C USAGE C J5NEXTIJCSNUM,JCFW0M,JCCLN0J C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSNUM = THE SEGMENT NUMBER OF THE FIRST SEGMENT TO BE C CHECKED FOR OCCURRENCE ON THE RETURN MASK C JCFHOM =» THE FIRST WORD OF THE RETURN MASK C JCCLNO =» A USER SPECIFIED CALL STATEMENT ID. NUMBER C C '^ THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C JCFHOM IS A PASSED PARAMETER AS AN ADVANCED USER MAY C UTILIZE THIS FUNCTION FOR MASK MANIPULATIONS. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5INDX C LAND C SYSENT C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM C NONE C C THE BITS OF THE RETURN MASK ARE INSPECTED INDIVIDUALLY C STARTING hITH THE BIT CORRESPONDING TO JCSNUM. IF THE END C OF THE MASK IS REACHED WITHOUT FINDING A SEGMENT PRESENT, C J5NEXT IS SET AT ZERO. C c •..»..••• c FUNCTION J5NEXT I JCSNUM, JCFWOH, JCCLNO) COMMON/ ALLOC/JCCOREl 1) CALL SYSENm,lf3, 19, JCCLNO) C DETERMINATION OF RETURN MASK WORD INDEX JC0UMl=J5INDX( JCSNUM, I ) JC0UM2=UCC0RE( l)-l)»I JCDUMl-1) C JC0UM3=BIT MASK JCDUM3'=2»«( JCSNUH-JCDUM2-1 ) JC0UH4=JCC0RE{1)-JCSNUM*JCDUM2 JC0UM5= JCFWOM+JCCOREI 8 )-JCDUMl J5NEXT=JCSNUM JC0UM6=(JCC0RE(2)-JCC0RE(9)*1)/JCC0REC3) C HAS ThE END OF THE RETURN MASK BEEN REACHED 1 IFCJ5NEXT.LE.JCDUM6)G0 TO 2 " C THE END HAS BEEN REACHED J5NEXT»0 10* CALL SYSEXT

PAGE 468

456 RETURN CHECKING A BIT OF THE RETURN MASK 2 JC0UM7=LAND(JCC0RE(JC0uM5),JC0UM3) lFtJCDUM7.NE.0)G0 TO lOA PREPARE TO CHECK NEXT BIT J5NEXT"J5NEXT*l JCDUH4=JCCUH'V-l 1F(JCDUM4.LE.0)G0 TO 3 JC0UM3=2»JCDUM3 GO TO 1 ADVANCING TO NEXT WORD OF RETURN MASK 3 JCDUM3=1 JCDUH<»=JCCORE(l)-l JC0UH5=JCDUM5-l GO TO 1 END

PAGE 469

.457 C ,,.,C •• •.».•••«••• .»•.••.••• .•.«..•..•••• ••• c .••......• C • J5NUM8 • C •••«•••••• c C PURPOSE r THE FUNCTION J5NUMB PROVIDES THE CALLING PROGRAM MITH THE Q NUMBER OF UNITS CONTAINING AT LEAST A SPECIFIED NUMBER OF C ELEMENTS. C C USAGE C J5NUMB(JCNUHR,JCDN0M,JCCLN0) c • C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCNUMR = THE NUMBER OF ELEMENTS C JCDNOM = THE NUMBER OF ELEMENTS PER UNIT C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER Cf pCMADKC C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C SYSENT C SYSEXT C . C ERROR CODES FOR THIS SUBPROGRAM C NONE C C METHOD C SELF EXPLANATORY C c •••• c FUNCTION J5NUH8(JCNUMR, JCDNOM, JCCLNO) COMMCN/ALLOC/JCCOREd) CALL SYSENT(l,l,3t20, JCCLNO) J5NUMB= JCNUMR/ JCDNOM JCDUMl=J5NUHB» JCDNOM lF(JCNUHR.GT.JCCUHl)J5NUMB=J5NUMa*l CALL SYSEXT RETURN END

PAGE 470

458 C , , ,•,••.. €•••••• ••••••••• • C •••••••»»• C • J5RE0Y • c •••• c C PURPOSE C THE SUBROUTINE J5REDY IS CALLED BY THE SUBPROGRAM LIST TO C PREPARE A FORWARD THREADED. LIST FROM THE BUDDY OF CORE C PROVIDED BY C8GIVE. C C "^*'^CALL JSREOYIJCNOCT.JCNOFS.JCSIZE.JCTOLO.JCHDCL.JCPHCL, C JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCNOCT = THE NUMBER OF CELLS THREADED BY J5RE0Y. ON THE C PASSED. A CELL IS A LIST ENTRY. C JCNOFS = THE NUMBER OF SEGMENTS IN THE BUDDY C JCSIZE = THE NUMBER OF WORDS PER LIST ENTRY C JCTOLO = THE TYPE OF LIST EMPLOYED BY THE USER C JCHOCL = THE POINTER TO THE FIRST WORD OF THE BUDDY C JCPHCL = THE POINTER TO THE FIRST WORD OF THE PREVIOUSLY i THREADED BUDDY, OR TO THE HEADCELL OF THE USER'S C AVAILABLE SPACE LIST. C JCCLNO " A USER SPECIFIED CALL STATEMENT ID. NUMBER c C '*^'^*THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE. C COMMON STATEMENT. ^^ ,,.,,.xTnK. C THIS SUBPROGRAM IS NOT RECOMMENDED FOR USER UTILIZATION. C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5SAME C SYSENT C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM C NONE C C """JSe LIST ENTRIES ARE PREPARED ACCORDING TO USER C . SPECIFICATIONS AND FORWARD THREADED. C c •••••••••• ** SUBROUTINE J5REDY( JCNOCT, JCNOFS, JCSIZE, JCTOLD, JCHOCL, JCPHCL, I JCCLNO) COMMON/ ALLOC/JCCORE( i; CALL SYSENT( 1, 1,3, 21, JCCLNO) C HOW MANY LIST ENTRIES ARE CONTAINED IN THE BUDDY JCDUM1= I JCNOFS* JCCORE( 3))/ JCSIZE IF(JC0UM1.EQ.0)G0 TO 104 JCNOCT* JCNOCT* JCDUMl JCDUM2=JCCORE(JCTOLD*20)+1 JCDUM3=JCHDCL IFCJCDUMl.EQ.DGO TO 2 JCDUM1=»JCDUMI-1

PAGE 471

459 C LINKING THE LIST ENTRIES CONTAINED IN THE BUDDY 00 I I>l*.JCDUHl JCOUM4"JC0UM3 JCDUM3=JC0UM3*JCSIZE 1 CALL J5SAMeiJC0UM2,JCDUM3,JC0UM<»,l) C LINKING CURRENT LIST ENTRIES TO THOSE ALREADY C EXISTING 2 CALL J5SAMElJCOUM2iJCPHCLtJC0UH3t2) JCPHCL=JCHOCL 104 CALL SYSEXT RETURN END

PAGE 472

460 C £••••••• •••••••••••••• ••••••••••.••••.••••••••••••• C •••••••••• C • J5SAME • C •••• • c C PURPOSE C TH6 SUBROUTINE J5SAME SETS AN INDICATED LINK AT A SPECIFIED C VALUE. C C USAGE C CALL J5SAHE(JCFW0Lf JCLINK.JCPOFPtJCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCFHDL = THE POINTER TO THE FIRST OF FOUR WORDS DESCRIBING C THE LINK LOCATION WITHIN A LIST ENTRY C JCLINK » THE VALUE TO WHICH THE LINK IS TO BE SET C JCPOFP = THE POINTER TO THE FIRST WORD OF THE LIST ENTRY C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C THIS SUBPROGRAM IS NOT INTENDED FOR USER UTILIZATION. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5SAVE C LEOR C LOR C SYSENT C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM C NONE C C METHOD C THE LINK LOCATION ARRAY PROVIDES THE WORD INDEX, SHIFT AND C BIT MASK NECESSARY TO LOCATE THE BITS OF THE LIST ENTRY C SERVING AS THE LINK. C c •••••••••• C SUBROUTINE J5SAME(JCFW0L. JCLINK, JCPOFP, JCCLNOJ COMMON/ALLOC/JCCOREd) CALL SYSENT(l,l,3,22,JCCLNO) C SHIFTING LINK TO CORRECT POSITION JC0UMl=JCLINK»JCC0RElJCFW0L+2) JCDUM2=JCP0FP+JCCORE(JCFW0LJ-I C SECURING CURRENT LINK JCDUH3=J5SAVE
PAGE 473

461 C c»»«» .•.•••*.••.». • .». • ••••••••••••••« c ••• C • J5SAVE • C ••• • c C PURPOSE C THE PURPOSE OF THE FUNCTION J5SAVE IS TO RETRIEVE A LINK C FROM A LIST ENTRY. C C USAGE C JSSAVEIJCFWCL.JCWOROtJCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCFHOL = THE POINTER TO THE FIRST OF FOUR WORDS DESCRIBING C THE LINK LOCATION WITHIN A LIST ENTRY C JCWORO * THE POINTER TO THE LIST ENTRY WORD CONTAINING THE C LINK C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C THIS FUNCTION IS NOT INTENDED FOR USER UTILIZATION. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REOUIREO C LAND C SYSENT C SYSEXT C C ERROR CODES FOR THIS SUBPROGRAM C NONE C C METHOD C THE LINK LOCATION ARRAY PROVIDES THE SHIFT AND BIT MASK C NECESSARY TO LOCATE THE BITS OF THE LIST ENTRY WORD C SERVING AS THE LINK. C c • c FUNCTION J5SAVE(JCFW0LtJCWORDtJCCLNO) COMMON/ ALLOC/JCC0RE( I > CALL SYSENTd, 1,3, 23, JCCLNO) JCDUMl=JCCORE( JCFWCL+3) C RETRIEVING THE LINK J5SAVE=JCC0RE« JCWORD) IF(JC0UH1.NE.0)J5SAVE=LAND(JCDUM1.J5SAVE/JCC0RE(JCFMDL«2)> CALL SYSEXT RETURN END

PAGE 474

.462 C £••••••• ..»•*•.• •....••...»»•••••.»• ».••..»«• c ••• C • J5TSTI • C ••••••••«• c . . C PURPOSE . » ,„ C THE PURPOSE OF THIS SUBPROGRAM IS TO TEST THE POINTER TO C THE FIRST WORD OF A LIST ENTRY, BUDDY OR SEGMENT FOR BEING C GREATER THAN OR EQUAL TO THE FIRST ALLOCATABLE WORD OF CORE C AND FOR BEING GREATER THAN THE LAST WORD OF COMMON CORE C . C USAGE C CALL J5TST11JCP0FP,JCCLN0) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCPOFP = THE POINTER TO THE FIRST WORD OF A LIST ENTRY, C BUDDY OR SEGMENT C JCCLNO « A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C THIS SUBPROGRAM MAY BE UTILIZED BY THE USER. C . ' C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C SYSENT C SYSERR C SYSEXT C C ERROR CODES FOR THIS SUBPROGRAM C CODE FATAL ERRORtOATA PrtOVIDEO) C 1 F ILLEGAL JCPOFP < JCPOFP J C C METHOD C SELF EXPLANATORY C c •••••.•••• c SUBROUTINE J5TST11 JCPOFP, JCCLNO) COMMON/ALLOC/JCCOREt 1) CALL SYSENT(l,1.3,24,JCCLNOI IF(t JCPOFP. LT.JCC0REt9)). OR. t JCPOFP. GT.JCC0RE(2)))CALL SYScRR( 1 -I, JCPOFP) CALL SYSEXT RETURN END

PAGE 475

463 £•••••••••••••••• .•.••..••«•••«••#.••••• ••• .«.»•.. Q •»•••»»»•» C • 45TST2 • C ...••••••• c C PURPOSE C THE PURPOSE OF SUBROUTINE J5TST2 IS TO TEST A LIST ENTRY C FOR A FORWARD LINK OF +1 INDICATING I T TO BE A PTC. C C USAGE C CALL J5TST2«JCWRITtJCT0LD,JCP0FP,JCCLN0J C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCWRIT = A PARAMETER EITHER I OR 2 AS DATA IS DIRECTED TO C OR FROM A LIST ENTRY RESPECTIVELY C JCTOLD » A PARAMETER INDICATING THE TYPE OF LIST EMPLOYED C JCPOFP = THE POINTER TO THE FIRST WORD OF THE LIST ENTRY C JCCLNO = A USER SPECIFIED CALL STATEMENT 10. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C THIS SUBPROGRAM MAY BE UTILIZED BY THE USER WITH DUE CARE C TO PROVIDE THE APPROPRIATE JCWRIT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C ERROR C J5SAME C J5SAVE C SYSENT C SYSERR C SYS6XT C C ERROR CODES FOR THIS SUBPROGRAM C CODE FATAL ERROR(OATA PROVIDED) C I NF JCPOFP IS A PTC (JCPOFP) C C METHOD C A FORWARD LINK OF +1 INDICATES A PTC. C c ••».•»•••• SUBROUTINE J5TST2( JCWR IT, JCTOLD, JCPOFP , JCCLNO) COMfON/ALLOC/JCCORE« I) CALL SYSENTd. 1,3, 25, JCCLNO) JC0UM1=JCC0REIJCT0LD*20)*1 JCDUM2=JCPOFP+JCCORE(JC0UMl)-l C SECURING THE FORWARD LINK JCDUM3=J5SAVE(JCDUMl,JCDUM2,l) C IS THE LIST ENTRY A PTC IFCJCDUM3.NE.1)G0 TO 104 C CALL ERROR IF JCWRIT =2 IF! JCWR1T*EQ.2)CALL SYSERR* I, JCPOFP) C SET FORWARD LINK TO IF JCWRIT =1 IFt JCWRIT. EQ. I) CALL J5SAME I JCDUMI.P, JCPOFP, 1) 10* CALL SYSEXT RETURN END

PAGE 476

464 C C>»***>»«»«*«*«*«a»>»«»««« •••••••••••••••••••••••••••••••••< C •• C • J5TST3 • C •..••••... c C PURPOSE C THE PURPOSE OF J5TST3 IS TO TEST A LIST TYPE FOR A FORWAROC BACKWARD LINK STRUCTURE. c C USAGE C CALL J5TST3(JCTOLO,JCPOFP,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCTOLO = A PARAMETER INDICATING THE TYPE OF LIST EMPLOYED C JCPOFP = THE POINTER TO THE FIRST WORD OF AN APPROPRIATE C LIST ENTRY C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C THIS SUBPROGRAM MAY BE UTILIZED BY THE USER. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5TST6 C SYSENT C SYSERR C SYSEXT C C ERROR CODES FOR THIS SUBPROGRAM C CODE FATAL ERROR (DATA PROVIDED) C IF FORWARD-ONLY LIST (JCTOLO) C C METHOD C THE FIRST WORD OF THE LINK LOCATION ARRAY FOR EACH LIST C TYPE IS X OR 2 AS THE LIST IS FORWARD ONLY OR FQRWAROC BACKWARD RESPECTIVELY, c c •••••••••• c SUBROUTINE J5TST3( JCTOLD, JCPOFP, JCCLNOJ COMKON/ALLOC/JCCOREJ 1) CALL SYSENT(lfl.3i26, JCCLNO) JC0UMl=J5TST6J JCTOLO, 1) IF(JCDUMl.EC.l ) CALL SYSERR C-1, JCTOLO) CALL SYSEXT RETURN END

PAGE 477

465 C c • C • J5TST4 • C •...«••••. c C PURPOSE C THE PURPOSE OF THE FUNCTION J5TSTA IS TO DIRECT A DATA C TRANSFER OPERATION TC TRANSFER NONE, ALL OR PART OF THE C INFORMATION AS THE VALUE OF J5TST4 IS I, 2 OR 3 C RESPECTIVELY. C C USAGE C J5TSTA(JCCANP,JCCLN0» C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCCANP =» THE FIRST WORD OF THE LOCAL ARRAY C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C J5TST4 IS NOT RECOMMENDED FOR USER UTILIZATION. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C SYSENT C SYSEXT C C ERROR CODES FOR THIS SUBPROGRAM C NONE C C METHOD • C LOCALU) HAY BE -I, OR ANY POSITIVE NUMBERt WHICH J5TST4 C TRANSLATESTO 1, 2 OR 3 RESPECTIVELY. C c •••••>•••• c FUNCTION J5TST4(JCCANP, JCCLNO) COMKON/ALLOC/JCCOREU) CALL SYSENTCl,l,3,27.JCCLNO) J5TST4=3 IF ( JCCANP. LT.0)J5TST4=1 IF ( JCCANP. E0.O)J5TSTA=2 CALL SYSEXT RETURN END

PAGE 478

466 C c»*»>«»*>»»««*»****»*»>**<** ••.•.....•..••••..•...*•••••..•• c ••••• C • J5TST5 • c C PURPOSE C THE SUBPROGRAM J5TST5 TRACES THROUGH A LIST USING THE C INOICATEC LINK, CHECKING THE CONTINUITY OF THE LIST BETWEEN C TWO INDICATED LIST ENTRIES. C C USAGE C CALL J5TST5(JCP0FP,JCP0SP,JCTOLD,JCWLNK,JCCLNO> C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCPOFP = THE POINTER TO THE FIRST WORD OF THE LEADING LIST C ENTRY C JCPOSP = THE POINTER TO THE FIRST WORD OF THE TRAILING LIST C ENTRY C JCTOLO = A PARAMETER INDICATING THE TYPE OF LIST EMPLOYED C JCWLNK = A PARAMETER EITHER 1 OR 2 AS RESPECTIVELY THE C FORWARD OR BACKWARD LINK IS TO BE USED FOR THE C TRACE. C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C THIS SUBPROGRAM MAY BE UTILIZED BY THE USER. C THE TERMS LEADING AND TRAILING ARE DEFINED WITH RESPECT TO C THE TRACE DIRECTION SPECIFIED BY JCWLNK. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5TST1 C J5SAVE C SYSENT C SYSERR C SYSEXT C C ERROR CODES FOR THIS SUBPROGRAM C CODE FATAL ERROR(OATA PROVIDED) C IF ATTEMPTED BACKWARD TRACE ON FORWARD-ONLY LIST C (JCTOLD) C 2 F LACK OF CONTINUITY (ADDRESS OF LAST LIST ENTRY) C C METHOD C THE FIRST TEST PERFORMED WOULD EXPOSE A REQUEST FOR A C BACKWARD TRACE THROUGH A FORWARD ONLY LIST AND CARRIES THE C ERROR CODE JCERRC. A TEST WITH THE ERROR CODE INCREMENTED C lOR CECREMENTEO* ACCORDIMG TO THE SIGN OF JCERRC) BY I C CHECKS EACH LIST ENTRY FOR BEING THE LIST END. A THIRD C TEST, THIS TIME WITH JCERRC INCREMENTED (OR DECREMENTED) C BY 2, CHECKS THE LEGALITY OF THE FIRST WORD OF EACH LIST C ENTRY ENCOUNTERED. c . c •..•..•••• c SUBROUTINE J5TST5( JCPOFP, JCPOSP, JCTOLO, JCWLNK, JCCLNO) COMMON/ ALLOC/JCCORE ( 1 )

PAGE 479

467 CALL SYSENTCltlf3.28,JCCLN0) JCOUMl=JCPdFP JCOUM2=JCCORE(JCTQLD*20) TESTING FOR LEGAL TRACE DIRECTION JC0UM3=JCCORE«JC0UM2) IF(JC0UH3.LT.JCWLNK)CALL SYSERR(-1. JCTOLO) JC0UM2 = JC0UM2*l+^»lJC>JLNK-l) CALL J5TSTl(JCP0FP,l) 1 JC0UM5=JCDUMltJCC0RE« JC0UM2)-l SECURING THE LINK JCDUH5»J5SAVEtJC0UM2iJCDUM5il) IF(JCP0SP.GT.1»G0 TO 2 1F(JCDUK5.GT.I)G0 TO 3 JCPCSP=JCCUHl CO TO 104 TESTING FOR PTC OR LIST END 2 IFIJCDUMS.LE.DCALL SYSERR {-2t JCDUHl) IF«JCDUM5.E0.JCP0SP)G0 TO 4 3 JC0UM1=JC0UM5 TESTING FOR LEGAL LIST ENTRY FIRST WORD CALL J5TST1(JC0UH1,2) GO TO 1 4 CALL J5TSTl(JCP0SPt3) 104 CALL SYSEXT RETURN END

PAGE 480

468 c c«»»»»» .»..•..•• •....•••••».. c C • J5TST6 • C ••.••••••. c C PURPOSE C THE PURPOSE OF THE J5TST6 FUNCTION IS TO PROVIDE THE C CALLING PROGRAM WITH THE VALUE OF THE PARAMETER INDICATING C IF THE LIST IS FORWARD ONLY OR IS FORWARD-BACKWARD THREADED C C USAGE C J5TST6(JCT0LDtJCCLN0) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCTOLD = THE PARAMETER INDICATING THE TYPE OF LIST EMPLOYED C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS ^ C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C SYSENT C SYSEXT C C ERROR CODES FOR THIS SUBPROGRAM C NONE C C METHOD C THE FIRST WORD OF THE LINK LOCATION ARRAY FOR EACH LIST C TYPE IS I OR 2 AS THE LIST IS FORWARD ONLY OR FORWARDC BACKWARD RESPECTIVELY. c • c •.•.•...•• c FUNCTION J5TST6(JCT0L0, JCCLNO) COMKQN/ALLQC/JCCOREJl) CALL SYSENTtl,l,3,29,JCCLN0) J5TST6='JCC0RE« JCTOLC*20 ) J5TST6=JCC0RE(J5TST6) CALL SYSEXT RETURN END

PAGE 481

469 C c»*«***»» • »t»»..«. #..•• c .«......»• C • J5TST7 • C • • c C PURPOSE C THE FUNCTION J5TST7 TESTS THE RETURN MASK FOR THE PRESENCE C OF ALL BITS CORRESPONDING TO A PARTICULAR BUDDY. C C USAGE C J5TST7(JCSNUM,JCN0FStJCFW0M,JCCLN0) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSNUM = THE SEGMENT NUMBER OF THE FIRST SEGMENT OF THE C 8UCDY C JCNOFS =» THE NUMBER OF THE SEGMENTS IN THE BUDDY C JCFWOM = THE POINTER TO THE FIRST WORD OF THE RETURN MASK C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C THIS FUNCTION MAY BE UTILIZED BY THE USER AS JCSNUM NEED C NOT BE THE FIRST SEGMENT OF A BUDDY, NOR DOES JCFWOM NEED C BE THE POINTER TO THE FIRST WORD OF THE RETURN MASK. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5INDX C LAND C SYSENT C SYS6XT C C ERROR COOES FOR THIS SUBPROGRAM C NONE ' C C METHOD C J5TST7 IS VALUED AT 1 IF ALL SEGMENTS OF THE BUDDY ARE C PRESENT ON THE RETURN MASK, OTHERWISE J5TST7 IS 2. C c ••••.•••.. c FUNCTION J5TST7(JCSNUM, JCNOFS, JCFWOM, JCCLNO) COMKON/ALLOC/JCCORE( I ) CALL SYSENT( I, 1,3, 30, JCCLNO) J5TST7=l C CALCULATING THE MASK WORD INDEX JC0UMl=J5INDXt JCSNUM, I) JCDUM2a(JCC0RE(l)-l)»t JCDUMl-l) C CALCULATING THE SHIFT JC0UM3=2«»( JCSNUM-JCDUM2-1 ) JCDUM<,= JCC0REt I )-JCSNUM*JC0UM2 JC0UM5=JCFW0M*JCC0RE{a)-JCDUMl JC0UM2=0 1 JC0UM6=JCN0FS-JCDUM2 IFUC0UM4.LT.JCDUM6)JCDUM6 = JCDUM4 C CALCULATING THE SHIFTED MASK JC0UM7»JC0UM3»(2»»JC0UM6-l) C THE TEST

PAGE 482

470 JC0UM8=LAND(JC0UM7,JCC0RE
PAGE 483

471 C €•••••••• • ••• «••• •••• ...»•» C •..•.»•»•• C • LNKBWO • c .•••....•• c C PURPOSE C THE FUNCTION LNKBWO EXTRACTS FROM A SPECIFIED LIST ENTRY C THE BACKWARD LINK. C C USAGE C LNK8W0«IAUASL,JCP0FP,JCCLN0) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C lAUASL = A VECTOR DESCRIBED IN THE BSTLNK DOCUMENTATION C JCPOFP = THE POINTER TO THE FIRST WORD OF THE LIST ENTRY C JCCLNO = A USER SPECIFIED CALL STATEMENT 10. NUMBER C C REMARKS C THE NUMBER REPRESENTED 8Y JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5SAVE C J5TST1 C J5TST3 C SYSENT C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM C NONE C C METHOD C THE LIST STRUCTURE MUST BE FORWARD-BACKWARD TO USE THIS C FUNCTION. C c ••• c FUNCTION LNKBWD( lAUASLt JCPOFP, JCCLNO) CbHMCN/ALLOC/JCCORE( I) DIMENSION IAUASL(5> CALL SYSENT (I, I, 3, 5, JCCLNO) JCT0L0=IAUASL«5) C TEST FOR LEGAL JCPOFP CALL J5TSTl«JCP0FP,n C TEST FOR FORWARD-BACKWARD LIST STRUCTURE CALL J5TST3(JCTOLD, JCPOFP, I) JC0UM1=JCC0RE( JCTOLD+20>+5 JC0UM2='JCP0FP+JCC0R6( JCOUMl)-l C CALL J5SAVE TO GET THE LINK LNKawD=J5SAVE(JCDUMl,JCDUM2,I) CALL SYSEXT RETURN END

PAGE 484

472 C £•••••••••• •• ••••••• •••••• • •••••• C •••• C • LKKFMO • C ••• • c C PURPOSE C THE FUNCTION LNKFWD EXTRACTS FROM A SPECIFIED LIST ENTRY C THE FORWARD LINK. C C USAGE C LNKFWD(IAUASL,JCPOFP,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C lAUASL = A VECTOR DESCRIBED IN THE 8STLNK DOCUMENTATION C JCPOFP = THE POINTER TO THE FIRST WORD OF THE LIST ENTRY C JCCLNO = A USER ASSIGNED CALL STATEMENT ID. PARAMETER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5SAVE C J5TSTI C SYSENT C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM C NONE C C METHOD • C FOR FORWARD ONLY LISTSt LNKFWD CHECKS TO SEE IF THE LIST C ENTRY FOLLOWING JCPOFP IS A PTC. A PTC WOULD BC RETURNED C TO THE USER'S AVAILABLE SPACE LIST AND THE FORWARD LINK OF C JCPOFP WOULD BECOME ZERO. THE VALUE OF LNKFWD IN THIS CASE C MOULD BE ZERO. C c •••••••••• c FUNCTION LNKFWOCIAUASL, JCPOFP, JCCLNO) COMMON/ ALLOC/JCCOREJ I) DIMENSION IAUASL(5) CALL SYSENT{l,l,3,6,JCCLN0» JCT0LD=IAUASL«5) C TEST FOR LEGAL JCPOFP CALL J5TST1(JCP0FP,1) JCDUMl=JCCORE(JCTOL0*20)*l JCDUM2=JCP0FP*JCC0RE(JCDUH1)-1 C CALL J5SAVE TO GET THE LINK LNKFWD=J5SAVE( JCDU^^1,JCCUM2,1) JCDUM2=JCC0RE« JCOUMl-1 ) C RETURN IF LIST IS FORWARD-BACKWARD OR IF JCPOFP IS C THE LIST END OR A PTC IF((JC0UM2.EQ.2).OR.(LNKFWC.LE.l))GO TO 104 C TEST FOR LEGAL LNKFWD CALL J5TST1 (LNKFWD, 2) JCDUM2=LNKFWD JCCOREC JCOUMl )-l JCDUM3=J5SAVE(JC0UM1,JCDUM2,2)

PAGE 485

473 RETURN IF LIST ENTRY FOLLOWING JCPOFP IS NOT A PTC IFIJCDUM3.NE.1)G0 TO 104 RETURNING THE PTC TO THE USER ASL CALL J5SAMEUC0UM1,IAUASL«2),LNKFHD,I) IAUASL(2)=LNKFW0 CALL J5SAME(JCDUMl,0f JCP0FP,2) LNKFWO=0 104 CALL SYSEXT RETURN END

PAGE 486

474 C c»»»««» .•••• ••••. •••.•».•••••••.•••••.• ••• c ••••• C • LOCATE • C ••••• c C PURPOSE C THE SUBROUTINE LOCATE SEARCHES A LIST IN A SPECIFIED C DIRECTION FOR THE LIST ENTRY CONTAINING CERTAIN DATA ITEMS C AT SPECIFIED VALUES. C C USAGE C CALL LOCATE(IAUASL,JCPOFPiJCPOSP,LION,LOCALf JCOOFS.JCCLNO) C C CATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C lAUASL = A VECTOR 0ESCRI8E0 IN THE BSTLNK DOCUMENTATION C JCPOFP = THE POINTER TO THE FIRST WORD OF THE LIST ENTRY AT C WHICH THE SEARCH IS TO COMMENCE C JCPOSP = THE POINTER TO THE FIRST WORD OF THE LIST ENTRY C CONTAINING THE SOUGHT AFTER DATA ITEMSi OR IF THE C SEARCH FAILS ZERO C LION = A VECTOR CONTAINING THE VALUES OF THE DATA ITEMS C OF INTEREST C LOCAL = A VECTOR INDICATING THE DESIRED DATA ITEMS. SEE C THE DOCUMENTATION FOR COPY FOR A COMPLETE C DESCRIPTION OF LOCAL. C JCOOFS = A PARAMETER EQUAL IN MAGNITUDE TO 1 1 2 OR 3 AS C RESPECTIVELY IT IS DESIRED THE SEARCH PROCEED IN C THE FORWARD DIRECTION ONLY, BACKWARD DIRECTION C ONLY OR THE SEARCH IS TO ENCOMPASS ALL LIST C ENTRIES ACCESSIBLE FROM JCPOFP. IF JCDOFS IS C NEGATIVE, THEN THE SEARCH IS SUCCESSFUL IF ANY C DATA TYPE DESCRIBED IN THE LOCAL VECTOR MATCHES C THE CORRESPONDING VALUES INDICATED IN LION. HERE C A CATA TYPE MEANS A THREE WORD DATA TYPE C DESCRIPTION FROM LOCAL AND MAY INVOLVE SEVERAL C WORDS OF DATA. WHEN JCDOFS IS NEGATIVE, THE C PARTICULAR DATA TYPE FOUND TO MATCH IS RETURNED TO C THE USER VIA THE JCDOFS PARAMETER. FOR A POSITIVE C JCDOFS ALL DATA TYPES IN THE LOCAL ARRAY MUST C MATCH AND THE PARAMETER JCDOFS REMAINS UNCHANGED. C JCCLNO » A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5C0MP C J5TST6 C LAND . C LNKBWO C LNKFMO C SETLIM C SYSENT . C SYSERR C SYSEXT C C ERROR CODES FOR THIS SUBPROGRAM

PAGE 487

475 C CODE FATAL ERRORJ DATA PROVIDED J C I NF JCPOFP IS A PTC (JCPOFP) C C THE SEARCH PROCEDURE IS INDICATED BY JCDOFS. FOR FORWARD C ONLY LISTS A TEST FOR A PTC IS CONDUCTED ON EACH LIST ENTRY C ENCOUNTERED. NO BACKWARD SEARCH ON A FORWARD ONLY LIST IS C POSSIBLE. IF JCDOFS IS 3 IN MAGNITUDE THE SEARCH INITIALLY C PROCEEDS FORWARD AND IF UNSUCCESSFUL FOR A FORWARD-BACKWARD C LIST WILL SEARCH BACKWARD FROM THE SAME INITIAL STARTING C POINT. C c ••• c SUBROUTINE LOCATE ( lAUASL, JCPOFP, JCPOSP, LION, LOCAL, JCDOFS, JCCLNO) COMMON/ ALLOC/JCCOREI II DIMENSION LION 11), LOCAL (U.IAUASLI 5) CALL SYSENT(I,1,3,7,JCCLN0» JCPCSP='0 JCDU12=IADS(JCD0FS) JC0UMl=2 IS LIST FORWARD ONLY OR FORWARD-BACKWARD JCDUH2=J5TST6CIAUASL(5»,l> JCDUM3=JCP0FP SEARCH FORWARD OR BACKWARD lF(JCDU12.dC.2)G0 TO I FORWARD JCDUM4=LNKFWD( IAUASL,JCDUM3,l) IS JCPOFP A PTC IF«JCDUM4.E0.1JCALL SYSERRd, JCPOFP I JCOUMl=l GO TO 2 BACKWARD 1 JCDUM4=LNKBW0(IAUASL,JCCUH3,1) 2 CALL J5C0MP( IAUASL,JCDUM3, LION, LOCAL, JCDOFS, JCDUM5,1> 1F(JCDUM5.EQ.0)G0 TO 10 SUCCESS JCPCSP=JCDUH3 104 CALL SYSEXT RETURN FAILURE 10 IFIJCDUM4.LE.1)G0 TO 13 PREPARING TO INSPECT NEXT LIST ENTRY JCDUH3=JCDUM4 IF1JCDUH1-EC.2)G0 TO I 11 JCDUM4=LNKFWD(IAUASL,JCDUM3,2) GO TO 2 END OF LIST X3 IF((JCDUM1.E0.2).OR.(JCDU12.EQ.I).OR.( JCDUM2.EQ.l>)G0 TO 10* REVERSE DIRECTION OF SEARCH JCDUM1»2 JC0UM4=LNKBWD( lAUASL, JCPOFP, 3) GO TO 10 • END

PAGE 488

476 C c ••<* •• •»...»••..••••••••••••••• ^ ••••••••• C • NEWCEL • C C PURPOSE ., . C THE SUBPROGRAM NEWCEL PROVIDES THE CALLING PROGRAM WITH A C LIST ENTRY FOR ITS USE, WHILE PLACING THE FORHAKO LINK OF C THIS LIST ENTRY AS THE HEADCELL OF THE USER'S AVAILAOLE C SPACE LIST. C C USAGE C CALL NEHCEHIAUASLf JCnWCL.JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C lAUASL = A VECTOR DESCRIBED IN THE 8STLNK DOCUMENTATION C JCNWCL = THE POINTER TO THE FIRST WORD OF THE NEW LIST C ENTRY C JCCLNO « A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS . , ^ C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C LIST C LNKFWO C SYSENT C SYSEXT C . . C ERROR CODES FOR THIS SUBPROGRAM C NONE C C METHOD . C NEWCEL SETS JCNWCL EQUAL TO THE AVAILABLE SPACE LIST C HEADCELL ANC THEN REPLACES THE HEADCELL BY THE FORWARD LINK C OF THE FORMER HEADCELL. IF THE ASL HEADCELL IS ZERO, THE C LIST SUBPROGRAM IS SUMMONED TO REPLENISH THE USER'S ASL. C THE FORWARD LINK, AND IF APPLICABLE THE BACKWARD LINK, OF C JCNWCL ARE SET AT ZERO. C c c •••••••••• SUBROUTINE NEWCEL( I AUASL, JCNWCL, JCCLNOI COK^<0N/ ALLOC/JCCOREJ I » DIMENSION IAUASL«5) CALL SYS£NTll,l,3,8,JCCLN0> 1 JCNWCL=IAUASL(2) C IS THE ASL EMPTY IF(JCNWCL.NE.O)GO TO 2 C REPLENISHING THE ASL CALL LIST(IAUASL,1J GO TO I C SETTING THE ASL HEADCELL 2 IAUASL(2)=LNKFWC( I AU*SL, JCNWW. , I) C ZERO EQCH WORD JCDUMI=JCNWCL*IAUASL14)-1 DO 3 l3JCNWCL,JCDUMl

PAGE 489

477 JCCORE(I)-0 CALL SYSEXT RETURN END

PAGE 490

478 C C»»»««>««>»*«a»».<** •••• •••••• C • •»• C • POPUP • c ••••••••• c C PURPOSE C POPUP STORES DATA ITEMS OF A LIST ENTRY IN LION, RETURNS C ALL LIST ENTRIES FROM THIS TO A SECOND NAMED LIST ENTRY TO C THE USER'S -ivAILABLE SPACE LIST, THEN PATCHES THE LINKS TO C PRESERVE THE CONTINUITY OF THE LIST. C C USAGE C CALL POPUP! lAUASLfJCPOFP, JCPOSP, LION, LOCALtJCWLNK.JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C lAUASL * A VECTOR DESCRIBED IN THE BSTLNK DOCUMENTATION C JCPOFP = THE POINTER TO THE FIRST WORD OF THE FIRST LIST C ENTRY TO BE REMOVED FROM THE LIST C JCPOSP = THE POINTER TO THE FIRST WORD OF THE LAST LIST C ENTRY TO BE REMOVED, OR IF ALL LIST ENTRIES FROM C JCPOFP TO THE LIST END ARE TO BE REMOVED C LION = THE VECTOR INTO WHICH THE CONTENTS OF THE FIRST C REMOVED LIST ENTRY ARE STORED C LOCAL = A VECTOR INDICATING THE DESIRED DATA ITEMS. SEE C THE DOCUMENTATION FOR COPY FOR A COMPLETE C DESCRIPTION OF LOCAL. C JCWLNK =» A PARAMETER EITHER I OR 2 AS RESPECTIVELY JCPOFP C PRECEEDS OR FOLLOWS JCPOSP ON THE LIST. THUS C JCWLHK INDICATES WHETHER THE FORWARD OR THE C BACKWARD LINKS ARE TO BE USED FOR THE POPUP C OPERATION. C JCCLNO = A USER SPECIFIED CALL STATEMENT 10. NUMBER C . C REMARKS C THE NUMBER REPRESENTED BY JcTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C FOR A FORWARD ONLY LIST, JCWLNK IS RESTRICTED TO BE I ONLY. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C BSTLNK C COPY C FRMCEL C FSTLNK C J5TST6 C LNKBWO C LNKFWO C RETURN C SETLNK C SYSENT C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM C NONE C C METHOD C THE CONTENTS OF JCPOFP ARE REPRODUCED IN LION ACCORDING TO C LOCAL. IF JCPOSP IS ZERO OR THE LAST LIST ENTRY, AND THE C LIST IS FORWARD ONLY LINKED, JCPOFP IS MADE A PTC ANO ALL

PAGE 491

479 C LIST ENTRIES FOLtOWiNG JCPOFP ARE RETURNED TO THE USER ASL. C FOR THIS SAME JCPOSP WITH A FORHaRD-BACKWARD LIST, THE ABOVE C STATEMENT APPLIES BUT WITH THE FOLLOWING CHANGE. IF A LIST C ENTRY IS ADJACENT TO JCPOFP IN THE DIRECTION OPPOSITE THAT C INDICATED BY JCWLNK, THeN THIS ADJACENT LIST ENTRY IS C RETURNED, WITH ITS CONTENTS COPIED INTO JCPOFP. IF THERE C IS NO ADJACENT LIST ENTRY, JCPOFP IS RETURNED. FOR A C JCPOSP WHICH IS NOT A LIST END, THE CONTENTS OF THE LIST C ENTRY ADJACENT TO JCPOFP IN THE DIRECTION INDICATED BY C JCWLNK ARE COPIED INTO JCPOFP, AND ALL LIST ENTRIES FROM C THIS ADJACENT LIST ENTRY TO THE LIST ENTRY ADJACENT TO C JCPOSP IN THE DIRECTION INDICATED BY JCWLNK ARE RETURNED TO C THE USER ASL. C c ••••••••• c SUBROUTINE POPUP( I AUASLt JCPOFP. JCPOSP, LION, LOCAL t JCWLNK. JCCLNO) COMKON/ALLOC/JCCOREIU DIMENSION LION(l), LOCAL (I), I AUASLC 5) CALL SYSENT(l,l,3,9,JCCLN0) C IS LIST FORWARD ONLY OR FORWARD-BACKWARD JCDUMl=J5TST6( IAUASL15),1» C LOAD DATA FROM JCPOFP INTO LION CALL FRKCEL( lAUASL, JCPOFP, LION, LOCAL. I) JC0UM6=L0CAL(l) L0CAL(1>=0 GO TO (2^1),JC0UKl 1 GO TO (5, 8), JCWLNK C LIST IS FORWARD ONLY 2 JCDUM2=LNKFWD( lAUASL, JCPOFP, IJ IF(JC0UM2.LE.l)GO TO 4 IF(JCPCSP.£0.0)G0 TO 3 JC0UM3=LNKFWD( lAUASL, JCPOSP. 2) IF(JCDUM3.LE.1)G0 TO 3 C TRANSFER ALL DATA FROM THE LIST ENTRY FOLLOWING C JCPOSP INTO JCPOFP CALL COPYI I AUASL,JCDUH3. JCPOFP, LOCAL, I) C RETURN ALL LIST ENTRIES FROM THE ONE FOLLOWING JCPOFP C TO THE LIST ENTRY FOLLOWING JCPOSP CALL RETURN(IAUASL.JCDUM2,JCDUM3,1) GO TO 11 C RETURN ALL LIST ENTRIES FROM JCPOFP TO THE LIST END 3 JCDUM3=»0 CALL RETURN(IAUASL.JCDUM2.JCDUM3.2) C JCPOFP IS MADE A PTC 4 CALL FSTLNKdAUASL. JCPOFP, 1,1) JCPCFP=0 JCPOSP=»0 GO TO 11 C JCPOFP PRECEEDS JCPOSP 5 JCDUH2 = LNKFWDnAUASL,JCP0FP,3) JCDUM3=LNKBWDi lAUASL, JCPOFP, 1) IF( (JCDUM2.E0..)). OR. (JCPOSP. EQ.0))GO TO 6 JCOUM'VsLNKFwOC I AUASL, JCP0SP,4) IF{JC0UH4.EQ.0)G0 TO 6 C RETURN ALL LIST ENTRIES FROM THE ONE FOLLOWING JCPOFP C TO THE ENTRY FOLLOWING JCPOSP JC0UM5''LNKFwD( IAUASL,JC0UM4,5I C TRANSFER ALL CATA FROM THE LIST ENTRY FOLLOWING C JCPOSP INFO JCPOFP CALL COPY ( I AUASL,JCDUM4. JCPOFP, LOCAL, 2 » CALL 8STLNK
PAGE 492

480 1F«JC0UM5.NE.0)CALL BSTLNK(IAUASLtJC0UM5tJCP0FPt2) CALL RETURNl lA'JASLf JCDUH2, JC0UM4| 3) GO TO 11 6 IF(JC0UM3. £0.0)00 TO 7 ....,, C RETURN THE LIST ENTRY PRECEEDING JCPOFPt AND ALL LIST C ENTRIES FaOM THE ONE FOLLOWING JCPOFP TO THE LIST END JC0UH5=LNKBW0( I AUASLi JC0UM3f2t IF(JCDUM5.NE.0)CALL FSTLNK { lAUASL, JC0UH5, JCPOFPt 2» CALL FSTLNK(IAUASL.JCDUM3,0,3) C TRANSFER ALL DATA FROM THE LIST ENTRY PRECEEDING C JCPOFP INTO JCPOFP CALL C0PYMAUASL,JCDUM3, JCPOFP, LOCAL, 31 IF(JC0UM2.NE.0)CALL FSTLNKi lAUASLt JC0UH3, JCDUM2,4) JCDUM2=0 CALL RETURNl IAUASL,JC0UH3,JC0UH2, 4) 60 TO 11 C RETURN THE ENTIRE LIST 7 JCDUM2=0 CALL RETURNdAUASL, JCPOFP, JC0UH2, 5) JCPGFP=0 JCPCSP=0 GO TO 11 C JCPOSP PRECEEDS JCPOFP 8 JCDUM2=LNKBHD( lAUASL, JCPOFP, 3) JC0UM3=LNKFWD( lAUASL, JCPOFP, 6) IF((JCDUM2.EO.0).OR.IJCPOSP.EQ.0))GO TO 9 _ JCDUM'f=LNK8HD{IAUASL,JCP0SP,4) IFIJCOUHV.EG.OGO TO 9 C RETURN ALL LIST ENTRIES FROM THE ONE PRECEEDING C JCPOSP TO THE ENTRY PRECEEDING JCPOFP JCOUM5«LNKBWOIIAUASL,JCOUM^,5) C TRANSFER ALL DATA FROM THE LIST ENTRY PRECEEDING C JCPOSP INTO JCPOFP CALL COPY! I AUASL.JCDUM^,, JCPOFP, LOCAL, 4 » CALL FSTLNK II AUASL, JCPOFP, JCDUM3, 5) IF GO TO 11 9 lF(JCDUH3.Et).0)GO TO 10 C RETURN ALL LIST ENTRIES FROM THE LIST BEGINNING TO C THE ENTRY PRECEEDING JCPOFP, AND RETURN THE LIST C ENTRY FOLLOWING JCPOFP JCDUM5=LNKFWD( IAUASL,JC0UM3,7) IFIJCDUM5.N£.0»CALL BSTLNK ( IAUASL,JCDUM5, JCPOFP, 3) CALL BSTLNKIIAUASL,JCDUM3,0,<»> CALL C0PY(IAUASL,JC0UM3, JCPOFP, LOCAL, 5) IFIJCUUM2.NE.0)CALL SETLNK ( lAUASL, JCDUM2, JCDUM3, 1) JCDUM2=0 CALL RETURNl IAUASL,JCDUM2,JCDUM3, 7) GO TO 11 C RETURN THE ENTIRE LIST 10 JC0UM2=0 CALL RETURNl IAUASL,JCDUH2,JCP0FP,8) JCPOFP=0 11 L0CALll)«JCDUM6 CALL SYSEXT RETURN END

PAGE 493

481 C c»»«»«* .«.»•«. •••»....••••..••.••••.••• •• c C • PUSH • c ••• c C PURPOSE C THE PUSH SUBPROGRAM INSERTS A NEW CELL INTO A LIST AND C SUPPLIES IT WITH DATA FROM A DATA STORAGE VECTOR. C C USAGE C CALL PUSH(IAUASL,JCPOFP, LION, LOCAL, JCPBOA.JCCLNOJ C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C lAUASL = A VECTOR DESCRIBED IN THE BSTLNK DOCUMENTATION C JCPOFP = THE POINTER TO THE FIRST WORD OF THE LIST ENTRY TO C WHICH THE NEW LIST ENTRY IS TO BE ADJCACENT C LION = THE VECTOR CONTAINING THE DATA FOR THE NEW LIST C ENTRY C LOCAL = A VECTOR INDICATING THE DESIRED DATA ITEMS. SEE C THE DOCUMENTATION FOR COPY FOR A COMPLETE C DESCRIPTION OF LOCAL. C JCPBOA = A PARAMETER VALUED AT -2,-1,1, OR 2 AS IT IS C DESIRED THAT THE OPERATION PERFORMED BE INSERT C BEFORE, PUSH UP, PUSH DOWN OR INSERT AFTER C RESPECTIVELY. C JCCLNO = A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C FOR A FORWARD ONLY LINKED LIST, JCPBOA IS RESTRICTED TO C POSITIVE VALUES ONLY. c • C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C BSTLNK C COPY C FSTLNK C J5TST6 C LNKBWO C LNKFHO C NEWCEL C SETLNK C SYSENT C SYSEXT C TOCELL C C ERROR CODES FOR THIS SUBPROGRAM C NONE C C METHOD C FOR THE INSERT MODE OF OPERATION A JCNWCL IS PROCURED AND C PLACED IN THE LIST EITHER BEFORE OR AFTER JCPOFP AS JCPBOA C IS'+2 OR -2 RESPECTIVELY. JCNWCL RECEIVES THE INFORMATION C STORED IN LION. WHEN. JCPBOA IS UNITY IN MAGNITUDE, THE C INFORMATION IN JCPOFP IS COPIED INTO JCNWCL AND THE C INFORMATION IN LION IS TRANSFERRED TO JCPOFP. THE JCNWCL C IS THREADED INTO THE LIST AFTER JCPOFP FOR JCPBOA = +1 AND C BEFORE JCPOFP FOR JCPBOA = -1. IF FOR A FORWARD ONLY LIST

PAGE 494

482 C JCPOFP IS A PTC, THE FORMARO LINK OF JCPOFP IS SET AT ZERO C AND THE INFORMATION IN LION TRANSFERRED TO JCPOFP. SUBROUTINE PUSH( lAUASL, JCPOFP, LION, LOCAL, JCPBOA.JCCLNO) COMMON/ALLOC/JCCOREl I) DIHcNSICN LI0N(l),L0CAL2»JCCUMl-2 JCDUM5=LNKFWC( lAUASL, JCPOFP, 1) IF(JC0UH5.NE.UG0 TO 2 JCDUH4=5 GO TO 4 OBTAIN A NEW CELL 2 CALL NEWCEL«IAUASL,JCNWCL,1) IF ( JCPOFP. EQ.0)JCPOFP=JCNWCL JC0UM6=JCNWCL GO TO (3,5),JCOUM2 PUSH 3 LOCAL! 1)=0 CALL COPY! lAUASL, JCPOFP, JCNWCL,LOCAL,l» L0CAL«n = JCDUM3 4 JCDUM6=JCP0FP INSERT 5 CALL TOCELL( IAUASL,JC0UM6, LION, LOCAL, 1) GO TO {7r6,9,ll,8,l2,l'»).JCDUH4 INSERT AFTER, FORWARD ONLY LIST 6 CALL FSTLNK(IAUASL,JCNWCL,JCDUH5,l» PUSH DOWN, FORWARD ONLY LIST 7 CALL FSTLNKCIAUASL, JCPOFP, JCNWCL, 2) REACTIVATION OF A PTC a CALL SYSEXT RETURN PUSH DOWN, FORWARD-BACKWARD LIST 9 IF(JCDUM5.NE.0)CALL 8STLNK IIAUASL, JC0UM5, JCNWCL,!) 10 CALL SETLNKdAUASL, JCPOFP, JCNWCL, I) GO TO 8 INSERT AFTER, FORWARD-BACKWARD LIST 11 IFUCDUM5.NE.0)CALL SETLNK ( lAUASL, JCNWCL, JCDUM5,2 J GO TO 10 PUSH UP 12 IFCJCDUM5.NE.0)CALL FSTLNK ( lAUASL.JCDUMS, JCNWCL t3» 13 CALL SETLNKIIAUASL,JCNWC1,JCP.0FP,3) GO TO 8 INSERT BEFORE 14 IFCJCDUM5.NE.0»CALL SETLNK (lAUASL.JCDUMS, JCNWCL, 4) CO TO 13

PAGE 495

483 END

PAGE 496

484 €•••• #•••••••••••• • •••••• ..••••.•••.»•• C •• •• C • RETURN • c C PURPOSE C THE PURPOSE OF RETURN IS TO RETURN TO THE USER'S AVAILABLE C SPACE LIST A PORTION OF A LINKED LIST. C C USAGE C CALL RETURN(IAUASL,JCPOFP,JCPOSPtJCCLNOJ C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C lAUASL = A VECTOR DESCRIBED IN THE BSTLNK DOCUMENTATION C JCPOFP = THE POINTER TO THE FIRST WORD OF THE LEADING LIST C ENTRY FOR RETURN, OR ZERO IF ALL ENTRIES FROM C JCPOSP TO LIST BEGINNING ARE TO BE RETURNED C JCPOSP = THE POINTER TO THE FIRST WORD OF THE TRAILING LIST C ENTRY FOR RETURN, OR ZERO IF ALL ENTRIES FROM C JCPOFP TO LIST END ARE TO BE RETURNED C JCCLNO = A USER SPECIFIED CALL STATEMENT 10. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. c C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C FSTLNX C J5TST5 C SYSENT C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM J C NONE C , C METHOD C RETURN TRACES THROUGH THE LIST FROM JCPOFP TO JCPOSP TO C INSURE CONTINUITY OF THE ASL FOLLOWING THE RETURN C OPERATION. C c •• •• c SUBROUTINE RETURN! lAUASL, JCPOFP, JCPOSP , JCCLNO) COMKCN/ALLOC/JCCORE( H DIMENSION lAUASLO) CALL SYSENr«l,l,3,lltJCCLN0) IF(JCPOFP.EQ.O)CALL J5TST5( JCPOSP, JCPOFP, lAUASL 15) ,2,1 » IF ( JCPOFP. NE. JCPOSP )CALL J 5TST5( JCPOFP , JCPOSP, IAUASL(5) ,1 ,2) RETURN UST ENTRIES TO ASL CALL FSTLNKCIAUASL, JCPOSP, IAUASL(2J,l» IAUASL(2)=JCP0FP ' CALL SYSEXT RETURN END -

PAGE 497

485 C c*«*»***> •••• • • • ».•..••••»•« c •••••••••• C • SETLIM • c •••••••••• c C PURPOSE C THE PURPOSE OF SETLIM IS TO PROVIDE THE CALLING PROGRAM C WITH POINTERS TO THE FIRST AND LAST WORD OF A LIST ENTRYt C THE SHIFT AND THE MASK REQUIRED FOR A DATA TRANSFER C OPERATION. c C USAGE C CALL SETLlMdAUASLf JCPOFPtLOCALtJCINDXtJCMNLH.JCMXLM, C JCSHFTtJCHASK,JCCLNOI C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C lAUASL = A VECTOR DESCRIBED IN THE BSTLNK DOCUMENTATION C JCPOFP = THE POINTER TO THE FIRST WORD OF THE INVOLVED C LIST ENTRY C LOCAL = A VECTOR INDICATING THE DATA TYPES FOR TRANSFER. C SEE THE DOCUMENTATION FOR COPY FOR A COMPLETE C DESCRIPTION OF LOCAL. C JCINDX = A PARAMETER INDICATING WHICH OF THE DATA TYPES C LISTED IN THE LOCAL ARRAY IS CURRENTLY BEING C PREPARED FOR THE TRANSFER OPERATION C JCMNLH « THE POINTER TO THE FIRST WORD INVOLVED IN A DATA C TRANSFER OPERATION C JCMXLH = THE POINTER TO THE LAST WORD INVOLVED IN A DATA C TRANSFER OPERATION C JCSHFT « THE SHIFT ASSOCIATED WITH THE DATA TYPE FOR C TRANSFER C JCMASK » THE BIT MASK ASSOCIATED WITH THE DATA TYPE FOR C TRANSFER C JCCLNO ' A USER SPECIFIED CALL STATEMENT ID. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. c C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED CSYSENT C SYSERR C SYSEXT C C ERROR CODES FOR THIS SUBPROGRAM C CODE FATAL ERRORIDATA PROVIDED) C IF NON-POSITIVE LOWER LIMIT IJCINDX) C 2 F LOWER LIMIT EXCEEDS DATA ITEM LIMITS UCINDX) C 3 F LOWER LIMIT EXCEEDS LIST ENTRY SIZE (JCINOXI C 4 F LOWER LIMIT BEYOND BOUNDS OF JCCORE (JCPOFP) C 5 F UPPER LIMITS EXCEEDS DATA ITEM LIMITS IJCINDX) C 5 F UPPER LIMITS EXCEEDS LIST ENTRY SIZE (JCINOXJ C 7 F UPPER LIMIT BEYOND BOUNDS OF JCCORE (JCPOFP) C 8 F LOWER LIMIT EXCEEDS UPPER LIMIT (JCINOX) C C METHOD C ONLY ONE DATA TYPE AT A TIME IS CONSIDERED BY SETLIM. THE C JCINOX PARAMETER INDICATES WHICH DATA TYPE FROM THE LOCAL

PAGE 498

486 C ARRAY IS BEING CONSIDERED. A JCINDX OF I THUS MEANS THE C JCHNLMt JCMXLH. JCSHFT AND JCMASK PARAMETERS ARE TO BE C CALCULATED FOR THE FIRST DATA TYPE OF LOCAL. IF THE DATA C IN THE ENTIRE LIST ENTRY IS TO BE TRANSFERRED AND LOCAL(l) C IS Q, SETLIM SHOULD NOT BE CALLED. C c •••••••••• c SUBROUTINE SETL IMdAUASL.JCPOFP, LOCAL, JCINDX, JCMNLM.JCMXLM, I JCSHFT, JCMASK, JCCLNOJ COMHCN/ALLOC/JCCORE( I) DIMENSION L0CAL(1),IAUASL(S) CALL SYSENTI1,1,3,12,JCCLN0) C SECURING FROM LOCAL THE PARAMETERS DESCRIBING THE C CURRENT DATA TYPE JCDUM3=3«JCINDX-1 M1=IAUASL(5) JCDUHl=JCCORE< Ml+20)*<»*( LOCAL! JC0UM3)-l)*l JC0UM2=l Hl=-2 C SETTING THE MINIMUM LIMIT JC0UMA=LOCAL(JCCUM3tl) IF(JCDUMA.LE.O)CALL SYSERR (-1, JCINDX) 1 JCDUH*=JCC0REtJC0UMl)+JC0UM4-l IF( (JCOUM4.GT.JCCORE(JCOUH14^1I ).ANO.(JCCDRE(JCOUM1^1>.GT.O)) I CALL SYSERR(M1,JCIN0XI Ml=Ml-l 2 IF(JCDUM4.GT.IAUASL(4))CALL SYSERR(M1,JCIN0X) Ml=Hl-l 3 JC0UM4=JCPOFPtJCDUM«-l IF(JCDUH*.GT.JCCaR£«2))CALL SYSERRIMl, JCPOFPI GO TO (4,5),JC0UM2 4 JC0UM2=2 JCHNLM=JCCUM4 C SETTING THE MAXIMUM LIMIT Ml"-5 JCDUM4=L0CAL(JCDUM3*2) IF(JCDUK<».NE.0)G0 TO I JC0UM4=JCCORE(JC0UHUl) Hl=-6 IF(JCDUH4.N£.0)G0 TO 2 JC0UM4=IAUASL(4) Ml=-7 GO TO 3 5 JCMXLM=JC0UM4 IF(JCMNLH.GT.JCMXLM)CALL SYSERR(-8, JCINDX) C SETTING THE SHIFT AND BIT MASK JCSHFT=JCC0RE(JCDUM1*2) JCMASK=JCC0RE(JCDUMlt3) CALL SYSEXT RETURN END

PAGE 499

487 C C* ••••«•• •••••• •••.•« • •••••• c •• •"• C • SETLNK • C •••.•••••• c C PURPOSE C THE PURPOSE OF SETLNK IS TO LINK TWO INDICATED LIST ENTRIES C IN FORWARD-BACKWARD THRiEADEO FASHION. C C USAGE C CALL SETLNK(IAUASLiJCPOFP,JCPOSP,JCCLNO) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C lAUASL =» A VECTOR DESCRIBED IN THE BSTLNK DOCUMENTATION C JCPOFP = THE POINTER TO THE FIRST WORD OF THE LEADING LIST C ENTRY C JCPOSP = THE POINTER TO THE FIRST WORD OF THE TRAILING LIST C ENTRY C JCCLNO = A USER ASSIGNED CALL STATEMENT 10. NUMBER C C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C BSTLNK C FSTLNK C SYSENT C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM C NONE C C METHOD C SELF EXPLANATORY C c ».••••••• c SUBROUTINE SETLNK( lAUASL, JCPOFP, JCPOSP, JCCLNO) COMMON/ ALLOC/JCCOR EH) DIMENSION IAUASL(5) CALL SYSENTll,l,3,13,JCCLN0) IF(JCPOFP.NE.O)CALL FSTLNK{ lAUASL , JCPOFP, JCPOSP,!) IF( JCPOSP. NE.OCALL BSTLNK ( lAUASL, JCPOSP, JCPOFP, I ) CALL SYSEXT RETURN END

PAGE 500

488 C .„..,...•. • C •«•••••••• • ••••••• c •••• C • SYSOHP • c .••••••••• c C PURPOSE C SYSOMP OUTPUTS THE CONTENTS OF THE NAMED COMMON ALLOC. C C USAGE C CALL SYSOMP C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C NONE C C '*^*^*THE NUMBER REPRESENTED BY JCTCIA MUST, FOR SOME MACHINES. C REPLACE THE 1 IN THE NAMED COMMON STATEMENT. C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C NONE C C ERROR COOES FOR THIS PROGRAM C NONE C C METHOD C" SELF-EXPLANATORY X c ••«••••••• c SUBROUTINE SYSOMP C0M«CN/ALLQC/JCC0RE«1» JCCCRE(13)=6 Ml=JCC0RE(9)-I M2sJCC0RE(ll) WRITE{H2,10l) 101 FCRHATdlHlALLOC DUMP) WRITE(M2»102) 102 FORMAT (16H0PRE-ALLCCATABLE) M3=l 1 IF(M<».6T.Ml)M<»=Ml WRlTElM2tlOA)M3,(JCCORE(I)tI=M3,M*) 104 FORKATdH I9,1H>5I22) M3=M3»5 IF(H3.LE.Ml)G0 TO 1 M3=«Ul Ml=JCC0REt2) IFCMS.GT.MDGO TO 2 M4=K3*4 URITE(M2,I05) X05 F0RfAT(l2HaALL0CATABLE» GO TO I 2 IF(JCCCRE(19).GE.0)G0 TO 3 ^ Ml=IA8S(JCC0REI19) ) M2=JCC0RE(2) WRITe(Ml,106)IJCC0RE(II.I«l.M2) 106 FORMAT (41201

PAGE 501

489 3 RETURN END

PAGE 502

490 c ^ ,,.••»••••• c • • ..#•.•••••••••••• ••••• ••• c •••••••••• C • SYSENT • c ••"•• c C PURPOSE C SYSENT RECORDS THE ENTRANCE INTO A SUBPROGRAM. C C CALL SYSENT (JCSYST.JCLEVL.JCPAKG.JCPROG.JCCLNQ) C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C JCSYST = SYSTEM ID NUMBER C JCLEVL = LEVEL ID NUMBER C JCPAKG = PACKAGE 10 NUMBER C JCPROG = PROGRAM ID NUMBER C JCCLNO « CALL NUMBER CC '^^'''JISI NUMBER REPRESENTED BY JCTCIA AND THE DIMENSION OF THE Q JCTRAS VECTOR MUST, FOR SOME MACHINES, REPLACE THE 1«S IN C THEIR RESPECTIVE COMMON STATEMENTS. C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C NONE C C ERROR COOES FOR THIS PROGRAM C NONE C C JCC0RE«12» HOLDS THE CURRENT LEVEL. JCC0RE(13) HOLDS THE C CURRENT LINE POSITION. JCC0RE(20) HOLDS THE TRACE CUT-OFF C LEVEL. IF JCC0RE(12) EXCEEDS JCCORE (20» . NO TRACE MESSAGE C IS PROVIDED. C C ••••••.»•• SUBROUTINE SYSENTt JCSYST, JCLEVL, JCPAKG, JCPROG, JCCLNO) COMMCN/ALLOC/JCCOREC I ) COMMON JCTRAS(l) C RECORD SUBPROGRAM IN JCTRAS Ml=l*5»JCC0RE(l2» M2=JCC0RECI3J JCTaAsiMl)=JCSYST««l/I)*JCLEVL»t2/I)»lI/2)*JCPAKG»«3/I)»tI/3) I JCPR0G»(4/I)»(I/A)«-JCCLNO»(I/5) I Hl=Ml+l C INCREMENT LEVEL JCC0RE«12) = JCC0RE( 12)*1 C TRACE MESSAGE IF(JCC0RE{20).LT.JCC0REU2))GO TO 8 MO=JCCCRE(ll) GO TO (3,*,5,6,7,2),M2 ^ J1rITE=2

PAGE 503

491 WRITE(MO,l02)JCCORE(12)tJCSYST,JCLEVU,JCPAKG,JCPROG,JCCLNO 102 FORI«"AT{lH*20X,lHNI2tlHlI2ilH,I2,lH,I2,lH,I2,lH,12,2H) ) CO TO 8 4 JCCCREtl3)=3 HRlTc(Mafl03)jCC0RE«12),JCSYST,JCLEVL,JCPAKG,JCPR0G,JCCLN0 103 F0RMAT(lH**0X,lHNI2f lH{12,lH,I2,lH,I2,lH,I2tlHtI2i2H) ) GO TO 3 5 JCCCRE(13)^4 HRITE(MO,lOJCCORE(12>,JCSY5T,JCUEVL,JCPAKG,JCPROG,JCCLNO 105 F0RMAT(lH*80X,lHNI2,lH(12,lH,I2,lH,I2,lH,I2tlH,I2,2H) ) GO TO 8 7 JCCCRE(13)=6 WRITE(MO,I06)jCCORc(l2),JCSYST,JCLEVL,JCPAK6,JCPROG,JCCLNO 106 FORMAT(lH»lOOX,lHNI2,lHtI2ilH, I2,1H,12,IH,I2,IH,I2,2H) ) EXIT 8 RETURN END

PAGE 504

492 c •••••••• c •••.•••••• C • SYSERR C •••••••.»• c ^ C PURPOSE C SYSERR PROVIDES AN ERROR MESSAGE. C C USAGE C CALL .SYSERR(JCCOOEtJCOATA) c C DATA FORMAT C N/A C C CESCRIPTION OF PARAMETERS C 4CC0CE = THE ERROR CODE, TWO DIGIT MAXIMUM C JCDATA » ANY INTEGER DATA ITEM TO ASSIST IN DETERMINING THE C NATURE OR CAUSE OF THE ERROR C C REMARKS C SEE REMARKS FOR SYSENT. C C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C NONE C . C ERROR CODES FOR THIS PROGRAM C NONE C C METHOD C SELF-EXPLANATORY C c SUBROUTINE SYSERR (JCCOCE, JCDATA) COMMCN/ALLOC/JCCOREC I) COMMON JCTRAS«l) ,^„, Q SET 00 LOOP LIMITS AND OTHER PARAMETERS M1=JCC0RE(12) MO^'JCCOREIll) H2=IABS(JCC0DE) C ERROR MESSAGE WRITE(M0»100) 100 FORMAT (7H ERROR I HA=«5 DO 6 1=1, Ml M3=I*5»(I-1» M4=K3*^ GO TO (2,3,*.5,l»,MA 1 MA»>1 . WRITE(H0,10HI,«JCTRAS«J),J=H3,M*» , . . 101 F0RMAT«lHt6X,lHNI2,lH(I2,lH,I2,lH,I2,lH,I2,lH,I2,2H» » GO TO 6 2 MA=2 HRITE(M0,102>I,CJCTRAS(J),J=M3,H4J 102 F0RMAT«IH*26X,IHNI2,1H(I2,IH,I2,1H,I2,IH,I2,1H,I2,2H» I GO TO 6 3 MA=3 WRITEJM0,103)I,(JCTRAS
PAGE 505

4 93 jCDUM2 = J5T5T6CJCT0LDil) . „„.,„...„« (. IS LIST STRUCTURE FORWARD ONLY OR FORWARD-BACKWARD IF(JCDUM2.EQ.2)G0 TO 1 C IS JCPOFP A PTC CALL J5TST2«I,JCTOL0,JCPOFPf I) 1 JC0UH2=L0CALtH C STORE DATA IN NONE, ALL OR PART JC0UM3=J5TST4(JCDUH2,U 60 TO (104,2t5) ,JCDUM3 C STORE IN ALL, A WORD AT A TIH6 2 00 3 I=l»JCSI2E jCDUM3=JCP0FPtI-l 3 jCCOREt JCDUM3>=LI0N(I) CO TO 10* C STORE IN PART, ONE DATA TYPE AT A TIME ^ 5 00 6 ^"^••"'^''"j^^^j^g ^^g LIMITS FOR THE DATA STORAGE 00 LOOP FOR C THE CURRENT DATA TYPE CALL^SETLIHdAUASL, JCPOFP. LOCAL, I, JCMNLM,JCMXLM,JCSHFT,JCMASK, I) JCDUH3=JCSHFT»JCMASK 00 6 J=JCMNLM,JCMXLM ,,^^ ., . ,,ue C THE DATA STORAGE OPERATION, ONE DATA ITEM AT A TIME C FOR EACH DATA TYPE JCDUM1 = JCDUM1*^1 JCDUM4=LI0N» JCOUMl ) »JCSHFT JC0UM5=JCCOREU) IF(JCDUM3.NE.0)JC0UM5=LAN0(JC0UM3,JC0UH5) JCDUM5=LE0R(JCDUH5,JCC0RE( J)l 6 JCCCRE(J)=LQR(JC0UK4,JCDUH5) 104 CALL SYSEXT RETURN ENO

PAGE 506

494 C . , ,••••..••.• C«*»»*«*«»*«*«»**" ...•.••••» ••••.. c •• ••• C • TOCELL • c •••• c C ''"'*''?0CELL STORES IN A SPECIFIED LIST ENTRY THE DATA PROVIDED C BY A VECTOR LION. C C CALL TOCELLdAUASL.jCPOFP, LION, LOCAL, JCCLNO) c C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS c-r^ocn r LION A VECTOR PROVIDING THE DATA TO BE STORED C JCPOFP » THE POINTER TO THE FIRST WORD OF THE LIST ENTRY TO C RECEIVE THE DATA ,-,» C JCTOLO = A PARAMETER INDICATING THE TYPE OF LIST EMPLOYED C LOCAL » A VECTOR INDICATING THE LOCATIONS WITHIN THE LIST C ENTRY TO RECEIVE DATA. SEE THc OOCUMcNTATION FOR r COPY FOR A COMPLETE DESCRIPTION OF LOCAL. C JCSUE » THE NUMBER OF WORDS PER LIST ENTRY C JCCLNO » A USER SPECIFIED CALL STATEMENT ID. NUMBER C . C REMARKS C THE NUMBER REPRESENTED BY JCTCIA MUST BE SUPPLIED IN THE C COMMON STATEMENT. C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C J5TST1 C J5TST2 C J5TST* C J5TST5 C LAND C LEOR C LOR C SETLIM C SYSENT C SYSEXT C C ERROR COOES FOR THIS SUBPROGRAM C NONE C C "^^"tSe vector local DETERMINES THE LOCATIONS WITHIN JCPOFP FOR r: THE DATA ITEMS TRANSFERRED FROM LION. IF JCPOFP IS A PTC, C IT BECOMES THE LAST LIST ENTRY OF THE LIST. C — c •••••••••• ** SUBROUTINE TOCELLIIABASL, JCPOFP, LION, LOCAL, JCCLNO) COKMCN/ALL0C/JCCORE( 1) DIMENSION LICNI I ) , LOCALC 1» . lAUASLC 5) CALL SYSENT( I, 1,3, lA, JCCLNO) JCT0LD=IAUASL15) . • JCSI2E=IAUASLU) JCDUMl^O C IS JCPOFP LEGAL CALL J5TST1 (JCPOFP,!)

PAGE 507

49rx WRITE«MO,10«)I.(JCTRAS(J»,J»H3.HM 10* F0RHAT(IH*66X,IHNI2.1H(I2,1H,I2,1H,I2,1H,I2,1H,12,2HJ J GO TO 6 ' WRITEIHO,105)I,IJCTRAS(J).J-H3,H4) 105 F0RHAT«IH*86X,IHNI2,IHII2,IH,12,IH,I2,1H,I2,IH,I2,2HI 1 WRIT6CM0,105» 106 FORKATdH J 6 jCC0Re|RITE(«C,203)M2,JCCATA 203 FORMAT (lH*'»6X,lhE 12, 2H 0115) GO TO 12 10 WRITE(M0»204)M2,JCCATA 20* F0RPATtlH*66X.IHEI2,2H 0115) GO TO 12 11 HRITe(M0,205)H2.JCCATA 205 F0RKAT{1H*86X,1HEI2,2H DH5) C OUKP 12 IF(JCC0RE(19).NE.0)CALL SYSDHP ^,^,, C 1^ iriJi,i. K ^^ ovER-RIOE NON-FATAL IN EFFECT IF(JCCORE11A).GT.O)GO TO 13 C »'-''"-*'^ j5 OVER-RIOc FATAL IN EFFECT IFUCCORE(1*).LT.O)STOP C IS ERROR CODE FATAL 1F(JCCOOE.LT.O)STOP C EXIT 13 RETURN END

PAGE 508

496 C ..., c«**»*>*»«**«> ••••• •••• •••»..••••• c .»•.•••..• C • SYSEXT • c ••.•.•..»» c C PURPOSE C SYSEXT RECORDS THE EXIT FROM A SUBPROGRAM. C C USAGE C CALL SYSEXT C C DATA FORMAT C N/A C C DESCRIPTION OF PARAMETERS C N/A C C REMARKS C SEE REMARKS FOR SYSENT. C SUBROUTINE AND FUNCTION SUBPROGRAMS REQUIRED C NONE C C ERROR COOES FOR THIS PROGRAM C NONE C C METHOD C SYSEXT TURNS THE TRACE ON IF A NEGATIVE JCTRAS WORD IS C ENCOUNTERED. A TRACE MESSAGE IS DISPLAYED IF JCC0REC20) C IS GREATER THAN JCC0R£(12). C c • •••••.».•• c SUBROUTINE SYSEXT COHKON/ALLOC/JCCOREdl COMMON JCTRASll) C ACCESS JCTRAS VECTOR Ml=l*5»-ll M2aMl»4 C TRACE MESSAGE IFIJCCCRE(20).LT.JCCQRE112J)G0 TO 7 MOaJCCORElIl) HA»JCC0RE(13» GO TO (2,3t'».5i6,l),MA 1 JCCCREI13)*! HRITEIK0,101JJCC0RE(12)i(JCTRAS(I)iI=Ml,M2) 101 F0RMAT(2H X 12, 1H( 12, IH, 12, IH, 12, IH, 12, IH, I2i2H) ) GO TO 7 2 JCCCREJ13)=2 ,, HRITE(M0,l02)JCC0RE(l2),{JCTRAS(n,I=Hl,M2) 102 FOaMAT(lH*20X,lHXI2,lHtI2,lH,I2,lH,I2,lH,I2,lH,I2j2H) ) GO TO 7 3 JCC0RE(13)=3 , WRITE{MO,l.03)JCCOREJ12),(JCTRAS(I),I=Ml,M2) 103 FQRHAT(1HK0X,1HX12,1H(I2,1H,I2,IH,I2,IH,I2,XH,I2,2H) ) GO TO 7 4 JCC0RE(13)=4 ^ WRITE{M0,104)JCC0RE(12),(JCTI(AS(I),I=M1,M2) 104 F0RMAT(lHf60X,lHXI2.lH( I2,IH,I2,IH,I2,IH,I2.1H,I2,2H) ) GO TO 7 5 JCC0RE«13)«5

PAGE 509

4 97 HRITEf I»Ml,M2J 105 FORHAT(1H^80X,1HXI2>1H(I2«1H.I2.1H,I2,1H,I2.1H,I2,2H) ) GO TO 7 6 JCC0R£(13)='6 HRITE(M0,l06)JCC0RE(12),(JCTRASCHfI»Ml,H2J 105 FORMATllH*l0OX,lHXI2,lH(I2,lH,I2ilH,I2ilHtl2tlH,I2t2H) I DECREf^eNT LEVEL 7 JCCCRE(12)=JCC0RE(12)-1 EXIT RETURN END

PAGE 510

APPENDIX B In its current version, there is no incentive for employing indexed variables and equations with GENDER. However, this will no always be the case. Memory and CPU time savings offer a strong incentive for the solution of such problems as pattern recognition. Since research is currently pursuing the index related problems, it was felt that ample justification existed for the inclusion of software within GENDER to provide an indexing capability. The indices permitted in both SECEDE and the GENDER list are each composed of seven components. The components are data types 9 through 15 for both list types 1 (SECEDE) and 2 (GENDER list). The LEND's must be devised to permit the storage of all seven components in a single word. The incentive for the complexity of the seven part index is a mechanism we shall call mapping. Mapping will in turn facilitate the implementation of the GENDER equivalent of FORTRAN DO loops. Let us consider an index i and an index j . Index i maps to index j if i is a function j i.e. i = F(3). Thus, an output variable index may be a mapping of an equation index. If the equation index is permitted a range of values, the variation of the output variable index (as a consequence of mapping) will be automatic. Index ranges in GENDER are permitted by. the inclusion of a minimum index and a maximum index. Index ranges are allowed for equations, ER's, constraints and groups. This feature is expected to be of considerable 498

PAGE 511

499 importance in reducing the analysis effort and storage requirements for multistage processing units. For the purpose of considering the combination of the seven components into a single index value," let us identify the data fields 9 through 15 by the letters a through g respectively. Components a and b identify the index to be employed in the mapping calculation. When a is 1, b is the depth of the group supplying the index. Depth specifies the particular group in a cascade of dimensioned groups. When a is 2, b specifies the particular equation, ER or constraint index to be used. Indices are numbered in the order of appearance in the group body. When a is 3, b refers to an index of the same entity for which the index calculation is to be performed. That is, an equation index may be a function of another index of the same equation. ; Using a and b, a mapping index j is selected. This j is related to i by the relationship. X = j*(-l)**d*(e**(-l)**c) + (-l)**f*g in which the FORTRAN operator symbols are employed. When use of a mapping index is not desired, the components a through f will all be valued at zero. To illustrate the use of this relationship, let us consider a numberical example. Suppose that we have a dimensioned output variable, one index, i, of which is one larger than the second function index, j. The seven components for the output variable index would be (2, 2, 0, 0, 1, 0, l), to yield i = 3 + I Each group on a GENDER list is permitted one index. Two words are reserved for the group index and are employed to store the minimum and maximum index values in the seven part format. This feature imparts the character of a DO statement to the dimensioned group. Since groups

PAGE 512

are permitted on the group bodies of other groups, a cascade of DO loops can be simulated on a GENDER list. The group indices are numbered for identification in the order of encounter in descending from the outermost group to the innermost group. This number is termed the depth of the group. Note that undimensioned groups encountered in descending from group to inner group do not contribute to the depth computation. Also note that index calculations stipulating a mapping onto a group index will employ the current value of the group index. Current values to group indices are stored in the vector provided by CUDGEL when creating the crude GENDER list. We shall consider a particular group at depth 3, with a current index value k. Let us continue our numberical example by assuming that j is four less than one half the index k for the group at depth 3. In this case, the seven components would be (l, 3, 1, 0, 2, 1, 4), giving the* relation 3 = V2 4 Finally, assuming that k does not map onto another group index, the seven components representing k would be (0, 0, 0, 0, 0, 0, k). If k is valued at 8, then the mappings stipulate values of 4 and 5 for j and i respectively.

PAGE 513

APPENDIX G

PAGE 514

502 122 110 111 103 107 109 112 108 101 104 123 118 132 131 130 129 128 127 126 125 3 124 3 121 3 115 3 119 3 120 3 116 113 105 3 106 3 102 104 103 101 102 112 111 109 108

PAGE 515

3 114 3 117 3 105 3 113 105 -I 1 2 3 5 6 7 8 9 110 106 107 -7 1 2

PAGE 516

APPENDIX D

PAGE 517

aus 1 132 301 302 303 304 2 3 4 5 6 7 8 9 10 11 12 13 3 103 3 203 3 303 3 403 123 114 113 116 223 19 18 21 323 27 26 29 423 35 34 37 43 42 45 3 511 108 208 308 408 505

PAGE 518

506 I 2 1 3 1 4 I 5 I 6 3 121 3 122 3 115 3 15 3 114 3 16 3 14 3 113 3 17 3 116 3 123 3 221 3 222 3 20 3 23 3 19 -I 1 2 3 4 5 103 104 109 105 101 102 106 107 110 111 112 203 204 209 205 201 202

PAGE 519

507 24 3 22 3 18 3 25 3 21 3 223 3 321 3 322 3 28 3 302 3 27 3 32 3 301 3 26 3 304 3 29 3 323 3 421 3 422 3 36 3 39 206 207 210 111 112 303 304 309 305 301 302 306 307 310 311 312 403 404 409 405

PAGE 520

508 3 35 3 40 3 38 3 34 3 41 3 37 3 423 3 43 3 44 3 508 3 42 3 45 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 401 402 406 407 410 411 412 501 502 504 503 506 -5 1 2 3 4 5 6 7 8 9 10 11 12

PAGE 521

13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 I 28 1 29 I 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 I 44 1 45 1 46 1 47 1 48 1 49 13 14 IS 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48

PAGE 522

BIBLIOGRAPHY Barkley, R. W. and R. L. Motard, "Decomposition of Nets," NATO Institute on Decomposition, Cambridge, England (July, 1972). Christensen, J. H., "The Structuring of Process Optimization," AIChE J., 16(2), pp. 177-184 (1970). Cooper, D. C. and H. Whitfield, "ALP: An Autocode List-Processing Language," The Computer Journal, 5(28), (1962/3). DeBrosse, C. J., "Feasible-point and Optimization Algorithms for Structured Design Systems in Chemical Engineering," Ph.D Dissertation, pp. 67-84, University of Florida (1971). Edie, F. C. , "Convergence and Tearing Algorithms for Solving Structured Systems of Design Equations in Chemical Engineering," Ph.D. Dissertation, pp. 20-27, University of Florida (1970). Edie, F. C. and A. W. Westerberg, "Computer Aided Design, Part 3," Chem. Engng. J., 2, pp. 114-124 (1971). Gupta, P.K. , "Application of Analysis and Optimization Techniques for Structured Systems to the Design of a Double Effect Evaporator System," Master's Thesis, University of Florida (1972). Kevorkian, A. K. and J. Snoek, "Decomposition in Large Scale Systems, Parts I and II," NATO Institute on Decomposition, Cambridge England (July, 1972). Knuth, D. E., "The Art of Computer Programming, Vol. 1," Addison-Wesley Pub. Co., Reading, Mass. (1968). ^ Lee, W. and Y. Ozawa, "Complex Chemical Engineering Systems," Chem. Engng. Educ, 5(2), pp. 144-145 (1971). Mah, R. S. H. and M. Rafal, "Automatic Program Generation in Chemical Engineering Computation," Trans. Instn. Chem. Engrs., 49, 101-108 (1971). Sargent, R. W. H. and A, W. Westerberg, "'SPEED-UP' in Chemical Engineering Design," Trans. Instn. Chem. Engrs., 42.(5), pp. T190-197 (1964). Scylemez, S., "Computer Generated Fortran Programs to Prepare Material and Energy Balances for Process Units," Ph.D. Dissertation, Univ. of Pennsylvania (1971). Soylemez, S. and W. D. Seider, "A New Technique for Precedence-Ordering Chemical Process Equation Sets," 71st National Meeting of the AIChE, Dallas, Texas (1972). 510

PAGE 523

BIOGRAPHICAL SKETCH James Richard Cunningham was born on January 14, 1942, in Houston, Texas, to Carl D. and Annette E., Cunningham. He was graduated from Destrehan High School at Destrehan, Louisiana, in June, 1959. In June, 1963, he was awarded the Bachelor of Science degree in chemical engineering from Louisiana State University. Following graduation from Louisiana State University, he accepted a position at Texaco, Inc., in the Domestic Producing Department (Gas). His duties at Texaco involved primarily the operations aspects of the Paradis, Louisiana, natural gas recycling facility. This employment was terminated in January, 1964 for induction into the United States Air Force. He served four years as an egress system specialist, attaining the final grade of SSGT prior to honorable discharge. After discharge, he was ' employed at the Shell Chemical Company plant in Norco, Louisiana^ as a technologist. In addition to providing technical support to plant operations personnel, he developed a computer simulation program modeling a reaction-distillation unit in the steady state. In September, 1968, he elected to pursue graduate study at the University of Florida. He received the degree of Master of Engineering in chemical engineering in June, 1970. James Cunningham is married to the former Eleanor Gayle Kincaid of Nashville, Tennessee. They are the parents of one son, Sean Carl, in whom they are well pleased. 511

PAGE 524

I certify that I have read this study and that in my opinion it conforms to acceptable standards of scholarly presentation and is fully adequate, in scope and quality, as a dissertation for the degree of Doctor of Philosophy. Arthur W. Westerberg,/t!hairman Associate Professor of Chemical Engineering I certify that I have read this study and that in my opinion it conforms to acceptable standards of scholarly presentation and is fully adequate, in scope and quality, as a dissertation for the degree of Doctor of Philosophy. f .7^ . .h (P. Tfl^'Frank P. May Professor of Chemical Engineering I certify that I have read this study and that in my opinion it, conforms to acceptable standards of scholarly presentation and is fully adequate, in scope and quality, as a dissertation for the degree of Doctor of Philosophy. Ralph a Selfri^ge K' Professor of Mathemntics and Director of the Computing Center I certify that I have read this study and that in my opinion it conforms to acceptable standards of scholarly presentation and is fully adequate, in scope and quality, as a dissertation for the degree of Doctor of Philosophy. ^fU>S):>')k, ^luL-^^ Frank D. Vickers Associate Professor of Computer and Information Sciences

PAGE 525

This dissertation was submitted to the Dean of the College of Engineering and to the Graduate Council, and was accepted as partial fulfillment of the requirements for the degree of Doctor of Philosophy. December, 1972 Dean, College of Engineering Dean, Graduate School

PAGE 526

UNIVERSITY OF FLORIDA 3 1262 08666 411 6