Simpson_Time Series_Computations_in_FORTRAN_and_FAP_1966 Simpson Time Series Computations In FORTRAN And FAP 1966
Simpson_Time-Series_Computations_in_FORTRAN_and_FAP_1966 Simpson_Time-Series_Computations_in_FORTRAN_and_FAP_1966
User Manual: Simpson_Time-Series_Computations_in_FORTRAN_and_FAP_1966
Open the PDF directly: View PDF .
Page Count: 1118
Download | |
Open PDF In Browser | View PDF |
·~ 1}ime-S,erie!5 :;cornp:u t·;a 't-iO:n s l I K ' . i'n ·'F ORTRAN and •:'.~ ,: '" PAP . I~ SIMPSON :: '\' .. Ii:.. ~ . Time-Series Computations in FORTRAN and FAP VOLUME I - A PROGRAM LIBRARY Time-Series Computations in FORTRAN and FAP VOL U M EI - A PROGRAM LIB R A R V STEPHEN MILTON SIMPSON, JR. Massachusetts Institute of Technology ADDISON-WESLEY· READING, MASSACHUSETTS Copyright © 1966 ADDISON-WESLEY PUBLISHING COMPANY, INC. Printed in the United States of America All rights reserved. This book, or parts thereof, may not be reproduced in any form without written permission of the publisher. Library of Congress Catalog Card No. 66-14667 ADDISON-WESLEY PUBLISHING COMPANY, INC. Reading, Massachusetts· Palo Alto· London New York· Dallas· Atlanta· Barrington, Illinois ADDISON-WESLEY (CANADA) LIMITED Don Mills, Ontario To my mother, to my father, and to Jackie. Preface In the fall of 1952 I joined, as a graduate student, a Massachusetts Institute of Technology project called the Geophysical Analysis Group, and so began a twelve-year effort in the application of digital computers to time-series problems. This project, the G.A.G., was organized by Professors G.P. Wadsworth and P.M. Hurley of M.l. T. and by Dr. Daniel Silverman of the Stanolind Oil and Gas Company. It assumed the task of attempting the realization of Norbert Wiener's time-series concepts on the Whirlwind I (WWI) Computer in the echo-sounding problems of seismic exploration for oil. At the same time I developed a close friendship with my fellow student Enders A. Robinson, on whom the directorship of G.A.G. soon devolved. Robinson's efforts centered in the elucidation of theory and its translation to discrete notation, and my own work tended toward machine realization of theory, but we each made sufficient excursions into the other's domain to form a profitable research partnership. This pattern has persisted over the years. The Geophysical Analysis Group is relevant for the reason that many of the programming concepts presented herein were seeded in the 16-bit registers of WWI for the seismic exploration problem. Digital prediction, both single and multiple, special digital filtering, spectral and correlation analysis, traveling spectral analysis, automatic processing systems for multirace seismograms, and many other operational concepts were developed and experimented with on WWI to an unprecedented degree. Besides myself and Robinson those involved with computation included Mark Smith, Howard Briscoe, William Walsh, Robert Bowman, Freeman Gilbert, Sven Treitel, Donald Grine, Kazi Haq, Donald Fink, Robert Wylie, Manuel Lopez-Linares, Richard Tooley, and Robert Sax. The ideas carried into industry and pursued there by students associated with G.A.G. have now ripened to the point of causing what amounts to a technological revolution in seismic interpretation. In 1954 Robinson left, eventually to become Associate Professor of Mathematics at the University of Wisconsin, and I assumed directorship of G.A.G. until its termination in 1957, but frequent visits with each other kept alive our mutual interests. With G.A.G. 's termination and the subsequent retirement of WWI, I was forced to the realization that my programming output might just as well have been expressed in vanishing ink-an experience which rankled long and which underlies our determination to develop stable programming and communicating techniques. I took a year's leave of absence from my Assistant Professorship in the Department of Geology and Geophysics at M.l. T. and spent it in military applications of special-design general purpose computers with RCA. This work tended to keep me from recognizing the latent power of the then infant language of FORTRAN. vii On returning to M.l. T. I kept my hand in programming on the IBM 704, but it was not until 1960, when I was asked by the Advanced Research Projects Agency to set up a project like G.A.G. but focused on the underground detection problem of VELA UNIFORM, that I became seriously involved with the new computers. I was fortunate in being able to attract Robinson to the project, as well as many gifted graduate students. By this time FORTRAN had become well established, and, after some hesitancy, we began to use it, gradually evolving a sense of proportion in the mixture of FOR TRAN and F AP programming. I find in this mixture that the whole is greater than the sum of its parts. For not only can we have the essential power of the individual languages, but they can supplement each other's weaknesses, as, for instance, they do when we use subroutine sandwiches of alternating language or use F AP programs to bolster FOR TRAN' s capabilities. Once again this leaves me committed, albeit partially, to a machine language. But the situation is not as bad as it was ten years ago. In the first place, the ubiquity of the IBM 700 series machines suggests a national and international investment in specific hardware and software of considerable inertia. The time constant of change has lengthened to a point where we should be able to keep up with it without periodic wholesale abandonment of past results. Secondly, our program design, testing, and documentation techniques have matured to the point where machine language translation is not nearly as formidable a prospect as previously. These conSiderations, the rapid advances which have been made in time-series computations, the growing requests we have had for the programs, and the general expanding interest in time series and in programming, have all encouraged me to pause and to pull together the myriad threads of our work into a single document representing, in first approximation, where time-series computations stand with respect to today's machines. Such has been my goal. However, this goal has proved too ambitious for a single volume, and we content ourselves in Volume I with a presentation of our subroutine library per se. Volume II will be devoted to the development of pertinent time-series theory from the computational viewpoint, to the consideration of computational applications in a realistic setting, and to discussion of programming technique. Taken together, the first and second volumes of Time-Series Computations in FORTRAN and FAP may be considered an introduction to a new topic, namely, the realization of modern time-series theory on digital computers. Their principal intended audience is students of time series or communications engineering who wish to acquire advanced techniques of handling empirical time series with pr:.:;sent-day computational equipment, especially on the IBM 709, 7090, or 7094. By "advanced" I refer both to the conceptual level of the techniques and to the professionalism of their realization. But I would hope that this work, Volume I especially, should also prove of value to the general programming community. The majority of our programs are not specialized to the time-series area. What we have done is to fill the gap between basic FORTRAN statements and time-series operations with a complex of generalpurpose black boxes that could be used to assist in the development of other areas of application. But even aside from functional utility, we hope that all computing groups faced with the problems of program exchange and communication will be interested in our experiments in communication formalisms. The subroutine library constitutes the bulk of Volume I. It represents the distillation of years of effort of my co-workers and myself. Cost studies of programming systems of this size (about 40,000 registers) might predict a developmental price tag of about a quarter million dollars for this set. Consequently we have felt justified in devoting considerable time and effort to the development of techniques for communicating our results in the context of applied problems. viii At the lowest level of communication, that is, the individual subroutine, we have tried to maintain high standards both of programming and of documentation. Toward the latter end, we have adhered to a program-writing format which might be called the self-documenting symbolic deck. In this format, the program card deck contains a program abstract and a detailed input-output specification, as well as illustrative and critical examples. The card deck is totally definitive of its own behavior. The format was originally designed for input to an automatic debugging compiler which would read the examples, set up appropriate test programs, execute the test programs, and report back results. In the press of other business the compiler never proceeded beyond a rudimentary stage, but the format has remained and proved itself valuable in our own internal communications. Furthermore, the format has proved itself many times over as a diSCiplining device for keeping programmers honest. It is a characteristic of the trade that programmers modify and remodify their decks. The juxtaposition of the documentation and the program proper in deck listings emphasizes documentation errors that result from such modifications, and the weeding out of these errors becomes a natural and integral part of the debugging process. Moreover, to a programmer, there is a great psychological difference between having to change a few comment cards and tracking down a secretary to make the same changes on a mimeograph master in order to run off an updated memorandum. The self-documenting program deck is a black box with input-output terminals fully described. It is necessarily bulky, the description being generally several times the length of the program proper. For routine reference we turn to compressed summaries, the "program digests," which, by judicious choice of terminology, enable one familiar with the programs to refresh his memory of calling-sequence details needed while programming, with an absolute minimum of page turning. For general scanning of and access to the programs, we have sorted them by various functional and nonfunctional attributes. The other types of documentation in Volume I relate to subroutine library structure and are of more specialized interest to the system programmer. But the study of n black boxes, each of which performs an isolated task in timeseries analysis, does not give one a sense of the coherency of the subject, or of the methods of interconnecting the boxes in broad experimental applications. For such purposes we have designed the experimental programs to be presented in Volume II. Each of these programs represents a series of experimental studies in an interconnected area of time-series analysis, with some carry-over from one program to the next. They permit the reader to see essentially all of our subroutines used in an applied framework. The applications chosen for illustration in Volume II range from elementary ones to problems the average student or research worker is unlikely to have encountered (especially multi-input processes). Since our theoretical development of time series is of rather limited scope, we have included appendixes on some of the less well-known topics covered in the experiments. The experiments of Volume II are designed to be readable without knowledge of the basic machine language, F AP, and to require a minimum of experience with FORTRAN. The study of Volume II, especially in conjunction with practice on a computerwhich can accept the subprograms of Volume I, is probably the easiest way of acquiring familiarity with the techniques we have to offer. It is an unfortunate fact that artificial but general languages like FORTRAN are, in themselves, incapable of expressing many of the' critical time-series operations in truly efficient form. This situation may change, but probably not in the near future. To a large extent our subroutine library may be viewed as an interdependent collection of FORTRAN and FAP programs where the FORTRAN programs steer the FAP programs to the desired task. The higher-level FORTRAN programs will easily compile ix on machines outside the IBM 700 series family, but their required subordinates, the F AP workhorse programs, will not in general carryover without hand-coded translation. For this reason, Volume II will present expositions of the more important logical processes used in the F AP subprograms to attain high-speed behavior, particularly in connection with correlation and spectral analysis. A knowledge of FAP is desirable but is not essential, since we lean considerably on ordinary flow charts for detailed relationships. Other limitations of a formal nature inherent in FORTRAN II have led us to some programming effort in the twilight region between FORTRAN and FAP, that is, to the writing of FAP programs which utilize "forbidden"knowledgeof the FORTRAN system in order to remove these limitations, and which we therefore label" system-expansion programs." Volume II includes a discussion of the techniques and problems involved in such programming and should prove of interest to serious students of programming. In short, then, we have limited the first volume to the presentation of the subroutine library with subsidiary documentation designed for the working programmer, and we have reserved time-series and programming concepts for Volume II. The "we" I use frequently above is not editorial, but includes my many coworkers, mostly graduate students, who have contributed to the subprogram collection. and with whom it has been my pleasure to work. In this congenial and loosely structured group, considerations of programming technique and style were developed to refined levels. Although the authorship of the programs is given individually, I would like to emphasize the importance of the contributions of James Galbraith, Jon Claerbout, and most particularly Ralph Wiggins. Other students directly associated were William Ross, Cheh Pan, Carl Wunsch, and Roy Greenfield. As for what theory we include in Volume II, much of it is pure review, but some of it has previously appeared only in project report form. I consider Robinson's solution, in the fall of 1962, of the multi-input iteration problem to be a Significant achievement. Wiggins pursued and expanded the analysis from this base through the program-development stage, and in so doing was the first to demonstrate the computational feasibility of multi-input least squares. But the work presented here has also depended on many others. The tireless and dedicated writing of test routines by Joseph Procito has been invaluable in the establishment of program reliability. In broader areas of service programming, analysis, data handling, desk calculating, etc., we also relied on Mrs. Irene Hawkins, Karl Gentili, my wife Jacqueline, Ervinia Irbin, Mrs. Susan Kannenberg, Allan Kessler, and Lloyd Kannenberg. Most of the card preparation and manuscript chores fell to Mrs. Elizabeth Studer, to my wife, and to Mrs. Wendy Tibbets, with assistance from Mrs. Elene Hershberg, Dauna Trop, Mrs. Myrna Kasser, Regina Lahteine, Mrs. Hazel White, and Mrs. Barbara Cullum. The punched-card work involved in these two volumes is too elegant to be passed over without further comment. The conventions and forms that we now use regularly (not all of which appear in these volumes; for instance, the mathematics of Volume II was card-coded in the source manuscript) I consider to be significant experiments in a field - call it "punched-card typography" - of growing importance in printing. In large part these conventions are due to my wife, who has become our arbiter of formats and to whose sense of style and standards of excellence we are much indebted. Over the years we have been favored with the most friendly cooperation of the machine operators and supervisors, starting in the early Whirlwind days with Robert A.J. Gildea (to whom I also owe many enjoyable hours of chess while waiting for the machine to come back) and Michael Solomita, and continuing with Anthony Sacco at the M.I.T. Computation Center and at the Cooperative Computing Laboratory at M.I.T .• John Harmon and our long-term friend Michael Saxton of IBM, and more recently with Thomas Burhoe, Mason Fleming, and William Jarvis of IBM. x We owe much to the sponsors of both the G.A.G. project and the VELA UNIFORM project for the computing facilities these projects have afforded us in the development of time-series and computing concepts, and to Lincoln Laboratory, the M.I. T. Computation Center, and Geoscience Incorporated for the use of programs developed under their auspices. Concerning editorial aSSistance, I am indebted to Robinson for critical review of the mathematical aspects of the manuscript and to Wiggins for his joint labors with my wife and myself in the editing of the programs. It is indeed a pleasure for me to acknowledge the many contributions and accommodations from this small army of co-workers and associates. Brookline, Massachusetts November, 1965 S.M.S.,Jr. xi Contents 1. 1 Introduction .. General Aspects of the Program Set Terminology Backgrounds Usages in the Present Volume Programming Philosophy Design for Speed References 2. Illustrative Usage of Programs 21 a. 3. Program Categorizations 39 ~ 4. Annotated Calling Sequences 61 Ell 5. Program Digests 77 ~ 6. Program Statistics 133 7. A One-Pass Subroutine Library 159 8. Cross-Reference Table for the One-Pass Library 166 r. 9. Subroutine Rosters for the One-Pass Library 186 DI Complete Program Listings 213 ~ 10. xiii .. DIll 1 Introduction The heart of this book is the presentation, in Section 10, of 267 programs which are rather widely applicable even though their development was motivated by problems in the field of time-series analysis. The reader may turn to anyone of these programs and study it with understanding without a need for the material in the preceding sections, these sections being concerned with introductory and access information, and with tabulation of data abstracted from the programs. In particular, the present section is concerned with an overview of the programs as a set, and with general considerations of language, terminology, and programming philosophy. The use of this book and of the programs presupposes some familiarity with the artificial computing language FORTRAN and, but to a lesser and nonessential extent with the machine language FAP. A reader with only FORTRAN background should be able to read through all of the textual material of the introductory sections in one sitting and lose very little from our occasional references to machine-language details. Thereafter he should have no trouble in locating programs of interest by means of the categorized lists of Section 3, or in utilizing, with the aid of Sections 4 and 5, the programs he has become familiar with. However, in his reading of the programs in Section 10, a person of this background will generally be limited to the FORTRAN programs, although if he has sufficient curiosity he will find that many of the machinelanguage programs are quite easy to follow with the aid of a machine manual (95 of these programs involve less than 50 machine-language instructions and constants, 31 less than 25). Many of the tabulations to follow contain data on program storage lengths and binary card counts; these data are somewhat dependent on the particular system used to translate the symbolic decks into machine language. The statistics given pertain to FORTRAN II, Verson 2, IBM Modifications 1 through 27, further modified to accept the G format. * *In reference to the monitor system, one might note that we have found it useful to modify the BSS loader to extend its limit on the maximum number of missing subroutines from 50 to 200. (This is accomplished by reassembling records 7, 8, and 9 of the FORTRAN Monitor System after appropriately redefining the symbol NMMSP.) Without this change large main programs referring to many library subroutines occasionally have their executions blocked. An alternative, if ad hoc, solution to this problem is to reduce the missing subroutines count by adding a number of the required routines to the input deck when the problem arises, rather than by obtaining them from the library. 1 III Time-Series Computations in FORTRAN and FAP GENERAL ASPECTS OF THE PROGRAM SET To begin our general view of the program set we will comment briefly on the variety of functions performed. Examination of the categories of Section 3 will show a wide diversity in the computational topics embodied, these topics ranging from spectral analysis and discrete filtering (convolution) to matrix manipulation, to polynomial operations, to machine graphing, to technical matters of program administration, and to a number of other topics. Conversely there are some programs which essentially or actually duplicate the functions of others. There are several reasons for such redundancy. Sometimes the reason is to provide both FORTRAN and FAP versions, and sometimes it is to illustrate alternative programming techniques, but more often the reason is historical accident. The redundancies are preserved in our use because of references made in main programs not shown, and occasionally because of differences in taste, but other groups might find it profitable to trim down the collection. The tables of Sections 8 and 9 are useful for checking the consequences of contemplated program deletions. Similarly, one will find considerable diversity both in program size, as measured by storage requirements* which vary from 1 register to 1499 registers with an average of 152, and in complexity, as measured by calling-sequence lengths, which vary from 0 to 22 with an average length of 4.5; by number of entry points, which varies from 1 to 18 around a mean of 1.5; and by the required number of pages of descriptive documentation, which ranges from 0.5 to 16 with an average of 1.4. Necessarily we must also admit to some diversity in the technical quality (not in accuracy or utility) of the programs. In general, the quality will have a positive correlation with the date of the writing. Such quality problems as may exist are most often due to awkwardness of design or of expression, resulting in programs larger than necessary. However, the critical program loops are usually very efficient despite these factors. Of the 267 programs, 90 are written in FORTRAN language, which is acceptable to most computers, and 177 are written in the FAP (FORTRAN Assembly Program) language, which is applicable only to the IBM 709,7090, and 7094 computers.** The average length of the FAP programs (85 registers) is distinctly smaller than that of the FORTRAN programs (283 registers). All of the programs are subroutines in the general FORTRAN sense of the word. The FAP subroutines conform to the subroutine linkage requirements of FORTRAN II and consequently can be used by FORTRAN programmers who are unfamiliar with the F AP language. It must not be assumed, however, that the 90 FORTRAN programs can be used immediately on computers other than the 709 series machines, or that they may be operated under FORTRAN IV. For the program library is strongly interconnected, and although each program is usable by the programmer as an apparently independent entity, many of them internally require the services of up to 16 other programs from the library. It turns out that only 23t of the FORTRAN programs either need no other programs from the library, or, if they do, need only programs which are themselves FORTRAN. Thus the library in present form is by and large specialized to operations under the FORTRAN II Monitor System of the IBM 709, 7090, or 7094. The program changes needed to permit operation under FOR TRAN IV on the IBM 709 series machines are minor compared to those necessitated by a change of computers, but are still more extensive than a specialist in such matters might guess from what has been said so far. The standard changes with regard to transfer of *The numbers here are exclusive of lower-order programs that might be required. Including these, the range is 1 to 5106. **Thirteen of the programs will work only on one or two of these three machines. t Some of these 23 programs require the use of FORTRAN system routines. 2 Introduction control, to the direction of storage of subscripted arrays, and to the binary point of fixed-point numbers must be made for all F AP programs needed. But about 30 of the F AP programs depend on more than routine knowledge of FOR TRAN II (some scan the calling program ahead of or behind the calling sequence, some have variable-length calling sequences, some refer to non-FORTRAN-callable system routines, and some utilize data left behind by the monitor). These programs require additional and more involved changes. Offsetting this complication, however, is the fact that a number of these unorthodox programs have the function of expanding the capabilities of FORTRAN II in ways now included as built-in features of FORTRAN IV, and consequently this number can be dropped entirely, providing suitable changes are made in programs referring to them. On the other hand, there will be cases where the possibility exists of choice between FORTRAN II and FORTRAN IV, and here one should balance the advantages of FORTRAN IV over FORTRAN II as bolstered by our systemexpansion programs against the required changes in the particular programs needed. In this volume, little direct help is provided for the problem of translation of the FAP programs for use on other machines. As a practical matter, however, it should be pointed out that many, perhaps most, of the F AP programs are of such elementary nature that their functional description and examples as given in Section 10 are all that coders for other machines will want. (They are more likely to consider many of the programs to be beneath their dignity.) The more involved FAP programs may require the services of an experienced translator. The second volume of this work will give numerical analysis discussions and flow charts of value in these cases. The programs of Section 10 are alphabetically ordered by program name where the name of a program is, under ordinary Circumstances, taken to be identical to the name of the entry point. For F AP programs with multiple entries the program name is taken from the first entry card in the deck. However, the alphabetized page headings of Section 10 do include all principal and secondary entries, in the latter case merely giving a reference to the associated prinCipal entry. If the program will operate only on the 709, we append (709) to the name; if it will not work on the 709, (7090) is appended; and if it works only on the 7094, (7094) is appended. (None of the programs work only on the the 7090.) There are some programs of identical entry name (they always perform identical or practically identicalfunctions), and these are distinguished by appending the serialization -II or -III. TERMINOLOGY BACKGROUNDS In the foregoing review we have been using a number of undefined terms, such as "program," "subroutine," "compiler," and "entry point," on the assumption that the reader is more or less familiar with them, at least in FORTRAN usage. We now would like to clarify usage for some of these terms. Unfortunately the attempt to capture their general meaning with precision leads one into more extensive discussions of topics concerning computer hardware and input-output devices than we wish to engage in, and we shall be satisfied with some of the salient definitional features of the broadest of these terms, namely "computer program." As a trial definition, let us take the term computer program to mean in general, "the representation of a plan of activities which could be carried out by a computer, where the activities possess a logical completeness and integrity with respect to some motivating function." The program user is interested, in the first instance, in the nature of the motivating function and in those aspects of the plan which enable him to understand the program assumptions, or inputs, and the program results, or outputs. The technical substance of the term, however, is contained more in the natures of the "representation" and of the "plan," and in the interpretation of the phrase "could be carried out by a computer" than it is in the utilitarian aspect of the program. 3 Time-Series Computations in FORTRAN and FAP The problems of meaning here, which are just beginning to be of concern in questions of law, are severe now and are likely to become worse with time. For the massive efforts going on in compiler development are continually expanding and diffusing the boundaries of meaning. To give an example, what is now commonly called a "FORTRAN program" could hardly have qualified as a computer program had it appeared back in 1950 (it would have been referred to probably as a form of algorithm), not because of the absence of a suitable computer but because there was no compiler at that time to give operational meaning to a FORTRAN program. At the present time it is easy to conceive of a compiler which will accept, say, building blueprints and generate programs to produce complete purchasing lists, construction schedules, etc. Is a blueprint then to be considered a computer program? Let us set this question aside for a moment. What is happening is that compilers and input-output devices are being taught how to read and respond not only to specification languages, that is, representations of plans of activities especially invented for computers, but also to many such languages established prior to the development of modern computers. This educational process drives the perimeter of meaning for the term "computer program" outward so as to overlap accepted usage in older disciplines in which people are now seeking to tap the potential of the big machines. These remarks point up a logical complication in our trial definition of the term "computer program," namely that this definition is clearly dependent on the meaning of the as yet undefined term "compiler," for a compiler, which may be classified briefly as a program-to-program translator, is itself a computer program. The definitional circle involved here can be broken by resorting to a recursive form of definition which uses the concept of a "machine-language program" to provide a semantic link to hardware. Strictly speaking, we can define a machine-language program to be a representation of a plan of activities for a given computer, which is fully detailed in that it explicitly and individually specifies the desired initial physical state of every memory element in the computer which will participate in the activities. Thus for a binary computer the maChine-language program might be a punched paper tape, where each potential punch pOSition on the tape is equated by correspondence assumptions with an individual binary memory element. (Note, however, that an octal shorthand of the binary expressions on tape would not be a machine-language program in the strict sense, since such specification, while explicit, is not individual.) A loader (whose generalizations are" assemblers" or "compilers") is then a device or procedure aware of the correspondence assumptions and capable of forcing the physical states of the memory elements in question to correspond to the specifications of any given machinelanguage program. The present usage of the term computer program is, then, more closely approximated by a "representation of a plan of computational activities which is either a machine-language program or else can be translated into a machine-language program by a computer responding to another machine-language program or by a succession of such translations." Thus one or more computers may be involved in the translation, and none of these is necessarily the same as the computer on which the original program is eventually executed. The translation programs are called assemblers or compilers. It is useful to widen the meaning of "machine-language program" to include all programs written in a machine-dependent language under which the programmer has unrestricted and easy access to every capability of the machine. The term absolute machine-language program can be used to refer to the stricter usage when necessary. The more general machine language is essentially a symbolic shorthand notation for the absolute machine language. An assembler is then a translation program for machine-language programs in the wide sense. 4 Introduction Our redefinition of computer programs evidently supports the affirmative position on the question raised earlier concerning blueprints, that is, Should blueprints be conSidered as computer programs once the compilers can handle them? Nevertheless a strong negative position can be developed. It stems from a critical analysis of what constitutes a "plan of activities for a computer." The basic activity of a computer is computation, or calculation on numbers. The numbers calculated on are usually physically disjointed from the commands of calculation and are gathered in an area labeled data, while the commands are gathered in an area generally accepted as program. (Note that the FOR TRAN language is designed in a way which formalizes this division and heightens the impression of absolute distinction between program and data.) Moreover, the numbers are frequently prepared on, say, a card deck and read into the data area by program commands prior to calculation. Such a card deck is not considered a program in any sense of the word. But if the basic activity of a computer is calculation on numbers, the essential defining activity which distinguishes a computer from an overgrown desk calculator is calculation on the program itself. The proper understanding of this feature, abortively introduced by the precocious Babbage over a century ago, is often the most confUSing obstacle a programmer must master in the study of his first machine. The confusion is due to the possibility, in fact the necessity, of the occurrences of ambiguity between program and data. * It is the transposition of this ambiguity to the level of compilers which makes our hypothetical question of blueprint classification truly a moot one. Thus the card decks which are processed by programs may contain information other than numbers for calculation. In particular they may contain numbers and symbols which indicate to the program the user's desired specializations, selections, or sequencing among alternative computational capabilities built into the program. Such decks are no longer thought of as data decks but rather as control decks. The plan of activities begins to migrate from the program proper to the cards. In the limit the cards themselves can become a new program in their own right, and the processing program becomes a compiler. When can one say that this limit has been reached? A useful measure to apply is the range of controls one can exercise with the card deck. If this range covers all or most of the actual machine capabilities,** as it does in FORTRAN, then the control deck may clearly be classed as a computer program. As this range narrows, the plan of activities must be said to reside more and more in the program which processes the cards. A blueprint must be considered to be analogous to the control cards of the foregoing discussion. Clearly the range of controls possible is highly restrictive; there would probably be no way, except perhaps a highly artificial one, to request, for example, the sum of one hundred numbers. The true plan of activities for the computer is a combination of the blueprint and the compiler. In the light of the present discussion, the blueprint may be viewed as control information for this plan, or even as a plan of activities for the compiler, but not in itself as a true computer program. *For an illustration in the present program set see subroutine PROCOR. PROCOR produces a computer program in response to an arbitrary array of numbers and may therefore be thought of as a specialized assembler whose input "program" is the number array. **We are speaking through this discussion of "general purpose" digital computers, which we leave as an undefined concept. At present most of the major computers are suffiCiently similar in respect to capability that each one can simulate the behavior of any of the others, as well as that of the prototype "Turing machine. " 5 Time-Series Computations in FORTRAN and~ FAP USAGES IN THE PRESENT VOLUME For present purposes a "computer program" is a card deck (or any of its translations or transmissions produced by compilation, assembly, listing, card-to-tape loading, etc.) prepared according to the rules of FORTRAN II programming or of FAP programming for the 709, 7090, or 7094. Since these fully documented rules prescribe well-defined program entities, ticklish questions of shades of meaning do not arise. Nevertheless it is of some value to review here some highlights of subroutine notation, since all of our programs are of this type, as well as to discuss a few notational conventions of our own. The expression computer routine is usually used to describe a program whose functional motivation, while possibly complete in itself, is somehow subsidiary to the principal computational thought under consideration. The "routine" mayor may not be merely a segment embedded in a larger program. In any event, compiling and assembly systems provide formal rules by which principal and subsidiary computational thoughts may be linked with respect to program flow and information exchange, and routines written under these rules are known generically as subroutines. But there are exceptions and inconsistencies in usage. Thus in FORTRAN manuals the word "subprogram" tends to vie with" subroutine" for the generic title, since we see references both to "subprogram-type subroutines" and to "subroutine-type subprograms." This terminology problem, though not of great practical concern, is necessarily present in this volume since all the programs here are written so as to be FORTRANcompatible. The ambiguity is relieved somewhat by adopting the following poSitions. (1) "Subroutine" can refer either to the general class of subsidiary computations linked by formal rules to a larger computational scheme, or it may refer to a particular form of such linkage, the reference being apparent from context. (2) When" subroutine" refers to a particular form, then it must refer to the functionally most general such form within the given class of forms. Thus the specific form known in FORTRAN as the subroutine or (subroutinetype) subprogram may be considered most general in that its inputs and outputs are unrestricted in form, whereas the other subprogram types, known as functions, are restricted to having scalar-valued outputs and in some case inputs. * From the practical point of view, however, our problem is merely to review the rules which distinguish among the three kinds of FORTRAN-style subroutines that appear in this book. The first of these is the ordinary subroutine subprogram, which is defined by the appearance at the beginning of the FORTRAN deck of a statement of the illustrative form** SUBROUTINE SUB(A,B, ... ,D) where SUB refers to one to six alphanumeric characters starting alphabetically, but terminating with F only if less than four characters are involved, and where A,B, ... ,D *Unfortunately even here we would have to yield to the technical argument that a FORTRAN function may have general outputs in addition to its scalar output (the function value), on which basis the FORTRAN function could be claimed as the most general subroutine type, although the deSign intent and description seem to center on the scalar output. **One or more RETURN statements are usually included but are not mandatory. Similarly, in our FOR TRAN Monitor System (FMS), the subroutine need not refer to all or even any of the names of its arguments. 6 Introduction is a list of nonsubscripted names, all different from SUB, which are the arguments of the subroutine (the list may be void. in which case the parentheses are suppressed), the names being those of variables or of other subroutine subprograms or FORTRAN functions. This type of subroutine is referred to from another FORTRAN program by a statement such as CALL SUB(E,F, ... ,H) where E,F, ... ,H is a list of arguments each of which (1) would form a legal righthand side to a non-Boolean arithmetic statement, or (2) would form a legal alphanumeric field in a format, or (3) is a name appearing on an F card in the calling program. The arguments E,F, ...• H should match A,B, ... ,D in mode (e.g., fixed point or floating point) and number. Moreover there must be understanding between the calling program and the subroutine concerning each argument which is a subscripted array. This is most easily achieved by making corresponding DIMENSION statements (identical except possibly for the variable name) in the two programs. But the DIMENSION statements do not necessarily have to agree, even with respect to number of subscripts (the same holds for variables equated by EQUIVALENCE statements). What is necessary is that the two programs reach an agreement based on the following rules governing the absolute machine location of a subscripted quantity: LOC(A(I» = LOC(A(I» - (I-I) LOC(B(I,J» = LOC(B(I,I» - (I-I) - (J-I)*IDIMEN LOC(C(I,J,K» = LOC(C(I,I,I» - (I-I) - (J-I)* IDIMEN - (K-I)*JDIMEN*IDIMEN where LOCO symbolizes "absolute machine address of," and where we are assuming a DIMENSION statement of the form DIMENSION A(IDIMEN),B(IDIMEN,JDIMEN), C(IDIMEN,JDIMEN,KDIMEN) Note that the first equation above does not involve a dimension. Consequently it is frequently useful to have the subroutine first dimension all of its arrays as singly subscripted quantities (with dummy values of the dimension) and then access the elements using the above relations plus values of the dimensions given to it in the calling sequence. For example, if the calling program has DIMENSION C(IO,20,3) = 10 JD = 20 ID CALL SUB(C,ID,JD, ... ) and the subroutine has SUBROUTINE SUB (A,IDIMEN,JDIMEN, ... ) DIMENSION A(I) 7 Time-Series Computations in FORTRAN andFAP then the subroutine can acquire, for example, C(5,15,2) by the statements L = 5 + 14*IDIMEN + JDIMEN*IDIMEN X = A(L) By using this type of scheme (not required in FORTRAN IV), it becomes unnecessary to recompile the subroutine for each calling program having different DIMENSION statements. We use it very frequently in the programs of Section 10. The translation to F AP of the statement CALL SUB(E,F, ... ,H) is symbolically TSX $SUB,4 TSX E,O TSX F,O TSX H,O where $SUB is a reference to the transfer list discussed below, and where E,F, ... ,H now stand for machine locations containing the corresponding arguments. For each argument which is an array in the calling program but which appears in the CALL statement with no subscripts, the location is assigned as though it had appeared with all of its subscripts set to value one. The FOR TRAN function (of which there are only two in the present set) is defined by the appearance at the beginning of the FORTRAN deck of something like FUNCTION FNCTN(A,B, ... ,D) and must include a RETURN statement preceded by an arithmetic statement of the form FNCTN where FNCTN obeys the sarne naming rules as SUB above, and where A,B, ... ,D is similar to the same expression in the subroutine-subprogram case but must not be a void list. The FORTRAN function is referred to from another program by an arithmetic statement such as X = ... FNCTN(E,F •... ,D) ... where the right-hand side of the equality is any legal FORTRAN expression which treats FNCTN( ... ) as a single number. The mode of this number is assumed determined by the function name according to FORTRAN naming conventions for variables E,F, ... ,H and A,B, ... ,D must match each other in the same manner as discussed above. The translation to F AP is the same as that of a subroutine subprogram, with $FNCTN,4 replacing $SUB,4, except that the statements immediately following the TSX H,O will assume the value of the function, Le., the single number generated by the function, to be in the accumulator. 8 Introduction The third type of subroutine is the closed (or library) function, of which there are many examples in Section 10. This type must be hand coded with a structure such as ENTRY FNCTN FNCTN STO A CLA VALUE TRA 1,4 The reference to the closed function from a FORTRAN program is the same as a reference to a FORTRAN function, except for the following differences: F* is appended to the name, the function value is considered fixed-point if and only if the name of the function begins with X, and the arguments in the string E,F, ... ,H may not be alphanumeric fields or names of subroutines. The information linkage is quite different and less uniform, however. The four statements in the table below, with their effective translations, illustrate the information linkage adequately. X = = FNCTNF(A) X FNCTNF(A,B) CLA TSX STO A $FNCTN,4 X LDQ CLA TSX STO B A $FNCTN,4 X X = CLA STO LDQ CLA TSX STO FNCTNF~A,B,C) C (DECIMAL) 32765 B A $FNCTN,4 X X = CLA STO CLA STO CLA STO LDQ CLA TSX STO FNCTNF (A,B,C ,D,E) E (DECIMAL) 32763 D (DECIMAL) 32764 C (DECIMAL) 32765 B A $FNCTN,4 X In addition to closed functions, it is of course also possible to hand-code subroutines and FORTRAN functions. The formal structure is similar to that for the closed function. Two examples are ENTRY SUB ENTRY FNCTN FNCTN SUB TRA CLA TRA N +1,4 VALUE N+1,4 *In the tabulations of this volume the terminal F is not considered to be part of the proper name of the function. 9 Time-Series Computations in FORTRAN and FAP \ where N is the argument count of the pertinent statement in the calling program, and where the hand coding is done subject to the argument transmission conventions illustrated earlier. In the listings of Section 10 the expressions FORTRAN subroutine and ~ subroutine under the "language" heading always refer to the subroutine subprogram, and the expression FAP function to closed functions. The two FORTRAN functions are so labeled. Hand coding of subroutines, unlike FORTRAN coding, permits the bunching of many subroutines in one program deck (which is often useful if the subroutines perform similar operations). Thus ENTRY ENTRY ENTRY ENTRY SUB1 SUB2 FNCTN1 FNCTN2 TRA STO STQ A B CLA TRA 1,4 CLA TRA VALUE2 6,4 SUB1 SUB2 FNCTN1 5,4 VALUE1 FNCTN2 might be a "single"program representing two subroutine subprograms, each of which has four arguments, one closed function of two arguments, and one FOR TRAN function of five arguments, all four subroutines needing access to the same table of numbers. This type of multiple-entry coding in F AP, appearing frequently in the library of Section 10, clouds the meaning of the term "program." From the standpoint of the calling program, each entry of a multiple-entry program is used as an independent subroutine; the calling program has no way of knowing that they are dependent. If a reference is made to just one of them, the loading program must nevertheless bring the entire bunch into the memory as a unit, since the physical deck cannot be divided. For example, the standard FOR TRAN functions COS and SIN are separate entries to a single program and are always together in the machine if one of them is. We might speak of logical programs and physical programs to clarify intention when necessary. For program-writing purposes, however, there is never any necessity to refer to other than logical programs. In any case, it has become customary in many circumstances to bypass the question by simply referring to entries or entry points. This terminology relates to the fundamental topic concerning "program" in the conception of the control hardware, namely, where to send control for the next job, and is neutral with respect to higher-level distinctions made by compilers. (Note that in the printed output of the compilation of a FORTRAN program one finds a list of 10 Introduction required logical programs accurately entitled" entry points to subroutines not output from the library.' ') For purposes of dealing with program decks and of general documentation, on the other hand, one must refer to a multiple-entried program as a unit. The manner of doing this is a matter of local convention. We have chosen to equate the name of each physical program with the name on its first entry card and to speak of that name as the prinCipal entry, other entries being termed secondary entries. When FORTRAN or FAP is processing a program, it forms a complete nonredundant list of all of the entry names referred to by the program. This list, which appears in BCD form in the first registers of the absolute relocatable binary deck produced by the translation, is called a transfer list or, as it is called more often in this book, a transfer vector. Each reference to a subroutine in the program body, that is, each TSX $SUB,4, becomes TSX A,4 where A is the register in the transfer list containing the name SUB. At execution time, the monitor system replaces the list of entry names with a corresponding list of Trap Transfer instructions whose address fields are the absolute machine locations assigned to the corresponding entries by the storage allocation logic for the particular execution. This scheme of routing all references to other entries through a single transfer vector helps minimize the relocation task of the loader. Transfer vectors often contain entries whose names are illegal subroutine names (containing special characters) from the standpoint of usage by FORTRAN programs. These routines, requested by the compiler as needed to implement associated FORTRAN statements, are called non-FORTRAN-callable routines. They can be directly referred to, however, from FAP programs, and the reader will find a number of such references in our program set. The program descriptions in Section 10 also use a more specialized notation; features of it are described in the following paragraphs. A FORTRAN INTEGER, or FORTRAN-II INTEGER, or INTEGER is a fixed-point quantity with binary point assumed between bits 17 and 18, with bits 18 through 35 all zero, where the 36 bits are labeled S,1,2, ... ,35. A MACHINE-LANGUAGE INTEGER, abbreviated as MLI, has its binary point to the right of bit 35. A triple-dot notation is often used to suppress symbolic subscripts in expressing lists of numbers. Thus X(l . . . 3) stands for and Y(l • . . 3,1 . • . 2 (X (I) , I J stands for or 1,3) «Y(I,J),I = 1,3), J = 1,2) Y(l ,2,3,,1,2) The term VECTOR is used very commonly to refer to any singly subscripted FORTRAN variable, and its length is the highest subscript value of pertinence. A doubly subscripted variable is referred to as a MATRIX or 2-DIMENSIONAL ARRAY, and a triply subscripted variable as either a 3-DIMENSIONAL ARRAY or a MATRIX VECTOR, this last term implying that the first two subscripts define a two-dimensional array which, in the context of the computation, obeys laws of matrix algebra. The abbreviations LSTHN, LSTHN = , GRTHN, and GRTHN = stand for the symbols < , ~ , >, and ~ respectively. Mathematical expreSSions appearing under ABSTRACT may deviate from FORTRAN conventions of naming and indexing. The emphasis here has been to produce expressions which are visually close to those of ordinary mathematics. 11 Time-Series Computations in FORTRAN and FAP The numerical examples given involve some notation which should be fairly obvious. Fixed-point number lists should always be assumed to be FORTRAN-II integers unless preceded by OCT for octal or MLI for machine language integer. On the other hand, the representation of Hollerith data is not too satisfactory or consistent as given here. In most cases we use either X(l . . . ) = 6H(something) X(l . . . ) = 6Hsomething or to imply that the" something" is a string of Hollerith characters stored six to a register, that is, FORMAT(A6). However, in some cases the "something" may be split into groups of six characters separated by commas to conform to the representation of ordinary numerical lists. In deciding which is meant, the reader will have to use his judgment from the context. There are some further notational discussions, which can be found in the introductions to Sections 4 and 10, and there is a pronunciation guide to the entry-point acronyms in Section 6. PROGRAMMING PHILOSOPHY The program set of Section 10 grew over a considerable period of time in a programming environment which possessed continuity of personnel and computers, coherency of computational purpose, total rapport between analysis and programming, relative freedom from a crisis atmosphere, and adequate financial support - an uncommon and fortuitous environment indeed, and one in which programming philosophy could be developed and realized. To a large extent the programs themselves are an adequate expression of such developments. This is particularly true of documentation and testing procedures, which are discussed in Section 10 as well as in the Preface, but more general design considerations may not be as self-evident. Our most general explicit design tendencies have been to avoid writing "main" programs except when absolutely necessary, and, when it does become necessary, to pare down the functions of the main program so that it incorporates only the specializing and input-output aspects of the applied problem at hand. Thus each applied problem is subjected to analysis to determine (a) what aspects of it are expressible in terms of the existing program set, and (b) what remaining aspects might be of future value if expressed as subroutines to be added to the general collection. Everything else becomes a function of the main program, except that occasionally subroutines might be used here for certain purely technical reasons (for instance, to break down large programs into smaller blocks for reduction of compilation time during debugging. Sometimes there are aspects of the main program's functions which for other technical reasons seem naturally to require subroutine usage (e.g., conputational patterns needed at numerous positions in the program). Such aspects are usually handled by methods internal to the main program, Le., by arithmetic statement functions or by effective" internal subroutines" utilizing ASSIGNED or COMPUTED GO TO statements for linkage (we don't write main programs in F AP). This is done to help limit the indiscriminate growth of true subroutines and the attendant naming and documentation problems. Computational aspects which are considered to be of future value are usually discussed by the responsible programmer with others in developing the detailed subroutine specifications. The basic choice of subroutine type has been almost invariably 12 Introduction made between closed functions and subroutine subprograms. * Beyond this our programming group adheres to general conventions in calling-sequence design and terminology. These are detailed in Section 4. Input-output functions are not generally permitted to a subroutine unless they are its primary responsibility, in which case the external units involved are specified as arguments in the calling sequence, rather than assumed. Computational subroutines usually begin with an interlude for checking the legality of input-type arguments, and they refuse to perform badly requested computations, returning instead a diagnostic error flag as the only output. As a minimum we try to make the routines shock-proof with respect to the possibility of loss of control (loops, stops, unpredictable transfers). Special care is taken to ensure that the subroutine behaves reasonably when faced with conceptually legal but unusual, or limiting, or degenerate configurations of input arguments, so as not to create booby traps in applications broader than the specific one creating the need for the subroutine. Also, we try to see that such configurations appear in the testing programs. But there are deeper problems of subroutine design which touch on questions not peculiar to the field of programming. By what process does one examine a complex of activities and abstract or invent useful subgroupings? With respect to the present program set we can pretty well sidestep the difficult part of this question, since the subgroupings are broadly based on corresponding and previously established ones of mathematical analysis. In particular, a program system meaningful with respect to a field of analysis would naturally tend to become a mapping of the operational structure of that field, and Volume II will expand on this topic for time-series analysis. The more difficult question still remains, however: What discriminates good program invention from bad within whatever freedom of decision prevails? Our only suggestion here is to recall the commonplace that good invention arises from the dissatisfaction of creative individuals familiar with both the cause of their irritation and the tools of the trade. The question itself is of clear importance in, say, the task of designing program-generating programs, but there is no need to pursue it in the present volume. DESIGN FOR SPEED We shall conclude this introductory section with a short discussion of one last consideration, namely that of computer time required. It has affected our programming strongly, since we have been dealing with many long empirical time-series and numerical filters. It has strongly biased our programming toward FAP over FORTRAN, and, in general, has decided the issues of tradeoff between speed and space in favor of the faster, if longer, programs. In Section 3 there is a program category labeled FAST which contains a large number of entries. Study of the programs in this category will furnish details of the various programming techniques we have used to obtain speed. Volume II will provide further discussions of some of these techniques, but for the present we will only abstract some data relative to the 7094 on program speeds, in the three most important areas where our techniques have been significantly superior to elementary approaches: correlation or convolution, Fourier transformation, and solution of Toeplitz matrix equations. *In retrospect, our tendency to avoid writing FORTRAN functions, based on no better reason than the fact that one can occasionally confuse them with subscripted variables, appears somewhat unfortunate, since we thereby denied ourselves a certain degree of flexibility. (Note, for example, that one may call a FORTRAN function as an ordinary subroutine subprogram in addition to using it as a numerical entity in an arithmetic statement. 13 Time-Series Computations in FORTRAN and FAP Our key high-speed correlation or convolution program is PROCOR, whose writeup gives a reasonable idea of the techniques employed. Since PROCOR involves basically fixed-point arithmetic, a number of higher-level routines based on PROCOR have been written for ordinary correlation and convolution floating-point applications. They are QACORR, QXCORR, QXCOR1, and QCNVLV. Timing data for the autocorrelation program QACORR are adequate for illustration here. This program achieves nothing more complicated than does the following FORTRAN subroutine. 10 20 SUBROUTINE FORAC(X, LX, MXLAG, ACOR) DIMENSION X(2), ACOR(2) JMAX = MXLAG + 1 DO 20 J = 1,JMAX SUM = 0.0 NMAX = LX - J+1 DO 10 1= 1,NMAX K = J+1 SUM SUM + X(I)*X(K-1) ACOR(J) SUM RETURN END Fig. 1 gives timing information on QACORR andon the above program for data lengths varying from about 20 to 10,000, showing that QACORR is inferior for very short data but possesses a speed advantage factor of ten or greater for the longer series (this factor jumps to around 17 for the 709 or 7090). Similar savings will be realized in cross correlation and convolution by the other programs using PROCOR. The high-speed harmonic transform programs are based primarily on subroutine COSP. They are ASPECT, COSIS1, QFURRY, QIFURY, and XSPECT. (Subroutine F ACTOR also uses COSP in finding minimum-phase transients from energy-density spectra.) The speed of COSP comes from careful looping logic on stored sinusoids. Speeds of ASPECT, which finds cosine transforms of symmetrical data (usually autocorrelations in our applications) and which uses folding and splitting logic in addition to using COSP, can be 10 to 100 times faster than those of elementary programs. Speed-run results for ASPECT are shown in Fig. 2 for various data lengths and frequency increments. The upswing of the curves in the lower portion of the figure results from the gradually dominating influence of the folding and splitting logic for lop.g data. Toeplitz matrices arise in many time-series problems, particularly in the determination of least-squares filters. These matrices are positive definite Hermitian with elements constant along any diagonal, so that if the matrix is n by n, there are only n independent elements rather than n 2 • Recursion techniques exist for the solution of simultaneous equations involving these matrices, which require computational times proportional to n2 rather than n3 • * Subroutine WLLSFP or the coordinated pair RLSPR and RLSSR handles normal Toeplitzmatrixequationproblems. RLSPR2, FIRE2, MIPLS, MIFLS, and MISS are for use in multidimensional or multi-input problems when, for example, the matrix elements themselves become matrices. It is instructive to make a comparison between the computation times of ordinary simultaneous-equation programs not involving the special Toeplitz assumption and those of recursive programs. Such a comparison is made in Fig. 3, showing empirical times of WLLSFP and of the general utility subroutine SIMEQ. Analogous curves for the 7090 will show very similar relative behavior. *An early reference is Levinson's Appendix to Interpolation, Extrapolation, and Predq.iction of Stationary Time Series, by N. Wiener, John Wiley & Sons. 14 100.0 DASHED CURVES AUTOCORRELATION (HIGHEST 10.0 t ELEMENTARY FORTRAN PROGRAM v en ~ IJ.J ::I: r- z 1.0 o CJ) o z o U IJ.J CJ) .10 TER MXACC OF QACORR SPECIFIES THAT THE DATA MAY BE ROUNDED DURING THE COMPUTATION TO INTEGERS IN THE RANGE -MXACC TO +MXACC .01 10 25 50 100 250 500 1000 2500 5000 10000 DATA LENGTH LX --+ FIGURE 1. EMPIRICAL TIME CURVES FOR SUBROUTINE QAC(2!RR AND FOR AN ELEMENTARY FORTRAN PROGRAM IN COMPUTING AUTOCORRELATION FUNCtiONS. 100.0 amllllflllllmIlIlBmIlEllmem__ MFREQ +1 MXLAG IS THE BER OF FREQUENCIES, EVENLY SPACED FROM ZERO TO 7r, AT WHICH THE TRANSFORM IS COMPUTED. IS THE HIGHEST LAG OR HALF-LENGTH OF THE AUTOCORRELATION. i v m or-w J: IZ 1.0 o Cf) o z u w o Cf) .10 .01 10 25 50 100 250 500 1000 2500 5000 10000 MXLAG~ FIGURE 2. EMPIRICAL TIME CURVES FOR SUBROUTINE ASPECT IN COMPUTING COSINE TRANSFORMS OF AUTOCORRELATIONS OVER THE FULL FREQUENCY RANGE. 10.0 t v en 0 I'lLI :r: IZ 0 1.0 en 0 z 0 U lLI en .10 .01 1 100 10 1000 N-+ FIGURE 3. EMPIRICAL TIME CURVES FOR SUBROUTINES WLLSFP AND SIMEQ IN SOLVING THE MATRIX EQUATION AX = B FOR THE VECTOR X, WHERE A IS SQUARE T~EPLlTt: OF DIMENSION N BY N. Time-Series Computations in FORTRAN and FAP REFERENCES As mentioned earlier, the motivation behind the development of this program set was time-series applications. From 1952 to 1957 these applications concerned seismic exploration for oil and were pursued by the M.I. T. Geophysical Analysis Group of the M.I. T. Department of Geology and Geophysics. From 1960 to 1965 the work was continued by an M.l. T. VELA UNIFORM group of the same department on the problem of underground nuclear detection. The research reports of these two groups contain background material for the present volume and are available for reference. The M.l.T. Geophysical Analysis Group Reports are on file at the M.l.T. Library, and also at VESIAC, the VELA Seismic Information Analysis Center at the Institute of Science and Technology of the University of Michigan. They are: Robinson, E.A., and G.P. Wadsworth, A prospectus on the applications of linear operators to seismology, M.I. T. Geophysical Analysis Group Report 1, Cambridge, Mass., and VESIAC 1108, 1952, 61 pp. Robinson, E.A., and G.P. Wadsworth, Results of an autocorrelation and crosscorrelation analysis of seismic records, M.l. T., Geophysical Analysis Group Report 2, Cambridge, Mass., 1952, 40 pp. Robinson, E.A., S.M. Simpson, Jr .. M.K. Smith, and W.P. Walsh, Case study of Henderson County seismic record, M.l. T. Geophysical Analysis Group Report 3, Cambridge, Mass., and VESIAC 1100, 1953, 48 pp. Robinson, E.A., S.M. Simpson, Jr., and M.K. Smith, Linear operator study of a Texas Company seismic profile, M.I. T. Geophysical Analysis Group Report 4, Cambridge, Mass., and VESIAC 1101, 1953, 181 pp. Robinson, E.A., M.K. Smith, and S.M. Simpson, Jr., On the theory and practice of linear operators in seismic analysis, M.l. T. Geophysical Analysis Group Report 5, Cambridge, Mass., and VESIAC 1102, 1953, 95 pp. Robinson, E.A., M.K. Smith, S.M. Simpson, Jr., D.E. Bowker, R Bowman, H.W. Briscoe, J.F. Gilbert, S. Treitel, M.S. Turyn, and W.P. Walsh, Further research on linear operators in seismic analysis, M.l. T. Geophysical Analysis Group Report 6, Cambridge, Mass., and VESIAC 1103, 1954, 203 pp. Robinson, E.A., Predictive decomposition of time series with applications to seismic exploration, Ph.D. Thesis, M.l.T., and M.l.T. Geophysical Analysis Group Report 7, Cambridge, Mass., and VESIAC 1104, 1954, 265 pp. Simpson, S.M., Jr., A multiple trace criterion for linear operator selection, M.l. T. Geophysical Analysis Group Report 8, Cambridge, Mass., 1954, 30 pp. Simpson, S.M., Jr., R Bowman, D.R Fink, J.F. Gilbert, D.R Grine, M. LopezLinares, RD. Tooley, S. Treitel, and R W. Wylie, Linear operators and seismic noise, M.l. T. Geophysical Analysis Group Report 9, Cambridge, Mass., 1955, 281 pp. Simpson, S.M., Jr., R Bowman, D.R Fink, D.R Grine, M. Lopez-Linares, H. Posen, R. D. Tooley, S. Treitel, and R. W. Wylie, Properties, origin, and treatment of certain types of seismic noise, M. 1. T. Geophysical Analysis Group Report la, Cambridge, Mass., 1956, 211 pp. 18 Introduction Simpson, S.M., Jr., J.F. Gilbert, D.R Grine, RL. Sax,S. Treitel,andRW. Wylie. The interrelation of the deterministic and probabilistic approaches to seismic problems, M.I. T. Geophysical Analysis Group Report 11, Cambridge, Mass., 1957. 136 pp. The VELA UNIFORM reports [of Contract No. AF19-(604)-7378] are on file at the M.l. T. Library (where they are filed by their AFCRL numbers) and at VESIAC. They are also distributed by government organizations. Requests from government agencies and from Department of Defense contractors are handled by the Defense Documentation Center, Cameron Station. Alexandria. Virginia 22314. Others can apply to Clearinghouse for Federal Scientific and Technical Information (CFSTI) Sills Building 5285 Port Royal Road Springfield. Virginia 22151. These reports (all unclassified) are: Simpson, S.M .• Jr., J. Claerbout. and J.N. Galbraith, Jr., Initial studies on underground nuclear detection with seismic data prepared by a novel digitization system, Report No. 1 of AF19(604) - 7378. M.l. T., Cambridge, Mass., and AFCRL 61- 863,1961. 450 pp. Robinson, E.A., S.M. Simpson, Jr., J. Claerbout, J.N. Galbraith, Jr .• J. Clark, and W. Ross, Time series techniques applied to underground nuclear detection and further digitized seismic data, Report No. 2 of AF19(604) -7378.M.I. T. Cambridge, Mass., and AFCRL 62-262. December, 1961, 500 pp. Robinson, E.A., S.M. Simpson, Jr., J. Claerbout, J.N. Galbraith, Jr .• RA. Wiggins, C. Pan, and J. Clark, Continued numerical studies on underground nuclear detection and further digitized seismic data, Report No.3 of AF19(604) -7378, M.l. T., Cambridge, Mass .• and AFCRL 62-879, June, 1962, 363 pp. Simpson. S.M., Jr., Magnetic tape copies of M.l. T. Geophysics Program Set I. Report No. 4 of AF19(604) - 7378, M.l. T .• Cambridge, Mass .• and AFCRL 63282, December, 1962, 47 pp. Claerbout, J. F., Digital filters and applications to seismic detection and discrimination, M.S. TheSis. M.l. T., and Report No. 5 of AF19(604) -7378, M.I. T., Cambridge, Mass., and AFCRL 63-604, February, 1963, 89 pp. Galbraith, J.N., Jr., Computer studies of microseism statistics with applications to prediction and detection, ph.D. TheSiS, M.l. T., and Report No.6 of AF19(604)7378, M.l.T., Cambridge, Mass •• and AFCRL 63-673, May. 1963,283 pp. Simpson, S.M., Jr., E.A. Robinson, RA. Wiggins, andC.l. Wunsch, Studies in optimum filtering of single and multiple stochastic processes, Rep0l't No.7 of AF19(604) 7378, M.l.T., Cambridge, Mass., and AFCRL 64-241, June, 1963,140 pp. Robinson, E.A., Seismic arrays for the detection of nuclear explOSions, Report No.8 of AF19(604) -7378, M.l. T., Cambridge, Mass., and AFCRL 64- 855, June. 1964, 107 pp. 19 Time-Series Computations in FORTRAN and FAP Wiggins, RA., On factoring the correlations of discrete multivariable stochastic processes, Ph. D. Thesis, M.l. T., and Report No.9 of AF19(604) -7378, M.I. T., Cambridge, Mass., and AFCRL 65-207, February, 1965, 196 pp. Simpson, S.M., Jr., Magnetic tape copies of M.l. T. Geophysics Program Set II, Report No. 10 of AF19(604) -7378, M.l. T., Cambridge, Mass., andAFCRL 65-306, March, 1965, 79 pp. Simpson, S.M., Jr., R.W. Wiggins, and C. Pan, Sampling events from U.S.C. & G.S. Earthquake Cards, Report No. 11 (Final Report) of AF19(604) -7378, M.l. T., Cambridge, Mass., and AFCRL 65 - 463, June, 1965, 70 pp. 20 2 Illustrative Usage of Programs Examples of the use of the program as an isolated entity appear with each program listed in Section 10. Such examples are valuable, but often do not project a sense of the use of the program in an applied setting. Volume II of the present writing will give numerous illustrations of such usage in the time-series setting for which the program collection was developed. It is in keeping with the tenor of the present volume to present' examples of usage in an applied but utilitarian setting. Such a setting is meaningful, because a good many of the programs of the collection fall under a utility classification in no way specialized to the field of time series. The illustrations in the first set given are quite simple to scan and digest. A large number of the utility programs have truly elementary functions which are easily expressed by a few basic FORTRAN statements, the raison d' ~tre of such programs being convenience, or speed, or both. The illustration for these programs is a sequence of isolated program usages paired with equivalent, basic FORTRAN sequences. In this fashion a large number of programs can be covered in a few pages. The selections here include ,all of the minor utility programs which have simple FORTRAN translations. The reader should be cautioned that the basic FORTRAN equivalents may not be exact in all variations of the sample usage, especially in cases of zero or negative-length vectors, or in cases where arguments in calling sequences are equated by FORTRAN equivalence statements not shown here. The illustrations in the second set given in this section are simply listings of some of the testing programs we have used to verify the input-output behavior asserted in the program writeups of Section 10. In these test programs we have leaned heavily on the use of utility programs previously verified. The test programs must be studied with close reference to the program writeups of Section 10, since the test decks have no independent documentation. An examination of these listings will also bring out the general style we have evolved for writing test programs: this style may be of interest to persons with similar problems. The third and last set of illustrations consists of three main programs which produced the timing data for Figs. 1, 2, and 3 of Section 1. 21 III 1-------------------------------------[---------------------------------------1 [ I I PROGRAM USAGE I I I EQUIVALENT BASIC FORTRAN I I I 1-------------------------------------1---------------------------------------1 I CALL ABSVAL(X,11,12,V,IANS) I DO 10 1=11,12 I I I J=I-Il+1 I I 10 V(J)=ABSF(XlI)) I I (SAME PROGRAM FOR FIXED POINT) 1-------------------------------------1---------------------------------------1 I CALL ADDKlC,X1,X2, ••• ,XN) I X1=X1+C I I I X2=X2+C [ I I lETC) I (XADDK FOR FIXED POINT) I XN=XN+C I 1-------------------------------------1---------------------------------------1 I CALL ADDKSlC1,X1,V1, C2,X2,V2, 1 V1=X1+C1 I I 1 ••• , CN,XN,VN) I V2-X2+C2 I I I I ETC) I I (XADDKS FOR FIXED POINT) I VN=XN+CN I I 1-------------------------------------1----------------------------------~----I I SUM=O.O I I DO 10 l=l,LX I I I 10 SUM=SUM+XlI) I I (XAVRGE OR XAVRGR FOR FIXED POINTI I XAVG=SUMfFLOATFllXI I 1-------------------------------------1---------------------------------------1 I CALL BOOSTlX,LX,C,VI I DO 10 1-1,LX 1 I lXBOOST FOR FIXED POINT) I 10 VlI)-Xlll+C I 1-------------------------------------1----------------__________________ 4 _ _ _ _ 1 I CALL CARIGElITAPE,NSPACE) 1 IF (NSPACE) 40,60,10 1 I 1 10 DO 20 l=l,NSPACE I I I 20 WRITE OUTPUT TAPE ITAPE, 30 1 I I 30 FORMAT( 1H I 1 I I GO TO 60 [ 1 I 40 WRITE OUTPUT TAPE ITAPE,50 I I I 50 FORMAT IlHlJ I I I 60 CONTINUE I 1-------------------------------------1---------------------------------·-----1 I CALL CHOOSE(ZIFRST, X,X1,X2, ••• , I IF lZIFRST) 20,10,20 1 I 1 Z,Zl,l2) I 10 X=X1 I I I I ETC) I I 1 CALL AVRAGElX,LX,XAVGJ I 1 I 1=11 GO TO 30 I 20 X-X2 I I[I I lETC) I 1=12 I 30 CONTINUE I I I I 1I I 1-------------------------------------1---------------------------------------1 I CALL CHSIGNlX,LX,V) I DO 10 l=l,LX I I (SAME PROGRAM FOR FIXED POINT) I 10 VII)a-XCI' I 1-------------------------------------1---------------------------------------[ I IF (CHUSETF(X,X1,X2,ZIFX1)1 I IF CZIFX1) 20,10,20 I I 1 40,50,60 I 10 X=X1 I I I GO TO 30 I .I I I 20 X=X2 I (SAME PROGRAM FOR FIXED POINT) I 30 IF lZIFX1) 40,50,60 I 1-------------------------------------1---------------------------------------1 I X=DELTAFlV) I IF (Va 20,10,20 I I I 1 I (ARGUMENT MODE I~MATERIAL) (XOELTA FOR FIXED POINT) I 10 X=1.0 I GO TO 30 I 20 x=o.o I 30 CONTINUE I -I I I 1-------------------------------------1---------------------------------------1 1-------------------------------------1---------------------------------------1 I I I 1 PROGRAM USAGE I EQUIVALENT BASIC FORTRAN 1 I I I 1-------------------------------------1---------------------------------------1 I CALL DIVIDEIX,LX,D,Y) I DO 10 1=1,LX I I IXDVIDE OR XDVIDR FOR FIXED POINT. I 10 YIII=XIII/D I 1-------------------------------------1---------------------------------------1 1 CALL DIVKIC,X1, ••• ,XNI I X1=XI/C 1 I I ( ETC I I I IXDIVK OR XDVRK FOR FIXED POINT) I XN=XN/C I 1-------------------------------------1---------------------------------~-----I I CALL DIVKSIC1.X1,Y1 ••••• CN,XN,YNI 1 I I I IXDIVKS OR XDVRKS FOR FIXEO POINT) I Y1=X1/C1 I I ETC I I YN=XN/CN I 1-------------------------------------1---------------------------------------1 1 CALL DPRESSIX,LX.C.YI 1 DO 10 1=1,LX 1 I IXDPRESS FOR FIXED POINT) I 10 Ylll=XIII-C I 1-------------------------------------1---------------------------------------1 I CALL DUBLLIX,LXI I DO 10 l=l,LX I I IDUBLX FOR FIXED POINT) 1 10 X(II=2.0.X(11 1 1-------------------------------------1---------------------------------------1 I CALL EXCHVSILXY.X,YI I 00 10 I=I,LXY I I I TEMP=X' II I XII)=Y(I) I (SAME PROGRAM FOR FIXED POINT) I 10 Y(II=TEMP I 1-------------------------------------1---------------------------------------1 1 CALL FDOT(LXY,X,Y,DOTI I DOT=O.O I I I 00 10 1=I,LXY 1 1 1 10 OOT=DOT+X(I).Y(II I 1-------------------------------------1---------------------------------------1 I CALL FDOTRILXY,X,Y,DOTRI I DOTR=O.O { I I DO 10 I=1,LXY 1 I I J=LXY+1-1 I I I 10 DOTR=OOTR+XII).YIJ) I I 1 1 1-------------------------------------1---------------------------------~-----I 1 CALL FIXVIX,LX,IX) 1 DO 10 1=I,LX I I I 10 IXI (l=XFIXF(X(ltI 1 1-------------------------------------1---------------------------------------1 I CALL FIXVRIX,LX,IXI 1 DO 10 I=1,LX 1 I I 10 IXI()=XFIXF(XIII+.51 I 1-------------------------------------1----------------------------------------1 CALL FMTOUTIITAPE,10H8H MESSAGE) I WRITE OUTPUT TAPE ITAPE,10 I I 1 I 10 FORMAT( 8H MESSAGE) I 1-------------------------------------1---------------------------------------1 1 Y=GETXIX.IA ••••• IX,IY.IZI I I=IYIIZI I I I I=IX(I) 1 I I I IIGETX FOR FIXED POINTI I I I l=lAII) Y=XIII (ETC I I IF 1I-ICRTCl) I I I 1-------------------------------------1---------------------------------------1 I IF IINOEXFII.ICRTCL)) 10,20,30 I 1=1+1 1 I 10,20,30 I 1-------------------------------------1---------------------------------------1 I CALL HALVLIX.LX) I 00 10 1=1,LX I I (HALVX FOR FIXED POINT) I 10 XIII=XII)/2.0 I 1-------------------------------------1---------------------------------------1 I -------------------------------------1----------------------------------.----·1 I I I I PROGRAM USAGE I ·1 EQUIVALENT BASIC FORTRAN I I I 1-------------------------------------1---------------------------------------1 I CALL INTSUMIX,lX,VI I VIII-Xlll I I I IF ILX-ll 30,30,10 I I 1 10 DO 20 1=2,LX 1 I 1 20 VIII=Y(I-ll+XIII 1 I IXNTSUM FOR FIXED POINTI 1 30 CONTINUE I I-----~-------------------------------I------------------~---------------~----I I CAlL·IXCARGIX,IXI I COMMON C I ", 1 IX=XlOCF(CI-XLOCF(XI+l 1 I 1-------------------------------------1---------------------------------------1 I CAll LOCIX(II,ILOC) I IlOC=XlOCF(XI-I+1 I 1-------------------------------------1---------------------------------..... CALL MOVEILX,X,Yt 1 IF IXLOCFIXI-X10CFIYlt 10,50,30 I I I 10 DO 20 1=1,LX I 1 I I 20 VIII-XCII I I GO TO 50 1 I I 30 DO 40 1=1,lX 1 I I J=LX+I-1 I I I I 40 YIJI=XIJI I I I 50 CONTINUE ----.1 1 1-------------------------------------1---------------------------------.. -----·1I I CALL MUlKIC,X1, ••• ,XNI ... I X1=X1-C I I I IXMUlK FOR FIXED POINTI I I ETC I XN=XN-C I I 1-------------------------------------1---------------------------------------1 I CALL MULKSIC1,Xl,Y1, ••• ,CN,XN,VNI 1 Yl=C1-X1 I (ETC I I I I I VN=CN-XN I I IXMULKS FOR FIXED POINTI 1-------------------------------------1---------------------------------·-----1 I CALL MULPlVIX,lX,C,VI I DO 10 1:1,lX 1 I IXMLPLY FOR FIXED POINT) I 10 YC 1 I=C-XI lJ I 1-------------------------------------1---------------------------------------1 1 A=NTHAFIJ,A1, ••• ,ANt I TEMPC11 A1 I a 1 I I I 1 1 IXNTHA FOR FIXED POINTI I ETC I TEMPINI=AN A=TEMPIJI I I 1 1-------------------------------------1---------------------------------------1 I CALL PLURNS(A1, ••• ,AN, ••• , I CAll SUBIA1t ••• ,ANI 1 1 1 l1, ••• ,lNI I IETCI I I CALL SUBCn, ••• ,lNI 1 I CAll SUBCNI 1-------------------------------------1---------------------------------------1 I CAll REFlECIX,LX,C,YI 1 DO 10 l-l,lX I I 10 YC II=C-XC II I I IXRFLEC FOR FIXED POINT) 1-------------------------------------1----------------------------------·----1 I CALL REVER(X,lX,Vt I IF IXLOCFCXI-XlOCFIYII 10,20,10 I I I 10 N=lX I GO TO 30 I I I 20 N-ILX+lJ/2 1 I I 30 00 40 I,.. 1 , N I I I J=LX+1-1 I TEMP=XIJI 1 I I I I Y(JI=X(l1 [ I 40 Y(II=TEMP 1 I (SAME PROGRAM FOR FIXED POINTI 1-------------------------------------1---------------------------------------1 I I 1-------------------------------------1---------------------------------------1 1 I I 1 PROGRAM USAGE I I EQUIVALENT BASIC FORTRAN I f I 1-------------------------------------1----------------------------------~----I CAll REVERS(lX,X) I N=(lX+1t/2 1 1 I I DO 10 l"l,N I I I J"lX+1-I 1 I I TEMP=X(J) I 1 I X(Jt=X(U I I (SAME PROGRAM FOR FIXED POINT) I 10 XCI)-TEMP f 1-------------------------------------1---------------------------------·-----1 I Y=RNDF(X) I Y=FlOATFCXFIXFCX+.5)) I 1-------------------------------------1---------------------------------.-----1 1 Y=RNDDNF(Xt I Y-FlOATF(XFIXF(X)t I 11-------------------------------------1---------------------------------~-----I Y=RNDUPF(XI 1 IF CX) 20,10,10 I I I 10 Y=FlOATFlXFIXFCX+.99999999,t I I GO TO 30 I I 20 Y=FlOATF (XF I XF (X-. 99999999 J I I I 30 CONTINUE I 1 I 1 1-------------------------------------1----------------------------------~----I CAll RNDVCX,lX,Y) I DO 10 1-1,lX I I I 10 YU J-FlOUF(XFlXF(XU )+.5)) I 1-------------------------------------1---------------------------------------1 I CAll RNDVDN(X,lX,Y) I DO 10 l=l,lX I I I 10 Y(I '=FlOATF (XF IXF (XU tJ I I 1-------------------------------------1-------------------------------------~-I DO 30 l=l,lX 1 IF (xU JJ 20,10,10 I I I 10 Y(IJ=FlOATF(XFIXF(XIIJ+.99999999Jt I I I GO TO 30 I 1 I 20 YCI J=FlOATF(XFIXF(X(U-.99999999)) 1 I I 30 CONTINUE I 1-------------------------------------1---------------------------------------1 I Y=SAMEFClXJ I EQUIVALENCE (Y,IY) I I IY-IX I I (XSAME FOR FIxeD POINT) 1-------------------------------------1---------------------------------------1 I IF (SETAPTF(X,XNEW,FVAlUEJJ I X=XNEW I I 1 10.20,30 I IF (FVAlUE) 10.20,30 I I CAll RNDVUP(X,lX,Y) I I I I------------------------------------~I---------------------------------------1 I IF (SETESTF(X,XNEW,XCRTClIJ I 1 10.20,30 I I X=XNEW IF (XNEW-XCRTClI I I X2=C I I 10,20,30 I I 1-------------------------------------1---------------------------------------1 I CAll SETK(C.X1,X2, ••• ,XNI I X1=C I 1 (ETC I I I (SAME PROGRAM FOR F lXED PO INTI I XN-C I CAll SETKP(C1,A,B,P, C2,D,E,F,G,P, C3,H) I 1 I I 1 I B=C1 D=C2 E=C2 F=C2 GaC2 H=C3 I I I I I I 1-------------------------------------1---------------------------------------1 I B P-777777712345 I A=C1 I I I I I I I 1 2 (SAME PROGRAM FOR FIXED POINT OR MIXED MODES) 1-------------------------------------1---------------------------------..----·1 --------------------------------------~-------------------------------··----1 I I I I PROGRAM USAGE I I EQUIVALENT BASIC FORTRAN I I 1 1-------------------------------------1---------------------------------------1 I CALL SETKS(C1,A,C2,B, ••• ,CN,Z) 1 A-C1 I I I B=C2 I I (SAME PROGRAM FOR F UED PO INT 1 CETC) I I OR MIXED MODES) I Z=CN I 1-------------------------------------1---------------------------------------1 I CALL SETKV(C,LX,X) I DO 10 1-1,LX I I 10 X(I)-C I I (SAME PROGRAM FOR FIXED POINT) 1-------------------------------------1---------------------------------------1 I CALL SETKVS(C1,LX1,X1. •••• I DO 10 1:1,LX1 1 I 1 CN,LXN,XN) I 10 Xlll)-C1 1 I 1 (ETC) 1 I (SAME PROGRAM FOR FIXED POINT I DO 90 1=1.LXN I I OR MIXEO MODES) 1 90 XN(I)=CN I 1-------------------------------------1---------------------------------·~----I I I CALL SETLINI8,o,LX,X) (XSTLIN FOR FIXED POINTt DO 10 la1,LX I 10 XII'=8+D-FLOATF(I-1t I I I 1-------------------------------------1---------------------------------~·----I CALL SETlNSIB1,01.LX1,Xl, ••• , I DO 10 1=1.LX1 I 8N.oN,LXN.XN) I 10 X1II)=B1+o1-FLOATFll-1) I I 1 I ETC t I I I I ISAME PROGRAM FOR FIXED POINT I DO 90 l=l.LXN I OR MIXEO MODES) I 90 XN(IJ-BN+oN-FLOATF(I-1) I I 1-------------------------------------1---------------------------------------1 I 8 P=777777712345 I X(l)-Cl I I CALL SETVCPIX.C1, ••• ,CL.P, I IETC) 1 I 1 Y,ol, ••• ,DM,P, I X(LJ=CL I 2 ••• , I YIlI-D1 I I Z,G1, ••• ,GN) 1 IETC' I I 3 I I YIM)=DM 1 I I I ETC I I I I l ( U=G1 I I (ETCt I I (SAME PROGRAM FOR FIXED POINT OR MIXED MODES) 1 ZIN)=GN I I 1-------------------------------------1---------------------------------------·1 I CALL SETVECIX,Cl, ••• ,CN) I X(1)aCl I I I I ETCl I I (SAME PROGRAM FOR FIXED POINT) I X(NI=CN I 1-------------------------------------1---------------------------------------1 I CALL SIFT(X,M,LY,YI I DO 10 l=l,LY I I I J,. 1 + (1-1) -M I I (SAME PROGRAM FOR FIXED POINT) I 10 YII).XIJ) I I II -------------------------------------1---------------------------------.. ------1I CALL SQRoEVIX,C,LX,SSQI I SSQ-O.O DO 10 l=i,LX 1 I I I (XSQoEV FOR FIXED POINT) I 10 SSQ-SSQ+IXIIJ-CJ-IX(II-CI I 1-------------------------------------1---------------------------------------1 I CALL SQRoFRIX,Y,LXY,SSQ) I SSQ=O.O I I I DO 10 l=l,LXY I I 10 SSQ=SSQ+IXII)-YCl))--2 I I IXSQDFR FOR FIXED POINT) 1-------------------------------------1---------------------------------------1 I CALL SQROOTIX,LX~YI I DO 10 1:1,LX 1 I (XSQRUT FOR FiXED POINT) I 10 YII)=SQRTF(XII)' I 1-------------------------------------1---------------------------------------1 1-------------------------------------1---------------------------------~.----I I I I PROGRAM USAGE I I I EQUIVALENT BASIC FORTRAN I I I 1-------------------------------------1---------------------------------~-----I I CALL SQRSUMU,LX,SSQI I I IXSQSUM FOR FIXED POINTI I I I SSQ=O.O 00 10 l=ltLX I 10 SSQ=SSQ+XI[)-XIII I I 1-------------------------------------1---------------------------------~.----I I I CALL SQUAREIX,LX,YI IXSQUAR FOR FIXED POINTI I 00 10 1=I,LX I 10 Yllt=X(It-X(I) I I 1-------------------------------------1---------------------------------------1 I Y=STEPCFUI I Y=.5+SIGNFI.5,XI I I (ARGUMENT MODE IMMATERIAL I I I 1 IXSTEPC FOR FIXED POINT OUTPUTI I I 1-------------------------------------1---------------------------------.-----1 I Y=STEPLFIXI I IF IXI 20,10,10 I I I 10 Y=I.0 I 1 I GO TO 30 I I IARGUMENT MODE IMMATERIALI I 20 Y=O.O I I IXSTEPL FOR FIXED POINT OUTPUTI I 30 CONTINUE I [-------------------------------------1---------------------------------------1 I Y=XSTEPRFIX' I IF (XI 20,20,10 I I I I 10 Y=I.0 [ I GO TO 30 I I 20 Y=O.O I I (ARGUMENT MODE IMMATERIALI I 30 CONTINUE I I IXSTEPR FOR FIXED POINT OUTPUT' 1-------------------------------------1---------------------------------------1 I CALL STz(LX,XI I 00 10 1=I,LX I I 10 XCII-O.O I I ISAME PROGRAM FOR FIXED POINTI 1-------------------------------------1----------------.. ----------------------1 I CALL STISILXI,XI, •••• LXN.XNI I 00 10 l:l,LXl I I I I 10 XlIII=O.O I I I ETC) I I 00 90 1=I.LXN I I (SAME PROGRAM FOR FIXED POINT I OR MIXED MODES) I 90 XNIl)=O.O I 1-------------------------------------1---------------------------------------1 I CALL SUBK(C,Xl, •••• XN) I Xl=Xl-C I I I (ETC) I I (XSUBK FOR FIXED POINT) I XN=XN-C I 1-------------------------------------1---------------------------------------1 I CALL SUBKS(Cl,Xl.Yl •••• ,CN.XN.YNI I Yl=XI-Cl· I I I I ETC) I I IXSUBKS FOR FIXED POINT) 1 VN=XN-CN [ 1-------------------------------------1---------------------------------------[ I CALL SUM(X.LX,SUM) . I SUM=O.O . I 1 I DO 10 1=I.LX I I (XSUM FOR FIXED POINT) 1 10 SUM=SUM+XII) I I----------------------~--------------I---------------------------------------1 I 1 CAll SUMDEV(X.B,lX,SUMD) I SUMD=O.O I DO 10 1= 1. l X I 10 SUMD=SUMD+X(I)-B I I I IXSMOEV FOR FIXED POINT) I 1-------------------------------------1---------------------------------------1 1 CAll SUMDFR(X.Y,LXY.SUMD) 1 SUMD=O.O 1 00 10 l=l.LXV I 1 I I IXSMDFR FOR FIXED POINT) I 10 SUMO=SUMO+XII)-YIII I 1-------------------------------------1---------------___________________ 4 _ _ _ _ 1 1-------------------------------------1---------------------------------.-----1 1 1 1 I PROGRAM USAGE I 1 EQUIVALENT BASIC FORTRAN I I I 1-------------------------------------1---------------------------------·~----I I I I I I IF ISWITCHFIISENSEII 10.10,20 I IF (ISENSE) I 30 IF (ISENSE-61 I 40 GO TO 11,2.3,4,5,6), I 1 IF (SENSE SWITCH I' I 2 IF ISENSE SWITCH 21 I I I I I I I I 00 10 1=I,lXY I 10 OOT=DOT+X(I)*YIII 1 OOT=OOT/OIV 10,10,30 40,40.10 ISENSE 20,10 20.10 I I I I I I ETC) 6 IF ISENSE SWITCH 6) I 20.10 1-------------------------------------1---------------------------------.-----1 I CAll VOOTVIX,Y,lXY,DIV,DOT) I OOT=O.O I I I I 1-------------------------------------1----------------------------------~----I I I CAll VOVBYVIX,Y,lXY,Z) 1 DO 10 1=I,lXY I IXVORBV OR XVOVBV FOR FIXED POINT) I 10 Z(I)=XIII/V(I) I I -------------------------------------1---------------------------------------'1 I CAll VECOUTIITAPE,8H6H10F1.1, I WRITE OUTPUT TAPE ITAPE.I0, I I 1 X,ll,121 I 1 (XII),1=11,121 I I I 10 FORMA TllOF1. 11 I II -------------------------------------I ---------------------------------.. -----'1I IF IVINOEXFII,IC,IJ11 10,20,30 I I=I+IJ I I IF II-ICI 1 0 , 2 0 , 3 0 1 1-------------------------------------1---------------------------------------1 I CAll VMNUSVIX,Y,lXY,ZI I 00 10 I=l,lXY I I IXVMNSV FOR FIXED POINT) I 10 ZII)=X(I)-YtI) I 1-------------------------------------1---------------------------------------1 I CAll VPlUSVIX,Y,LXY,ZI I DO 10 1=I,lXY I I (XVPlSV FOR FIXED POINTI I 10 ZIII=XIII+Y(II I 1-------------------------------------1---------------------------------------1 I CAll VTIMSVIX,Y,lXV,ZI I 00 10 l=l,lXY I I (XVTMSV FOR FIXED POINTI I 10 ZIII=X(II*Ytll I 1-------------------------------------1---------------------------------~-----I I I X=WHICHFIX1,X2,YI I I (XWHICH FOR FIXEO POINT) I IF IVI 20,10.20 I 10 X=X1 I GO TO 30 I 20 X=X2 I 30 CONTINUE (SAME PROGRAM FOR FIXED POINT ARGUMENTS) I 40 IF IXI 20,50,20 I 50 IF (SIGNF(l.,X)-SIGNF(l.,Y)1 I 1 10,20,30 I I I I I I I I I 1-------------------------------------1---------------------------------------1 I IF (XACTEQFIX,YI) 10,20,30 I IF IX-YI 10,40,30 I I I I 1-------------------------------------1----------------------------------~----I I IF IXlIMITFIX,XA,XBI) 10,20,30 I IF IX-MAX1FIXA,XBII 40,20,30 I I (SAME PROGRAM FOR FIXED POINT I 40 IF (X-MIN1FIXA,XBII 10,20~20 I I ARGUMENTS I I I I--------------------------------~----I-_------------------------------- ~----I I CAll XlOCV(lOCV,X1, ••• ,XNI I lOCV(11=XlOCFIX11 I .. 1 1 I I 1 ETC I lOCVINI=XlOCFIXN) I 1 1-------------------------------------1---------------------------------------1 I IF (XQQZEFII)I ---,10,20 I IF (1-2-11/211 20,10,20 I 1-------------------------------------1---------------------------------··----1 SAMPLE TESTING PROGRAMS * * * * TEST BlKSUM XEQ lIST8 lABel CTlKSUM DIMENSION X(91, SI4,4,41, lS(4,41, SPACEIIOI ITEST=O 7 ITEST=ITEST+I CAll VRSOUT(Z,3,14H9H EXAMPLE ,II,ITEST,ITEST) CAll SETVEC(X,2.,4.,6.,8.1 CAll SETKVS(-9.,64,S, -9,16,lS, Z.O,I,DVSRt GO TO (1,2,31,ITEST 1 DO 10 lX=I,4 DO 10 l=l,lX 10 CAll BlKSUM(X,lX,l,DVSR,S(I,l,lXI,lSll,lXII CAll VSOUT(2,3,S(I,I,11,6HSI4I41,5H4f1.1,I,16, 1 S(I,I,Z),6HSI4I4Z,5H4f7.1,1,16, S(I,I,3),6HSI4I43, Z 5H4F1.1,I,l6, S(l,l,41,6HS14144,5H4F7.1,1,16, 3 lS(I,II,6HlSI4I4,3H4I7,1,161 GO TO 7 CAll BlKSUM(X,4,Z,DVSR,X,lS) 2 CAll VSOUT(Z,3,X,IHX,5H4F1.l,l,4, lS,ZHlS,2HI7,1,11 GO TO 7 3 CAll BlKSUM(X,-1,2,1.0,S,lS) CAll BlKSUMIX, 3,O,l.O,S,lS) CAll BlKSUM(X, 3,4,l.0,S,lS. CAll 8lKSUMIX, 3,2,O.O,S,lSI CAll VRSOUT(Z,3,18H8H S,lS = ,F1.I,I1,SPACE,S,lSI CAll EXIT END * * * * TEST CMPRA XEQ lIST8 lABEL CTCMPRA GO TO 999 10 CONTINUE Z = CMPRAF(X,Y) IZ=XCMPRAFIX,Y) FZ=CMPRFlF(X,Y) WRITE OUTPUT TAPE 2,20,J,X,Y,Z,X,Y,IZ,X,Y,FZ 20 FORMAT(IHOI2,23H. ACOMP TEST - ACOMPF( OIS,IH, 01S,4H) = GIS.81 II8X8HXACOMPF(GIS.8,IH,GIS.8,4H) = GI5.8/18X8HFlCOMPFIG15.8,IH, 2GlS.8,4H) = GI5.B) 999 J=J+l GO TO II,2,3,4,S,6,9999),J (CONTINUED NEXT PAGE) SAMPLE TESTING PROGRAMS 1 CALL SETKS GO TO 10 2 CALL SETKS GO TO 10 3 CALL SETKS GO TO 10 4 CALL SETKS GO TO 10 5 CALL SETKS GO TO 10 6 CALL SETKS GO TO 10 9999 CALL EXIT END • • • TEST CRSVM XEQ L1ST8 • LABEL (l,X,l,Va ( 1,X,-1,n (1.Z345678,X,1.Z345679,Va (6HABCDE1,X,6HABCDEZ,Va (O,X,-O,n (-50.,X,-51.,V) CTCRSVM DIMENSION AA(lOOO),BB(1000),CC(lOOO),SPACE(lOOOI COMMON AA,BB,CC,SPACE 10 J·J+1 CALL VRSOUT (Z,-1,ZOHIXIZ,lZH. CRSVM TEST,J,J) CALL RDATA (4,Z,IANS,SPACE,4HNRAC,NRAC,5HNCARB,NCARB,4HNCBC,NCBC, 1 3HLAA,LAA,2HAA,AA,3HLBB,LBB,ZHBB,BB,6HZFNBTR,ZFNBTR,6HIFSTLG, 2 tFSTLG,3HLCC,LCC) CALL CSOUT (Z,1,NRAC,4HNRAC,NCARB,5HNCARB,NCBC,4HNCBC,LAA,3HLAA, 1 LBB,3HLBB,ZFNBTR,6HZFNBTR,IFSTLG,6HIFSTLG,LCC,3HLCC) CALL HOUT (Z,1,AA,ZHAA,NRAC,NCAR8,LAA' CALL MOUT (Z,1,8B,2H8B,NCARB,NC8C,LBB) CALL CRSVM (NRAC,NCARB,NCBC,LAA,AA,L8B,BB,ZFNBTR,IFSTLG,LCC,CC) CALL ~OUT (Z,3,CC,ZHCC,NRAC,NC8C,LCCa GO TO 10 END • DATA NRAC=l NCAR8=Z NC8C s 3 lAA-4 AA=1.,Z.,3.,-Z.,5.,-4.,1.,-1. LBB=Z BB~3.,2.,4.,3.,1.,-1.,-Z.,-3.,-Z.,Z.,4.,-5. ZFNBTR=O. IFSTLG=-Z LCC=7 REtURN ZFNBTR=1. RETUR~ SAMPLE TESTING PROGRAMS • • • TEST GETX xeQ lIST8 • LABel CTGETX DIMENSION X(5),IXI5),1117),IZI3),C(10) CAll SETlIN 11.,l.,5,XI CAll SETVEC IIX,1,Z,3,4.5) 11=4 CAll YRSOUT IZ,Z,35HI3,Z6H. GETX,XGETX INPUTS - 11 ,. 13,C.l,ll) CAll YOUT IZ,l,X,lHX, 6H10F6.1,1,5) CAll YOUT IZ,1,IX,ZHIX.4H1016.1,5) Xl .. GETX IX,lll 1X1= IGETXl IX, III CAll YRSOUT IZ,Z,35H4XI4HOUTPUTS - X ,. F6.Z,4X4HIX ,. 16,C,X1,IX1) CAll SETvec (ll,4,1,1,3,5,Z,1) CAll SETVEC (IZ,l,7,5) 13=3 CAll YRSOUT (Z,Z,Z8HI3,ZZH. GETX,XGETX INPUTS - ,Z,Z) CAll YSOUT IZ,l,X,lHX,6H1DF6.Z,I,5,IX,ZHIX,4H1DI6,1,5,11,2HII, 1 4H1016,1,7,IZ,ZHIZ,4H1016,1.3,13,ZHI3,4H1016,1,lt X1=GETX (X,II,IZ.13) IX1=IGETXlIX,11,IZ,13) CAll YRSOUT IZ,Z,35H4X14HOUTPUTS - X = F6.2,4X4HIX = 16,C,X1,IX1) CAll EXIT END • TEST INTHOl • XEQ • lIST8 • lABEL CTNTHOl DIMENSION HOl(50t, FMT(50t, DATAI50t nEST,. 0 7 ITEST .. ITEST+1 CAll SETKSl1,NHOl, 6H-53.31,HOl, 6H(F6.Z),FMT, l,NDATAD) CAll YRSOUT(Z,3,14H9H EXAMPLE ,11,ITEST,ITEST) GO TO (1,Z,31,ITEST 1 CAll INTHOl(NHOl,HOl,FMT,NDATAD,NDATAA,DATA) CAll YSOUT(2,3,NDATAA,6HNDATAA,2HI7,1,1, DATA,4HDATA,4HF9.Z,l,lt 1 GO TO 7 NDATAD '" 6 2 GO TO 1 3 CAll SETKS(2,NHOl, 3HXYZ,HOl, 6H 5 -9,HOLC2t, 3,NDATADt CAll INTHOlINHOl,HOl,6HA6,213,NDATAD,NDATAA,OATA) CAll YSOUT(Z,3,NDATAA,6HNDATAA.2HI1,l,t~ 1 DATA,4HDATA,9H1X,A3,ZI1,1,3) CAll EXIT END SAMPLE TESTING PROGRAMS * * * TEST LIMITS XEQ LISTS * LA8EL CTIMITS DIMENSION S(3) CALL LIMITSl1,IANS. -0,-0,1. -0,+0.1. +0.-0,1, +0,+0,1, 1 -0,-1,-0, -0,-1,+0, +0,-1,-0, +0,-1,+0. +0.+0,+0, +0,+0,-0, 2 +0,-0,+0, +0,-0,-0, -0,+0,+0, -0,+0,-0, -0,-0,+0. -0,-0,-0) CALL VRSOUTl2, 3, 26H20H EXAMPLE 1. IANS. ,14, S, IANS) CALL LIMITSl 1,IANS1, 1.0.2.0,3.0' CALL LIMITSl21,IANS2, 3,1,4, 3.,1.,4., -3.,-4.,-1., 1,1,4, 1.2,3~ 1 4,1,4) CALL LIMITSl31,IANS3, 0.,0.,0., 1,1,1, ~1,-1,-1. 3.1,2, 0,1,2) CALL VRSOUTl2, 3, 32H25H EXAMPLE 2. IANS1 ••• 3. ,314, S, 1 IANS1, IANS2, IANS3) CALL LIMITSl 1,IANS1, 1.0,3.0,2.01 CALL LIMITSl21.IANS2, 3,4,1, 3.,4.,1., -3.,-1.,-4., 1,4,1, 1,3,2~ 1 4,4,1) CALL LIMITSl31,IANS3, 0.,0.,0., 1,1,1, -1,-1,-1, 3,2,1, 0,2,1) CALL VRSOUTl2, 3, 32H25H EXAMPLE 3. IANS1 ••• 3 = ,314, S, 1 IANS1, IANS2, IANS3) CALL EXIT END * TEST SHUFFL NEEDS LOGICAL 9 XEQ LIST8 * LABEL CTHUFFL DIMENSION IRDl100',ISPACElI0),IXSHFll10),IXSHF2l10) ITP=9 CALL SETVEClIRD,1,0,0,9.7,3,2,5,3,3,7,6,5,2,O,l,3.5,8,6,3,4,6,7,3, 1 5,4,8.7,6,8,0,9,5,9,0,9,1,1,7,3,9,2,9,2,7,4,9,4,5, 2 3,7,5,4,2,0,4,8,0,5,6,4,8,9,4,1,4,2,9,6,2,4,8,0,5, 3 2,4,0,3,1,2,0,6,3,6,1,0,4,0,2,0,0,8,2.2,9,1.6,6,5) REWIND ITP WRITE OUTPUT TAPE ITP, 10, lIROlI),1-1,1001 10 FORMATl5011, 29X, IH ) REWIND ITP CALL SHUFFLIITP,1,ISPACE,IXSHF1) CALL SHUFFLlITP,10,ISPACE,IXSHF2) CALL VSOUTI2,5,IXSHF1,6HIXSHF1,8H20X,1014,l,7, 1 IXSHF2,6HIXSHF2,8H20X,10I4,1,10) REWIND ITP CALL EXIT END • • SAMPLE TESTING PROGRAMS • TEST SIFT • XEQ • LISTS lABEL • CTSIFT DIMENSION X(501, XSl(50), XS2(50), XS3(SO), XS4(50), XS5(50), 1 XS6(50), FMT(2) CAll SETlIN(l.,l.,lO,X) CAll SETK(-9.,XS5,XS6) CAll PlURNS(X,O,3,XSl, X,1,3,XS2, X,3,3,XS3, X,3,1,XS4, 1 X,-1,3,XS5, X,1,0,XS6, X,5,2,X) CAll SIFT(4) CAll FMTOUTeZ, 20HIIIII,11H EXAMPLE 1.) CAll SETVEC(FMT,6HflOX,1,6HOF5.1) CALL VSOUT(2,3, XSl,3HXSl,FMT,1,3, XS2,3HXS2,FMT,1,3, 1 XS3,3HXS3,FMT,1,3, XS4,3HXS4,FMT,1,1, XS5,3HXS5,FMT,I,1, 2 XS6,3HXS6,FMT,1,1, X,lHX,FMT,l,lOI CALL EXIT END • TEST SIZEUP, SIZUPl XEQ • • LISTS • LABel CTlZEUP DIMENSION XClO), INDEXlllO), INDEX2flO) ITEST = 0 1 ITEST • ITEST+l LX = 5 CALL SETVECeX, 3.,-10.,-1.,2.,0.) GO TO (1,2,3),ITEST 1 CALL SIZEUP(X,LX,INOEX1) CALL SIZUPL(X,LX,INOEXZI CALL VRSOUT(Z,3,14HQH EXAMPLE ,I1,ITEST,ITEST) CALL VSQUT(2,3, INOEXl,6HINDEXl,3H5IS,I,S, 1 INDEX2,6HINDEX2,3H515,1,51 GO TO 1 2 CALL SETVECIX ,1HX,lHA,lHC,lHN,lHA) GO TO 1 3 CALL EXIT END SAMPLE TESTING PROGRAMS * TEST TIMA2B XEQ * lIST8 * lABEL CTTMA2B COMMON X,SPACE DIMENSION X(100ll,SPACE(3001 B XLXA=053400000000 CALL SETKV (XlXA,lOOI,XI lOCB=XlOCFlXI CAll ClKON 10 J=J+l CAll VRSOUT (2,l,llHIXI2,13H. TIMAlB TEST,J,JI CAll ROATA (4,O,IANS,SPACE,4HNREG,NREG,6HINDUMP,INDUMP,6HMINACC, 1 MINACC) CAll ClOCKl(l,TIMEI CAll TIMAlB (lOCB-NREG,lOCB,MINACC,SECSI CAll ClOCKl(l,TIMEI CAll CSOUT (Z,1,NREG,4HNREG,MINACC,6HMINACC,SECS,4HSECS,TIME, 1 4HTIME I GO TO 10 END * DATA NREG=lOOO MINACC=lOO INDUMP=l. RETURN NREG=lOO INDUMP=O RETURN NREG=lO RETURN NREG=2 RETURN NREG=1 MINACC=lOO RETURN * SAMPLE TIMING PROGRAMS * TIME TEST QACORR AND FORAC • XEQ • LIST8 * LABEL CTIMQAC DIMENSION X150001, SPACE(12000), ACORI50001 COMMON SPACE, X. ACOR C C OUTERMOST LOOP DECIDES WHETHER FULL AUTOCORRELATION OR CIllO AUTOCORRELATION IS TO BE COMPUTED. THE NEXT LEVEL LOOP C SELECTS ONE OF 5 ACCURACY CONSTANTS FOR QACORR. C DO 100 IXFR=1.2 FRCTN = NTHAFIIXFR, .10, 1.01 DO 100 IXA=l,5 MXACC = XNTHAFIIXA, 25,50,100.250,5001 C C THE INNERMOST LOOP SELECTS ONE OF 7 DATA LENGTHS, ACQUIRES THE DATA, C TIMES THE CORRELATION PRODUCED BY QACORR AND THEN BY FORAC, C EXCEPT THAT OPERATION OF FORAC IS BYPASSED FOR DATA LENGTHS C EXCEEDING 1000, AND FOR ACCURACY INDICES OTHER THAN 1 • C DO 100 IXL=1,7 LX = XNTHAFIIXL, 25,50,100.250,500,1000,5000) MXLAG = XFIXFIFRCTN*FLOATFILX)) - 1 CALL GIVEX ILX, Xl CALL TIMSUBI50, SECSQAI CALL QACORRIX, LX, MXACC, MXLAG, SPACE, ACOR, IANSI CALL VRSOUT(2, 2, 1 49H34H LX, MXACC, MXLAG, IANS, SECSQA = , 416, F12.4, 2 SPACE, LX, MXACC, MXLAG, IANS, SECSQA) IF (IXA-ll 100,10,100 10 IF (LX-I0001 80,8C,100 80 CALL GIVEX (LX, X) CALL TIMSUB(50, SECSFAJ CALL FORAC (X, LX, MXLAG, ACORI CALL VRSOUTI2, 2, 36H21H LX, MXLAG, SECSFA ,215, F12.4, 1 SPACE, LX, MXLAG, SECSFAI 100 CONTINUE CALL EXIT END SAMPLE TIMING PROGRAMS - * CFORAC FORAC, LISTS LABEL FORTRAN AUTOCORRELATION FOR COMPARISON WITH QACORR SUBROUTINE FORAClX, LX, MXLAG, ACOR) C C TOKEN DIMENSIONS C DIMENSION X(2), ACOR(Z) JMAX = MXLAG + 1 00 20 J=l,JMAX SUM .. 0.0 NMAX = LX - J + 1 00 10 l=l,NMAX K 10 20 - * * CGIVEX .. J + I SUM .. SUM + X(I)-XIK-1) ACORIJt .. SUM RETURN END GIVEX, LISTS LABEL PROVIDES A DATA VECTOR FOR QACORR TIME TESTS SUBROUTINE GIVEXILX, xt C C TOKEN DIMENSIONS C DIMENSION X(2) C C THE DATA VECTOR PROVIDED IS A MORE OR LESS WHITE LIGHT SERIES C WITH VALUES IN THE RANGE -1.0 TO +1.0 C 10 00 10 l=l,LX XII)" COSFl100.-FLOATFlllt RETURN END SAMPLE TIMING PROGRAMS • TIME TEST ASPECT • XEQ • LISTS LABEL • CTIMASP DIMENSION ACOR(5001t, SPECT(1001', SPACE(2010), COSTAS(10011 COMMON ACOR, SPECT, SPACE, COSTAB C C INITIALIZE SY SETTING UP THE AUTOCORRELATION OF A SAW-TOOTH. C CALL SETLIN(500l., -I., 5001, ACOR) CALL SQUARECACOR, 5001, ACORI C C OUTER LOOP SELECTS ONE OF SIX FREQUENCY INCREMENT CONSTANTS, C AND ESTABLISHES THE CORRESPONDING COSINE TASLE. C 00 100 IXMFRQ=l,6 MFREQ = XNTHAF(IXMFRQ, 25,50,100,250,500,10001 CALL COSTBL(MFREQ, COSTABI C C INNER LOOP SELECTS ONE OF S CORRELATION LENGTHS AND PROCEEDS WITH C THE TIMING. BUT HAS A BYPASS FOR CASES IN WHICH THE NO. OF C FREQUENCIES EXCEEOS THE CORRELATION LENGTH. C 00 100 IXMXLG=l,8 MXlAG = XNTHAF(IXMXLG, 25,50,100.250,500,1000.2500,50001 IF (MXlAG-HFREQ) 100.10.10 10 CAll TIMSUB(50. SECSAS) CAll ASPECT(ACOR. MXlAG, COSTAS. MFREQ, 0, MFREQ, 1 1.0, SPECT. SPACE, DUMMY. ERRI CALL VRSOUT(Z. 2, 1 45H29H MXLAG, MFREQ. ERR. SECSAS = , 216, 2F12.4, 2 SPACE. MXLAG. MFREQ. ERR, SECSASI 100 CONTINUE CAll EXIT END SAMPLE TIMING PROGRAMS • TIME TEST WLLSFP AND SIMEQ XEQ * LIST8 * LABEL CTIMWAS DIMENSION X(50Zl, R(50Zl, G(500l, A(501l, C(1010), SPACE(100Z), AA(10000), BB(lOl), EII01) 1 COMMON AA, SPACE, C * C C C C C INITIALIZE BY SETTING UP THE NORMALIZED AUTOCORRELATION OF A SAWTOOTH IN R(I ••• 501), AND A LINEAR RIGHT HAND SIDE IN G(1 ••• 500). (THE NORMALIZATION IS NECESSARY TO PREVENT OVERFLOW IN SIMEQ.) THE VARIABLE NAMES ARE CHOSEN AS DEFINED 8Y WLLSFP. C CALL CALL CALL LR '" CALL CALL SETLIN(O.O, l.C, 501, X) WAC (50l, X, 50l, R) DIVIOE(R, 501, R, R' 500 SETLINll.O, l.O, 500, G) DIVIDE(G, 500, G(500), G) C C LOOP SELECTS ONE OF 8 MATRIX SIZES, LA, RANGING FROM 3 TO 500. C TIMES WLlSFP FOR THIS SIZE, AND THEN, PROVIDED LA DOESN'T C EXCEED 100, TIMES SIMEQ. C 00 100 IXLA=1,8 LA XNTHAF(IXLA, 3,5,10,Z5,50,100,Z50,500) CALL TIMSU8(50, SECSWL) CALL WLLSFP(LR, R, G, LA, A, C' CALL VRSOUTIZ, Z, Z8H14H LA, SECSWL '" , 15, FIZ.4, I SPACE, LA, SECSWL) IF (LA-100) 80,80,100 C C SINCE SIMEQ DESTROYS BOTH THE INPUT MATRIX AND THE RIGHT HAND SIDE, C THESE INPUTS MUST BE ESTA8LISHED FOLLOWING A CALL INTMS8 STATEMENT C AND PRIOR TO THE CALL TIM5U8 STATEMENT. C CALL INTMS8 CALL REVER (R, 501, SPACE) CALL REVER (SPACE, 500, SPACE(50Z) 00 90 l=l,LA K '" 50Z - I J = 1 + (l-ll*LA 90 CALL MOVE (LA, SPACEIKl, AA(J)) o = 1.0 CALL MOVE (LA, G, B8) CALL TIMSU8(50, SECSIM) CALL SIMEQ (LA, LA, 1, AA, 88, 0, E, ERR) CALL VRSQUT(Z, Z, 34H19H LA, ERR, SECSIM = , 15, ZFlZ.4, 1 SPACE, LA, ERR, SECSIM) 100 CONTINUE CALL EXIT END 80 3 Program Categorizations The usages presented in Section 2 are only samples, and highly specialized ones at that. For systematic access to programs of interest one needs an orderly indexing such as that provided by the general sortings discussed in this section. The characteristics on which these categorizations are based can be broadly divided into functional and nonfunctional ones. The functions performed by the programs of Section 10 can be grouped into the following fifteen classes. 1. 2. 3. 4. 5. 6. 7. 8. 9. Administration Input-output Data transmission and access Data-form changing Data generation Da ta inquiry Elementary numerical functions Miscellaneous numerical functions 10. 11. 12. 13. 14. 15. Probability and statistics computations Integration and differentiation 2-D array and 3-D array operations Polynomial computations Correlation and convolution Harmonic transformation Miscellaneous spectral-analysis operations In the following Summary of Functional Classifications, each of these classes is broken down into a number of subclasses or categories, according to which the programs are sorted in the bulk of this section. This summary thus delineates the scope of the programs and constitutes a starting point in a functionally oriented search of the library. It should be noted that there is some overlap in the category definitions. Moreover, programs with multiple functions may appear in two or more of the categories. The remainder of the section is then devoted to program sortings based on nonfunctional characteristics such as authorship, language, linkage, and equipment uses, and on subjective qualities such as speed and utility. The categories used there are self-explanatory except, perhaps, for the term "FAP necessarily," by which we imply that it is either impossible or extremely awkward to express the function performed using only basic FORTRAN statements. 39 Ell SUMMARY OF FUNCTIONAL CLASSIFICATIONS I I I I •••••••••••••••••••••••••••••• I •••••••••••••••••••••••••••••• I FOR CONTROL OF PROGRAM FLOW I FOR EXPANDING SYSTEM CAPABILITY I FOR UNORTHODOX SUBROUTINE USAGE I FOR INDEX LOGIC I FOR DOCUMENTING EXECUTIONS I FOR EQUIPMENT CONTROL I FOR PROGRAM TIMING I FOR ABSOLUTE MEMORY INFORMATION I FOR PROPER USE OF MISNAMED VARIABLES I I I •••••••••••••••••••••••••••• I • 2. INPUT-OUTPUT PROGRAMS • I I I I I I I I I I I I •••••••••••••••••••••••••••• I FOR BCD INPUT TO CORE I FOR BINARY INPUT TO CORE I FOR BCD OUTPUT FROM CORE I FOR BINARY OUTPUT FROM CORE I FOR GRAPHICAL OUTPUT FROM CORE I FOR FORMAT PURPOSES I I •••••••••••••••••••••••••• I • 3. DATA TRANSMISSION • AND ACCESS PROGRAMS • I • I •••••••••••••••••••••••••• I FOR STORAGE-TO-STORAGE MOVEMENT I FOR STORAGE-TO-TAPE MOVEMENT I FOR TAPE-TO-STORAGE MOVEMENT I FOR TAPE-TO-TAPE MOVEMENT I fOR INFORMATION STORAGE I FOR INFORMATION RETRIEVAL I I I •••••••••••••••••••••••••••••••••• I • 4. DATA FORM-CHANGING PROGRAMS. I •••••••••••••••••••••••••••••••••• I FOR CONVERTING DATA MODE I fOR PACKING DATA I fOR UNPACKING DATA I FOR SCALING OAT A I FOR NORMALIZING DATA I fOR ROUNDING DATA I FOR SHIFTING DATA I FOR CHANGING DATA SPACING I I I I I I I I I I • 1. ADMINISTRATIVE PROGRAMS. ••••••••••••••••••••••••••••••• • ••••••••••••••••••••••••••• • ••••••••••••••••••••••••••• • 6. DATA INQUIRY PROGRAMS. fOR FOR FOR FOR FOR FOR FINDING EXTREMAL VALUES COMPARING DATA SEARCHING DATA SELECTING DATA ORDERING DATA CLASSIFYING DATA ••••••••••••••••••••••••••• • 7. ELEMENTARY NUMERICAL. • PROGRAMS • ••••••••••••••••••••••••••• I fOR ADDITION I FOR SUBTRACTION I FOR MULTI PLICA TI ON I fOR DIVISION I FOR MODIFYING SIGN I FOR RAISING TO POWERS I FOR TAKING ROOTS I fOR TRIGONOMETRIC FUNCTIONS I FOR COLLAPSING VECTORS I FOR ROTATING VECTORS I fOR REVERSING VECTORS I FOR EXCHANGING VECTORS I FOR REfLECTING VECTORS I I I •••••••••••••••••••••••••••••• I • 8. MISCELLANEOUS NUMERICAL • I • PROGRAMS • I •••••••••••••••••••••••••••••• I FOR INTERPOLATION I fOR SAMPLE BASE CHANGING I fOR GENERATING SINUSOIDS I fOR TRIGONOMETRIC FUNCTIONS I FOR TREATING ODD AND EVEN PARTS I FOR fiTTING EQUATIONS TO DATA I FOR CONTOURING I fOR DELTA AND STEP fUNCTICNS I FOR CONVERTING COMPLEX NUM8ERS I FOR MOVI NG SUMMATION I FOR INVERTING FUNCTIONS I fOR DOT PRODUCTS I • 5. DATA GENERATING PROGRAMS. I I FOR FOR FOR FOR FOR I I I I I ••••• ** •••••••••••••••••••••••• GENERATING HOllERITH GENERATING RANDOM NUMBERS GENERAl ING SINUSOIDS GENERATING SCALARS GENERATING 1-0 ARRAYS PAGE 1 OF 2 I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I SUMMARY OF FUNCTIONAL CLASSIFICATIONS I •••••••••••••••••••••••••••••••••• I. 9. PROBABILITY AND STATISTICS • I •••••••••••••••••••••••••••••••••• I I I I I I I I I I I I FOR FOR FOR FOR FOR FOR FOR FOR FOR FOR FOR FOR FINDING MOMENTS FINDING AVERAGES FINDING R.M.S. VALUES FINDING SUMS OF SQUARES FINDING SUMS OF DIFFERENCES GENERATING RANDOM NUMBERS RANDOMIZING DATA FINDING DISTRIBUTIONS PROBABILITY TRANSFORMATION CHI-SQUARE ANALYSIS DEPENDENCY TESTING NORMAL CURVE INTEGRATION I I I •••••••••••••••••••••••••••••••• I • 10. INTEGRATION AND • I • DIFFERENTIATION PROGRAMS. I •••••••••••••••••••••••••••••••• I I I I I FOR FOR FOR FOR FOR DEFINITE INTEGRATION INDEFINITE INTEGRATION DIFFERENTIATION INDEFINITE SUMMATION DIFFERENCING I I I •••••••••••••••••••••••••• I • 11. 2-D ARRAY AND • I • 3-D ARRAY PROGRAMS • I •••••••••••••••••••••••••• I I I I I I I I I I FOR FOR FOR FOR FOR FOR FOR FOR FOR FOR FOR FOR FOR FOR FOR FOR I I I I I I MATRIX MULTIPLICATION MATRIX INVERSION SOLVING MATRIX EQUATIONS DETERMINANT EVALUATION MATRIX TRANSPOSITION MATRIX FACTORIZATION 2-D ARRAY ROTATION INTERPOLATING 2-D ARRAY COLUMNS 2-D ARRAY DOT PRODUCTS 2-D ARRAY CORRELATION 2-D ARRAY FOURIER TRANSFORMATION SOLVING 2-0 ARRAY EQUATIONS MATRIX VECTOR REVERSAL MATRIX VECTOR DOT PRODUCT MATRIX VECTOR CORRELATION SOLVING MATRIX VECTOR EQUATIONS PAGE 2 OF 2 I ••••••••••••••••••••••••••• { I II ...........................1 FOR POLYNOMIAL EVALUATION I I • 12. POLYNOMIAL PROGRAMS. I I I I I FOR FOR FOR FOR FOR FINDING POLYNOMIAL ROOTS POLYNOMIAL MULTIPLICATION POLYNOMIAL DIVISION POLYNOMIAL SQUARE ROOTS SYNTHESIZING POLYNOMIALS I I I I I 1 I I 1 I • 13. CORRELATIONS ANt. I • CONVOLUTIONS. { I •••••••••••••••••••••••• I I I •••••••••••••••••••••••• 1 I I I I I FOR FOR FOR FOR AUTOCORRELATION CROSS-CORRELATION CONVOLUTION DOT PRODUCTS I I I I I I ••••••••••••••••••••••••••• I I [ I • 14. HARMONIC TRANSFORMS • I ••••••••••••••••••••••••••• 1 I I I I FOR FOR FOR FOR I COSINE TRANSFORMATION SINE TRANSFORMATICN FOURIER TRANSFORMATION INVERSE FOURIER TRANSFORMATION I I I •••••••••••••••••••••••••••••• I • 15. MISCELLANEOUS SPECTRAL • I • ANALYSIS PROGRAMS • I •••••••••••••••••••••••••••••• I FOR DANIELL WEIGHTING I I I I I I FOR FOR FOR FOR FOR FOR I 1 I I I I I I I I 1 I SPECTRAL FACTORIZATION GENERATING NUMERICAL FILT£RS I CONVERTING TO AMPLITUDE AND PHAS!I CONVERTING TO REAL AND IMAGINARY I SPECTRAL COMPARISCNS I GENERATING SINUSOIDS I I I I 1 I I I I I I I I I I Time-Series Computations in FORTRAN and FAP The sorted lists which will follow below need some introduction with regard to format. First of all, the sortings have been made on the basis of names of principal entries, and the lists are alphabetically ordered with respect to these names. In the case of multiple-entry programs, the names of the secondary entries appear as a parenthetical list following each appearance of the principal entry name. However, a parenthetical list following a name is not necessarily a list of secondary entries; it may alternatively be a list of functionally related programs. For example, each !lPpearance of the Fourier-transform program QFURRY is followed by a parenthetical reference to the inverse Fourier-transform program QIFURY, and conversely. Secondly, it should be noted that we run into an occasional problem resulting from the fact that the present sortings are necessarily based on six-character names for the principal entries, whereas in the program listings of Section 10 we sometimes have appended serial numbers and/or computer numbers to distinguish between programs of identical principal entry names. The sortings have been made on the basis of effective names. The effective names are identical to the principal entry names in cases where no ambiguity can arise. Effective names for the exceptional cases are listed below. Effective Name True Name Effective Name True Name CLOCK1 CLOCK1 (7090) LINE LINE (709) CNVLV2 CONVLV-II LINE90 LINE (7090) DISPLA DISPLA (709) LINEH LINEH (709) DSPL 90 DISPLA (7090) LINH90 LINEH (7090) FRAME FRAME (709) LINEV LINEV (709) FRAM90 FRAME (7090) LINV90 LINEV (7090) FT24II HST2 FT24 -II HSTPLT -II MULK2 SETK2 MULK -II SETK -II HST309 HSTPLT -III (709) SETKS2 SETKS -II HST390 HSTPLT -III (7090) TIMA2B TIMA2B (7094) 42 PROGRAMS SORTED BY FUNCTION •••••••••••••••••••••••••••••• • 1. ADMINISTRATIVE PROGRAMS • •••••••••••••••••••••••••••••• FOR CONTROL OF PROGRAM FLOW INDEX (CHUSET, SETAPT, SETEST, VINDEX), SEVRAL (PLURALI. FOR EXPANDING SYSTEM CAPABILITY FNDFMT, GETX ( IGETXI, LOCATE ARG, CALL, CAll2, RETURN, SETSBV, SETUP, STORE, WHERE, XARG, XINDEX, XNAME, XNARGSI, (STH I, (STHDt, (STH"II, PLURNS, RDATA, REREAD (ENDFIL, ONLINE (TSH I, (TSHM», RPLFMT, EOFSET, SAME ( XSAME), SEVRAL (PLURAL), VARARG. FOR UNORTHODOX SUBROUTINE USAGE LOCATE ( ARG, CAlL, CAll2, WHERE, XARG, XINDEX, XNAME, VARARG. RETURN, SETSBV, XNARGSI, PLURNS, FOR INDEX LOGIC FASTRK, GETX ( IGETX), LOCATE ARG, CAll, WHERE, XARG, XINDEX, INDEX (CHUSET, SETAPT, CAll2, RETURN, SETSBV, XNAME, XNARGS). FOR DOCUMENTING EXECUTIONS DADECK, LISTNG, MEMUSE, RDATA, FOR EQUIPMENT CONTROL CLKON, FRAME (FRAM90), CARIGE, (STHM», REREAD (ENDFIL, EOFSET, SWITCH, TRMINO, lEFBCD CZEFBINI. FOR PROGRAM TIMING CLKON, CLOCK1, T1MA2B, TIMSUB FOR ABSOLUTE MEMORY INFORMATION IXCARG, LOC, MEMUSE, XLCOMN, SETUP, STORE, SEVRAL (PLURAL) , SETEST, SETUP, VIND"EX), STORE, XLCOMN. FSKIP, (TSH), ONLINE ( (STH). nSHM) I, RSKIP, CSTHDJ, SETI NO, (TSHM)), lEFBCO (lEFBINt. (INTMSBI. XLOCV. FOR SUBROUTINE LIBRARY STUDY (NO ENTRIES FOR THIS CATEGORY) FOR PROPER USE OF MISNAMED VARIABLES SAME (XSAMEI • •••••••••••••••••••••••••••• • 2. INPUT-OUTPUT PROGRAMS • •••••••••••••••••••••••••••• FOR BCD INPUT TO CORE RDATA, REREAD (ENDFIL, EOFSET, FOR BINARY INPUT TO.CORE INDATA, PACDAT, ZEFBCD (ZEFBINI. (TSHI, PROGRAMS SORTED BY FUNCTION --------------------------FOR BCD OUTPUT FROM CORE COLABL, CSOUT, CVSOUT, MOUTAI, ONLINE ( (STH I, VRSOUT, VSOUT. DISPLA (DSPL90), FMTOUT, (STHDI, (STHM), PWMLI V. MLI2A6. VECOUT, MOUT, VOUT. FOR BINARY OUTPUT FROM CORE OUDATA, WRTDAT. FOR GRAPHICAL OUTPUT CNTRDB, CNTROW, ( HST2, HST309. (LINV90t. PLOTVS, FROM CORE CONTUR, OISPLA HST3901, LINE PLTVS1. FOR FORMAT PURPOSES COLABL, DSPFMT, FNDFMT, (DSPL90t, (LINE90 I. GRAPH, GRAPHX, HSTPLT lINEH (LINH90) • LINIiV RPLFMT • •••••••••••••••••••••••••• • • 3. DATA TRANSMISSION AND ACCESS PROGRAMS • • •••••••••••••••••••••••••• FOR STORAGE-TO-STORAGE MOVEMENT EXCHVS, MOVE, MOVECS, MOVREV, MRVRS, MVBLOK. TRMINO, WRTDAT. FOR STORAGE-TO-TAPE MOVEMENT GETRD1, OUDATA, WRTDAT. FOR TAPE-TO-STORAGE MOVEMENT INDATA, PACDAT. FOR TAPE-TO-TAPE MOVEMENT CPYfl2, DADECK. FOR INFORMATION STORAGE OUDATA, PAKN lUNPAKNI, SETINO, FOR INFORMATION RETRIEVAL GETX « IGETX) , INDATA, PAKNI • LISTNG, NTHA ( XNTHA I, PACDAT, UNPAKN •••••••••••••••••••••••••••••••••• • 4. DATA FORM-CHANGING PROGRAMS • •••••••••••••••••••••••••••••••••• FOR CONVERTING DATA MOOE FIXV ( FIXVRI. FLOATM, HOATV, FXDATA (HDATA), HVTOIV XFIXM. INTHOL, ITOMLI , IVTOHV (HVTOIVI, MLI 2A6. FOR PACKING DATA PAKN lUNPAKNI. FOR UNPACKING DATA UNPAKN ( PAKN). FOR SCALING DATA FXOATA (HDATA I, MLISCL, SCPSCL, SMPSON. l'IVTOHV. , PROGRAMS SORTED BY FUNCTION FOR NORMALIZING DATA FXDATA (FLDATA', NMZMG1, FOR ROUNDING DATA FIXV I FIXVRa, FXDATA (RNDVDN, RNDVUP" XDIV (XDVRBV). FOR SHIFTING DATA HLADJ ( HRADJt, ITOMLI, NRMVEC. (FLDATAt. RND I XDIVRt, XDVIDE LSHFT ( RNODN, I XDVIDR', RNDUPt, RNDV XFIXIoi, XVOVBV IXLSHFT), SHFTR1, SHFTR2. FOR CHANGING DATA SPACING MOVREV • ••••••••••••••••••••••••••••••• • 5 • DATA GENERATING PROGRAMS • ••••••••••••••••••••••••••••••• FOR GENERATING HOLLERITH GENHOL, GETHOL. GNHOL2. FOR GENERATING RANDOM NUMBERS GETRD1. FOR GENERATING SINUSOIDS COSTBL (COSTBX, SINTBL, SINTBX), SEQ SAC FOR GENERATING SCALARS SETK I SETKS, SETVECt, SETK2, FOR GENERATING 1-0 ARRAYS SETK ( SETKS, SETVEC I, STZ, IXSTLINt, SETLNS, SETKP (SETVCPI, STZS • SETKP (NEXCOS, NEXSINI. (SETVCPI, SETKS2. SETKV, SETKVS, SETLIN IMAXABM, MINAB~, MINSNM). •••••••••••••••••••••••••••• • 6• DATA INQUIRY PROGRAMS • •••••••••••••••••••••••••••• FOR FINDING EXTREMAL VALUES MAXSN ( MAXAB. MINAB, MINSN) , MAXSNM FOR COMPARING DATA CMPARP (CMPARSI. (CHUSET, SETAPT, CALLZ, RETURN, XNAME, XNARGS', CMPARV (CMPARLI , CMPRA (CMPRFL, SETEST, VINDEXI, LIMITS, LOCATE WHERE, SETUP, STORE, SETSBV, XAC TEQ, XLIMIT. FOR SEARCHING DATA FASCN1, FASTRK, NXALRM, FOR SELECTING DATA CHOOSE, GETX FOR ORDERING DATA SIZEUP (S I ZUPLI. FOR CLASSIFYING DATA MONOCK, XODZE. IGETX I, SEARCH, NTHA ( XCMPRAI, INDEX ARG, CALL, XARG, XINDEX, SRCH1. XNTHA' , WHICH (XWHICHI. PROGRAMS SORTED 8Y FUNCTION •••••••••••••••••••••••••••••••••••• •••••••••••••••••••••••••••••••••••• • 7. ELEMENTARY NUMERICAL PROGRAMS • FOR ADD IT ION ADDK I ADDKS, DIVKS, DIVK. XADDK, XADDKS, XDIVK. XDIVKS. XSUBK. XSUBKS1, BOOST (DPRESS, SUM ( XSUM), VPLUSV IVMNUSV, MULK. XDVRK. X800ST, XVMNSV, SUSK, MULK2, XDVRKS, XMULK, XDPRSS), FAPSU .... XVPLSV I. SUSICS, XMULKS, NRMVEC. FOR SUBTRACTI ON ADOK (ADDKS, DIVK, DIVKS, XDIVK, XDIVKS, XADDK. XADDKS. XSUBK. XSUBKSt. BOOST (DPRESS, (VMNUSV. XVMNSV. XVPLSV), XREMAV. MULK. XOVRK. XBOOST. MULK2. XDVRKS. XDPRSSI. SUSK, XMULK, REMAV, SUBKS, XMULKS t VPLUSV FOR MULT I PLI CA TI ON ADDK ( ADDKS. DIVK, DIVKS. XADDK, XADDKS. XDIVK. XDIVKS, XSUBK. XSU8KSI. DUBLX ( DU8lL, MULPlY. VTIMSV (XVTMSVI. MULK, XDVRK. HALVl, MULK2. SUSKt XMULK, XDVRKS. HAlVX), MLlSCl. SUBKSt XMUlKS. MULK2, FOR DIVISION MUlK2, ADDK ( ADDKS, DIVK, DIVKS, MULK. XOIVK, XDIVKS. XAODK, XADOKS, XDVRK. XDVRKS. HAlVL, XSUBK, XSUBKS I, DIVIDE. DUBlX ( DUBll, XDIV ( XOIVRI, XDVIDE (XDVIDRI, XVDVSV ( XDVRBVI. FOR MODIFYING SIGN ABSVAL. CHPRTS (RVPRTSI, CHSIGN, FOR RAISING TO POWERS MVSQAV, POWER (SMPROV I, SQRMlI, MOVREV. SQUARE FOR TAKING ROOTS SQROOT, XSQRUT. FOR TRIGONOMETRIC FUNCTIONS ARCTAN, SEQSAC (NEXCOS, NEXSINI. FOR COLLAPSING VECTORS COLAPS. KOLAPS. FOR ROTATING VECTORS ROTAH. FOR REVERSING VECTORS CHPRTS (RVPRTSI, MOVREV t FOR EXCHANGING VECTORS EXCHVS. FOR REFLECTING VECTORS REFLEC (XRFLECI. REVER, REVERS. (XSQUARI. SU8MS, SU8K. XMULK. XMULKS. HALVXI, VDVBYV, PROGRAMS SORTED BY FUNCTION *************************************** * 8. MISCELLANEOUS NUMERICAL PROGRAMS * *************************************** FOR INTERPOLATION ARBCOL, EXPAND, INTOPR, LINTRl, QINTRI. FOR SAMPLE BASE CHANGING EXPAND, NURINC, SIFT. FOR GENERATING SINUSOIDS COSTBL ICOSTBX, SINTBL, SINTBXI, SEQSAC FOR TRIGONOMETRIC FUNCTIONS ARCTAN, SEQSAC (NEXCOS, NEXSINI. INEXCOS, NEXSINI. XSTEPC, XSTEPL, FOR TREATING ODD AND EVEN PARTS CHPRTS IRVPRTSI, SPLIT I REFITI. FOR FITTING EQUATIONS TO DATA CUFIT1, INTOPR, LSLINE, PRBFIT, QUFITI. FOR CONTOURING CNTRDB, CONTUR. FOR DELTA AND STEP FUNCTIONS DELTA I STEPC, STEPL, STEPR, XDELTA, MVNSUM, MVSQAV. XSTEPRI. FOR CONVERTING COMPLEX NUMBERS AMPHl I REIMI. FOR MOVING SUMMATION BLKSUM, MUVADD, MVINAV, FOR INVERTING FUNCTIONS IFNCTN. FOR DOT PRODUCTS DOTJ, FOOT I FDOTRI, VDOTV. ********************************* * 9. PROBABILITY AND STATISTICS * ********************************* FOR FINDING MOMENTS POWER ISMPRDVI. FOR FINDING AVERAGES AVRAGE, MVINAV, MVSQAV, XREMAV. REMAV, TAMVL I TAMVRI, XAVRGE FOR FINDING R.M.S. VALUES RMSDEV IRMSDAVJ. FOR FINDING SUMS OF SQUARES SQRDFR ISQRDEVI, SQRSUM IXSQSUMI, XSQDFR (XSQOEVI. (XAVRGRI, PROGRAMS SORTED BY FUNCTION FOR FINDING SUMS OF DIFFERENCES SQRDFR lSQRCEVl, SUMDFR ISUMDEV, XSMOEV, XSMCFRt, XSQDFR FOR GENERATING RANDOM NUMBERS GETRDI. FOR RANDOMIZING DATA SHUFFle FOR FINDING DISTRIBUTIONS FRQCTl, FRQCT2, POKCTl, PRBFIT, PROB2. FOR PROBABILITY TRANSFORMATION GRUP2, MPSEQl, NOINTl INOINT21. FOR CHI-SQUARE ANALYSIS CHISQR, KIINTI. FOR DEPENDENCY TESTING MSCONl, POKCTl. FOR NORMAL CURVE INTEGRATION NOINTI INOINT21 • •••••••••••••••••••••••••••••••• • 10. INTEGRATION AND • • DIFFERENTIATION PROGRAMS • •••••••••••••••••••••••••••••••• FOR DEFINITE INTEGRATION MVNTIN (MVNTNAI, SMPSON, TINGL (TINGLA). FOR INDEFINITE INTEGRATION IDERIV lDERIVAl, INTGRA lIINTGRl, TAMVL FOR DIFFERENTIATION DERIVA (IDERIV), IINTGR (INTGRAI. TAMVRI. FOR INDEFINITE SUMMATION INTSUM (DIFPRS, XNTSUM). FOR DIFFERENCING DIFPRS (INTSUM, XDFPRSI • •••••••••••••••••••••••••••••••••••••••• • 11. 2-D ARRAY AND 3-D ARRAY PROGRAMS. ** •••••••••••• ** •••••••••••••••••••••••• FOR MATRIX MULTIPLICATION MATMll, MATML3. FOR MATRIX INVERSION MATINV, SIMEQ (DETRMI. FOR SOLVING MATRIX EQUATIONS LSSS1, RLSPR, RlSSR, SIMEQ (DETRM), WLLSFP. IXSOOHVI. PROGRAMS SORTED BY FUNCTION FOR DETERMINANT EVALUATION SIMEQ (DETRMl. FOR MATRIX TRANSPOSITION MATRA, MATRA1. FOR MATRIX FACTORIZATION MFACT. FOR 2-D ARRAY ROTATION ROAR2. FOR INTERPOLATING 2-D ARRAY COLUMNS ARBCOL. FOR 2-D ARRAY DOT PRODUCTS DOTP. FOR 2-0 ARRAY CORRELATIONS SPCOR2. FOR 2-0 ARRAY FOURIER TRANSFORMATION PLANSP. FOR SOLVING 2-0 ARRAY EQUATIONS FIRE2, RLSPR2. FOR MATRIX VECTOR REVERSAL MRVRS. FOR MATRIX VECTOR DOT PRODUCT MOOT, MOOTJ. FOR MATRIX VECTOR CORRELATION CRSVM. FOR SOLVING MATRIX VECTOR EQUATIONS MIFLS, MIPLS, MISS • ••••••••••••••••••••••••••• • 12. POLYNOMIAL PROGRAMS • ••••••••••••••••••••••••••• FOR POLYNOMIAL EVALUATION FASCUB, IPLYEV, POlYEV. FOR FINDING POLYNOMIAL ROOTS MULLER. FOR POLYNOMIAL MULTIPLICATION CONVLV, CNVLV2. FOR POLYNOMIAL DIVISION POLYOV. PROGRAMS SORTEO BY FUNCTION FOR POLYNOMIAL SQUARE ROOTS PSQRT. FOR SYNTHESIZING POLYNOMIALS PLYSYN, POLYSN • ••• * ••••••••••••••••••••••••••••••••• • 13. CORRELATIONS ANO CONVOLUTIONS • ••••••••••••••••••••••••••••••••••••• FOR AUTOCORRELATION CROSS, CROST, QXCORR, WAC. PROCOR (FASCOR, FASCRl, FASEPC, FASEPl), QACORR, FOR CROSS-CORRELATION CROSS, CROST, PROCOR QXCORI. (FASCOR, FASCR1, FASEPC, FASEP1), QXCORR, FOR CONVOLUTION CONVLV, CNVLV2, QCNVLV. FOR OOT PRODUCTS DOTJ, FOOT' FDOTR), VOOTV • ••••••••••••••••••••••••••• • 14. HARMONIC TRANSFORMS • ••••••••••••••••••••••••••• FOR COSINE TRANSFORMATION ASPECT, ASPEC2, COSISl, COSP FOR SINE TRANSFORMATION COSIS1, COSP 'COSISP, SISP). FOR FOURIER TRANSFORMATION COSISl, COSP (COSISP, XSPECT. SISP), FOR INVERSE FOURIER TRANSFORMATION QIFURY ,QFURRYI • •••••••••••••••••••••••••••••• • 15. MISCELLANEOUS SPECTRAL • • ANALYSIS PROGRAMS • * ••••••••••••••••••••••••••••• FOR DANIELL WEIGHTING ADANL (ADANX, XOANL, XOANX). FOR SPECTRAL FACTORIZATION FACTOR. FOR GENERATING NUMERICAL FILTERS GNFLTI. (COSISP, FT24 SISP). (FT24II), QFURRY (QIFURY). PROGRAMS SORTED BY FUNCTION FOR CONVERTING TO AMPLITUDE AND PHASE AHPHZ REIM). FOR CONVERTING TO REAL AND IMAGINARY AMPHZ I REIMt. FOR SPECTRAL COMPARISONS MXRARE. FOR GENERATING SINUSOIDS COSTBL ICOST8X, SINT8Lt SINT8X., SEQSAC (NEXCOS, NEXSIN). PROGRAMS SORTED BV NON-FUNCTIONAL ATTRIBUTES ........................... .. AUTHORSHIP .. ..................... CLAERBOUT, JON F. XOANX), ADANL ( ADANX, XDANL, (COSTBX, SINTBL, SINTBX), FAPSUM, MINAB, MINSNI, MOVE, OUDATA, STZ, UNPAKN SAME ( xSAMEI, AMPHZ I REI M) , CCNVLV, COSTBL FSKIP, INDATA, fo!AXSN ( MAXII!, PAKN (UNPAKN), POLVEV, PSQRT, PAKNI, VARARG, WAC. CLARK, JACQUELINE COLAPS, KOLAPS. GALBRAITH, JAMES N., CHISQR, FACTOR, LINEH (LlNH90) , PROB2, SMPSON, JR. FRQCT2, GRUP2, HSTPLT « HST2, LlNH90, LINEV (LINV90), LINV90, ZEFBCD (ZEFBINI. HST309, MPSEQl, HST390) , MSCONl, GREENFIELD, ROV J. PRBFlT • HANSON, I. MULLER. M.I.T. COMPUTATION CENTER STAFF FRAM90. PAN, CHEH FT24 (FT24Il I. PROCITO, JOSEPH T. QINTRI. ROBINSON, ENDERS A. PLVSVN. SIMPSON, STEPHEN M., JR. ABSVAL, AODK« AODKS, DIVK, SUBKS, XAODK, XADDKS, XOIVK, XMULKS, XSUBK, XSUBKS), ARBCOL, BOOST (DPRESS, XBOOST, XDPRSS), CHSIGN, CLOCKI, CMPARP (CMPARS), COLABL, CONTUR, COSP (COSISP, (STEPC, STEPL, STEPR, XDELTA, (IDERIVI, DIFPRS (INTSUM, XDFPRSI, HALVL, HALVXI, EXCHVS, EXPAND, I FIXVR), FLOATM, FLOATV, FMTOUT, GETHOL, GETRDI, GNFLTI, GRAPH, IIVTOHVI,IDERIV IDERIVA',IFNCTN, SETAPT, SETEST, VINDEX), INTGRA XNTSUMJ, [TOMLI, IVTOHV (HVTOIVI, ILINE901, LINE90, LINTRl, LOCATE SETSBV, SETUP, STORE, WHERE, MAXSNM (MAXABM, MINABM, MINSNM), DIVKS, MULK, MULK2, SUBK, XDIVKS, XDVRK, XDVRKS, XMU~K, ASPECT, ASPEC2, AVRAGE, BLKSUM, CARIGE, CHOOSE, CHPRTS (RVPRTSI, CMPARV (CMPARL), CNTRDB, CNTROW, SISPJ, CUFITI, CVSOUT, DELTA XSTEPC, XSTEPL, XSTEPRI, DERIVA DIVIDE, DSPFMT, DUBLX (DUBLL, FASCNI, FASCUB, FASTRK, FIXV FNDFMT, FRQCTI, FXDATA (FLOATA), GRAPHX, HLAOJ I HRADJ), HVTOIV IINTGR IINTGRA), INDEX ICHUSET, (IINTGR), INTOPR, INTSUM (OIFPRS, IXCARG, KIINTI, LIMITS, LI~E I ARG, CALL, CALL2, RETURN, XARG, XINDEX, XNAME, ?AGE 21 STO ILO TMI LEAVE HE LEAVE GET3 CLA •• ARS 18 S10 IH I TMI LEAVE TlE LEAVE SUB ILO ADO 1<1 STO LVECT TMI LEAVE HE LEAVE STl IANS UP. • SET LOOP CLA 1.4 SUB ILO ADO 1<2 STA CAL 4,4 CLA ADD 1<1 STA STO LXA LVECT.l .. LOOP. CAL CAL ·.,1 •• ,1 STO S10 T1X CAL.l,l • STORE I ANS AND LEAVE. LEAVE CLA tANS AlS 18 PUT5 STO •• EXIT AXT *. ,1 TRA 6,4 .. CONSTANTS 1<1 PZE 1 1<2 PZE 2 • VARIABLES ILO PZE IHI PZE IANS PZE " LVECT PZE "" END ...... . .•••••••••••••••••••••••• ABSVAL .* •••••.•••••••.••••••.•" (PAGE AIIHII AIA{ANYVEC)} AIAIABSVECll AIANYVECI-ILO+2 AIABSVEC1+l A{IANS) o OR -1 IHi-ilO+l 0075 0076 0077 0078 0079 0080 0081 0062 0063 0064 0085 0086 0067 0066 0069 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 21 •••••••••••••••••••••••• ADANl * •••••••••••••••••••••••• PROGRAM LISTINGS • LAST CARD IN DECK IS NO. 0335 0001 0002 0003 0004 0005 0006 0001 OOOB 0009 0010 ----ABSTRACT---0011 TITLE - ADANL WITH SECONDARY ENTRY POINTS XDANL, ADANX, XDANX 0012 MODIFY AUTO- OR CROSS CORRELATIONS FOR DANIELL SPECTRA 0013 0014 0015 AOANL WEIGHTS A ONE-SIDED. FLOATING POINT AUTOCORRELATION FUNCTION, A(L) L=O ••• N, BY A SINIY)/Y TYPE CURVE TO 0016 PRODUCE A FLOATING POINT OUTPUT OAIL) 0017 0018 0019 M l*PI DAlll All) .. ( ---- .. SINI----) 0020 0021 L-PI M 0022 0023 FUR L O.I ••••• N 0024 WHERE M AND N ARE INPUT PARAMETERS PI = 3.14159265 0025 0026 0027 XDANl WEIGHTS A TWO-SIDED, FLOATING POINT CROSS0028 CORRELATION FUNCTION. XIL) L= -N ••• O••• N. BY A SINCY)/Y 0029 TYPE CURVE TO PRODUCE A FLOATING POINT OUTPUT OXIL) 0030 0031 M l-PI 0032 DXIl) Xill - I ---- - SIN(----) 0033 L-PI M 0034 0035 FOR l • -N.-N+I •••• ~N 0036 WHERE M AND N ARE INPUT PARAMETERS 0031 PI = 3.14159265 0038 0039 ADANX IS IDENTICAL TO AOANL EXCEPT THAT THE INPUTS ANO 0040 OUTPUTS ARE FIXED POINT VECTORS. 0041 XDANX IS IDENTICAL TO XDANL EXCEPT THAT THE INPUTS AND 0042 0043 OUTPUTS ARE FIXED POINT VECTORS. 0044 0045 LANGUAGE - FAP SUBROUTINE (FORTRAN II COMPATIBLE) 0046 EQUIPMENT - 709 OR 1090 IMAIN FRAME ONLY) 0047 - 1B3 CELLS STORAGE 7090 0048 - CAPPROX) 109 SPEED 0049 1.2M + .1BN MIlLISECS FLOATING PT - 6" + .9N 1.2M + .325N MILLISECS 0050 FIXED POINT - 6M + 1.6N 0051 J. CLAERBOUT AUTHOR 0052 0053 ----USAGE---0054 0055 TRANSFER VECTOR CONTAINS ROUTINES - NONE 0056 ANO FORTRAN SYSTEM ROUTINES - SIN 0057 0058 FORTRAN USAGE OF ADANl 0059 CALL ADANL IAA,N,M.DAA) 0060 0061 INPUTS AIO, ••• ,N) 0062 1=1,2, ••• ,N+1 CONTAINS THE AUTOCORRELATION AAIU 0063 WHERE AAII) AClI-1) 0064 0065 MUST BE NON NEGATIVE N 0066 0067 IS THE DANIELL WEIGHTING PARAMETER M 0068 IS A NON-ZERO INTEGER 0069 0010 OUTPUTS 0071 CONTAINS THE WEIGHTED AUTOCORRELATION 1=1 ••• N+1 DUll I 0072 DAIO ••• N) AS DEFINED IN ABSTRACT 0073 WHERE DAAII) = DAll-1) • AOANL ISUBROUTINE) • FAP .ADANL 300 COUNT ADANL lBL ADANL IAA,N,M,OAA) ENTRY XDANL IXX,N,M,DXX) ENTRY AOANX IIAA,N,M,IDAA) ENTRY ENTRY XDANX IIXX,N,M,IDXX) •. •.. .. •. .... ..•. .. • • •. .. . • ---• • -• • -.• • -•. • • • • • --.. .-.-. -- - - • ••••••••••••••••••••••• ADANl • • ••••••••••••••••••••••• * 9/29/64 .•••••••••••••••••••••••• . ADANL •••••••••••••••••••••••• IPAGE PROGRAM LISTINGS .• ••••••••••••••••••••••• . ADANL • ••••••••••••••••••••••• 21 IPAGE .. EQUIVALENCE IDAA.AA) IS PERMITTED ... INPUTS .... XXIII .. . 1= -N+1.-N+2 ••••• N+l CONTAINS THE CROSS-CORRELATION XI-N ••• N) WHERE XXII) = XII-I) .. FORTRAN USAGE OF XDANL .. CALL XDANLIXX.N.M.OXX) N M .. OUTPUTS .. DXXI Il .... .... ..... .. .. .. .... . SAME AS FOR AOANL SAME AS FOR AOANL 1= -N+l,-N+2 ••••• N+1 CONTAINS THE WEIGHTED CROSSCORRELATION DX(-N ••• N) AS DEFINED IN ABSTRACT WHERE DXXII) = OXll-l) EQUIVALENCE CXX.DXX) IS PERMITTED FORTRAN USAGE OF ADANX CALL ADANX(IAA.N,M,IDAA) INPUTS IAAIII SAME MEANING AS FOR AOANL EXCEPT THAT THE AUTOCORRELATION ELEMENTS ARE FIXED POINT QUANTITIES. THE POSITION OF THE BINARY POINT IS IMMATERIAL BUT THE DATA MUST NOT OCCUpy BITS 1 THROUGH 8 • SAME MEANING AS FOR AOANL SAME MEANING AS FOR ADANL N M .. OUTPUTS AS FOR ADANL EXCEPT THE DATA .... IDAA SAMEWITHMEANING BINARY POINT SAME AS THAr OF IAA. .. FORTRAN USAGE OF XOANX (II ...... .. ... .. CALL XDANXIIXX.N.M,IDXX) INPUTS I XX I I ) N M .. OUTPUTS .. IDXXII) ... . .. .. .. .. .. .... .. .. .. .... .. SAME MEANING AS FOR XDANL EXCEPT THAT THE DATA IS FIXED POINT AND MUST NOT OCCUpy BITS 1 THROUGH 8. SAME MEANING AS FOR XDANL SAME MEANING AS FOR XDANl SAME MEANING AS FOR XDANL EXCEPT IDXX IS FIXED POINT. EXAMPLES 1. GENERAL BEHAVIOR ON ELEMENTARY CORRELATIONS INPUTS AAll ••• 4)=1.0,1.0,1.0,1.0 IAAll ••• 4)=500.500,500,500 XXll ••• 11=1.0.1.0, ••• ,1.0 IXXll ••• 1)=500,500, •••• 500 INOTE - BIT 9 IS THE MOST SIGNIFICANT BIT OCCUPIED BY IAA OR IXX WITH THESE DEFINITIONS) .. .. .. .. .. .. .. .. .. IS FIXED POINT N USAGE =3 M =2 CALL AOANLIAA.N.M,DAA) CALL XOANLIXXI41,N,M,DXX(4)) C~LL AOANXIIAA,N,M,IOAAI CALL XOANX(IXXC4).N,M,·IOXXI41) OUTPUTS - OAA(1 •• ~)=1.0 •• 636620.0.0,-.212201 OXXll ••• 71=-0.212207,0.0,.636620.1.0 •• 636620,O.O,-.212207 IDAAll ••• 41=500.318.0.-106 IOXXll ••• 71=-106,O,318,500,318,O,-106 2. EQUATING OUTPUTS WITH INPUTS INPUTS - SAME AS EXAMPLE 1. USAGE CALL AOANlIAA,N,M,AAI CAll XOANlIXX(4),N,M,XXI4)1 CALL AOANXIIAA.N.M.IAAI CAll XOANXIIXXI41,N.M.IXXI411 OUTPUTS - AAll ••• 4)=OAAll ••• 41 OF EXAMPLE 1. XXll ••• 7)=OXX(1 ••• 7) OF EXAMPLE 1. IAA(1 ••• 4)=IOAAI1 ••• 4) OF EXAMPLE 1. 0074 0075 0076 0077 0078 0019 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 2) •••••••••••• * ••••••••••• - - ADANL PROGRAM LISTINGS • * ••••••••••••• * ••• ** ••• (PAGE 31 ... IXXll ••• 11:IDXXll ••• 11 OF EXAMPLE 1. * - PROGRAM FOLLOWS BElOW " ADANL XDANL LXL ADANX XDANX XXL MOIIA MOIIX MAX M1 MM2 T'AX M3 M4 M6 M5 MOl/Oil M1 M8 *FLOAT FLOAT FLl H2 HTR 0 l,ADANL 8CI SlIl,l SXA MOil A,1 MOVE DATA TO OUTPUT FIELD TSX CLA " AORX STO AORX"'O IF CROSS TRA LXL SXA SI/l tl MOllE DATA MOIIX,! TSX AORX:O IF CROSS AORX STZ CLA XORD:O IF FIXED XORL S10 ADANL-2,4 SXD SFTUP SKIP FLOATING TRA SXA SI/1,l MOIIA,l MOllE DATA TSX ADRX.:O IF CROSS CLA * AORX STO TRA XXL SXA SII1,l MOllE DATA TSX MOl/X.! AORX:O IF CROSS AORX STl XORL=O IF FIXED XORL STl SXO AOANL-2,4 TRA FLOAT M8 CLA STA TAX TRA MAX M7 CLA TAX STA 1,4 CLA STA MI M3 STA 4,4 CLA MM2 STA M4 S.fA 2,4 CLA* M5 STD 5112,2 SXA MOIIOI/,l SXA 0,2 AXT 0,1 AXC •• ,2 I ".:CC I CLA *.,2 I **:DDCC I STO 1 •• :M3 OR M6) TRA CLA **,1 I ""=CCI STO **,1 I **"'OOCC) ,,+ 1,1.-1 TXI TXI "+1,2,1 ("-=N) TXL Ml,2,"* AXT **,1 I **=IRlJ TRA 1tl PIE M3 M6 PlE THE INPUT DATA 4,4 CLA STA FLl STA Fl2 2,4 CLA" STD FL4 STD 11.4 AXT 1tl 1,2 AXC CLA ··,1 **=R :0233000000000 ORA FA[) =0233000000000 FLl STD· AOII.X II::T AUT£) Til. A Fl3 •• =R CROSS CLA **,2 - _. • •• ** ••••••••••• *.****** - . ADANL .** ••••• **** •••• * ••• **** (PAGE 0141 0148 0149 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0110 0111 0112 0113 0114 0175 0116 0171 0118 0119 0180 0181 0182 0183 0184 0185 0186 0181 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0201 0208 0209 0210 Olll 0~12 0213 0214 0215 0216 0217 0218 0219 0220 0221 31 • •• ***_ •••••••• -*.- •••• * AOANL * " .... _.. _.............-.* IPAGE rROGRAM LISTINGS 4) ORA =0233000000000 FAD =0233000000000 STO" FL2 TXI ...·1,2,-1 FL3 TXI *+1,1,1 FL4 TXL FLl,I,*" *,,=N *SET UP FOR WEIGHTING Loor SETUP CLA" 3,4 =M ARS 17 STO TWOM ARS 1 ORA =0233000000000 FAD =0233000000000 FOP =3.14159265 STO MOVPI CLA =1. For MOVPI STO PIOVM CLA 4,4 STA R STA Rl STA R7 CLA" 2,4 STD NO N IN DECR ARS 18 STO N CLA" 3,4 ADD* 3,4 STD M2 CLA M2 CAS NO CLA NO STD MIN STO MIN STl ARG AXC 0,2 AXT 0,1 -BEGIN WEIGHTING LOOP NXWVL TXI *+1,2,-1 TXI *+1,1,1 MIN TXL *+2,1,"* "*=MINIZM,NI TRA SMDONt SMOOTHING DONE * FORM SINIPI*I/MI CLA ARG FAD PIOVM STO ARG TSX $SIN,4 FOP PIOVM STQ IWT =IM/Pl)SINlrl*I/MI PXA 0,1 PUT I IN AC STO X2MPI I+MULTIPLE OF 2*M MORE ORA =0233000000000 FAD =0233000000000 STO L2MPI I+MULTIPLE OF 2*M LXA X2MPI,4 I+MULTIPLE OF 2*M CLA IWT =IM/PIISINIPI*I/MI FOP L2MPI I+MULTIPLE OF 2*M STO TEMP R FMP *.,4 **=DATA LOCATION STO* *-1 lET AORX TRA LP AUTO COR LAC X2MPI,4 CROSS COR LDO TEMP FMP" R STO* R • INCREMENT X2MPI 8Y 2M LP CLA X2MPI AOD TWOM STO X2MPI CAS N TEST IF I PLUS SOME TRA NXWVL MULTIPLE OF 2*M IS TRA MORE GREA TER THAN N TRA MORE SMDONE lET XORL .*-* .••.. _..• -._. __ ._._. AOANL " " *.*.*.-*.*.-••. _(rAGE .• *._-*4) 0222 0223 0224 0225 0226 0221 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 (>254 0255 0256 0251 0258 0259 0260 0261 0262 0263 0264 0265 0266 0261 0268 0269 0210 0271 0212 0273 0214 0215 0216 0211 0218 0279 0280 0281 0282 0283 0284 0285 0286 0281 0288 0289 0290 0291 0292 0293 0294 0295 0296 .•••••••••••••••••••••••• .. ADANL PROGRAM LISTINGS • ••••••••••••••••••••••• •••••••••••••••••••••••• (PAGE 51 R1 ( PAGE TRA AXT Axe eLA UFA LRS ANA LLS STO" ZET R2 R3 R4 SVI SV2 KDl AORX XORL MOVPI PIOVM N X2MPI L2MPI I HT TWOM TEMP M2 .• ••••••••••••••••••••••• .. AOANL TRA eLA UFA LRS ANA llS STO. TXI TXI TXL AXT AXT LXO TRlI PZE SVI DONT FIX DATA 1,1 FIX DATA 1.2 •• ,1 =0233000000000 =0111111111 R1 AORX R3 AUTO •• ,2 =0233000000000 =0111111111 R2 "+1,2,-1 ".1,1.1 Rl,I ..... *.,1 **=N ·",2 ADANL-2,4 5,4 ,,1 =0 IF CROSS =0 IF FIXEO M/PI PIIM STORES N IN AOOR FIXED I+MULTIPLE OF 2 .. M HTG I+MULTIPlE OF ?*M =(M/PIISIN(PI*I/MI 2*M IN ADDRESS STORE 2M IN DECR III IN DEeR ARGUMENT OF SIN!' ND ARG END 0291 0298 0299 0300 0301 0302 0303 0304 0305 0306 0301 0308 0309 0310 0311 0312 0313 0314 0315 0316 0311 0318 0319 0320 0321 0322 0323 0324 0325 0326 0321 0328 0329 0330 0331 0332 0333 0334 0335 5) •••••••••••••••••••••••• • AOANX • •••••••••••••••••••••••• REFER TO ADANL PROGRAM LISTINGS •••••••••••••••••••••••• AOANX •* •••••••••••••••••••••••* REFER TO ADANl ..•••••••••••••••••••••••• ADDK " PROGRAM LISTINGS •••••••••••••••••••••••• " " ADDK FAP COUNT LBL ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY " " "" " .. ". " .. " ... " ." . " " ".. " ... . ..". .. .. .. .. . . . .... ... .... ".. (SUBROUTINE) 9/29/64 • ••••••••••••••••••••••• ADDK • •••••••••••••••••••••••" . LAST CARD IN DECK IS NO. 0365 250 ADDK ADDK SUBK MULK DIVK XADDK XSUBK XMULK XDIVK XDVRK ADDKS SUBKS MULKS DIVKS XADDKS XSUBKS XMULKS XOIVKS XDVRKS e. Xl, X2, ••• , XN) C, Xl, X2, •••• XN) e, Xl. X2, •••• XN) ( e. Xl, X2, •••• XN) IIe.IXI.IX2 •••• ,IXN) (IC,IXl,IX2, •••• IXN) (Ie,IXl,IX2 ••••• IXN) (IC,IXl.IX2, ••• ,IXN) (IC,IXl,IX2, ••• ,IXN) ( Cl, Xl. YI, C2. X2, Y2 ••••• eN. XN. YN) ( CI. Xl, Yl. C2. X2. Y2, •••• eN, XN, YN) ( e1. Xl. YI. C2. X2, Y2, •••• CN. XN, YN) I el, Xl. YI. C2. X2. Y2, ••• , eN, XN, YN) (IeI,IXI,IYl.IC2.IX2,IY2, ••• ,ICN,IXN.IYN) IIel.IXl,IYl,IC2,IX2,IY2 •••• ,ICN,IXN.IYN) (ICI,IXI.IYl,IC2.IX2,IY2, ••• ,ICN,IXN.IYNI (ICI,IXl.IYI.IC2,IX2.IY2 ••••• ICN.IXN,IYNI (IC1.IXl.IYl.IC2.IX2.IY2 •••• ,ICN.IXN.IYN) ----ABSTRACT---- TI HE - ADDK WITH SECONDARY ENTRIES MULK. DIVK. SUBK. XADDK. XSUBK. XMULK. XDIVK. XDVRK. ADOKS. SUBKS • MULKS. DIVKS. XADDKS. XSUBKS • XMULKS. XOIVKS. XDVRKS MODIFY A SEr OF VARIABLES BY A CONSTANT OR BY CONSTANTS ADDK AND ITS OTHER ENTRIES ARE VARIABLE LENGTH CALLING SEQUENCE SUBROUTINES. FOR THE FIRST NINE ENTRIES THE FIRST ARGUMENT IS TAKEN AS A CONSTANT BY WHICH THE REMAINING ARGUMENTS ARE TO BE MODIFIED. THE MODIFICATION DEPENDS ON THE ENTRY USED AS FOLLOWS FLOATING ARGUMENTS FIXED ARGUMENTS ADDK SUBK MULK DIVK XADOK XSUBK XMULK XOIVK XOVRK FUNCT ION ADDS THE CONSTANT SUBTRACTS THE CONSTANT MULTIPLIES BY THE CONSTANT DIVIDES BY THE CONSTANT DIVIDES BY THE CONSTANT WITH ROUNDING INSTEAD OF TRUNCATION THE LAST NINE ENTRIES ASSUME THAT THE NUMBER OF ARGUMENTS IS A MULTIPLE OF THREE. AND THAT WITHIN EACH TRIPLET OF THREE ARGUMENTS THE FIRST IS A CONSTANT BY WHICH THE SECOND IS TO BE MODIFIED WITH THE RESULT STORED IN THE THIRD ARGUMENT. THE NAMES OF THE LAST NINE ENTRIES (THE PLURAL ENTRIES) ARE DERIVED FROM THOSE OF THE FIRST NINE (THE SINGULAR ENTRIES) BY ADDING THE LETTER S. THE MODIFICATION ASSOCIATED WITH A PLURAL ENTRY IS THE SAME AS THAT OF ITS SINGULAR COUNTERPART. THE ORDER OF PROCESSING IS TOWARDS HIGHER ARGUMENTS. THE DIVISION ENTRIES SKIP OVER AN ATTEMPT TO DIVIDE BY ZERO WITHOUT TURNING ON ANY INDICATORS. BUT NO OTHER TESTS FOR POSSIBLE OVERFLOW ARE MADE • FOR THE PLURAL ENTRIES. AN ILLEGAL RETURN RESULTS FROM AN ARGUMENT COUNT WHICH IS NOT A MULTIPLE OF 3 • THERE IS NO LIMIT ON THE NUMBER OF ARGUMENTS PERMITTED • THERE ARE NO RESTRAINTS ON ARGUMENT ECUIVALENCES. HOWEVER NO OUTPUT (THIRD) ARGUMENT MAY BE INVOLVED AS A SUBSCRIPT Of, OR IN A DEFINING EXPRESSION FOR, A SUBSEQUfNT INPUT ARGUMENT, OTHER THAN BY A PURE 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0031 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 •••••••••••••••••••••••• * ADDK * •••••••••••••••••••••••• (PAGE •••••••••••••••••••••••• ADDK • * •••••••••••••••••••••••• PROGRAM LISTINGS 2) • •.. IPAGE EQUIVALENCE. LANGUAGE - FAP SUBROUTINES (FORTRAN-II COMPATIBLE) STORAGE SPEED - 114 REGISTERS - K1 + K2.N MACHINE CYCLES, WHERE 1'1 " NO. MOOIFICATIONS. AND Kl LIES BETWEEN 33 ANO 44 K2 LIES BETWEEN 22 AND 59. DEPENDING ON ENTRY AND ON COMPUTER. - S.M. SIMPSON, AUGUST 1963 * EQUIPMENT - 1Q9 OR 1090 (MAIN FRAME ONLY) * * • • • .. AUTHOR * • • ----USAGE---- * TRANSFER VECTOR CONTAINS ROUTINES - (NONE) FORTRAN SYSTEM ROUTINES ... FORTRANANDUSAGE .. • • * .. * • .. * • .. • * • .. .. • .. • ... CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL CALL ADDK SUBK MULK OIVK XADDK XSUBK XMULK XDIVK XDVRK AODKS SUBKS MULKS DIVKS XADDKS XSUBKS XMULKS XDIVKS XOVRKS - INONE) C, Xl, X2, ••• , XN) C, Xl. X2 •••• , XN) C, Xl, X2, ••• , XN) ( C, Xl, X2, ••• , XN) tIC,IXI.·IX2 ••••• IXN) tIC,IX1,IX2 •••• ,IXN) tIC,IXI,IX2, ••• ,IXN) IIC,IXl,IX2, ••• ,IXNI IIC,IX1,IX2 •••• ,{XN) I Cl, Xl, Yl, C2, X2, Y2, ••• , CN, XN. YNI 1 Cl, Xl, Yl, C2, X2, Y2, ••• , CN. XN, YNI 1 Cl, Xl, YI, C2, X2, Y2, ••• , CN, XN, YN) 1 C1, Xl, Y1, C2, X2, Y2 •••• , CN, XN, YN) IIC1,IXl,IYl,IC2,IX2,IY2, ••• ,ICN,IXN.IYNI IICl,IX1.IYl,IC2,IX2,IY2 •••• ,ICN,IXN,IYN) IIC1,IXl,IYl,IC2,IX2,IY2 •••• ,ICN,IXN,IYN) IICl,IX1,IY1,IC2,IX2,IY2, ••• ,ICN,IXN,IYN) IICl,IXl,IYl.IC2,IX2.IY2, •••• ICN.IXN,IYN) IN-THE ABOVE EXPRESSIONS, THE LETTER ExtEEOING lERO. ..... 1'1 MAY HAVE ANY VALUE .. INPUTS ... .. * C IS A FLTG CONSTANT FOR MODIFYING X1,X2, ••• XN, FOR THE FLOATING SINGULAR ENTRIES • Xl. X2, ••• ,XN .. .. .... .. .. EQUIVALENCE(C.SOME XJ) IS PERMITTED. THE INITIAL VALUE OF C WILL ALWAYS BE USED FOR MODIFICATION • Cl. C2, ••• ,CN .. ... .. ... * .. *.. ARE THE FLOATING VARIABLES TO BE MODIFIED, FOR ALL FLOATING ENTRIES. THEY ARE ALSO OUTPUTS FOR SINGULAR FLOATING ENTRIES ARE THE FLOATING CONSTANTS USED. FOR THE FLOATING PLURAL ENTRIES, TO MODIFY Xl,X2 ••••• XN RESPECTIVELY. EQUIVALENCEtCJ,XL) IS PERMITTED FOR ANY J.L PAIR. IC lXI, lX2, ••• ,IXN ICl, lC2, ••• ,ICN IS THE FIXED PT. ANALOG. OF ARE THE FIXED PT. ANALOGS OF ARE THE FIXED PT. ANALOGS riF C Xl •••• ,XN Cl ••••• CN .. OUTPUTS .. .* * ...* * .. Yl, Y2 ••••• YN 0011 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 Xl. X2 •••• , XN ARE OUTPUTS FOR ADDK GIVES Xl SUBK GIVES Xl" MULK GIVES Xl DIVK GIVES Xl " IX1, •••• IXN 0015 0016 ENTRIES ADDK. SUBK, MULK. DIVK X1+C, •••• XN XN+C X1-C ••••• XN = XN-C X l*C, •••• XN = XN-C XI/C •••• , XN " XN/C ARE SIMILAR OUTPUTS FOR XAODK. XSUBK. XMULK. XDIVK. AND XDVRK, WHERE XDIVK TRUNCATES, XDVRK ROUNDS. AR~ ADDKS OUTPUTS FOR ENTRIES ADOKS, SUBKS, MULKS, DIVKS GIVES Yl=Xl+C1, Y2=X2+C2, ••• , YN=XN+CN 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 2) .•••••••••••••••••••••••• . ADDK •••••• - •••••••• -- •••••• * (PAGE ... .. ..• ••••••••••••••••••••••• ADDK PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 31 SUBKS HULKS DIVKS .. . " .... GIVfS GIVES GIVES • YN=XN-CN YN=XN"CN • YN=XN/CN Yl=Xl-CI. Yl=XI"CI. Yl=XI/Cl, EQUIVALENCE (CJ,XLl.ICJ.YL),IXJ.YLl IS PERMITTED FOR ALL J.L PAIRS. THE VALUES OF THE OPERANDS USED DURING A MODIFICATION ARE THEIR PRESENT VALUES AND NOT NECESSARILY THEIR INITIAL VALUES • ." THE ENTRY DIVK 8YPASSES THE COMPUTATION OF EACH YJ OUTPUT FOR WHICH THE CORRE,PONDING CJ HAS VALUE ZERO AT'THE TIME OF MODIFICATION. " .." THE COMPUTATIONAL ORDER IS Yl, Y2, •••• YN. .." " "" . ". . .... ... (YI, IY2, •••• IYN ARE SIMILAR OUTPUTS FOR XDIVKS. AND XDVRKS. 1. EXAMPLES OF THE SINGULAR ENTRIES INPUTS - USAGE " .. " .." .... .... " ".. " " ... " ...... AI. A2. A3 = 1. , CI, C2, C3 = 1., I, IAl,IA2,IA3 ICl,IC2,IC3 = 1, IEl, IE2, IE3 = 1, CALL CALL CAll CALL CAll CALL CALL CALL CAll CAll ". .." ..... ... XADDKS. XSU8KS. XMUlKS. ADOK XADDK SUflK XSUBK MULK XMULK OIVK XDIVK XDVRK AODK 2., 3. 2., 3. 2, 3 2. 3 2, 3 12 •• 12, 12. , 12, (2. , ( 2, 12. , ( 2, 12, ( 2., Bl. 82, B3 = 1 •• 01, 02. 03 " 1., IBl, 182, IB3 1. 101,102,103 '" 1, X " 1.0 2., 3. 2., 3. 2, 3 2• 3 AI. A2, A31 IA1.1A2,IA3) BI, B2, B3) IBl.IB2,IB3) Cl, C2, 01 ICI. IC2, IC3) 01, 02, 03) 101.102, lO31 lEI, IE2, IE31 XI OUTPUTS - AI, A2, A3 - 3., 4 •• 5. BI, 82. B3 =-1., 0 •• 1. Cl. C2. C3 = 2., 4 •• 6. 01. 02. 03 = .5, 1., 1.5 lEI. IE2. IE3 = 1. 1. 2 IAI. I A2. IBl, I B2, IC 1, IC2. 101. 102. X 3. = IA3 '" 3, 4, IS3 =-1. 0, 2, 4. IC3 103 " 0, 1. 5 1 6 1 />192 2. EXAMPLES OF THE PLURAL ENTRIES INPUTS USAGE - SAME AS EXAMPLE 1 CALL CALL CALL CALL CALL CALL CALL CALL CAll OUTPUTS - Yl,Y2 Ul,U2 IY = 2, ADDKS( SU8KSI MULKS! OIVKSI XADDKSI XSUBKSI XMUlKSI XOIVKSI XOVRKSI 2.,6. 3. ,4. IZ = -1. 1 •• AI, YI. 2 •• AI, l l , 3., AI. Ul. 4 •• AI. VI, 1 .IAltlY) 2 .IAI.Il) 3 ,IAI,IU) 2 ,IA3,IV) 2 ,IA3.IWI 4 •• 3 •• 2., 1., A2, A2. A2, A2, -1.,-1 • Z1,Z2 Vl,V2 .25.2.0 I V = 1, IU " 3. Y2) Z2) U2) V2) IW 2 .." PROGRAM FOLLOWS BElOWS . ".. 0150 0151 0152 0153 0154 0155 0156 0151 015B 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0170 0111 0172 0113 0174 0115 0116 0111 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 NO TRANSFER VECTOR HTR 0 XR4 BCI 1.ADDK .. PRINCIPAL ENTRY. ADDKIC.Xl,X2 ••••• XNl = ADDKIARGSKI AOOK srz llFK .. SECOND ENTRY. AODKSICI,Xl.Yl •••• ,CN,XN,YNI = ADOKSIARGSKS) AODKS CLA TRAI TRA SETUP " THIRD fNTRY. XADDKIIC.IX1.IX2, ••• ,IXN) = XAOOKIXARGSKI XAODK srz ZIFK .. fOURTH ENTRY. XADDKSIICI,IXI.IYl •••• ,ICN,IXN,IYN) = XADDKSIXARGSKSI 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0201 0208 0209 0210 0211 0212 0213 0214 0215 0216 0211 021B 0219 0220 0221 0222 0223 0224 31 •• *** •••• ************.*. ADDK ".* ••••••••• * ••• ******.**" I PAGE PROGR AM LI ST1 NG S ••• ****** •• **** •• * •••••• ADDK "••••••••••• ** •••• ***.***" 4) XADDKS CLA TRA2 TRA SETUP " FIFTH ENTRY. SUBKIARGSK) SUBK STZ ZIFK " SIXTH ENTRY. SUBKSIARGSKS) SUBKS CLA TRA3 TRA SETUP " SEVENTH ENTRY. XSUBK(XARGSK) XSUBK STZ ZIFK " EIGHTH ENTRY. XSUBKS(XARGSKS) XSUBKS CLA TRA4 TRA SETUP " NINTH ENTRY. MULK(ARGSK) MULK STZ ZIFK " TENTH ENTRY. MULKS(ARGSKS) MULKS CLA TRA5 TRA SETUP " ~LEVENTH ENTRY. XMULK(XARGSK) XMULK STZ ZIFK " TWELFTH ENTRY. XMUlKS(XARGSKS) XMULKS CLA TRA6 TRA SETUP " THIRTEENTH ENTRY. DIVK(ARGSK) DIVK STZ ZIFK " FOURTEENTH ENTRY. DIVKS(ARGSKS) DIVKS CLA TRA7 TRA SETUP " FIFTEENTH ENTRY. XDIVK(XAKGSK) XDIVK STZ ZIFK " SIXTEENTH ENTRY. XDIVKSIXARGSKS) XDIVKS CLA XCA TRA SETVRY " SEVENTEENTH ENTRY. XDVRK(XARGSK) XOVRK STZ ZIFK " EIGHTEENTH ENTRY. XDVRKS(XARGSKS) XDVRKS CLA RND SETVRY STO VARY CLA TRA8 " SET BRANCH AT MODIFY. THEN CHECK SINGULAR OR PLURAL SETUP SXU ADDK-2,4 S TA MOD I FY ZET llFK TRA PLURAL " SET UP FOR SINGULAR ENTRIES CLA1,4 C OR IC STO CONST CLA SINGI I PZE GETX.O.ll LDQ SING2 (PLE 1.0.-11 TXI STA.4.-1 (SET TO PICK UP Xl FIRST) " SET UP FOR PLURAL ENTRIES PLURAL CLA PLURI ( PZE GETC.O.21 (PZE LOQ PLUR2 3.0,-3) STA STA GETXOe ARS 18 STA GE TX XCA STA STORE STD BACK " ACQUIRE NEXT POSSIBLE TSX X.O ANO CHECK IF IT JS. GETSXZ CAL 1.4 A(T5X Xl.o) SINGULAR, A(TSX Cl.O) PLURAL ANA MASK KNOCK OUT ADDRESS LAS TSXl TRA LEAVE GETXOC TRA "" "" = GETX (SINGULAR), = GETC (PLURAL) " EXIT AT END OF ARGUMENT STRING. LEAVE SXA ZIFK,4 RESTORE ZIFK TO NON-ZERO (PLURAL INDICATION) TRA 1.4 " STORE NEXT C OR IC. GET NEXT X OR IX IN AC. " BRANCH TO MODIFY. GETC CLA. 1,4 Cl,C2, ••• STO CONST GETX CLA" ·*,4 ** :: 1 (SINGULAR). = 2 (PLURAL) MODIFY TRA ** :: M001.MOD2 •••• ,MOD8 "" " MODIFICATION 1. ADDK OR AOOKS MODI FAD CONST ,PAGE 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0231 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 U254 0251) 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0273 0274 0215 0276 0211 0218 0219 0280 0281 0282 02B3 0284 0285 0286 0287 0288 0289 0290 0291 0292 0293 0294 0295 0296 0291 0298 0299 4) •••••••••••••••••••••••• ADDK •••••••••••••••••••••••• (PAGE PROGRAM LISTINGS •••••••••••••••••••••••• ADDK • •••••••••••••••••••••••• - (PAGE 5) • STORE RESULT. GO BA~K FOR MORE STORE STO•• ,4 .... (SINGULAR), .. 3 (PLURALI 8ACK TXI GETSX·Z,4,.... ..-1 (SINGULAR), =-3 (PLURALI • MODIFICATION 2. XAODK OR XADDKS MOD2 ADD CONST TRA STORE • MODIFICATION 3. SU8K OR SUBKS MOD3 FSB CONST TRA STORE • MODIFICATION 4. XSUBK OR XSUBKS MOD4 SUB CONST TRA STORE • MODIFICATION 5. MULK OR MULKS MOD5 XCA FMP CONST STORE TRA • MODIFICATION 6. XMULK OR XMULKS M006 XCA MPY CONST ALS 17 TRA STORE • MODIFICATION 7. DIVK OR DIVKS MOD7 NZT CONST BYPASS FOR CONST = D. TRA 8ACK fOP CONST XCA TRA STORE • MODIFICATION 8. XDI VK, XDIVKS, XOVRK, OR XDVRKS MOD8 NIT CONST TRA BACK LRS 35 DVP CONST VARY NOP = XCA OR TRA ROUND ALS18 ALS 18 TRA STORE • ROUNDING INSERT, COMPARES TWICE THE REMAINDER AGAINST DENOMINATOR. ROUND SSP ALS 1 SBM CONST CLM PREPARE fOR ROUNDING DOWN TMI RXCA KRND PREPARE FOR ROUNDING UP CLA RXCA XCA RNO TRA ALS18 • CONSTANTS, TEMPORARIES TRA1 TRA MODI TRA2 TRA MOD2 TRA3 TRA MOD3 TRA4 TRA MOD4 TRA5 TRA MOD5 TRA6 TRA MOD6 TRAl TRA MOD1 TRA8 TRA MOD8 0,0 TSXZ TSX MASK OCT 111111100000 XCA XCA RND TRA ROUNO KRNO OCT 200000000000 SINGl PZE GETX,O.l 1,0,32167 SING2 PZE GETC,0,2 PLURI PZE 3,0,32165 PLUR2 PZE •• ,ee,.e .. C OR IC, CL OR ICL L == 1, ••• ,N CONST PZE ZIFK PZE SET 0 FOR SINGULAR 1 END = 0300 0301 0302 0303 0304 - 0305 0306 0301 0308 0309 0310 0311 0312 0313 0314 0315 0316 0311 0318 0319 0320 0321 0322 0323 0324 0325 0326 0321 0328 0329 0330 0331 0332 0333 0334 0335 0336 0337 0338 0339 0340 0341 0342 0343 0344 0345 0346 0347 0348 0349 0350 0351 0352 0353 0354 0355 0356 0351 0358 0359 0360 0361 0362 0363 0364 0365 5) ••••••••••••••••• * ••••• * • ADDKS • * •• * ••• * •••• *.** •••• *** REFER TO ADOK PROGRAM LISTINGS *** ••••••••••••• * •• * •••• •. ADDKS • _..••.....••..•••.•••. • REFER TO AOOK •••••••••••• ** •••••• ** •• • PROGRAM LISTINGS AMPHZ ••••••••••••••••••••••••" • • AMPHZ (SUBROUTINE) FAP .. ..• ••••••••••••••••••••••• AMPHI •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0250 0001 ·AMPHZ 0002 COUNT 0003 280 AMPHZ LBL 0004 AMPHl (RE,XIM,LR,AMP,PHZ,R) ENTRY 0005 REIM (AMP,PHZ,LR,RE,XIM) ENTRY 0006 0007 • 0008 ----ABSTRACT---0009 • TITLE - AMPHI , WITH SECONDARY ENTRY POINT REIM 0010 • AMPLITUDE AND PHASE FROM REAL AND IMAGINARY, OR REVERSE 0011 0012 • AMPHZ COMPUTES AN AMPLITUDE (AMP) AND PHASE (PHI) VECTOR 0013 FROM THE VECTORS OF THE REAL (RE) AND IMAGINARY (XIM) 0014 PARTS. THUS IF 0015 • 0016 Z(J) RE(J)+I.XIMIJ) 0017 • 0018 WHERE 0019 • THEN 0020 • 0021 • AMPIJ) IREIJ1·*2+XIM(Jl··2) ••• 5 0022 ARCTAN(XIM(J)/RE(J)1 PHZ(J) 0023 (WITH PROPER QUADRANT CHOICE) 0024 0.0 IF XIM=RE=O.O 0025 0026 0027 PHZIJ) IS COMPUTED SUCH THAT -PI LSTHN PHZIJ) LSTHN= PI 0028 THEN, IF DESIRED, A MULTIPLE OF 2PI IS ADDED TO PHZ(JI SO 0029 AS TO MINIMIZE THE DIFFERENCE BETWEEN PHZIJ) AND PHI(J-l). 0030 • FOR THE LATTER CONDITION, PHZ(l) WILL BE BETWEEN 0031 • + AND - PI. THIS PROCESS GIVES POINTS ON THE TRUE 0032 CONTINUOUS PHASE CURVE PROVIDED THE TRUE PHASE JUMPS ARE 0033 LESS THAN MAGNITUDE PI. 0034 0035 PI = 3.14159265 • 0036 " REIM REVERSES THE ABOVE PROCESS. IT CALCULATES THE REAL 0037 AND IMAGINARY VECTORS FROM THE AMPLITUDE AND PHASE 0038 • 0039 VECTORS • 0040 RE(JI = AMPIJ).COSIPHZ(J) 0041 " XIMIJ) = AMPIJ)"SINIPHZ(J») 0042 0043 .. LANGUAGE FAP SUBROUTINE IFORTRAN II COMPATIBLE) 0044 0045 • EQU I PMENT - 109 OR 7090 (MAIN FRAME ONLY) .. STORAGE - 149 REGISTERS 0046 .. SPEED - ABOUT .00050-LR SECONDS ON THE 1094 MOD 1 FOR BOTH 0047 0043 AMPHZ AND REIM, WHERE LR IS LENGTH OF THE VECTORS. 0049 - J.F. CLAERBOUT • AUTHOR 0050 • ----USAGE---0051 "• 0052 0053 • TRANSFER VECTOR CONTAINS ROUTINES - RND • AND FORTRAN SYSTEM ROUTINES - ATAN,SQRT,COS,SIN 0054 0055 .. FORTRAN USAGE Of AMPHZ 0056 .. CALL AMPHZ IRE,XIM,LR,AMP,PHZ,R) 0057 0058 .. INPUTS 0059 0060 " REI I) I=l ••• L~ IS fLOATING POINT VECTOR Of REAL VALUES • 0061 0062 " XIM{I) 0063 I=l ••• LR IS fLOATING POINT VECTOR OF IMAGINARY VALUES. 0064 " LR IS FORTRAN II INTEGER. 0065 " MUST EXCEED 0 0066 " 0067 R =0 INOICATES PHASE IS BETWEEN + ANO - PI. 0068 NOT = 0 INDICATES THAT THE PHASE IS TO BE A CONTINUOUS 0069 FUNCTION FOR WHICH THE FIRST VALUE IS BETWEEN + ANO -PI 0070 0071 0072 .. OUTPUTS 0073 AMP II) 0074 I=I ••• LR IS FLOATING POINT VECTOR Of THE AMPLITUDES. .. .. . . .. . .... .. .. .. .. ... .. . .. . . .. ... --. - 10/1/64 •••••••••••••••••••••••• .. AMPHI ..............•... (PAGE 21 .. •••••••••••••••••••••••• PROGRAM LISTINGS -..... .. • AMPHI • • ••••••••••••••••••••••• (PAGE EQUIVALENCE WITH RE IS ALLOWED. •. PHIII) . it • l=l ••• L~ IS fLOATING POINT VECTOR OF THE PHASES. If AMP(JI=O. THEN PHIIJ)=O. EQUIVALENCE WITH XIM IS ALLOWED. .. FORTRAN USAGE OF REIM .. CALL REIM IAMP,PHI,LR,RE,XIMI it • INPUTS AND OUTPUTS HAVE THE SAME DEFINITIONS AS FOR AMPHI .. EXCEPT AMP, PHI, AND LR ARE INPUTS, .. RE, AN~ XIM ARE OUTPUTS. •.. • EXAMPLES OF AMPHI • 1. INPUTS - RE(I ••• 1) • XIMll ••• 1) .. OUTPUTS - AMPll ••• 1) • PHIll ••• 1) . 1.,3.,0.,-3.,-1.,-3.,0. LR 0.,4.,1.,+4., 0.,-4.,-1. 1.,5.,1.,5.,1.,5.,1. =1 R =0 0.,0.9213,1.5108,2.2143,3.1416,-2.2143.-1.51 • 2. INPUTS SAME AS EXAMPLE 1. EXCEPT R=l. • OUTPUTS - AMPll ••• 11 = 1.,5.,1.,5.,1.,5.,1. .. PHIIl ••• 1) = 0.,0.9213,1.5108,2.2143,3.1416.4.0689,4.1124 . 8SS 8CI AMPHI SXD SXA CLA* STO CLA. STD CtA ADD STA CLA PIPI Al AZ • .. 1 I,AMPHZ .-Z,4 SVl,1 6,4 TSTCN 3,4 AI0 1,4 =1 A2 2,4 =1 Al 4,4 =1 A4 5,4 =1 A5 =1 A6 FIRST GET N RE 1M ADO STA ClA AMP ADO STA ClA PHZ ADD STA THIS PHI ADO STA PREVIOUS PHI STO STORE SOME NON-ZERO QUANTITY AXT 1,1 SET FOR LOOP OF LENGTH N lET. A2 If REAL PART IS ZERO TRA Al ISN*T =1.57079633 SET EQUAL +PI/Z OR -PI/Z ClA TRA A3 ClA ... ,1 IMAG FOP ... ,1 REAL XCA SSP TSX $ATAN,4 THE fOUR QUADRANT AM81GUITY IS ELEGANTLY RESOLVED IN THE NEXT 5 I~STRUCTIONS A3 A4 LDQ. TQP fSB LDQ* LLS STO LDQ" FMP. STO LDQ. FMP" FAD TSX STO TNZ STZ AZ A3 =3.14159Z65 RIGHT OR lEfT HALF PLANE RIGHT lEfT AI 0 PHZ Al Al AMP AZ AZ AMP SSQRT,4 •• ,1 .+2 PHI UPPER OR LOWER HALF PLANE COMPUTE AMPLITUDE STO AMPl IF AMP=O. SET PHI=O. 0075 0016 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 011Z 0113 0114 0115 0116 0117 0118 0119 0120 0121 01Z2 0123 01Z4 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 2) .•••••••••••••••••••••••• .. •••••••••••••••••••••••• PROGRAM LISTINGS AMPHI (PAGE * IfT TRA A5 A9 AIO All SVI CONT • .. .. A6 CLA TSTCN CONT FIRST PHI STO • •• 1 STZ (PAGE REPRESENT PHASE PI TO -PI OR CONTI NUOUSL V STORE PHASE TXI *+1,1,1 REPEAT LOOP TXL PIPI.l.· .. **=N AMPHZ-2,4 LXD AXT *·,1 7,4 TRA lET FIRST TRA A45 WE DONT HAVE A FIRST VALUE VET GET M=IPREV PHASEJ/(2 * PI) ROUNOED TO INTEGER CLA **.1 GET PREV PHASE FDP =6.2831853 XCA $RNO,4 TSX XCA FMP =6.2831853 TWOPIM STO FORM SS=ABSF(PHI+2.*PI*M-PHZPRV) SM=ABSF(PHZ+2.*PI*M-PHZPRV-2.*PII FORM SP=ABSFIPHZ+2.*PI*M-PHIPRV+Z.*PI) FORM FAD Pfil A6 FSB* SS SS STILL NEEDS ABS VALUE STO FSB =6.2831853 SSP GOT SM STO SM CLA SS FAD =6.2831853 SSP STO SP GOT SP CAL SS STO SS GOT SS FORM PHITRIAL=PHI+2.*PI*M CLA PHI FAD TWOPIM STO PHZ WHIC IS SMALLER, SS,SP, OR SM * IF SS, THEN PHASE PHITRIAL * IF SM. THEN PHASE PHlTRIAL - 2 PI * IF SP. THEN PHASE PHITRIAL + 2 PI CLA SS SUB SM TPL A7 TRA IF SS GREATER SM CLA SS SS SMALLER SM SUB SP SS SMALLEST, STORE PHASE TMI A5-1 SP SMALLEST A65 CLA PHI FAD =6.2831853 TRA AS STORE CORRECT PHASE CLA SM SM SMALLER SS A7 SUB SP TPL A65 SP SMALLEST CLA PHI SM SMALLEST FSB =6.2831853 TRA A5 STORE CORRECT PHASE TSTCN PIE rWOPIM PIE PIE SS PIE SM PIE SP FIRST PZE AMP PIE PHI PIE REIM SXD AMPHI-2,4 R5,t SXA 1,4 AMP ClA AOD =1 STA R2 2,4 PHASE ClA AOD =1 STA R1 4,4 RE CUI .. . . AMPHZ •••••••••••••••••••••••• 3) A45 • ••••••••••••••••••••••• 0150 0151 0152 0153 0154 0155 0156 0157 015B 0159 0160 0161 0162 0163 0164 0165 0166 0167 016B 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 3) ..• _..................... AMPHZ I' ROGR AM 1I STINGS * ••••••••••••• ** .......... (PAGE RI R3 R4 R5 ORF • AMPHZ •••••••••••••••••••••••• (PAGE 4) R2 •••••••••••••••••••••••• • ADO STA ClA ADO STA ClA* POX ClA STO ClA STO TSX XCA HIP 510 ClA TSX XCA FMP STO TIX AXT lXD TRA OCT END =1 R3 5,4 =1 R4 3,4 ,1 *·,1 AMP *·,1 PHZ SCOS,4 AMP **,1 PHZ $SHl,4 AMP .*,1 R2, 1,1 ... ,1 AMPHZ-2,4 6,4 233000000000 1M GET N STORE IN IRI 0225 0226 0221 0228 0229 0230 0231 0232 0233 0234 0235 0236 0231 0238 0239 0240 0241 0242 0243 02 It It 0245 0246 0241 0248 0249 0250 4) * .••••••••••••••••••••••• .. ARBCOL ................... _.... PROGRAM LISTINGS ... .. -•............ -_ ...... ARBCOL • ••••••••••••••••••••••• .. ARBCOL (SUBROUTINE) 9/9/64 LAST CARD IN DECK IS NO. 0210 .. FAP 0001 -ARBCOL 0002 COUNT 200 0003 ARBCOL 0004 LBL ENTRY ARBCOL (FOFIJ,LI,LJ,IDIMEN,FJCOL,COLI 0005 0006 0001 ----ABSTRACT---0008 0009 .. Tl TLE - ARBCOL 0010 .. FINO A MATRIX COLUMN WITH ARBITRARY INDEX BY INTERPOLATION 0011 0012 ARBCOL IS GIVEN A MATRIX AND A FLOATING POINT NUMBER 0013 (GENERALLY NOT A WHOLE NUMBER) REPRESENTING A DESIRED 0014 COLUMN NUMBER IN THE MATRIX. THE FOUR COLUMNS WHICH 0015 ARE CLOSEST IN NUMBER TO THE DESIRED COLUMN NUMBER ARE 0016 SUBJECTED TO CUBIC INTERPOLATION TO YIELD THE 0017 INTERPOLATED COLUMN. 0018 0019 0020 ARBCOL REDUCES THE DEGREE OF INTERPOLATION IN THE CASES OF MATRICES WITH ONLY 3, 2. OR 1 COLUMNS. 0021 0022 THE PROCEDURE USED IS TO FINO THE PROPER INTERPOLATION 0023 OPERATOR FOR THE GIVEN COLUMN NUMBER AND THEN APPLY IT 0024 IN A HIGH SPEED LOOP ON THE ROW INDEX • 0025 0026 .. LANGUAGE - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) 0027 .. EQUI PMfNT - 109 OR 1090 (MAIN FRAME ONLY) 0028 .. STORAGE - 129 REGISTERS 0029 .. SPEED - TAKES ABOUT 530 + 90-N MACHINES CYCLES ON THE 1090. 0030 WHERE N NO. ROWS IN THE MATRIX. 0031 .. AUTHOR - S.M. SIMPSON. MARCH 1964 0032 0033 0034 ----USAGE---0035 0036 .. TRANSFER VECTOR CONTAINS ROUTINES - INTOPR 0037 .. AND FORTRAN SYSTEM ROUTINES - (NOT ANY) 0038 0039 .. FORTRAN USAGE 0040 CALL ARBCOL(FOFIJ,LI,LJ,IDIMEN,FJCOL,COL) 0041 0042 .. INPUTS 0043 0044 FOFIJ(I,JI I=l ••• LI. J=l ••• LJ IS A MATRIX OF FLOATING POINT 0045 ELEMENTS. 0046 0047 MUST EXCEED ZERO 0048 LJ 0049 MUST EXCEED ZERO LJ 0050 0051 IDIMEN IS THE DIMENSION,IN THE CALLING PROGRAM, OF THE 0052 0053 INDEX 1 OF FOFIJ(I,J) MUST BE GRTHN= LI 0054 0055 IS THE FLOATING POINT COLUMN NUMBER FOR WHICH AN 0056 FJCOL INTERPOLATED COLUMN IS DESIRED 0051 MUST BE GRTHN= 1.0. AND LSTHN FLOATFtLJ+l) 0058 0059 0060 .. OUTPUTS STRAIGHT RETURN WITH NO OUTPUTS IF LI, LJ, IDIMEN. OR FJCOL IS ILLEGAL 0061 0062 0063 COL (I) l=l ••• LI IS THE INTERPOLATED COLUMN 0064 0065 .. EXAMPLES 0066 0061 0068 .. 1. THIS EXAMPLE INTERPOLATES ALL HALF-INDEX AND FULL-INDEX COLUMNS 0069 .. IN A I-COLUMN. A 2-COLUMN •••• , AND A 5-COLUMN MATRIX. IT ALSO 0010 .. SHOWS THAT NO INTERPOLATION RESULTS FOR ILLEGAL FJCOL VALUES. 0011 0072 .. INPUTS - FOFIJ(1,2,3"l,2,3,4,5) = It 0.,0.,0 •• , 0.,1 •• 2 •• t 0.,2.,4 •• , 0.,3.,6." 0.,4.,8. 0073 .... ... .. ..... .. ... .... ... -. . ... . . . .... ..... .. ... . .. -. .. ... . *** ••••••••••••••••• .•••• . •••••••••••••••••••••••• PROGRAM LI S Tt NG S AR8COL (PAGE 2) .." LI=3 USAGE (PAGE IDfMEN=10 COLll ••• 3,,1 ••• 9,,1 ••• 51 = -99., ••• DIMENSION FOFIJII0,51,COLI3,9,51 00 10 LJ=1,5 00 10 J=1,9 FJCOL IFLOATFIJ+111/2.0 CAll ARBCOL{FOFIJ,LI,LJ,IOIMEN,FJCOL,COLll,J,LJII " " 10 .... 0., 0., O. FOR LJ= 1 ••• 5 OUTPUTS - COLll ••• 3,I,LJI COLll ••• 3,2,1l 0., 0., O. ..." 0., .5, 1. COLl1 ••• 3,2,LJI FOR LJ=2 ••• 5 COLl1 ••• 3,3.LJI = 0., 1., 2. FOR LJ=2 ••• 5 COllI ••• 3,4, LJ I 0.,1.5, 3. FOR LJ=2 ••• 5 .... 0., 2., 4. COlll ••• 3,5,LJI FOR lJ=3 ••• 5 COll1 ••• 3,6,lJI 0.,2.5, 5. FOR LJ=3 ••• 5 COLIl •••.3,7,LJ) FOR LJ=4,5 0 •• 3., 6. ". COLll ••• 3,8,LJ I 0.,3.5. 7. FOR LJ,4,5 .. COLl1 ••• 3,9,5) 0., 4. , 8. COllI ••• 3, J, L J) -99.,-99.,-99. WHE"IEVER J • ". " PROGRAM FOLLOWS BELOW . .. TRANSFER VECTOR CONTAINS INTOPR ONLY " o o HTR HfR BCI XR1 XR4 1, ARBCOL * * ONLY E"ITRY. . ARBCOL(FOFIJ,LI,LJ,IOIMEN,FJCOL,COLI AR8COL SXO SXO ARBCOL-2,4 AR8COL-3d it LI, ... CHECK ClA. LJ AND fOIMEN 2,4 LEAVE LfAVE 0,1 3,4 LEAVE LEAVE 4,4 2.4 LEAVE 2,4 18 101M TMI TlE POX CLA. TM! HE CLA. sua .. TMI ADO* ARS STO • LI IFOR LOOP AT STZI LJ 10lMfN MINUS LI * FIND JCOL FJCOL ROUNDEO OOWN EXCEPT IN THE CASE THAT * FJCOL FlOATFILJI AND lJ EXCEEDS 1 * IN WHICH CASE SET JCOl = LJ-l = . CLA. UFA LRS ANA LLS 5,4 K233 ALS 18 3.4 LEAVE LJCK LEAVE LEAVE JCOK K01 JCOK KG1 TZE . ..* TRA SUfi TNZ ADO THEN FORM JCOK STO LRS ORA FAD FJCOL o KDECR o CASTRA TRA TMI LJCK • ••••••••••••••••••••••• AR8COL " "• ••••••••••••••••••••••• X = EXCEEDS lJ EQUALS LJ ([QUALS LJ EQUALS 1) FJCOL - FLOATF(JCOL) JCOL 18 K233 K233 GRTHN 2*LJ 0014 0015 0076 0077 0078 0019 0080 0081 0082 0083 0.084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 DIU 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 2) •••••••••••••••••••••••• • • ••••••••••••••••••••••• ARBCOl • • ••••••••••••••••••••••• PROGRAM LISllNGS • ARReOL .. •••••••••••••••••••••••• (PAGE (PAGE 3) CHS FAD- • • • sro 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 5,4 X NOW SOME ADDRESS SETUPS CLA SUB XeA MPY llS CHS ADD ADO STA JCDL KD2 ID[M 17 K1 1,4 LDQ1 SUB IO[M STA LDQ2 1D[M lDQ3 101M lDQ4 6,4 Kl STORE SUB STA SUB STA eLA ADD STA AIFOFIJ)-IJCOl-2).ID[MEN+1 AICOLI ... SET UP AS THOUGH NDATA=4 THEN TEST JCOl It eLA STA CLS STO elA STO CLA SUB TlE FMPI TSXOP 0176 0177 KlL 0178 0179 0180 0181 0182 01B3 0184 0185 0186 0187 018B 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 XLO KD4 NDATA JCOL KD1 JCOll It .. SETTINGS FOR JCOl EXCEEDING 1 ARE All MADE UNLESS JCOL+1=lJ • ADD SUB. TlE TRA . JCOl+l COMPARE WITH LJ SAME, CHANGE NDATA TO 3 SMALLER, ALL SETTINGS OK KD2 3,4 NDATA3 GETOP .. SETTINGS IF JCOL=l "JCOll CLA STA STZ CLA. STO SUR TMI .. FMP2 TSXOP XlO 3,4 NDAJA KD3 STZOP AIFMP2) = OPER2 XLO=O.O TRIAL SET NOATA =lJ 10K IF LJ=l OR 2) THEN TEST (NEGATIVE IF LJ=1 OR 2) .. CHANGE NDATA TO 3 FOR [NTERPOlATING NEAR RIGHTMOST COLUMN. " NDATA3 CtA STO KD3 NDATA ".. CLEAR OPER1,},4, IF " STlOP STl OPERI STl ... GO GET STZ . GETOP .. NOATA IS NOT 4 OPER3 OPER4 THE OPERATOR TSX TSX TSX TSX TSX TSXDP TSX lXO $I NTOPR,4 NOATA,O XlO,O KIL,O X,O •• ,0 ARBCOl-2,4 123 0.0 0.0 0.0 3 4 -1.0 -1.0 OPERI OPERI DELX .. :. OPER2 OPER2 OPER2 3) •••••••••••••••••••••••• • •••••••••••••••••••••••• PROGRAM LISTINGS • ARBCOl • •••••••••••••••••••••••• 4) (PAGE • lOOP FORMING I NTERPOlA TES, • STZ lOO FiliP FAD STO lOO2 lOO FMP2 FMP FAD STO lOO3 lOO FMP FAD STO lOO4 lOO FiliP FAO STORE STO TIX STZ lOOl FMPI - TEMP .... ,1 OPERI TEMP TEMP *.,1 OPER2 TEMP TFMP •• ,1 OPER3 TEMP TEMP •• ,1 OPER4 TEMP **.1 STZ,l,1 (PAGE XRl=lI,ll-l •••• ,l .... AIFOFIJI-IJCOl-21.IOIMEN+1 ... DITTO lOOl MINUS IOIMEN ... DITTO l002 MINUS IOIMEN ... ... DITTO l003 MINUS 10IMEN AICOll+l .. EXIT . LEAVE lXO TRA ARBCOL-3,1 7,4 - CONSTANTS, VARIABLES • Kl KOI K02 K03 K04 K233 KOECR Kll 101M JCOl NOATA XlO X TEMP OPER4 OPER3 OPER2 OPER1 PIE PZE PIE PZE PIE OCT OCT DEC PZE PZE PIE PZE PZE PZE PZE PIE PZE PZE END 1 0,0,1 0,0,2 0,0,3 0,0,4 233000000000 000000377777 1.0 .. - 0,0, •• 0,0,-" 1, 2, 3, OR 4 NORMALLY = -1.0 IMAY BE 0.0) EOUAlS FJCOl-FlOATFIJCOLI •• , •• ,** IIIULTIPlIES MULT IPlleS MULTIPLIES MUL TIPLIES .... .... .... .. , .• , .. .... ,, .... ,, •... •• , •• ,*. , , , , • ARBCOl •••••••••••••••••••••••• COLUMN COLUMN COLUMN COLUMN NO • NO. NO • NO. .ICOL +2 JeOL +1 JCOL JCOl-1 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 4) •••••••••••••••••••••••• PROGRAM LISTINGS " ARCTAN (FUNCTION) .. FAP "ARCTAN COUNT 30 LBL ARCTAN ARCTAN F(X,Y) ENTRY •••••••••••••••••••••••• . ARCTAN • •••••••••••••••••••••••" ARCTAN " "•••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0091 0001 0002 0003 0004 0005 0006 0007 0008 ----ABSTRACT---0009 "" TJ TLE - ARCT AN 0010 .. ARCTANGENT FUNCTION 0011 0012 it ARCTAN FINDS THE ANGLE IN RADIANS ASSOCIATED WITH AN 0013 0014 X AND Y COORDINATE SUCH THAT " 0015 " it -3.14159265 LSTHN ANGLE LSTHN= 3.14159265 0016 0017 0018 0019 .. LANGUAGE - FAP FUNCTION (FORTRAN II COMPATIBLE) 0020 .. EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0021 - 29 REG I STERS " STORAGE 0022 it SPEED - ABOUT 250 MACHINE CYCLES ON 7090. 0023 - R.A. WIGGINS MARCH 1964 " AUTHOR 0024 " 0025 " It 0026 ----USAGE---0027 .. TRANSFER VECTOR CONTAINS ROUTINES - (NOT ANY) 0028 0029 It AND FORTRAN SYSTEM ROUTINES - ATAN 0030 "" FORTRAN USAGE 0031 0032 " ANGLE = ARCTANF(X,Y) 0033 " 0034 "" INPUTS 0035 It 0036 0037 X IS THE ABSCISSA OF THE POINT 0038 "it 0039 IS THt ORDINATE OF THE POINT Y 0040 " 0041 "" OUTPUTS 0042 0043 0044 IS THE ANGLE IN RADIANS FROM THE POSITIVE X-AXIS TO THE ANGLE 0045 POINT, ARCTANGENT OF Y/X. " 0046 0047 0048 .. EXAMPLES 0049 0050 .." 1. USAGE ANGLEl ARCTANF -2., 0.) -2., 1. ) 0051 ANGLE2 ARCTANF " O. , 1. ) 0052 ANGlE3 ARCTANF " 0053 ARCTANF 2., 1. ) ANGLE4 0054 ARCTANF 2. , 0.) ANGLE5 " 2. , -1. ) 0055 ANGLE6 ARCTANF O. , -1. ) 0056 ANGlE7 ARCTANF " 0057 ARCTANF ( -2. , -1. ) ANGLE8 ANGLE3 1.5708 0058 ANGLE! 3.1416 ANGLE2 2.6779 .. OUTPUTS = = '" 0059 ANGLE4 = 0.4636 ANGLES = O. ANGlE6 =-0.4636 " 0060 ANGLE7 =-1.5708 ANGLE8 =-2.6779 0061 " 0062 0063 " PROGRAM FOLLOWS BELOW 0064 0065 XR4 HPR o 0066 I,ARCTAN BCI 0067 XR4,4 ARCTAN SXO 0068 STO Xl 0069 A TlE 0070 TMI Al 0071 CRRCT STZ 0072 TRA A3 0073 A CLA =1.57079632 0074 TRA Al+ 1 ... . . ... . .. .... .... . .. . . . . 9/4/64 ••••••••••••••••••••••• * UCTAN * • •••••••••••••••••••••••• IPAGE 2) Al A2 A3 ADD CLA TQP SSM STO PXD NZT TRA XCA FOP XCA TSX FAD LXO TRA CRRCT pze pze Xl END =3.14159265 A2 CRRCT ,0 Xl ADO Xl SATAN,4 CRRCT XR4,4 1,4 0 0 PROGRAM LISTINGS •••••••••••••••••••••••• • • ARCTAN •••••••••••••••••••••••• IPAGE 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 21 ................. *_ ..... ARG ••••••••••••• • * ••••••••••• REFER TO LOCATE PROGRAM LISTINGS •••••••••••••••••••••• ** *•••• *ARG ••••••••••••• w•• ~.* REFER TO LOCATE •••••••••••••••••••••••• .. ASPECT .. •, •• ~ ••••••••••••••••• *. PROGRAM LISTINGS •••••••••••••••••••••••• * ASPECT .. ASPECT (SUBROUTINE) 9/29/64 LAST CARD IN DECK IS NO. 0535 0001 " FAP "ASPECT 0002 COUNT 560 0003 LBL ASPECT 0004 ENTRY ASPECT (ACOR,N,COSTAB,M.JMIN,JMAX,TYPE,SPECT.SPACE, 0005 ISCALE.ERR) 0006 " 0007 ----ABSTRACT---0008 0009 * " TITLE - ASPECT 0010 .. FAST COSINE TRANSfORMS OF ONE-SIDED AUTOCORRELATIONS 0011 0012 " ASPECT PRODUCES A HI-SPEED POWER- OR ENERGY-DENSITY 0013 SPECTRUM (OR PORTION THEREOF) FROM AN N-LAG AUTOCORREL0014 ATION FUNCTION. AC(I) I=O,l •••• ,N, ACCORDING TO 0015 0016 N 0011 it SP(J) ACIO) + 2-SUM ( ACII )-COS( I*J*(PI/M» 0018 1=1 0019 0020 fOR J = JMIN,JMIN+I, •••• JMAX 0021 WHERE 0022 PI = 3.14159265 0023 N,M,JMIN AND JMAX ARE INPUT PARAMETERS 0024 COS(J*(PI/M» J=O,I, •••• M IS AN INPUT TABLE 0025 o LSTHN= JMIN LSTHN JMAX LSTHN= M 0026 0027 SPEED IS ATTAINED BY 0028 1. (FOR M LSTHN=N) 0029 - COLLAPSING AC(I) INTO THE RANGE 0 TO 2M 0030 - SPLITTING THE COLLAPSED 0031 CORRELATION INTO ODD AND EVEN PARTS AND 0032 SUBPARTS (ONLY 2 OF THESE 4 ARE USED) 0033 2. USING THE HIGH-SPEED LOOPING LOGIC OF SUBROUTINE 0034 COSP TO PERFORM THE TRANSFORMS OF THE SHORTENED 0035 PARTS (LENGTH = M/21 0036 0037 THE AUTOCORRELATION MAY BE FLOATING POINT OR FIXEO 0038 (COMPUTATIONS SLIGHTLY FASTER FOR FIXED POINT) 0039 0040 2*M+l TEMPORARY REGISTERS ARE NEEDEO UNLESS USER IS 0041 WILLING TO SACRIFICE THE AUTOCORRELATION FOR THIS PURPOSE 0042 (TEMPORARIES NOT REQUIRED FOR M GRTHN N) 0043 0044 .. LANGUAGE - FAP SUBROUTINE (FORTRAN II COMPATIBLE) 0045 " EQU I PMENT - 709 OR 7090 (MAIN FRAME ONLYI 0046 .. STORAGE - 278 REGISTERS 0047 - FIXED PT, M LSTHN= N - 17*M*(JMAX-JMIN+ll MACH. CYCLES 0048 " SPEED FLTG. PT, M LSTHN= N - 19*M*(JMAX-JMIN+IJ MACH. CYCLES 0049 (FOR M GRTHN N SUBSTITUTE 2N FOR M IN ABOVE FORMULAS) 0050 - S.M. SIMPSON JR, OCT, 1961 " AUTHOR 0051 0052 ----USAGE---0053 0054 .. TRANSFER VECTOR CONTAINS ROUTINES COLAPS, COSP, OUBLX, DUBLL • 0055 SPLI T, RVPRTS 0056 "NONE AND FORTRAN SYSTEM ROUTINES 0057 0058 - FORTRAN USAGE 0059 " CALL ASPECT(ACOR,N,COSTAB.M,JMIN,JMAX,TYPE,SPECT.SPACE,ISCALE,ERRI 0060 0061 0062 - INPUTS 0063 ACOR (I) I=I ••• N+l CONTAINS AC(J) J=O,I •••• ,N 0064 ACUR IS FIXED OR FLTG AS SPECIFIED BY TYPE 0065 0066 N MUST EXCEED ZERO 0061 " 0068 ".. COSTAB(I) I=l ••• M+l CONTAINS COS(J"PI/MI J=O,I •••• ,M 0069 .. COS TAB IS FIXED OR FLTG AS SPECIFIED BY TYPE 0070 .. IF FIXED PT IT IS ASSUMED THAT THE BINARY POINT IS 0011 .. BETWEEN THE SIGN BIT AND BIT 1 SO THAT VALUES =+1. AND 0072 " -1. SHOULD BE ENTERED AS OCT 377717717777 AND 0073 .. OCT 771777777777 RESPECTIVELY. THE BINARY POINT OF 0074 .. ... .. .. .... ... ... ... ... . .-.. . -.-. . .. . . .. .. . •••••••••••••••••••••••• •••••••••••••••••••• ** •• ASPECT *.**.* ••••••• **.** •• ** •• IPAGE 2) . • ... ... PROGRAM LISTINGS .* •••••••••••••••••••••• .* ASPECT ** ••••••• *** ••••••••••• * IPAGE ACOR IS IMMATERIAL BUT ACCURACY IS GREATER FOR FEWER LEADING ZEROES. M MUST EXCEED ZERO JMIN DEFINES LOWEST MULTIPLE OF FUNDAMENTAL OESIRED MUST BE GRTHN= 0 AND LSTHN jMAX JMAX DEFINES HIGHEST MULTIPLE OF FUNDAMENTAL DESIRED MUST BE GRTHN JMIN AND LSTHN= M . TYPE = 0.0 SIGNIFIES ACOR AND COS TAB ARE FIXED POINT NOT = 0.0 MEANS ACOR AND COSTAB ARE FLTG. POINT "" SPACEII) 1=1 ••• 2"M+l MUST BE AVAILABLE FOR TEMPORARY USE IF M IS LSTHN= N. SPACEII) NOT USED FOR M GRTHN N. EQUIVALENCEISPACE,ACORI IS PERMITTED IACIII WILL BE LOST) " " .." ". " " .. " . .. OUTPUTS ." SPECTII) I-l ••• JMAX-JMIN+l WILL CONTAIN SPIJI J=JMIN ••• JMAX AS DEFINED IN ABSTRACT. lIT IS FIXED OR FLOATING ACCORDING TO TYPE) I SCALE IS NOT USED FOR FLOATING POINT DATA IS A SCALE FACTOR FOR FIXED POINT RESULTS, DETERMINED BY ASPECT SO AS TO AVOID OVERFLOW. =0 MEANS BINARY POINT OF SPIJ) SAME AS ACIJ) NOT - 0 MEANS BINARY POINT OF SPIJ) IS ISCALE BITS TO THE RIGHT OF BINARY POINT OF ACIJ) ERR 0.0 NORMAL '" 1.0 IF N,M,JMIN OR JMAX IS ILLEGAL " " " ." ". " .. .. . ... EXAMPLES • 1. COMPLETE .. INPUTS .. " .. "USAGE .. • .. OUTPUTS " .. .. ... ..." ..... 2. USE OF SPACE SAVING FEATURE INPUTS - SAME AS EXAMPLE 1. CALL ASPECTIACOR,N,COSTAB,M,JMIN,JMAX,l.O,SPECT, USAGE ACOR,OUMMY,ERR) CALL ASPECTIIACOR,N,COSTBL,M,JMIN,JMAX,D.O,ISPECT, IACOR,ISCALE,ERR) OUTPUTS - SAME AS EXAMPLE 1. IBUT ACOR AND IACOR ARE DESTROYED) " 3. PARTIAL .. INPUTS .. USAGE .. OUTPUTS .. . SPECTRUM, NOT TRYING TO SAVE SPACE, FIXED OR FLOATING ACORll ••• 4) = 2.,2.,3.,4. IACORll ••• 4) '" 200,200,300,400 COSTABll ••• 3) = 1.0,0.0,-1.0 N=3 M=2 COSTBll1 ••• 3)-OCT377777777777,0000000DOOOO,777177177777 JMIN = O. JMAX = 2 CALL ASPECTIACOR,N,COSTAB,M.JMIN,JMAX.1.0,SPECT, SPACE,OUMMY.ERRll CALL ASPECTIIACOR,N.COSTBL,M,JMIN.JMAX,O.,ISPECT, SPACE.ISCALE,ERR2) ERR 1 = ERR2 = O. SPECTll ••• 3J=20.,-4.,-4. ISPECTl1 ••• 3)=2000.-400.-400 ISCAlE - 0 SPECTRUM - SAME AS EXAMPLE 1. EXCEPT JMIN=l - SAME AS EXAMPLE 1. - SAME AS EXAMPLE 1. EXCEPT SPECTll ••• 21=-4.,-4. ISPECTl1 ••• 2)=-400,-400 .. 4. FINER GRAINED SPECTRUM, M GRTHN N , FLTG PT .. INPUTS - SAME AS EXAMPLE I. EXCEPT .. COSTABll ••• 5)=1.0,.70711,O.O,-.70711,-1.0 M=4 .. USAGE - SAME AS FIRST CALL IN EXAMPLE 1. " OUTPUTS - ERR=O. SPECTll ••• 5) = 20.,-.82844,-4.,4.82844,-4. ".. " " " " 5. FIXED POINT CASE INVOLVING SCALING INPUTS - SAME AS EXAMPLE 1. EXCEPT IACORl1 ••• 4) '" 20000,20000,30000,40000 USAGE - SAME AS SECOND CALL IN EXAMPLE 1. OUTPUTS - ERR2=0. ISPECT=100000,-20000,-20000 ISCALE=1 II.E. 0075 0016 0077 0078 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 2) •••••••••••••••••••••••• ASPECT • •••••••••••••••••••••••• - IPAGE PROGRAM LISTINGS 3) -• •••••••••••••••••••••••• ASPECT •••••••••••••••••••••••• (PAGE ISPECT VALUES SHOULO BE DOUBLED FOR TRUE SCALE) • 6. ERROR EXI1S (WITH NO COMPUTATION) • USAGE CALL ASPECT(ACOR,-I,COSTAB,3,0,3,1.0.SPECT,ACOR, • DUMMY,ERRl) • CALL ASPECT(ACOR,2,COSTAB,O,O,3.1.0,SPECT,ACOR, • DUMMY,ERR2) • CALL ASPECTIACOR,2,COSTAB,3,-1,3,1.0,SPECT,ACOR, • DUMMY,ERR3) • CALL ASPECTIACOR,2,COSTAB,3,O,4,1.0,SPECT,ACOR, • DUMMY,ERR4) • CALL ASPECTIACOR,2.COSTAB,3,2,2,l.0,SPECT,ACOR, * DUMMY,ERR51 • OUTPUTS - ERRl=l. IILLEGAL N) ERR2=1. (ILLEGAL MI • ERR3=1. (ILLEGAL JMINI ERR4=1. (ILLEGAL JMAXI • ERR5=1. IILLEGAL JMAXI • ** • * • - PROGRAM FOLLOWS BELOW NOTATION DIFFERENCES IN PROGRAM NOTES ARE AACC=ACOR SCALE=ISCALE HTR 0 BCI l,ASPECT ASPECT SXO *-2,4 SXA LV+l,l SXA LV+2,2 -MAKE PARTIAL ARGUMENT MAP (CHECKING N,M,JMIN) Al CLA 1,4 AACC STA n CLA2,4 N TMI A2A HE AlA STD T2 CLA 3,4 COSTAB STA 13 CLA* 4,4 M TMI A2A TZE A2A STD T4 CLA5,4 JMIN TMI A2A STD T5 CLA6,4 JMAX STD T6 CLA7,4 CONTENTS OF TYPE STO T7 CLA 8,4 SPECT STA TB CLA 9,4 SPACE STA T9 CLA 10,4 SCALE STA no -CHECK LEGALITIES, JMIN LESS THAN JMAX LESS THAN OR-M A2 CLA T6 JMAX CAS T5 JMIN TRA A2B OK NOP NO GOOD A2A CLA KLI NO GOOD STO* 11,4 SET ERR INDICATOR TRA LV EXIT A28 CAS T4 M TRA A2A NO GOOD ~P STZ11,4 -IF OK SET UP CONSTANTS A3 CLA T4 ADD KDl STO 115 ADO T4 STO Tl6 SUB KDl STD Tl7 CLA T2 ~ OK SET ERR-O.O M M+l 2M+l 2M N 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0110 0111 0172 0173 0114 0175 0176 0177 0178 0179 0180 0181 0182 0183 01B4 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 3) ........... _._ .......... PROGRAM LI STINGS ASPECT * ••••••••••••••••••••••••• (PAGE (PAGE 41 ADD STD CLA SUB ADD STD CLA ARS STD .NOW ADDRESSES A4 CLA STA STA STA STA STA STA STA STA STA STA STA STA STA STA STA ADD STA STA STA CLA STA CLA STA STA STA STA STA STA STA STA STA ALS SU8 ARS STA ALS AOD SUB ARS STA STA CLA ALS SUB SUB ARS STA STA STA CLA STA STA CLA STA STA STA STA .WHEN ALL SET A5 lET TRA .FIXED A6 CLA ARS A7 STO KDl Ti8 T6 T5 KOI H9 TIt 1 H4 H A6 A7 A8 A9 A23 A26 A27 A28 A29 A30 A31 A34 A3S A37 A38 Kl All AI9 A21 HO Al8 T9 A24 M4 A48 A49 A50 AS2 A53 AS5 A56 18 Ti7 18 A40 18 T4 KDl IB ASI A55B T9 18 TI4 KDl IB A54 A55A A57 •••••••••••••••••••••••• ASPECT • •••••••••••••••••••••••• • N+l JMAX JMAX-JMIN JMAX-JMIN+l MI2 FOR M EVEN SET P= (M-1I12 FOR MODO AACC AACC+l SCALE SPACE SPACE-2M SPACE-M SPACE-M-I SPACE SPACE-P SPACE-P-l COSTAB A32 AS8 SPECT T8 AH A36 A39 AS9 UP BEGIN BY DIVIDING AUTOCOR OF ZERO BY 2 T7=CONTENTS OF TYPE T7 A8 T3 .* ( "'=AACCI ** I **=AACCI 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0273 0274 0275 0276 0277 0278 0279 0280 0281 0282 0283 0284 07.85 0286 0287 0288 0289 0290 0291 0292 0293 0294 0295 0296 0297 0298 41 •••••••••••••••••••••••• .................. ASPECT -......" (PAGE 51 PROGRAM LISTINGS • ••••••••••••••••••••••• -• •••••••••••••••••••••••• TRA AI0 -nOATI NG I .-=AACC I A8 CLA .FOP KL2 A9 STQ -'-"=AACCI TRA A22 AVOIO SCALING CHECK "IF DATA IS FIXED POINT DECIDE IF IT NEEDS DOWN-SCALING .TO PREVENT OVERFLOW IN THE COSINE TRANSFORM. IT WILL BE "DOWN SCALED IF TWICE THE SUM OF THE MAGNITUDES OF THE "CORRELATION CFROM LAG 0 TO NI OVERFLOWS. .. MARK SUMMATION AI0 STZ SUMHI TOV .+1 CLA KO LXD H8.4 TI8=PZE 0.0.N+1 All ADM .... 4 I -.=AACC+1 I TOV A13 A12 TIX Al1.4,1 TRA A14 .. ADD L TO SUMHI FOR EACH OVERFLOW, AND GO BACK A13 XCA CLA K1 ADD SUMHI STO SUMHI XCA TRA A12 .WHEN DONE CHECK IF SUMHI ZERO A14 ZET SUMHI TRA A16 THERE WAS OVERFLOW .FOR SUMHI ZERO CHECK BIT1 OF SUM IN AC ALS 1 TOV A15 YES CLA KO NO SEALING NEEDED TRA A17 WE NEED TO SCALE DATA DOWN 1 BIT "IF BIT 1 IS Kl A15 CLA TRA A11 .IF OVERflOW IN SUMHI WE NEED TO SCALE DOWN BY C(SUMHII+l Al6 CLA SUMHI ADD K1 -SET SCALE CONSTANT AND THEN DO IT IUNLESS SCALE IS ZEROI A11 S TA A20 ALS IB A18 STO I "-=SCALE I .. TZE A22 "SCALE DOWN LXD Tl8,4 TIB=PZE O,O,N+l Al9 CLA .",4 I*"=AACC+1) A20 ARS I""=SCALE CONSTANT) ." A21 STO .. ".4 ( ""= AACC+ 1) T1X AI9,4,1 .. CHECK IF COLLAPSING IS VALID lONLY FOR M LESS THAN OR =NI A22 CLA T4 T4=PZE O,O,M T2=PZE O,O,N CAS T2 TRA CSP2 NOT VALID NOP VALID -IF VALID GO DO IT (NOTE COLAPS FItLS IN ZEROS IF N lESS THAN 2M) CLPS TSX SCOLAPS,4 A23 TSX -" I."=AACCI TSX T18 TIB=PZE O,O,N+l TSX T1 T1=CONTENTS OF TYPE A24 TSX ".. I""=SPACEI TSX Tl1 T11=PZE O,O,2M -THEN RESTORE THE AurOCOR OF ZERO LAG TO ITS ORIGINAL VALUE .UNLESS THE USER HAD US COLLAPSE IT ON TOP OF ITSELF ISPACE=AACC) A25 CLA Tl Tl=PIE AACC CAS T9 T9=PZE SPACE TRA .+2 OK TO RESTORE TRA A40 AVOID RESTORING ACIOI -RESTORE FIXED OR FLOATING ZET T1 T7=CONTENTS OF TYPE TRA A28 FLOATING "FIXED AZ6 CLA I""=AACC) "" ALS 1 - ASPECT (PAGE 0299 0300 0301 0302 0303 0304 0305 0306 0307 030B 0309 0310 0311 0312 0313 0314 0315 0316 0311 0318 0319 0320 0321 0322 0323 0324 0325 0326 03;>1 0328 0329 0330 0331 0332 0333 0334 0335 0336 0331 0338 0339 0340 0341 0342 0343 0344 0345 0346 0341 0348 0349 0350 0351 0352 0353 0354 0355 0356 0351 0358 0359 0360 0361 0362 0363 0364 0365 0366 0361 0368 0369 0310 0311 0312 0313 51 * •••••••••• .••••••••••••••••••••••••• • ** •••••••••• ASPECT (PAGE 61 .... PROGRAM LISTINGS •••••••••••••••••••••••• • ( ... =AACC) STO TRA A40 .. flOATING ( .... =AACC) A2B lDQ •• FMP KL2 A29 STO ... (".=AACC I TRA A40 .IF COLLAPSING IS NOT VALID COMPUTE SPECTRUM DIRECTLY FROM .AACC. THEN DOUBLE THE SPECTRUM. RESTORE AC(OI ANO EXIT "(DONT WORRY ABOUT AC(OI SINCE SPACE WAS NOT USED) SCOSP.4 CSP2 TSX ( * ..=AACC) A30 TSX ** A31 TSX ... ' •• =AACC) TSX T2 T2=PZE O.O.N ( "=COSTA8) A32 TSX ** TSX T4 T4=PlE O.O.M TSX T5 T5=PlE O,O.JMIN TSX T6 T6=PlE O,O,JMAX T7=CONTENTS OF TYPE TSX T1 A33 TSX .. (··=SPECT) "FIXED OR FLOATING ZET T1 TRA AH flOATING -FIXED A34 CUI ( ".=AACC) ALS (".=AACC) A35 STO •• OUBlX,4 DeXl TSX A36 TSX (,,"=SPECT) TSX Tt9=JMAX-JMIN+1 Tl9 TRA GO EX IT LV .. FLOATING ( ... =AACC) A37 LDQ ** FMP KL2 ( .... =AACC) A38 STO ** DBLI TSX OUBLL.4 ( ""=SPECT) A39 TSX -TSX Tl9 Tl9= JMAX-JM I N+ 1 TRA LV GO EX IT -IF COLLAPSING WAS PERFORMED .THEN END-POINT ADJUST THE COLLAPSED CORRELATION AND OOUBLE IT A40 S T l . . (.*=SPACE-2M) lET T7 T7=CONTENTS OF TYPE TRA DBL2 .FIXED POINT $OUBLX,4 DBX2 TSX •• A44 TSX ( "·=SPACE) TSX Tt6 TI6=PIE 0.0.2M+1 TRA SPL Tl .. flOATING POINT DBl2 TSX SOUBLl,4 A48 TSX". (*.=SPACE) TSX T16 Tl6=PIE 0.0,2M+l .NOW SPLIT THE ADJUSTED COLLAPSED AUTOCORRELATION ON TOP OF ITSELF SPLTI TSX SSPLIT,4 ( **=SPACE) A49 TSX ** Tl6=PZE 0,0,2M+l TSX J16 TSX T1 T7=CONTENTS OF TYPE ("'=SPACE) A50 TSX ** ( **=SPACE-M-1) A51 TSX ** .NOW RESPLIT THE SYMMETRIC PART ON TOP OF ITSELF SPLT2 TSX SSPLIT,4 A52 TSX .. (*"=SPACE) TI5=PZE O.O,M+l TSX TI5 TSX T7 T7=CONTENTS OF TYPE A53 TSX ... ( ·*=SPACE) ( *"=SPACE-P-l) A54 TSX ** "REVERSE THE RESPLIT PARTS AND seT AS(PI=O FOR COSP REV TSX SRVPRTS,4 ("*=SPACE) A55 TSX ** A55A TSX .. (**=SPACE-P-l) (TI5=PIF. O.O,M+l) TSX Tl5 A55B STZ ... ( **=SPACE-M-l) .. NOW COMPUTE SPECTRUM FROM THE RfSPLIT PARTS CSP1 TSX SCOSP,4 A27 ... ... • ASPECT •••••••••••••••••••••••• (PAGE 0374 0375 0376 0377 0378 0379 03BO 0381 0382 0383 0384 0385 0386 0387 0388 0389 0390 0391 0392 0393 0394 0395 0396 0397 0398 0199 0400 0401 0402 0403 0404 0405 0406 0407 0408 0409 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 0440 0441 0442 0443 0444 0445 0446 0447 044B 61 •••••••••••••••••••••••• •••••••••••••••••••• _ •• * ASPECT PROGRAM 1I STINGS -••••••••••••••••••••••••- -...................*_ .... ASPECT 7) IPAGE IPAGE -" A56 A57 TSX TSX "" TSX Ti4 A58 TSX "" TSX T4 TSX T5 TSX T6 TSX T1 A59 TSX -FINAL EXIT LXD ASPECT-2,4 LV AXT "·,1 •• ,2 AXT TRA 12,4 "TEMPORARIES, ETC "INPUT ARGUMENTS T1 PZE "" T2 PIE 0,0,-" 13 PZE .. " T4 PZE 0,0,·· PZE 0,0,*. T5 PIE 0,0,.T6 T7 PZE "" T8 PZE T9 PZE ". TlO PZE "" H4 PZE 0,0,"" Tl5 PZE 0,0,"" Tl6 PZE 0.0,". 0,0,.Tl7 PlE 0,0, •• H8 PZE Tl9 PZE 0,0."" SUMHI PZE PZE KO PIE K1 1 0,0,1 KOl PZE KLl DEC 1.0 KL2 DEC 2.0 I."=SPACEI I ""=SPACE-P-II TI4=PZE O,O,P I··=COSTA8) T4=PZE O,O,M T5=PZE O.O,JMIN T6=PZE O,O,JMAX T7=CONTENTS OF TYPE I **=SPECT I ". I"·=XRll I.·=XR21 I "=AACCI I"·=N) I "=COSTAB) I·.=M) I··=JMINI I •• =JMAXI I."=CONTENTS OF TYPE=O.OIFXO)=l.OIFLTGll I •• =SPECT) I""=SPACEI I .""'SCALE I I".=P FOR COSP=M/2 OR IM-I)/21 I."=M+I FOR REV, SPLT2,1 1."=SM+l FOR SPLT2, OUBlX, OUBlL,) I **=2M FOR CLPS I 1•• =N+l FOR CLPS, SCALING,) I **·JMAX-JMIN+ll OVERFLOW REG FOR COR. MAGN. SUM ." ." ° " ".USE OF SPACE WHEN M IS EVEN " "• AFTER COLAPS • AFTER END POINT ADJUST AND OUBL " All MI 2XC12M-1I • " ETC • .-M-1 • -M -1 .SPACE ""THUS • " .USE AFTER SECOND SPLIT AfTER RVPRTS ANO END POINT SET ISAME BUT THESE NOT USEDI A1I1I A21P) O.O=ASIP) A21 ll=ASIP-ll XCIMI 2XCIMI A1I21 All II S1I M) XCIPI 2XCIPI Sl( P+lI Sl( P) A2(1) S21PI A2IPI=ASIO) S2101=SSIP) XC I 11 XC 101 2XC(1) 2XCIOI S l ( 11 Sl( 0) S21 1) S2(0) S2tP-ll=SS( 11 S2IPl=SS(0) " ETC • -P-l " -P "ETC AfTER FIRST SPLIT Al ( MI 0.0 0.0 • -2M 8LANK • -2M BLANK "-2M+l XC12M-11 I P=M/21 WHEN M EVEN RSS SPACE, Of SPACE WHEN M 15 ODD RAS IQ=IM+11/2, SPACE-P-1 P=IM-1)/2=Q-l) It " ..• • AFTER COLAPS • -2M BLANK "-2M+1 XC12M-11 - AFTER END POINT ADJUST AND DUBL 0.0 2XCI2M-1) AFTER FIRST SPLI T AFTER SECOND SPLIT AFTER RVPRTS AND END POINT SET SAME SAME All M) A1 I M-l A1I1I All 1) O.O=NOT USED 0449 0450 0451 0452 0453 0454 0455 0456 0457 0458 0459 0460 0461 0462 0463 0464 0465 0466 0467 0468 0469 0470 0471 0472 0473 0474 0475 0476 0477 0478 0479 0480 0481 0482 0483 0484 0485 0486 0487 0488 0489 0490 0491 0492 0493 0494 0495 0496 0497 0498 0499 0500 0501 0502 0503 0504 0505 0506 0507 0508 0509 0510 0511 0512 0513 0514 0515 0516 0517 0518 0519 0520 0521 0522 0523 7) •••••••••••••••••••••••• - - ASPECT PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 81 - -M --M+l -ETC xc I MI XC 1M-II - 2XCIM) (PAGE S1I M) --QI=-P+ 1) --Q+lI=-PI -ETC • -1 XC 111 2XCIl) SIll) -SPACE XCIO) 2XCIO) SIlO) -THUS WHEN MODO RSS = SPACE, RAS • END •••••••••••••••••••••••• ASPECT • ••••••••• * ••••••••••••••• A2IQ) A2111=AS(PI A2(2) A2111 S2IQ) A2{Q-ll=ASIII A2IQ)=ASIO) S21 11=SSIPI S2(2) S2111 SPACE-P-l S2IQ-1I=SSI1I S2(QI=SSI0) 0524 0525 0526 0527 0528 0529 0530 0531 0532 0533 0534 0535 81 •••••••••••••••••••••••• . •••••••••••••••••••••••• • ASPEC2 PROGRAM LISTINGS .••••••••••••••••••••••••• . ASPEC2 ••••••••••••••••••••••• .. ASPEC2 (SUBROUTINE) 3115/65 LAST CARD IN DECK IS NO. 0205 .. FAP 0001 dSPEC2 0002 COUNT 250 0003 0004 ASPEC2 LBL ENTRY ASPEC2 (ACOR, MXLAG, FREQLO, FRQOEL, NFREQS, lERRLO, 0005 SPECT, IANS) 0006 0007 ----ABSTRACT---0008 • 0009 .. TITLE - ASPEC2 0010 .. AUTOSPECTRUM BY COSINE TRANSFORM OF AUTOCORRELATION 0011 a 0012 ASPEC2 COMPUTES THE COSINE TRANSFORM VALUES 0013 • 0014 MXLAG 0015 SPECTIJ) = ACIO) + 2 - SUM ACII)-COSIWIJ)-I) 0016 1=1 0011 0018 FOR J = 1,2, ••• ,NFREQS 0019 0020 WHERE 0021 W(J) = FREQLO + (J-l)aFRQDEL, AND 0022 AC(I). MXLAG, FREQLO, FRQDEL, AND NFREQS ARE INPUTS 0023 0024 THE COMPUTATIONS ARE SPEEDED UP BY THE USE OF SUBROUTINE 0025 SEQSAC AND FUNCTION NEXCOS TO GENERATE COSINE VALUES • 0026 0021 WHILE THREE OR FOUR TIMES SLOWER THAN SUBROUTINE ASPECT, 0028 THE COMPUTATIONS HERE REQUIRE NO TEMPORARIES. 0029 0030 .. LANGUAGE - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) .. EQUIPMENT - 709,7090,7094 (MAIN FRAME ONLY) 0031 0032 - 74 REGISTERS - STORAGE .. SPEED - ON THE 1090 ASPEC2 TAKES ABOUT 0033 100 + l18-NFREQS + 140-NFREQS.IMXLAG+1) MACHINE CYCLES 0034 WHERE NFREQS AND MXLAG ARE DEFINED ABOVE 0035 a AUTHOR - S.M. SIMPSON, JUNE 1964 0036 0031 0038 0039 ----USAGE---0040 .. TRANSFER VECTOR CONTAINS ROUTINES - SEQSAC, NEXCOS 0041 .. AND FORTRAN SYSTEM ROUTINES - NOT ANY 0042 0043 • 0044 - FORTRAN USAGE CALL ASPEC2IACOR, MXLAG, FREQLO, FRQDEL, NFREQS, IERRLO, SPECT, 0045 0046 1 IANS) • 0047 0048 .. INPUTS 0049 0050 CONTAINS THE AUTOCORRELATIONS AC(J), 0051 ACOR III I=1 ••• MXLAG+1 a 0052 J=O ••• MXLAG. 0053 0054 MUST BE GRTHN OR EQUAL ZERO • MXLAG 0055 FREQLO IS THE LOWEST FREQUENCY, WIll OF THe ABSTRACT, IN RADIANS 0056 0057 FRQDEL IS THE FREQUENCY INCREMENT IN RADIANS 0058 0059 NFREQS IS THE DESIRED NUMBER OF OUTPUT SPECTRAL VALUES 0060 0061 MUST EXCEED ZERO 0062 IS THE DESIRED IANS OUTPUT FOR ILLEGAL MXLAG 0063 IERRLO 0064 0065 0066 NO COMPUTATIONS ARE MADE FOR ILLEGAL MXLAG OR NFREQS • OUTPUTS 0067 VALUES • 0068 0069 SPECTlJ) J=l ••• NFREQS CONTAINS THE VALUES DEFINED IN THE ABSTRACT 0070 0, IF ALL OK 0071 IANS • 0072 IERRlO, IF MXLAG ILLEGAL • ... . -.. . ... ----. ... -. -.. -- --. -. ... .. .... . ... .. ... •••••••••••••••••••••••• PROGRAM LISTINGS • ASPEC2 • ........................ (PAGE 2) • • • •••••••••••••••••••••••• ASPEC2 ••••••••••••••••••••••••• • IPAGE = IERRLO+1. IF NFREQS ILLEGAL • EXAMPLES • • • • • • • • -•• -• -• -•• • --• --• -• 1. INPUTS - ACOR(1 ••• 4) • 1.0 •• 5 •• 5,.5 FREQLO = 3.14159265/6.0 130 DEGREES) FREQDEL 2.0-FREQLO NFREQS=2 IERRLO=l USAGE DIMENSION SPECTI2,4), IANS(4) DO 10 LACOR=1,4 MXlAG = LACOR-1 10 CALL ASPEC2CACOR, MXLAG, FREQLO, FRQDEL, NFREQS, 1 IERRLO, SPECTl1,LACOR), IANSILACOR)) OUTPUTS - SPECTll ••• 2,1) = 1.000, 1.000 SPECTl1 ••• 2.2) = 1.866, 1.000 SPECTl1 ••• 2,3) = 2.366. 0.000 SPECTl1 ••• 2,4) = 2.366, 0.000 IANSl1 ••• 4) 0,0,0,0 = - SAME AS EXAMPLE 1. EXCEPT ACORl1 ••• 4) = 2.,1.,1.,1. NFREQS=l USAGE - SAME AS EXAMPLE 1. OUTPUTS - SPECTl1.1 ••• 4) = 2.000,3.732,4.732,4.732 IANSl1 ••• 41 0.0.0,0 2. INPUTS = 3. ILLEGAL CASES 10 IS A DUMMY VARIABLE BELOW) CALL ASPEC21D,-l,D.D,1.3.D,IANS1) CALL ASPEC21D,O,D.D,O,3,D,IANS2) OUTPUTS - IANS1=3 IANS2=4 USAGES • PROGRAM FOLLOWS BELOW •• •• • TRANSFER VECTOR CONTAINS HTR HTR HTR BCI ONLY ENTRY. •ASPEC2 - SXD SXD SXD o o o SEQSAC, NEXCOS XR1 XR2 XR4 l,ASPEC2 ASPEC21ACOR, MXLAG, FREQLO, FRQDEL. NFREQS, IERRLO. SPECT, IANS) ASPEC2-4,l ASPEC2-3.2 ASPEC2-2,4 • DIVIDE ACOR(1) BY 2. SET ADDRESSES. DECREMENTS, CHECK MXLAG. NFREQS •• • CLASTO FOP STQCLA AOD STA CLA AOD STA CLA* POX CLAADD 1,4 ACORl KL2 1,4 ACORIl) ISAVE IT) 1,4 AtACORI AtACOR)+l Kl FMP 7,4 K1 STO 6,4 0,1 2,4 KD1 STD TXU TMI TlE TXI CLA. STD SUB TlE TMI LEAVE LEAVE -+1,1,1 5.4 TXL2 KDl CLAFl LEAVE AI SPECTI AI SPECTI+1 IERRlO TO XR1 MXLAG MXlAG+1 NFREQS ALL OK, INITIALIZE FOR FREQUENCY INCREMENTING 0073 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 21 •••••••••••••••••••••••• • • ASPEC2 PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 31 • • • CLAFL CLA. STO CLA" STO FREQLO FRQDEL OUTER LOOP COUNTS SPEC TRAL VALUES WITH XR2 ,. 1 ••• NFREQS TSXl • • • 3,4 FREQ 4,4 FRQDEL AXT TSX TSX TSX 1,2 $SEQSAC,4 KZ,O FREQ,O INNER LOOP COUNTS ACOR VALUES WITH XRl TSX2 FMP TXll •.. AXT STZ TSX XCA FMP FAD STO TXI TXL 1 ••• MXLAGS+l 1.1 SUM $NEXCOS,4 ··,1 SUM SUM "+1.1,1 TSX2.1 ..... .... .... A(ACORI+l " MXLAG+1 . STORE XCARESULT AND INDEX FOR MORE STO TXL2 • ..• • ... FMP STO CLA FAD STO TXI TXL AXT KL2 .... ,2 FREQ FRQOEL FREQ .+1.2.1 TSX1,2, ... 0,1 .... AI SPECT) +l •• = NFREQS IIANS = 0) EXIT, SETTING IANS AND RESTORING ACORll) LEAVE PXO LOQ LXD LXD LXD STO" STQ" TRA 0.1 ACORl ASPEC2-4.1 ASPEC2-3.2 ASPEC2-2.4 8,4 1.4 9.4 CONSTANTS. TEMPORARIES KZ K1 K01 KL2 FRQDEL FREQ SUM ACORI PZE PZE PZE DEC PZE PZE PZE PZE END 0 1 0,0.1 2.0 .... , ...... ,,, ...... .. , ..... "., , ' ASPEC2 •••••••••••••••••••••••• (PAGE .. .......................• INPUT FREQLO, FREQLO+FRQDEL, ••• ACORllI 0148 0149 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0180 0181 0182 0183 0184 0185 0186 0181 0188 0189 0190 0191 0192 0193 0194 0195 0196 0191 0198 0199 0200 0201 0202 0203 0204 0205 3) •••••••••••••••••••••••• AVRAGE • •••••••••••••••••••••••• PROGRAM LISTINGS • LAST CARD IN DECK IS NO. 0078 0001 0002 0003 150 AVRAGE 0004 AVRAGE IX,LX,XAVG) 0005 0006 0007 ----ABSTRACT--0008 0009 TITLE - AVRAGE 0010 FINO AVERAGE OF FLOATING VECTOR 0011 AVRAGE COMPUTES THE MEAN OF A FLTG VECTOR. 0012 0013 0014 - FAP SUBROUTINE IFORTRAN-II COMPATIBLE) LANGUAGE 0015 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLYI 0016 - 24 REGISTERS STORAGE - 52.4 + 8.4*LX MACHINE CYCLES ON 7090, LX • VECTOR LENGTH 0017 SPEED 0018 57.4 + 8.4-LX ON 709 0019 AUTHOR - S.M. SIMPSON, AUGUST 1963 0020 0021 ---USAGE---0022 0023 TRANSFER VECTOR CONTAINS ROUTINES - (NONEI 0024 AND FORTRAN SYSTEM ROUTINES - INONE) 0025 0026 FORTRAN USAGE CALL AVRAGE(X,LX,XAVG) 0027 0028 0029 INPUTS 0030 XIII l=l ••• LX IS A FLTG VECTOR 0031 0032 0033 LX SHOULD EXCEED ZERO 0034 STRAIGHT RETURN WITH NO OUTPUT IF LX LSTHN 1 0035 OUTPUTS 0036 XAVG IS 11/lXI-SUM IFROM 1-1 TO LX) OF XII) IFlTGI 0037 • AVRAGE FAP • .AVRAGE COUNT LBL ENTRY • • • • • • •• • • • * • • *• • *• * ** • * •* ** *• • • • (SUBROUTINE) 9129/64 0038 EXAMPLES • 1. INPUTS - Xll ••• 4I a l.,2 •• 3.,4. u=o. USAGE CALL AVRAGEIX,4,XAVGI • CALL AVRAGEIX,I,Y) • CALL AVRAGEIX,O,UI • OUTPUTS - XAVGa2.5 Y=l. UzO.O CNO OUTPUT CASEI - • PROGRAM FOLLOWS BELOW •• •••••••••••••••••••••••• • AVRAGE • • ••••••••••••••••••••••• NO TRANSFER VECTOR XR4 HTR 0 l,AVRAGE 8CI AVRAGECX,LX,XAVG) ENTRY. • ONLY AVRAGE SXO AVRAGE-2,4 CLA 1,4 Kl AIX)+l ADD K1 STA AOOI • CHECK LX AND FLOAT IT LX CLA2.4 TMI LEAVE POX 0,4 LOOP SET TXL LEAVE.4,O 18 LRS OCTK ORA FAD OCTK FLOATED LX STO FLX - SUM XI1 ••• LXI, DIVIDE, STORE, EXIT PXD 0.0 •• =AIXI+l -.,4 AD01 FAD AODl,4,1 TIX 'FOP FlX LXD AVRAGE-2.4 3.4 S'OLEAVE UD AVRAGE-2.4 4,4 TRA 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 .**** •• ***********.****. AVRAGE * PROGRAM LISTINGS * ••••• *.**.*******.***** (PAGE 21 (PAGE • CONSTANTS, VARIABLES OCTK OCT 233000000000 FLX PIE END .. ***********.***.*.****** AVRAGE *••• *******.****.*.*.*.*. * LX FLOATED 0015 0016 0017 0078 21 ..•••••••••••••••••••••••• . BLKSUM ••••••••••••••• * •••••••• PROGRAM LISTINGS •••••••••••••••••••••••• BLKSUM _....... _........ _.*_ .. ... .. 9/4/64 LAST CARD IN nECK IS NO. 0168 BLKSUM (SUBROUTINE) .. fAP 0001 0002 -BLKSUM COUNT 200 0003 LBL BLKSUM 0004 0005 ENTRY BLKSUM (X, LX. LBLOK. DVSR, XBSMOD, LXBSODJ 0006 0001 ----ABSTRACT---0008 0009 0010 .. TITLE - BLKSUM .. SUMMATION OF VECTOR OVER ABUTTING BLOCKS OF CONSTANT LENGTH 0011 0012 BLKSUM COMPUTES 0013 • 0014 0015 I*L • S (II SUM XIJI 0016 0017 o J= (1-1 I.L+l 0018 0019 FOR I 1.2 ••••• N=(LX/LIROUNDED DOWN 0020 WHERE X(l ••• LX). LX, L, AND 0 ARE INPUTS • 0021 0022 THE OUTPUT VECTOR MAY REPLACE THE INPUT VECTOR, AND THE 0023 0024 LENGTH N IS AN ADDITIONAL OUTPUT FROM BLKSUM • 0025 0026 .. LANGUAGE - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) 0021 0028 • EQUIPMENT - 109,1090.1094 (MAIN FRAME ONLY) 0029 - 49 REG I STERS • STORAGE - REQUIRES 80 + 29*N + 8.4.L-N MACHINE CYCLES ON THE 1090 0030 • SPEED 0031 WHERE LAND N ARE DEFINED ABOVE • 0032 - S.M. SIMPSON. JULY 1964 • AUTHOR 0033 0034 • 0035 ----USAGE---0036 0031 • TRANSFER VECTOR CONTAINS ROUTINES - (NOT ANY) 0038 • AND FORTRAN SYSTEM ROUTINES - (NOT ANY) 0039 • 0040 .. fORTRAN USAGE 0041 .. CALL 8LKSUMIX. LX. LBLOK, DVSR, XBSMOD. LXBSOD) 0042 0043 0')44 • INPUTS 0045 • 0046 I=I ••• LX IS A FLOATING POINT VECTOR. XI II 0041 0048 LX MUST 8E GRTHN= 1 • 0049 • 0050 LBLOK IS THE BLOCK LENGTH L OF THE ABSTRACT. 0051 MUST EXCEED ZERO AND BE LSTHN= LX. 0052 0053 IS THE DIVISOR 0 OF THE ABSTRACT. DVSR 0054 MUST BE NON-ZERO. 0055 0056 0051 STRAIGHT RETURN WITH NO OUTPUTS IF LX, LBLOK, OR DVSR OUTPUTS 005B ILLEGAL. • 0059 0060 • XBSMOD(I) I=l ••• LXBSOD ARE THE SUMS SI1 ••• N) OF THE ABSTRACT. 0061 EQUIVALENCE (X.XBSMODI IS PERMITTED. 0062 0063 (LX/LBlOKI ROUNDED DOWN. lXBSOD WILL 0064 0065 0066 .. EXAMPLES 0061 0068 .. 1. MISCELLANEOUS VALUES OF LX, LBLOK 0069 .. INPUTS - X{1 ••• 41 = 2.,4.,6 •• 8. DVSR=2.0 0010 SI1 ••• 4,1 ••• 4,1 ••• 4) = -9.,-9., ••• 0071 lS(1 ••• 4,1 ••• 4) = -9,-9, ••• 0012 DO 10 LX=1,4 USAGE 0013 DO 10 L=l,LX 0014 It 10 CALL BLKSUMIX,LX,L,DVSR,S(l,L.lXI,LSfl,LXII .. .. . ...... . .. ... . . -• .... ... .. .. .• • • .. • . .. .. . . --. = .•••••••••••••••••••••••• . BLKSUM •••••••••••••••••••••••• BLKSUM .. •••••••••••••••••••••••• PROGRAM LISTINGS .. •••••••••••••••••••••••• (PAGE 21 .. IPAGE OUTPUTS - S(l ••• ~.l ••• ~.l) • 1 •• -9 •• -9 •• -9 ••• -9 •• -9 •• -9 •• -9 ••• • S(1 ••• 4,1 ••• 4,2) = • 511 ••• 4,1 ••• 4,3) • Sfl ••• 4,1 ••• 4,4) * .. .. LS(1 ••• ~,1 ••• 41 • • ... 2. .. - . -9.,-9.,-9 •• -9.,,-9.,-94,-9.,-9. 1., 2.,-9.,-9." 3.,-94,-9.,-9." -9.,-9.,-9.,-9.,,-9.,-9 •• -9 •• -9. ~ I., 2., 3.,-9 ••• 3.,-9.,-9 •• -9 •• , 6.,-9.,-9.,-9.'f-9 •. ,-9~,-9.,-9. 1., 2., 3., 4 ••• 3., 7.,-9 •• -9." 6.,-9.,-9.,-9.,,10.,-9.,-9.,-9. 1,-9,-9.-9 •• 2, 1.-9,-9" 3. 1, 1,-9,. 4, 2. I, 1 0081 00B8 0089 0090 0091 0092 INPUTS USAGE - SAME AS EXAMPLE 1. CALL BLKSUMIX,-1,2,l.0,S.LSI CALL ~LKSUMIX, 3.0,1.O,S,LSI CALL BLKSUMIX, 3,4.1.0,S,LSI CALL BLKSUMIX, 3,2,O.O,S,LSI OUTPUTS - S " -9. LS"-9 0093 . ...• • FOLLOWS BELOW ...• PROGRAM NO TRANSFER VECTOR . HTR HTR 8CI • It ... CHECK SXOAND - LRS •.. .. ClAt> HE STO CLAARS STO TMI HE ClACASNOP TRA TRA LRS DVP. CLM llS XCA STOlt STD CLA ADD STA CLA ADO STA AXT PXO FAD XR2 XR4 8lKSUM IX, LX, LBLOK, DVSR, XBSMOD, lXBSODI BLKSUM-3,2 BLKSUM-2,4 SET DVSR, 4,4 LEAVE DVSR 3,4 IB LBLOK LEAVE LEAVE 2,4 3.4 LRS LEAVE 35 3.4 lBLOK. lX8S0D AND SET ADDRESSES DVSR lBLOK LX AGAINST LBlOK OK OK NG LX/LBLOK ROUNDED DOWN 18 6,4 TXL 1.4 Kl FAD 5,4 Kl STQ 1,2 DOU8LE LOOP STARTS. PXD LXA FAD TIX FOP 0094 0095 0096 0091 0098 0 0 1,BLKSUM ONLY ENTRY. .BLKSUM SXD EQUALS lXBSOD 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 6129 0130 0131 0132 0133 013~ AIXI AIX 1+1 AI XBSMOD 1 AIXBSMODl+l XR2 WILL CONTROL OUTPUT STORAGE XR2=1 ••• LXBSOD. XR4=LBlOK ••• l REPEATED 0,0 LBLOK.4 (SUMMATION IN At) •• ,4 .... = AIX)+1,-LBLOK,-2 .. L8l0K •••• FAD,4,1 DVSR 0084 0085 0086 OUTPUT REPLACING INPUT INPUTS - SAME AS EXAMPLE 1. USAGE CALL BLKSUMIX,4.2,OVSR,X,LSI OUTPUTS - Xl1 ••• 41 = 3.,1.,6.,8. LS" 2 .. 3. I LLEGAL CASES .-. 0015 0016 0071 0018 0019 0080 0081 0082 0083 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 21 •••••••••••••••••••••••• PROGRAM LISTINGS BLKSUM "•••••••••••••••••••••••• " 3) (PAGE STg • TXL STg CAL SUB STA TXI TXL " •• 2 FAD LBLOK FAD "+1.2.1 PXD.2,·" LXD LXD TRA BLKSUM-3,2 SLKSUM-2,4 7.4 • EXIT •LEAVE • • CONSTANTS TEMPORARIES •K1 PZE DVSR PZE LBLOK PZE END .. , .., .. 1 ... ,0,0 •••••••••••••••••••••••• • BLKSUM • • ••••••••••••••••••••••• (PAGE •• A(XBSMOD)+l ". = LXBSOD 0150 0151 0152 0153 0154 0155 0156 0157 015B 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 31 •••••••••••••••••••••••• * BOOST PROGRAM .1lSTINGS - •••••••••••••••••••••••• * BOOST (sUBROUTINEI 9/29/64 * FAP *BOOST COUNT 150 lBl BOOST ENTRY BOOST ( X, lX, XRIZE, XBUSTDJ ENTRY XBOOST (IX,lIX.IXRllE.IXBSTD) ENTRY OPRESS ( X. lX, XSINK, XlWRDI ENTRY XOPRSS CIX,llX,lXSINK,lXLWRDJ -. * .. ... .. * .-.. * .. .. ... . - --. .. * .. * - -.. .. -. -.. - ... ..- -. .-. ... . .. .... .. ..... ..... - -. •••••••••••••••••••••••• BOOST * • ••••••••••••••••••••••• * lAST CARD IN DECK IS NO. 0146 0001 0002 0003 0004 0005 0006 0007 0008 0009 ----ABSTRACT---0010 0011 TITLE - BOOST WITH SECONDARY ENTRIES XBOOST, DPRESS, AND XDPRSS 0012 ADO A CONSTANT TO ELEMENTS OF A FXD OR FlTG VECTOR 0013 0014 BOOST ADDS A FLTG CONSTANT TO A VECTOR. 0015 XBOOST ADDS A FXD CONSTANT TO A VECTOR. 0016 OPRESS SUBTRACTS A FLTG CONSTANT FROM A VECTOR. 0017 XDPRSS SUBTRACTS A FXD CONSTANT FROM A VECTOR • 0018 0019 THE CONSTANT MAY BE ONE OF THE VECTOR ELEMENTS. 0020 0021 LANGUAGE - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) 0022 EQUIPMENT - 709 ~R 7090 (MAIN FRAME ONLY) 0023 STORAGE - 34 REGISTERS 0024 SPEED - BOOST 36 + 12.4-lX MACHINE CYCLES, LXzVECTOR LENGTH 0025 XBOOST - 38 + a-LX 0026 DPRESS - 3B + 12.4-LX 0027 XDPRSS - 38 + a-LX 002B - S.M. SIMPSON, AUGUST 1963 0029 AUTHOR 0030 ----USAGE---0031 0032 TRANSFER VECTOR CONTAINS ROUTINES - INONE) 0033 AND FORTRAN SYSTEM ROUTINES - INONEI 00.34 0035 FORTRAN USAGE 0036 CALL BOOST I X, lX, XRIlE.XBUSTDI 0037 CALL XBOOSTIIX,LIX.IXRIZE.IXBSTDI 0038 CALL DPRESSI X. LX. XSINK. XLWRDI 0039 0040 CALL XDPRSSIIX,LIX,IXSINK,IXLWRDI 0041 0042 INPUTS 0043 XI II 1=1 ••• LX IS A FLTG PT VECTOR 0044 0045 LX SHOULO EXCEED 0 0046 0047 XRllE IS ANY FLTG VARIABLE. EQUIVALENCE IXRIZE, SOME Xli I) OK. 004B 0049 XSINK IS ANY FLTG VARIABLE. EQUIVALENCE IXSINK, SOME XIII} OK. 0050 0051 IXII I l=l ••• LIX IS A FXD PT VECTOR 0052 0053 L1X SHOULD EXCEED 0 0054 0055 IXRIZE IS ANY FXD VARIABLE. EQUIVAlENCEIIXRIZE, SOME IXI I)) OK. 0056 0057 IXSINK 0058 IS ANY FXD VARIABLE. EQUIVALENCE IIXSINK, SOME IXCI)I OK. 00.59 OUTPUTS STRAIGHT RETURN WITH NO OUTPUTS IF LX OR llX lSTHN 1. 0060 0061 XBUSTD(II 1=1 ••• lX HAS VALUES XBUSTDIII=XIII+XRIZE 0062 0063 EQUIVALENCE IXBUSTD,XI IS PERMITTED. 0064 XLWRDIII I=l ••• LX HAS VALUES XLWRDI!I=XI!I-XSINK 0065 EQUIVALENCE IXlWRD,XI IS PERMITTED. 0066 0067 IXBSTDI!I I=l ••• LIX HAS VALUES !XBSTDIII=IXIII+IXRIZE 0068 EQUIVALENCE (IXBSTD,IXI IS PERMITTED. 0069 0070 IXLWRDIII l=l ••• LIX HAS VALUES IXLWRDII}=IXIII-!XSINK 0071 0072 EQUIVALENCE (IXLWRD,IXI IS PERMITTED. 0073 0074 IF ANY OF THE ABOVE EQUIVALENCES OBTAIN, THE INITIAL •••••••••••••••••••••••• • . BOOST PROGRAM LISTINGS •••••••••••••••••••••••• IPAGE •••••••••••••••••••••••• .. 800ST ... VALUE OF THE QUANTITY IS ALWAYS USEO AS THE AODEND OR SUBTRAHEND. . ..... EXAMPLES . 1. INPUTS •. - Xll ••• 4)=1.,2 •• 3 •• 4. Yll ••• 41-1 •• 2 •• 3.,4. IXll ••• 41=l,2.3.4 IYll)-1 W=WW=O.O IW=IWW=O CALL BOOSTIX.4,2 •• ZI CALL DPRESSIY.4,2.,Ul CALL XBOOSTIIX.4.2.IZI CALL XDPRSSIIY,1,2,IU) CALL BOOSTIX,O.2.,W) CALL DPRESSIY.0,2 •• WWl CALL XBoOSTIIX.0,2,IW) CALL XDPRSSIIY,0,2,IWWI .. .. OUTPUTS - Zll ••• 4)=3.,4.,5.,6. UII ••• 4)=-1.,0 •• I.,2. Illl ••• 4)=3,4,5,6 lUll )=-1 W=WW=O.O IW=IWW=O INO OUTPUTS FROM LAST 4 CALLS) • . .. USAGE .• • • .... •• .. .. .. . 2. INPUTS USAGE - SAME AS EXAMPLE 1. CALL BOOSTIX,4,2.,X) CALL DPRESSIY,4,YI31.Yl OUTPUTS - Xll ••• 4)=3.,4.,5.,6. Yll ••• 4)=-2.,-1.,0.,l. .. PROGRAM FOLLOWS BELOW •.. "• •••••••••••••••••••••••• 2) NO TRANSFER VECTOR HTR 0 XR4 BCI l,BOOST .. PRINCIPAL ENTRY. BOOSTIX,LX,XRIZE.X8USTDI BOOST CLA FAD SETUP STo MODIFY SXD BOOST-2,4 Kl CLA 1.4 ADD Kl AIXI+l STA GET CLA 4,4 ADD Kl AIXBUSTD)+l STA STORE CLA3.4 XRllE STD TEMP • CHECK LX CLA2,4 LX TMI LEAVE POX 0,4 TXL LEAVE,4.0 .. LOOP •• ,4 .... =AIXI+l GET CLA FAD TEMP, ADD TEMP, FSB TEMP OR SUB TEMP MODIFY NoP •• ,4 ... =AIXBUSTD)+l STORE S TO GET.4,l T1.X • EXIT LEAVE LXD BOOST-2,4 TRA 5.4 • SECOND ENTRY. X800STIIX,LIX,IXRIZE,IXBSTDI XBOOST CLA ADO TRA SETUP • THIRD ENTRY. DPRESSIX,LX,XSINK,XLWRD) OPRESS CLA FSB' TRA SETUP • FOURTH ENTRY. XDPRSSIIX,LIX,IXSINK,IXLWRDI XDPRSS CLA SUB TRA SETUP • CONSTANTS. VARIABLES. ADD ADD TEMP SUB SUB TEMP FAD FAD TEMP FSB FSB TEMP TEMP PZE ...... ,... ADDEND OR SUBTRAHEND END IPAGE 0075 0076 0077 0078 0079 0080 OOBI 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 012B 0129 0130 0131 0132 0133 0134 0135 0136 0137 0136 0139 0140 0141 0142 0143 0144 0145 0146 2) •••••••••••••••••••••••• • CALL • •••••••••••••••••••••••• REFER TO LOCATE •••••••••••••••••••••••• CALL2 • •••••••••••••••••••••••• • REFER TO LOCATE PROGRAM LI STINGS •••••••••••••••••••••••• • CALL • •REFER ••••••••••••••••••••••• TO LOCATE •••••••••••••••••••••••• CALL2 • •••••••••••••••••••••••• • REFER TO LOCATE •••••••••••••••••••••••• • • CARIGE •••••••••••••••••••••••• PROGRAM LISTINGS • CARIGE (SUBROUTINE) • LABEL CCARIGE SUBROUTINE CARIGECITAPE,NSPACEI 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 C C C C C C C C C ........................ • CARIGE • •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0097 0001 0002 0003 0004 ----ABSTRACT--0005 0006 0007 TITLE - CARIGE SPACE CARRIAGE N LINES OR RESTORE PAGE 0008 0009 CARIGE WRITES OUT CARRIAGE CONTROL HOlLERITH ON A GIVEN 0010 OUTPUT TAPE FOR OFF-LINE PRINTING UNDER PROGRAM CONTROL. 0011 IT WIll EITHER SPACE THE PRINTED PAGE N LINES (WHERE N 0012 MAY BE ZERO) OR GIVE A SINGLE PAGE RESTORE. 0013 0014 LANGUAGE - FORTRAN-II SUBROUTINE 0015 EQUIPMENT - 709 OR 7090 CMAIN FRAME + 1 TAPE UNIT) 0016 STORAGE - 47 REGISTERS 0017 0018 SPEED AUTHOR - S.M. SIMPSON, SEPTEMBER 1963 0019 0020 0021 ----USAGE---0022 TRANSFER VECTOR CONTAINS ROUTINES - (NONEI 0023 AND FORTRAN SYSTEM ROUTINES - (STH), (FIL) 0024 0025 FORTRAN USAGE 0026 CALL CARIGE(ITAPE,NSPACE) 0027 0028 0029 INPUTS 0030 IS A FORTRAN-II INTEGER SPECIFYING THE LOGICAL TAPE TO 0031 ITAPE BE USEO. 0032 IS NOT EXAMINED FOR LEGALITY. 0033 0034 NSPACE IS A FORTRAN-II INTEGER SPECIFYING THE NUMBER OF SPACES 0035 (CARRIAGE RETURNS) DESIRED. 0036 =+N PRODUCES N CARRIAGE RETURNS 0037 =-N PRODUCES 1 PAGE RESTORE 0038 = 0 STRAIGHT RETURN WITH NO EFFECT 0039 0040 CARRIAGE CONTROL HOLLERITH IS WRITTEN OUT ON ITAPE. 0041 OUTPUTS 0042 0043 EXAMPLES 0044 0045 1. INPUTS - NSPACEll ••• 5)=1,0,-5,4,9 0046 DO 5 1=1,5 0047 USAGE 004B WRITE OUTPUT TAPE 2,10,1 CALL CARIGE(2,NSPACE(I)) 0049 0050 WRITE OUTPUT TAPE 2,10,1 5 FORMAT(17H THIS IS A MARKER,6X,2HI=,Il) 0051 10 0052 0053 OUTPUTS - 2 PAGES OF PRINTED OUTPUT FROM LOGICAL UNIT 2, AS FOLLOWS 0054 0055 PAGE 1 0056 0057 (LINE 11 THIS IS A MARKER (BLANK LINE) 0058 0059 THIS IS A MARKER 1=1 Ia2 0060 THIS IS A MARKER 1:2 0061 THIS IS A MARKER 0062 (LINE 6) THIS IS A MARKER 1=3 0063 0064 0065 PAGE 2 0066 0067 (LINE 11 THIS IS A MARKER 1=3 0068 THIS IS A MARKER 1"4 0069 (BLANK LINE) 0070 (BLANK LINE) 0071 (8LANK LINE) 0072 (BLANK LINE) 0073 THIS IS A MARKER 1=4 0074 THIS IS A MARKER 1=5 9/29/64 •••••••••••••••••••••••• CARIGE • ••••••••••••••••••••••••• (PAGE PROGRAM LI STINGS • CARIGE • ••••••••••••••••••••••• (PAGE 2) C (BLANK lINE) (BLANK LINE) C (BLANK LINE) C (BLANK LINE) C C (BLANK LINE) (BLANK LINE) C C (BLANK LINE) (BLANK LINE) C C (BLANK LINE) C (LINE 18) THIS IS A MARKER C C C PROGRAM FOLLOWS BELOW C IF (NSPACE) 10,9999,30 10 WRITE OUTPUT TAPE ITAPE,20 20 FORMATllHll GO TO 9999 30 DO 40 I=l,NSPACE 40 WRITE OUTPUT TAPE fTAPE,50 FORMATIlH ) 50 9999 RETURN END • ••••••••••••••••••••••• • 1=5 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 2) •••••••••••••••••••••••• CHISQR • *•••••••••••••••••••••••• • PROGRAM 1I ST INGS •••••••••••••••••••••••• * CHISQR CHISQR ISUBROUTINE) 9/29/64 LAST CARO IN OECK IS NO. 0084 0001 LABEL CCHISQR 0002 SUBROUTINE CHISQRINBLOCS,ICOUNT,N,CHISQ,IANS) 0003 0004 C 000.5 ----ABSTRACT---C 0006 C 0007 C TITLE - CHISQR COMPUTES CHI-SQUARE FOR EQUALLY LIKELY PROBABILITY CASE. 0008 C 0009 C CHISQR COMPUTES CHI SQUARE WHEN GIVEN THE OISTRIBUTION 0010 C COUNT AND THE NUMBER OF EQUALLY LIKELY BLOCKS INTO WHICH 0011 C THE DATA IS PUT. NUMBER OF BLOCKS = NBLOCKS, N = TOTAL 0012 C 0013 NUMBER OF OBSERVATIONS, ICOUNT = OISTRI8UTION COUNT. C 0014 C CHISQ=SUMIIICOUNTIII-N/NBLOCKS) •• 2/IN/N8LOCKS» 0015 C 0016 C SUMMEO OVER N8LOCKS, WHERE FLOATING OPERATIONS ARE ASSUMED 0017 C RATHER THAN THE INDICATEO INTEGER OPERATIONS. 0018 C 0019 C 0020 - FORTRAN II SUBROUTINE C LANGUAGE 0021 C EQUIPMENT - 709 DR 7090 IMAIN FRAME ONLY) 0022 C STORAGE - 105 REGISTERS 0023 C SPEED 0024 - J.N. GALBRAITH C AUTHOR 0025 C 0026 C ----USAGE---0027 C 002B TRANSFER VECTOR CONTAINS ROUTINES NONE C 0029 ANO FORTRAN SYSTEM ROUTINES - NONE C 0030 C 0031 C FORTRAN USAGE CALL CHISQRIN8LOCS,ICOUNT,N,CHISQ,IANS) 0032 C 0033 C 0034 C INPUTS 0035 C 0036 IS NUMBER OF EQUALLY LIKELY BLOCKS. NBLOCKS C MUST BE GRTHN 1. 0037 C 0038 C 0039 ICOUNTII) l=l ••• NBLOCKS IS THE DISTRIBUTION COUNT. I.E. THE NUMBER C 0040 OF VALUES IN I-TH EQUALLY LIKELY BLOCK. C MUST BE NON-NEGATIVE 0041 C 0042 C 0043 IS TOTAL NUMBER OF OBSERVATIONS I=SUMIICOUNTIIJ). C N 0044 MUS T BE GRTHN= 1. C 0045 C 0046 C OUTPUTS 0047 C 0048 CHISQ IS THE CHI-SQUARE VALUE C 0049 C 0050 IANS C =0 NORMAL 0051 C =1 IllEGAL N8LOCS 0052 =2 ILLEGAL N C 0053 C 0054 C EXAMPLES 0055 C 0056 ICOUNTll ••• 31=1,3,5 N=9 C 1. INPUTS - NBLOCS:3 0057 OUTPUTS - CHISQ=2.666667 IANS=O C 0058 C 0059 N=9 C 2. INPUTS - NBLOCS-l ICOUNTll)=l 0060 OUTPUTS - ERROR IANS=l C 0061 C 0062 - NBLOCS=3 ICOUNTll ••• 31=1,3,5 N=O C 3. INPUTS 0063 OUTPUTS ERROR IANS=2 C 0064 C 0065 ICOUNTll ••• 5)=1.2.3.4,5 N=15 C 4. INPUTS - NBLOCS=5 0066 OUTPUTS - CHISQ=3.333333 IANS=O C 0067 C 0068 DIMENSION ICOUNTII00) 0069 IANS:O 0070 IFINBLOCS-l) 990,990,5 0071 5 IFINI 992,992,10 0072 10 P=l./FLOATFINBLOCS) 0073 EXPNO=P*FLOATFIN) 0074 CHISQ=O * * • ••••••••••••••••••••••• .................. _..... ._.....CHISQR -._._- ••••.....••... (PAGE PROGRAM 1I STINGS 2) 25 26 990 992 DO 25 I~l.NBLOCS OIF=FLOATF(ICOUNT(I»-EXPNO CHISQ=CHISQ+OIF-OIF CHISQ=CHISQ/EXPNO RETURN IANS=l GO TO 26 IANS=2 GO TO 26 END . •••••••••••••••••••••••• - CHISQR •••••••••••••••••••••••• (PAGE 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 21 •••••••••••••••••••••••• - CHOOSE - •••••••••••••••••••••••• *••••••••••••••• CHOOSE *.~.* •• * • PROGRAM LISTINGS •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0083 9/4/64 CHOOSE (SUBROUTINE) 0001 FAP 0002 -CHOOSE COUNT 100 0003 LBl CHOOSE 0004 0005 ENTRY CHOOSE (ZIFRST, X,Xl,Xl, Y,Yl,Yl, ••• , l,ll.ll) 0006 0007 • ----ABSTRACT---0008 0009 0010 - TITLE - CHOOSE • SET A LIST OF VARIABLES TO ONE OF TWO SETS OF VALUES 0011 0012 • 0013 • CHOOSE SETS A VARIABLE LENGTH LIST OF VARIABLES (X.Y ••••• 0014 • l) FROM THE FIRST LIST (Xl,Yl, ••• ,Zl) OF A PAIR OF LISTS 0015 OF CONSTANTS IF lIFRST-O. OR FROM THE SECONO LIST IF 0016 • ZIFRST NOT-O. I.E., IF ZIFRST=O. CHOOSE SETS X-Xl,Y-Yl, 0017 • ••• ,Z-ll. IF llFRST NOT=O. CHOOSE SETS X=Xl,YzYZt ••• , 001B • l=ll. 0019 0020 • 0021 FAP SUBROUTINE (FORTRAN II COMPATIBLE) 0022 • LANGUAGE 709 OR 7090 (MAIN FRAME ONLY) 0023 • EQUIPMENT - 17 REGI STERS 0024 • STORAGE - 6 + l6.N MACHINE CYCLES. WHERE N .. NO. OF SETrINGS 0025 • SPEED - S.M. SIMPSON, APRIL 1964 0026 - AUTHOR 0027 0028 ----USAGE---0029 0030 •.. TRANSFER VECTOR CONTAINS ROUTINES - (NOT ANY) 0031 .. AND FORTRAN SYSTEM ROUTINES - (NOT ANY) 0032 0033 .. FORTRAN USAGE 0034 .. CALL CHOOSEIIIFRST, X.Xl.Xl, Y,Yl,YZ, ••• , l,ll.lZ) 0035 0036 .. INPUTS 0037 0038 ZIFRST = O. IF VALUES Xl,Yl, •••• Zl ARE TO BE CHOSEN. 0039 NOT= O. IF VALUES Xl,Yl, ••• ,Zl ARE TO BE CHOSEN • 0040 0041 .. Xl.XZ,Yl,YZ, ••• ,II.ll. ARE ANY MODE 0042 0043 0044 .. OUTPUTS ILLEGAL RETURN OCCURS IF ARGUMENT COUNT IS NOT 0045 1 + MULTIPLE OF 3. 0046 0047 .. X,Y, •••• Z ARE FORMED AS OESCRIBED IN ABSTRACT. 0048 0049 0050 .. EXAMPLES 0051 0052 .. 1. USAGES CAll CHOOSEI-O •• Xl,l •• l., IXl.l,l) 0053 CAll CHOOSE(1.X2.1 •• 2.) 0054 CAll CHOOSEf-.000l,X3.1 •• 2 •• IX3,1.2. X4.X3,X3) 0055 .. OUTPUTS - Xl-I. IXl=l Xl=2. X3=2. IX3=2 X4=2. 0056 0057 005B • 0059 - PROGRAM FOllOWS BELOW 0060 .. NO TRANSFER VECTOR 0061 0062 BCI I.CHOOSE 0063 0064 .. ONLY ENTRY • CHOOSE( ZIFRS T. X.Xl.Xl. Y.Yl.Yl, ., l.11.l21 0065 0066 •CHOOSE ClA K3 0067 lEh 1.4 0068 ADD 0069 ·-1 STA GET 0070 2.4 CAL CAL 0011 0072 ANA AMASK TSXl LAS 0073 0074 TRA 2.4 . .. .. .. - .. . . . .. . -. . ... .. . . - . . . ... .** •• **** ••••••••••••••• CHOOSE * * •• ********.* •••• ******** (PAGE PROGRAM LISTINGS 2) TRA TRA GET CLA* STO" TXI K3 PlE AMASK OCT TSXl TSX END GET 2,4 **,4 *"=3 (ZIFRST=OI, OR 4 (lIFRST NOT=O) 2,4 CAl,4,-3 3 717171700000 0,0 •••••• *.*.*.* •• *.***.*.* CHOOSE * * ** •••• ****** •••••• * ••••• (PAGE 0075 0076 0017 0078 0079 0080 0081 0082 0083 2) •••••••••••••••••••••••• PROGRAM LI STINGS CHPRTS "•••••••••••••••••••••••• " " CHPRTS (SUBROUTINE) " FAP *CHPRTS COUNT 150 LBL CHPRTS CHPRTS (SYM,ANT,NI ENTRY RVPRTS (SYM,ANT,NI ENTRY •••••••••••••••••• ** •••• "CHPRTS " •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 014B 0001 0002 0003 0004 0005 0006 0007 " ----ABSTRACT---OOOB " 0009 "" TITLE - CHPRTS, WITH SECONDARY ENTRY RVPRTS 0010 " FAST REVERSAL OF SPECIAL VECTORS (AS PRODUCED BY SPLIT) 0011 0012 " CHPRTS REVERSES THE STORAGE ORDER OF TWO VECTORS (CALLED 0013 " ANT AND SYMI AND CHANGES THE SIGN OF ANT. 0014 " 0015 " RVPRTS REVERSES THE STORAGE ORnER OF TWO VECTORS. 0016 " 0017 "" LANGUAGE - FAP, SUBROUTINE (FORTRAN II COMPATIBLE) 001B 0019 " EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLYI - 76 REGISTERS 0020 " STORAGE - ABOUT 6.5.(COMBINED LENGTH OF THE VECTORS I MACHINE CYCLES 0021 " SPEED S.M. SIMPSON JR 0022 " AUTHOR 0023 " ----USAGE--0024 " 0025 "" TRANSFER VECTOR CONTAINS ROUTINES - NONE 0026 " AND FORTRAN SYSTEM ROUTINES NONE 0027 0028 "" FORTRAN USAGE 0029 " CALL CHPRTS(SYM,ANT,NI 0030 " CALL RVPRTS(SYM,ANT,N) 0031 0032 " INPUTS 0033 " 0034 " SYM(II 1=1 ••• LS IS FIRST VECTOR TO BE REVERSED 0035 " (NAME NEED NOT BE FLOATING POINT) 0036 " 0037 " ANT( II l=l ••• LA IS SECOND VECTOR TO BE REVERSED lAND SIGN 0038 " CHANGED FOR CHPRTS E~rRY) 0039 " (NAME NEED NOT BE FLOATING POINT) 0040 " 0041 " N 0042 " LS+LA " IF N IS EVEN LS " LA = N/2 0043 " IF N I S ODD LS " (N+1l/2 0044 LA " IN-lIl2 " IS FORTRAN II INTEGER 0045 " 0046 "" OUTPUTS 0047 0048 " 0049 SYM( II I=l ••• LS IS THE REVERSED SYM SERIES. " 0050 " ANT (II I=l ••• LA IS THE REVERSED ANT SERIES (WITH SIGN CHANGED 005i " IF THE CHPRTS ENTRY WAS USED). 0052 " (NOTE- PROGRAM EXITS WITHOUT MODIFYING SYM OR ANT 0053 " IF N IS LSTHN= 11 0054 " 0055 "" EXAMPLES 0056 0057 "" 1. INPUTS - SYM(1 ••• 31 = 3.,2.,1. ANTll ••• 3) = 4.,1 •• 2. N=6 0058 " OUTPUTS - CHPRTS SYM(I ••• 31" 1 •• 2.,3. ANTll ... 31" -2.,-1 •• -4. 0059 " RVPRTS SYM(I ••• 3) = 1.,2.,3. ANTIl ••• 3) a 2 •• 1.,4. 0060 0061 "" 2. INPUTS - SYMtl ••• 3) = 3.,2.,1. ANTll ••• 21 = 4.,5. N=5 0062 " OUTPUTS - CHPRTS SYMll ••• 31 = 1.,2.,3. ANTIl ••• 21 -5.,-4. 0063 " RVPRTS SYM(1 ••• 3) = 1.,2.,3. ANTIl ••• 21" 5.,4. 0064 0065 "" 3. INPUTS - SYM(11 = 1. ANT(11=2. N=2 0066 0067 " OUTPUTS - CHPRTS SYM(l)=l. ANTIll=-2. " RVPRTS SYM(l)=l. ANTl11=2. 0068 0069 " 0070 PZE l,CHPRTS 0071 BCI CHPRTS CLA K3 0072 STO CI0 0073 CLA K4 0074 9129/64 ...... _.... -...._.-* ........... __ CHPRTS •................ (PAGE 21 PROGRAM LISTINGS (PAGE STO C12A TRA C2 RVPRTS CLA K5 STO CI0 CLA K6 STO C12A C2 SXD CHPRTS-2,4 SXA LV+ 1.1 SXA LV+2,2 • FIGURE THE LENGTHS OF SYM(LS) AND ANTtLA) 3,4 GET N CLA" ARS 18 1 N ADDRESS CAS Kl TRA *+3 TRA LV EX IT UNLESS TRA LV N EXCEEDS 1 L8T TRA C3 EVEN ARS 1 LA=(N-1112=N/2 TRUNCATED ODD STA LA ADD Kl LS=(N+1)/2=LA+l TRA C4 C3 ARS 1 EVEN LA=LS=N/2 STA LA C4 STA LS .. SET DECREMENT AND ADDRESSES CLA LA DECR LA12 ROUNDED UP LRS 1 RND ALS HI STD CLA ADD STA STA SUB SUB STA STA CLA ADD STA STA SUB SUB STA STA CI0 Cll C12 C18 1,4 Kl SYM+l C14 el7 LS Kl SYMtLS)-l C16 2,4 C13 Cll C12 AXT AXT NOP **,2 **.2 C14 STO XCA NOP STO CLA CIS LOQ C16 STO STQ TXI TXI TXL LXD AXT AXT TRA PlE PZE PZE CLS CHS CLA NOP END C13 C11 C18 LV Kl LS LA K3 K4 K5 K6 ANTlLA)-l 1<1 LOQ C12A ANT+l CI0 LA "*,1 **,1 .*,2 .*,2 **,1 .+1,2,-1 IRI COUNTS UP FROM 1 TO LA/2 IR2 COUNTS DOWN FROM -1 TO -LA/2 (""ANT+ 1) REVERSE AND (*.=ANTILA)-l) POSSIBLY CHANGE (**=ANTtLAI-l) SIGN OF ANTI SYMMETRIC PART t .*=ANT+ 11 (".=SYM+ 11 REVERSES (**=SYMILSI-1) SYMMETRIC PART (··=SYM(LSI-1) ( .*=SYM+1I .+1,1,1 CI0,1,.· CHPRTS-2,4 1*.=LA/2 ROUNDED UP) **,1 **,2 4,4 1 .* .... '•• ,1 *.,1 0075 0076 0077 007B 0079 OOBO 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 C15 1<1 ..... * •• * ••••••• * •••• CHPRTS • * •••••••••••••••••••••••• ~.* t .*=LS=LENGTH OF SYM) I*·=LS=LENGTH OF ANT) fOR CHPRTS FOR CHPRTS FOR PVPRTS FOR RVPRTS 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 2) •••••••••••••••••••••••• - CHSIGN PROGRAM LISTINGS • - •••••••••••••••••••••••• ISUBROUTINE) ••••••••••••••••••••••••• CHSIGN LAST CARD IN DECK IS NO. 0077 0001 0002 100 0003 CHSIGN 0004 CHSIGN IX,LX,XNEG) 0005 0006 ----ABSTRACT---0001 0008 0009 - TITLE - CHSIGN DOlO CHANGE ALL SIGN BITS OF A VECTOR 0011 • CHSIGN CHANGES SIGN BITS IN A FLOATING OR FIXEO VECTOR 0012 0013 - FAP SUBROUTINE IFORTRAN-II COMPATIBLE) 0014 - LANGUAGE 0015 - EQUIPMENT - 709 OR 1090 IMAIN FRAME ONLY) - 1B REGISTERS 0016 - STORAGE - 27 + 6-LX MACHINE CYCLES, LX VECTOR LENGTH 0017 - SPEED - S.M. SIMPSON, AUGUST 1963 0018 - AUTHOR 0019 • 0020 ----USAGE--0021 0022 - TRANSFER VECTOR CONTAINS ROUTINES - INONE) 0023 AND FORTRAN SYSTEM ROUTINES - (NONE) 0024 0025 • FORTRAN USAGE 0026 • CALL CHSIGNCX,LX,XNEG) 0027 0028 • INPUTS 0029 • XCI) 1-1 ••• LX IS A FIXED OR FLOATING VECTOR 0030 • 0031 • LX 0032 SHOULD EXCEED 0 0033 • STRAIGHT RETURN WITH NO OUTPUT IF LX lSTHN 1 • 0034 - OUTPUTS 0035 • 0036 • XNEG I II I=l ••• LX IS XNEGII)= -XIII 0037 • EQUIVALENCE eXNEG,XI IS PERMITTED. 003B 0039 • 0040 • EXAMPLES 0041 • 0042 • 1. INPUTS - Xel ••• 41 = 1.,-1.,2.,0. IXll ••• 41 = -1,1,-2,-0 Y-O. 0043 • USAGE CALL CHSIGNI X,4, XNEG) 0044 • CALL CHSIGNIIX,4,IXNEGI 0045 • CALL CHSIGNI X,4, XI 0046 • CALL CHSIGNIIX,I,IXI 0047 • CALL CHSIGNI X,D, Yl • OUTPUTS - XNEGIl ••• 4) = -1.,1.,-2.,-0. IXNEGel ••• 4) = 1,-1,2,0 0048 0049 • Xll ••• 41 = -1.,1.,-2.,-0. IX(1)· 1 • Y • 0.0 INO OUTPUT CASE) 0050 0051 •- PROGRAM FOLLOWS BELOW 0052 0053 • 0054 • 0055 • NO TRANSFER VECTOR HTR XR4 o 0056 BCI I,CHSIGN 0057 0058 • ONLY ENTRY. CHSIGN(X,LX,XNEGI 0059 CHSIGN SXO CHSIGN-2,4 Kl CLA 1,4 0060 AIX)+l ADO K1 0061 STA 0062 GET 3,4 0063 CLA 0064 AIXNEGI+I ADD Kl 0065 STA STORE CLA. 0066 2,4LX 0067 TMI LEAVE 0,4 0068 POX LEAVE,4,O 0069 TXL 0070 - REVERSING LOOP •• ,4 0011 •• =AeXI+I GET CLS 0072 STORE STO *-=AI XNEG 1+1 0073 TlX 0014 • EXIT CHSIGN FAP -CHSIGN COUNT LBL ENTRY --- -- - - •••••••••••••••••••••••• 9/29/64 .*•••••••••••••••••••••••• .. CHSIGN •• * ••••••••• **** ••••••• (PAGE 21 LEAVE PROGRAM LISTINGS .*. ...... *•••••••••••••••. CHSIGN •••••••••••••••••••••••• (PAGE LXO TRA END CHSIGN-2,4 4,4 0075 0076 0077 21 •••••••••••••••••••••••• ...•••.•••.......•.•••. CHUSET _. It REFER TO INDEX PROGRAM LISTINGS * •••••• .*•••••••••••••••••• .. CHUSET * ••••••••••••••••••••• REFER TO INDEX •••••••••••••••••••••••• PROGRAM LISTINGS CLKON "•••••••••••••••••••••••• " ••••• *•••••••• ** ••••• •• ~ • ClKON LAST CARD IN OECK IS NO. 0041 0001 0002 0003 C 0004 ----ABSTRACT---0005 C 0006 C C TITLE - CLKON 0001 C CHECKS IF INTERVAL TIMER IS ON 0008 0009 C CLKON OPERATES CLOCKI TO OETERMINE IF THE INTERVAL TIMER C 0010 C IS ON. IF IT IS NOT ON. CLKON PRINTS AN ON-LINE MESSAGE 0011 0012 C OPERATOR. PLEASE TURN INTERVAL TIMER ON C 0013 0014 C REPEATEDLY UNTIL THE TIMER IS TURNED ON. IF THE TIMER C 0015 IS ON. CLKON RETURNS TO THE CALLER. C 0016 C 0011 C LANGUAGE - FORTRAN II SUBROUTINE 0018 C EQUIPMENT - 709 OR 1090 IMAIN FRAME. INTERVAL TIMER. AND ON-LINE 0019 PRINTER) C 0020 C STORAGE - 46 REGISTERS 0021 C AUTHOR 0022 - R.A. WIGGINS MAY. 1963 0023 C ----USAGE---0024 C 0025 C C TRANSFER VECTOR CONTAINS ROUTINES - CLOCK 1 0026 C AND FORTRAN SYSTEM ROUTINES - IFIL).(SPH) 0027 C 0028 C FORTRAN USAGE 0029 C CALl CLKON 0030 0031 C C PROGRAM FOLLOWS BELOW 0032 0033 C 10 JOB=O 0034 CALL CLOCKI (JOB.TIME) 0035 IF (JOB) 20.40.40 0036 0037 PRINT 30 20 FORMATIIH05X39HOPERATOR. PLEASE TURN INTERVAL TIMER ON) 30 0038 GO TO 10 0039 40 RETURN 0040 END 0041 " CLKON ISUBROUTINE) " LABEl CCLKON SUBROUTI NE CLKON • •••••••••••••••••••••••• 9/29/64 •••••••••••••••••••••••• • CLOCKI (70901 • PROGRAM LISTINGS •••••••••••••••••••••••• • CLOCK! 170901 (SUBROUTI NE) • FAP .CLOCK1 (7090) COUNT 130 LBL CLOCK1 ENTRY CLOCKI (JOB,TIME) • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• • ••••••••••••••••••••••• CLOCK1 170901 • ••••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0147 0001 0002 0003 0004 0005 0006 ---.. ABSTRACT---0001 0008 0009 TITLE - CLOCKI FOR REAL TIME TIMING IN SECONDS USING 7090 INTERVAL CLOCK 0010 0011 CLOCKI ALLOWS FORTRAN ACCESS TO THE CORE STORAGE CLOCK 0012 SO THAT IT MAY BE USED AS A TIMER. IT WILL RETURN THE 0013 ELAPSED TIME IN SECONDS AS A FLOATING POINT NUMBER OR IN 0014 FIXED POINT MULTIPLES OF 1/60 SECONO. 0015 0016 CLOCKI WILL ALSO TELL IF THE INTERVAL CLOCK IS RUNNING 0011 0018 LANGUAGE - FAP, SUBROUTINE IFORTRAN II COMPATIBLE) 0019 EQUIPMENT - 7090, 7094 IMAIN FRAME, CORE STORAGE CLOCK 0020 AND INTERVAL TIMER) 0021 STORAGE - 51 REGISTERS 0022 AUTHOR - S.M. SIMPSON, MAY, 1962 0023 0024 ----USAGE---0025 0026 0021 TRANSFER VECTOR CONTAINS ROUTINES NONE 0028 AND FORTRAN SYSTEM ROUTINES NONE 0029 0030 FORTRAN USAGE 0031 CALL CLOCKIIJOB,TIME) 0032 0033 INPUTS 0034 JOB DEFINES WHAT CLOCK1 DOES. 0035 =0 CHECKS TO SEE IF CLOCK IS RUNNING. 0036 =1 REMEMBERS PRESENT CORE STORAGE CLOCK VALUE. 0031 =2 TELLS ELAPSED TIME FROM LAST TIME JOB=l 0038 (IN SECONDS, FLOATING POINT). 0039 =3 TELLS ELAPSED TIME FROM LAST TIME JOB=l 0040 lIN FORTRAN II INTEGER MULTIPLES OF 1/60 SECOND). 0041 IS FORTRAN 11 INTEGER. 0042 0043 0044 OUTPUTS 0045 JOB IS UNDISTURBED EXCEPT FOR THE CASE OF INPUT JOB=O AND 0046 THE CORE STORAGE CLOCK (REGISTER 5) IS NOT RUNNING. 0041 0048 IN THIS CASE JOB IS SET = -1. 0049 0050 TIME IF iNPUT JOB 0 IS UNDISTURBED. = 1 IS UNDISTURBED. 0051 = 2 IS SET = NO. SECONDS (IN FLOATING POINT) 0052 0053 WHICH HAVE ELAPSED SINCE THE LAST USE WITH JOB = 1. 0054 3 IS SET = NO. OF COUNTS lIN FORTRAN II 0055 0056 INTEGERS) II COUNT = 1/60 SEC) 0057 MODULO 2**11 • MAY DIFFER ON SUCCESSIVE RUNS BY .016661 SEC. 0058 0059 0060 EXAMPLES 0061 0062 1. INPUTS - ASSUME THE FOLLOWING USE OF CLOCK1 0063 10 CALL CLOCK1IJOB1,TIME1) 0064 20 DO 30 1=1,32165 CONTINUE 0065 30 40 CALL CLOCK1IJOB2,TIME2) 0066 0061 JOB1=0 JOB2=2 CLOCK IS NOT ON. 0068 0069 OUTPUTS - JOB1=-1 TIME1 IS UNDISTURBED TIME2 CONTAINS A 0010 MEANINGLESS NUMBER. 3/15/65 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT CLOCK IS ON. • OUTPUTS - JOBl=O TIME1 IS UNDISTURBED TIME2 CONTAINS A 0011 0012 0013 ........................ • ClOCKI (7090) • PROGRAM LISTINGS • • • • • • • •4 • • • • • • • • • • • • • • • iPAGE 2) • • • • • • (PAGE MEANINGLESS NUMBER 3. INPUTS - SAME AS EXAMPlf 1. EXCEPT CLOCK IS ON JOB1=1 JOB2'"2 OUTPUTS - JOB1:1 TIMEl UNDISTURBED JOB2 .. 2 T1ME2= .28 (7090) OR .13 (7094) • 4. INPUTS - SAME AS EXAMPLE 1. EXCEPT CLOCK IS ON JOB1=1 OUTPUTS - JOB1-1 TIME1 UNDISTURBED JOB2=3 TIME ,. 17 OR 8 • • • •••••••••••••••••••••••• ClOCK1 (7090) •• ••••••••••••••••••••••• • HTR 0 BCI 1,ClOCK1 ClOCKl SXO ClOCKl-2,4 ClA 5 STO TEMP SXA lV,l ClA 1,4 STA SJ1 STA SJ2 ClA 2,4 STA STORE .FIND OUT WHICH JOB SJ1 ClA •• • ... JOB TMI lV CAS KDl TRA J20R3 TRA JOBl TRA JOBI KD1 J20R3 SUB CAS KD1 TRA JOB3 TRA JOB2 TRA lV • WAIT A SECOND (IN THE 709) JOBI lXA K32K,1 lOOP TIX lOOP,l,l .010 CLOCK INCREMENT (VES IF NOW DIFFERENT FROM TEMP) ClA 5 CAS TEMP TRA lV TRA NOClOK TRA lV .INDICATE CLOCK NOT RUNNING NOClOK ClS K01 SJ2 STO •• ..=JOB TRA lV .FOR JOB 1 SAVE REG 5 AND EXIT JOB1 ClA 5 STO ORG TRA lV .FOR JOB 2 OR 3 SET DIFFERENCE JOB3 ClA TEMP SUB ORG ANA KMSK AlS 18 TRA STORE JOB2 ClA TEMP SUB ORG ORA KOCT FAD KOCT FOP KCONV STQ TEMP ClA TEMP STORE STO •• •• "TIME .... XRl lV AXT •• ,1 TRA 3,4 KD1 PIE 0,0,1 KOCT OCT 233000000000 KMSK OCT 000000377777 K32K PIE 32767 KCONV DEC 60.0 •• TEMP PZE •• .. TEMPORARV PZE •• ....ClOCK SAVE ORG END JOB2=3 (7090) (7094) 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 2) * •• * •• *.**.*.*** ••••••• * • CMPARl • • *.* •• ****.*.*********** REFER TO CMPARV PROGRAM LISTINGS ***.*.** •••••••• *****.** • CMPARl • ********* •••• **.****.**. REFER TO CMPARV •••••••••••••••••••••••• .. CMPARP .. •••••••••••••••••••••••• PROGRAM 1I STINGS • ••••••••••••••••••••••• .. CMPARP .. • ••••••••••••••••••••••• .. CMPARP I SUBROUTINE I 9129/64 LAST CARD IN DECK IS NO. 0150 .. FAP 0001 *CMPARP 0002 COUNT 150 0003 CMPARP LBL 0004 ENTRY CMPARP (IANS,Xl,Yl,X2,Y2, ••• ,XN,YNI 0005 ENTRY CMPARS IIANS,Xl,X2, ••• ,XNI 0006 0001 ----A8STRACT---0008 0009 .. TITLE - CMPARP WITH SECONDARY ENTRY CMPARS 0010 .. COMPARE PAIRS OF VARIABLES OR A SET OF VARIABLES FOR EQUALITY 0011 0012 CMPARP IS A VARIA8LE-LENGTH-CALLING-SEQUENCE SUBROUTINE 0013 " WHICH TREATS ITS ARGUMENTS, BEYOND THE FIRST ONE, IN 0014 PAIRS. THE TWO ELEMENTS IN EACH PAIR ARE COMPARED FOR 0015 IDENT lTY. 0016 0017 CMPARS IS A VARIABLE-LENGTH-CALLING-SEQUENCE SUBROUTINE 0018 " WHICH TREATS ITS ARGUMENTS, BEYOND THE FIRST ONE, AS A 0019 SET OF QUANTITIES. THE ELEMENTS IN THIS SET ARE 0020 COMPARED TO SEE IF THEY ARE ALL IDENTICAL. 0021 0022 BOTH ENTRIES CONSIDER +0 TO BE THE SAME AS -0 AND LEAVE 0023 THE RESULT OF THE TEST IN THEIR FIRST ARGUMENT. 0024 0025 .. LANGUAGE - FAP SUBROUTINES (FORTRAN-II COMPATIBLE I 0026 .. EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0027 .. STORAGE - 53 REGISTERS 0028 .. SPEED 0029 .. AUTHOR - S.M. SIMPSON JR., OCTOBER 1963 0030 0031 ----USAGE---0032 0033 .. TRANSFER VECTOR CONTAINS ROUTINES - INONEI 0034 .. AND FORTRAN SYSTEM ROUTINES - (NONEI 0035 0036 .. FORTRAN USAGE OF CMPARP 0037 .. CALL CMPARPIIANS,Xl,Yl,X2,Y2, ••• ,XN,YNI 003B 0039 .. INPUTS 0040 0041 Xl, VI IS FIRST PAIR TO BE TESTED, ANY MODE 0042 X2,Y2 IS SECOND PAIR TO BE TESTED, ANY MODE 0043 ETC 0044 XN,YN IS N-TH PAIR TO BE TESTED, WHERE N MUST EXCEED 0 • 0045 0046 .. OUTPUTS ILLEGAL RETURN RESULTS IF ARGUMENT COUNT IS EVEN OR LESS 0047 THAN 3 • 0048 0049 IANS =0 IF xl=Yl AND X2=Y2 AND ••• AND XN=YN (+0=-0) 0050 0051 =K IF XK NOT= YK IK IS LOWEST SUCH INDEX IF MORE THAN " ONEI 0052 0053 0054 .. FORTRAN USAGE OF CMPARS .. CALL CMPARSIIANS,Xl,X2, ••• ,XN) 0055 0056 .. INPUTS 0057 0058 .. Xl,X2, ••• ,XN ARE THE N QUANTITIES (ARBITRARY MODE) TO BE TESTED. 0059 .. N MUST BE GRTHN=2 • 0060 0061 .. OUTPUTS AN ILLEGAL RETURN RESULTS IF ARGUMENT COUNT IS LESS 0062 THAN 3 • 0063 0064 I ANS (+0 EQUALS -0 IN THE TEST) =0 IF Xl'X2= ••• =XN 0065 0066 =K IF XK NOT: XK+l (K IS THE LOWEST SUCH INDEX) 0067 0068 .. EXAMPLES 0069 0070 .. 1. INPUTS - Al,A2,A3 = 1.,2.,3. BI,B2,83 = 1.,2.,3. IXI = IYl = 1 0011 0012 .. Al = O. BZ = -0. C3 = 03 = 3. 0073 CALL CMPARP(IANS1,Al,BZ,Al,Bl,A2,B2,A3,B3,IXI,IYl) 0074 USAGE ...... . ... . .. ... .. .. ..... . . ... .. . .. .. ... . . . . .. .. .. . . .. . •••••••••••••••••••••••• • CMPARP •••••••••••••••••••••••• CMPARP • •••••••••••••••••••••••• PROGRAM LISTINGS • • •••••••••••••••••••••••• IPAGE 21 • • • •• •• • • IPAGE CAll CMPARPIIANS2,Al,B1,IX1,IY1.Al.AZ.A3.B21 CAll CMPARSIIANS3,A3,B3.C3.031 CAll CMPARSIIANS4,A3.B3,B2,03) OUTPUTS - IANS1 t 0 IANS2" 3 IANS3. 0 IANS4. 2 PROGRAM FOllOWS 8ElOW • NO TRANSFER VECTOR HTR o XR1 HTR o XR2 HTR o XR4 • PRINCIPAL ENTRY. CMPARPIIANS,X1,Yl,X2.Y2~ •••• XN,YNI l.CMPARP 8CI CMPARP ClA KOM2 TRA SETUP • SECONDARY ENTRY. CMPARSIIANS.X1,X2, ••• ,XN) I,CMPARS 8CI KOMI CMPARS ClA TXI2 SETUP STD STA EXIT STA CALX CMPARP-2,4 SXO SXO CMPARP-3,2 CMPARP-4,1 SXO 1,4 CLA AIIANS) STA STOANS • POSITION 1,4 TO Xl AND CLEAR XRl .+1,4,-1 TXI lXA AMASK,l • lOOP TO MOVE ALONG ARGUMENTS 1 OR 2 AT A TIME .+1,1,1 XR1 COUNTS COMPARISONS TXIl TXI CAL 2.4 TSX Y1,O TSX Y2,0 ••• TSXICK,2 TSX TRA PXOI RUN OFF CAL MAY8E OK 1.4 TSX TSXICK,2 TRA RUN OFF PXDI TRA ISARG NEW PAIR • SET IANS"O IF RUN OFF ARGUMENTS, AND LEAVE PXDI PXO 0,0 • EXIT •• STOANS STO •• AI tANS) LXD CMPARP-3.2 L'XO CMPARP-4.1 EXIT TRA •• ,4 •• : 1ICMPARP) OR 21CMPARSI • FOR MORE ARGUMENTS MAKE COMPARISON ISARG ClA. 1,4 X1.X2 •••• IEITHER ENTRY) TNZ CAS NZT2,4 SPECIAL TREATMENT TRA TKI2 FOR FIRST MAGNITUDE ZERO CAS2,4 Y2,Y3, ••• OR X2,X3 •••• CAS TRA *+2 TXI2 TXI TXI1,4 ••• •• "-2 OR -1 • COMPARISON FAILS. RUN TO END OF ARGUMENTS. SET IANS. EXIT CALX CAL •• ,4 •• " IICMPARP) OR 2(CMPARS) TSX TSXZCK.2 TRA *+2 END TXI CALX,4.-1 MORE PXD 0,1 END TRA STOANS • INTERNAL SUBROUTINE TO CHECK IF AC = TSX X,O LINKAGE XR2 • • RETURNS TO 1,2 IF NOT, ~O 2,2 IF SO TSXICK ANA AMASK lAS TSXZ TRA *+2 TRA 2,2 YES TRA 1,2 NO • CONSTANTS. VARIABLES AMASK OCT 777777700000 TSXZ TSX O,D KOMI PZE 2,0,-1 KDM2 PZE 1,0,-2 END 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 Olll 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 0150 21 ••••••••••••• * •••••••••• CMPARS "•• * ••••••••••• " *.***** ••• REFER 10 CMPIIRP PROGRAM LI S TJ NGS •• * •••••••••••••••• ** ••• "• ••• * CMPARS •••••••••••••• * ••••" REFER 10 CMPIIRP •••••••••••••••••••••• *. CMPARV ••••••••••••••••••••• • * ••• PROGRAM LJ STINGS • .. •. . • ..• • • • • • .. .. • • •• . ..• • • •• • .. • •. .. . It •.. It .. •. .. ... . .. • • .. ... • it . it . it • •. . CMPARV • •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0155 0001 0002 0003 0004 0005 0006 0007 0008 0009 ----ABSTRACT---0010 0011 TITLE - CMPARV WITH SECONDARY ENTRY CMPARL FAST COMPARE TWO ARBITRARY MOOE VECTORS FOR IDENTITY 0012 0013 CMPARL COMPARES TWO VECTORS, VIII) AND V2II) I-l ••• LV, 0014 ELEMENT BY ELEMENT (36 BIT COMPARISON) CHECKING FOR 001S IDENTITY. IT EITHER CONFIRMS THAT THE TWO VECTORS ARE 0016 IDENTICAL OR, IF THEY ARE NOT, IT RETURNS THE FIRST INDEX 0011 FOR WHICH THE ELEMENTS WERE FOUND TO DIFFER. 0018 0019 CMPARV IS IDENTICAL TO CMPARL EXCEPT THAT IT CONSIDERS 0020 +0 TO BE THE SAME AS -0 • 0021 OOZLY-2 0020 WHERE 0021 LX AND LY ARE INPUT PARAMETERS 0022 YIK) IS ASSUMED = 0.0 FOR K OUTSIDE OF 0023 0024 THE RANGE 0 TO LY-l 0025 NOTE THAT THE CONVOLUTION IS INDEPENDENT OF THE ORDER OF THE INPUTS X AND Y• 0026 0027 CONVLV-II IS A FAP PROGRAM FUNCTIONALLY IDENTICAL TO THE 0028 FORTRAN PROGRAM CONVLV BUT IS ABOUT 35 PERCENT FASTER. 0029 0030 LANGUAGE - FAP SUBROUTINE (FORTRAN II COMPATIBLE) 0031 0032 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 56 REGISTERS 0033 STORAGE 0034 ABOUT .32 (LX-LY) MILLISEC ON 709 SPEED 0035 .051 - ILX-LY) MILLISEC ON 7090 AUTHOR - J. CLAERBOUT AND R. WIGGINS 0036 0037 ----USAGE---0038 0039 0040 TRANSFER VECTOR CONTAINS ROUTINES - (NONE) AND FORTRAN SYSTEM ROUTINES - INONE) 0041 0042 FORTRAN USAGE 0043 CALL CONVLVILX,XX,LY,YY,CC) 0044 0045 0046 INPUTS 0047 IS NO. OF TERMS IN X VECTOR 0048 LX FOR MAXIMUM SPEED THE X VECTOR SHOULD BE THE LONGEST 0049 IF X AND Y HAVE DIFFERENT LENGTHS 0050 MUST EXCEED ZERO IPROGRAM EXITS IF ZERO OR LESS) 0051 0052 XXII ) I=I, ••• ,LX CONTAINS X(0), ••• ,XILX-1) RESPECTIVELY 0053 0054 0055 LY IS NO. OF TERMS IN Y VECTOR MUST EXCEEO ZERO (PROGRAM EXITS IF ZERO OR LESS) 0056 0057 0058 YYI I) l:l ••• LY CONTAINS YIO), ••• ,YILY-1) RBSPECTIVElY 0059 EQUIVALENCE (XX,YY) IS PERMITTED 0060 OUTPUTS 0061 0062 0063 CCII) I=I, ••• ,LX+LY-l CONTAINS CIO), ••• ,CILX+lY-2) RESPECTIVELY WHERE C(I) IS GIVEN IN ABSTRACT 0061t 0065 0066 EXAMPLES 0067 006B 1. SHOWING REVERSIBILITY OF X AND Y 0069 INPUTS - lX : 3 XX(I ••• 3) = 1.,2.,3. 0010 lY = 2 YY(I ••• 2) = 10.,1. 0071 CALL CONVLVILX,XX,LY,YY,CCl) 0072 USAGE CALL CONVLVILY,YY,LX,XX,C(2) 0013 10/2/64 •••••••••••••••••••••••• . CONVLV-I I ••••••••••••••••••••• ***. IPAGE PROGRAM LISTINGS 2) . • ••••••••• * •••••••••••••• CONVLV-II •.........•........... _.• • IPAGE OUTPUTS - CC111 ••• 4) = CC211 ••• 4) = 10.,21.,32.,3. • 2. ILLEGAL INPUT CASES INO OUTPUT) • INPUTS - SAME AS EXAMPLE 1. EXCEPT START WITH OUTPUT VECTORS • CLEANEO, I.E. CClI1 ••• 41 = CC211 ••• 41 = 0.,0.,0.,0. .. USAGE CALL CONVLVI-2.XX,LY,YY,CCl) .. CALL CONVLVILX,XX,0,YY.CC21 .. OUTPUTS CClI1 ••• 41 0 •• 0 •• 0 •• 0. (ILLEGAL LX) • CC2(1 ••• 4) = 0 •• 0.,0 •• 0. (ILLEGAL LY) . • PROGRAM FOLLOWS BELOW • IN PROGRAM NOTES BELOW .. X=XX .. Y=YY .. C=CC HTR 0 HTR 0 HTR BCI I.CONVLV CONVLV SXD CONVLV-4.1 SXD CONVLV-3.2 SXD CDNVLV-2.4 CLA. 1.4 GET AND SET UP ARS 18 STA LADl LENGTH OF X SERIES. TMI LEAVE TlE LEAVE ClA.. 3.4 GET AND SET UP ARS 18 LENGTH OF STA lAD2 Y SERIES. TMI LEAVE TZE LEAVE CLA 2.4 SET ADO =1 UP STA S2 ADDRESS. ClA 4.4 SET ADO =1 UP STA S1 ADDRESS. ClA 5.4 SET UP SUB LAD2 ADDRESS ADD =2 EQUAL TO STA S3 LOCIC)-lY+2. STA S4 CLA 5.4 ADO =1 STA Z =BES C CLA LADI ADD LAD2 SUB =1 PAX.l LC=LX+LY-l GOES TO XRl • FILL ANSWER BLOCK WITH ZEROS Z STZ .".1 TI X *-1.1,1 LXA LAD2.2 .. OUTER LOOP S lXA LADl.1 .. CENTRAL lOOP SI LDQ " •• 2 **=BES Y S2 FMP •• ,1 **=BES X S3 FAD .".1 ."=BES C -LY+1 (INITIALLY) S4 STO •• ,1 •• =BES C -LY+1 (INITIALLY) TIX Sltl,l .. END CENTRAL LOOP CLA S3 RESET CENTRAL ADO =1 LOOP FOR STA S3 THE NfXT STA S4 LAG. TIX S,2.1 .. END OF OUTER LOOP LEAVE LXD CONVLV-4,1 LXD CONVLV-3,2 TRA 6,4 LADI PZE LENGTH X SERIES IN ADDR. LAD2 PlE LENGTH Y SERIES IN ADDR. END ° 0074 0075 0076 0017 0018 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 2) ·.** •••.•••••.•••••••.•• COSISP •••••••• * •••••• * •••• ***.* REFER TO COSP PROGRAM LISTINGS •••• **.*.*** ••• **.*****. * *• •••• COSISP ******.***.*** •• *** REFER TO COSP •••••••••••••••••••••••• COSISI •................ __ ......• PROGRAM LISTINGS •••••••••••••••••••••••• • COSISI •..•.........•....•.... -* • COSISI ISUBROUTINEI 9/10/64 LAST CARD IN DECK IS NO. 0263 • LABEL 0001 CCOSISI 0002 SUBROUTINE COSIS! (JOB,XX,LX,COSTAB,SINTAB,M,JMIN,JMAX. 0003 1 CTR,STR,AOD.SPACE,IANSI 0004 C 0005 C 0006 ----ABSTRACT---0007 C C OOOB C TITLE - COSISI 0009 C FAST COSINE AND/OR SINE TRANSFORMS OF ODD-LENGTH SERIES 0010 C 0011 COSISI PRODUCES A HIGH-SPEED COSINE AND/OR SINE TRANSFORM C 0012 lOR PORTION THEREOF I FROM AN ODD-LENGTH SERIES XCI), C 0013 I=-N,-N+l, ••• ,N C 0014 C 0015 C N 0016 CTC JI SUM C 0017 E I=-N 0018 AND/OR C 0019 C N 0020 SUM STC JI 0021 C C I=-N 0022 0023 C FOR J = JMIN,JMIN+l, •••• JMAX C 0024 WHERE C 0025 C PI = 3.14159265 0026 C N,M.JMIN AND JMAX ARE INPUT PARAMETERS 0027 C COSIJ*PI/MI AND/OR SINIJ*PI/MI J=O,l, ••• ,M 0028 C ARE REQUIRED AS INPUT TABLES 0029 o LSTHN= JMIN LSTHN JMAX LSTHN= M C 0030 C 0031 ATTAINED BY C SPEED IS 0032 1. SPLITTING THE XII) SERIES INTO ODD AND EVEN 0033 C PARTS AND, IF N=M, RESPLITTING THESE INTO C 0034 C THEIR ODD AND EVEN SUBPARTS. 0035 C 0036 C 2. USING THE HIGH-SPEED LOOPING LOGIC OF SUBROUTINE 0037 C COSISP TO PERFORM THE TRANSFORMATIONS OF THE 0038 C SHORTENED SUBPARTS. 0039 0040 C C AN OPTION IS PROVIDED FOR ADDING CTCII AND OR STII) TO 0041 THE OUTPUT AREA RATHER THAN STORING THEM THERE. C 0042 C 0043 0044 C 2*N+4 TEMPORARY REGISTERS ARE REQUIRED BY COSISI UNLESS THE USER IS WILLING TO SACRIFICE XII) lIN WHICH 3 EXTRA C 0045 REGISTERS BEHIND XIII ARE NEEDED). C 0046 C 0047 C LANGUAGE - FORTRAN.II SUBROUTINE 004B C EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLYI 0049 C STORAGE - 406 REGISTERS 0050 - FOR M=N COSIS! TAKES ABOUT C SPEED 0051 20*M*IJMAX-JMIN+ll MACHINE CYCLES ION THE 70901 C 0052 C TO PRODUCE EITHER THE SINE OR COSINE TRANSFORM, 0053 TWICE THAT TIME FOR BOTH. C 0054 C FOR M NOT= N SUBSTITUTE 2*N FOR M IN ABOVE FORMULA. 0055 C AUTHOR - ~.A. WIGGINS, JUNE, 1963 GEOSCIENCE, INC. 0056 C 0057 C 0058 C ----USAGE---0059 C 0060 C TRANSFER VECTOR CONTAINS ROUTINES - CHPRTS,COSISP,COSP,IXCARG,MOVREV, 0061 C SISP,SPLIT 0062 C AND FORTRAN SYSTEM ROUTINES - NONE 0063 C 0064 0065 C FORTRAN USAGE CALL COSISIIJOB,XX,LX,COSTAB,SINTAB,M,JMIN,JMAX,CTR,STR,ADD, 0066 C 1 SPACE,IANS) 0067 C 0068 C 0069 C 0070 C INPUTS C 0071 JOB INOICATES WHETHER USER DESIRES THE COSINE TRANSFORM, THE C 0072 SINE TRANSFORM, OR BOTH. 0073 C =1 INDICATES COSINE TRANSFORM ONLY. C 0074 •••••••••••••••••••••••• COSIS! • ••••••••••••••••••••••••• IPAGE 21 PROGRAM LISTINGS •••••• * ••••••••••••••••• COSISI ••••••••••••••••••••••••* • C =2 INDICATES SINE TRANSFORM ONLY. C =3 INDICATES COSINE AND SINE TRANSFORMS. C C XXIII I=l, ••• ,LX CONTAINS THE SERIES XIJI. J=-N.-N+l ••••• N AS C DESCRiBED IN THE ABSTRACT. C C LX =2*N+l C MUS T EXCEED ZERO. C MUST BE ODD. C C COSTABIII I=1 ••••• M+1 CONTAINS COSIJ*PI/MI J=O,l, ••• ,M C IS DUMMY ARGUMENT IF JOB=2 C C SINTABIII I=l ••••• M+l CONTAINS SINIJ*PI/MI J=O,l ••••• M C IS DUMMY ARGUMENT If JOB=l C C M MUST EXCEED 0 IF = N COSIS1 BECOMES MUCH MORE EFFICIENT - SEE SPEED. C C C JMIN MUST BE NON-NEGATIVE. C C JMAX MUST BE GRTHN JMIN. LSTHN= M C C ADD =0. IMPLIES THAT OUTPUTS ARE TO BE STORED IN THE OUTPUT C AREA WITHOUT ADDITION. C NOT= O. IMPLIES THAT THE OUTPUTS ARE TO ADDED INTO THE C IJUTPUT AREA. C C SPACEIII I=1 •••• ,LX+3 IS A BLOCK OF TEMPORARIES NEEDED BY COSISI. C MAY BE EQUIVALENT TO XXIII IXXIII WILL BE DESTROYEDI. C NOTE THAT 3 ADDITIONAL SPACES ARE NEEDED IN ADDITION TO C THE LENGTH OF XXIII. C C C OUTPUTS C C CTRIII I=l •••• ,JMAX-JMIN+l CONTAINS CTIJI J=JMIN •••• ,JMAX AS C DEFINED IN THE A8STRACT. C IS DUMMY ARGUMENT If JOB=2 C C STRIII I=I, ••• ,JMAX-JMIN+l CONTAINS STIJI J=JMIN, ••• ,JMAX AS C DEFINED IN THE A8STRACT. C IS DUMMY ARGUMENT IF JOB=l C ClANS =0 NORM ALL Y C =1 IF JOB ILLEGAL INOT = 1,2. OR 31 C =3 IF LX ILLEGAL ILSTHN= 0, OR 0001 =6 IF M ILLEGAL ILSTHN= 01 C C =7 IF JMIN ILLEGAL ILSTHN 01 C =B IF JMAX ILLEGAL ILSTHN= JMIN, OR GRTHN MI C C C EXAMPLES C C 1. COMPLETE SPECTRUM, NOT TRYING TO SAVE SPACE, 2*M+l NOT = LX C INPUTS LX=7 XXll ••• 71 = -36.,-27.,-18.,2.,22.,33.,44. C M=2 COSTABll ••• 3) = 1.,0.,-1. SINTABll ••• 31 * 0.,1 •• 0. C JOB=3 JMIN=O JMAX=M ADD=O. C USAGE CALL COSISI IJOB,XX,lX.COSTAB,SINTAB,M,JMIN,JMAX, C 1 CTR,STR,ADD,SPACE,IANSI C OUTPUTS - I ANS=O C CTRll ••• 3) 20.,-4.,-4. STRll ••• 31 = 0.,-40 •• 0. C C 2. COMPLETE SPECTRJM SAVING SPACE, 2*M+l NOT= LX C INPUTS - SAME AS EXAMPLE 1. C USAGE CALL COSISI IJOB.XX.LX,COSTAB,SINTAB.M,JMIN,JMAX. C 1 CTR,STR.ADD,XX,IANSI C OUTPUTS - SAME AS EXAMPLE 1. EXCEPT XXll ••• 10) ARE DESTROYED. C C 3. COMPLETE COSINE SPECTRUM. NOT TRYING TO SAVE SPACE, 2*M+l=LX C INPUTS - LX=5 XXll ••• 5) = -17.,-5.,9.,7.,16. C M=2 COSTABll ••• 3) = 1.,0.,-1. C JOB=l JMIN=O JMAX=M ADD=O. C USAGE CALL COSISI IJOB,XX,LX,COSTAB,DUMMY,M,JMIN.JMAX, C 1 CTR,DUMMY,ADD,SPACE,IANSI IPAGE 007~ 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0096 0099 0100 0101 0102 0103 0104 0105 0106 0107 0106 0109 0110 0111 0112 0113 0114 0115 0116 0117 0116 0119 0120 0121 0122 0123 0124 0125 0126 0127 0126 0129 0130 0131 0132 0133 0134 0135 0136 0137 0136 0139 0140 0141 0142 0143 0144 0145 0146 0147 0146 0149 21 •••••••••••••••••••••••• COSIS1 • •••••••••••••••••••••••• PROGRAM LISTINGS • (PAGE ~ COSIS1 (PAGE OUTPUTS - IANS=O CTRll ••• 31 = 12.,8.,8. C C It. COMPLETE SINE SPECTRUM, NOT TRYING TO SAYE SPACE, 2*M+1=LX, AND ADDING OUTPUT INTO OUTPUT AREA. C INPUTS - LX=5 XX(I ••• 5) = -17.,-5.,9.,7.,18. C M-2 SINTA811 ••• 31 = 0 •• 1., O. STRIl ••• 3 • • I., 1 •• 1. JOB=2 JMIN=O JMAX=M ADD=l. C USAGE CALL COSISI IJOB.XX.LX,DUMMY.SINTAB,M,JMIN,JMAX, C 1 DUMMY,STR,ADD.SPACE,IANS) C C OUTPUTS - IANS=O STRI1 ••• 3) = 1., 13 •• 1. C C C C 5. ERROR EXITS W[TH NO COMPUTATION USAGE CALL COS[Sl lO,XX.3.COSTAB.S[NTA8.3.0,3. C t CTR,STR,ADD,SPACE.IANS11 C C C C C C C C C C C C C C C CALL COS[Sl 13,XX,2,COSTAB,S[NTAB.3,O.3, CTR,STR,ADD,SPACE,1ANS21 CALL COS1Sl 13,XX,3,COSTAB,SINTAB,O,O,3, 1 CTR,STR,ADD,SPACE,IANS3J CALL COSIS1 13,XX,3,COSTAB,SINTAB.3,-1,3, 1 CTR,STR,ADD,SPACE.IANS4) CALL COSIS1 13,XX,3,COSTAB,SINTAB,3,5,It, 1 CTR,STR,ADD.SPACE,IANS5) OUTPUTS - IANSl=l (ILLEGAL JOB) IANS2=3 IILLEGAL LX) [ANS3=6 I[LLEGAL MI IANSIt=7 IILLEGAL JM[NI IANS5=8 I [LLEGAL JMAX AND JMINI t C C • • ••••••••••••••••••••••• 3) C C •..•...... ......•...... • PROGRAM FOLLOWS C DIMENSION XXI21,CMI21 COMMON CM J=JOB L=LX JMN=JMIN JMX=JMAX C CHECK LEGALITIES OF INPUT PARAMETERS IAN=O IF IJ.'It-JII 10,10,20 10 IAN=l GO TO 999 20 [F IL .XMODFIL,211 30,30,40 30 I AN=3 GO TO 999 IF IMI 50,50,60 40 50 IAN=6 GO TO 999 60 IF IJMNI 70,80,80 70 IAN=7 GO TO 999 80 IF IJMX-JMNI 100,100,90 90 [F IM-JMXI 100,110,110 100 IAN=8 GO TO 999 110 CONTINUE M1=M [F IADDI 120.130,120 120 M1=-M1 130 CONT[NUE N=L/2 LS=N+1 CALL IXCARG ISPACE,[SSI [SA= I SS+LS+l C SPLIT XX ONCE ONTO SPACE CALL SPLIT IXX,L,1.,CMI[SSI,CMI[SA-111 CALL MOYREYIN,1,CMIISA-1),1,CMIISA+1',1) CMIISA-U=O. CMIISAI=O. [SL"'ISS+L+2 CMI I SLI =0. C CHECK [F FURTHER SPLITTING IS YALID IF 1M-HI 300,200,300 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 018,6 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 31 •••••••••••••••••••••••• COS.ISl • ••••••••••••••••••••••••• IPAGE 4) PROGRAM LISTINGS •••••••••••••••••••••••• • COSISl • •••••••••••••••••••••••• C YES IT IS VALID 200 CONTI NUE LSS=N12 GO TO 1210,230,210),J C SPLIT AND REVERSE SYMMETRICAL PART 210 CONTINUE IAS=ISS+lSS+l CAll SPLIT ICMCISS),lS,I.,CMIISS),CMIIAS)) CALL CHPRTSCCMCISS),CMCIASl,lSl GO TO C220,10,230),J C ONLY COSINE TRANSFORM WANTED - CALL COSP. 220 CONTI NUE CALL COSP ICMIJSSl,CMIIAS),lSS,COSTAB,Ml,JMN,JMX,I •• CTRJ GO TO 999 C SPLIT AND REVERSE ANTI SYMMETRICAL PART 230 CONTINUE IAA=ISA+lSS+l CALL SPLIT ICMIISAl,lS,I.,CMltSAl,CMfIAA)l CALL CHPRTSCCMCISAl,CMIIAA),LSl GO TO IIO,240,2501,J C ONLY SINE TRANSFORM WANTED - USE SISP 240 CONTINUE . CAll SISP ICMIISAl,CMCIAAI,LSS,SINTAB,MI,JMN.JMX,l.,STRl GO TO 999 C BOTH COSINE AND SINE TRANSFORMS WANTED - USE COSISP 250 CONTINUE . CALL COSISP ICMIISSI,CMIIAS),CMIISAI,CMIIAAI,LSS,COSTAB,SINTAB, 1 Ml,JMN,JMX,l.,CTR,STR) GO TO 999 C FURTHER SPLITTING IS NOT VALID 300 CONTINUE IAS"'ISS IAA=ISA LSS"'N GO TO 1220,240,250l,J C THAT'S ALL. 999 IANS=IAN RETURN END I PAGE 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236. 0237 0238 0239 0240 021t1 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 4) ..•••••••••••••••••••••••• . casp PROGRAM 1I STINGS •••••••••••••••••••••••• ... •. •. .. .. .. . ...- --.. . .--. . .-. • • .. ... •. • ... • • .• . • •. . • .-- -- • LAST CARD IN DECK IS NO. 0811 0001 0002 COUNT 1000 0003 LBL COSP 0004 ENTRY COSP ISSX,ASX,L,COSTAB,M,JMIN,JMAX,TYPE,COSTRl 0005 SISP ISAX,AAX,L,SINTAB,M,JMIN,JMAX,TYPE,SINTRl ENTRY 0006 COSISP ISSX,ASX,SAX,AAX,L,COSTAB,SINTAB,M,JMIN.JMAX,TYPE. ENTRY 0001 CDSTR,SINTRl 0008 0009 ----ABSTRACT---0010 0011 TITLE - COSP WITH SECONDARY ENTRY POINTS SISP AND COSISP 0012 FAST COSINE AND/OR SINE TRANSFORMS FROM 2 OR 4 EVEN-ODD PARTS 0013 0014 COSP COMPUTES COSINE SUMS, CTIJI J=JMIN, ••• ,JMAX , ON 0015 TWO INPUT SERIES, SS!II AND ASIII I=O,l, ••• ,L , ACCORDING 0016 TO L 0017 SUM I SSIII.COSII.J*IPI/MII. J EVEN 0018 1:0 0019 CTIJI = 0020 L 0021 0022 SUM I ASIII*COSII-J*IPI/MII J 000 1=0 0023 0024 FOR J =JMIN,JMIN+1, ••• ,JMAX 0025 WHERE 0026 PI = 3.14159265 0027, M '" INPUT PARAMETER 0028 COSII*IPI/MII I=O,l, ••• ,M IS AN INPUT TABLE 0029 SSIII,ASIII, MAY BE EITHER FIXED OR FLOATING POINT 0030 ITHE COSINE TABLE MUST CORRESPOND IN TYPEI 0031 o LSTHN= JMIN LSTHN JMAX LSTHN= M 0032 0033 SISP COMPUTES SINE SUMS, STIJI 0034 0035 L SUM 1 AAIIl*SINII*J*IPI/MII J EVEN 0036 0037 1=0 Sf( Jl 0038 0039 L SUM I SAIII*SINII*J-IPI/MII 0040 J ODD 1=0 0041 0042 FOR J = JMIN,JMIN+1, ••• ,JMAX 0043 WHERE 0044 SINII*IPI/MII I=O,l, ••• ,M IS AN INPUT TABLE 0045 AA,SA, AND THE SINE TABLE ARE FIXED OR FLOATING 0046 0047 COSISP COMPUTES BOTH CTIJ) AND STIJ) AS DEFINED ABOVE 0048 0049 AN OPTION IS PROVIDED FOR ADDING THE TRANSFORMS INTO THE 0050 OUTPUT AREAS. 0051 0052 NOTE THAT THE FUNDAMENTAL FREQUENCY AS DEFINED BY THE 0053 0054 INPUT TABLES HAS PERIOD'" EVEN NO. OF POINTS 2M 0055 0056 LANGUAGE - FAP SUBROUTINE IFORTRAN II COMPATIBLE) 0057 EQUIPMENT - 109 OR 1090 IMAIN FRAME ONLYl 0058 STORAGE - 504 REGISTERS 109-FIXED PT 109-FLDATING PT 0059 SPEED MACHINE CYCLES 0060 COSP 34*K*ll+ll 31-K*ll+ll MACHINE CYCLES SISP 39*K*ll+ll 43.K-IL+l1 0061 MACHINE CYCLES COSISP 61*K*IL+11 12.K-IL+11 0062 WHERE K '" JMAX-JMIN+l 0063 IREDUCE ESTIMATES ABOUT 10 PERCENT FOR 10901 0064 - S.M. SIMPSON, OCT 26, 61 0065 AUTHOR 0066 0067 ----USAGE---0068 0069 TRANSFER VECTOR CONTAINS ROUTINES NONE 0010 AND FORTRAN SYSTEM ROUTINES NONE 0071 0012 FORTRAN USAGE OF COSP CALL COSP !SSX,ASX,l,COSTAB,M,JMIN,JMAX,TYPE,COSTRl 0073 0074 --- .. • ... - COSP ISUBROUTINEI FAP •••••••••• ** •••••••••••• .••••••••••• . casp ** ••••••••••• 9/29/64 .•••••••••••••••••••••••• casp • ................ _...... . IPAGE •••••••••••••••••••••••• PROGRAM LI STINGS to 21 IPAGE .. INPUTS TO COSP • ..*.. •.* . .. .. .. .. .. .. .. .. SSXIIl l=l ••• L+l CONTAINS SSIJ) J=O,l, •••• L FIXED OR FLOATING ASXIII l=l ••• L+l CONTAINS ASIJI J=O.l, •••• L EQUIVALENCE ISSX,ASX) IS PERMITTED FIXED OR FLOATING L MUST EXCEED 0 COSTABII) l=l ••• M+l CONTAINS COSIJ.PI/MI J= O.l •••• ,M COSTAB IS FIXED OR FLOATING FOR FIXEO POINT IT IS ASSUMED THAT THE BINARY POINT IS BETWEEN THE SIGN BIT AND BIT 1 SO THAT VALUES 1.0 AND -1.0 SHOULD BE ENTERED AS OCTAL 377717717771 AND 717777777777 RESPECTIVELY. THE BINARY POINT OF SSX AND ASX IS IMMATERIAL, BUT OVERFLOW MAY ARISE. M IS LENGTH OF COSTAB. IF NEGATIVE, COSP ADDS TRANSFORM CT(II TO THE OUTPUT BEFORE STORING IN THE OUTPUT AREA • .... MUST NOT =0 LOWEST MULTIPLE OF FUNDAMENTAL DESIRED .... JMIN MUST BE GRTHN= 0 AND LSTHN JMAX HIGHEST MULTIPLE OF FUNDAMENTAL DESIREO .... JMAX DEFINES MUST BE GRTHN JMIN AND LSTHN= M SS.AS, AND COSTAB ARE FIXED PT • .... TYPE =NOT=0.0 0.0SIGNIFIES MEANS SS.AS. AND COSTAB ARE FLTG. PT • .. OUTPUTS FROM COSP . .. COSTRII) l=l ••• JMAX-JMIN+l CONTAINS CTIJI J=JMIN ••• JMAX AS DEFINED IN ABSTRACT. ..• IPROGRAM EXITS WITHOUT COMPUTATION IF l.M,JMIN, •.. OR JMAX I LlEGAlI .... FORTRAN USAGE OF SISP DEFIN~S .. . • .. . It CALL SISP ISAX,AAX,L.SINTAB,M,JMIN,JMAX.TYPE,SINTR) INPUTS TO SISP SAXI I I l=l ••• L+l AAXIII l=l ••• L+l CONTAINS AAIJI J=O.l, ••• ,L EQUIVALENCE ISAX,AAX) IS PERMITTED. L SAME MEANING AS FOR COSP It CONTAINS SAIJI J=O,l, ••• ,L It It It It • •.. .. SINTABII I I=l ••• M+l CONTAINS SINIJ.PI/MI M SAME MEANING AS FOR COSP JMIN SAME MEANING AS FOR COSP SAME MEANING AS FOR COSP ..• TYPE SAME ... OUTPUTS FROM SISP MEANING AS FOR COSP ... SINTRIII I=l ••• JMAX-JMIN+l CONTAINS STIJ) .... FORTRAN USAGE .. .. J=O,l ••••• M JMAX .. 1 J=JMIN ••• JMAX AS DEFINED IN ABSTRACT OF COSISP CALL COSISPISSX.ASX.SAX.AAX.L.COSTAB,SINTAB.M.JMIN.JMAX. TYPE,COSTR.SINTRI .. ..... EXAMPLES . . casp •••••••••••••••••••••••• WHERE ARGUMENTS ARE THE SAME AS FOR COSP AND SISP EQUIVALENCE ISSX,ASX.SAX.AAX) IS PERMITTED • 0075 0076 0077 007B 0079 OOBO 0081 0082 0083 0084 00B5 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 014B 0149 2) •••••••••••••••••••••••• COSP • *•••••••••••••••••••••••• (PAGE •••••••••••••••••••••••• COSP * •••••••••••••••••••••••• PROGRAM LISTINGS * 31 IPAGE * 1. USE OF COSP, SISP, COSISP WHEN ALL INPUTS EQUATED, FIXED AND * FLOATING, ALL FREQUENCIES • INPUTS - Xll ••• 4) = 1.,2.,3.,4. IXll ••• 4) 100,200,300,400 La 3 • COS'AB11 ••• 3)=1.0,0.0,-1.0 SINTABI1 ••• 3)-0.0,1.0,0.0 M=2 • ICOST811 ••• 31=OCT377777777777,000000000000,777777777777 • ISINTBll ••• 31=OCTOOOOOOOOOOOO,377777777777,000000000000 JMIN = 0 JMAX = 2 • • USAGE CALL COSP IX,X,L,COSTAB,M,JMIN,JMAX,1.,CI1 • CALL COSP IIX,IX,L,ICOSTB,M,JMIN,JMAX,O.,ICl) CALL SISP IX,X,L,SINTA8.M,JMIN,JMAX,l.,SI) • * CALL SISP IIX,IX.L,ISINTB,M,JMIN.JMAX,O •• ISl) • CALL COSISP IX.X,X.X,L,COSTA8.SINTA8.M.J"IN,JMAX. 1.,C2.S2) * • CALL COSISP IIX,IX,IX,IX,l,ICOSTB,ISINTB,M,JMIN, • JMAX,0.,IC2,IS2) • OUTPUTS - ClI1 ••• 31 = C211 ••• 3) 10 •• -2.,-2. SlI1 ••• 3) = S211 ••• 3) = 0.,-2.,0. • IC111 ••• 3) = IC211 ••• 3) = 1000,-200,-200 * ISlI1 ••• 3) = IS211 ••• 31 • 0,-200.0 = = • • 2. PARTIAL • INPUTS • USAGE • OUTPUTS • • • • FREQUENCY COVERAGE - SAME AS EXAMPLE 1. EXCEPT JMIN - SAME AS EXAMPLE 1. - ClI1 ••• 21 = C211 ••• 2) -2 •• -2. SlI1 ••• 21 S211 ••• 2) = -2.,0. IClI1 ••• 2) = IC211 ••• 2) a -200,-200 ISlI1 ••• 21 = IS211 ••• 2) • -200,0 = = = • 3. USE OF COSISP TO FINO COEFFICIENTS OF TRIGONOMETRICAl SERIES FOR AN EVEN-LENGTH VECTOR • ISEE CARSLAW, 1930, FOURIER SERIES AND INTEGRALS. P324,325) GIVEN XXII) 1=1 ••• 2.M CONTAINING XIJ) J=0,1, ••• ,2.M-1 • FINO AIOI.All), ••• AIM) AND 8(1),812) •••• ,BIM-1) SUCH THAT • * •• • • • • • • • XIJ)=AIOI+AI1)COSIJ*0)+ ••• +A(M-1)COSIIJ-I).O)+AIM1COSIPI) +BII1SINIJ.0)+ ••• +8IM-1)SINIIJ-1).0) WHERE O=PI/M J=0.1 •••• ,2.M-l SOLUTION INPUTS - COSTA811 ••• M+l) = COSIJ-PI/M) J . O.l, •••• M SINTA811 ••• M+l) • SINIJ-PI/M) J O.l •••• ,M L = 2-M-l USAGE CALL COSISPIX,X,X,X,L.COSTAB.SINTA8,M,0.M.1.,AA.8B) AAll) = AAIII/FLOATFI2-MI AAIM+1) = AAIM+l1/FLOATFI2-MI 00 10 1~2,M AAII)=AAII)/FLOATFIM) 10 BBII'=8B(I'/FLOATFIMI OUTPUTS - AAll ••• M+l1 WILL CONTAIN AIOI.All, •••• AIM) AS nEQUIREO 8812 ••• M) WILL CONTAIN 811) •••• 8IM-l) AS REQUIRED 18Bll'=B8IM+l)=0.I = - 4. USE OF COSISP TO INVERT COEFFICIENTS OF TRIG SERIES FOR AN EVEN• LENGTH VECTOR GIVEN AIOI •••• AIMI Bll) ••• BIM-l1 AS DEFINED ABOVE • FINO XIJI = TRIG SERIES ABOVE J = 0.1 ••••• 2.M-l SOLUTION • INPUTS AAII) AND BBIII ARE SAME AS UUTPUTS OF EXAMPLE 3. • USAGE CALL COSISPIAA.AA.BB.BB,M,COSTAB,SINTAB, • 1 M.O.M.l •• XS.XAI • 12M=2.M • DO 20 1=2,M • J=I2M+2-I XSIJI=XSIII 20 XAIJ)=-XAIII • DO 30 1=1,12M 30 XBACII)=XAII)+XSII) OUTPUTS - XBACll ••• 2-MI WILL CONTAIN X(0.1, •••• 2.M-l1 AS REQUIRED •• • - • 5. ILLUSTRATION OF FINDING TRIG SERIES INPUTS - SAME AS EXAMPLE 1. USAGE - SAME AS EXAMPLE 3. OUTPUTS - AAll ••• 31 = 2.5,-1 •• -.5 BBll ••• 31 • 0 •• -1.,0. • 6. ILLUSTRATION OF INVERTING TRIG SERIES 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 01BO 0181 0182 01B3 0184 0185 0186 01B7 018B 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 31 . .•••••••••••••••••••••••• COSP PROGRAM LISTINGS COSP •••••••••••••••••••••••• •••••••••••••••••••••••• (PAGE 4) .. * * .* ... _.•.......•.......... .. .. I PAGE INPUTS - SAME AS EXAMPLE 5. WITH AA,BB. SAME AS OUTPUTS FROM EX 5. USAGE - SAME AS EXAMPLE 4. OUTPUTS - XBACIl ••• 4) = 1 •• 2.,3.,4. 1. USE OF SYMMETRIES TO REDUCE TIME IN COMPUTING TRANSFORMS ABOUT MIDPOINT OF AN ODD-LENGTH SERIES GENERAL FORM I=M CI J) = SUM ( XI I )*COSI I"J*PI/M) ) I=-M AND I=M SIJ) - SUM I X(I)"SINtI-J"PI/M) ) * I=-M J = JMIN ••• JMAX .. SUPPOSE XI-6 ••• 6)-1.,3.,I.,2.,1.,I.,5.,4.,3.,3.,5.,4.,I. FIRST SPLIT X ABOUT ITS MIDPOINT INTO ITS SYMMETRIC ANO " ANTISYMMETRIC PARTS .. SXll ••• 7) = 5.,5.,4.,5.,6 •• 7.,2. AXll ••• 7) = 0.,3.,2.,1.,4 •• 1.,0. .. THEN SPLIT EACH OF THESE ABOUT THEIR MIDPOINTS .. SSXll ••• 4) - 5 •• 10.,12.,1. ASXll ••• 4) = 0.,2.,2.,-3. " SAXl1 ••• 4) = 1.,6.,4.,0. AAXI1 ••• 4) = 0.,2.,-2.,0. * INPUTS - THEN REVERSE ALL THE VECTORS AND CHANGE SIGNS OF ASX " AAX TO GIVE .. SSXll ••• 4) = 7.,12.,10.,5. ASXll ••• 4) = 3.,-2.,-2.,0. • SAXI1 ••• 4) 0 •• 4.,6.,1. AAXI1 ••• 4) = 0.,2 •• -2 •• 0. " L=3 M=6 C05TABII ••• 7)=CDSIJ.Pllhl SINTABI1 ••• 7)=SINIJ"PI/6) J = 0 ••• 6 "USAGE CALL COSISP ISSX,ASX,SAX.AAx,3,eOSTAB,SINTAB.M,0,M, " I.,COSTR,5INTR) .. OUTPUTS - C05TRl1 ••• 1) CIO ••• 6) 34.,.26195,3 •• 5.,1.,3.73205,0. .. 5INTRI1 ••• 1) SI0 ••• 6) = 0.,8.19615,0 •• 3.,3.46410, .. -2.19615,0. * ... .. . .. = .... . • .. • " * .. .. .. " .... .. " ..*. 8. AODITION OF OUTPUTS TO VALUES ALREAOY IN THE OUTPUT AREA - SAME AS EXAMPLE 1. EXCEPT M=-2 ClI1 ••• 3) = C211 ••• 3) = 1.,2.,3. 5111 ••• 3) = 5211 ••• 3) = 1.,-1.,-2. IC111 ••• 3)= IC211 ••• 3)= 100,200,300 15111 ••• 3)= 15211 ••• 3)= 100,-100,-200 USAGE - SAME AS EXAMPLE 1. CUTPUTS - C111 ••• 3) - C211 ••• 3) = 11 •• 0 •• 1. SI11 ••• 3) = 5211 ••• 3) = 1.,-3 •• -2. IClll ••• 3)= IC211 ••• 3)= 1100,0.100 ISlI1 ••• 3)= 15211 ••• 3)= 100.-300,-200 INPUTS PROGRAM fOLLOWS BELOW NOTATION DIFFERENCES IN PROGRAM NOTES ARE RSS=SSX ~AS=ASX RAA=AAX RSA=SAX P=L HTR 0 BCI 1.COSP COSP 5XD *-2,4 SXA LV+ltl LV+2,2 SXA KIO CLA 5TA EXIT .SET ARGUMENT TABLE CLA 1,4 STA 11 CLA 2.4 STA T2 eLA. 3,4 T5 5TD 4,4 eLA STA T6 5.4 CLA" STO T8 eLA· 6.4 T9 5TD 7,4 CLA* SET UP EXIT 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0241 0248 0249 0250 0251 0252 0253 0254 0255 0256 0251 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0213 0214 0275 0216 0277 0278 0279 0280 0281 0282 02B3 0284 0285 0286 0287 0288 0289 0290 0291 0292 0293 0294 0295 0296 0297 0298 0299 4) -* ......................... COSP ••..•.•...... -.......... (PAGE PROGRAM LISTINGS 5) no STD CL.A* 8.4 STO Tl1 CLA 9.4 STA Tl2 *SET COSP SWITCHES KAla CLA STA Z30 CLA KA6 STA 133 CLA KA15 STA Zl06 CLA KA19 STA Zl098 CLA KTl STO ZIl4 STO 1112 CLA KT2 STO ZI2lA STO ZI22A TRA Zl4 *SET EXIT SISP SXO COSP-2.4 SXA LV+I,1 SXA LV+2.2 CLA KIO STA EXIT ARGUMENT TA8LE -SET 1,4 CLA STA 13 2,4 CLA STA T4 3,4 CLA* STO T5 4,4 CLA STA T7 5,4 CLA* STO T8 6,4 CLA* T9 STD 7,4 CLA* STO no 8,4 CL.A* STO Tll 9,4 CLA STA Tt3 *SET SISP SWITCHES CLA KAl4 STA no KA9 CLA STA Z33 KA7 CLA STA Z56 STA 166 STA Z76 STA Z86 CLA KA16 STA Zl06 Kll CLA STO Z114 STO Z112 CLA Kl2 Zl21A STO STO ZI22A TRA Zl4 -SET EXI T COSISP SXO COSP-2,4 LV+ 1,1 SXA SXA LV+2,2 CLA K14 STA EXIT -SET UP ARGUMENT TA8LE 1,4 CLA STA Tl 2,4 CLA ......... -....... _--_ ... •..• *-_._. __ .-._. __ ..•.* COSP * (PAGE KA6 190 1107 1130 TRA llO4 TRA 1102 KA9 150 1100 Z1l5 lET SWE lET SWO SET UP EXIT 0300 0301 0302 0303 0304 0305 0306 0307 0308 0309 0310 0311 0312 0313 0314 0315 0316 0317 0318 0319 0320 0321 0322 0323 0324 0325 0326 0327 0328 0329 0330 0331 0332 0333 0334 0335 0336 0337 0338 0339 0340 0341 0342 0343 0344 0345 0346 0347 0348 0349 0350 0351 0352 0353 0354 0355 0356 0357 0358 0359 0360 0361 0362 0363 0364 0365 0366 0367 0368 0369 0370 0371 0372 fJ373 0374 5) .•••••••••••••••••••••••• .. COSP •••••••••••••••••••••••• IPAGE PROGRAM LISTINGS •••••••••••••••••••••••• .. 61 STA eLA STA CLA STA CLA.. STD CUI STA CLA STA CLA" STO eLA* STD T2 3,4 T3 4,4 T4 5,4 T5 6,4 T6 7,4 T7 8,4 T8 9,4 T9 10,4 eosp .. •••••••••••••••••••••••• CLA* STO no eLA* 11,4 STO Ttl CLA 12,4 STA Tl2 eLA 13,4 STA Tl3 *SET COSISP SWITCHES eLA KA14 KA9 STA l30 CLA KA9 l50 STA In eLA KA6 190 STA l56 STA l66 STA Z16 STA l86 eLA KA15 ll07 STA Zl06 CLA Kll lET SWE STO l1l4 STO l1l2 CLA Kl2 lET SWO STO Zl2lA STO 1122A CLA KA16 ll15 STA 1l09B TRA Zl4 "MAKE COMMON SETTINGS FOR COSP, srsp, COSISP AS IF IT WERE COSISP .FIRST FOR FIXED POINT OR FLOATING POINT l14 lET Til TRA lI5 FLOATING eLA MPY FIXED LDQ ADO TRA 116 l15 CLA FMP FLOATING LDQ FAD l16 STO l51 STO l61 STO l7l STO l81 STO 191 STQ l52 STQ l62 STQ Z12 STQ l82 STQ 192 STO l54 STO l64 STO l74 STO l84 STO 194 STQ l55 STQ l65 srQ l15 STQ l85 STQ 195 SLQ Zl08 SLQ Zl09A IPAGE 0315 0316 0311 0318 0319 0380 0381 0382 0383 0384 0385 0386 0381 0388 0389 0390 0391 0392 0393 0394 0395 0396 0391 0398 0399 0400 0401 0402 0403 0404 0405 0406 0407 0408 0409 0410 0411 0412 0413 0414 0415 0416 0411 0418 0419 0420 0421 0422 0423 0424 0425 0426 0421 0428 0429 0430 0431 0432 0433 0434 0435 0436 0431 0438 0439 0440 0441 0442 0443 0444 0445 0446 0441 0448 0449 61 •••••••••••••••••••••••• .•••••••••••••••••••••••• . casp (PAGE PROGRAM LISTINGS 11 SLQ Z1l6 SLQ Z1l8 CLA KA2 SMSE STA l52 STA l62 STA Z12 STA l82 CLA KA3 SMSO STA l55 STA l65 STA 115 STA l85 CLA KA4 SMCE STA In CLA KA5 SMCO STA 195 -THEN ADDRESSES CLA T1 SINfAB (OR HASH) STA l50 STA l53 STA l60 STA l63 STA Z10 STA In STA l80 STA l83 CLA T4 RAA (OR HASH) STA l51 STA l6I STA l11 STA l8I CLA T3 RSA lOR HASH) STA l54 STA l64 STA Z14 STA l84 CLA T6 COSTA8 (OR HASH) STA 190 STA zen CLA Tl RSS (OR HASH) S fA Z91 CLA T2 RAS (OR HASH) STA 194 CLA T8 M TlE LV TMI Zl7 CLA 1131A STD Zl08 STD 1l09A STO Z116 STO lllS CLA T8 STD l17 ZlOl STD Zl03 ADD T8 2M STD 2M CLA T5 P TMI LV TZE LV STD l105 CLA Tl2 COSTR (OR HASH) STA Zl08 STA 1l09A CLA Tl3 SINTR (OR HASH) STA Z1l6 STA lllS -FOR JMIN EVEN SET JE=JMIN+l,JO=JMIN+l,ESTOR=O.OSTOR=l JMIN ODD SET JOzJMIN.JE=JMIN+l),OSTOR=O,ESTOR=l l20 CLA T9 JMIN TMI LV CAS TlO TRA LV TRA LV ARS 18 L8T - .•••••••••••••••••••••••• . COSP •••••••••••••••••••••••• (PAGE 0450 0451 0452 0453 0454 0455 0456 0451 0458 0459 0460 0461 0462 0463 0464 0465 0466 0461 0468 0469 0410 0411 0412 0413 0414 0415 0416 0411 0418 0419 0480 0481 048;> 0483 0484 0485 0486 0481 0488 0489 0490 0491 0492 0493 0494 0495 0496 0497 0498 0499 0500 0501 0502 0503 0504 0505 0506 0507 0508 0509 0510 0511 0512 0513 0514 0515 0516 0517 0518 0519 0520 0521 0522 0523 0524 11 •••••••••••••••••••••••• • COSP . •••••••••••••••••••••••• (PAGE 81 PROGRAM LISTINGS • ••••••••••••••••••••••• COSP * "•••••••••••••••••••••••• TRA Z21 IS EVEN IS ODD ALS 18 STD JO ADD KDl STD JE STZ OSTOR CLA Kl STA ESTOR TRA 123 ALS 18 IS EVEN 121 STD JE ADD KDl STD JO STZ ESTOR CLA Kl STA OSTOR -CLEAR DUMMV SWITCHES 123 STl DUME STl DUMO "NOW BEGIN LOOPING .. INITIALIZE Zl05 SWITCH, CLEAR SUM REGISTERS, SET TRAVEL SWITCHES " FORWARD (**=KA6 COSP. *"=KA9 OTHERWISE) Z30 CLA "" STA Zl05 STl SMSE STZ SMSO STl SMCE STl SMCO STl SWE STZ SWO CLA JE STO ZlOO CLA JO STO Zl02 "SET MINUS JE.JO LDC JE,l SXD MJE, 1 LOC JO,1 SXO MJO.l "XR4 WILL CONTROL MOTION FOR EVEN HARMONIC INDEX "XR2 WILL CONTROL MOTION FOR 000 HARMONIC INDEX "XRl WILL CONTROL MOTION FOR DATA INDEX "DATA INDEX=SINE INDEX=COSINE INDEX=O AXT 0,7 133 TRA It. (""=190 FOR COSP, =Z50 OTHERWISE) -LOOP FOR FORWARD MOTION ON SINE WAVE FOR BOTH HARMONICS THIS PART IS FOR EVEN HARMONICS (XR41 SUMMED IN SMSE Z50 LOQ *",4 (*"=SINTAB) 151 NOP (MPV OR FMP $$,1 WITH "* = RAAI Z52 NOP (ADD OR FAD SMSEI STO SMSE HARMONICS (XR21, SUMMED IN SMSO THIS PART IS FOR ODD • Z53 LOQ ( **=SINTAB) *",2 (MPV OR FMP *.,1 wITH ""=RSA) Z54 NOP (ADD OR FAD SMSO 155 NOP STO SMSO "NOW GO TO COSINE SUMS IF COSISP, OR AVOID IF SISP (""=Z90 FOR COSISP, ""=lI00 FOR SISPI TRA "" Z56 -LOOP FOR FORWARD MOTION ON SINE WAVE OF EVEN HARMONIC AND " REVERSE MOTION ON SINE WAVE OF 000 HARMONIC FOR EVEN ( **=SINTAB) Z60 LOQ ··,4 (MPV OR FMP *",1 WITH 1t"=RAA) l61 NOP (ADO OR FAD SMSEI Z62 NOP S,.,SE STO ODD "163 FORCLS ( **=SINTAB) XCA (MPV OR FMP *",1 WITH "*=RSA) NOP l64 (ADO OR FAD S,.,SO) Z65 NOP STO SMSO TRA "" (""=Z90 IF COSISP, **=Z100 IF SISP) Z66 *LOOP FOR REVERSE ,.,OTION ON SINE WAVE OF EVEN HARMONIC AND MOTION ON SINE WAVE OF ODD HARMONIC " FORFORWARD EVEN " (PAGE 0525 0526 0527 0528 0529 0530 0531 0532 0533 0534 0535 0536 0537 0538 0539 0540 0541 0542 0543 0544 0545 0546 0547 0548 0549 0550 0551 0552 0553 0554 0555 0556 0557 0558 0559 0560 0561 0562 0563 0564 0565 0566 0567 0568 0569 0570 0571 0'>72 0573 0574 0575 0576 0577 0578 0579 0580 0581 0582 0583 0584 0585 0586 0587 0588 0589 0590 0591 0592 0593 0594 0595 0596 0597 0598 0599 8) •••••••••••••••••••••••• COSP • "•••••••••••••••••••••••• (PAGE 9' PROGRAM LISTINGS •••• * ••••••••••••••••••• .. COSP (PAGE l70 CLS (**=SINTABI XCA NOP (MPY OR FMP **,1 WITH **=RAA' Z71 NOP Z72 (ADD OR FAD SMSE' STO SMSE FOR ODD l73 LDQ (""=SINTABI ··,2 174 NOP (MPY OR FMP **.1 WITH ."=RSAI l75 NOP (ADD OR FAD SMSOI STO SMSO ( •• =Z9D COSISP, *.=lI00 IF SISP) Z76 TRA ** *LODP FOR REVERSE MOTION ON SINE WAVE FOR BOTH HARMONICS * THIS PART IS FOR EVEN HARMONICS ("=SINTABI l80 CLS "*,4 XCA (MPY OR FMP •• ,1 WITH **=RAA I NOP l81 NOP l82 (ADD OR FAD SMSE' STO SMSE THIS PART IS FOR ODD HARMONICS * •• ,2 (."=SINTAB' CLS l83 XCA (MPY OR FMP •• ,1 Z84 NOP WITH *"=RSA) l85 (ADD OR FAD SMSQI NOP STO SMSO "NOW GO TO COSINE SUMS IF COSISP, OR AVOID IF SISP l86 TRA "* (**=l90 FOR COSISP, "*=ZI00 FOR SISPI "LOOP FOR FORWARD OR BACKWARD MOTION ON COSINE WAVE " THIS PART FOR EVEN HARMONICS SUMMED IN SMCE 190 LDQ •• ,4 (**=COSTAO' 191 NOP (MPY OR FMP **,1 WITH **=RSSI 192 NOP (ADD OR FAD SMCE' STO SMCE PART IS FOR ODD HARMONICS SUMMED IN SMCO "193 THIS LDQ **,2 ( "-COSTABI (MPY OR FMP •• ,1 WITH ""=RASI Z94 NOP (ADD OR FAD SMCD' Z95 NOP STO SMCO -INCREMENT INDEX FOR EVEN HARMONICS (BY +JE FOR FORWARD * TRAVEL, BY -JE FOR REVERSE TRAVEL' *.1,4,** (**=JE FORWARD' (**=-JE REVERSE' Z100 TXI -CHECK IF INDEX HAS RUN OFF END (GREATER THAN M FOR * FORWARD TRAVEL, LESS THAN ZERO FOR REVERSE' (HOWEVER FOR REVERSE TRAVEL XR4 GOING NEGATIVE MEANS " XR4 GETS GREATER THAN M, SO SAME TEST APPLIES' l101 TXH ZI20,4,** "*=M -INCREMENT INDEX FOR ODD HARMONICS (RY+JO OR -(JOII * AND MAKE SAME KIND OF END TEST ("=-JO REVERSE) Z102 TXI "+1,2,"* (**=JO FORWARD' l103 TXH lI10,2,** (**=MI AND CHECK FOR END OF OATA -INCREMENT DATA INDEX BY " LOOPING BACK TO PLACE OETERMINED 8Y WHETHER COSP OR " SISP OR COSISP ANO FORWARD OR BACKWARD AND EVEN OR ODD l104 TXI *.1,1,1 •• B=PI (TXL **A,I,'HB l105 TXL **,1,** **A=Z90 FOR CDSP " FOR SISP OR COSISP (INITIAL = l501 **A-ZSO EVEN AND 000 HARMONICS FORWARO " ""A-l60 EVEN FORWARD, ODD REVERSE ""A=Z70 EVEN REVERSE, ODD FORWARD " "*A=ZSO EVEN AND ODD REVERSE (**-l107 FOR COSP OR COSISP, Zl06 TRA ..=lllS FOR SISPI -READJUSTMENTS WHEN DOD HARMONIC INDEX RUNS OFF END -FORWARD OR BACKWARD lll0 lET SWO BACKWARD TRA Zl13 CLA KI STO SWO *IF FORWARD SET TO GO BACKWARD ON ODD Zill SXD TEMP,2 CLA 2M SUB TEMP POX 0,2 CLA MJO STD Zl02 - . . -• * • ••••••••••••••••••••••• *. 0600 0601 0602 0603 0604 0605 0606 0601 0608 0609 0610 0611 0612 0613 0614 0615 0616 0617 0618 0619 0610 0621 0622 0623 0624 0625 0626 0621 0628 0629 0630 0631 0632 0633 0634 0635 0636 0631 0638 0639 0640 0641 0642 0643 0644 0645 0646 0641 0648 0649 0650 0651 0652 0653 0654 0655 0656 0651 0658 0659 0660 0661 0662 0663 0664 0665 0666 0667 0668 0669 0670 0671 0672 0673 0674 9' •••••••••••••••••••••••• • COSP • •••••••••••••••••••••••• COSP • • ••••••••••••••••••••••• PROGRAM LISTINGS • •••••••••••••••••••••••• (PAGE 10) (PAGE 10) l105 OR SISP OR COSISP lET S~I l50) l701 RUNS OFF END AND DECREM OF TXI .......... -............ . 'it • COSP •••••••••••••••••••••••• (PAGE 111 PROGRAM LISTINGS •..•............... _.... • COSP -If NOT STORE SMCO IN COSTR BLOCK LXA OSTOR,4 CLA SMCO Zl09A ADO -.,4 , **=COSTRI --I STO. ZI09B TRA _. ( •• =lI15 COSISP, **=l130 COSP) *COSISP OR SISP RESULT STORAGE FOR SINE TRANSFORMS *WAS LAST EVEN HARMONIC A DUMMY ll15 ZET DUME TRA ll11 YES .IF NOT STORE SMSE IN SINTR BLOCK LXA ESTOR,4 CLA SMSE l116 ADO *.,4 [ **=SINTRI *-1 STO. -WAS LAST ODD HARMONIC A DUMMY ll11 lET DUMO TRA l130 YES *IF NOT STORE SMSO IN SINTR BLOCK LXA OSTOR,4 CLA SMSl1 lll8 ADO *.,4 [**=SINTR) STO. .-1 -RESET FOR NEXT LOOP STORAGE l130 CLA ESTOR ADO K2 STO ESTOR CLA OSTOR ADO K2 STO OSTOR *INDEX JE BY TWO AND CHECK IF TOO 8IG CLA JE ADO KD2 STO JE CAS no COMPARE WITH JMAX TRA Zl35 TOO BIG NOP OK -If NEW JE OK, INDEX JO 8Y TWO AND CHECK ITS SIZE JO 1131 CLA ADD KD2 STO JO CAS no TRA lIB TOO BIG Zl3lA NOP OK *RETURN TO BEGINNING OF LOOP Zl32 TRA Z30 -If JO TOO BIG SET SWITCH ZlB CLA K1 STO DUMO *IS JE ALSO TOO BIG DUME lET TRA LV YES - ALL FINISHED TRA Zl32 NO - ONE MORE TO GO *IF JE TOO BIG SET SWITCH K1 l135 CLA STO DUME TRA Zl31 GO CHECK JO -FINAL EXIT LV LXD COSP-2,4 [.-=IRll AXT ·*,1 •• ,2 AXT [·"=IR2) •• ,4 EXIT TRA [**=10 FOR COSP OR SISP, .*=14 FOR COSISP) *CONSTANTS. TEMPORARIES, ETC , **=0 WHILE EVEN HARMONIC GOING FORWARDS I SWE PZE •• (**=1 WHILE EVEN HARMONIC GOING BACKWARD) • ( **=0 WHILE ODD HARMONIC FORWARDS) SWO PZE *. ( **=1 WHILE ODD HARMONIC 8ACKWARDS) • JE PZE **=JE 0,0.** MJE PlE 0,0,*. * .. =25 COMP OF JE 0,0, •• PZE JO ''''=JO MJO PlE 0,0,** **=25 COMP OF JO DUME PZE [**=0 FOR REAL EVEN,-"=l FOR DUMMY EVEN I •• DUMO PZE (**=0 FOR REAL 000,*.=1 FOR DUMMY 0001 -* ESTOR PlE ' •• =ZERO INDEX OF INITIAL EVEN HARMONIC STORAGE) (**=ZERO INDEX OF INITIAL 000 HARMONIC STORAGE) OSTOR PZE .* .. • •••••••••••••••••••••••• (PAGE III 0150 0151 0152 0153 0154 0155 0156 0151 0758 0159 0160 0761 0762 0763 0764 0765 0766 0767 0768 0769 0770 0771 0772 0773 0774 0775 0776 0777 0778 0779 0780 0781 0782 0783 0784 0785 0786 0787 0788 0789 0790 0791 0792 0193 0194 0195 0796 0191 0198 0199 0800 0801 0802 0803 0804 0805 0806 0801 0808 0809 0810 0811 0812 0813 0814 0815 0816 0811 0818 0819 0820 0821 0822 0823 0824 •••••••••••••••••••••••• COSP • ••••••••••••••••••••••••• PROGRAM LISTINGS 13 T4 T5 T6 T7 T8 T9 flO fll Tl2 Tl3 KO Kl K2 KI0 K14 KTl KT2 KZl KZ2 K01 KD2 KA2 KA3 KA4 KA5 KA6 KA7 KA8 KA9 KAI0 KAll KA12 KA13 KA14 KA15 KA16 KA17 KAl8 KA19 MPY FMP ADD FAD PZE PZE PlE pze PIe pze PIE PIE PIe PU PZE PZE PZE PZE PZE PIe PIE PZE PIe pze PIe PZE pze PZE: TRA TRA lET ZET pze PZE PIe PZE pze PZE PZE PZE PZE PZE PZE PZE PZE pze PZE PZE pze PZE pze PlE END •••••••••••••••••••••••• (PAGE 121 (PAGE 121 MPY FMP ADD FAD SMSE SMSO SMce SMCO 2M TEMP Tl T2 . COSP ••••••••••••••••••••••••• ··.1 ••• 1 •• •• •• ... -•• 0.0, •• •• •• •• •• •• 0,0 ••• •• _. 0,0.·. 0.0, •• 0.0 .... •• •• •• 0 1 2 10 14 Zl04 1102 SWE SWO 0,0.1 0.0.2 SMSE SMSD SMce SMCD Z90 1100 no Z50 Z60 Z70 Z80 KA8 KA9 1107 Zll5 1120 KA6 1130 SUM FOR SUM FOR SUM FOR SUM FOR '''·=2MI EveN HARMONIC SINE T~ANSFORM ODD HARMONIC SINE TRANSFORM eVEN HARMONIC COSINe TRANSFORM 000 HARMONIC COSINe TRANSFORM (**"RSS) \.·=RAS) ' ..... RSAI ( _·=RAA) I ._=P I (··=COSTA81 \**=SINTABI ' •• =M) Cu=JMINI \ •• =JMAX I '''=Typel C.... COSTRI ' •• =SINTRI 0825 0826 0827 0828 0829 0830 0831 0832 0833 0834 0835 0836 0837 0838 0839 0840 0841 0842 0843 01144 0845 0846 0847 0848 0849 0850 0851 0852 0853 0854 0855 0856 0857 0858 0859 0860 0861 0862 0863 0864 0865 0866 0867 0868 0869 0870 0871 0872 0873 0874 0875 0876 0877 •••••••••••••••••••••••• PROGRAM LISTINGS "••••••COSTBl *.* •••••••••• ••••" lAST CARO IN OECK IS NO. 0199 0001 0002 0003 0004 0005 0006 0001 0008 0009 " ----ABSTRACT---0010 " 0011 "" TITLE - COSTBl WITH SECONDARY ENTRY POINTS SINTBL. COSTBX. SINIBX 0012 • GENERATE COSINE OR SINE HALF-WAVE TABLES, FIXED OR FLOATING 0013 0014 • COSTBL GENERATES A HALF-WAVE COSINE TABLE FLOATING POINT 0015 "• SINTBL GENERATES A HALF-WAVE SINE TABLE FLOATING POINT 001& COSTBX GENERATES A HALF-WAVE COSINE TABLE FIXED POINT 0011 " SINTBX GENERATES A HALF-WAVE SINE TABLE FIXED POINT 0018 " WHERE 0019 " THE HALF-WAVE LENGTH IS AN INPUT PARAMETER. 0020 " FOR FIXED POINT TABLES THE BINARY POINT [S BETWEEN 0021 " THE SIGN BIT AND BIT 1. 0022 " 0023 "- LANGUAGE - FAP SUBROUT[NE IFORTRAN II COMPAIIBLEI 0024 " EQUIPMENT - 109 OR 1090 (MAIN FRAME ONLY) 0025 "STORAGE - 121 REGISTERS 0026 0021 " SPEED - ABOUT 2N MIll[SEC ON 109. WHERE N HALF-WAVE lENGTH "AUTHOR - JON ClAERBOUT 0028 0029 " ----USAGE---0030 " 0031 "" TRANSFER VECTOR CONTAINS ROUTINES - INONE) 0032 " AND FORTRAN SYSTEM ROUTINES - COS,SIN 0033 0034 "• FORTRAN USAGE OF COSTBL 0035 " CAll COSTBLIN,COSTAB) 003& 0031 "" INPUTS TO COSTBl 0038 • N DEFINES THE HALF-WAVE LENGTH TO BE N+1 0039 0040 " MUST EXCEEO ZERO IPROGRAM EXITS IF N IS NEGATIVE OR ZERO) 0041 "" OUTPUTS FROM COSTBL 0042 " COSTABII) I=I ••• N+1 CONTAINS TABLEIJ) = COStJ.P[/NI J=O,l ••••• N 0043 " I.E. COSTAB(I) CONTAINS TABLE I 1-1) 0044 0045 • FORTRAN USAGE OF SINTBL 0046 0041 • CALL SINTBL(N.SINTABI " INPUTS TO SINTBl 0048 "N SAME MEANING AS FOR COSTBL 0049 " OUTPUTS FROM SINTBL 0050 " SINTABII) I=1 ••• N+1 CONTAINS TABLEtJ) SINIJ"PI/NI FOR J=O,l ••• N 0051 0052 "" FORTRAN USAGE OF COSTBX 0053 " CAll COSTBXIN,ICCSTB) 0054 " INPUTS TO COSTBX 0055 "N SAME MEANING AS FOR COSTBL 005& " OUTPUTS FROM COSTBX 0051 " ICOSTBII) I=I ••• N+l IS SAME AS FOR COSTBL BUT DATA [S FIXED POINT 0058 0059 "" FORTRAN USAGE OF SINTBX OObO " CALL SINTBXIN,ISINTBI 00&1 " INPUTS TO SINTBX 00&2 "N SAME MEANING AS FOR COSTBL 00&3 " OUTPUTS FROM SINTBX 0064 " ISINTBIII I=1 ••• N+1 IS SAME AS FOR SINTBL BUT DATA IS FIXED POINT 00&5 00&& "• EXAMPLES 00&1 " 1. GENERAL BEHAVIOR FOR N=4 0068 " INPUTS - N=4 00&9 • USAGE CALL COSTBL(N,COSTAB) 0010 " CALL SINTBL(N,SINTA8) 0011 0012 • CALL COSTBXtN,ICOSTBI CALL SINTBX(N,ISINTB) " 0073 " OUTPUTS - NOTE - THESE NUMBERS ARE GOOD TO 8 OCTAL PLACES. 0014 • " •••••••••••••••••••••••• ~ " COSTBl (SUBROUTINE) " FAP -COSTBl COUNT 200 COSTBl lBl ENTRY COSTBl (N,COSTAB) ENTRY SINTBL IN,SINTAB) ENTRY COSTBX IN,ICOSTB) ENTRY SINTBX IN,ISINTBI •••••••••••••••••••••••• "COSTBl 9/29/&4 •••••••••••••••••••••••• •••••••••••••••••••••••• PROGRAM LISTINGS • COSTBL • • ••••••••••••••••••••••• COSTBL "•••••••••••••••••••••••• " (PAGE 2) (PAGE .. ." COSTABIl ••• 5 ) SINTA6(l·••• 5) ICOST6 11 ••• 5) " ISINT61l ••• 5) •" " HTR 0 BCI I,COST6L COSTBl ClA • STO Fl TRA ·"3 COSTBX STZ Fl CORS STZ COST6l-2,4 SXD SXA SV,1 CLA KCOS STO AL 2,4 ClA STA 63 ADD =1 A STA STA 6 STA 61 STA 62 STA 64 TRA 0 SINT8l CLA " Fl STO TRA *+4 SINT8X STZ Fl ClA STO CORS COST6l-2,4 SXD SXA SV,l KS I N CLA STO Al UP FIXING lOOP SET CLA 2,4 ADD =1 STA A STA 6 S TA 61 STA 62 STA L2 .. SET UP COMPUTATION lOOP 1,4 0 CLASV HI; TM! SV STD N ADD KDl STD AN STD 8N N CLA ARS 18 ORA ORF FAD ORF STO Nfl ClA =3.14159265 FOP NFL STQ INCR STZ ARG - LOOP 1,1 AXT CLA ARG NOP AL "" •• ,1 A STO ARG CLA INCR FAD STO ARG TXI *+1,1,1 AN AL,l,." TXL lET Fl TRA SV 1,1 AXT 1.0,.70711,0.0,-.70711,-1.0 0.0,.70711,1.0,.70711,0.0 OCT 377777777777,265011714000, 000000000000,665011714000,771777717777 OCT 000000000000,265011714000, 317117777771,265011114000,000000000000 (TSX 5COS,4) GET COSINS COSINSH • . ITSX SSIN,41 GET SINS SINS+l GET N FORM N+l FLOAT N FORM PI/N COS SIN TSX $COS,4 "·=COSINS+l TSX SSIN,4 •• =SINS+l ·"=N+l FIX IF ZERO EXIT - NOT ZERO 0075 0076 0077 0076 0079 0080 0081 0082 00B3 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 2) ....................... - • COSTBL •••••••••••••••••••••••• PROGRAM LISTINGS • * •••••••••••••••••••••••• (PAGE 31 BC B Bl RlSH 82 BN 83 B4 Ll L2 SV N FL INCR ARG ORF NFL KD1 KCOS KSIN CORS MD CLM LDQ LLS SSP SUB STA CLA LRS ANA ALS LLS ARS STO lXI TXL CLA TNZ CLA STO SSM LXD STO TRA CLA ARS LST TRA TRA CLA ARS ADD STD CLA LXD STO AXT LXD TRA PZE PZE PZE PIE OCT PZE PZE TSX TSX PZE PZE END .·,1 (PAGE "·=COSINS+l B =0200 RTSH •• ,1 ""=COSINS+l =0000777777777 8 .·,1 "* "" FROM B+4 *"=COSINS+l "+1,1,1 BC,l,*" CORS *"=N+1 Ll =0377777777777 ." ""=COSINS SET FIRST AND LAST VALUES IN TABLE = 1 BN,! •• ,1 **=COSINS+l SV N 18 IF = 0, N EVEN - EXIT .+2 SV N N ODD - SET MDPT 1 GET (N+1I/2 KD1 MD =0377771777777 MO,! .·,1 .* S INS+l ··.1 COSTBL-2,4 3,4 ...""•• "" 233000000000 "* 0.0.1 $COS,4 $SIN,4 "" 0,0,"* . COSTBL •••••••••••••••••••••••• ""=N IN DECR ."=O.FXD **=PI/N • "*:I*PI/N. I=O.l •••• ,N .... =FLOATF(NI "*=0 IF COS **=(N+1I/2 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 01B 0174 0175 0176 0177 0178 0179 0180 0161 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 3) ••••••••••••••• * •••••••• COSTBX • * •••••••••••• *********** REFER TO COSTBL • PROG~AM LISTINGS ••••••• * ••••••• **** •• *** COSTRX * ************************ REFER TO COSTBL • .•••••••••••••••••••••••• CPYFl2 ••••••••••••••••••••••••" .. CPYFl2 .. FAP "CPYFl2 COUNT l8l ENTRY ..... .. it • • •. .. ... it it • . • • .. • • . ..." ..... " . • •.. .. .. • " • •.. . • •.. •" .. .. .. . ... ... ..•.. ...• .• .. .. • (SUBROUTI NE) PROGRAM LISTINGS ..... . ....................... ' , CPYFL2 •••••••••••••••••••••••• 9/9/64 lAST CARD IN DECK IS NO. 0303 0001 0002 300 0003 0004 CPYFl2 CPYFl2 (ITPIN,ITPOUT,lRECMX.ZFEOFW,SPACE.IANSI 0005 0006 ----ABSTRACT---0007 0008 0009 nTlE - CPYFl2 FAST COPY FILE FROM ONE TAPE TO ANOTHER - VERSION 2 0010 0011 CPYFl2 COPIES ONE FILE OF BCD AND/OR BINARY RECORDS FROM 0012 ONE TAPE TO ANOTHER TAPE. THE END-OF-FllE MARK IS ALSO 0013 COPIED IF THE USER DESIRES IT. 0014 0015 IF A REOUNDANCY IS ENCOUNTERED ON EITHER TAPE. CPYFl2 0016 WIll ATTEMPT TO RECOPY 20 TIMES BEFORE GIVING AN ERROR 0011 0018 EXIT. AN ERROR EXIT WIll ALSO OCCUR IF AN END-TAPE CONDITION IS SENSED. 0019 0020 CPYFl2 DERIVES ITS SPEED BY OPERATING BOTH TAPES 0021 0022 SIMULTANEOUSLY IF THEY ARE ON DIFFERENT DATA CHANNELS. 0023 - FAP SUBROUTINE (FORTRAN (III COMPATIBLE) 0024 LANGUAGE EQUIPMENT - 709, 7090, OR 1094 (MAIN FRAME AND TWO TAPE UNITS) 0025 - 118 REGISTERS 0026 STORAGE - FOR THE 1090 (556 BPI) 0027 SPEEO 0.00927 SECONDS/14 WORD RECORD IF THE TAPES ARE ON 0028 0029 DIFFERENT CHANNELS. 0.01828 SECONOS/14 WORD RECORD IF THE TAPES ARE ON 0030 THE SAME CHANNEL • 0031 (NOTE THAT FORTRAN COPYING (READING ONE RECORD ANO THEN 0032 WRITING ONE RECORDI REQUIRES 0.02845 SECONOS/PER 14 WORD 0033 RECORD. I 0034 AUTHOR R.A. WIGGINS JULY. 1964 0035 0036 ----USAGE--0037 0038 TRANSFER VECTOR CONTAINS ROUTINES - NONE 0039 AND FORTRAN SYSTEM ROUTINES - (IOSI, (TCOI. IWRSI, (RCHI, (TRCI, 0040 (ETTI, (WEFI. (BSRI. (RIJS) 0041 0042 0043 FORTRAN USAGE 0044 CAll CPYFl2(ITPIN,ITPOUT.LRECMX,ZFEOFW,SPACE.IANSI 0045 INPUTS 0046 0047 ITPIN lOGICAL TAPE NUMBER THAT FILE IS COPIED FROM. 0048 0049 ITPOUT lOGICAL TAPE NUMBER THAT FILE IS TO BE COPIED ONTO. 0050 0051 lRECMX MAXIMUM NUMBER OF WORDS PER RECORD THAT Will BE COPIED. 0052 0053 IF RECORDS ARE ENCOUNTEREO THAT ARE LONGER. THEY WIll BE CHOPPED AT THIS LENGTH AND THE REMAINING WORDS WILL 0054 BE lOST. 0055 SOME STANDARD FORTRAN RECORD LENGTHS ARE 0056 0057 BCD CARDS 14 WORDS BCD OUTPUT RECORDS 0058 22 WORDS BINARY CARDS 0059 27 WORDS BINARY OUTPUT RECORDS - 256 WORDS 0060 MUST B~ GRTHN 1 BUT IS NOT CHECKED. 0061 0062 lFEOFW IS ZERO IF AN END-OF-FILE IS TO BE WRITTEN ON ITPOUT. 0063 0064 IS NOT ZERO IF NO END-OF-FILE IS TO BE WRITTEN. 0065 SPACE(I) l:l, •••• 2.LREC IS TEMPORARY STORAGE SPACE NEEDED BY 0066 0061 CPYFL2. 0068 OUTPUTS 0069 0070 0071 ONE FILE FROM TAPE ITPIN IS COPIEO ONTO ITPOUT. ITPIN IS lEFT POSITIONED AFTER THE END-OF-FILE MARK AND ITPOUT IS lEFT 0072 POSITIONED AFTER THE END-OF-FILE MARK IF ZFEOFW = 0., OR AFTER 0013 0014 THE LAST RECORD COPIED IF ZFEOFW NOT= O. IF A PERMANENT .•••••••••••••••••••••••• .. CPYFl2 •••••••••••••••••••••••• (PAGE PROGRAM LISTINGS •••••••••••••••••••••••• .. CPYFL2 21 .. .. .. .. .. .. .. .. . .. .. .. . IANS .. . .. .. ... .... .. .. .... .. EXAMPLE . ...... ..... ..... . ... ..... ... . ... .. .. .. ... (PAGE REDUNDANCY IS ENCOUNTERED ON ITPIN, IT IS LEFT POSITIONED AFTER THE REDUNDANT RECORD AND ITPDUT IS LEFT POSITIONED AFTER THE PREVIOUS RECORD. IF A PERMANENT REDUNOANCY IS ENCOUNTERED ON ITPOUT, ITPIN IS LEFT POSITIONED AFTER THE RECORD IMMEDIATELY SUCCEEDING THE REDUNDANT RECORD AND ITPOUT IS LEFT POSITIONED AFTER THE REDUNDANT RECORD. IF AN tND-TAPE CONDITION IS SENSED ON ITPIN, ITPOUT IS LEFT POSITIONED AFTER THE LAST SUCCESSFULLY READ RECORD. IF AN END-TAPE CONDITION IS SENSED ON ITPOUT, ITPIN IS LEFT POSITIONED ONE RECORD BEYOND THE LAST RECORD SUCCESSFULLY COPIED. SPACEII) CONTAINS THE NUMBER OF RECORDS COPIED IN THIS FILE IFIXED POINT). o =1 If All OK • IF REDUNDANCY ON ITPIN (AFTER 20 ATTEMPTS TO RECOPY). 2 IF REDUNDANCY ON ITPOUT (AFTER 20 ATTEMPTS TO RECOPY) 3 IF REDUNDANCIES ON ITPIN AND ITPOUT (AFTER 20 ATTEMPTS TO RECOPY). 4 IF END TAPE ON ITPIN. 5 IF END TAPE AND REDUNDANCY ON ITPIN. .. 6 IF END TAPE ON ITPIN, REDUNDANCY ON ITPOUT. 1 IF END TAPE ON ITPIN. REDUNDANCIES ON HPIN AND ITPOUT • 8 IF END TAPE ON ITPOUT. z 9 IF END TAPE ON ITPOUT, REDUNDANCY ON ITPIN. =10 IF END TAPE AND REDUNDANCY ON ITPOUT. =11 IF END TAPE ON ITPOUT, REDUNDANCIES ON ITPIN AND ITPOUT. =12 IF END TAPE ON ITPIN AND ITPOUT. =13 IF END TAPE ON ITPIN AND ITPOUT, REDUNDANCY ON ITPIN. =14 IF END TAPE ON ITPIN AND ITPOUT. REDUNDANCY OF rTPOUT =15 IF END TAPE AND REOUNDANCIES ON ITPIN AND JTPOUT. 1. A COMPREHENSIVE TEST END-OF-FILE CONTROL AND COPYING AL TERNAT ING BCD AND BINARY RECORDS. INPUTS - ITPIN .. 6 ITPOUT = 8 LRECMX .. 10 IFEOFI .. 1 • IAIl ••• 51 1,2,3,4,5 IFEOF2 .. O. USAGE - C SET UP ITPIN WITH ALTERNATING BCD AND BINARY RECORDS. REWIND ITPIN WRITE OUTPUT TAPE ITPIN,10,IA(11 FORMATI5I6) 10 WRITE TAPE ITPIN, t IA( I 1,1=1,3) WRITE OUTPUT TAPE ITPIN,lO,IIA(II,I=1.5) END FILE ITP IN REWIND ITPIN REWIND ITPOUT C COPY THE FILE TWICE CALL CPYFL2IITPIN,ITPDUT,LRECMX,IFEOF1.SPACE,IANSI REWIND ITPIN CALL CPYFL2IITPIN,ITPOUT,LRECMX,IFEOF2,SPACE,lANSI C READ THE FILE FROM ITPOUT (LAST READ SHOULD CAUSE EXITI REWIND ITPOUT READ INPUT TAPE ITPOUT,IBII) READ TAPE ITPOUT,(IBII),I=2,41 READ INPUT TAPE ITPOUT,IIB(I),I=5,10) READ TAPE ITPOUT,{IBIII,I=11,13) READ INPUT TAPE ITPOUT,(IBII),1=14,181 READ INPUT TAPE ITPOUT,IBII9) OUTPUTS - IANS = 0 IBll ••• 18) = 1, 1,2,3, 1,2.3,~,5, 1, 1,2,3, 1,2,3.4,5 FOLLOWS .. XR4PROGRAM HTR BCI CPYFL2 SXD SXA SXA CLA STO CLA BELOW o 1. CPYFL2 XR4,4 IRl,l IR2,2 11 NIH 13 .. •••••• ** •••••• ~ •• * •• ~ ••• SAVE INDEX REGISTERS. SAVE TRAPPING INSTRUCTIONS. 0015 0016 0071 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 21 .•••••••••••••••••••••••• . CPYFL2 •••••••••••••••••••••••• (PAGE PROGRAM LISTINGS .•• ••••••••••••••••••••••• .. CPYFL2 •••••••• ** ••••••••••••• 3) TPSET TCOB RDSB RCHB SCHB STO AXT CLA .. STO CLA* S10 POX SXA CAL ADD SUB STA SUB STA AXT LXD CLA* lET ADD TSX LXO LDO· SlQ LDOSTO lDO* SlO lDQ* SlO lDO* STO LDOlET lDO STO LDO* STO ClA* lET ADD TSX lDO* SLO SlO SLO lOO· STO LDO* STO STO lDO* SLO ClA llS XCA SlO lDO* STO XCl ANA ARS PAX SXD SXA AlS ADD STA CLA STO STO TCOB RTDB ENB RCHB SCHB NIF2 20,2 4,4 WEFSW 3,4 IN ,1 LREC,l 5,4 =1 LREC IN LREC UT 0,1 XR4,4 2,4 MODE =020 SilOS I ,4 XR4,4 S( TCo) TCOA S(WRS) WRSA S(RCH) RCHA S(TRC) TRCA S(EH) ETTA S(WEFI WEFSW NOP WEFA S(BSR) BSRAI 1,4 MODE =020 S (IDS), 4 SITCO) TCOB TCDBI lCOB2 SIRDS) RDSB SIBSRI BSRB1 BSRB2 S(RCH) RCHB SCHB 0 IPAGE CHANNEL COMMANOS. GET OUTPUT TAPE NO. I ITPOUTI TEST FOR BINARY MODE SET UP INSTRUCTIONS IN IIOS) RESTORE IR 4. SET UP INSTRUCTIONS BY A. GET INPUT TAPE NO. ( lTPINI TEST FOR BINARY MODE. SET UP INSTRUCTIONS IN II OS) • SET UP INSTRUCnO"lS DES IGNATED BY B. SCHB S(EHI ETTB :03000 9 ,4 ENBIN.4 E"IBIN,4 1 =BB35 ICB TRA2 11 13 * * .. ENBIN 1"1 DC STORE TRAPPING INSTRUCTIO"lS. DelAY IF CHANNel IN OPERATION. READ SELECT. ENABLE INPUT DATA CHANNEL. RESET AND lOAD CHANNEL. MONITOR 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 019B 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 3) •••••••••••••••••••••••• • • CPYFl2 PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 41 ICB TRA1 ETTB TCOA TRCA ETTA WRSA RCHA TRA LXO ENS TRA TRA TRA TRA TRA TRA TRA CLA ANS LOQ CLA STA XCA STA ANA SUB ALS STO AXT PXD ETTB ADO TCOA TRCA ETTA ADD TMI TNl WTOA RCHA no REDUNA ADD TNX TCOB2 TCOB BSRB2 BSRB BSRAI BSRA TRA ENDFIL ClS TRA WEFA WEFA CLA TRA REOUNB CLA TNX CLA ADO ANA STO TCOBI TCOB BSRBI BSRB TRA END LXD STD· CLA STO CtA STO PXD STO· AXT IRI AXT IR2 TRA TRA2 T.RA • NOP MODE NIFl NIF2 LREC IN UT ENBIN NOP PZE PZE PZE PZE 10RT IORT PZE ·-1 ··,4 =0 TRAl+1,4 ENDFIL ENDFIL ENDFIL ENDFIL REDUN6 REDUNB =071717 DC IN UT IN UT =077117 DC 18 UT 20,2 ,0 . =4811 REDUNA =8B11 WEFA E"lD •• UT re08,I,l =2817 END,2,1 • •• *. •••••••••••••••••••••••• CPYFL2 ••..•.............. READING PROCESS. .REENTRY FROM TRAP. DISENABLE CHANNELS FOR OUTPUT. CHECK REASON FOR TRAPPING. END RECORD. SWITCH INPUT ANa OUTPUT ADDRESSES. FIND NO. OF WORDS IN REC. CHECK FOR REDUNDANCY ON ITPOUT OR END TAPE CONDITIONS GO WRITE END-OF-FILE ON ITPOUT. LEAVE IF END TAPE OF END OF FILE) WRITE THIS RECORD. BUMP RECORD COUNTER AND GO TO NEXT REC SIGNAL ITPOUT REDUNDANCY SLICE REDUNDANCY COUNTER PREPARE TO RETRY WRITING TCOBl =IB17 ETT8 O'O' =1 TCOA =1B17 ETTB,2.1 MODE =1 =1 MODE • -O' TPSET XR4,4 6,4 NIFl 13 NIF2 14 ,I 5,4 •• ,1 ··.2 7,4 ICB ..o.. "" ...... -.....- (PAGE NOP IF lFEOFW NOT= o. SIr.NAL TO LEAVE AFTER WRITING CHECK FOR END TAPE SIGNAL ITPIN REDUNDANCY SLICE REDUNDANCY COUNTER CHANGE MODE AND PREPARE TO RETRY READING IN ANOTHER MODE RESET I R 4. SET I ANS, 4ND RESTORE TRAPPING INSTRUCTIONS 0225 0226 0221 022B 0229 0230 0231 0232 0233 0234 0235 0236 0231 023B 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0273 0274 0275 0276 0271 0278 0279 0280 0281 0282 0283 0284 0285 0286 0287 0288 0289 0290 0291 0292 0293 0294 0295 0296 0297 0298 0299 41 •••••••••••••••••••••••• • • CPYFL2 •••••••••••••••••••••••• 5) (PAGE • PROGRAM 1I STINGS •••••••••••••••••••••••• • CPYFL2 • • ••••••••••••••••••••••• (PAGE DC PZE WEFSW PZE END 0300 0301 0302 0303 5) •••••••••••••••••••••••• • CROSS PROGRAM LISTINGS • •••••••••••••••••••••••• • CROSS (SUSROUTINE) 9/29/64 • LASEL CCROSS SUBROUTINE CROSS (LX.X,LY,Y,LC,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 C C C C C C C C C •••••••••••••••••••••••• • CROSS LAST CARD IN DECK IS NO. 0086 0001 0002 0003 0004 ----ABSTRACT---0005 0006 0007 Tl TlE - CROSS CROSSCORRELATION OF TRANSIENTS BEGINNING WITH ZERO LAG 0008 0009 CROSS FINDS THE CROSSCORRELATION OF TRANSIENTS 0010 BEGINNING WITH ZERO LAG. 0011 0012 0013 LX SUM ( X(I). Y(I-K) ) 0014 CIK+lJ 0015 0016 0017 FOR K = 0 ••••• LC 0018 WHERE X AND Y ARE TRANSIENT SERIES OF LENGTH LX AND LY 0019 RESPECTIVELY. ANDLC IS AN INPUT PARAMETER. THE COMPU0020 TATION IS MADE AS THOUGH X AND Y HAD ZEROS EXTENDING 0021 0022 SEYOND THEIR ENOS. 0023 0024 LANGUAGE - FORTRAN II SUBROUTINE EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0025 STORAGE 0026 - 107 REGISTERS SPEED 0027 AUTHOR - R.A. WIGGINS 0028 0029 ----USAGE---0030 0031 TRANSFER VECTOR CONTAINS ROUTINES - FOOT, STZ 0032 AND FORTRAN SYSTEM ROUTINES - NONE 0033 0034 0035 FORTRAN USAGE CALL CROSS ILX,X,LY.Y,LC.C) 0036 0037 INPUTS 0038 0039 0040 LX LENGTH OF X SERIES. 0041 I=l ••••• LX IS THE X TRANSIENT SERIES. 0042 XIII 0043 LY LENGTH OF Y SERIES. 0044 0045 l=l, •••• LY IS THE Y TRANSIENT SERIES. 0046 YI II 0047 0048 IS THE DESIRED LENGTH OF THE CROSSCORRELATION. LC 0049 0050 IF LC, LX, OR LY ARE LESS THAN 1, THE ROUTINE EXITS WITH NOTE NO COMPUTATION. 0051 0052 OUTPUTS 0053 0054 CII) 0055 I=I, ••• ,LC IS THE CROSSCORRELATION SERIES. THIS VECTOR 0056 IS SET TO ZERO BEFORE COMPUTATIONS ARE MADE. 0057 0058 EXAMPLES 0059 1.,2.,3. LY=2 Yll ••• 2l • 2.,1. (') 0060 1. INPUTS - LX=3 XIl ••• 31 .1,.1,.1,.1,.1 0061 LC=5 CIl ••• 5) 0062 4.,1.,6.,0.,0. Cll ••• 51 OUTPUTS 0063 SAME AS EXAMPLE 1. EXCEPT lC=2 0064 2. INPUTS 0065 OUTPUTS - CIl ••• 51 = 4.,1.,.1,.1 •• 1 0066 0067 3. INPUTS SAME AS EXAMPLE 1. EXCEPT LC=O 0068 OUTPUTS - CIl ••• 5) = .1,.1,.1 •• 1,.1 0069 0070 4. INPUTS - SAME AS EXAMPLE 1. EXCEPT LX=O 0071 OUTPUTS - Cll ••• 5) = 0.,0.,0.,0.,0. 0072 0013 SAME AS EXAMPLE 1. EXCEPT LY=O 5. INPUTS - • •••••••••••••••••••••••• •••••••••••••••••••••••• • CROSS • PROGRAM 1I STINGS •••••••••••••••••••••••• IPAGE OUTPUTS - Cl1 ••• 51 • CROSS •••••••••••••••••••••••• 21 C • ••••••••••••••••••••••• • (PAGE 0.,0 ... 0.,0.,0. C PROGRAM FOLLOWS BELOW 0074 0075 0076 C 0077 C 10 15 20 30 DIMENSION XI21,YI21,C(21 IF I LC I 30,30,10 CALL STZ ILC,CI IF IXMINOFILX,LYII 30,30,15 LC1=XMINOFILX,LCI DO 70 I=1,LC1 CALL FOOT IXMINOFILY+I-1,LXI-I+1,XIII.Y,CIIII RETURN END 0078 0079 0080 0081 0082 0083 0084 0085 0086 21 •••••••••••••••••••••••• • CROST • PROGRAM LISTINGS •••••••••••••••••••••••• 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 C C C C C C C CROST • • ••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0098 0001 0002 0003 0004 0005 ----ABSTRACT---0006 0007 fI TLE - CROS T 0008 0009 CROSSCORRELATION OF TRANSIENTS BEGINNING WITH ANY LAG 0010 CROST FINDS LC TERMS OF THE CROSSCORRELATION CIJ) Of TWO 0011 TRANSIENTS XII) AND YII) OF LENGTH LX AND LY RESPECTIVELY 0012 0013 BEGINNING WITH ANY LAG K 0014 LX 0015 0016 C(JI SUM I XII) • YII-J) I 0017 1=1 0018 0019 FOR J ~ K, •••• K+LC-1 0020 WHERE THE COMPUTATION IS MADE AS THOUGH X AND Y HAD ZEROS 0021 0022 EXTENDING BEYOND BOTH ENDS. 0023 0024 LANGUAGE - FORTRAN II SUBROUTINE 0025 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0026 STORAGE - 134 REGISTERS 0027 SPEED 0028 AUTHOR - R.A. WIGGINS 0029 0030 ----USAGE--0031 0032 TRANSFER VECTOR CONTAINS ROUTINES - CROSS, REVERS 0033 AND FORTRAN SYSTEM ROUTINES - NONE 0034 0035 FORTRAN USAGE 0036 CALL CROST ILX,XX,LY,YY,K,LC,CCI 0037 0038 INPUTS 0039 0040 IS LENGTH OF XX. LX 0041 IF LSTHN 1 NO COMPUTATION IS MADE. 0042 0043 I=l, ••• ,LX CONTAINS XIll, ••• ,XILXI AS OESCRIBED IN THE XXI II 0044 ABSTRACT. 0045 0046 IS LENGTH OF YY. LY 0047 IF LSTHN 1 NO COMPUTATION IS MADE. 0048 0049 YYI I) l=l, ••• ,LY CONTAINS Ylll, ••• ,YILYI AS DESCRIBED IN THE 0050 ABSTRACT. 0051 0052 K IS THE INITIAL LAG. 0053 0054 IS THE NUMBER OF LAGS WANTEO. LC 0055 IF LSTHN 1 NO COMPUTATION IS MADE. 0056 0057 OUTPUTS 0058 0059 I=l, ••• ,LC CONTAINS CIK1, ••• ,CIK+LC-ll AS DESCRIBED IN CC I I I 0060 THE ABSTRACT. 0061 0062 EXAMPLES 0063 0064 1.,2 •• 3. LY=2 YYll ••• 2) = 2.,1. 1. INPUTS - LX=3 XXll ••• 31 0065 .1,.1,.1,.1,.1 K=O LC=5 CCIl ••• 51 0066 CCll ••• 5) 4.,7 •• 6.,0.,0. OUTPUTS 0067 0068 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT K=2 0069 OUTPUTS - CCl1 ••• 5) = 6.,0.,0.,0.,0. 0070 0071 3. INPUTS - SAME AS EXAMPLE 1. EXCEPT K=-2 0072 OUTPUTS - CCl1 ••• 51 = 0.,1.,4.,7.,6. 0073 0074 4. INPUTS - LX=2 XXl1 ••• 21 = 2.,1. LY=3 YYIl ••• 3) = 1.,2.,3. • CROST (SUBROUTINE) 9/29/64 • LABEL CCROST SUBROUTINE CROST (LX,XX,LY,YY,K,LC.CC) C C •••••••••••••••••••••••• • -......... ... .............. •••••••••••••••••••••••• PROGRAM LISTINGS IPAGE •••••••••••••••••••••••• I PAGE 21 C C LC=5 OUTPUTS - CCll ••• 51 CCIl ••• 51 .1,.1,.1,.1,.1 K=-2 6.,1.,4.,1.,0. C C 5. INPUTS C OUTPUTS C C 6. INPUTS C OUTPUTS - •••••••••••••••••••••••• CROST CROST SAME AS EXAMPLE 4. EXCEPT LX=O CCI1 ••• 5) = 0.,0.,0.,0.,0. SAME AS EXAMPLE 4. EXCEPT LY=O CCll ••• 51 = 0.,0.,0.,0.,0. C C 7. INPUTS - SAME AS EXAMPLE 4. EXCEPT LC=O C OUTPUTS - CCll ••• 5) - .1,.1,.1,.1,.1 C C PROGRAM FOLLOWS BELOW C DIMENSION XXI21,YYI21,CCI21 II-XMAXOFIl,-K-LC+ll LCl=XMINOFILC,-K) CALL CROSS ILY-Il,YYII1+1),LX,XX,LC1,CCI CALL REVERSILC1,CCI Il=XMAXOFIO,K)+1 12-XMAXOFll,LC1+ll CALL CROSS ILX-11+1,XXII11,LY,YY,LC-12+1,CC(121) RETURN END 0015 0016 0077 007B 0079 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 2) • ••••••••••••••••••••••• .•••••••••••••••••••••••• CRSVM • PROGRAM LI STINGS -..•......•............. .. CRSVM * CRSVM ISUBROUTINE) 9/10/64 LAST CARD IN DECK IS NO. • LABEL CCRSVM SU8ROUTINE CRSVM INRAC.NCAR8.NCBC,LAA.AA.L88.88,ZFN8TR, 1 IFSTLG.LCC.CC) C C ----A8STRACT---C C TITLE - CRSVM C CROSSCORRELATION OF TRANSIENT VECTORS OF MATRICES. C C CRSVM FINDS LCC TERMS OF THE TRANSIENT ~ROSSCORRELATION C OF A VECTOR OF NRAC X NCAR8 MATRICES All) WITH A C VECTOR OF NCAR8 X NC8C MATRICES (AFTER TRANSPOSITION) C 81K) BEGINNING WITH A FIRST LAG IFSTLG C INF C ( AI I ).B( I-J I CIJ) SUM C C I=-INF OR C INF C C (J) SUM C AI Il"BII-J) I=-INF C C C FOR J = IFSTLG,IFSTLG+1 ••••• IFSTLG+LCC-l C C C WHERE INF INFINITY. RII) = 8(11 TRANSPOSE, AND THE C ASSUMPTION IS MADE THAT THE VECTORS ARE ZERO BEYONO THE C RANGE OF DEFINITION. C C LANGUAGE - FORTRAN II (SUBROUTINE) C EQUIPMENT - 709. 7090. OR 7094 IMAIN FRAME ONLY) C STORAGE - 327 REGISTERS C SPEED LET M03TIMINRAC.NCARB.NCBC.LAA) TIME FOR MDOT3 C TO FINO THE DOT PRODUCT OF 2 SERIES OF LENGTH LAA. C THEN TI~E FOR ONE LAG OF A CROSS CORRELATION IS C (M03TIMINRAC.NCAR8.NCBC.LAA) C + .00085 - MD3TIMl1,1.1.1)) SECONDS C ON THE 7094 MOD 1 • C FOR THE 3/63 VtRSIONS OF MDOT3 AND MATML3 THIS C BECOMES C (.000036*NRAC*NCARB*NCBC + .000170"NRAC*NCBC C + .000040*NCBC + .000024) * LAA + .00010 SECONDS. C THUS THE TI ME FOR HALF OF MXLAGS LAGS OF AN C AUTOCORRELATION OF A SERIES OF LENGTH LAA C WILL RE" ABOUT C 1.000036"NRAC*NCARB*NC8C + .000170*NRAC*NC8C C + .000040.NCBC + .000024) C .. IILAA.ILAA-MXLAGS»)/2 + .00010) • MXLAGS SECONDS. C AUTHOR - R.A. WIGGINS AUGUST. 1964 C C ----USAGE---C C TRANSFER VECTOR CONTAINS ROUTINES - MDOT3. SETKS. STZ C AND FORTRA~ SYSTEM ROUTINES - (NOT ANY) C C FORTRAN USAGE C CALL CRSVM INRAC.NCARB.NC8C,LAA,AA.LB8.88.ZFN8TR,IFSTLG,LCC.CC) C C INPUTS C C NRAC NUMBER OF ROWS IN THE AA AND CC MATRICES. C MUST EXCEED ZERO. C C NCARB NUMBER OF COLUMNS IN THE AA MATRICES. NUMBER OF ROWS C (AFTER TRANSPOSITION) IN THE B8 MATRICES. C MUST EXCEED ZERO. C C NCBC NUMBER OF COLUMNS IN THE BB AND CC MATRICES. C MUST EXCEED ZERO. = C C C LAA .. • ••••••••••••••••••••••• NUMBER OF NRAC X NCAR8 MATRICES AA. MATRIX ELEMENTS IN THE VECTOR OF 0219 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 O~B 0069 0070 Q071 0072 0073 •••••••••••••••••••••••• • CRSVM * •••••••••••••••••••••••• (PAGE •••••••••••••••••••••••• PROGRAM LISTINGS • CRSVM 2) IPAGE MUST EXCEEO ZERO. C C C C C C AA I I) l=l, ••• ,NRAC.NCARB*LAA CONTAINS THE VECTOR OF MATRICES Al11, ••• ,AILAAI STORED CLOSELY SPACED BY COLUMNS. LBB NUMBER OF NCARB X NCBC MATRICES BB. MUST EXCEED ZERO. BB(I) I=l, ••• ,NCARB*NCBC*LBB CONTAINS THE VECTOR OF MATRICES BI11 •••• ,BILBBI STORED CLOSELY PACKED 8Y COLUMNS IIF ZFNBTR=O.I OR BY ROWS (IF IFN8TR=1.). ZFNBTR =0. I MPLI ES THAT THE MATRICES IN COLUMNS. =1. I MPLI ES THAT THE MATR ICES IN ROWS. C C C C C C C C C C C C C MATRIX ELEMENTS IN THE VECTOR OF 88( I) ARE STORED BY B8(1) ARE STORED BY IFSTLG INDEX OF THE FIRST LAG OF THE CROSSCORRELATION. LCC NUMBER OF LAGS OF THE CROSSCORRELATION TO BE COMPUTED. MUST EXCEED ZERO. C C C C C OUTPUTS C STRAIGHT RETURN WITH NO COMPUTATIONS IF LAA, LBB, OR LCC LSTHN= O. C C C C CCIII C C C C C EXAMPLES C C 1. INPUTS C C C C NRAC, NCARB, NCBC, l=l •••• ,NRAC.NCBC*LCC CONTAINS THE CROSSCORRELATION VECTOR OF MATRICES CIIFSTLGI ••••• C(IFSTLG+LtC-l) AS OEFINED IN THE ABSTRACT STORED CLOSELY SPACED 8Y COLUMNS. - NRAC=l NCAR8=2 NCBC=3 LAA=4 AAll ••• 8)=(1.,2.),13 •• -2.),15 •• -4.1.ll.,-I.) LBB=2 BBIl ••• 12)=( 3., 4 •• 1.) (-2 •• -2., 4.) I 2 •• 3 •• -1.). (-3 •• 2 •• -5.) INOTE THAT B8 IS STORED AS I 8Bll ••• 12)=3.,2.,4.,3.,1.,-1.,-2.,-3.,-2.,2.,4.,-5. ZFN8TR=0. IFSTLG=-2 LCC=1 OUTPUTS - CCl1 ••• 211= (0,0,01, 1-8.,2.,-6.), 1-1.,0 •• 21.), 17 •• -12.,45.1, 18.,4.,18.1, 11.,1 •• 2.), (0.0,0) C C C C C C 2. INPUTS C - SAME AS EXAMPLE 1. EXCEPT ZFN8TR=1. THIS CAUSES CRSVM TO SEE THE ARRAY 8B(I) AS 3 X 2 MATRICES BB(1 ••• 121=(3 •• 3.1 1-2., 2.) 12., 1.1 (-3 •• 4.) 14 •• -1.1. 1-2.,-5.) OUTPUTS - CCll ••• 211= (0,0,01, 12.,5.,-12.1. 1-1.,-13.,6.1, 1-15.,-21.,24.), (-1.,-1.,27.), (0.,1.,5.), (0,0,0) C C C C C C C C C PROGRAM FOLLOWS BELOW C C C C DUMMY OIMENSION DIMENSION AA(2),BBI2),CCI21 C C BRING IN PARAMETERS AND SET SOME USEFUL COMBINATIONS C CALL SETKS INRAC.N, NCARB,M, NCBC,L, LAA,LA, LBB,LB. 1 IFSTLG,K. LCC,LC, 1,ICCI NM=N*M NL=N*L ML=M*L C C LEAVE IF ANY VALUES ILLEGAL C 10 C IF IXMINOFIN,M,L,LA.LB,LCII CONTINUE * •••••••••••••••••••••••• 100,100,10 0074 0015 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 2) •••••••••••••••••••••••• - PROGRAM LISTINGS • CRSVM •••••••••••••••••••••••• (PAGE •••••••••••••••••••••••• -• CRSVM 3) C CLEAR THE OUTPUT AREA C CALL STI IlC-Nl,CC) C C IF NEGATIVE LAGS ARE SPECIFIED 00 THESE FIRST C 20 IF IK) 20,50,50 CONTINUE C C SET UP MDOT3 CONTROL PARAMETERS C IS IS IS IS IS IC ICC LCM IB IBB C C C C C C IC ICC LCM IB IBB MATRIX VECTOR MATRIX MATRIX VECTOR INDEX -1 OF NEXT OUTPUT INDEX OF NEXT OUTPUT NO. OF PRODUCTS TO COMPUTE INDEX -1 OF BB FOR NEXT PRODUCT INDEX OF BB FOR NEXT PRODUCT XMAXOFIO,-K-LB+1) IC-NL+1 XMINOF{-K,LB-1,LC-IC) XMINOF{-K,LB-l) IB-ML+l C C IF THERE ARE NO PRODUCTS, LEAVE (PAGE 0149 0150 0151 0152 0153 0154 0155 0156 0157 015B 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 C 30 IF ILCM) CONTINUE 100,100,30 C C COMPUTE THE NEGATIVE LAGS C 40 00 40 1=I,LCM CALL MDOT3 IN,M,L,XMINOFIlB-IB,LA),AA,BBIIBB),IFNBTR,CCIICC),l) IB=IB-l IBB=IBB-ML ICC=ICC+NL C C ADJUST K AND LC FOR POSITIVE LAG COMPUTATION C 50 LC=LC+K K=O CONTINUE C C SET UP MDOT3 CONTROL PARAMETERS C C C C IS IS IS IS LCM IA IAA ICC C MATRIX MATRIX VECTOR VECTOR NO. OF PRODUCTS TO COMPUTE INDEX -1 OF AA FOR NEXT PRODUCT INDEX OF AA FOR NEXT PRODUCT INDEX OF NEXT OUTPUT IALREADY SETI C lCM lA I AA XMINOF ILA-K,lC-K) = K = I A-NM+l C C LEAVE IF THERE ARE NO PRODUCTS C 60 IF ILCM) CONTINUE IDO,100,60 C C COMPUTE THE POSITIVE LAGS C 00 70 l=l,LCM 70 CALL MDOT3 IN,M.l,XMINOFILA-IA,lB).AAIIAAI,BB,IFNBTR,CCIICC),l) IA=IA+l IAA= IAA+NM ICC=ICC+Nl C C THAT'S ALL C 100 CONTINUE RETURN END - ••••••••••••••••••••••• 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 01B4 01B5 0186 01B7 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 020B 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 3) .•••••••••••••••••••••••• . CSOUT •••••••••••••••••••••••• . . it • .. .•. ... • .. .. .. .. .. •.. .. .. . .. .. .... .. • ... .. .. ... .... ... ...• .. •. . ". .. •.. .. .. .. ... .. .." • .. .. . ** •••• .•••••••••••••••••• .. CSOUT •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0126 0001 0002 COUNT 150 0003 LBL CSOUT 0004 ENTRY CSOUT (ITAPE.NSPACE.Cl.C1NAME,C2.C2NAME ••• J 0005 0006 0001 ----ABSTRACT---0008 0009 0010 T[ TLE - CSOUT CONSTANTS OUTPUTTED IN fIXED fORMAT 0011 0012 CSOUT WRITES A LIST OF VARIABLES AND THEIR NAMES ON A 0013 LOGICAL TAPE ACCORDING TO A fIXED fORMAT WITH INITIAL 0014 SPACING (OR PAGE RESTORE). 0015 0016 - fAP SUBROUTINE (fORTRAN-II COMPATIBLE) 0011 LANGUAGE EQUIPMENT - 109 OR 1090 IMAIN fRAME PLUS ONE TAPE UNIT) 0018 STORAGE - 49 REGISTERS 0019 SPEED 0020 AUTHOR - R.A. WIGGINS. JULY. 1964 0021 0022 0023 ----USAGE---0024 0025 TRANSfER VECTOR CONTAINS ROUTINES - CARIGE, HRADJ 0026 AND fORTRAN SYSTEM ROUTINES - ISTH1,(fIL) 0027 0028 FORTRAN USAGE 0029 CALL CSOUT IITAPE.NSPACE,C1.CINAME,C2.C2NAME ••••• CN,CNNAME) 0030 0031 0032 INPUTS 0033 0034 ITAPE IS LOGICAL TAPE NUMBER OF DESIRED OUTPUT TAPE. 0035 0036 IS DESIRED NUMBER (MAY BE ZERO) OF SPACES BEFORE ANY 0037 NSPACE OUTPUT. IF NEGATIVE AN INITIAL PAGE RESTORE OCCURS • 0038 0039 0040 Cl.C2 ••••• CN ARE THE FIXED OR FLOATING POINT VARIABLES TO BE PRINTED. 0041 0042 CINAME.C2NAME, ••• ,CNNAME ARE THE HOLLERITH NAMES OF Cl,C2, •••• CN 0043 RESPECTIVELY IN FORMATIA6) OR IA5) OR ••• IAI). 0044 0045 0046 OUTPUTS 1. NSPACE SPACES OR A PAGE RESTORE OCCURS 0047 2. THE VARIABLES AND THEIR NAMES ARE WRITTEN AS THEY 0048 WOULD BE BY THE FORTRAN STATEMENTS 0049 0050 WRITE OUTPUT TAPE ITAPE, 10, C1NAMR.Cl.C2NAMR.C2, 0051 1 ••• , CNNAMR.CN 0052 10 FORMAT(S(2XA6,3H = GI4.1)) 0053 0054 WHERE CNNAMR = HRAOJFICNNAME) • 0055 0056 0057 EXAMPLES 0058 0059 0060 1. INPUTS - Cl=l. CINAME=3HONE C2=2 C2NAME=3HTWO 0061 ITAPE = 2 NSPACE = 2 USAGE CALL CSOUT (ITAPE.NSPACE.Cl.CINAME.C2,C2NAME) 0062 OUTPUTS - THE FOLLOWING 3 LINES 0063 0064 0065 ONE = 1.0000000 TWO = 2 0066 WILL BE PRINTED OFF LINE FROM LOGICAL TAPE 2 IUNDER 0067 PROGRAM CONTROL) • 0068 0069 0070 2. EXAMPLE WITH LITERAL ARGUMENTS. THE LAST ARGUMENT IS IGNORED SINCE 0071 IT HAS NO NAME. USAGE CALL CSOUT{2,1,.01,lHX,5) 0072 0073 OUTPUTS - THE FOLLOWING 2 LINES 0074 •.CSOUT .... CSOUT (SUBROUTINE) FAP PROGRAM LISTINGS 9/4/64 ** •••••••••• .•••••••••••• CSOUT - PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE .. .. ..- CSOUT (PAGE x = 0.1000000E-Ol WILL BE PRINTED OFF LINE FROM LOGICAL TAPE 2 (UNOER PROGRAM CONTROL). PROGRAM FOLLOWS BELOW HTR BCI CSOUT SXD CtA STA CLA STA TSX ITAPE TSX NSPACE TSX LXD CLA" TSX PZE LXD TRA LOOP CLASXD TSX LXD XC.A STR LOOSTR LKAHD CAL ANA LAS TRA TRA SXO EXIT TSX LXO TRA Al CAL ANA LAS TRA TIX TIX XR4 .-..TSXCONSTANTS TSX FORMAT BCI END .. •••••••••••••••••••••••• 21 .. •••••••••••••••••••••••• .. o l.CSOUT XR4,4 1,4 ITAPE 2,4 NSPACE $CARIGE,4 ... ,0 .*,0 XR4,4 1,4 $( S TH),4 FORMAT"l XR4,4 LKAHO 2,4 XR4,4 SHRAOJ ,4 XR4,4 STORAGE REGISTER FOR IR 4 SAVE IR4 AND USE CARIGE TO _MAKE THE INITIAL SPACES. RESET IR 4 AND -GO INITIAliZE (STH). (1 IN DECREMENT INDICATES THAT RESET IR 4 IS STORED IN THE REVERSE AND GO CHECK. OF THE NORMAL ORDER) GET NEXT NAME AND RIGHT ADJUST IT. PUT IN MQ -AND FEED IT TO (IOHI. 1,4 GET NEXT VARIABLE AND FEED IT TO (IOH). 3,4 THEN CHECK IF =0111111100000 NEXT ARGUMENT (VARIABLE) TSX IS TSX ,0 IT IS NOT -+2 Al JT IS, GO CHECK NEXT ARGUMENT. XR4,4 IT IS NOT, PREPARE TO LEAVE $(FllI,4 -GO ROUND-OUT (STH). XR4,4 AND 3,4 -RETURN 4,4 CHECK NEXT ARGUMENT (NAME) =0171177100000 FOR TSX TSX ,0 FORM. -+2 IT I S NOT. LOOP,4,2 IT IS, BUMP IR4 AND GO WRITE EXIT,4,1 IT IS NOT, BUMP IR4 AND PREPARE TO RETURN. 0,0 4,(5(2XA6,3H G14.1») 0015 0016 0011 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 2) •••••••••••••••••••••••• . PROGRAM LISTINGS CUFITI ••••••••••••••••••••••••" .. .. " " " . " ." • .. " •" •" "• " .. " . " " •" • • • " •" •" • .. "" .. • "" .. "• .. .. •. .. " ". ." • • .. • .." • •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0325 0001 0002 0003 0004 0005 0006 0007 0008 ----ABSTRACT---0009 0010 TITLE - CUFITl FIND CUBIC WHICH EXACTLY FITS 4 EQUALLY SPACED POINTS 0011 . 0012 CUFIT1 FINDS CO,Cl,C2, AND C3 SUCH THAT THE CUBIC 0013 0014 POLYNOMIAL 0015 2 3 FIX)= CO + Cl"X + C2.X + C3.X 0016 0017 0018 TAKES ON SPECIFIED VALUES AT 4 EQUALLY SPACED VALUES OF X, NAMELY AT XLO, XLO+DELX, XLO+2.DELX AND XLO+3.DELX, 0019 WHERE XLO AND DELX ARE PARAMETERS • 0020 0021 0022 CUFITI HAS TWO AUTOMATIC HI SPEED BYPASSES, ONE E~FECTIVE 0023 IN CASES WHERE XLO=-3 AND DELX"'+2, THE OTHER APPLYING 0024 TO REPEATED CALLS OF CUFITl WITH IDENTICAL VALUES OF XLO 0025 AND DELX. 0026 0027 - fAP SUBROUTINE IFORTRAN-II COMPATIBLE) LANGUAGE 0028 EQUI PMENT - 709 OR 7090 IMAIN FRAME ONLY) 0029 STORAGE - 158 REGISTERS 0030 ON 709 , ON 7090 SPEED 0031 1. GENERAL. 614MC"'7.37MS, 545MC-l.19MS 2. REPEAT CALL IN GENERAL 0032 WITH SAME XLO, DELX. 496MC"'5.95MS, 445MC=.970MS 0033 0034 3. CASE IN WHICH XLO '" -3 0035 AND DELX '" 2 • 290MC=3.48MS, 268MC=.584MS 0036 WHERE MC = MACHINE CYCLES, MS" MILLISECONDS. 0037 0038 0039 - S.M. SIMPSON, MARCH 1964 AUTHOR 0040 0041 0042 ----USAGE---0043 0044 TRANSFER VECTOR CONTAINS ROUTINES - INOT ANY) 0045 AND FORTRAN SYSTEM ROUTINES - INOT ANY) 0046 0047 FORTRAN USAGE CALL CUFITIIFOFX,XLO,DELX,COEFS) 0048 0049 0050 0051 INPUTS 0052 0053 FOFXII) 1=1 ••• 4 CONTAINS THE VALUES THAT THE POLYNOMIAL 0054 MUST ASSUME, AS DETAILED BELOW 0055 0056 IS DEFINED IN THE ABSTRACT XLO 0057 0058 DELX SHOULD NOT 8E lERO IS DEFINED IN THE ABSTRACT. DELX 0059 BUT MAY BE NEGATIVE • 0060 0061 0062 OUTPUTS STRAIGHT RETURN WITH NO OUTPUTS IF 4FELX"'O • 0063 0064 COEFSII ) 1=1 ••• 4 WILL CONTAIN CO,Cl,C2,C3 DETERMINED SO THAT 0065 THE POLYNOMIAL FIX) GIV~N IN THE ABSTRACT WILL SATISFY 0066 FIXLO) FOFX 111 0067 FOFX(2) FIXLO+OELX) 0068 F1XLO+2*DELX) '" FOFX(3) 0069 FOFX(4) FIXLO+3*OELX) 0070 0071 0072 EXAMPLES 0073 0074 2.,4.,10.,26. XLO=-l. DELX"'I.0 1. INPUTS - FOFXll ••• 4) 9/4/64 " CUFITI I SUBROUTINE) .. FAP .CUFITl COUNT 300 LBL CUFIT1 ENTRY CUFIT1 IFOFX,XLO,DELX,COEFS) • • •" _..........•............ CUF ITl • " ••••••••••••••••••••••• .. ..••••••••••••••••••••••••• CUFIT1 CPAGE PROGRAM LISTINGS .•••••••••••••••••••••••• . CUFIT1 • •••••••••••••••••• * •••• 2) .. .. .. IPAGE USAGE CALL CUFIT1CFOFX,XLO,DELX,COEFS11 CALL CUFIT!CFOFX,XLO,DELX,COEFS2) OUTPUTS - COEFS1C1 ••• 4) = COEFS2(1 ••• 4) = 4.0,3.0,2.0,1.0 . .. 2. INPUTS - FOFX(1 ••• 4) = -14.,2.,10.,58. XLO=-3. DELX=2.0 .. COEFS4(1 ••• 4) = -99.,-99.,-99.,-99. .. USAGE CALL CUFITICFOFX,XLO,DELX,COEFS3) .. CALL CUFITl(FOFX,XLO.0.O,COEFS4) .. OUTPUTS - COEFS3C1 ••• 4) = 4.0,3.0,2.0,1.0 .. COEFS4C1 ••• 41 = -99.,-99 •• -99.,-99. . .. 3. INPUTS - FOFXll ••• 4) = 2.0.3.0.4.0,5.0 XLO=2.0 DELX=1.0 USAGE CALL CUFIT1CFOFX,XLO,OELX,COEFS5) .. .. OUTPUTS - COEFS5(1 ••• 4) = 0.0,1.0,0.0.0.0 .... . .. PROGRAM FOLLOWS BELOW HTR HTR BCI . .. ONLY ENTRY • ..CUFITI SXD SXD 0 0 l,CUF IT 1 CUFITIIFOFX,XLO,DELX,COEFSI CUFITI-2,4 CUFITI-3,l * • EXIT ON ZERO DELX * 3,4 NZT* TRA LEAVE . .... BRINGCLAIN FM3,FM1,Fl,F3 1,4 CLAF . ... ADD STA AXT CLA STO TlX CLA STA SUB STA SUB STA SUB STA XR1 XR4 DELX AND SET ADDRESSES A(FOFXlll) K1 CLAF 4,1 •• ,1 FM3+1.1 CLAF,l,l 4,4 STOCZ Kl STOC1 Kl STOC2 Kl STOC3 •• =AIFOFXIl)l+l AICOEFSClll .. ISO FAR IT HAS TAKEN ABOUT 29 HI SPEEDS) .. SET TRIAL VALUES OF CO, C1, C2, C3 (FOR XLO=-3.0, DELX=2.0) (C3) 1 .. I-I +3 -3 +11 (FM3) .. (C2) C+3 -3 -3 +3) (FM1) (Cll '.8 (+1 -21 +21 -11 (Ftl .. .. (COl (-3 +21 +21 -31 IF3) . . .. FIRST C3 .. . CLA FSB XCA FMP FSB FAD XCA FMP STOO STO STO FMl Fl K~L FM3 F3 R48 *. C3 .. THEN C2 CLA FM3 ... =A I CDEFS 1-3 0015 0016 0011 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 2) •••••••••••••••••••••••• CUFITl • "•••••••••••••••••••••••• (PAGE PROGRAM LISTINGS 31 FSB FSB FAD XCA FMP STOC2 STO STO "" CLA FSB XCA FMP FAD FSB XCA FMP STOCI STO STO - "• "• •" - "" • *"=AICOEFSI-2 Fl FMl K271 FM3 F3 _. R48 Cl *""AICOEFSI-l FMl Fl K9L FM3 F3 R16 "" **"A(COEFS) Cl NOW WE ARE ALL DONE IN THE CASE THAT XLO " -3.0 AND OELX = 2.0 CLS· CAS TRA TRA TRA CLA. CAS TRA TRA 2,4 K3L CKJUMP "+2 CKJUMP 3,4 K2L CKJUMP LEAVE -XLO NO MAYBE NO OELX NO EX IT (IF XLO=-3 AND DELX*2, THE CHECK TAKES 7 HI SPEEDS, OTHERWISE AVERAGE " 3) OTHERWISE JUMP AHEAO IN THE CASE THAT AND DELX ARE BOTH THE SAME AS LAS T CALL. CLA" LDQ. CAS TRA TRA TRA XCA CAS TRA TRA XCA "" STORE THE " NEW STO •" R16 "" C2 (SETTING THE ABOVE TAKES 19 HI SPEEDS, 12 FAOS, 7 FMPSI • XLO • CKJUMP • FM1 Fl F3 THEN CO CLA FAD XCA FMP FSB FSB XCA FMP STOCl STO STO " (PAGE THEN Cl "" " •••••••••••••••••••••••• CUFITl " "•••••••••••••••••••••••• STQ 3,4 2,4 LASOEl NEW ·+2 NEW LASXLO ·+2 REVISE OELX IN AC XLO IN MQ FIRST CHECK DELX NEW MAYBE OLD NEW CHECK XLO IF MAYBE NEW JUMP AHEAD NEW, RESTORE ACt MQ NEW XLO AND DElX LASOEl LASXLO (TAKES B HI SPEEOS IF JUMP, 7 I F NOT) IN THE GENERAL CASE WE HAVE TO SET THE CONSTANTS 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 01Bl 01B2 01B3 0184 01B5 0186 0187 01BB 01B9 0190 0191 0192 0193 0194 0195 0196 0197 019B 0199 0200 0201 0202 0203 0204 0205 0206 0207 020B 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 3) ••••••• *** •••••••••••••• • - eUFITI PROGRAM LISTINGS - 41 .. • • - eLA FOP STQ FMP STO XCA FMP STO CLS XCA FMP FSB STO FAD S TO FAD STO XCA FMP STO K2L LASOH K K KSQUAR K KCUBE K LASXLO K3L G G TWG G THG G THGSQR ITHESE SETTINGS TAKE 12 HI SPEEDS. 1 FOP. 4 FMPS. 3 FADSI - COMPUTE AND STORE THE REVISED COEFFICIENTS AS FOLLOWS IK .... 3 0 o 0) I(3) IC31 o 0) IC21 13IK--2IG K--2 IC21 K 0) (ClI ICII I3KIGull 2KG It G 11 ICOI ICOI IG--3 G**2 •- REVISE LDQ FMP STOLOQ FMP FAD XCi'< FMP STOLOQ FMP STO LOQ FMP FAD FAD XC" FMP STOLOQ FMP FAD XCA FMP FAD XCA FMP FAO STO- - C3 KCUBE STOC3 C3 THG C2 KSQUAR STOC2 C3 THGSQR TEMP C2 TWG TEMP Cl K STOC1 C3 C2 G Cl G cz SToez IREVISEON TAKES 16 HI SPEEDS, 9 FMPS. 6FADS) - - EXIT LEAVE lXD TRA - el=Cl+GIC1+GIC2+GItC311 G It CUFITI-3,1 5,4 .. CONSTANTS Kl K2L K3L PZE OEe DEC 1 2.0 3.0 It IPAGE K. KSQUAR, KCUBE. G. 2G. 3G. 3GSQR WHERE K 2/DELX G = -K-IXLO+3/KI = -K-XLO-3 • CUFIT1 •••••••••••••••••••••••• •••••••••••••••••••••••• (PAGE •••••••••••••••••••••••• 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 024B 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0213 0274 0275 0276 0217 0278 0279 0280 0261 0262 0283 0284 0285 0286 0287 0286 0269 0290 0291 0292 0293 0294 0295 0296 0297 0298 0299 4) ......................... * • CUFITI PROGRAM 1I STINGS •••••••••••••••••••••••• (PAGE (PAGE 51 K9l K27l RIb R48 DEC DEC DEC DEC * * VARIABLES •F3 Fl FMl FM3 lASXlO lASDEl KCUBE KSQUAR K THGSQR THG TWG G CZ Cl C2 C3 TEMP PIE PIE PZE PIE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PlE PZE PZE PZE END 9.0 27.0 .0625 .020833333 .. , .. ., .. ··f··' .... ··t··t·· ··t··,·· ··t··.·· •• ,--,*. ··.,··f·· ..... , .. ··t··,·· ·*'··f·· ··t··.,·· ··f··,·· .... ,., ..... .. , .. ··f·-'·· .. , ... , .... ··f-·.·· .* •• *.*. ••••••••• * •••••••••••••• CUF I Tl * ••••••••••••••••••••••••• =1116 =1148 NOTE ORDER OF F SEQUENCE IS IMPORTANT K**3 K**2 210ElX 3*(G*.21 3*G 2*G 0300 0301 0302 0303 0304 0305 0306 0307 0308 0309 0310 0311 0312 0313 0314 0315 0316 0317 0318 0319 0320 0321 0322 0323 0324 0325 51 •••••••••••••••••••••••• ..•••••••••••••••••••••••• CVSOUT •••••••••••••••••••••••• .•••••••••••••••••••••••• CVSOUT PROGRAM LISTINGS It It .. CVSOUT tSUBROUTINE) 9/29/64 lAST CARD IN DECK IS NO. .. FAP "CVSOUT COUNT 200 CVSOUT lBl ENTRY CVSOUT IITAPE,NSPACE.FMTHED.FMTLIN.ILO.IHI.ARGlO,ARGDEL, SPACE.Xl,X2 ••••• XNI ." ----ABSTRACT---- " .." .... TITLE - CVSOUT OUTPUT COLUMN VECTORS BY NORMAL OR LITERAL FORMATS . " .. It .." .. LANGUAGE .. .. .. .. .. EQUIPMENT STORAGE SPEED AUTHOR CVSOUT IS A VARIABLE-LENGTH-CALLING-SEQUENCE PROGRAM WHICH OUTPUTS AN ARBITRARY NO. OF VECTORS IN COLUMN FASHION ONTO A SPECIFIED TAPE UNIT. IT PROVIDES A LEFTMOST COLUMN WITH VALUES INCREMENTED BY A SPECIFIED AMOUNT FROM A SPECIFIED BASE. USER SUPPLIES HEADING FORMAT AND LINE FORMAT AS EITHER NORMAL FORMAT VECTORS OR LITERAL ONES • - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) - 109 OR 7090 (MAIN FRAME PLUS ONE TAPE UNIT) - 84 REGISTERS - S.M. SIMPSON JR, SEPTEMBER 1963 ----USAGE---.... TRANSFER VECTOR CONTAINS ROUTINES FORTRAN SYSTEM ROUTINES .... FORTRANANDUSAGE CARIGE,FMTOUT,VECOUT NONE It .. .. .... .. ... ... ... .. ... ...... .. .. .. .. .. 1 CALL CVSOUTtITAPE,NSPACE.FMTHED,FMTLIN,ILO,IHI.ARGlO,ARGDEL, SPACE.Xl,X2, ••• ,XN) INPUTS DEFINE A NORMLIT FORMAT VECTOR AS EITHER Al A NORMAL FORMAT VECTOR • OR B) LITERAL HOLLERITH IN A CALLING SEQUENCE WHOSE CHARACTERS tREADING CONTINUOUSLY FROM LEFT TO RIGHT) ARE THE DESIRED FORMAT STRIPPED OF THE ENCLOSING PARENTHESES. THE FIRST AND SECOND CHARACTERS MUST NOT BE QUOTE ( UNQUOTE DR QUOTE ) UNQUOTE RESPECTIVELY. (TWO 8LANKS FOLLOWED BY I WOULD BE OK.) I TAPE IS DESIRED LOGICAL TAPE NUMBER NSPACE IS DESIRED NO. OF INITIAL SPACES (MAY BE ZERO) BEFORE ANY PRINTING • IF NEGATIVE A PAGE RESTORE OCCURS BEFORE PRINTING • FMTHEDII) 1:1,2, ••• OR 1:1.0.-1, ••• IS A NORMLIT FORMAT VECTOR TO BE PRINTED AS A HEADING FOR THE COLUMNS. FMTLIN(I) 1=1,2, ••• OR 1=1.0.-1, ••• IS A NORMLIT FORMAT VECTOR GIVING THE PRINTING FORMAT FOR A SINGLE LINE OF OUTPUT. THE LIST OF QUANTITIES PRINTED ON A LINE IS ARG(L),XltI).X2II), •••• XN(Il WHERE ARG(L) IS DEFINED BELOW. FMTLIN MUST INCLUDE THE IFLTGI FORMAT FOR ARGILI AS WELL AS FOR THE X VECTORS. it .. ... ... .. ... ILO IS FIRST SUBSCRIPT OF VECTOR RANGE TO BE PRINTED. MUST EXCEED a (NOT CHECKEDI. IHI IS LAST SUBSCRIPT OF VECTOR RANGE TO BE PRINTED. MUST BE GRTHN: ILO INOT CHECKED) • ARGLO INITIAL VALUE OF QUANTITY ARGIL) TO APPEAR IN LEFTMOST COLUMN • MUST BE FLOATING POINT • ARGDEL INCREMENT FOR ARG, FLOATING POINT. ARGIL):ARGLO+IL-I)ttARGDEL WHERE L it it it LINE INDEX • 0220 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0031 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0051 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0013 * ••• - ••••••••• .•••••••••• .. CVSOUT • * ••••• PROGRAM LISTINGS *** ••• ***.******* IPAGE CVSOUT **.*.*****.*******.*.** • 2) ..... ..... ..... ... IPAGE SPACE I I ) l=l ••• N+l IS SCRATCH AREA WHERE N : NO. OF VECTORS. X1 I I ) X2(1) ETC XNI I) I=ILO ••• IHI I=ILO ••• IHI IS FIRST VECTOR, ANY MODE IS SECOND VECTOR, ANY MODE I=ILO ••• IHI ZERO. IS N-TH VECTOR, ANY MOOE. OUTPUTS N MUST EXCEEO THE VECTORS ARE PRINTED COLUMNWISE AS ILLUSTRATED BELOW • .. EXAMPLES . .. 1. USING NORMAL FORMATS .. INPUTS - Xll ••• 10) = 1.1,2.2, ••• ,10.10 IXlI1 ••• 10l = 1,2, ••• ,10 .. IX211 ••• 10) = 2,3, ••• ,11 IX311 ••• 10) = 3,4, ••• ,12 .. FMTHll ••• 6) = 34HI26H ARGX X IX1 IX2 IX3,11) .. FMTLll ••• 31 = 18HIF6.2,F6.1,2x,3I4) .. USAGE DIMENSION SPACE(5) .. CALL CVSOUTI2,3,FMTH,FMTL,4,10,-.03,.01,SPACE,X, .. 1 IXl,IX2,IX31 .. OUTPUTS - THE FOLLOWING 12 LINES ... .. .. .... .. .... . ARGX x IXI IX2 IX3 -0.03 4.4 4 5 6 -0.02 5.5 7 5 6 -0.01 6.6 6 7 8 9 7.7 0.00 7 8 0.01 8.8 9 10 8 0.02 9.9 9 10 11 0.03 10.1 10 11 II WILL BE PRINTED OFF-LINE FROM LOGICAL l (UNDER PROGRAM CONTROLI .. 2. USING LITERAL FORMATS .. INPUTS X,IXl,IX2,IX3 SAME AS IN EXAMPLE 1. .. USAGE CALL CVSOUTIl,3,32Hl6H ARGX X IXI IXl IX3, .. 1 11,16HF6.l,F6.1,lX,3I4,4,10,-.03,.01,SPACE,X, .. 2 lXI, IXl, IX3) .. OUTPUTS - IDENTICAL TO THOSE OF EXAMPLE 1. .... ..... PROGRAM FOLLOWS BELOW TRANSFER VECTOR CONTAINS CAR I GEt FMTOUT, VECOUT HTR o XRl HTR o XR2 XR4 HTR o 1,CVSOUT BCI .. ONLY ENTRY. CVSOUTIITAPE,NSPACE,FMTHED,FMTLIN,ILO,IHI,ARGLO,ARGDEL, SPACE,Xl,X2, ••• ,XNI CVSOUT SXO CVSOUT-2,4 SXO CVSOUT-3,2 CVSOUT-4,1 sxn 1,4 AI ITAPE) Kl CLA STA Cl STA Fl STA VI 2,4 AINSPACE) CLA STA C2 3,4 AIFMTHEO) CLA STA F2 4,4 AIFMTLINI CLA STA V2 9,4 AISPACEI CLA STA V3 STA STO .. SET UP LOOP CONTROLS 6,4 CLA .. IHI TXL2 TO LOOP CONTROL. STD 7,4 ARGLO CLA" 9,4 TO SPACEIlI. STO" .. . *****.*.***.*.********** It 0074 0075 0076 0077 0078 0079 0080 0081 0082 00B3 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 21 •••••••••••••••••••••••• CVSOUT * _ ........... * ...... ...(PAGE _. 3) CLA. POX CLA 5,4 0.2 8.4 STA FAD * OPERATE THE CARRIAGE TSX SCARIGE.4 *.,0 TSX Cl TSX C2 **,0 * AND PRINT THE HEADING TSX SFMTOUT ,4 TSX Fl **,0 F2 TSX *",0 * THEN COUNT THE VECTORS LXO CVSOUT-2.4 AXT 0,1 TXI *+1,4,-9 NXTLIN,4 SXA 1,4 CAL CAL ANA AMASK lAS TSXl TRA TRA *+2 TRA COVER TXI *+1,1,1 CAL,4,-1 TXI * FINISHED TXLl,l COVER SXD TX! *+1,1,1 SXD NPl,1 SXA LEAVE ,4 * SET NEXT LINE OF OUTPUT IN *• PROGRAM LISTINGS ••••••••••••••••••••••• * * CVSOUT * *--•.••••.••••••. _-*---(PAGE ILO TO XR2. AIARGDEll **=A(ITAPEI **=AINSPACEI **=AI ITAPEI **=AIFMTHEDI ISAVE FOR INITIALIZING LOOPI TSX Xl,O TSX X2,0 ••• OONE MORE DONE STORE N, AND N+l. ISAVE FOR EXITING TO 1,4) SPACEl1 ••• N+l) XR4 ACQUIRES VECTOR ADDRESSES • XR2 ACQUIRES VECTOR ELEMENTS IILO TO I HII • XRl STORES IN SPACE VECTOR 12 ••• N+l) 11,4 IS THEN TSX Xl,O) NXTLIN AXT **,4 A XT 1,1 • START LOOP 1,4 CLA CLA ADD Kl TSX XK+l,O H-l STA CLA **=AIXK)+1 * •• 2 STO STO **=AISPACEl **,1 TXI *+1,4,-1 TXI *+1,1,1 TXLl TXL ClA,I,** * GO OUTPUT ONE LINE TSX $VECOUT,4 TSX *.=AI ITAPEl VI ·*,0 V2 TSX ""=AIFMTllNl **.0 V3 TSX **=AISPACEI **to TSX KD1,O 1 NPl,O TO N+l TSX • CHECK FOR MORE AFTER INCREMENTING SPACEll) CLA. V3 **=A 1_~RGDELl FAD FAD ** TNZ SSP STO. V3 *+1,2,1 TXI TXl2 TXL **=IHI NXTLIN.2, ** * EXIT LEAVE AXT **,4 lXD CVSDUT-3,2 CVSOUT-4,1 LXD TRA 1,4 * CONSTANTS, TEMPORARIES 0,0,1 KDl PIE AMASK OCT 717717700000 0,0 TSXZ TSX NPI PZE **=NO. OF VECTORS + 1 0,0,** ENO 0149 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0110 0171 0172 0113 0114 0175 0116 0117 0118 0119 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0191 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 3) •••••••••••••••••••••••• • DADECK • PROGRAM LISTINGS • DADECK • •••••••••••••••••••••••• •••••••••••••••••••••••• • DADECK ISUBROUTINE) • LABEL CDADECK SUBROUTINE DADECK IITPIN.ITPOUT) •••••••••••••••••••••••• 9/1t/64 LAST CARD IN DECK IS NO. 0069 0001 0002 0003 C 0004 C 0005 C ----ABSTRACT---0006 C 0007 C TITLE - DADECK 0008 C LIST DATA DECK AND REPOSITION TAPE TO FRONT OF DECK 0009 C 0010 C DADECK LISTS THE DATA ON TAPE ITPIN FROM THE PLACE WHERE 0011 THE TAPE IS POSITIONED WHEN DADECK IS CALLED TO THE END C 0012 C OF FILE. THE TAPE IS REPOSITIONED BEFORE RETURN IS MADE. 0013 ALL BO COLUMNS OF A CARD WILL BE LISTED. THE OUTPUT C 0014 C FORMAT SPACES ONE COLUMN TO THE RIGHT SO THAT CHARACTERS 0015 IN COLUMN ONE WILL NOT AFFECT THE CARRIAGE CONTROL. THE C 0016 C LISTING IS MADE ON ITPOUT. 0011 C 0018 C DADECK MAKES NO COMMENTS ANO DOES NOT RESTORE THE 0019 CARRIAGE. IF THERE IS NO DATA ON ITPIN. THERE WILL BE NO C 0020 C OUTPUT AT ALL FROM DADECK. 0021 C 0022 C LANGUAGE - FORTRAN II 0023 C EQUIPMENT - 1091109011094 CMAIN FRAME AND TAPE DRIVES) 0024 STORAGE - 100 REGISTERS C 0025 - PROPORTIONAL TO NO. OF DATA CARDS C SPEED 0026 C AUTHOR - J. N. GALBRAITH, JR. AND R. A. WIGGINS 0021 C 0028 C 0029 C ----USAGE---0030 C 0031 C TRANSFER VECTOR CONTAINS ROUTINES - EOFSET,RSKIP 0032 C AND FORTRAN SYSTEM ROUTINES - CTSHl,IRTNl.ISTH).IFIL) 0033 C 0034 C FORTRAN USAGE 0035 C CALL DADECKIITPIN,ITPOUTl 0036 C 0031 C 0038 C INPUTS 0039 C 0040 C ITPIN FORTRAN II INTEGER. LOGICAL TAPE NUMBER OF INPUT TAPE 0041 C ITAPE CONTAINING DATA OECK). 0042 C 0043 I TPOUT C FORTRAN II INTEGER. LOGICAL TAPE NUMBER OF OUTPUT TAPE 0044 ITAPE ON WHICH DATA DECK WILL BE WRITTENl. C 0045 C 0046 0041 C C OUTPUTS 0048 C 0049 PRINTED AS DESCRIBED ABOVE. C 0050 C 0051 C 0052 C PROGRAM FOLLOWS BELOW 0053 0054 C DIMENSION DATA(14) 0055 INUM=O 0056 CALL EOFSETIO,EOF,ITAPE) 0051 IF IEOFl 40,10,40 0058 10 CONTINUE 0059 READ INPUT TAPE ITPIN,20,{DATAIIl,I=1,14l 0060 20 FORMATI13A6,A2l 0061 0062 WRITE OUTPUT TAPE ITPOUT,30,CDATAII),1=1,14) 30 FORMATI1X13A6,A2l 0063 INUM=INUM+l 0064 GO TO 10 0065 CAll RSKIPIITPIN,-INUM-1.EOF) 40 0066 0061 CALL EOFSET l-l,EOF,ITAPEl RETURN 0068 END 0069 .•••••••••••••••••••••••• . DELTA •••••••••••••••••••••••• .. .. ... .. .. .. ..... .... .... ... ... . .... ...... .... .. ... .... .. .. .. .. .. ... .... .. ... .. ... .... .. ." DELTA (FUNCTIONS) FAP PROGRAM LISTINGS .•••••••••••••••••••••••• .. DELTA •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0140 0001 0002 COUNT 0003 75 LBL DelTA 0004 ENTRY DELTA F(ARG) 0005 ENTRY XDELTA F(ARG) 0006 ENTRY 0007 STEPR F(ARG) 0008 ENTRY XSTEPR F(ARG) STEPL F(ARG) EfliTRY 0009 EfliTRY XSTEPL F(ARGJ 0010 ENTRY STEPC F{ARG) 0011 ENTRY XSTEPC FIARG) 0012 0013 0014 ----ABSTRACT---0015 0016 TITLE - DELTA, WITH SECONDARY ENTRIES XDELTA, STEPR, XSTEPR, STEPL, 0017 XSTEPL, STEPC, XSTEPC 0018 DELTA FUNCTION AND STEP FUNCTIONS, FLOATING AND FIXED POINT 0019 0020 DELTA HAS VALUE EQUAL TO PLUS ZERO UNLESS THE MAGNITUDE 0021 OF ITS ARGUMENT (WHICH MAY BE EITHER FIXED OR FLOATING 0022 POINT) IS ZERO, IN WHICH CASE DELTA HAS VALUE EQUAL TO 0023 1.0 (flOATING) • 0024 0025 XDELTA IS IDENTICAL TO DELTA EXCEPT THAT IT GIVES A 0026 FIXED POINT OUTPUT • 0027 0028 STEPR HAS VALUE EQUAL TO PLUS ZERO UNLESS THE VALUE OF 0029 ITS ARGUMENT (EITHER FIXEO OR FLOATING POINT) EXCEEDS 0030 ZERO, IN WHICH CASE STEPR HAS VALUE EQUAL 1.0 (FLOATING) • 0031 0032 XSTEPR IS IDENTICAL TO STEPR EXCEPT THAT IT GIVES A 0033 0034 FIXED POINT OUTPUT • 0035 STEPL HAS VALUE EQUAL TO PLUS 1.0 UNLESS THE VALUE OF 0036 ITS ARGUMENT tEITHER FIXED OR FLOAITNG POINT) IS LESS 0037 THAN ZERO, IN WHICH CASE STEPL HAS VALUE EQUAL 0.0 (FLTG) 0038 0039 XSTEPL IS IDENTICAL TO STEPL EXCEPT THAT IT GIVES A 0040 FIXED POINT OUTPUT • 0041 0042 STEPC HAS VALUE EQUAL TO ZERO WHENEVER THE SIGN BIT OF 0043 ITS ARGUMENT IS NEGATIVE. OTHERWISE STEPC HAS VALUE 0044 1.0 IFLTG) • 0045 0046 XSTEPC IS IDENTICAL TO STEPC EXCEPT THAT IT GIVES A 0047 FIXED POINT OUTPUT • 004B 0049 LANGUAGE - FAP FUNCTIONS (FORTRAN II COMPATIBLE) 0050 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0051 STORAGE - 17 REGISTERS 0052 SPEED - 6, 8, OR 10 MACHINE CYCLES 0053 AUTHOR 0054 - S.M. SIMPSON, APRIL 1964 0055 0056 0057 ---USAGE---0058 TRANSFER VECTOR CONTAINS ROUTINES - (NOT ANY) 0059 0060 AND FORTRAN SYSTEM ROUTlfIIES - (NOT ANY) 0061 FORTRAN USAGES 0062 Y DELTAFIX) OR DELTAFI IX) 0063 STEPRFt IX) 0064 Y = STEPRFt Xl OR Y = STEPLFIX) OR STEPLFIIXI 0065 0066 Y = STEPCFIXI OR STEPCFI IX) XDELTAFIIX) IY=XDELTAFIX) OR 0067 IY=XSTEPRFtX) XSTEPRF( IX) 0068 OR XSTEPLFI IX) 0069 IY=XSTEPLFIX/ OR 0070 OR XSTEPCFIIX) IY=XSTEPCFIX) 0071 0072 0073 INPUTS 0074 9/4/64 .•••••••••••••••••••••••• . DELTA PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 2) •••••••••••••••••••••••• (PAGE 2) .. X .. IX . .. OUTPUTS .. Y .. .... IY ..... EXAMPLES 1. INPUTS .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .... ..... .... .•••••••••••••••••••••••• . DELTA IS ANY FLOATING POINT NO. IS ANY FIXED POINT NO. AS DESCRIBED IN ABSTRACT AS DESCRIBED IN ABSTRACT - Xl1 ••• 6) = -2., -1., -D., 0., 1., 2. IXll ••• 6) = -2, -I, -0, 0, 1, 2 USAGES DO 10 1=1,6 01111 DELTAFI XII)I 02111 OELTAFIIXIII) 101111 XDELTAFI XIII) 102111 XDELTAFIIXII)) SRlll1 STEPRFI XCI)I SR21I I STEPRFI IX( I) I ISRlIII XSTEPRF( XII)) ISR2111 XSTEPRFIIXII1I SLl111 STEPLF( XII») SL21I1 STEPLFIIXI[)I [SLl 111 XSTEPLF( XII)I ISL21I1 KSTEPLF(IXII)I SCI1I1 STEPCFIKII) SC21I1 STEPCFIIKI[» [SClI II KSTEPCFIXI [) I 10 [SC2(1) XSTEPCF([XII)I OUTPUTS - 0111 ••• 61 = D211 ••• bl = 0 •• 0 •• 1 •• 1., 0., O. 10111 ••• 6) = 10211 ••• 6) " 0, 0, 1, I, 0, 0 SRlll ••• b) = SR2II ••• 61 0., 0., D., D., I., 1. ISRlI 1 ••• 6) = SR2( 1 ••• bl = 0, 0, 0, 0, I, 1 SLlll ••• 61 = SL21l ••• 61 " 0., 0., I., I., I., 1. ISLIII ••• bl = ISL2II ••• 61 = 0, 0, 1, 1, 1, 1 SClI1 ••• bl = SC211 ••• 61 = D., D., 0., I., 1., 1. ISClIl ••• bl = ISC2Cl ••• 61 = 0, 0, 0, I, 1, 1 = PROGRAM FOLLOWS BELOW NO TRANSFER VECTOR 8CI DELTA HE KDElTA TlE GETZ PKD TRA STEPL TZE STEPR TZE STEPC TMI GETlL CLA TRA KSTEPL TZE KSTEPR HE KSTEPC TMI GETI CtA TRA XDI PZE DEC KIL END I,OELTA GETIL GETl 0.0 1.4 GETlL GETZ GETZ KIL 1,4 GETl GETZ GETZ KOI 1,4 0,0,1 1.0 FIRST ENTRY SECOND ENTRY ANOTHER ANOTHER ANOTHER ANOTHER ANOTHER ANOTHER 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 •••••••••••••••••••••••• • DETRM • ••••••••••• **** ••• ****** REFER TO SIMEQ PROGRAM LISTINGS ••••••••••••••••• ** ••• ** • DETRM • ••••••••••• ** ••• ** •• * ••• REFER TO SIMEQ .•••••••••••••••••••••••• ••••••••••••••••••••••••" •••••••••••••••••••••••• PROGRAM L ISTlNGS OERIVA OERIVA "•••••••••••••••••••••••• " .. DERIVA I SUBROUTINE I 9/29/64 .. FAP .DERIVA COUNT 150 LBL DERIVA ENTRY DERIVA IYOFX,LY,DELX.DYDX,YOFXll • • •.. .• ----ABSTRACT---TITLE - DERIVA DERIVATIVE OF A VECTOR BY DIFFERENCI~G 0011 DERIVA FORMS A VECTOR, DYDXIII 1=1 ••• 2Y , REPRESENTING THE DERIVATIVF OF ANOTHER VECTOR, YOFXIII l=l ••• LY , FROM THE DIFFERENCING FORMULAS •" •" " •. . . IYOFXIZI - YOFXIIII/DELX DYDXIKI IYOFXCK+ll - YOFXIK-11/12.0.DELX) FOR K = 2,3 •••• ,LY-l IYOFXCLY) - YOFXILY-l))/DELX WITH MINIMUM LENGTH OF LY =2 THE OUTPUT DYDXl1 ••• LYI MAY REPLACE THE INPUT YOFX. . DERIVA HAS ONE OTHER OUTPUT YOFXl WHICH [T SETS= YOFXCl). USING THIS QUANTITY [T [S POSSIBLE TO INVERT EXACTLY THE DIFFERENTIATED VECTOR DYDX, AND REOBTAIN YOFX. THIS INVERSION IS PERFORMED BY SUBROUTINE [DERIV. WHOSE CALLING SEQUENCE IS THE REVERSE OF THAT OF DER[VA • • •.. ... LANGUAGE .. EQUIPMENT • STORAGE • SPEED - FAP SUBROUTINE IFORTRAN-II COMPATIBLE) - 709 OR 7090 IMAIN FRAME ONLYI - 61 REGISTERS 7090 709 7090 709 168 0101 831 + 139.4 OR 42.6)"LY MACHINE CYCLES - S.M. SIMPSON, AUGUST 1963 .• AUTHOR " TRANSFER VECTOR CONTAINS ROUTINES - INONEI AND FORTRAN SYSTEM ROUTINES - INONE} • 0014 0015 0016 DYDX 111 DYIJXILY) .. • •" 0012 0013 0011 •. .• • LAST CARD IN DECK IS NO. 0159 0001 0002 0003 0004 0005 0006 0001 0008 0009 0010 0031 ----USAGE---- .. FORTRAN USAGE • CALL DERIVAIYOFX,LY,DELX,DYDX.YOFXl) .... . " ..• .• ... • ..• INPUTS YOFXI II 1=1 ••• LY LY SHOULD EXCEED 1 DELX SHOULD BE NON-ZERO OUTPUTS DYDXIII . •. • IS THE VECTOR TO BE DIFFERENT[ATED IMAY BE NEGATIVE) STRAIGHT RETURN WITH NO ACTION IF LY LSTHN 2 OR DELX 1=1 ••• LY IS GIVEN IN ABSTRACT EQUIVALENCEIDYDX,YOFX) IS PERMITTED YOFXl IS SET = YOFXIlI • EXAMPLES ... • • • • ..• •. . 1. 8EHAVIOUR WITH VARIOUS DELX, LY VALUES INPUTS - Yll ••• 51 = 2., 6. , 14., 18. , 18. 04 = FY4 = 05 = FY5 = -999. USAGE CALL DERIVAI Y. 5, 1., 01, CALL DERIVA( Y, 5, -2., 02, CALL DERIVAI Y, 2, I., 03, CAL DERIVAI Y, I, I., 04, CALL DERIVAI Y, 5, 0., 05, 4., 6., 6., 2., o. OUTPUTS - 0111 ••• 51 0211 ••• 51 = -7 •• -3.,-3.,-1.,0. FYlI FY21 FY31 FY4) FY51 001B 0019 0020 0021 0022 0023 0024 0025 0026 0021 0028 0029 0030 0031 0032 0033 0034 0035 0036 O. 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 005B 0059 0060 0061 0062 0063 0064 0065 0066 0061 0068 0069 0070 0071 FYI FY2 2. 2• 0072 0073 0014 .•••••••••••••••••••••••• ••••••••••••••••••••••••" •••••••••••••••••••••••• PROGRAM 1I STINGS DERIVA (PAGE "DERIVA • • •.. • • "• ". 03(1 •• 2) 04 FV4 = .. • ••••••••••••••••••••••• 21 IPAGE =-05 4., 4. FV3 = = FV5 = -999. (NO OUTPUT CASES) 2. 2. MULTIPLE DIFFERENTIATION WITH OUTPUT REPLACING INPUT INPUTS VI1 ••• 6) = 4., 8., 12., 24., 20., 24. USAGE DO 10 1=1,3 10 CALL DERIVAI V, 6, 1., V, FVIIII OUTPUTS - Vl1 ••• 6) 2., 0., -3., 0., 4., 4. FVIl ••• 3) = 4., 4.. O. = " PROGRAM FOLLOWS 8ELOW "" NO TRANSFER VECTOR HTR 0 XR4 BCI 1,DERIVA • ONLY ENTRV. DERIVAIVOFX,LV,DELX,DVDX,VOFX1) DERIVA SXD DERIVA-2,4 • CHECK LV (GRTHN= 2) AND DELX (NON-ZERO) eLA. 2,4 LY TMI LEAVE POX 0,4 TXL LEAVE,4,1 TXI "+1,4,-1 LV-l SXD TXL,4 LXD DERIVA-2,4 CLA" 3,4 DELX HE LEAVE " OK, SETUP STO REC2DX CLA fLP5 FOP REC2DX lIZ"OELX STO REC20X 1,4 CLA AIYOfXl STA GET Kl AIYOFXl-l SUB STA GETl 4,4 AIOYOXI CLA STA STOI AIOYDX)+l ADD Kl STA STORE " FORM DVDX 111 AND VOfX1 CLA. 1,4 STO OLDSTY 5,4 TO VOFXl STO· = AIYOfXl-l GETl CLA "" MIDDlY STO fSB OLDSTY FOP fLP5 FiliP REC2DX •• = AIOVDXl STDt S TO " BYPASS LOOP If LV IS 2 IlY-l IS II LXD TXL,4 TXL UPK1,4,1 PROCEED TO LOOP " OTHERWISE AXT 2.4 K IN XR4 • LOOP TO SET DVDXI2,3 ••• K••• LV-ll .",4 •• AIVOfXl GET LOO OlDSTY CLS OLDSTY STO OLDSTY fAD XCA FiliP REC20X AIDYDXl+l STORE STO ".,4 " CLA MIDDLV LDO OLDSTY STO OLDSTY STO MIDDLY .+1,4,1 UPKI TXI TXL TXL GET,4,"" " .. = LV-l XR4 NOW = LY " NOW SET DYOXILVI. CLA MIDDLY FSB OLOSTY FOP FLP5 fMP REC20X STORE STO" .It ". VOfX(lI VOfXI21 VDfX(2)-VOFX{1) TIMES 1/DELX IS DVDX{ 11 = . VIK+ll-VIK-ll TIMES 1I2DELX IS DVDXIKI VILV)-VILV-lI TIMES I/DELX IS DVDXIL VI 0015 0016 0011 0018 DOn 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 2) •••••••••••••••••••••••• • OERIVA • PROGRAM LI STINGS 3) (PAGE * EXIT LEAVE LXO OERIVA-2,4 6,4 TRA • CONSTANTS, TEMPORARIES FLP5 DEC 0.5 1<1 P ZE 1 REC20X PZE , MIOOLY PZE , OLOSTY PZE END ··w·*,·· ,..... ........ OERIVA • ••••••••••••••••••••••• •••••••••••••••••••••••• IPAGE ..._...................•. • 1/12*OElX) HOLDS YOFXIK) HOLDS YOFXIK-ll INITIAL=YOFX(2) INITIAL=YOFX( 11 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 31 •••••••••••••••••••••••• DIFPRS *................... _ * .... PROGRAM LISTINGS * DIFPRS 'SUBROUTINE) • FAP ·DIFPRS COUNT 100 LBL DIFPRS DIFPRS ( x, LX,XPRSDF) ENTRY XDFPRS (IX,LIX,IXPRSD) ENTRY • * •• • • .• .. • • • .. • • • • * * • .. • .... .. .. • .. .. .. ... •. •" * * * . *. ... ..* .. .. .* • * * • .. .. .. .. .. .. .. .. • . .. •••••••••••••••••••••••• • DIFPRS * •••••••••••••••••••••••• 9/29/64 LAST CARD IN DECK IS NO. 0117 0001 0002 0003 0004 0005 0006 0007 ----ABSTRACT---0008 0009 0010 TITLE - DIFPRS WITH SECONDARY ENTRY XDFPRS 0011 DIFFERE~CE FIXED OR FLOATI~G VECTOR ELEMENTS IN PAIRS 0012 DIFPRS FORMS A FLOATING VECTOR WHOSE ELEMENTS ARE THE 0013 DIFFERENCES OF SUCCESSIVE PAIRS OF THE ELEMENTS OF 0014 ANOTHER FLOATING VECTOR, THE FIRST OUTPUT ELEMENT BEING 0015 SET EQUAL TO THE FIRST INPUT ELEMENT. OUTPUT MAY REPLACE 0016 0017 INPUT. 0018 0019 XDFPRS DOES THE SAME THING FOR FIXED VECTORS. 0020 OIFPRS AND XDFPRS ARE THE EXACT INVERSE OPERATORS OF 0021 0022 SUBROUTINES INTSUM AND XNTSUM RESPECTIVELY. 0023 0024 - FAP SUBROUTINES IFORTRAN-II COMPATIBLE) LANGUAGE 0025 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0026 - 30 REGISTERS STORAGE - DIFPRS 30.6 + 12.4.LX MACHINE CYCLES, 0027 SPEED XDFPRS 37.0 + 8.0.LX LX = VECTOR LENGTH 0028 0029 AUTHOR - S.M. SIMPSON, AUGUST 1963 0030 ----USAGE---0031 (J032 TRANSFER VECTOR CONTAINS ROUTINES - INONE) 0033 ANO FORTRAN SYSTEM ROUTINES - (NONE) 0034 0035 0036 FORTRAN USAGE 0017 CALL DIFPRSI X, LX,XPRSDF) CALL XDFPRSIIX,LIX,IXPRSD) 0038 0039 INPUTS 0040 0041 XII) 0042 l=l ••• LX IS A FLOATING VECTOR INPUT TO DIFPRS 0043 0044 SHOULD EXCEED 0 LX 0045 I=l ••• LX IS A FIXED VECTOR INPUT TO XDFPRS. THE POSITION 0046 I XI I ) 0047 OF THE BINARY POINT IS ARBITRARY. 0048 0049 SHOULD EXCEED 0 LIX 0050 OUTPUTS STRAIGHT RETURN WITH NO OUTPUT IF LX OR LIX LSTHN 1 0051 0052 X(1) 0053 XPRSDFII) I=l ••• LX IS XPRSOFIl) 0054 XI Il XII-1) , I=2 ••• LX AND XPRSDF I I ) 0055 0056 IXPRSDIII l=l ••• LX IS IXPRSD(1) IX(1) 0057 AND IXPRSOI Il IXI I) - IXII-ll , I=2 ••• LX 0058 WITH SAME BINARY POINT AS IXII). 0059 0060 EQUIVALENCE IXPRSDF,X),IIXPRSD,IX) IS PERMITTED. 0061 0062 EXAMPLES 0063 0064 1. INPUTS - XIl ••• 4) = 1., 3., 6., 10. IXl1 ••• 4) 1,3,6,10 XDF3=0. 0065 USAGE CALL DIFPRSI X,4, XDFl) 0066 CALL XDFPRSIIX,4,IXDF1) 0067 CALL DIFPRSI X,4, Xl CALL DIFPRSI X,l, XDF21 0068 0069 CALL DIFPRSI X,D, XDf3) 0070 OUTPUTS - XDFlIl ••• 4) = 1., 2., 3., 4. IXDFlIl ••• 4J 1,2,3,4 0071 XI1 ••• 4) = 1., 2., 3., 4. XDF2 = 1. C072 XDF3 = O. INO OUTPUT CASE) 0073 0074 2. INPUTS - IXl1 ••• 3) = OCT 000000000001, 000000000003, 000000000006 •••••••••••••••••••••••• DIFPRS • *•••••••••••••••••••••••• IPAGE •••••••••••••••••••••••• * DIFPRS * PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 21 * * • • • USAGE CALL XDFPRSIIX,3,IX) OUTPUTS - IXC1 ••• 3) = OCT 000000000001, 000000000002, 000000000003 PROGRAM FOLLOWS BELOW • NO TRANSFER VECTOR HTR 0 XR4 BCI 1,DIFPRS • PRINCIPAL ENTRY. DIFPRSIX,LX,XPRSDFI DIFPRS CLA FSB SETUP STO SUBTR SXD DIFPRS-2,4 Kl CLA 1,4 A(X) STA GET ADD Kl AIX)+l STA SUBTR CLA 3,4 A(XPRSDF) STA STORE CLA. 2,4 LX TMI LEAVE POX 0,4 TXL LEAVE,4,0 TXI .+1,4,-1 LX-1 TXL LAST,4,0 • LOOP FOR ALL BUT XPRSDFCl) GET CLA •• ,4 •• = AIX) SUBTR NOP FSB •• ,4 OR SUB STORE STO •• ,4 •• = AIXPRSDF) TI X GET ,4,1 • SET XPRSDF 11) LAST LXD DIFPRS-2,4 CLA. 1,4 XII) STO. 3,4 XPRSDFll) • EXIT LEAVE LXD DIFPRS-2,4 TRA 4,4 • SECOND ENTRY. XDFPRSIIX,LIX,IXPRSD) XDFPRS CLA SUB TRA SETUP • CONSTANTS FSB FSB •• ,4 SUB SUB •• ,4 END •• ,4 •• = AIX'+l 0075 0076 0077 0078 0079 0080 00B1 0082 0083 0084 0085 0086 0087 0088 00B9 0090 0091 0092 00.93 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 2) •••••••••••••••••••••••• • DISPUI (709) • PROGRAM LISTINGS •••••••••••••••••••••••• • DISPLA (709) (SUBROUTINE) • FAP .DISPLA (709) COUNT 400 LBL DISPLA ENTRY DISPLA .... • .. • . ...• • .• • .. .. .. .. .. ..... .. .. ... • .. • • .... . • .. • .. • •.. •. • •. • • •.. • • •.. •. ... ..... .. ... to •••••••••••••••••••••••• • DISPLA (109) • •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0473 0001 0002 0003 0004 0005 0006 ----ABSTRACT---0007 0008 TITLE - DISPLA (709) 0009 0010 WRITE HOLLERITH TEXT ON SCOPE 0011 DISPLA PRODUCES TITLES, LABELS, AND LEGENDS FOR SCOPE 0012 DISPLAYS. IT CAN PLOT 64 CHARACTERS IN EITHER LARGE (36 0013 CHARACTERS ACROSS THE SCOPE) OR SMALL 148 LETTERS ACROSS 0014 THE SCOPE) MODES IN EITHER A HORIZONTAL OR VERTICAL 0015 DIRECTION. 0016 0017 0018 LANGUAGE - FAP SUBROUTINE (FORTRAN II COMPATIBLE) EQUIPMENT - 709 (MAIN FRAME AND SCOPE) 0019 STORAGE - 220 REGISTERS 0020 SPEED 0021 AUTHOR - DISPLA IS A CONVERSION BY THE M.I.T. COMPUTATION CENTER OF 0022 THE SUBPROGRAM WRITE AS DESCRIBED IN M.I.T. LINCOLN LAB • 0023 MEMO. NO. 54-0003. THE VERSION HERE IS SLIGHTLY MODIFIED 0024 BY J. GALBRAITH (TO MAKE IT INVARIANT TO USE OR NON-USE OF 0025 STANDARD ERROR PROCEDURE) • 0026 0027 ----USAGE---002S 0029 TRANSFER VECTOR CONTAINS ROUTINES - NONE 0030 AND FORTRAN SYSTEM ROUTINES - (IOHI 0031 0032 0033 FORTRAN USAGE CALL DISPLA 0034 0035 PRINT 10,(LIST) 0036 10 FORMAT (OISCON,FMT) 0037 0038 INPUTS 0039 0040 PRIMARILY WHAT APPEARS ON THE SCOPE IS WHAT WOULD HAVE BEEN WRITTEN BY THE PRINT STATEMENT WHICH FOLLOWS THE CALL DISPLA 0041 0042 STATEMENT. HOWEVER, THE BEGINNING CHARACTERS (CALLED DISCON IN THE ABOVE FORMAT) OF THE FORMAT ARE USED TO CONTROL THE 0043 0044 MODE OF THE DISPLAY. 0045 DISCON IS A VARIABLE LENGTH HOLLERITH FIELD 0046 1. THE FIRST CHAR~CTER IS A CONTROL CHARACTER AND 0047 MUST BE ONE OF THE FOLLOWING 004S 0049 CHARACTER ACTION CAUSED 0050 0051 SAME MODE AND ORIGIN. 0052 + o (ZERO) SAME MODE, DOUBLE SPACE. 0053 (BLANK) 0054 SAME MODE, SINGLE SPACE. 0055 CHANGE FILM FRAME, NEW MODE, 1 0056 NEW ORIGIN • NEW MODE, NEW ORIGIN 0057 2 005S WHER£ MODE REFERS TO THE SIZE OF THE CHARACTERS 0059 0060 AND TO THE DIRECTION OF PLOTTING, AND ORIGIN REFERS TO THE LOCATION OF THE FIRST CHARACTER 0061 0062 OF THE LINE • 0063 IF THIS CHARACTER IS A +,0, OR BLANK, NO OTHER 0064 CHARACTERS ARE USED • 0065 0066 2. THE SECOND CHARACTER CONTROLS THE SIZE OF THE 0067 0068 PLOTTED CHARACTERS • 0069 BIG CHARACTERS (20 BY 28 SCOPE UNITS) 0070 B SMALL CHARACTERS (15 BY 21 SCOPE UNITS) 0071 S 0072 9/29/64 ......... ...............• • . • ••••• ••••••••••••••••• * ~ IPAGE 2) • • • • • • • • • • • • • • • • • • • • • • • •• • • • • • • DISPLA (709) .••..•..••....... ~ 3. THE THIRD CHARACTER CONTROLS THE DIRECTION OF PLOTTING. • H V HORIlONTAL VERTICAL 4. THE LAST SET OF INFORMATION CONSISTS OF TWO 0 TO 4 OIGIT INTEGERS IGRTHN-O, LSTHN 1024) FOLLOWED BY COMMAS. THE FIRST INTEGER INDICATES THE X-COORDINATE AND THE SECOND INTEGER THE YCOOROINATE (IN SCOPE UNITS) OF THE LOWER LEFT CORNER AT WHICH PLOTTING BEGINS. THERE MUST BE NO BLANKS BETWEEN ANY OF THESE CHARACTERS FMT IMMEOIATLY FOLLOWS DISCON IS THE STANDARD FORMAT FOR THE INFORMATION WHICH IS TO BE WRITTEN ON THE SCOPE. SHOULD NOT CALL FOR A LINE LONGER THAN 48 (FOR SMALL) OR 36 (FOR BIG) CHARACTERS. IF A LINE GOES BEYOND THE EDGE OF THE SCOPE, THE END IS WRITTEN BEGINNING AT THE OPPOSITE EDGE. LIST IS THE APPROPRIATE LIST WHICH CORRESPONDS TO FMT. THE FOLLOWING IS A LIST OF THE SPECIAL CHARACTERS AND THEIR OCTAL EQUIVALENTS WHICH OISPLA WILL RECOGNIZE IN ADDITION TO THE STANDARD CHARACTERS. APOSTROPHE INTEGRAL SIGN SUMMATION SIGN APOSTROPHE LOW POINT MIOOLE POINT CAP CUP ARROW RIGHT • • • • • 14 15 16 17 32 35 36 37 52 ARROW LEFT ALPHA THETA PI SMALL SIGMA TAU PHI PSI ..... •••••••••••••••••••••••• PROGRAM LI STINGS ' DISPLA (709) 53 55 56 57 72 75 76 77 • •• • EXAMPLES • • • • • 2. EXAMPLE OF SMALL, HORIZONTAL WRITING ON SAME FILM FRAME. USAGE CALL DISPLA PRINT 20 20 FORMATII0H2SH120.90,25HSMALL, HORllONTAL WRITING) • 1. EXAMPLE OF BIG, VERTICAL WRITING AND CHANGING THE FILM FRAME. CAll DISPLA • USAGE PRINT 10 • 10 FORMAT(9HIBVI0,10,21HBIG, VERTICAL WRITING) • IPAGE 0073 0074 0075 0076 0011 001B 0019 OOBO 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 • 2) ** •••• ..•••••••••••••••••• .. 01 SPLA (109) * •••• **0****.******* •••• IPAGE 3) ..... . PROGRAM LISTINGS ••• *.**** ••• .*.**.*.***** . 01 SPLA 11091 **************.*.* •• * ••• I PAGE 3) OUTPUTS - ... .. .... ... .... .... .... ... ..... .... .. .... .. ... ... ..... .... .... . ... 3. EXAMPLES OF ALL THE CHARACTERS, SINGLE SPACING AND DOUBLE SPACING IN BOTH BIG AND SMALL • INPUTS - Al1 ••• 631 = OCT 016b60606060,026060606060, ••• 776060606060 USAGE CALL DISPlA PRINT 30, IA( II, 1=1,161 30 FORMAT(10H1BH56,900,16A21 CALL OISPLA PRINT 40, IA(IJ,I=17,32) 40 FORMAT(lH 16A21 CALL DISPLA PRINT 50, IAI I ) ' [=33,48) 50 FORMATI1H016A2) CALL OISPLA PRINT 60, IA(I),I=49,63) 60 FORMAT I 10H2BH56,600, 16A2) AND A SIMILAR SEQUENCE TO PLACE SMALL CHARACTERS IN THE BOTTOM OF THE FRAME • 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 013B 0139 0140 0141 0142 0143 0144 0145 0146 0147 014B 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 e._*.e •• _._ ••••••••• .•••• . •••••••••••••••••• * ••••• ............ * •• _ •••• ".• .,_ • PROGRAM LISTINGS DISPLA (709) (PAGE .. DISPLA (709) 4) .... ... .. .. IPAGE OUTPUTS - .. .... .. ..... .. ... .... .. .... .. . ... .. . .. .... .. .. .. .. .... .. ... .. .. ..... 4. EXAMPLE OF A LINE EXTENDING BEYOND THE EDGE OF THE SCOPE. USAGE CALL DISPLA PRINT 10, IAI I 1,1=1,24) 10 FORMATII0HIBH56,500,24A2) OUTPUTS- !O Cl IE E3 F4 CO 6 7 a 9 :;. :: l. J ' ' ,t it it 5. EXAMPLE OF DISPLAY SPACING UNDER FORMAT CONTROL USAGE CAll DISPLA PRINTBO, IAI0,1=1,63) BO FORMATII0HIBH56.500,16A2/1H 16A2/1H 16A2/1H 16A2) OUTPUTS - it .. ... .. it .. .., U 1 2 3 4 5 6 , + H B C D E F (i J K L ~1 N 0 P "-' T U \\' W . PlE BCI DISPlA CAL ANA TlE 1,DISPlA 1,4 MASK2 NOERR .. .** ••••• * •••• * •••••••• _- ",.,< j' .... d 9 H I Q R ..,. y ... , ? :: ... ., . .:::r ( , f J. ,:.; 8 T tt' 'f CHECK FOR STANDARD ERROR PROCEDURE MASK2=110371000000 ZERO, NO STANDARD ERROR PROCEDURE IT ~ 0112 0113 0114 0175 0116 0111 0118 0179 01BO 0181 0182 0183 0184 0185 0186 0181 0188 0189 0190 0191 0192 0193 0194 0195 0196 0191 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0211 021B 0219 0220 0221 0222 0223 0224 0225 0226 0221 0228 0229 0230 0231 0232 0233 0234 0235 0236 0231 0238 0239 0240 0241 0242 0243 0244 0245 0246 4) ·......................- OISPLA (109) * * •••••••••••••••••••••••• (PAGE 51 NOERR (STVH I WOS ( SVHI 0 TRACE E A5 LP1 LP2 ElP2 A FETCH ( (SII PROGRAM LISTINGS •••••••••••••••••••••••• DISPLA (1091 • * •••••••••••••••••••••••• ((SII CAL NOT ZERO, STANDARD ERROR PRESENT 3,4 STA 1,4 TRA CAL II S II STA 1,4 WTV 1,4 TRA REM REM REM was - WRITE ON SCOPE LOQ *+4 CLA *+2 S(IOHI TRA* MZE .. 3 TRA WOS SXO DISPLA-2,4 SXA OUT+l,1 DUT+2,2 SXA FETCH PZE Z"N. FORMAT WORDS ARE IN l BSS N CLA 1,4 ARS 18 ADO 1,4 STA A POX WOS,l LXD MOOE,2 TSX A,4 FETCH FIRST CHARACTER LXA A5,1 IDENTIFY CONTROL CHARACTER ADO C,l HE 0,1 TlX *-2,1,1 TRA OUT ILLEGAL CONTROL CHARACTER REM TSX CFF,4 TRANSFER IIECTOR TRA NUORG INCR,2 ACL ACL INCR,2 ORGIN ACL ANA MASK STO ORGIN LXD MODE,2 CAL ORGIN WRITE RECORD ACL 6U3L,2 MOVE POINT OF ORIGIN NEXT CHARACTER, MOVE POINT ACL 2R.2 ANA MASK AND STORE SLW POINT TSX FETCH,4 FETCH CHARACTER PAX 5,4 IS IT BLANK SUB BLANK TNZ *+4 CAL POINT ACL 1R,2 TRA E+l LOQ PAT,4 NO. FETCH PATTERN LXA A5,1 00 5 COLUMNS CAL POINT ACL 1D1R,2 NEXT COLUMN, MOllE POINT LXA A1,4 00 1 ROWS ADO lU,2 NEXT ROW, MOVE POINT RC/ .. DO POINT TQP ElP2 PLOT POINT SLW POINT STQ T CPY POINT LOQ T TlX LP2,4,l TlX LPl,l,l COLUMN DONE TRA CHARACTER DONE E REM Z+N NEW WORD LOO •• ,1 ** STQ WORO SXO WCNT tl LXA A7,l SXD CCNT,l LXO CCNT,l LOO WORD (STVHI STORAGE TO Til HOLLERITH PXD (PAGE 0241 0248 0249 0250 0251 0252 0253 0254 0255 0256 0251 0258 0259 0260 0261 0262 0263 0264 0265 0266 0261 0268 0269 0210 0211 0212 0213 0214 0215 0216 0211 021B 0219 02BO 0281 0282 0283 0284 0285 0286 0281 0288 0289 0290 0291 0292 0293 0294 0295 0296 0291 0298 0299 0300 0301 0302 0303 0304 0305 0306 0301 0308 0309 0310 0311 0312 0313 0314 0315 0316 0317 0318 0.319 0320 0321 5) •••••••••••••••••••••••• DISPLA 1709) • ••••••••••••••••••••••••• (PAGE PROGRAM LISTINGS 61 A6 LGL 6 STQ WORD TIX B.1.1 LXD WCNT,l TIX A.1.1 OUT LXD DISPLA-2.4 AXT .·,1 •• ,2 AXT TRA 2.4 B SXD CCNT.l TRA 1.4 REM COMPUTE MODE NUORG TSX FETCH.4 STO T B OR S TSX FETCH.4 H OR V ADO T LRS 1 ARS 4 RND A7 PAX 7.2 SV:4.BV~3.SH:2.BH:l SXD MODE.2 LXA A2.2 COMPUTE ORIGIN R STZ T.2 TSX FETCH.4 CAS TEN !\lOP MODE TXI f, ,-. STO T CLA T.2 A2 ALS 2 ADO T.2 ALS 1 ADO T STO T.2 WCNT TXI R+1 ... • TIX R.2.1 F CLA T-2 ALS 18 ADD T-1 STO ORGIN CCNT TXI TRACE" •• SUBROUTI NE TO CHANGE FILM FRAME CFF CFF 1,4 TRA REM DEC -1,-1,2,-4B.32 CC IS 1,2,0, ," SYN • C PZE 6 SV PZE 8 BV PZE ,,6 SH BH PZE ,,8 SYN • 2R PZE .. 30 SV PZE ,,40 BV 994 PZE SH BH PZE 984 INCR SYN • MZE ,,3 SV MZE ,,4 BV PZE 3 SH BH PZE 4 SYN • 1U PZE 3 .. 21 SV BV PZE 4,,28 SH PZE 1003 .. 3 8H PZE 996,.4 7D1R SYN • 21 SV BV 28 ,,21 SH ,,28 BH 7R SYN • PZE 1015" 1006 SV BV PZE 1012,,1000 SH PZE 18,,1015 • •••••••••••••••••••••••• OISPLA 17091 • •••••••••••••••••••••••• • (PAGE 0322 0323 0324 0325 0326 0327 0328 0329 0330 0331 0332 0333 0334 0335 0336 0337 0338 0339 0340 0341 0342 0343 0344 0345 0346 Ol47 0'l4B 0349 0350 U351 0352 0353 0354 0355 0356 0357 0358 0359 0360 0361 0362 0363 0364 0365 0366 0367 0368 0369 0370 0371 0372 0373 0374 0375 0376 0377 0378 0379 03BO 0381 0382 0383 03B4 0385 0386 0387 0388 0389 0390 0391 0392 0393 0394 0395 0396 61 •••••••••••••••••••••••• • DISPLA (709) PROGRAM LISTINGS * DISPLA (709) ( PAGE 1) 6U3L PZE SYN REM OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT 24,,1012 BH * 30207144014 010427150434 020107422010 070424040000 001303400000 141104416010 303214461303 006047401003 306240405143 376401010177 016306006007 177004020077 002011740201 105054464242 100200401002 77 PSI 16 PHI 75 TAU 74 ( 73 , 0199 0200 72 SMALL SIGMA 71 Z 10 Y 61 X 66 W 65 V 64 U 63 T 62 S 61 I 0202 0203 0204 0205 0206 0201 020B 0209 0210 ORGIN OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OC r OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT PAT OC T MASK OCT MASK2 OCT BLANK BCD TEN DEC WORD ass ass ass T BSS • •••••••••••••••••••••••• •••••••••••••••••••••••• (PAGE •••••••••••••••••••••••• • 021100436010 115114462216 141104414110 124343701052 54 020342502010 020102501010 376111452306 51 115015050336 50 316110442206 41 175014060216 46 45 376020202117 316020600577 44 311004020100 43 42 316101210501 101004020077 41 020100402010 40 040404010020 200401010100 000000400000 000004050434 34 001406000000 33 4000000 000001740000 31 376100402177 30 115014062311 21 376110440201 26 371114460301 25 203174060216 24 115014060242 23 22 203774462266 370221044514 21 020103702010 20 000130340000 203435242343 201003700201 000130340000 000241205000 13 004015442206 015114452236 11 155114462266 10 003610441203 01 111124462260 06 111054261211 05 060241131620 04 105014462266 03 345114462306 02 001027760000 01 175014060216 00 1177001177 170311000000 100000 10 57 PI 56 THETA 55 ALPHA * 0215 53 ARROW LEFT 52 ARROW RIGHT R Q P 0 N M L K J - 0218 0219 0220 0221 0222 0223 0224 0225 0226 0221 37 CUP 36 CAP 35 MIDDLE POINT 0231 0232 ) • 32 LOW POINT I H G F E D C B A + 0234 0235 0236 0231 0238 0239 0240 0241 0242 0243 11 APOSTROPHE 16 SUMMATION SIGN 15 INTEGRAL SIGN 14 APOSTROPHE 0248 12 QUESTION MARK 9 8 1 6 5 4 3 2 1 0 0250 0251 0252 0253 0254 0255 0256 0251 0258 0259 0397 0398 0399 0400 0401 0402 0403 0404 0405 0406 0401 0408 0409 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 0420 0421 0422 0423 0424 0425 0426 0421 0428 0429 0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 0440 0441 0442 0443 0444 0445 0446 0441 0448 0449 0450 0451 0452 0453 0454 0455 0456 0451 0458 0459 0460 0461 0462 0463 0464 0465 0466 0461 0468 0469 0470 0471 1) •••••••••••••••••••••••• • OISPLA (709) . •••••••••••••••••••••••• (PAGE 8) POINT PROGRAM LISTiNGS OISPLA (709) •••••••••••••••••••••••• (PAGE ass END .. •••••••••••••••••••••••• • 0412 0413 81 •••••••••••••••••••••••• - DtSPLA (7090) PROGRAM Ll STINGS •••••••••••••••••••••••• - LAST CARD IN DECK IS NO. 0480 0001 0002 450 0003 DISPLA 0004 DISPLA 0005 0006 ----ABSTRACT---0001 0008 0009 TITLE - DtSPLA (1090) 0010 WRITE HOLLERITH TEXT ON SCOPE 0011 DISPLA PROOUCES TITLES. LABELS. AND LEGENDS FOR SCOPE 0012 DISPLAYS. IT CAN PLOT 64 CHARACTERS IN EITHER LARGE 136 0013 CHARACTERS ACROSS THE SCOPEl OR SMALL 148 LETTERS ACROSS 0014 THE SCOPE) MODES IN EITHER A HORIZONTAL OR VERTICAL 0015 DIRECTION. 0016 0011 001B LANGUAGE - FAP SUBROUTINE (FORTRAN II COMPATIBLE) 0019 EQUIPMENT - 1090 (MAIN FRAME, DATA CHANNEL 0, AND SCOPEI 0020 - 219 REGISTERS STORAGE SPEED 0021 AUTHOR - DISPLA IS A CONVERSION BY THE MIT COMPUTATION CENTER OF 0022 THE SUBPROGRAM WRITE AS DESCRIBED IN M.I.T. LINCOLN LAB 0023 MEMO. NO. 54-0003. 0024 0025 ----USAGE---0026 0021 0028 TRANSFER VECTOR CONTAINS ROUTINES - FRAME 0029 AND FORTRAN SYSTEM ROUTINES - IIOH) 0030 0031 FORTRAN USAGE CALL DISPLA 0032 0033 PRINT 10.ILIST) 10 fORMAT (DISCON,fMT) 0034 0035 0036 INPUTS 0037 PRIMARILY WHAT APPEARS ON THE SCOPE IS WHAT WOULD HAVE BEEN 0038 0039 WRITTEN BY THE PRINT STATEMENT WHICH FOLLOWS THE CALL DISPLA 0040 STATEMENT. HOWEVER, THE BEGINNING CHARACTERS (CALLED DISCON IN THE ABOVE fORMAT) OF THE FORMAT ARE USED TO CONTROL THE 0041 0042 MODE OF THE DISPLAY. 0043 IS A VARIABLE LENGTH HOLLERITH fIELD 0044 01 SCON 1. THE FIRST CHARACTER IS A CONTROL CHARACTER AND 0045 MUST BE ONE OF THE fOLLOWING 0046 0041 CHARACTER ACTION CAUSED 0048 0049 SAME MODE AND ORIGIN. 0050 + SAME MODE, DOUBLE SPACE. 0051 o (BLANK) SAME MODE. SINGLE SPACE. 0052 CHANGE FILM FRAME. NEW MODE. 1 0053 NEW ORIGIN • 0054 NEW MODE, NEW ORIGIN 0055 2 0056 WHERE MODE REFERS TO THE SIZE OF THE CHARACTERS 0057 AND TO THE DIRECTION OF PLOTTING, AND ORIGIN 0058 REFERS TO THE LOCATION OF THE fIRST CHARACTER 0059 0060 OF THE LINE • 0061 IF THIS CHARACTER IS A +,0, OR BLANK, NO OTHER 0062 0063 CONTROL CHARACTERS ARE USED • 0064 2. THE SECOND CHARACTER CONTROLS THE SIZE OF THE 0065 0066 PLOTTED CHARACTERS • 0067 B BIG CHARACTERS 120 BY 28 SCOPE UNITS) 0068 0069 SMALL CHARACTERS 115 BY 21 SCOPE UNITS) S 0070 DISPLA FAP -01 SPLA (7090) COUNT LBL ENTRY . --•.. - • • • • • .. .. • • • • • .• • .. • .. • • •.. • • .. • • ..•.. •. .... ... . ... .. ... ... .. .. ... .. •••••••••••••••••••••••• DISPLA (7090) .. •••••••••••••••••••••••• .. .. (1090) (SUBROUTINE) 9/4/64 •••••••••••••••••••••••• DISPLA (1090) * •................* ......(PAGE •••••••••••••••••••••••• PROGRAM LISTINGS * DISPLA (7090) * •••••••••••••••••••••••• 2) (PAGE 3. THE THIRD CHARACTER CONTROLS THE DIRECTION OF PLOTT ING. * * * • H V * * * * * * 4. THE LAST SET OF INFORMATION CONSISTS OF TWO 0 TO 4 DIGIT INTEGERS (GRTHN=O, LSTHN 1024) FOLLOWED BY COMMAS. THE FIRST INTEGER INDICATES THE X-COORDINATE AND THE SECOND INTEGER THE yCOORDINATE lIN SCOPE UNITS) OF THE LOWER LEFT CORNER AT WHICH PLOTTING BEGINS. * * • • •* * • • THERE MUST BE NO BLANKS BETWEEN ANY OF THESE CHARACTERS FMT IMMEOIATLY FOLLOWS DISCDN IS THE STANDARD FORMAT FOR THE INFORMATION WHICH IS TO BE WRITTEN ON THE SCOPE. SHOULD NOT CALL FOR A LINE LONGER THAN 48 (FOR SMALL) OR 36 (FOR BIG) CHARACTERS. IF A LINE GOES BEYOND THE EOGE OF THE SCOPE, THE END IS WRITTEN BEGINNING AT THE OPPOS ITE EDGE. LIST IS THE APPROPRIATE LIST WHICH CORRESPONDS TO FMT. * •* • • * * • ** * * HORIZONTAL VERTICAL CNOTE - VERTICAL MODE CHARACTERS READ CORRECTLY WHEN PICTURE IS ROTATED 90 DEGREES CLOCKWISE) THE FOLLOWING IS A LIST OF THE SPECIAL CHARACTERS AND THEIR OCTAL EQUIVALENTS WHICH DISPLA WILL RECOGNIZE IN ADDITION TO THE STANDARD CHARACTERS. •* APOSTROPHf INTEGRAL SIGN SUMMA TI ON SIGN APOSTROPHE LOW POINT MIDDLE POINT CAP CUP ARROW RIGHT * • * * • • * * * 14 15 16 17 32 35 36 37 ARROW LEFT ALPHA THETA PI SMALL SIGMA TAU PHI PSI 53 55 56 57 72 75 76 77 52 • EXAMPLES * • 1. EXAMPLE OF BIG, VERTICAL WRITING AND CHANGING THE FILM FRAME. • • USAGE CALL DISPLA PRINT 10 * 10 FORMATC9HIBV90,10,21HBIG, VERTICAL WRITING) * * * 2. EXAMPLE OF SMALL, HORIZONTAL WRITING ON SAME FILM FRAME. * * • • USAGE CALL DISPLA PRINT 20 20 FORMATII0H2SHI20,90,25HSMALL, HORIZONTAL WRITING) 0071 0072 0073 0074 0075 0076 0077 007B 0079 OOBO OOBI 00B2 00B3 00B4 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 009B 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 2) •••••••••••••••••••••••• . DISPLA (7090) ••••••••••••••••••••••••• (PAGE PROGRAM LI STINGS 3) .. .. ... .. ....• . .. •••••••••••••••••••••••• DISPLA (7090) .. •••••••••••••••••••••••• .. (PAGE OUTPUTS - ... . .... ... . • •. .... .. .. .. 3. EXAMPLES Of ALL THE CHARACTERS. SINGLE SPACING AND DOUBLE SPACING .. IN BOTH BIG AND SMALL. .... .. . INPUTS - Al1 ••• 63) = OCT 016060606060.026060606060 •••• 776060606060 it .. ... . USAGE 30 it ... .. 40 50 60 AND A THE CALL DISPlA PRINT 30. IA(I).I:l.16) fORMATI10HIBH56.900.16A2) CALL DISPlA PRINT 40, IAII).1=17.32) fORMATI1H 16A2) CALL DISPlA PRINT 50, (AII).1=33,48) FORMATI1H016A2) CALL DISPLA PRINT 60. (AIII.I=49.63) FORMATI10H2BH56.600.16A2) SIMILAR SEQUENCE TO PLACE SMALL CHARACTERS IN 80TTOM OF THE FRAME • 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 01'59 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 3) ...................... -... .•••••••••••••••••••••••• •••••••• * ••••• ** ••••• .. ...** 11090) ...__ DISPLA .......... _........ PROGRAM LISTINGS DISPLA 11090) IPAGE IPAGE 4) .. .. OUTPUTS - .. . . ... .... ... .. ... ... . ... ..... .. .. .... ... . * .. 4. EXAMPLE OF A LINE EXTENDING BEYOND THE EDGE OF THE SCOPE. .. USAGE CALL OISPLA .. PRINT 10, IAII),1=1,24) .. 10 FORMATI10HIBH56,500,24A2) .. OUTPUTS - .... ... IO (1 IE E3 F4 CO .; 7 a 9 -;. :: :r. J , + ~ • •. ... • ..• 5 • EXAMPLE OF DISPLAY SPACING UNDER FORMAT CONTROL CALL OISPLA USAGE PRINT 80, IAII),I=1,63) BO FORMATIIOHIBH56,500, 16A2/1H 16A2/1H 16A2/1H 16A2) OUTPUTS - . • •.. .... . ... I) + 1 2 3 4 5 6 A B C D E F J K L ~1 N 0 S T U V W -;. :: , G H I P Q R ..,. +- <:1 • . 7 d 9 .,. "/<'," y .... I, J J. ~ .?-'. f;t: T 8 TT rtt 't' BSS 0 .. FOLLOWING CARD DESIGNATES THE OATA CHANNEL THAT CRT IS ATTACHEO TO. • TO CHANGE, ALTER THE LETTER DESIGNATIDN ONLY AND REASSEMBLE. TAPENO D1 X SCPAD EQU X-I05 PZE I- 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 0225 0226 0221 0228 0229 0230 0231 0232 0233 0234 0235 0236 0231 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 4) •••••••••••••••••••••••• - DISPlA (7090) PROGRAM LISTINGS - •••••••••••••••••••••••• (PAGE I,OISPlA 1,4 MASK2 NOERR liS)) 3,4 1,4 TZE NOERR (STVH) WOS (SVHI CHECK FOR STANDARD ERROR PROCEDURE MASK2=770377000000 ZERO. NO STANDARD ERROR PROCEDURE NOT ZERO. STANDARD ERROR PRESENT TRACE E A5 LP1 LP2 ELP2 A DISPLA (1090) CAL STA TRA II S) I CAL STA 1,4 1,4 TRA REM REM REM WOS - WRITE ON SCOPE lDQ -+4 CLA *+2 $( IOHI TRA., t 3MZE TRA was SXO DISPlA-2.4 SXA OUT+1.1 SXA OUT+2,2 CLA 1,4 FETCH PZE Z"N. FORMAT WORDS ARE IN l BSS N ARS 18 ADO 1.4 STA A POX WOS.l LXO MOOE.2 TSX A.4 FETCH FIRST CHARACTER lXA A5.l IDENTIFY CONTROL CHARACTER ADO C.1 TZE 0.1 TIX *-2.1.1 TRA OUT ILLEGAL CONTROL CHARACTER REM TSX SFRAME,4 TRA NUORG INCR.2 ACl INCR.2 ACL ACL ORGIN ANA MASK STO ORGIN LXO MOOE.2 CAL ORGIN WRITE RECORD ACl 6U3L.2 MOVE POINT OF ORIGIN NEXT CHARACTER, MOVE POINT ACL 2R,2 ANA MASK AND STORE SLW POINT FETCH CHARACTER TSX FETCH,4 PAX 5.4 I S IT BLANK SUB BLANK TNZ *+4 CAL POINT ACL 1R,2 TRA E+l LOQ PAT.4 NO. FETCH PATTERN LXA A5.1 DO 5 COLUMNS CAL POINT ACl 701R,2 NEXT COLUMN, MOVE POINT LXA A7,4 DO 1 ROWS NEXT ROW, MOVE POINT ADO lU,2 RQL DO POINT TQP ELP2 SLW POINT PLOT POINT WRS SCPAD RCHX 10C TCOX TIX lP2,4,l LPl,l,l TIX COLUMN DONE TRA CHARACTER DONE E REM NEW WORD l+N lOO * •• 1 STO WORD SXD WCNT.l lXA A7.1 SXO CCNT.l < o - - •••••••••••••••••••••••• 5) BCI DISPLA CAL ANA •••••••••••••••••••••••• . -. (PAGE 0253 0254 0255 0256 0257 025B 0259 0260 0261 0262 0263 0264 0265 0266 0261 0268 0269 0210 0271 0212 0273 0274 0275 0216 0277 0278 0219 0280 0281 0282 0283 0284 0285 0286 0287 0288 0289 0290 0291 0292 0293 0294 0295 0296 0297 Oi98 0299 0300 0301 0302 0303 0304 0305 0306 0307 0308 0309 0310 0311 0312 0313 0314 0315 0316 0317 0318 0319 0320 C321 0322 0323 0324 0325 0326 0327 5) •••••••••••••••••••••••• * PROGRAM LlSTlNGS • OrSPLA (7090) (PAGE OISPLA (7090) (PAGE FETCH LXO LOQ ( (S) ) PXO A6 lGl STQ TlX LXD T1X OUT LXD AXT AXT TRA SXD B TRA REM NUDRG TSX S10 TSX ADD LRS ARS RNO A7 PAX SXD LXA R STl TSX CAS NOP MODE TXI STO CLA A2 ALS ADD ALS ADD STO WCNT TXI F TIX CLA ALS ADD S10 CCNT TXI REM DEC C SYN PZE PZE PZE PZE 2R SYN PZE PZE PIE PZE INCR SYN MZE MZE PZE PZE lU SYN PZE PZE PZE PZE 701R SYN CCNT,l WORD (STVH) ,0 6 WORD B ,1,1 WCNT.l A,1,1 OISPLA-2,4 *.,1 STORAGE TO TV HOLLERITH .*,2 2,4 CCNT,1 1,4 FETCH,4 T FETCH,4 T 1 4 COMPUTE MODE B OR S H OR V 7,2 MODE,2 A2,2 T,2 FETCH,4 TEN SV=4,BV=3,SH=2,BH=1 COMPUTE ORIGIN F" •• T T,2 2 T.2 1 T T.2 R+l,,** R,2,l T-2 18 T-1 ORGIN TRACE,,*- -1,-1,2,-48,32 * 6 8 ,,6 ,,8 CC IS 1,2,0, ,+ SV BV SH BH * ,,30 ,,40 994 984 SV BV SH BH ,,3 ,,4 3 4 SV BV SH BH * * 3,,21 4,,28 1003,,3 996,,4 SV BV SH BH * 21 28 ,,21 ,,28 SYN * PZE 1015,,1006 PZE 1012" 1000 PIE 18,,1015 * •••••••••••••••••••••••• 6) 7R •••••••••••••••••••••••• * •••••••••••••••••••••••• SV BV SH BH SV BV Si-i 0328 0329 0330 0331 0332 0333 0334 0335 0336 0337 0338 0339 0340 0341 0342 0343 0344 0345 0346 0347 0348 0349 0350 0351 0352 0353 0354 0355 0356 0357 0358 0359 0360 0361 0362 0363 0364 0365 0366 0367 0368 0369 0370 0371 0372 0373 0374 0375 0376 0377 0378 0379 0380 0381 0382 0383 0384 0385 0386 U387 0388 0389 0390 0391 0392 0393 0394 0395 0396 0397 0398 0399 0400 0401 0402 6) .•••••••••••••••••••••••• . •••••••••••••••••••••••• PROGRAM LISTINGS OISPLA 170901 (PAGE 6U3L 24,,1012 .. 30207144014 070421750434 020107422010 010424040000 001303400000 141104416010 303214461303 006047401003 306240405143 376401010177 016306006001 177004020017 002017740201 105054464242 100200401002 BH 77 PSI 76 PHI 75 TAU 74 ( 73 , 0199 0200 72 SMALL SIGMA 71 10 67 66 65 64 63 62 61 I Y X W V U T S I ORGIN OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT PAT OCT MASK OCT MASK2 OCT BLANK BCD TEN DEC WORD BSS BSS BSS RSS T . (PAGE 71 PIE SYN REM OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT OCT . •••••••••••••••••••••••• DISPLA (7090) •••••••••••••••••••••••• 021100436010 175114462276 141104414110 54 124343707052 020342502010 020102'507010 376111452306 51 50 175015050336 376110442206 47 175014060276 46 376020202171 45 376020600577 44 43 377004020100 376101210501 42 101004020077 41 020100402010 40 040404010020 200401010100 000000400000 000004050434 34 001406000000 33 4000000 000007740000 31 376100402177 30 175014062371 27 376110440201 26 377114460301 75 203774060276 24 175014060242 23 203774462266 22 370221044574 21 02010H02010 20 000130340000 203435242343 201003700201 000130340000 000241205000 13 004015442206 015114452236 11 155114462266 10 003610441203 01 171124462260 06 111054261211 05 060241131620 04 105014462266 03 345114462306 02 001027760000 01 175014060276 00 1717001777 170377000000 100000 10 1 1 1 1 0202 0203 0204 0205 0206 0207 0208 0209 0210 .57 PI 56 THETA 55 ALPHA .. 0215 53 ARROW LEFT 52 ARROW RIGHT R Q P a N M L K J - 0218 0219 0220 0221 0222 0223 0224 0225 0226 0227 37 CUP 36 CAP 35 MIDDLE POINT 0231 0232 I • 32 lOW POINT I H G F F 0 C R A + 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 17 APOSTROPHE 16 SUMMATION SIGN 15 INTEGRAL SIGN 14 APOSTROPHE 0248 12 QUESTION MARK 9 8 7 6 5 4 3 2 1 0 0250 0251 0252 0253 0254 0255 0256 0251 0258 0259 0403 0404 0405 0406 0407 0408 0409 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 0420 0421 0422 0423 0424 0425 0426 0421 0428 0429 0430 0431 0432 0433 0434 0435 0436 0431 0438 0439 0440 0441 0442 0443 0444 0445 0446 0447 044B 0449 0450 0451 0452 0453 0454 0455 0456 0457 0458 0459 0460 0461 0462 0463 0464 0465 0466 0467 0468 0469 0470 0471 0412 0473 0414 041'5 0416 0477 1) •••••••••••••••••••••••• -.. OISPlA (7090) •..................... • (PAGE 81 POINT BSS IOC lOCO END POINT"l PROGRAM LISTINGS • ••••••••••••••••••••••• 01 SPlA (7090) •*_ •••••••••••••••••••••• • (PAGE 0418 0419 0480 81 •••••••••••••••••••••••• DIVIDE • ••••••••••••••••••••••••• •••••••••••••••••••••••• PROGRAM LISTINGS • OIVlOE -..•.............•...•.. 9129/64 • DIVIDE I SUBROUTI NE) • FAP -DIVIDE COUNT 150 DIVIDE LBL ENTRY DIVIDE (X,LX,XOVSR,XDVDEDI LAST CARD IN DECK IS NO. 0087 0001 0002 0003 0004 0005 0006 • 0007 ----A8STRACT---• 0008 * 0009 • TITLE - DIVIDE 0010 • DIVIDE A FLOATING VECTOR BY A CONSTANT 0011 • 0012 DIVIDE FORMS A VECTOR EQUAL TO A GIVEN VECTOR DIVIDED • BY A FLTG CONSTANT. OUTPUT MAY REPLACE INPUT. 0013 • 0014 • 0015 - FAP SUBROUTINE I FORTRAN-I I COMPATIBLEI • LANGUAGE 0016 • EQUI PMENT - 709 OR 7090 IMAIN FRAME ONLY) 0017 - 23 REGISTERS • STORAGE 7090 709 0018 • SPEED 0019 34 + 119 OR 241*LX MACHINE CYCLES, LX VECTOR LENGTH • 0020 • 0021 - S.M. SIMPSON, AUGUST 1963 • AUTHOR 0022 • 0023 ----USAGE---* 0024 ** TRANSFER VECTOR CONTAINS ROUTINES - INONE) 0025 0026 * AND FORTRAN SYSTEM ROUTINES - INONE) 0027 * 0028 • FORTRAN USAGE 0029 • CALL DIVIDEIX,LX,XDVSR,XDVDEDI 0030 0031 • INPUTS 0032 X(JI 0033 I=l ••• LX IS A FLTG VECTOR 0034 • 0035 LX SHOULD EXCEED ZERO 0036 * 0037 XDVSR IS A NON-ZERO FLTG QUANTITY. EQUIVALENCECXDVSR,SOME XCI" * 0038 IS PERMITTED. • 0039 * STRAIGHT RETURN WITH NO OUTPUT IF LX LSTHN 1 OR XOVSR=O. 0040 • OUTPUTS 0041 * 0042 * XDVDEDII) I=I ••• LX HAS VALUES = XCII/XDVSR. 0043 • EQUIVALENCE IXDVDED,Xl IS PERMITTED. 0044 • 0045 THE DIVISOR USED IS ALWAYS THE INITIAL VALUE OF XDVSR. 0046 •* EXAMPLES 0047 0048 • 0049 • 1. INPUTS - Xll ••• 41=1.,2.,3.,4. U=O.O V=O.O 0050 USAGE CALL DIVIDEIX,4,2.,YI 0051 CALL DIVIDEIX,l,2.,ZI 0052 • CALL DIVIOEIX,O,2.,UI 0053 • CALL DIVIDEIX,I,O.,VI 0054 • CALL OIVIDEIX,4,X(2),X} 0055 • OUTPUTS - YIl ••• 41=.5,l.0,1.5,2.0 1=0.5 0056 • U=V=O.O (NO OUTPUT CASESl XIl ••• 4J=.5,l.0,1.J,2.0 0057 • 0058 • PROGRAM FOLLOWS BELOW 0059 • 0060 - NO TRANSFER VECTOR 0061 o XR4 HTR 0062 I,DIVIDE BCI 0063 • ONLY ENTRY. DIVIDE IX,LX,XDVSR,XDVDEDI 0064 DIVIDE-2,4 DIVIDE SXD 0065 Kl CLA 1.4 0066 Kl AIXl+l ADD 0067 STA GET 0068 4,4 CLA 0069 AIXDVDEDI+l ADD KI 0070 STA STORE 0071 3,4 XDVSR CLA0072 LEAVE HE 0073 TEMP STO 0074 CLA. 2,4 LX = -- - - • ••••••••• **** ••• ****.** • PROGRAM LISTINGS 01 VIDE * •• * ••• * •• *.*.****** •• *** (PAGE .*.* •• *****.*.-***.*.*.* (PAGE 21 TMI LEAVE POX 0,4 LEAVE,4,O TXL * DIVISION LOOP GET CLA **.4 FOP TEMP STQ STORE *- ,4 GET,4,l TIX EXIT * LEAVE lXD DIVIOE-2,4 5,4 TRA TEMP PZE --,**,** END •• *.* ••• * •• ~* ••• **.**.** DIVIDE * * **=A(XI+l **=AIXDVOEOI+l =OIVISOR 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 21 ·*** •••••• ********* •••• * "•• *.* OIVK " ••••• ************** REFER TO ADDK PROGRAM LISTINGS .*****************.***** OIVK "***.**.* " ••• ***** ••• *.*** REFER TO ADDK •••••••• * •••• ***.** ••••• .* •• ** •• *** ••••• ** •••••• "••••••OIVKS ** •••••••• * •••• **. DIVKS • "*** ••••• * •••• ***.*** •••• REFER TO ADOK ****.****.*.**.********* (PSEUDO ENTRY) " "**** ••DO************* •••• * REFER TO SEVRAL REFER TO ADOK *********************.** CO (PSEUDO ENTRY) * *" •• ********************* REFER TO SEVRAl •••••••••••••••••••••••• - DOTJ - •••••••••••••••••••••••• -OOTJ . -* • • --.. - -.. . * -. --.-. .. -.... .. --. .. .. .. . " .. •..•.••..•....•... _..... .. OOTJ - •••••••••••••••••••••••• 1012164 DOTJ ISUBROUTINEI LAST CARD IN DECK IS NO. 0142 0001 FAP 0002 COUNT 100 0003 LBL DOTJ 0004 ENTRY DOTJ ILXY,IDX,X,IDY,Y,DOT,ADD,ORDERI 0005 0006 ----ABSTRACT---0001 0008 TITLE - DOTJ 0009 VECTOR DOT PRODUCT WITH ARBITRARY INCREMENTS 0010 0011 DOTJ EVALUATES THE FORMULAE 0012 0013 DOT XIII.YIII + XII+IDX)-YIl+IDYI 0014 + XII+2*IDXI-YII+2-IDYI + 0015 III 0016 OR 0017 0018 DOT XIU·YIl+(LXY-lI-IDYI +' ••• 0019 + X(I+ILXY-11.IDXI-Y(11 ( 21 0020 0021 FOR LXY TERMS OF X AND Y. THE INCREMENTS lOX AND lOY 0022 ARE INPUT PARAMETERS. 0023 0024 0025 LANGUAGE - FAP SUBROUTINE (FORTRAN II COMPATIBLE) EQUIPMENT - 109 OR 7090 IMAIN FRAME ONLYI 0026 - 59 REGISTERS 0021 STORAGE 0028 - ABOUT 18-LXY + 72 MACHINE CYCLES ON THE 1090. SPEED R.A. WIGGINS 3/63 0029 AUTHOR 0030 ---USAGE---0031 0032 TRANSFER VECTOR CONTAINS ROUTINES - NONE 0033 AND FORTRAN SYSTEM ROUTINES - NONE 0034 0035 FORTRAN USAGE 0036 0037 CALL DOTJ (LXY,IDX,X,IDY,Y,DOT,ADD,ORDERI 0038 0039 INPUTS 0040 LXY IS THE NUMBER OF TERMS IN X AND Y THAT ARE TO BE 0041 MULTIPLIED. 0042 MUST BE GRTHN= 0043 0044 lOX IS THE INCREMENT FOR X AS ILLUSTRATED IN THE ABSTRACT. 0045 MUST BE GRTHN= 0 0046 0041 X(II I=l, ••• ,(LXY-I)"IDX+I IS THE X VECTOR. 0048 0049 lOY IS THE INCREMENT FOR Y AS ILLUSTRATED IN THE ABSTRACT. 0050 00')1 MUST BE GRTHN= 1 0052 YIII 1=1, ••• ,(lXY-11"IDY+I IS THE Y VECTOR. 0053 0054 ADD IS GRTHN ZERO THE INPUT VALUE OF DOT IS ADDED TO THE 00S5 DOT PRODUCT 0056 IF LSTHN=ZERO, DOT IS CLEARED BEFORE THE PRODUCT IS FOUND 0057 0058 ORDER 00')9 IF GRTHN ZERO FORMULA II) OF THE ABSTRACT IS EVALUATED. IF LSTHN= ZERO FORMULA 121 OF THE ABSTRACT IS EVALUATED. 0060 0061 OUTPUTS 0062 0063 DOT IS THE DOT PRODUCT OF X AND Y AS DEFINED IN THE 0064 ABSTRACT. 0065 0066 EXAMPLES 0061 0068 1. INPUTS - LXY=2 IDX=l ADD=O X(1 ••• 21=1.,2. IDY=2 0069 Yll ••• 31 = 1.,2.,3. ORDER = 1. 0070 OUTPUTS - DOT = 7. 0071 0072 2. INPUTS - LXY=2 IOX=3 X(1 ••• 41 1.,2.,3.,4. ADD=l. DOT=2. 0073 IOY=l Y(1 ••• 21 1.,2.5 ORDER=l. 0074 --.-.. . -... • -• - PROGRAM 1I STINGS •••••••••••••••••••••••• (PAGE ...•.......•.•.-........ PROGRAM LISTINGS DOTJ • ••••••••••••••••••••••••• * • • = 13. • 3. INPUTS - SAME AS EXAMPLE 2. EXCEPT ORDER=-l. OUTPUTS - DOT=8.5 * • IDX=4 XIl)=2. IDV=7 - LXV=l ORDER=l. OUTPUTS - DOT = 8. * 4. INPUTS • • • • PROGRAM FOLLOWS • XRl PZE XR2 XR4 DOTJ A2 A3 A4 A5 A6 X V OOT Tl T2 LV lOX LXV PZE PZE BCI SXD SXD SXD LDQ CLATLQ STZ* CLA* TLQ TRA SUB STO CLA* TLO TRA STD LOQ* CAL* TOP STO SUB STD LOQ MPV ARS PAX TRA STO AXT CAL STA CAL STA CAL STA STA AXT LXD TXI LDQ FMP FAO STO TXI TXI TIX LXO LXO LXD TRA PZE PZE ENO VI1I=3. ADD .. I. BELOW l,DOTJ XR4,4 XRl,l XR2,2 =0 7,4 A2 6,4 1,4 A3 LV =lB17 LXV 4,4 A4 LV T2 8,4 2,4 A5 lOX =0100000000000 =ADD =LXV =ORDER =IOX Tl lOX LXV 1 ,1 A6 Tl 0.1 3,4 X 5,4 V 6,4 DOT DOT+I 0,2 LXV,4 ·+1,4,1 •• ,1 ··,2 •• •• * (PAGE 21 OUTPUTS - DOT DOTJ •••••••••••••••••••••••• =AORIXI =ADRIV) =ADRIDOTI •• =ADRIXI •• =AORIY) •• =AORf OOTI **=AORIOOT) *+1,1,*. ·+1,2,*. X,4,1 XRl,l XR2,2 XR4,4 9,4 DECREMENT CONTAINS lOX DECREMENT CONTAINS LXV-1 00T=2. 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 Ol23 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 21 •••••••••••••••••••••••• • DOTP • PROGRAM LISTINGS •••••••••••••••••••••••• • 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 C C C C C DOTP • •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0146 0001 0002 SUBROUTINE DOTP INRA.NCA.AA.NRB.NCB.BB.IRB.ICB.DOT.ORDER) 0003 0004 ----ABSTRACT---0005 0006 Tl TLE - DOTP 0001 DISPLACED OOT PRODUCT OF 2-0IMENSIONAL ARRAYS 0008 0009 DOTP FINDS THE DISPLACED DOT PRODUCT OF TWO RECTANGULAR 0010 ARRAYS AII,J) l=l, •••• NRA J=l, ••• ,NCA AND BII,J) 0011 l=l ••••• NRB J=l, ••• ,NCB ACCORDING TO THE fORMULAE 0012 0013 M M 0014 DOT SUM I SUM ( AII1,J1).BII+IRB,J+ICB) ) 0015 0016 I=-M J=-M 0011 WHERE IF 0018 ORDER= 1. 11=1 Jl=J 0019 ORDER= 2. 11=NRA-I+l Jl=J 0020 DRDER=-l. 11=1 J1=NCA-J+1 0021 ORDER=-2. 11=NRA-I+1 Jl=NCA-J+1 0022 AND 0023 M IS GRTHN MAX{NRA,NCA,NRB,NCB) (A AND BARE 0024 CONSIDERED TO BE ZERO WHEN THE SUMMATION IS 0025 OUTSIDE THE RANGE OF DEFINITION) 0026 NRA,NCA.NRB,NCB,IRB.ICB, AND OROER ARE INPUT 0021 PARAMETERS. 0028 0029 DOTP EXITS WITH NO COMPUTATION IF ILLEGAL PARAMETERS 0030 ARE FOUND. 0031 0032 LANGUAGE - FORTRAN II SUBROUTINE 0033 EQU I PMENT - 109 OR 1090 (MAIN FRAME ONLY) 0034 STORAGE - 264 REGISTERS 0035 SPEED - ABOUT .000029*NRA.NCA + .000190*NCA + .00018 SECONDS 0036 ON THE 1094 MOD 1. 0031 AUTHOR - R.A. WIGGINS MAY.1963 0038 0039 ----USAGE---0040 0041 TRANSFER VECTOR CONTAINS ROUTINES - DOTJ 0042 AND FORTRAN SYSTEM ROUTINES - NONE 0043 0044 fORTRAN USAGE 0045 CALL DOTP INRA,NCA,AA.NRB,NCB.88,IR8.ICB,DOT.ORDER) 0046 0041 INPUTS 0048 0049 NRA NUMBER ROWS IN A. 0050 MUST EXCEED 0 0051 0052 NCA NUMBER COLUMNS IN A. 0053 0054 MUST EXCEED 0 0055 AAIL) L=l ••••• NRA.NCA CONTAINS AII,J) I=l, ••• ,NRA J .. 1 ••••• NCA 0056 STORED CLOSELY PACKED. 0057 0058 0059 NRB NUMBER ROWS IN B MUST EXCEED 0 0060 0061 NCB NUMBER COLUMNS IN B 0062 MUST EXCEED ZERO 0063 0064 BBILI L=l •••• ,NRB.NCB CONTAINS BII.JI 1=1, ••• ,NR8 J"'l, ••• ,NCB 0065 STORED CLOSELY PACKEO. 0066 0061 IRB OEFINES THE OISPLACEMENT ALONG THE COLUMNS OF A WITH 0068 0069 RESPECT TO B BEFORE THE PRODUCT IS TAKEN. MAY BE ANY VALUE. 0010 0071 ICB DEFINES THE DISPLACEMENT ALONG THE ROWS OF A WITH RESPECT 0012 TO B BEFORE THE PRODUCT IS TAKEN. 0013 • CDOTP C C C DOTP ISUBROUTINE) LABEL •••••••••••••••••••••••• • 9129/64 •••••••••••••••••••••••• OOTP * •••••••••••••••••••••••• • (PAGE •..•......•..•.... _..... PROGRAM LI STINGS • OOTP (PAGE 21 MAY BE ANY VALUE. C C C ORDER C C C C C DEFINES THE TYPE OF REVERSAL OF A THAT IS MADE BEFORE THE 9RODUCT IS FOUND ISEE ABSTRACT 1 '" 1. IMPLIES NO REVERSAL = 2. IMPLIES COLUMN REVERSAL =-1. IMPLIES ROW REVERSAL =-2. IMPLIES ROW AND COLUMN REVERSAL C C OUTPUTS C C C C DOT CONTAINS THE DOT PRODUCT EVALUATED AS DEFINED IN THE ABSTRACT. C EXAMPLES C - NRA=4 NCA=4 NRB=4 NCB=4 IRB=O ICB-O ORDER-I. AA(l ••• 161 = 1.0,1.1,1.2,1.1 BBl1 ••• 161=1.0,0.9,0.9,0.8. 1.2,1.3,1.4.1.3 0.9,0.8.0.7,0.6. 0.7,0.7,0.5,0.4, 1.2.1.5.1.5,1.3 1.1, 1 • .3, 1.2, 1.0 0.6,0.5.0.2.0.3 WHERE AA AND BB ARE STORED BY COLUMNS. OUTPUTS - DOT = 12.84 C 1. INPUTS C C C C C C C C 2. C C C 3. C INPUTS - SAME AS EXAMPLE 1. EXCEPT ORDER=2. OUTPUTS - DOT = 12.95 INPUTS - SAME AS EXAMPLE 1. EXCEPT ORDER:-1. OUTPUTS - DOT = 12.87 C C 4. INPUTS - SAME AS EXAMPLE 1. EXCEPT ORDER=-2. OUTPUTS - DOT = 13.07 C C C 5. INPUTS OUTPUTS C C SAME AS EXAMPLE 1. EXCEPT IRB=-2 DOT = 4.17 C 6. INPUTS - SAME AS EXAMPLE 1. EXCEPT IRB=2 OUTPUTS - DOT - 1.57 C ICB=-2 C C C 10 C 20 30 40 50 60 70 90 100 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 010q ICB=2 C C PROGRAM FOLLOWS BELOW C • • ••••••••••••••••••••••• DIMENSION AA(2),BBI21 OOT=O. J=l II IS VECTOR INDEX OF THE FIRST POINT IN BB. Il=XMAXOFll,l+IRB)+XMAXOFIO,ICB*NRBI t2 IS VECTOR INDEX OF THE LAST POINT IN FIRST COLUMN OF BB. I2=XMINOFINRA,NRA+IRB.NRB,NRB-IRB)+Il-1 LC IS THE LENGTH OF ROWS TO 8E USED. LC=XMINOFINCA,NCA+IC8.NCB,NC8-ICB) IF IXMINOFII2-11+1,LC)) 100,100,10 CONTINUE JA1+JA2+1 IS VECTOR INDEX OF FIRST POINT IN A FOR ORDER 1. JA1 = XMAXOFIO,-IRBI JA2 = XMAXOFIO,-ICB*NRA) K1 - ORDE P+3. IF (Kl-51 20,20,100 GO TO 130,40,50,50,601,Kl J1 = (NCA-LC+1)*NRA-JAI-JA2 J--l GO TO 70 J1 = INCA-LC)*NRA+JA1-JA2+1 GO TO 70 Jl = JAl+JA2+1 GO TO 70 J1 = NRA+JA2-JAl J=-l CONTINUE DO qO 1=11,12 CALL DOTJ (LC,NRA,AAIJ1),NRB,BBII),DOT,1.,ORDER) J1=Jl+J RETURN END 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 2) •••••••••••••••••••• ** •• •••••• DPRESS • *.* •• ***** ••• * •• **. REFER TO BOOST PROGRAM Ll STINGS ••••••••••••••••••••••• * •.*.** DPRESS • ••••••••••• *** ••• ** REFER TO BOOST .•••••••••••••••••••••••• .. oSPFMT •••••••••••••••••••••••• PROGRAM LI STINGS -..•.•.......•...•...... - DSPFMT .. oSPFMT 1SUBROUTJ NE I LAST CARD IN DECK IS NO. 0312 9129/64 .. FAP 0001 0002 ·oSPFMT 0003 COUNT 310 0004 LBL DSPFMT DSPFMT ICNTHOL,IORGX,IORGY,FMTEND,FMTI ENTRY 0005 0006 0001 ----ABSTRACT---0008 0009 - TITLE - DSPFMT .. VARIABLE ORIGIN FORMAT GENERATOR FOR SCOPE SUBROUTINE DISPLA 0010 0011 0012 DSPFMT SETS UP A FORMAT FOR THE SUBROUTINE DISPLA WHICH • 0013 ALLOWS THE USE OF A VARIABLE ORIGIN FOR THE ALPHANUMERIC CHARACTERS WHICH APPEAR ON THE SCOPE • 0014 0015 0016 .. LANGUAGE - FAP SUBROUTINE IFORTRAN II COMPATIBLE) .. EQUIPMENT - 109 OR 1090 IMAIN FRAME ONLY) 0011 .. STORAGE 0018 - 194 REGISTERS 0019 .. SPEED .. AUTHOR 0020 - S.M. SIMPSON. NOVEMBER, 1961 0021 0022 ----USAGE---0023 0024 .. TRANSFER VECTOR CONTAINS ROUTINES NONE 0025 .. AND FORTRAN SYSTEM ROUTINES NONE 0026 0021 .. FORTRAN USAGE .. CALL DSPFMTICNTHOL.IORGX.IORGY.FMTEND.FMTI 0028 0029 •.. INPUTS 0030 0031 0032 IS AN ALPHANUMERIC WORD CONTAINING PRECISELY 3 HOLLERITH CNTHOL LEFT ADJUSTED CHARACTERS. THESE ARE THE CHARACTERS 0033 0034 USED TO CONTROL THE PLOTTING MODE OF DISPLA • 0035 0036 IS THE X ORIGIN IN SCOPE UNITS. 10RGX 0031 IS FORTRAN II INTEGER • 003B MUST BE GRTHN=O, LSTHN 1024 0039 0040 IS THE Y ORIGIN IN SCOPE UNITS. 10RGY • 0041 IS FORTRAN II INTEGER. • 0042 MUST BE GRTHN=O. LSTHN 1024 0043 0044 FMTENDIII 1=1.0.-1.... IS AN ARBITRARILY LONG VECTOR OF HOLLERITH CHARACTERS 16 PER WORD) THAT COMPLETES 0045 0046 THE FORMAT CONTROLLING oISPLA • 0041 DOES NOT INCLUDE THE RIGHT PARENTHESIS • 0048 IS TERMINATED BY A FENCE (OCT 111111111111) 0049 MAY BE MOST EASILY SET UP BY USING A HOLLERITH ARGUMENT IN THE CALLING SEQUENCE. THEN FORTRAN 0050 0051 TAKES CARE OF THE ORDERING AND THE FENCE • 0052 0053 .. OUTPUTS 0054 • 0055 1=1.2.... IS THE HOLLERITH VECTOR OF THE COMPLETEO FMTI I I 0056 FORMAT. • 0051 IS OF LENGTH OF FMTEND PLUS THREE WORDS • 0058 0059 • EXAMPLES 0060 0061 • 1. INPUTS - CNTHOL = 3H2SH IORGX=12B 10RGY=1000 0062 USAGE CALL DSPFMT (CNTHOL.IORGX.IORGY.1H2I6.3A6,FMTI • 0063 .. OUTPUTS - FMTll ••• 51 = 6HI12H2SH12B.IOOO.2I6.3A61 0064 .. 2. USAGE CALL DSPFMT (3H2SH.IO,2.3H4A6,FMT) 0065 0066 .. OUTPUTS - FMTll ••• 3) 6HI8H2SHI0.2.4A61 0061 0068 PZE 0069 BCI 1.oSPFMT 0010 .-2.4 DSPFMT SXD 0011 SXA SV2.2 0072 SXA SVl.1 0013 -SET FMTEND 0014 CAL 4.4 ... . .... .. .. . .. .... ... . .. .. .... .... .. .. .. . . .. .. •••••••••••••••••••••••• •••••••••••••••••••••••• - DSPfMT . PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 21 SUB =IB35 STA ST50 .. INITIAL STUff ROUTINE FOR fIRST HoLERITH (LEFT PARENI CLA Kl KAY STA STA EL CLA 5,4 FMT STA SHO .. PUT IN LEFT PAREN etA LPRN TSX STUff,2 -GO FIND OUT HOW MANY DIGITS IN IRGX AND IN lRGY 2,4 CLA" BCI,2 TSX STD NOX 3,4 CLATSX BCI,2 NOY STo -THE NUMBER Of DIGITS IN HoLERITH fIELD OF FMT IS " 3( fOR CONTROL I + NOX + NDY + 21FoR CoMMASI ADD NDX ADO K5 -SPREAD IT OUT IN HoLERITH AND STUfF INTO fORMAT ALS 18 TSX BCI,2 SToRN,1 TSX -THEN PUT IN H CLA AlTCH STUFF,2 TSX -NOW SET UP AND INSERT 3 CONTROL HolERITH,STUFF SAVES 1 MQI 1,4 LDQ* LGL 6 TSX STUFF.2 LGL 6 STUFF,2 TSX LGl 6 TSX STUFF,2 -NEXT SET UP AND PUT IN lRGX 2.4 CLATSX BCI.2 SToRN,l TSX -THEN A COMMA CLA COMMA TSX STUFF.2 -THEN IRGY CLA3,4 TSX BCI,2 TSX SToRN,1 -THEN ANOTHER COMMA CLA COMMA TSX STUfF,2 -NOW KEEP PUTTING IN THE fORMAT END TILL HIT FENCE AXT -1,1 .... =FMTEND ST50 CLA ** tl CAS fENCE TRA -+2 TRA ST60 FENCE HIT, GO WIND UP -PUT IN ALL SIX XCA LGL 6 TSX STUFF.2 LGL 6 TSX STUFF.2 lGL 6 TSX STUFF.2 LGl 6 TSX STUFF.2 6 LGL TSX STUFF .2 6 LGL TSX STUFf.2 ST50,l.1 TlX -WHEN fENCE HIT FIll IN RIGHT PAREN ST60 CLA RPRN TSX STUFF.2 - •••••••••••••••••••••••• - OSPFMT _ •••••••••••••••••••••••• (PAGE 0015 0016 0011 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 014B 0149 21 •••••••••••••••••••••••• DSPFMT •••••••••••••••••••••••• (PAGE PROGRAM LISTINGS 3) •••••••••••••••••••••••• DSPFMT * •••••••••••••••••••••••• * -NOW FILL IN REMAINDER OF REGISTER WITH BlANKS(UNTIL KAY=l) KAY ST70 CLA Kl CAS TRA -+2 TRA LV -(USING BLANK IN COMMA SINCE UNSURE OF BCI 1,(6 BLANKS)) CLA COMMA LRS 6 STUFF,2 TSX TRA ST10 -EXIT DSPFMT-2.4 LXD LV AXT· •• ,2 SV2 SVI AXT ·.,1 TRA 6.4 -CONSTANTS NDX PZE NO. DIGITS NDY PZE LPRN BCI 1. RPRN BCI I, I, , COMMA BCI FENCE OCT 711117711777 1, H AITCH BCI K5 PZE 5 - -INTERNAL SUBROUTINES •-STORN STUFFS NO. FROM BCI INTO FMT BLOCK (IGNORE LEADING ZEROESl TSX STORN.I - A+l RETURN STORN CLA B4 TNZ S1'400 CLA B3 TNZ SHOO CLA B2 TNZ S1'200 TRA snoo ST400 CLA B4 TSX STUFF.2 SHOO CLA B3 TSX STUFF.2 ST200 CLA B2 TSX STUFF.2 snoo CLA B1 TSX STUFF,2 TRA 1,1 - CALLING SEQUENCE FOR STUFF • (INTERNAL SUBROUTINE TO DSPFMT) • A TSX STUFF.2 • A+l RETURN * A - • • * • • STUFF STORES BITS 30-35 OF THE AC AS FOLLOWS. L K=l K=2 K=3 K*4 K=5 K=6 ETC * 3 • 2 • FMT 1 FMTtl.l1 •-FL AND KAY MUST BE SET TO 1 BY DSPFMT. AND • FMT STORED IN ADDRESS OF STIO. BEFORE STUFF - IS FIRST USEO. *- STUFF SHIFTS THE At APPROPRIATELY, AODS FMT(LI. - AND STORES RESULT AT FMT(LI. [T THEN INCREMENTS - K. AND IF K GRTR THAN 6. INCREMENTS L AND RESETS K=l. - FOR Kal IT FIRST CLEARS FMT(L). STUFF ANA KANA GET RID OF ANY OTHER B[TS STO TEMP AND STORE SXA STlV.2 STQ SVMQ LXA EL,2 L-I TO XR2 TXI *+1,2.-1 -IF K=l CLEAR FMTCLI (PAGE 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 01B6 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 020ft 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 31 ........... __ .......... . .••••••••••••••••••••••••* PROGRAM LI STINGS DSPFMT CPAGE • ST9 STIO * I PAGE ClA CAS TRA TRA TRA STZ* ClA SUB XCA MPY XCA STA lDQ lGl lGl ACl SlW* ClA ADD STO CAS TRA Nap KAY Kl *+2 sn STlt STIO K6 KAY K6 ST9 TEMP 36 ** **,2 STl 0 KAY Kl KAY K6 ST12 GET BITS BWS ZEROES IN MQ ··:616-K) .*=FMT XR2=l-1 TRA SHY ClA Kl RESET K TO 1 STO KAY AND l TO l+l AOD El STO El STlV AXT **,2 109 SYMQ TRA 1,2 TEMP PZE .*=6 8ITS TO 8E STUFFED .* KAY *.=K PZE El **=l PZE K6 PZE 6 Kl PZE 1 KANA OCT 77 SVMQ PZE INTERNAL SUBROUTINE 8CI * TSX BCI,2 WITH FORTRAN INTEGER IN ACRETURN WITH * BCI IN Bl,B2.B3,B4. RIGHT ADJUSTED * AC : NO DIGITS ON EXIT (ZERO)=11 BCI SXA BCIR,2 STl Bl STZ B2 B3 STZ B4 STZ ARS 18 AXT 0,2 :1000 SUB TMI *+2 TXI .-2,2.1 :1000 ADD 84,2 SXA AXT 0,2 :100 SUB TMI *+2 .-2,2,1 TXI :100 ADO SXA 83,2 AXT 0.2 :10 SUB TMI *+2 TXI *-2.2.1 :10 ADD SXA B2.2 STA Bl *FIGURE OUT HOW MANY DIGITS ClA Kl B4 NZT TRA *+3 ADO K3 TRA BCIR NZT 83 TRA *+3 STl2 .* .* .* • DSPFMT •••••••••••••••••••••••• 4) ST3 ST4 •••••••••••••••••••••••• 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0261 0268 0269 0270 0271 0272 0273 0274 0275 0276 0277 0278 0279 0280 0281 0282 0283 0284 0285 0286 0287 0288 0289 0290 02(H 0292 0293 0294 0'-95 0296 0297 0298 0299 4) •••••••••••••••••••••••• PROGRAM LISTINGS DSPFMT "•••••••••••••••••••••••• " (PAGE (PAGE 51 BCIR B4 B3 B2 81 K2 K3 ADO TRA lET ADO AXT TRA PZE PZE PZE PZE PZE PZE ENO K2 BCIR B2 Kl ••• 2 1,2 ".. "" ". ". 2 3 .•••••••••••••••••••••••• DSPFMT ••• * ••••••••••••••••••••" MOST SIG OIG LEAST SIG DIG 0300 0301 0302 0303 0304 0305 0306 0307 0308 0309 0310 0311 0312 51 .*****.*.**.*.*********. * DUBLl * .***.******************* REFER TO DUBLX PROGRAM LISTINGS *.*.**.** •• ***.**.* •• *** DUBll * *********** ••••• ** •• *** •• REFER TO OUBLX ..•••••••••••••••••••••••• DUBLX " PROGRAM LISTINGS ".. ".. ... ". .... .. ". .... . .. .. .. " .. ... .. .. . .. " " .. .. .. ... ". .. .. . . ...... .... it it it .. .. ... .. .. .. .. .. ".. .. DUBLX " •••••••••••••••••••••••• •••••••••••••••••••••••• .. DUBLX (SUBROUTINE) " FAP "DUBLX COUNT 100 LBL DUBLX DUBLX (IX,LX) ENTRY DUBll (X,LX) ENTRY ENTRY HALVX (IX.LX) HALVL (X,LX) ENTRY •••••••••••••••••••••••• .. LAST CARD IN DECK IS NO. 0128 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 ----ABSTRACT---0011 TITLE - DUBLX • WITH SECONDARY ENTRY POINTS DUBLL, HALVX, HALVl. 0012 FAST DOUBLING OR HALVING OF A VECTOR (FIXED OR FLOATING) 0013 0014 0015 DUBLX DOUBLES THE MAGNITUDES OF THE NUMBERS IN A FIXED 0016 POINT VECTOR. OVERFLOW IS NOT CHECKED. 0017 DUBLL DOUBLES THE MAGNITUDES OF THE NUMBERS IN A FLOATING 0018 0019 POINT VECTOR. 0020 HALVX HALVES THE MAGNITUDES (WITHOUT ROUNDING) OF THE 0021 0022 NUMBERS IN A FIXED POINT VECTOR. 0023 0024 HALVL HALVES THE MAGNITUDES OF THE NUMBERS IN A FLOATING 0025 POINT VECTOR. 0026 0027 LANGUAGE - FAP, SUBROUTINE (FORTRAN II COMPATIBLE) 0028 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0029 STORAGE - 45 REGISTERS 0030 SPEED - ION MACHINE CYCLES IN: LENGTH OF VECTOR) 0031 AUTHOR - S.M. SIMPSON 0032 OOH ----USAGE---0034 0035 TRANSFER VECTOR CONTAINS ROUTINES NONE 0036 AND FORTRAN SYSTEM ROUTINES NONE 0037 0038 FORTRAN USAGE 0039 CALL DUBLX IIX,LXI 0040 CALL DUBLL I X,LX) 0041 CALL HALVX IIX.LXI CALL HALVL I X,lX) 0042 0043 0044 INPUTS 0045 I=l ••• LX IS VECTOR OF FLOATING POINT NUMBERS. 0046 XIII 0047 0048 I=l ••• LX IS VECTOR OF FIXED POINT NUMBERS. I XIII 0049 0050 IS FORTRAN II INTEGER LX 0051 MUST EXCEED ZERO 0052 ILX=O IS TREATED AS LX-I. LX NEG AS LX POS) 0053 0054 OUTPUTS 0055 0056 I=l ••• LX IS INPUT VECTOR HALVED OR DOUBLED. XIII 0057 0058 I=l ••• LX IS INPUT VECTOR HALVED OR DOUBLED. IXI II 0059 0060 EXAMPLES 0061 0062 1. INPUTS - IXII ••• 3) 1,-4.9 LX-3 0063 IXII ••• 3) 2,-8,18 OUTPUTS - DUBLX IX(l ••• 3) 0,-2,4 0064 HALVX 0065 0066 2. INPUTS - IXI1 ••• 3) - OCT 000001000000.-000004000000,000011000000 0067 LX=3 0068 OUTPUTS - DUBLX IXII ••• 3) OCT 000002000000, -000010000000. 000022000000 0069 0070 HAlVX IXII ••• 3) OCT 000000400000, -000002000000, 0071 000004400000 0072 0073 3. INPUTS - XJI ••• 31 = 1.,-4.,9. LX-3 0074 OUTPUTS - DUBLL X(I ••• 3) - 2.,-8.,18. 9129/64 ... OUBLX •_...................... •••••••••••••••••••••••• (PAGE PROGRAM LISTINGS X(1 ••• 31 = .5,-2.,4.5 • 4. INPUTS - XIII = 3.11 LX:l OUTPUTS - OUBLL XIII 6.34 HALVL XII) = 1.585 HALVX 01 OU8LL HALVL PIE 8CI CLA STO TRA CLA STO CLA STO CLA STO TRA CLA STO TRA CLA STO 02 05 -• .. IPAGE HALVL OU8LX DUB LX •••••••••••••••••••••••• 21 -• - •••••••••••••••••••••••• .. CLA STO eLA STO SXO CLA ADD STA STA CLA" POX LOOP NOP 06 01 NOP NOP K1 K2 K3 K4 K5 K6 K7 KB K9 K10 LXD TRA PZE CLA ALS STO ARS CAL SLW ACL SUB OCT END TZE TlX I,OU8LX K3 06 01 K5 06 K2 LOOP K4 07 05 K8 06 02 K9 06 K6 LOOP K1 07 DU8LX-2,4 1,4 Kl LOOP SET ALS SET ARS 1 SET CLA .. ,4 AND STO ... ,4 SET ACL K10 SET SUB KI0 SET CAL.-,4 ANO SLW "",4 SAVE XR4 SET Y+1 C7 2,4 0,4 SET XR4 FOR N DATA .... 8ELOW=Y+ 1 OUBLX HALVX OU8LL HALVL CLA •• ,4 CLA ... ,4 CAL ... ,4 CAL •• ,4 01+1 ALS 1 ARS 1 ACL K10 SUB K10 STO •• ,4 STO •• ,4 SLW".,4 SLW ... ,4 LODP,4,1 DUBLX-2,4 3,4 1 *.,4 1 •• ,4 1 .*,4 *.,4 KID K10 001000000000 EXIT 0015 0016 0011 0018 0079 0080 0081 0082 0083 0084 00B5 0086 0081 0088 00B9 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 21 *.* ••• ..* •••• ENDFIl ~ •••••••• ** •• . • * ••• * ••• ~*.* •••••• *.* •• PROGRAM LISTINGS •••••••••••••••••••••••• * REFER TO REREAD .••••••••••••••••••••••• ..* EOFSET •••••••••••••••••••••••• REFER TO REREAD ENDFll .. • ••••••••••••• *** ••••••• REFER TO REREAD ••••••••••••• ****.* ••••• .. EOfSET .. •••••••••••••••••••••••• REFER TO REREAD . •••••••••••••••••••••••• •••••••••••••••••••••••• - PROGRAM 1I STINGS EXCHVS •••••••••••••••••••••••• eXCHVS .. •••••••••••••••••••••••• .. LAST CARD IN DECK IS NO. 00B3 0001 0002 0003 0004 0005 0006 ----ABSTRACT---0001 • OOOB 0009 - nTlE - EXCHVS 0010 • EXCHANGE ANY TWO VECTORS 0011 EXCHVS EXCHANGES ANY TWO VECTORS 0012 It 001.3 0014 It LANGUAGE - FAP SUBROUTINE IFORTRAN-II COMPATIBLEI 0015 - EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) .. STORAGE 0016 REGISTERS -22 0011 .. SPEED LENGTH OF VECTORS - 31 + LO-LXY MACHINE CYCLES, LXY 001B .. AUTHOR - S.M. SIMPSON, AUGUST 1963 0019 • ----USAGE---0020 0021 .. TRANSFER VECTOR CONTAINS ROUTINES - INONE) 0022 0023 AND FORTRAN SYSTEM ROUTINES - (NONEI 0024 .. FORTRAN USAGE 0025 0026 .. CALL EXCHVSILXY,X,Y) 0021 0028 - INPUTS 0029 0030 LXY IS COMMON LENGTH OF THE TWO VECTORS. SHOULD EXCEED 0 XII) I=L ••• LXY IS A VECTOR IN ANY MODE 0031 0032 YII! I=l ••• LXY IS A VECTOR IN ANY MOOE 0033 .. OUTPUTS 0034 STRAIGHT RETURN WITH NO ACTION IF LXY LSTHN 1 0035 l=l ••• LXY IS XI I! = INPUT VALUE OF YI I I 0036 XIII 0031 0038 l:l ••• LXY IS YI II '" INPUT VALUE OF XII) YIII • 0039 EQUIVALENCE IX,YI IS PERMITTED (SAME THING AS NO ACTION) 0040 0041 •.. EXAMPLES 0042 0043 0044 .. L. INPUTS - Xl1 ••• 31 = I., 2 •• 3. IXlI1 ••• 31= 2. 4. 6 .. !X2=4 IX3=5 IX4=0 IX5=1 0045 0046 USAGE CALL EXCHVSI3, X, IX1) 0041 • CALL EXCHVSll,IX2,IX3) 0048 .. CALL EXCHVSIO,IX4,IX51 .. CALL EXCHVSI3, X, X) 0049 0050 .. OUTPUTS - Xll ••• 3) 2, 4. 6 [XlI1 ••• 3) '" 1., 2 •• 3. 0051 It IX2 = 5 IX3 4 IX4 = 0 IX5 = 1 INO OUTPUT CASE) 0052 .. 0053 • 0054 • PROGRAM FOLLOWS BELOW 0055 0056 0051 .. NO TRANSFER VECTOR 0058 HTR XR4 o 0059 I, EXCHVS BCI 0060 • ONLY ENTRY. EXCHVSILXY,X,YI EXCHVS-2,4 0061 EXCHVS SXD 0062 CLA 2.4 AIX)+l 0063 Kl ADO 0064 STA GETl 0065 STA STORE! 0066 3,4 CLA 0061 AIYI+1 ADO Kl 0068 GET2 STA 0069 STORE2 STA 0070 CLA. 1,4 LXY Kl 0011 TMI LEAVE 0012 POX 0,4 0073 LEAVE,4,O TXL 0074 .. EXCHANGE LOOP EXCHVS (SUBROUTINE I FAP -eXCHVS COUNT 100 LBL EKCHVS EXCHVS ILXY,X,YI ENTRY - ... . - . . .. .. . .. . ... . . - 9/29/64 ..•••••••••••••••••••••••• .. EXCHVS PROGRAM LI ST INGS •••••••••••••••••••••••• IPAGE Z) GETl GETZ STORE2 STORE 1 CLA LOQ STO STQ TIX .. EXIT LEAVE LXD TRA END •• ,4 •• ,4 •• ,4 .·,4 GET 1,4,1 EXCHVS-2,4 4,4 .•••••••••••••••••••••••• . EXCHVS • ••••••••••••••••• * ••••• IPAGE ** ** ** ** A(Xl+l AIY)+l AIY)+l AIX)+l 0075 0076 0077 0078 0079 0080 0081 0082 0083 21 _.•..................... EXPAND • • •••••••••••••••••••••••• PROGRAM LISTINGS •••••••••••••••••••••••• • EXPAND .. EXPAND (SUBROUTINE) 9/4/64 LAST CARD IN DECK IS NO. 0379 0001 • FAP .EXPAND 0002 COUNT 500 0003 LBL EXPAND 0004 ENTRY EXPAND IX, LX, MLPLYR, XPNDED, LXPNDD) 0005 0006 • 0007 • ----ABSTRACr---0008 • 0009 • .. TI TLE - EXPAND 0010 .. HI-SPEED EXPANSION OF A VECTOR UNDER CUBIC INTERPOLATION 0011 0012 • EXPAND TAKES A VECTOR OF LENGTH LX AND CREATES AN 0013 OUTPUT VECTOR OF LENGTH M*ILX-l)+l IN WHICH THE FIRST, 0014 • THE IM+l)-TH, ••• , THE IM*ILX-l)+l)-TH VALUES ARE 0015 • THE SAME AS THOSE OF THE INPUT VECTOR, AND IN WHICH THE 0016 REMAINING VALUES ARE INTERPOLATED WITH UNIFORM SPACING 0017 BY EXACT FITTING CUBICS, EXCEPT THAT QUADRATICS ARE USED 0018 AT THE TWO ENDS. THE EXPANSION FACTOR M IS AN INPUT 0019 • PARAMETER GREATER THAN ZERO. LINEAR INTERPOLATION IS 0020 • USED IF LX % 2. A PURE COpy OCCURS IF LX % 1 OR IF 0021 • M 1 • 0022 "• 0023 .. LANGUAGE - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) 0024 .. EQUIPMENT - 709,7090,7094 IMAIN FRAME ONLY) 0025 .. STORAGE - 189 REGISTERS 0026 .. SPEED - ON THE 7090, EXPAND TAKES ABOUT 0027 360+10*lX+800"IM-l)+94"IM-l)"LX MACHINE CYCLES, 0028 "• PROVIDED LX EXCEEDS 3. 0029 - S.M. SIMPSON, JUNE 1964 0030 • AUTHOR 0031 0032 • ----USAGE---0033 0034 • • TRANSFER VECTOR tONTAINS ROUTINES - INTOPR 0035 • AND FORTRAN SYSTEM ROUTINES - NOT ANY 0036 0037 "• FORTRAN USAGE 0038 • CALL EXPAND IX, LX, MLPLYR, XPNDED, LXPNDD) 0039 0040 0041 0042 • INPUTS 0043 • XI II l:l ••• LX IS THE VECTOR TO BE EXPANoeD. 0044 0045 • LX SHOULD EXCEED ZERO • 0046 0047 • IS THE EXPANSION FACTOR, M, DESCRIBED IN ABSTRACT. MLPLYR 0048 SHOULD EXCEeD ZERO. 0049 • 0050 • 0051 • STRAIGHT RETURN WITH NO OUTPUT IF LX LSTHN% 0, OR IF 0052 • OUTPUTS LX EXCEeDS 1 BUT MLPLYR IS LSTHN% O. FOR 0053 • LX % 1 XPNDEDll) IS SET XII) REGARDLESS OF 0054 • MLPL YR • 0055 0056 .. XPNDEDII) l%l ••• LXPNDD IS THE EXPANDED VECTOR DESCRIBED IN 0057 0058 • ABSTRACT. IF MLPLYR" I, XPNDEDII) " XII). 0059 LXPNDD MLPLYR*ILX-l)+l IF LX EXCEEDS 1 . 0060 0061 " 1 IF LX 1 • 0062 • 0063 .. EXAMPLES 0064 0065 " 1. THIS EXAMPLE EXERCISES ALL PATHS IN EXPAND, EXCLUDING ILLEGAL LX 0066 0061 • AND MLPLYR VALUES, ON A SIMPLE LINEAR X SERIES. 0068 .. INPUTS - Xll ••• 5) % 0.,6.,12.,18.,24. AND LET XPNDED BE A THREE 0069 .. DIMENSIONAL ARRAY OF DIMENSION XPNDEDI16,5,31, ALL 0070 " ELEMENTS OF WHICH HAVE 8EEN SET TO THE CONSTANT 0071 .. VALUE % -9.0 • 0072 .. USAGE DIMENSION LXPNDD(5,3) 0073 0074 • DO 10 MLPLYR" 1,3 . .. . % . .. .. .. . . .. .... . .. . • •••••••••••••••••••••••• •••••••••••••••••••••••• • • EXPAND •••••••••••••••••••••••• PROGRAM LISTINGS ........................ • •••••••••••••••••••••••• (PAGE • • • • • • • • • • • • • • • • • • • • = 00 10 lX 1.5 CALL EXPAND IX. LX. MLPLYR. XPNDEO Cl. LX. MlPlYR). 1 LXPNOOILX. MlPlYRl1 OUTPUTS - XPNDED(1 ••• 16,1.11 0 •• -9 •• -9 •••••• -9. XPNDEDll ••• 16,2.11 0 •• 6.,-9 •• -9., •••• -9. XPNDEDll ••• 16.3,11 0 •• 6.,12 •• -9 •• -9., •••• -9. XPNOEDIl ••• 16,4.11 0 •• 6 •• 12 •• 18.,-9•• -9 •••••• -9. XPNDEDll ••• 16.5,11 0.,6 •• 12 •• 18 •• 24 •• -9 •• -9 ••••• ,-9. XPNDED(I ••• 16,1,21 0 •• -9 ••••• ,-9. XPNDEDll ••• 16.2.21 0 •• 3 •• 6 •• -9 •••••• -9. XPNDEDll ••• 16.3.2J 0 •• 3 •• 6.,9.,12 •• -9., •••• -9. XPNDEO(1 ••• 16~4,2) = 0.,3., ••• ,15.,18 •• -9., ••• ,-9. XPNDEOtl ••• 16,5,2) 0.,3., ••• ,21.,24.,-9 ••••• ,-9. XPNOEDll ••• 16,1.31 0 •• -9 •••••• -9. XPNDEDll ••• 16.2.3J 0 •• 2 •• 4 •• 6 •• -9 •••••• -9. XPNDEDll ••• 16.3,31 0 •• 2 •••••• 10 •• 12 •• -9 •••••• -9. XPNDEDl1 ••• 16.4,31 0.,2 ••••• ,16.,18 •• -9 •••••• -9. XPNDEDll ••• 16.5.31 Q •• 2 •••••• 22.,24.,-9 •• -9 •• -9. LXPNDDll ••• 5.1 ••• 31 1.2,3,4.5,.1,3,5.1.9,.1,4,1,10.13 10 = = = - SAME AS EXAMPLE 1 •• EXCEPT LXPNDD = -9 CAll EXPAND IX.O,3.XPNDEDI1.1.11.lXPNDD) CAll EXPAND IX.2.0.XPNDEDll.l.ll.lXPNDDJ CALL EXPAND IX.-3.-1,XPNDEDll,1,11.lXPNDDI • • • • INPUTS • OUTPUTS - XPNDEDI1 ••• 16.I,11 • • • = -9 •• -9., ••• ,-9. LXPNDD • PROGRAM FOLLOWS BELOW • • • • TRANSFER VECTOR CONTAINS INTOPRINDATA. YLO, DELY, Y. OPER) HTR HTR HTR BCI o o o XRl XR2 XR4 I,EXPAND • ONLY ENTRY. EXPAND(X. LX, MlPLYR. XPNDED, LXPNDDI EXPAND SXD SXD SXD EXPAND-4.1 EXPAND-3,2 EXPAND-2,4 • • • ADDRESS SETTINGS • • • • CLA ADD STA STA SUB STA SUB STA SUB STA CLA ADD STA STA 1,4 Kl CLAI LDQl Kl LDQ2 Kl LDQ3 Kl LDQ4 4,4 Kl STOI ST02 A(XI AIXI+l AIXI A(X)-l AIXI-2 AIXPNDEDI AIXPNDED)+l CHECK OUT LX AND MLPLYR CLA. STO STD CAS TRA TRA TRA LXGR1 CLA* STO STD STD 2.4 LX TXLl KOl LXGRl EVEN LEAVE 3,4 M TXIl TXI2 • IPAGE • 2. ILLEGAL CAll STATEMENTS • EXPAND - 2. lX ILX = 11 MLPLYR, CALLED M FOR SHORT = -9 0015 0016 0077 0018 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 2) •••••••••••••••••••••••• EXPAND • * •••••••••••••••••••••••• IPAGE •••••••••••••••••••••••• PROGRAM LISTINGS • 31 MGRI CAS TRA TRA TRA LRS ORA FAD STO KDl MGRI EVEN LEAVE (PAGE 1M 1) 18 OCTK OCTK DElY M FLOATED * • INTERPOLATE 8ETWEEN XII) AND X(2), LX GRTHN= 2 • * lEFT CLA STO CLA STO STD STO CtA SUB TNZ ClA STO TSXLFT TSX • * • KD3 NOATA KOI IXLO IF ITlO NSETS lX K02 TSXlFT KD2 NOATA IJljTRP.4 NDATA = 3 IXlO = IFIllO NSETS = 1 RESET NOATA TO 2 FOR LX =2 INTERPOLATE 8ETWEEN X(2) AND XllX-l,. PROVIDED LX EXCEEDS 3 CENTER ClA STO ClA STO CLA SUB STO TMI TZE TSX KD4 NOATA K02 IXlO lX KD3 NSETS RIGHT RIGHT INTRP.4 =4 NOAlA IXLO =2 NSETS IIFITlO STILL 11 lX-3 * • INTERPOLATE BETWEEN XILX-l) AND X(LX), PROVIDED LX EXCEEDS 2 * RIGHT CLA STO ClA STO CLA SUB STO SUB STO TMI TZE TSX • K03 NDATA KDI NSETS LX KOI IXlO KOI IF I llO EVEN EVEN INTRP,4 NOATA 3 NSETS 1 IXLO = LX-l IFIllO = LX-2 * FINAllY INSERT X(I.2, •••• LXI INTO XPNOEDll.M+l ••••• M.ILX-ll+1) * AND COMPUTE AND SET lXPNOD • EVEN CLAI STD1 TXIl TXll AXT AXT ClA STO TXI TXI TXL LXD ClA SUB ClAl,l,*. EXPANO-2,4 LX K01 TNl XCAtA CLA TRA XCAIA XCA MPY AlS ADD SlOtA STO* * 1,1 1.2 **t1 ··,2 *+1,2,*. ·+"1,1,1 I OF XI II J OF XPNDEDIJ) *. Al>d+l .* A(XPNDEO)+~ M *. ** LX KOI STOIA M 17 KOI 5,4 • EXPAND •••••••••••••••••••••••• LXPNDD ILX=ll • 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0113 0114 0175 0176 0117 0118 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0211 0218 0219 0220 0221 0222 0223 3) * •••• * •••• *.*.***. . ..••••••EXPAND .•••••••••••••••••••••••• . EXPAND PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 4) •••••••••••••••••••••••• IPAGE 4) EXIT ... lEAVE LXD ... ... ... . EXPAND-4, 1 EXPAND-3,2 EXPAND-2,4 6,4 lXD lXD TRA INTERNAL SUBROUTINE INTRP LINKAGE XR4, RETURNS TO 1,4 ASSUMES NOATA IXLO IF I no NSETS ..... .. IS IS IS IS SET (= 2, 3, OR 41 SET (= 1, 2, OR lX-l) SET IIXLO OR IXlO-l) SET 1= 1 OR LX-31 FORMS AND STORES INTERPOLATIONS (EXCLUDING ENDS) BETWEEN X(IXLOI AND XIIXLO+l) XIIXlO+l1 AND XIIXLO+21 ETC XtIXLO+NSETS-ll AND XtIXLO+NSETSI WHERE THE OPERATORS FOR THE FIRST SET ARE FITTED TO XIIFITlOI, XtIFITLO+ll, ••• , XIIFITLO+NDATA-ll ... .. .. INTRP SXA INTSV4,4 .... FOR PURPOSES OF INTOPR, THE FIRST DATA POINT IS AT ARGUMENT YLO = 0.0, THE SECOND AT ARGUMENT DElY M, THE THIRD AT 2M, ETC. HENCE THE Y FOR WHICH WE WANT AN OPERATOR IS Y = 1.0 lIN THE CASE THAT IFITLO = IXLOI OR Y = M+1 {FOR IFITlO = IXlO-11. THE TOTAL NUMBER OF OIFFERENT OPERATORS WE WANT IS M-l. .. .. .. .. .. ... . INITIALIZE Y, YCOUNT, OECREMENT AT TXL2, AND FRSXR2 XCA ... .... LDQ CLA SUB TlE lDQ XCA FAD STO CLA STO CLA ADD SUB STD CLA SUB XCA MPY ALS ADD S10 K1L Y KOl YCOUNT IF ITLO NSETS KOI TXL2 IXLO KD1 IPREPARE FOR IFITLO = IXLOI Y YCOUNT DECREMENT AT TXL2 M 17 K02 FRSXR2 FRSXR2 LOOP FOR SUCCESSIVE Y VALUES BEGINS HERE ACQUIRE .GETOPR STl STZ SXA TSX TSX TSX TSX TSX TSX GETSV4 AXT lXO LXD .. YLO IXLO IF ITLO XCA DELY OPERATOR, THEN INITIALIZE XR1,XR2 OPER3 OPER4 GETSV4.4 $I NTOPR,4 NDATA,O YLO,O OELY,O Y,O OPER1,0 (CLEAR FOR CASES NDATA = 2 OR 31 ·*,4 ... IF lTLO,l FRSXR2,2 XR4 PRIOR TO INTOPR 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 024B 0249 0250 0251 0252 0253 0254 0255 0256 0257 025B 0259 0260 0261 0262 0263 0264 0265 0266 0267 026B 0269 0270 0271 0272 0273 0274 0275 0276 0277 0278 0279 02BO 0281 0282 0283 0284 02B5 0286 02B7 02B8 0289 0290 0291 0292 0293 0294 0295 0296 0297 0298 •••••••••••••••••••••••• • ~.* ••• * •••• * PROGRAM LISTINGS EXPAND •*•••••• * •••• (PAGE 5) •••••••••••••••••••••••• • ••••••••••••••••••••••••• EXPAND (PAGE • INNER lOOP OVER THE SETS TO FORM • • • XII)"OPER1 + X(I+1).OPER2 + XII+2)"OPER3 + X(I+3)"OPER4 • " RESULT IS STORED IN XPNDEOIJI ASSUMES I IS IN XRl, J IS IN • • JUMPS BY • EVAl lOOl l002 l003 l004 ST02 TXI2 TXL2 "• • STZ lOO FMP FAD STO LOO FMP FAD STO lOO FMP FAD STO LDO FMP FAD STO TXI TXI TXl 1, J JUMPS BY SUM ·.,1 OPERI SUM SUM *.,1 OPER2 SUM SUM •• ,1 OPER3 SUM SUM •• ,1 OPER4 SUM **,2 *+1,2 .. ** .+1,1,1 EVAl,l,". XR2 M •• AIXl+l "" A()O "" A(Xl-l •• A(XI-2 ." A(XPNOEO)+l ." M ." IFITlO+NSETS-1 RESET FOR ANOTHER Y VALUE AND CHECK COMPLETION • •INTSV4 CLA ADO STO CLA FAD STO ClA ADD STO CAS HPR TRA TRA FRSXR2 KD1 FRSXR2 INCREASE INITIAL OUTPUT STORAGE BY 1 Y INCREMENT Y BY 1.0 Kll Y YCOUNT KD1 YCOUNT INCREMENT AND CHECK Y COUNTER 11 ••• M-ll M •INTSV4 GETDPR (IMPOSSIBLE) DONE MORE Y VALUES • EXIT FROM INTERNAL SUBROUTINE "• AXT TRA ." XR4 AT START OF INTRP CONSTANTS •Kl KOI K02 KD3 K04 KIL YlO OCTK PZE PZE PZE PZE PZE DEC DEC OCT IFITLO NSETS M lX NDATA OELY Y PIE PZE PZE PZE PZE PZE PZE • • TEMPORARIES • IXLO PZE • *.,4 1,4 YCOUNT PZE FRSXR2 PZE 0,0,1 0,0,2 0,0,3 0,0,4 1.0 0.0 233000000000 0,0,". 0,0,." 0,0,." 0,0,"" 0,0,.- ..**,_., ,_.,--•• 0,0,.· •• •• .. ." ." ." 1, 2, OR lX-l IXlO OR IXlO-l 1 OR lX-3 M" MLPLYR LX 2, 3, OR 4 ** FlOATF(M) •• " DELY·(IXLO-IFITlO)+l, (+2,+3, ••• ,+M-1) 1,2, ••• ,M-l "" M"(IXLO-11+2 (+3.+4 •••• ,+Ml .* 0299 0300 0301 0302 0303 0304 0305 0306 0301 0308 0309 0310 0311 0312 0313 0314 0315 0316 0311 0318 0319 0320 0321 0322 0323 0324 0325 0326 0321 0328 0329 0330 0331 0332 0333 0334 0335 0336 0331 0338 0339 0340 0341 0342 0343 0344 0345 0346 0341 0348 0349 0350 0351 0352 0353 0354 0355 0356 0351 0358 0359 0360 0361 0362 0363 0364 0365 0366 0361 0368 0369 0310 0311 0312 0373 5) •••••••••••••••••••••••• • PROGRAM LI STINGS • EXPAND •••••••••••••••••••••••• (PAGE 6) OPER4 OPER3 OPER2 OPERI SUM PIE PIE PZE PIE PZE END •••••••••••••••••••••••• EXPAND • * • ••••••••••••••••••••••• (PAGE .... ,._,-, .. , .. .", .. ,-. .. , .... ,, .... 0374 0375 0376 0377 0378 0379 .", \ 6) •••••••••••••••••••••••• - FACTOR ••••••••••••••••••••••••• PROGRAM LI STINGS 9/8/64 FACTOR (SUBROUTINEI FAP -FACTOR COUNT 450 FACTOR LBL FACTOR (SPECT,N,L,WAVE,SPACEI ENTRY . --.. ..• . •• • • • • • • • . • ..• .. • •.. ..• • -••• • • • • • • • • • • • • • • ---• • -•• • • • • • • • • • • • - ........................... • FACTOR •••••••••••••••••••••••• LAST CARO IN OECK IS NO. 0488 0001 0002 0003 0004 0005 0006 0001 ---ABSTRACT---OOOB 0009 TITLE - FACTOR 0010 FACTOR POWER SPECTRUM TO FIND MINIMUM PHASE WAVELET 0011 0012 FACTOR USES THE METHOD OF KOLMOGOROV (REF.- 1. ROBINSON,E_ 0013 A., M.I.T. PH.D. THESIS,GEOPHYSICAL ANALYSIS GROUP REPORT 0014 1,1954. 2. SIMPSON ET AL., SCIENTIFIC REPORT NO.2 OF 0015 CONTRACT AF 19160411318.) TO FACTOR THE POWER SPECTRUM 0016 AND THUS PRODUCE THE MINIMUM PHASE WAVELET. 0011 THE RESTRICTIONS ON APPLICABILITY OF THE METHOD REQUIRE 0018 THAT THE INPUT SPECTRUM BE NON-NEGATIVE AND NON-ZERO. 0019 HENCE SPECTII), THE INPUT SPECTRUM, [S CHECKED AND ANY 0020 VALUES WHICH ARE LESS THAN 10 •• 1-6) OF THE MAXIMUM VALUE 0021 OF SPECHI) ARE SET EQUAL TO 10"'(-6) OF THE MAXIMUM.CTHU 0022 FEATURE MAY EASILY BE REMOVED FROM THE SYMBOLIC DICK). 0023 0024 ONE HALF OF THE NATURAL LOG OF THE SPECTRUM IS COMPUTED 0025 AND EXPANDED IN A COSINE SERIES. THE COEFFICIENTS OF THE 0026 EXPANSION ARE COMPUTED BY TRAPEZOIDAL RULE INTEGRATION 0021 ISAME AS TRIGONOMETRIC INTERPOLATION. HENCE THE FIRST AND 0028 LAST TERMS IN THE SPECTRUM ARE WEIGHTED BY 1/2 ANO THE 0029 SUMMATION AND COSINE WEIGHTING ARE DONE SIMULTANEOUSLY 0030 BY SUBROUTINE COSP. THE COEFFICIENTS OF THE COSINE 0031 EXPANSION ARE TRANI II, Ial,L. THE EXPONENTIAL 0032 0033 0034 L EXP •• CTRAN(1)+ SUMITRANII).CZ •• CI-l)))) 0035 0036 1=2 0031 MUST BE EXPANDED IN A CONTINUED PRODUCT OF POLYNOMIALS IN 0038 Z. THE POLYNOMIALS ARE THEN MULTIPLIED OUT AND 6ROUPED IN 0039 THE FORM 0040 0041 L 0042 P " SUM IWII).IZ •• CI-ll)) 0043 0044 I" 1 0045 WHERE L IS THE LENGTH OF THE WAVELET, AND WIll IS THE 0046 DESIRED WAVELET. 0041 0048 0049 PROGRAM NOTES THE EXPANSION OF THE EXPONENTIAL AND MULTIPLICATION OF 0050 0051 THE RESULTING POLYNOMIALS MAY BE SIMPLIFIED BY THE 0052 FOLLOWING CONSIDERATIONS - THE EXPONENTIAL MAY BE 0053 REPRESENTED AS A CONTINUED PRODUCT OF POLYNOMIALS 0054 WHERE THE ITH POLYNOMIAL IS OF THE FORM 0055 L-I 0056 P(II-(SUM( CII,JI.IZ •• III+ 11.EXP •• (TRANllll 0051 0058 1=1 WHERE 0059 CII,Jl= ITRANI11/I).(TRANI2)/21 ••••••• CTRANIII/IJ/IIJ 0060 0061 FOR J"K-I CII,JI= 0 FOR J NOT =K.I 0062 THE CII,OI TERMS ARE 1 FOR ALL I. 0063 0064 WE ARE ONLY INTERESTED IN THE FIRST L TERMS OF THE WAVELET. 0065 SO WE NEEO ONLY CONSIOER TERMS IN THE POLYNOMIALS WITH 0066 EXPONENTS LESS THAN OR -M,MaL-I. WE CAN THEN COMPUTE THE 0061 WAVELET COEFFICIENTS BY PARTIAL CONVOLUTION OF THE 0068 POLYNOMIAL COEFFICIENTS. THAT IS, 0069 0010 0011 0012 WHERE WAVEII) IS THE WAVELET, M=L-l, AND THE. SYMBOL 0013 DENOTES CONVOLUTION. 0014 .•••••••••••••••••••••••• .. FACTOR ...................... _* (PAGE PROGRAM LISTINGS .. IT WILL BE NOTED THAT IF THE CONVOLUTION IS REPRESENTED IN STEPS BY B(M-ll= C(M-1,J).CIM,J), B(K)=CIK,J)-BIK+ll BY CAREFUL INSPECTION OF THE FORM OF THE CII,J) ONE CAN WRITE DOWN THE BIN) BY INSPECTION FOR N=L/2 (ROUNDED DOWN) +1. THIS CUTS DOWN THE TOTAL LABOR BY NEARLY 1/2. BIN)= 1,0,0, ••••• ,0,CIN,N),C{N+l,N+1), ••••• C(M,M) FACTOR SETS UP BIN) AND THEN USES AN INTERNAL SUBROUTINE TO SET UP CIN-l,J) FOR J=O,M. THE INTERNAL SUBROUTINE PARCON COMPUTES THE PARTIAL CONVOLUTION WHICH IS BIN-I). THE NEXT CII.J) IS SET UP BY CCOM AND THE NEXT Btl-II COMPUTED BY PARCON. THIS IS REPEATED UNTIL ALL THE PARTIAL CONVOLUTIONS HAVE BEEN DONE. THE RESULTING WAVELET IS THEN SCALED BY EXP •• (TRANl1). THE OUTPUT OF PARCON FOR ONE STAGE IS THE INPUT FOR THE NEXT STAGE SO THAT THE ADDRESSES B1 AND B2 IN THE PARCON ROUTINE ARE REVERSED BETWEEN STAGES. -.. --• -••. • .. .. .. . .. .. . ..... .. ..... .... .. ..... ... .. . • ..•.. .. • • • LANGUAGE EQUIPMENT STORAGE SPEED AUTHOR - FAP, SUBROUTINE IFORTRAN II COMPATIBLE) 109,1090 IMAIN FRAME ONLY) 30B DECIMAL REGISTERS 2200+94L+16L*-2+3L--3+210N+31L-N MACHINE CYCLES J.N. GALBRAITH NOV. 1, 1961 ----USAGE---- TRANSFER VECTOR CONTAINS ROUTINES - MAXAB, COSTBL, COSP AND FORTRAN SYSTEM ROUTINES - LOG, EXP FORTRAN USAGE CALL FACTORISPECT,N,L,WAVE,SPACE) INPUTS SPECTII) l=l,N N NUMBER OF POINTS IN SPECTRUM MUST BE GRTHN O. L LENGTH OF DESIRED WAVELET. MUST BE GRTHN 0, LSTHN= N. SPACE I I) SPECTRUM FROM ZERO TO PI I=l,NSPACE. NSPACE=3-L+N+1. WORK SPACE FOR COMPUTATIONS. THE QUANTITIES B21I1,CIIl,TRANII),WORKIII, AND COST(!) WHICH ARE MENTIONED IN THE ABOVE ABSTRACT ARE IN SPACEII) IN THE FOLLOWING MANNER- (SEE OUTPUTS FOR LOCATION OF B1) B2(1),1=1,L IS SPACEll) TO SPACEIL). SPACE FOR PARTIAL CONVOLUTION. COSTII),I=l,L+l IS SPACEll) TO SPACEIL+l). SPACE FOR COSINE TABLE FOR COSINE SERIES EXPANSION. CII),I=1,L IS SPACEIL+2) TO SPACEI2L+11. SPACE FOR COLUMN OF CII,J) MATRIX • WORKII),I=l,N IS SPACEI2L+2) TO SPACEI2L+N+l). WORK SPACE FOR SPECTRUM • TRANIII,I=l,L IS SPACEI2L+N+2) TO SPACEI3L+N+1). SPACE FOR COSINE TRANSFORM. NOTENO CHECKS ARE MAOE ON THE VALUES OF N ANO L. BOTH MUST BE GREATER THAN 0, AND L MUST BE LESS THAN OR =N. ILLEGAL VALUES MAY RESULT IN INCORRECT WAVELETS OR PROGRAM LOOPS. .. OUTPUTS .. • • • .• .• WAVEII) I=I,L OUTPUT MINIMUM PHASE WAVELET. SAME SPACE IS USED FOR Blll),I=I,L. IF THE INPUT SPECTRUM CAN BE DESTROYED, SPECT AND WAVE CAN BE THE SAME. WE NOTE THAT N IS GRTHN OR EQUAL TO L SO THAT THERE IS NO SPACE DIFFICULTY INVOLVED IN THIS EQUIVALENCE. EXAMPLES .. 1. INPUTS • .. (PAGE .. . • • .. .. .. FACTOR •••••••••••••••••••••••• 21 .. • .• • •••• * ••• _•••••••••••••• FOR A CONTINUOUS SPECTRUM 0015 0016 0011 001B 0019 0080 OOBI 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 014B 0149 2) •••••••••••••••••••••••• • fACTOR • PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 31 • • • •. • . • • • • • • • • • • • •••••••••••••••••••••••• fACTOR • •••••••••••••••••••••••• • (PAGE SPECT= 1.25+COS(WI, W~O,PI THE WAVelET IS WAVE= 1.,.5,0.,0., •••••• ,0. fOR THE DISCRETE CASE THE NUM8ERS WILL NOT COME OUT EXACTLY THE SAME OUE TO ROUND Off AND APPROXIMATION. FOR A TEST CASE THE INPUT SPECTRUM CAN BE SET UP WITH A FORTRAN LOOP. SPECTlll=1.25 +COSFIFLOATF(I-l).W) ,I=l,N W =PI/FLOATFIN-1) WHERE N IS THE LENGTH OF THE SPECTRUM. RESULTS ARE GIVEN BELOW FOR N=500 OUTPUTS - WAVEl1 ••• 5)= 1.000EOO,0.5000EOO,-O.4899E-06~-0.1327E-Ol THE HIGHER TERMS ARE EVEN SMALLER WITH WAVE(20) lESS THAN 10··1-8) PROGRAM FOLLOWS BelOW PZE BCI l,FACTOR FACTOR SXA RETURN,I SAVE IR1 SXA RETURN+1,2 SAVE IR2 SXA RETURN+2,4 SAVE IR4 SXD FACTOR-2,4 1,4 CLA SPECTRUM ADDRESS STA MAX+2 ADO ONE STA LOOP 1 ClA. 2.,4 GET N IN DECREMENT STO ENOl STO N CALL FACTOR,SPECT,N,L,WAVE,SPACEI • SUB DONE N-1 STO NN ADO DONE LRS 1B N IN ADDRESS STO NA SUB ONE ORA CONST FAD CONST NF STO Nf=FLOATlNG IN-1I 3,4 ClA. GET L IN DECREMENT STO L STD END3 ARS 18 L IN ADDRESS STO LA CLA 4,4 GET B1 AND WAVELET ADDRESS STA WAVAD STA PAR+1 STA BFST STA LOOP2 STA LOOP3+l STA LOOP4+2 5,4 CLA GET B2 AND COST ADDRESS STA B2AD STA PAR+2 STA CST+2 STA CSP+4 SUB LA SUB ONE ADDRESS OF C PAR+3 STA STA COM+ 1 SUB ADDRESS OF WORK LA STA WGT+3 STA WGT+5 STA CSP+l STA CSP+2 ADO ONE ADDRESS OF WORK+1 STA ENDl-2 STA WGT STA WGT+2 SUB NA SUB ONE ADDRESS OF TRAN CSP+9 STA STA LOOP3 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0180 0181 0182 0183 0184 0185 0186 0181 0188 0189 0190 0191 0192 0193 0194 0195 0196 0191 0198 0199 0200 0201 0202 0203 0204 0205 0206 0201 0208 0209 0210 0211 0212 0213 0214 0215 0216 0211 0218 0219 0220 0221 0222 0223 0224 3) •••••••••••••••••••••••• FACTOR • ••••••••••••••••••••••••• (PAGE 41 MAX LOOPI ENOl WGT CST " COSP "CSP • TRAN • MUST BFST LOOP2 END2 LOOP3 END3 CONV PROGRAM LISTINGS •••••••••••••••••••••••• • FACTOR • •••••••••••••••••••••••• STA COM+2 STA SCALE TSX SMAXA8,4 FIND MAXIMUM OF SPECTUM PIE N PIE LOCATION OF SPECTUM •• PIE BIGSP PZE INDEX LOQ BIGSP MAX. OF SPECTUM FMP DEC 10"'1-61 OF MAX STO BIGSP AXT 1,1 CLA .uSPECT + 1 ··,1 CAS BIGSP .+3 TRA SPECT LARGER .+2 TRA SPECT EQUAL CLA BIGSP SPECT LESS $LOG,4 TSX LOGI SPECTI FOP NF LOG( SPECT III N-I) •• ,1 STQ ·."WORK+1 TXI ·+1,1,1 TXl LOOPl,I,.· .·=N .+1,1,-1 TXI •• ,1 •• =WORK+I. WEIGHT LAST CLA FOP TWOO TERM IN SPECTRUM BY 1/2 .... WORK+I STQ ·.,1 CLA •• =WORK. WEIGHT FIRST •• FOP TWOD TERM IN SPECTRUM BY 1/2 STQ ."=WORK •• CLA L SUB DONE STO LL TSX SCOSTBl.4 GO TO COSINE TABLE NN PIE PZE COST GIVES HALF OF COSINE TRANSFORM OF LOGISPECTI EXCEPT FOR TRANU) WHICH IS 2 TIMES NEEDED VALUE. TSX SCOSP,4 GO TO COSINE TRANSFORM PZE WORK SPACE FOR SPECTRUM •• PZE WORK SPACE FOR SPECTRUM •• PZE NN N-l PZE COST •• PZE NN N-1 PZE ZERO JMIN=O PZE LL JMAX=L-l PZE ONED 1.0 PZE TRANCCOSTR) •• CONTAINS COSINE TRANSFORM OF 1/2 LOG(SPECT). FIRST TERM BE WEIGHTED BY 1/2. (SEE SYMBOLIC ADDRESS ·.SCALE .... ) CLA L ARS 1 LIZ ANA MASK ADD Ll2+1 DONE M M=L/2+1 STO CLA ONED 1.0 •• s8l. STO B1I0)=1.0 •• AXT 1,1 CLA M M SUB DONE M-l END2 STD ••• 1 CLEAR Bl STZ TXI ·+1,1,1 "-2.1, •• TXL ."=M-I LXD M.l IR1=M CLA TRAN .",1 •• ,1 STO 81 TXI "+1.1,1 LOOP3,I, •• TXL L IN DECREMENT AXT 1,2 M CLA STO P DONE SUB STD END23 AXT 1,1 CLA P DONE SUB ... (PAGE 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 026B 0269 0270 0271 0272 0273 0274 0275 0276 0277 0278 0279 0280 0281 0282 0283 0284 0285 0286 0287 0288 0289 0290 0291 0292 0293 0294 0295 0296 0297 0298 0299 41 . •••••••••••••••••••••••• •••••••••••••••••••••••• • PROGRAM I f STINGS FACTOR (PAGE 51 COM PAR END23 SCALE LOOP4 END4 RETURN L LL STO SXO TSX PZE PZE TSX PZE PZE PZE CLA LOQ STO STQ TXI TXI TXL CLA ARS L8T TRA CLA STA TRA CLA STA CLA FOP XCA TSX STO CLA STO AXT LOQ FMP STO TXI TXL AXT AXT AU TRA PZE PZE PZE PZE PZE PZE PZE PZE (PAGE P K,2 CCOM,4 ...•• ....... ... 0300 0301 TRAN C PARCON,4 PAR+l PAR+2 PAR+2 PAR+l ,,+1,2,1 "+1,1,1 CONV,I, ... M 18 "+4 WAVAD LOOP4 .+3 B2AD LOOP4 LOCATION OF Bl LOCATION OF B2 LOCATION OF C EXCHANGE LOCATIONS OF Bl AND B2 0302 0303 0304 0305 0306 0307 0308 0309 0310 0311 0312 0313 0314 " .. =M-l 0315 GET M M IN ADDRESS LOW BIT TEST M EVEN, B2 CONTAINS WAVELET MODO, B1=WAVELET 0316 0317 0318 0319 0320 0321 82 ADDRESS. B2 .. WAVELET. 0322 0323 ." TWOD - .. =TRAN(11 0324 0325 0326 SEXP,4 NORM SCALE FOR WAVELET LL EN04 0.1 .... ,I NORM "",I "+1,101 LOOP4,1,". ··,1 • .. ,2 B2 OR Bl SCALE FOR WAVELET WAVELET "·=L-l •• ,4 6,4 0 0 0 0 0 0 0 0 L-l RESTORE IRl RESTORE IR2 RESTORE IR4 K N NN N-l M P NF NA N IN ADDRESS LA L IN ADDRESS WAVAD WAVELET AND Bl ADDRESS BlAO B2 ADDRESS NORM PZE 0 BIGSP PZE 0 INDEX PZE 0 +23)000000000 CONST OCT MASK ocr 777777000000 ZERO PZE 0 1,0,0 ONE PZE 0,0,1 DONE PZE ONED DEC 1.0 TWOO DEC 2.0 DEC DEC .000001 -CCOM -COMPUTES CCP.JI FOR J=O TO L-l .CALLING SEQUENCE TSX CCOM,4 PZE LOCATION OF C(P,OI • PZE LOCATION OF TRAN • RETURN CCDM SXA BACK,l SAVE IRI SXA BACK+l,2 SAVE IR2 SXA BACK+l,4 SAVE IR4 CLA L GET L - •••••••••••••••••••••••• FACTOR • •••••••••••••••••••••••• • 0327 0328 0329 0330 0331 0332 0333 0334 0335 0336 0337 0338 0339 0340 0341 0342 0343 0344 0345 0346 0347 034B 0349 0350 0351 0352 0353 0354 0355 0356 0357 035B 0359 0360 0361 0362 0363 0364 0365 0366 0367 0368 0369 0370 0371 0372 0373 0374 51 •••••••••••••••••••••••• • . fACTOR f'ROGRAM LISTINGS •••••••••••••••••••••••• •••••••••••••••••••••••• 6) IPAGE STD ADDR2+2 CLA P ARS 18 CHS 1,4 ADO STA ADDR3 ADDR4 STA CLA 1,4 STA ADDRI ADD ONE STA ADDR2 P CLS ARS 18 ADD 2,4 STA ST01 CLA ONED ADDR1 STO 2,1 AXT ADDR2 STZ ··,1 .+1,1,1 TXI ADDR2,1,·" TXl STOI CLA ADDR3 STO ." STO TEMPI STO TEMP2 CLA LL 35 lRS DVP P 51 LLS SU8 DONE BACK HE STD END CLA P ,2 POX SXD END-2.2 AXT 1,1 CLA TWOO STO R TEMPI LOOP LOQ FMP TEMP2 FOP R •• ,2 ADDR4 STQ STQ TEMPt R CLA FAD ONEO R STO .. +1,2, .... TXI ,,+1,1,1 TXI END TXL LOOPd."" .*,1 BACK AXT AXT *.,2 AXT .·,4 TRA 3,4 TEMPI PZE 0,0,0 0,0,0 TEMP2 PIE R PZE "PARCON COMPUTES A PARTIAL "CALLING SEQUENCE TSX PARCON,4 " PIE LOCAT ION OF PZE LOCATION OF PIE LOCATION OF PARCON SXA EXT,1 EXT+1,2 SXA EXT+2,4 SXA 2,4 CLA STA REG1 STA REG3 REG3+1 STA ADD ONE STA REG2 CLA 3.4 REG') STA CLA ONED REG1 STO ... ... -- ,,- .•••••••••••••••••••••••• FACTOR • IPAGE GET P L IN ADDRESS ADDRESS OF CIP,P) LOCATION OF CIO) TRAN 1.0 CIO) CLEAR Clll TO CI Ll ··=l TRANIP) CIP,P) INTO MQ Il-I)/P INTO AC Il-ll/P-1 IF ZERO,NO MORE TO DO NOT ZERO, SET TO DO I L-II1P-l TIMES P IN IR2 GET 2.0 INIT IAliZE R TRANI 11 ""=C. CIR+1) COMPUTED. SAVE FOR NEXT C GET R INCREMENT BY 1.0 RE-SET R *.=P. INCREMENT C STORAGE INDEX INCREMENT lOOP COUNTER .... =L-I/P-l. END LOOP CHECK. RESTORE IR 1 RESTORE IR2 RESTORE IR4 RETURN WILL CONTAIN PARTIAL SUM FOR CIP) WILL CONTAIN TR·ANI P) CONVOLUTION OF C AND Bl 81 82 CIX,O) SAVE IR1 SAVE IR2 SAVE IR4 GET LOCA T ION OF B2 LOCATION OF C 1.0 B2101=1.0 0375 0376 0377 0378 0379 0380 0381 0382 0383 0384 0385 0386 0387 0388 0389 0390 0391 0392 0393 0394 0395 0396 0397 0398 0399 0400 0401 0402 0403 0404 0405 0406 0407 0408 0409 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 0440 0441 0442 0443 0444 0445 0446 0447 0448 0449 6) • ••••••••••••••••••••••• it - FACTOR PROGRAM LISTINGS •••••••••••••••••••••••• IPAGE 71 REG2 REG7 REG5 REG4 REG3 REG6 REG8 EXT S AXT CLA STO SUB STO STZ TXI TXL CLA SUB POX SXO PDC SXD SXD AXT LXA CLA STD CLS ARS ADD STA AXT LOQ FMP FAD STO TXI TXI TXL TXI TXL AXT AXT AXT TRA PZE END 2,1 L REG2+2 DONE REGB -",1 -+1,1,1 REG2,l,-M K ,1 REG3+2,1 ,2 REG3+3,2 S,I 0,2 EXT+2,4 S REG6 S 18 1,4 REG4 0,4 •• ,4 .·,2 --,I --,I *+1,4, •• .+ 1,2, •• REG5,4,-. .+1,1,1 REG7-1,l,-- .·,1 •• ,2 ••• 4 4,4 0 •••••••••••••••••••••••• - • FACTOR •••••••••••••••••••••••• GET L CLEAR B2111 TO B21Ll OECREMENT=L K GOES FROM 1 TO M-l. SET BY CALLING LOOP. IRl=M-K S=IRl=M-K ZERO IR2 RESET IR4 GET S LOCATION OF BlIS) CIO) BlI S) B2 82 IM-K) IN DECREMENT -IM-KI IN DECREMENT ··=5 --=L-l RESTORE IRI RESTORE IR2 RESTORE IR4 RETURN IPAGE 0450 0451 0452 0453 0454 0455 0456 0457 0458 0459 0460 0461 0462 0463 0464 0465 0466 0467 0468 0469 0470 0471 0472 0473 0474 0475 0476 0477 0478 0479 0480 0481 0482 0483 0484 0485 0486 0487 0488 7} •••••••••••••••••••••••• - FAPSUM - PROGRAM LISTINGS ...,.....•.••........... • FAPSUM LAST CARD IN DECK IS NO. 0065 0001 0002 -FAPSUM 0003 COUNT 50 0004 FAPSUM LBL 0005 FAPSUM ILD,DATA,SUMCKI ENTRY 0006 0007 ----ABSTRACT---0008 • 0009 -TITLE - FAPSUM 0010 COMPUTES A LOGICAL SUMCHECK 0011 FAPSUM COMPUTES A SUMCHECK BY SUMMING THE CONTENTS OF A 0012 0013 VECTOR WITH THE -ADO AND CARRY LOGICAL WORD- INStRUCTION. 0014 •""LANGUAGE - FAP, SUBROUTINE IFORTRAN 11 COMPATIBLEI 0015 0016 - EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLYI 0011 "STORAGE - 14 REGISTE~S 0018 - SPEED - LENGTH OF VECTOR TIMES 4 MACHINE CYCLES 0019 "AUTHOR - J.F. CLAERBOUT, JUNE, 1962 0020 0021 ---USAGE---• 0022 •• TRANSFER VECTOR CONTAINS ROUTINES - NONE 0023 0024 " AND FORTRAN SYSTEM ROUTINES NONE 0025 0026 • FORTRAN USAGE 0027 • CALL FAPSUMILD,OATA,SUMCKI 0028 • 0029 • INPUTS 0030 • 0031 I=l ••• LD IS A DATA VECTOR. DATAIII • 0032 (NEED NOT HAVE FLOATING NAMEI. • 0033 • LD 0034 IS FORTRAN II INTEGER. 0035 •"• OUTPUTS 0036 0037 • IS LOGICAL SUMCHECK FOR THE DATA. 0038 SUMCK • 0039 INEED NOT HAVE FLOATING POINT NAMEI • 0040 • 0041 " EXAMPLES 0042 "• 1. INPUTS - DATAIl ••• 31 = 1. ,-2. ,-3. LD=3 0043 0044 60660000001 OUTPUTS SUMCK = OCT • 0045 • INPUTS - DATAll ••• 41 1,-2,-3,4 lD=4 0046 = • 2. 0041 OUTPUTS - SUMCK = OCT 000012000001 • 0048 "• 3. INPUTS - DATAIl ••• 21 = 6HAB , 6H 45 0049 LD=2 0050 OUTPUTS - SUMCK = OCT 020264664141 0051 • 0052 1,FAPSUM BCI 0053 SV4,4 FAPSUM SXA 0054 2,4 eLA 0055 ADD =1 0056 STA A 0051 CLA. 1,4 0058 ,4 POX 0059 CLM 0060 •• ,4 A ACL 0061 A,4,1 TlX •• ,4 0062 AXT SV4 0063 SlW. 3,4 0064 4,4 TRA 0065 EIIID FAPSUM ISUBROUTINEI FAP --- - - - •••••••••••••••••••••••• •••••••••••••••••••••••• 9/29/64 •••••••••••••••••••••••• • FASCNI • •••••••••••••••••••••••• PROGRAM LISTINGS •••••••••••••••••••••••• FASCNI • •••••••••••••••••••••••• • 9/29/64 LAST CARD IN DECK IS NO. 0198 • FASCNI (SUBROUTINE) 0001 • FAP .FASCN1 0002 COUNT 200 0003 0004 LBL FASCNI ENTRY FASCN1 IVECT,ILO,IHI,VALUE,IFIND.IANSI 0005 0006 • 0007 ----ABSTRACT---• 0008 • 0009 • TITLE - FASCN1 • FAST SCAN VECTOR FOR ELEMENT EQUAL OR GREATER THAN GIVEN VALUE 0010 0011 • FASCN1 SCANS A VECTOR RANGE AT HIGH SPEED TO FIND THE 0012 • FIRST ELEMENT IIF ANY) EQUAL TO OR GREATER THAN A GIVEN 0013 • VALUE. VECTOR MAY BE FIXED POINT OR FLOATING POINT. 0014 • PROGRAM IS MOST EFFICIENT FOR LONG VECTORS. 0015 • 0016 • 0017 • LANGUAGE - FAP SUBROUTINE IFORTRAN II COMPATIBLEI 0018 • EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) - 107 REGISTERS 0019 • STORAGE - 100 + 5.2 N MACHINE CYCLES WHERE N = NO. ELEMENTS SCANNED 0020 • SPEED - S.M. SIMPSON JR, JUNE 1962 0021 • AUTHOR 0022 • ----USAGE---0023 • 0024 • 0025 • TRANSFER VECTOR CONTAINS ROUTINES - NONE 0026 • ANO FORTRAN SYSTEM ROUTINES - NONE 0027 • 0028 • FORTRAN USAGE 0029 • CALL FASCN1IVECT.ILO.IHI,VALUE,IFIND,IANSI 0030 • 0031 • INPUTS 0032 • VEC TI I I I=ILO, ••• ,IHI IS THE FORTRAN-TYPE VECTOR TO BE SCANNED 0033 • VECTII) MAY BE FIXED POINT OR FLOATING POINT 0034 • 0035 • ILO MUST BE GRTHN= 0036 • 0037 • IHI MUST BE GRTHN= IlO 0038 • 0039 • IS TO BE COMPARED IBY A CAS INSTRUCTION) AGAINST 0040 • VALUE VECTIILO, ••• ,IHI). VALUE SHOULD BE FIxeD POINT OR 0041 • FLOATING POINT MODE ACCORDING TO MODE OF VECTII). 0042 • 0043 • 0044 • OUTPUTS 0045 • IS NOT DISTURBED IF VECTIILO, ••• ,IHI) ALL LESS THAN VALUE IFIND 0046 • IS FIRST INDEX GRTHN=ILO SUCH THAT VECTIIFIND) 0047 • GRTHN= VALUE IF ONE IS FOUND. 0048 • 0049 • IANS o MEANS VECTIILO, ••• ,IHI) ALL LESS THAN VALUE 0050 • 1 MEANS VECTIIFINO) WAS FOUND TO BE GRTHN= VALUE 0051 • -2 MEANS ILLEGAL ILO 0052 • = -3 MEANS ILLEGAL IHI 0053 • 0054 • 0055 • EXAMPLES 0056 • 0057 • 1. SHOWING USE ON BOTH FIXED AND FLOATING DATA 0058 • INPUTS - XII ••• 7) = 9.,8.,7 •• 6.,7.,8.,9. VAL =8. 0059 • IXli ••• 7) - 9,8.7,6,7,8,9 IVAL -8 0060 • USAGE CALL FASCN1IX,3,7,VAL,IFIND1,IANSI) 0061 • CALL FASCN11IX,3,7,IVAL,IFIND2,IANS21 0062 OUTPUTS - IANSl = IANS2 = 1 IFINDI = IFIN02 = 6 • 0063 •• 2. SHOWING CASE WHEN VALUE NEVER FOUND 0064 00-65 • INPUTS - SAME AS EXAMPLE 1. EXCEPT VAL = 10. • USAGE CALL FASCNIIX,3,7,VAl,IFIND,IANS) 0066 0067 • OUTPUTS - IANS = 0 0068 • 0069 • 3. ILLEGAL REQUESTS 0070 • USAGE CALL FASCNlIX,O,3,VAL,IFIND,IANSli 0071 CALL FASCNIIX,5,4,VAl,IFIND,IANS2) • 0072 OUTPUTS - IANS1 = -2 IILLEGAL ILO) IANS2 = -3 (ILLEGAL {HI) • 0073 • 0074 HTR 0 ..•••••••••••••••••••••••• . FASCNI PROGRAM LISTINGS •••••••••••••••••••••••• IPAGE 2) HTR o HTR o BCI 1,FASCN1 FASCNI-4,1 FASCNI SXD SXD FASCNl-3,2 FASCNl-2,4 SXD "SET ADDRESSES 1,4 CLA AIAIVECTI) ADD K1 +l STA C1 STA C2 STA C3 C4 STA STA C5 STA C6 STA C1 STA C8 STA C9 STA CI0 AIAIILO)) CLA 2.4 STA GET2 CLA 3,4 AIAIIHIlI STA GETJ 5,4 CLA STA PUT5 CLA 6,4 STA PUT6 .. CHECK ILO, IHI AND MAKE SETT I NGS K2 CLS STO IANS GET2 CLA A( I LO I STO ILO TMI LEAVE TZE LEAVE .. I SET TO COUNT ON XRl FROM ILO TO IHII POX 0.1 K3 CLS STO IANS GET3 CLA A( IH I l •• CAS ILO NOP TRA IHIOK TRA LEAVE GOBAK IHIOK STD MAYBE STD .. MAKE TRIAL SETTING OF IANS=O IANS STZ "PUT VALUE IN AC 4,4 CLA AlAlVALUEll Sf A GET4 .... AIVALUEl GET4 CLA "COMPARE IN BLOCKS OF LENGTH 10 CAS .*,1 AIVECTl+l CI C2,1,1 TXI NOP TRA MAYBE CAS DITTO C2 ··,1 C3,1,1 TXI NOP TRA MAYBE C3 CAS .*,1 DITTO TXI C4,1'1 NOP TRA C4 DITTO CAS TXI NOP TRA MAYBE •• ,1 CAS C5 DITTO C6,l,1 TXI NOP TRA MAYBE .... , 1 CAS C6 DITTO TXI C1,1,l NOP ... .•••••••••••••••••••••••• . FASCNI •••••••••••••••••••••••• IPAGE 0075 0076 0011 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 2) ••••••••• * •••••••••••••• PROGRAM LISTINGS fASCNl * •••••• * •••••••••••••••••* IPAGE 3) TRA MAYBE CAS **,1 DITTO TXI C8.1,1 NOP TRA MAYBE CB CAS •• ,1 DITTO TXI C9,ld NOP TRA MAY8E C9 CAS .-,1 DITTO TXI CI0,1,1 NOP TRA MAYBE cto CAS *-,1 DITTO TXI GOBAK,I,l NOP TRA MAYBE *GO BACK AND COMPARE NEXT 10 ELEMENTS *IF WE HAVENT RUN OFF END GOBAK TXL C1,l,***~IHI -NONE FOUND IF WE INDEXED OFF END TRA LEAVE .IN CASE OF JU~P FROM LOOP TO MAYBE, ELEMENT IN IV *HAS BEEN FOUND;OR GREATER THAN VALUE, PROVIDED *THAT WE HAVE NOT INDEXED BEYOND VEeTIIHII MAYBE TXL FIND,l,.. **;IHI TRA LEAVE *ELEMENT DEFINITELY FOUND;OR GREATER THAN LEVEL -SET IFIND,IANS,AND EXIT FIND PXD 0,1 PUTS S T O . * A(IFINDI CLA Kl STO lANS .LEAVE,STORING tANS LEAVE eLA IANS ALS 18 PUT6 STO ** AIIANSI LXD FASeNl-4,l LXD FASCNl-3,2 LXD FASeNl-2,4 TRA 7.4 -CONSTANTS Kl PZE 1 K2 PZE 2 K3 PZF 3 .VARIABLES IANS PZE _. -2,-3,0,1 ILO PZE 0,0, •• END C7 •••••••••••••••••••••••• fASCNl * ••••••••••••••••••••••••* (PAGE 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0114 0175 0116 0117 0178 0179 0180 0181 0182 0183 0184 0185 0186 01B7 01B8 01B9 0190 0191 0192 0193 0194 0195 0196 0197 0198 3) ........... _.......•.... -- •••••••••••••••••••••••• •.•......••..........• FASCOR • •..•.....•...•... _...... •••••••••••••••••••••••• •............ _......... . •••••••••••••••••••••••• •••••••••••••••••••••••• * FASCOR • REFER TO PROCOR • FASCRI REFER TO PROCOR • PROGRA'" LISTINGS • R£:FER TO PROCOR • FASCRI REFER TO PROCOR • •••••••••••••••••••••••• * FASCUB PROGRAM LISTINGS • •••••••••••••••••••••••• * FASCUB * •••••••••••••••••••••••• •••••••••••••••••••••••• 9/4/64 * FASCUB ISUBROUTINE) * FAP *FASCUB COUNT 250 LBL FASCUB ENTRY FASCUB ICOEFS,XLO.DELX.NF.FOFX) LAST CARD IN DECK IS NO. 0259 0001 0002 0003 0004 0005 0006 * 0007 * 0008 ----ABSTRACT---*• 0009 * TITLE - FASCUB 0010 * FAST EVALUATE CUBIC FOR EVENLY SPACED ARGUMENTS 0011 0012 • FASCUB PRODUCES N EVENLY SPACED VALUES OF THE THIRD 0013 • ORDER POLYNOMIAL 0014 • 3 2 0015 * FIX) = A + A X + A X + A X 0016 * • • • • • * • • • • o LANGUAGE EQUIPMENT STORAGE SPEED * ** • • • • 1 2 3 X '" XLO. XLO+OELX, ••• , XLO+IN-l)DElX, BY HIGH-SPEED ITERATIVE TECHNIQUES, WHERE XlO AND DElX ARE PARAMETERS. AUTHOR - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) 709 OR 7090 (MAIN FRAME ONLY) 141 REGISTERS Kl + K2 + 27.2.N MACHINE CYCLES WHERE Kl = 120 M.C. IF DElX=I.0 250 M.C. OTHERWISE K2 '" 10 M.C. IF XlO =0.0 140 M.C. OTHERWISE - S.M.SIMPSON, MARCH 1964 ----USAGE---- * TRANSFER VECTOR CONTAINS ROUTINES - (NOT ANY) • AND FORTRAN SYSTEM ROUTINES - (NOT ANY) ..* FORTRAN USAGE * * • • • • • • • • • * • * • CALL FASCUB(COEFS,XlO.DELX,NF,FOFX) INPUTS COEFS( I) 1=1,2.3,4 CONTAIN AO,Al,A2,A3. RESPECTIVELY. THE COEFFICIENTS OF FIX) IN THE ABSTRACT. XlO IS FIRST VALUE OF ARGUMENT OF F(X) IN THE ABSTRACT. DELX IS ARGUMENT INCREMENT. NF IS NUMBER OF SUCCESSIVE EVALUATIONS OF FIX) DESIRED. MUST EXCEED ZERO. SHOULD BE NON-ZERO. OO~O • * • OUTPUTS * • FOFXII) • • • STRAIGHT RETURN WITH NO OUTPUT IF NF IllEGAL. I=I ••••• NF CONTAIN THE N VALUES OF FIX) AS DESCRIBED IN THE ABSTRACT. * EXAMPLES * • 1. INPUTS - COEFSIl ••• 4}=1.0,2.0.-1.0,3.0 •. USAGE CALL FASCUBICOEFS.0.0,2.0,4.FOFXl) • OUTPUTS - FOFXl(1 ••• 4'=1.0,25.0,18~.0,62~.0 • • 2. INPUTS - COEFSIl ••• 4)=0.O,3.0.1.0,-4.0 • USAGE CALL FASCUB(COEFS,-2.0, 1.0.3,FOFX2) • OUTPUTS - FOFX211 ••• 3) = 30.0.2.0.0.0 •• • • • 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 3. INPUTS USAGE - SAME AS EXAMPLE 2., EXCEPT FOFX5Il ••• 4) = -99. CAll FASCU8(COEFS,1.0.-1.0,2.FOFX3) CAll FASCUBICOEFS.-2.0.-1.0.1,FOFX4) CALL FASCUB(COEFS,-2.0,-1.0.0,FOFX5) 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 **** ••••••• .••••••••••••• FASCUB * •••••••••••••••••••••••• FASCUB *•••••••••••••••• ** ••• ** • . PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 21 ... . OUTPUTS - FOFX3(1 ••• 21 FOFX4 (1) FOF X51l ••• 41 . ..... .. IPAGE 0.0,0.0 30.0 -99 • PROGRAM FOLLOWS BELOW NO TRANSFER VECTOR HTR HTR BCI .* ONLY ENTRY. .. FASCUB SXD SXD CLA STA AXT CLACO CLA STO TIX ClA- TMI TZE STO STD STO CUI .- ADD STA ADD STA CLA .. STO CLA* STO CAS TRA TRA TRA o o XRl XR4 l,FASCU8 FASCUBICOEFS,XLO,DELX,NF,FOFXI FASCUB-2,4 FASCUB-3,1 1,4 CLACO 3,1 •• ,1 IXRl COUNTS OUTPUTS) AICOEFS) -uAICOEFS) A1+1'! CLACO,ltl 4,4 LEAVE LEAVE CKF2 CKF3 TXL 5,4 K1 STOF Kl FA OF 2,4 XLO 3,4 DELX AIFOFXI KlL IS IT (NOTE XRl IS LEFT NF XLO DElX z 1.0 NOll OEll NOll .. HI-SPEED SETTING OF CONSTANTS IF DELX=1.0 DEll CLA FA.D FAD STO LDO FMP STO FAD FAD STO FAD STO CLA FAD STD STO TRA Al A2 A3 BI A3 K3L B2 A2 A2 BI B2 CZ B2 B2 C1 DZ CKXLO .* SLOWER CONSTANT . Non LDO A3 FMP FAD XCA FMP FAD XCA FMP STO CLA IT IS ONE, HI-SPEED Bl=A 1 +A2+A3 B2=)*A3 Bl=2*A2+3*A3 CZ=B1+B2 Cl=2*82 DZ=Cl SETTINGS IN GENERAL DELX A2 DELX Al DELX BZ DELX 8Z=J*IAl+JIA2+J*A311 LOOP TO GET A1,A2,A3 11 0075 0076 0071 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 Ol06 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 on8 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 2) •••••••••••••••••••••••• • PROGRAM LISTINGS • FASCUB •••••••••••••••••••••••• (PAGE 3) STO LOO FMP STO DELX TWODEL DELX A3 B2 A2 A2 DELX Bl B2 DELX Bl DELX CZ B2 TWODEl Cl Cl DELX DZ CZ Cl DZ • CHECK XLO AND SET fl IN THE CASE XLO=O. • liN THIS CASE HI AND Gl ARE ALREADY OK BY SYNONYMS) •CKXLD • lET TRA CLA. STO" TRA XLO GENXL 1,4 STOf TXIl COEFSllI=AZ • SET Fl.Gl.Hl IN GENERAL • • GENXL LOO FMP FAD XCA FMP FAD XCA FMP FAD· STO" LOO fIolP FAD XCA FMP FAD STO LOO FMP fAD STO A3 XLO A2 XLO Al XLO 1,4 STOF B2 XLO B1 COEFS( lI=Al Fl=AZ+XLOIAl+XLO(A2+XLO-A31) XLO B1 G Gl STORED Cl XLO Cl H HI STORED • SET FOfXI2) If Nf GRTHN * TXIl CKF2 CKF3 - TXI TXH CLA fAD" STO" TXI TXH *+1,1,1 LEAVE,l,*" ··=Nf G fADF STOF *+1,1,1 LEAVE,l.". (XRl = 2 NOW) "·=NF • ENTER LOOP SO AS TO COMPUTE G2 FROM HI. THEN F.3 FROM G2, THEN CYCLE (H2.G3,f4), ..• • • • FASCUB • •* ••••••••••••••••••••••• I PAGE FAD STO FAD XCA FMP STO FAD FAD XCA FMP STO LDO FMP FAD XCA FMP STO LDO FMP • •••••••••••••••••••••••• CLA H TRA FADG LOOP TO PRODUCE fOfX(3.4, •••• NF) (H3,G4,F5), ••• 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 3) ............................ * FASCUB PROGRAM LISTINGS * .......................... (PAGE FASCUB * •••••••••••••••••••••••• 41 CLADI CLA FAD STO FADG FAD STO FADF FAD STOF STO TX! TXL TXL •••••••••••••••••••••••• * (PAGE 01 H H G G *.,1 **,1 *+1,1,1 CLADI,I,** * * EXIT * LEAVE LXD FASCUB-J, 1 6,4 TRA * * CONSTANTS, TEMPORARIES * K1 PZE 1 KIL OEC 1.0 3.0 K3L DEC , , PZE XLO , , TWODEL PZE , , DELX PZE , , DZ PZE , PZE Cl , , PZE CI H SYN CZ B2 PZE .*,** ••• , , PZE B1 PZE 8Z SYN 8Z G A3 PZE ,.", A2 PIE , , Al PZE END ....•. ...... ...... .... .... ,.-.. .. •. .. •. .. .. ._,.",." .... ....•. ,_., .. .. **=A(FOFX)+2 **=A(FOFX)+l ··:NF 2*DELX CALLEO J IN EQUATIONS BELOW J*C 1 2*J*B2 J*(B1+J*B21 3*J*A3 J*(2*A2+3*J*A31 J*IA1+J*IA2+J*A311 0225 0226 0227 022B 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0.151 0252 0253 0254 0255 0256 0257 0258 0259 4) ..•••••••••••••••••••••••• FA SEPt to •••••••••••••••••••••••• REFER TO PROtoR . ..•••••••••••••••••••••••• FASEPl •••••••••••••••••••••••• REFER TO PROCOR PROGRAM LISTINGS -..•.....••..•.......... FASEPt • .. •••••••••••••••••••••••• REFER TO PROtOR •••••••••••••••••••••••• • FASEPl .. •••••••••••••••••••••••• REFER TO PROtOR .. -..................... .. FASTRK •••••••••••••••••••••••• PROGRAM LI STINGS . .•••••••••••••••••••••••• FASTRK •••••••••••••••••••••••• 9/8/64 LAST CA~D IN DECK IS NO. 0118 .. FASTRK (SUBROUTINE) 0001 FAP 0002 -FASTRK 0003 COUNT 100 0004 FASTRK LBL FASTRK IIXVEC,[XSTRT,IXLDDK,MXTRAK,IANS) 0005 ENTRY 0006 0007 0008 ----ABSTRACT---0009 0010 • TITLE - FASTRK 0011 • FAST TRACK THROUGH A VECTOR OF INDICES 0012 • 0013 FASTRK TRACKS THROUGH A fORTRAN FIXED POINT VECTOR EACH 0014 OF WHOSE ELEMENTS REPRESENTS THE INDEX OF ANOTHER ELEMENT • 0015 OR ELSE HAS VALUE ZERO, SEARCHING FOR A GIVEN INDEX 0016 AND STARTING FROM A GIVEN ELEMENT, SUBJECT TO A LIMIT • 0011 ON THE NO. OF SEARCHES, AND WHERE SEARCHING STOPS WHEN • 0018 A ZERO ELEMENT IS FOUND. " 0019 " THUS FASTRK LOOKS DOWNSTREAM IN A BRANCHING PROCESS LIKE 0020 A RIVER COMPLEX TO SEE IF RIVER A FLOWS INTO RIVER B. 0021 0022 "" LANGUAGE - FAP SUBROUTINE (FORTRAN II COMPATIBLE) 0023 0024 " EQUIPMENT - 109 OR 1090 (MAIN FRAME ONLY) 0025 .. STORAGE - 26 REG I STERS 0026 - 38 + 12.(N-ll MACHINE CYCLES • SPEEO 0027 WHERE N = NO. OF SEARCHES MADE "• AUTHOR 0028 - S.M. SIMPSON, JULY 1963 0029 • 0030 0031 ----USAGE---• 0032 0033 • TRANSFER VECTOR CONTAINS ROUTINES - INOT ANY) 0034 .. AND FORTRAN SYSTEM ROUTINES - INOT ANY) 0035 • 0036 • FORTRAN USAGE 0037 " CALL FASTRKIIXVEC,IXSTRT,IXLOOK,MXTRAK,IANS) 0038 0039 ".. INPUTS 0040 0041 "• 0042 IXVEC(I) 1=1,2,... IS INOEX VECTOR OF ARBITRARY LENGTH. EACH 0043 • ELEMENT MUST BE GREATER THAN OR = ZERO 0044 (1045 SPECIFIES THAT IXVEC(IXSTRT) IS THE FIRST ELEMENT IXSTRT 0046 TO BE COMPARED AGAINST IXLOOK " 0047 MUST EXCEED ZERO 0048 0049 IS THE INDEX SEARCHED FOR IXLOOK " 0050 MUST EXCEED ZERO " 0051 It 0052 IS THE MAXIMUM NO. OF TRIES TO BE MADE MXTRAK 0053 MUST EXCEED ZERO " 0054 0055 • OUTPUTS 0056 (NO LEGALITY CHECKS ARE MADE ON THE INPUTS) 0051 0058 It IANS 0 MEANS TRAIL STOPPED AT A ZERO ELEMENT 0059 -'I MEANS TRAIL STOPPED BECAUSE MAX NO. OF TRIES • 0060 WAS ABOUT TO BE EXCEeDED 0061 +K, WHERE K POSITIVE, MEANS SEARCH WAS SUCCESSFUL, • 0062 AND THAT IXVECIK) = IXlOOK • 0063 0064 0065 • EXAMPLES 0066 • 1. INPUTS - IXVECl1 ••• 12) = 7, 9, 0, 5, 4, 3, 6, 8, 3, 1,12, 4 0061 0068 CAll FASTRKIIXVEC,10, 3,10,IANSl) USAGE 0069 CAll FASTRKIIXVEC,10, 3, 4,IANS2) 0010 CAll FASTRKIIXVEC,10, 3, 3,IANS3) 0071 CAll FASTRKIIXVEC, 8, 8,10,IANS4) 0012 CALL FASTRKIIXVEC, 4, 4,10,IANS5) • 0013 CAll FASTRKIIXVEC,12, 3,10,IANS6) 0074 CALL FASTRKIIXVEC, 7,12,10,IANS7) ... ... . . .. . . .. .... ... . . ... . ... .... ... ... •••••••••••••••• * ••••••• PROGRAM LISTINGS FASTRK *•••••••••••••••••• * •••••* IPAGE 2) * * * * * * * * * * * * •••••••••••••••••••••••• FASTRK * * •••••••••••••••••••••••• IPAGE OUTPUTS - I ANSI IANS2 IANS3 IANS4 IANS5 IANS6 IANS7 IANS8 IANS9 CAll CAll '" 6 '" 6 :-1 '" 8 '" 5 =-1 "' 0 0 2 = ** PROGRAM FOLLOWS BELOW * HTR 0 BCI 1,FASTRK FASTRK SXD FASTRK-2,4 SXA LEAVE,L SXA lEAVE+l,l ClA 1,4 ADD *-1 STA ClA 4,4 ClA* POX 0,2 ClA* 2,4 * BEGIN TRACKING lOOP NEXT POX 0,1 ClA ClA **,1 HE SETANS CAS* 3,4 TRA *+2 TRA ARRIVE TI X NE X T , 2 , 1 * SET IANS AND LEAVE ENOUGH CLS KDl TRA SETANS ARRIVE PXD 0,1 SETANS STO* 5,4 lEAVE AXT **,2 AXT .*,1 TRA 6,4 KD1 PlE 0,0,1 ENO FASTRKIIXVEC. 3,12.l0,IANS8) FASTRKIIXVEC, 2, 9,10.IANS91 liE IXVECI6) ,. 3) ITOO MANY TRACKS. TAKES 4 TO GO FROM 10 TO 6) INOTE lOOP AT 4-5-4-5 ETC) (STOPS AT IXVEC1311 DITTO XR4 AIIXVECI+1 SET FOR MAX NO. OF LOOKS SET TO lOOK AT IXVECIIXSTRTI FIRST **=AIIXVEC )+1 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 21 .•••••••••••••••••••••••• . FOOT •••••••••••••••••••••••• • • .•••••••••••••••••••••••• . FOOT •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0100 0001 0002 0003 COUNT BO FOOT 0004 LBL FOOT (LXY,X,Y,ANS) 0005 ENTRY FOOTR (LXY,X,Y,ANS) 0006 ENTRY 0007 • 0008 ----ABSTRACT---• 0009 •• TITLE - FOOT ,WITH SECONDARY ENTRY POINT FOOTR 0010 0011 • FAST ~OT PRODUCT OF TWO VECTORS 0012 FOOT COMPUTES THE DOT PRODUCT OF TWO VECTORS • 0013 0014 FOOTR COMPUTES THE DOT PRODUCT OF A VECTOR WITH THE 0015 REVERSE OF ANOTHER VECTOR. 0016 • 0011 0018 THUS FOOT CORRESPONDS TO ONE LAG OF A CROSSCORRElATION, 0019 FOOTR TO ONE LAG OF A CONVOLUTION. • 0020 .. LANGUAGE - FAP, SUBROUTINE (FORTRAN II COMPATIBLE) 0021 .. EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0022 0023 .. STORAGE - 40 REGISTERS 0024 .. SPEED - LENGTH OF VECTOR TIMES 25.4 MACHINE CYCLES - 7090 2B.6 MACHINE CYCLES - 70Q 0025 .. AUTHOR 0026 - R.A. WIGGINS, 4/10/62 0021 0028 ----USAGE---0029 0030 .. TRANSFER VECTOR CONTAINS ROUTINES NONE 0031 • AND FORTRAN SYSTEM ROUTINES NONE 0032 .. FORTRAN USAGE 0033 0034 • CALL FOOT (LXY,X,Y,ANS) 0035 CALL FOOTR ILXY,X,Y,ANS) • 0036 • INPUTS 0037 0038 • 0039 XIII l=l ••• LXY IS FLOATING POINT VECTOR 0040 * 0041 YII) 1=1 ••• LXY IS FLOATING POINT VECTOR * 0042 * 0043 LXY IS fORTRAN II INTEGER 0044 MUST BE GRTHN=1 0045 0046 .. OUTPUTS 0047 0048 ANS IS FLOATING POINT DOT PRODUCT OF X AND Y. 0049 *.. EXAMPLES 00'50 00'51 .. 1. INPUTS - Xl1 ••• 3)=1.,2.,3. Y(1 ••• 3)=I.,2.,3. LXY=3 0052 00'53 * OUTPUTS - FOOT ANS=14. FOOTR ANS=10. 0054 0055 * 2. INPUTS - XII)=I. Y(1)=2. LXY=l 0056 .. OUTPUTS - FOOT ANS=2. FOOTR ANS=2. 0057 * 0058 • 0059 * PROGRAM FOLLOWS 8ELOW 0060 0061 PZE 0062 l,FOOT 8CI 0063 FOOT SXO *-2,4 SAVE 0064 RET, 1 SXA INOECES. 0065 1,4 AILXY) CLA. 0066 POX ,1 SET IR 1 FOR FOOT. 0061 TIX SET FOOT CLA 0068 SWITCH. STP SW 0069 A TRA 0010 FOOTR SXO FOOT-2,4 SAVE 0011 SXA RET ,I INOECES. OU72 1,1 SET IR 1 FOR FOOTR. AXT 0013 SET FDOTR TXI CLA 0014 SW ITCH. STP SW ... ... .. . . .. . . . . ... . ... . . . FOOT (SUBROUTINE) FAP PROGRAM LI STINGS 9/4/64 •••••••••••••••••••••••• * FOOT PROGRAM LISTINGS * 21 A X Y SW RET TIX TXI ANS FOOT * • ••••••••••••••••••••••• •••••••••••••••••••••••• (PAGE •••••••••••••••••••••••• * IPAGE CAL ADO STA CAL ADD STA STZ CLA* TlE TMI PDX LDQ FMP FAD STO PZE TIX LXD CLA STD* AXT TRA TIX TXI PZE END 2,4 =1835 AIA(X)) X 3,4 =1835 Y ANS 1,4 RET-2 RET-2 ,4 .... ,1 •• ,4 ANS ANS *+1,1,1 X,4,1 FDOT-2.4 ANS 4,4 • •• 1 5,4 0,,0 0,,0 AlAIY)) AILXYI SET IR 4. AIXI A(y1 EITHER TXI *+1,1,1 OR TIX *+1,1,1 RESET IR4. A(ANSI RESET IR 1. RETURN. 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 21 •••••••••••••••••••••••• FOOTR *•• * ••••••••••••••••••••• * REFER TO FOOT PROGRAM LISTINGS •••••••••••••••••••••••• FOOTR *• ••••••••••••••••••••••• * REFER TO FOOT •••••••••••••••••••••••• FIRE2 * * •••••••••••••••••••••••• PROGRAM LISTINGS •••••••••••••••••••••••• FIRE2 * * •••••••••••••••••••••••• • FIRE2 (SUBROUTINEI 9/8/64 LAST CARD IN DECK IS NO. 0151 0001 * LABEL 0002 CFIRE2 SUBROUTINE FIRE2 INRA,NCAT,NCAN,AA.NRR,NCR.RR,NRG.GG.FF,C) 0003 C 0004 0005 ----ABSTRACT---C 0006 C 0001 C TITlE - FIRE2 C TWO-DIMENSIONAL FILTER BY RECURSION 0008 0009 C 0010 FIRE2 INCREASES THE LENGTH OF ONE DIMENSION OF A 2C DIMENSIONAL LEAST-SQUARE FILTER BY ONE. THUS, GIVEN 0011 C THE FILTER FII,JI l=l, ••• ,NRA J=l, •••• NCAN-l THAT IS THE C 0012 SOLUTION TO THE EQUATION 0013 C 0014 C NRA NCAN-l 0015 C C SUM I SUM I FI I,JI*RI I-K,J+L-21 I I = GIK,lI 0016 1=1 J=1 0011 C 0018 C 0019 FOR K = 1, ••• ,NRA C L = 1, ••• ~NCAN-l C 0020 0021 C THEN FlRE2 INCREASES THE J DIMENSION BY ONE SO THAT 0022 C THE EQUATIONS ARE SATISFIED FOR L = 1, ••• ,NCAN. 0023 C 0024 C TO PERFORM THE RECURSION, FIRE2 MAKES USE OF THE 0025 C PREOICTION ERROR OPERATORS AA AND THE ERROR MATRIX STORED 0026 C 0021 IN COMPUTATION SPACE C AS GIVEN BY RLSPR2. C C 0028 - FORTRAN 11 SUBROUTINE 0029 C LANGUAGE 0030 C EQUIPMENT - 109, 1090, 1094 IMAIN FRAME ONLY) - 211 REG I STERS 0031 C STORAGE 0032 - ABOUT .00015*M*N**2 SECONDS ON THE 1094 MOD 1 C SPEED FOR ~ GRTHN 1 AND M GRTHN 25 • 0033 C 0034 GEOSCIENCE, INC. C AUTHOR - R.A. WIGGINS 8/63 0035 C ----USAGE--0036 C 0031 C 0038 C TRANSFER VECTOR CONTAINS ROUTINES - DOTJ,DOTP,IXCARG,MATML3,STZ AND FORTRAN SYSTEM ROUTINES - NONE 0039 C 0040 C 0041 C FORTRAN USAGE CALL FIRE2 INRA,NCAT,NCAN,AA,NRR,NCR,RR,NRG,GG.FF,C) 0042 C 0043 C 0044 C INPUTS 0045 C 0046 NRA NUMBER ROWS IN AA AND F. C MUST BE GRTHN= 1 0041 C 0048 C NCAT NUMBER OF COLUMNS OF AA ANO F TOTAL. I.E. THIS IS THE 0049 C UPPER LIMIT ON THE NUMBER OF COLUMNS TO WHICH F CAN 0050 C BE EXTENDED. 0051 C MUST BE GRTHN= 1 0052 C 0053 C NUMBER OF COLUMNS OF AA AND F NOW. I.E. THIS IS THE 0054 NCAN C PRESENT LENGTH OF THE PREDICTORS, THE FUTURE LENGTH OF 0055 C 0056 THE FILTER. C MUST BE GRTHN= 0 LSTHN= NCAT 0051 C 0058 C L=l, ••• ,NRA*NCAT*NRA CONTAINS THE PREDICTION ERROR 0059 AAI 1I C OPERATORS AII,J,KI OF LENGTH NCAN AS GIVEN BY RLSPR2. 0060 C 0061 C 0062 NUMBER ROWS OF R. NRR C 0063 MUST BE GRTHN= 1 AND ODD. C 0064 C 0065 NUMBER COLUMNS OF R. C NCR 0066 MUST BE GRTHN= 1 C 0061 C 0068 RRIII I=I, ••• ,NRR*NCR CONTAINS RIJ,Kl J=-NRR/2, ••• ,-1,0,1 •••• C 0069 NRR/2 K=O, •••• NCR-l. AN AUTOCORRELATION ARRAY. C 0070 C 0011 NRG NUMBER ROWS OF G. C MUST HE GRTHN= 1 0012 C 0013 C 0014 I=l, ••• ,NRG CONTAINS GIK,l) K=-NRG/2, ••• ,NRG/~ GGII) C •••••••••••••••••••••••• - FIRE2 ••••••••••••••••••••••••• IPAGE 2) C C C C C PROGRAM LISTINGS •..•.•.......•. • FIRE2 C CII) C C C OUTPUTS C FFIl) C C C C C EXAMPLES • IPAGE l=1 ••••• NRA.INCAN-1) CONTAINS FII.J) l=l ••••• NRA .NCAN-1 AS DESCRI8ED IN THE A8STRACT. J=l.... I=1 ••••• 4.NRA.NRA CONTAINS DATA FROM RlSPR2 THAT IS NEEDED 8Y FIRE2. l=l ••••• NRA.NCAN CONTAINS FII.JI l=l ••••• NRA NCAN AS DESCRIBED IN THE ABSTRACT. ........ •••••••••••••••••••••••• IS ASSUMED TO 8E ZERO OUTSIDE THE liMITS OF DEFINITION. FFIl) ~ J·l..... 0075 0016 0011 0078 00" 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 C 0090 C 1. EXTENSION OF A ONE-DIMENSIONAL PREDICTOR INPUTS - NRA = 1 NCAT: 5 NCAN - 5 C 1.001 C AAll •• ~5) - 1.000.-0.499.0.246.-0.117.0.041 Cllt NRR = 1 NCR = 2 RRl1 ••• 21" 1.25 •• 50 C C NRG a 1 Gil)" O. C FFI1 ••• 41 = 0.997.-0.493.0.235.-0.094 C USAGE CAll FIRE2INRA.NCAT,NCAN.AA.NRR.NCR.RR,NRG.GG.FF,Ct OUTPUTS - FFl1 ••• 51 .. 0.999.-0.498,0.246.-0.111.0.041 C C C 2. CONSTRUCTION OF A GENERAL FILTER USING RLSPR2. INPUTS - NRA .. 3 NCAT = 5 NCAN = 0 C C NRR 3 NCR" 3 RRl1 ••• 91 0.302, 0.105. 0.010, C 1.340. 0.621. 0.020, 0.302. 0.105. 0.010 C NRG 1 NCG" 5 GGll ••• 5)" 0 •• 0•• 1•• 0 •• 0. C C USAGE DO 10 l-l,NCAT CALL RLSPR2INRA.NCAT,NCAN.AA.NRR,NCR,RR.C.IANSI C IG .. l+ll-ll.NRG C CALL FIRE2INRA,NCAT,NCAN.AA.NRR,NCR.RR,NRG.GG.FF.Cl C C 10 CDNTINUE OUTPUTS - IANS ,. 0 FFI1 ••• 151 = 0.002. 0.181.-0.393, 0.181, 0.002. C C 0.045,-0.609, 1.417,-0.6109. 0.045. C 0.002, 0.181.-0.393. 0.181, 0.002 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 = C C C PROGRAM FOLLOWS 8ElOW C C 10 20 30 40 50 60 DIMENSION AA(2),RRI2).GGI2).FFI2),CI21.CMI21 COMMON CM laNRA MaNCAN-l MT=NCAT Ll=L.L LMT=l*MT CALL IXCARG IC.ICll IC2-IC1+LL IC3=IC2+LL IC4=IC3+l IF 1MI 10.10.20 CALL STZ IlMT.FFI CONTINUE M1=INRR+U/2 JC1:1C) IG1=NRG-INRG-LI/2 DO 50 l=l,L CALL DOTP IL.M.FF.NRR.NCR.RR.MI-I,l.CMIJCll.-2.) IF IXMINOFIIG1.NRG-IGl+11) 40.40.30 CONTINUE CMIJC11=CMIJCII-GGIIGl) IG1aIGl-1 JCl=JCl+l CALL MATMl3 IL.l.l,CMIIC21.CMIIC3I,O.CHIIC41.01 HaM+l LM-L-H IA-lH DO 60 ll=l.LH CALL DOTJ IL,l,CHIIC4),LMT,AAIIA).FFI111.1,11 IA=IA-1 2) ..................... -.. FIRE2 * •••••••••••••••••••••••• * (PAGE 3) RETURN END PROGRAM LISTINGS •••••••••••••••••••••••• FIRE2 *••• * •••••••••••••••••••• * (PAGE 0150 0151 31 •••••••••••••••••••••••• • • FI XV PROGRAM LI STINGS ' • FIXV LAST CARO IN OECK IS NO. 0104 0001 0002 0003 COUNT 100 0004 LBL FIXV ENTRY FIXV (X,LX.IXFIXDI 0005 0006 ENTRY FIXVR (X,LX,IXFIXOI 0001 • 0008 ----ABSTRACT---0009 "• TITLE - FIXV WITH SECONDARY ENTRY FIXVR 0010 FIX A FLOATING VECTOR WITH OR WITHOUT ROUNDING 0011 0012 0013 FIXV FIXES A FLOATING VECTOR TO A FORTRAN-II FIXED POINT • INTEGER VECTOR WITH TRUNCATION OF THE fRACTIONAL PART. 0014 • 0015 FIXVR ROUNDS THE fRACTIONAL PART. 0016 0017 .. LANGAUGE - FAP SUBROUTINES (FORTRAN-II COMPATIBLE) 0018 • EQUI PMENT - 709 OR 7090 IMAIN fRAME ONLY) 0019 - ~S REGISTERS • STORAGE 7090 709 0020 " SPEED FIXV 31 + 127 OR 281"LX MACHINE CYCLES, 0021 FIXVR 33 + 133 OR 34)"LX LX • VECTOR LENGTH 0022 "" AUTHOR 0023 - S.M. SIMPSON, AUGUST 1963 0024 " ----USAGE---0025 " 0026 0021 • TRANSFER VECTOR CONTAINS ROUTINES - INONE) AND FORTRAN SYSTEM ROUTINES - (NONE) " 0028 0029 ".,fORTRAN USAGE 0030 0031 • CALL FIXV IX,LX,IXFIXO) 0032 " CALL FIXVR IX,LX,IXFIXDI 0033 0034 "" INPUTS 0035 I=l ••• LX IS THE FLOATING VECTOR 0036 XCII • 0031 0036 LX SHOULD EXCEED 0 " 0039 STRAIGHT RETURN WITH NO OUTPUTS IF LX LSTHN 1 0040 .. OUTPUTS 0041 0042 • IXFIXDIII 1:1 ••• LX IS THE FIXED FORM OF Xl1 ••• LXI 0043 WITH TRUNCATION IF FIXV IS USED " 0044 " WITH ROUNOING IF FIXVR IS USED .. EQUIVALENCE IX, IXFIXDI IS PERMITTED 0045 0046 0047 • EXAMPLES 0048 "" 1. INPUTS - Xl1 ••• 5) : 1.2.1.5,1.9.2.0.-3.5 0049 .. EQUIVALENCE IX, IX3) IX4=0 0050 0051 "USAGE CALL FIXV IX,5,IX1) 0052 " CALL FIXVRIX,5,IX2) 0053 .. CALL FIXV (X,l. Xl 0054 • CALL FIXV eX,0,IX4) 0055 • OUTPUTS - IX111 ••• 5) = 1,1.1,2,-3 0056 .. IX211 ••• 5) = 1.2.2,2,-4 0057 • IX3Il) = XII) = 1 IX4 0 INO OUTPUT CASE) 0058 0059 .. PROGRAM FOLLOWS BELOW 0060 " 0061 0062 • NO TRANSFER VECTOR 0063 HTR 0 XR4 0064 BCI 1.FIXV 0065 .. PRINCIPAL ENTRY. FIXVIX,LX,IXFIXD) 0066 FIXV CLA NORND 0067 SETUP STA TRA 0068 SXD FIXV-2,4 0069 K1 CLA 1,4 ADD K1 AIX)+l 0070 0071 STA GET 0072 CLA 3,4 0073 ADD K1 0074 STA STORE FIXV FAP ISUBROUTINE) 9/29/64 • • • • • • • .. • .. • • • • • •••••••••••••••••••••••• •••••••••••••••••••••••• • •.FIXV ......................... = •••••••••••••••••••••••• it .. FI XV PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 21 ClA. 2,4 TMI lEAVE POX 0,4 TXl lEAVE,4,0 • FIXING lOOP •• ,4 •• =A(X)+l ClA GET UFA OCTKI lRS 0 ANA OCTK2 llS 0 TRA TRA •• =AlS OR ROUND AlS AlS 18 STORE STO .*,4 ".=A( IXFXD)+l GET,4,1 TIX .. EXIT FIXV-2,4 lEAVE lXD 4,4 TRA • ROUNDING INSERT I ON ROUND ROl 8 RND TRA AlS • SECOND ENTRY. FIXVRIX,lX,IXFIXD) RND FIXVR ClA TRA SETUP .. CONSTANTS NORND TRA AlS RND TRA ROUND OCTK1 OCT 233000000000 OCTK2 OCT 000000377777 END ... ..•••••••••••••••••••••••• .. FIXV • •••••••••••••••• * •••••• (PAGE 0075 0076 0017 0018 0019 OOBO OOBI 00B2 00B3 0084 00B5 00B6 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 21 • ••••••••••••••••••••••• FIXVR • * •••••••••••••••••••••••• REFER TO FIXV •••••••••••••••••••••••• * FlDATA • •••••••••••••••••••••••• REFER TO FXDATA PROGRAM lISTINGS •••••••••••••••••••••••• * FIXVR * •••••••••••••••••••••••• REFER TO FIXV •••••••••••••••••••••••• * FlDATA • •••••••••••••••••••••••• REFER TO FXDATA ..•••••••••••••••••••••••• . FLOATH PROGRAM LISTINGS •••••••••••••••••••••••• •••••••••••••••••••••••• .. FLOATM (FUNCTION) .. FAP "FLOATM COUNT BO LBL FLOATM ENTRY FLOATH (INTEGR) .•••••••••••••••••••••••• . FLOATH LAST CARO IN DECK IS NO. 0090 0001 0002 0003 0004 0005 0006 ----ABSTRACT---0007 0008 .. TITLE - FLOATM 0009 .. FLOAT ANY MACHINE LANGUAGE INTEGER 0010 0011 FLOATM ASSUMES ITS ARGUMENT IS A 35 BIT PLUS SIGN 0012 INTEGER (BINARY POINT TO RIGHT OF BIT 351 AND CONVERTS 0013 IT TO EQUIVALENT FLOATING POINT FORM. THERE ARE NO 0014 RESTRICTIONS ON THE ARGUMENT. 0015 0016 .. LANGUAGE - FAP SUBROUTINE (FORTRAN II FUNCT I ON) 0017 .. EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 001B .. STORAGE - 25 REGISTERS 0019 .. SPEED - ABOUT 17 MACHINE CYCLES IF INTEGER LSTHN 2".27 0020 .. ABOUT 46 MACHINE CYCLES IF INTEGER GRTHN& 2 ... 27 0021 .. AUTHOR - S.M. SIMPSON JR, NOV/1962 0022 0023 ----USAGE---0024 0025 .. TRANSFER VECTOR CONTAINS ROUTINES NONE 0026 .. AND FORTRAN SYSTEM ROUTINES NONE 0027 0028 .. FORTRAN USAGE 0029 .. FLTG = FLOATMF(INTEGR) 0030 0031 .. INPUTS 0032 0033 INTEGR IS ANY 35 BIT PLUS SIGN INTEGER 0034 0035 0036 • OUTPUTS 0031 FLTG IS THE EQUIVALENT FLOATING POINT FORM OF INTEGR 003B 0039 0040 • EXAMPLES 0041 INPUTS 1. - INTEGR OCT 000000000004 0042 OUTPUTS - FLTG 4• 0043 0044 • .. 2. INPUTS - INTEGR OCT 400000000004 0045 OUTPUTS - FLTG -4 • 0046 0047 .. 3. INPUTS - INTEGR OCT 377777777777 0048 OUTPUTS - FLTG 34359738367.0 (GOOD TO 8 PLACES) 0049 0050 .. 4. INPUTS - INTEGR OC T 777777777777 0051 OUTPUTS - FLTG -3435973B367.0 0052 0053 .. 5. INPUTS - INTEGR 0'054 OCT 000000000000 OUTPUTS - FL TG 0.0 0055 0056 •.. 6. INPUTS OCT 400000000000 - INTEGR 0057 OUTPUTS - FLTG -0.0 0058 • 0059 • OCT 001000000000 0060 • 7. INPUTS - INTEGR OUTPUTS - FLTG 134217728.0 0061 0062 HTR 01)63 o I,FLOATM BCI 0064 HOATM SXD FlOATM-2,4 0065 .. CHECK FOR SPEC tAL CASE OF MAGNITUDES EXCEEDING 2 .... 27-1 0066 LAS KOOI 0067 TRA BIG 0068 TRA 0069 BIG ORA 0070 K233 FAD K233 0071 LEAVE TRA 1,4 0072 0073 • HANDLE BIG NUM~ERS BIG LRS 0074 27 .. . .. .. . .. ... . . .. .. .. . ..... ... ... ... . ... 9129/64 •••••••••••••••••••••••• • • FLOATM •••••••••••••••••••••••• (PAGE 2) STQ ORA FAD STO CLA ARS ORA FAD FAD TRA KOOI OCT K233 OCT K266 OCT TEMP PZE TEMP2 PZE END TEMP K266 K233 TEMP2 TEMP 8 K233 K233 TEMP2 LEAVE 001000000000 233000000000 266000000000 ... •• PROGRAM LISTINGS •••••••••••••••••••••••• • • •••••••••••••••••••••••• (PAGE 2) FLOATM 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 •••••••••••••••••••••••• - ••••••••••••••••••••••••FlOATV PROGRAM LISTINGS FlOATV (SUBROUTINE) FAP -FlOATV COUNT 100 lBL FLOATV ENTRY FLOAT V (IX.LIX.XFLOTD) •••••••••••••••••••••••• - FlOATV LAST CARD IN DECK IS NO. 0080 0001 0002 0003 0004 0005 0006 ----ABSTRACT---0007 • 0008 "- TITLE - FLOATV 0009 " FLOAT A VECTOR 0010 0011 FLOATV CONVERTS A FORTRAN-II FIXED VECTOR TO FLOATING PT. 0012 • 0013 • - FAP SUBROUTINE, FORTRAN-II COMPATIBLE 0014 - LANGUAGE " EQUIPMENT - 709 OR 1090 (MAIN FRAME ONLY) 0015 - 22 REGISTERS 0016 • STORAGE - 21 + 11.4-LX MACHINE CYCLES WHERE LX s VECTOR LENGTH 0017 • SPEED - S.M. SIMPSON, AUGUST 1963 - AUTHOR 0018 0019 " ----USAGE---0020 " 0021 " TRANSFER VECTOR CONTAINS ROUTINES - INONE) 0022 AND FORTRAN SYSTEM ROUTINES - (NONE) 0023 0024 • FORTRAN USAGE 0025 • CALL FLOATV(IX,lIX,XFLOTD) 0026 0027 • 0028 • INPUTS 0029 " I XI I ) 1=1 ••• LIX IS THE FIXED POINT VECTOR 0030 0031 L1X MUST EXCEED ZERO 0032 • 0033 "" OUTPUTS STRAIGHT RETURN WITH NO OUTPUT IF LIX lSTHN 1 0034 0035 • • XFLOTDII) I=I ••• LIX IS THE FLOATED FORM OF IXll ••• LIX) 0036 0031 • EQUIVALENCE (IX, XFlOTD) IS PERMITTED 0038 • 0039 • 0040 • EXAMPLES 0041 • • 1. INPUTS - IXll ••• 3) = 1.-3.1 EQUIVAlENCE IIX,X2) X3-0.0 0042 0043 • • USAGE CALL FLOATVIIX.3,XI) 0044 CALL FLOATV(IX,I,IX) 0045 • " CALL FLOATVIIX,-I,X3) 0046 OUTPUTS - XlI1 ••• 3) = 1.0.-3.0,1.0 X2(1). IXll) = 1.0 0047 • X3 = 0.0 INO OUTPUT CASE) 004B 0049 • " PROGRAM FOLLOWS BELOW 0050 0051 • 0052 • VECTOR " NO TRANSFER 0053 HTR o XR4 0054 BCI 1,FLOATV 0055 0056 • ONLY ENTRY. FLOATVIIX,LIX,XFLOTD) FLOATV SXD FLOATV-2,4 0057 1,4 Kl CLA 005B ADD Kl AIIX)+1 0059 STA GET 0060 3,4 CLA 0061 ADD Kl AIXFLOTO)+1 0062 STA STORE 0063 2,4 L1X CLA" 0064 TMI LEAVE 0065 0,4 POX 0066 TXL LEAVE,4,0 0061 0068 • FLOATING LOOP •• ,4 GET CLA .-=AIIX)+1 0069 LRS IB 0010 ORA OCTK 0011 FAD OCTK 0012 •• ,4 STORE STO •• =AIXFLTD)+1 0073 GET,4,l TlX 0014 - - -- - •••••••••••••••••••••••• 9/29/64 •••••••••••••••••••••••• * FLOATV * •••••••••••••••••••••••• (PAGE 21 * EXIT LEAVE LXD TRA * CONSTANTS OCTK OCT END FLOATV-2,4 4,4 233000000000 PROGRAM II STINGS •••••••••••••••••••••••• * FLOATV • •••••••••••••••••••••••• (PAGE 0075 0076 0077 0078 0079 0080 21 •••••••••••••••••••••••• .••••••••••••••••••• . FMTOUT ** ••• PROGRAM LI STINGS .. FMTOUT ISUBROUTINE) .. LABEL CFMTOUT SUBROUTINE FMTOUTIITAPE,FMT) •••••••••-** ••••••• .•••• **FMTOUT .. •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0070 0001 0002 0003 0004 C ----ABSTRACT---0005 C C 0006 C TITLE - FMTOUT 0007 C WRITE OUTPUT TAPE WITH NORMAL OR LITERAL FORMAT VECTOR OOOB 0009 C FMTOUT HAS TWO ARGUMENTS, ITAPE AND FMT, WHERE FMT IS 0010 C A NORMAL OR LITERAL FORMAT VECTOR. THE FUNCTION OF 0011 C 0012 FMTOUT IS THAT OF THE FORTRAN STATEMENT C 0013 C WRITE OUTPUT TAPE ITAPE,FMT 0014 C 0015 C 0016 C - FORTRAN-II SUBROUTINE 0017 C LANGUAGE 001B C EQUIPMENT - 709 OR 7090 IMAIN FRAME PLUS ONE TAPE UNIT) 0019 C STORAGE - 51 REGISTERS 0020 SPEED C - S.M. SIMPSON JR., SEPTEMBER 1963 0021 C AUTHOR C 0022 ----USAGE---0023 C 0024 C 0025 C TRANSFER VECTOR CONTAINS ROUTINES - FNDFMT,RPLFMT AND FORTRAN SYSTEM ROUTINES - ISTH),IFILI 0026 C 0027 C 0028 C FORTRAN USAGE 0029 C CALL FMTOUTIITAPE,FMT) C 0030 0031 C DEFINE A NORMLIT FORMAT VECTOR AS EITHER 0032 C INPUTS AI A NORMAL FORMAT VECTOR, 0033 C OR BI LITERAL HOLLERITH IN A CALLING SEQUENCE WHOSE 0034 C CHARACTERS IREADING CONTINUOUSLY FROM LEFT TO RIGHT) 0035 C ARE THE DESIRED FORMAT STRIPPED OF THE ENCLOSING 0036 C PARENTHESES. THE FIRST AND SECOND CHARACTERS MUST 0037 C NOT RE QUOTE ( UNQUOTE OR QUOTE I UNQUOTE 0038 C RESPECTIVELY. ITWO BLANKS FOLLOWED BY I WOULD BE OK.) 0039 C 0040 C ITAPE IS LOGICAL NUMBER OF DESIRED OUTPUT TAPE. 0041 C 0042 C 1;1,2, ••• DR 1;1,0,-1, ••• IS THE NORMLIT FORMAT VECTOR FMTlI I 0043 C TO BE WRITTEN OUI ON TAPE ITAPE. 0044 C 0045 C THE FORMAT IS WRITTEN OUT AS ILLUSTRATED BELOW. 0046 C OUTPUTS 0047 C 0048 C EXAMPLES 0049 C 0050 C 1. INPUTS - FMTIl ••• 4J ; 21HI16H ORDINARY FORMAT) USAGE CALL FMTOUTI2.fMTI 0051 C CALL FMTOUTI2,18H15H LITERAL fORMAT 0052 C 0053 THE FOLLOWING TWO LINES C OUTPUT'S ORDINARY FORMAT 0054 C 1I TERAL FORMAT 0055 C 0056 WILL BE PRINTED OFF-LINE fROM LOGICAL TAPE 2. C 0057 C 0058 C PROGRAM fOLLOWS BELOW 0059 C 0060 01 MENS ION COM I 2 I 0061 COMMON COM CALL fNDFMTIFMT,IXCFMTI 0062 0063 CALL RPLfMTICOM.COMIIXCFMTII 0064 GO TO 20 CALL RPLFMTICOMIIXCFMTI.COMI 0065 10 0066 GO TO 9999 0067 20 WRITE OUTPUT TAPE ITAPE,COM 006B GO TO 10 0069 9999 RETURN 0070 END 9/29/64 _ •••••• ** .••••••••••••••• FNDFMT •• -.••..••••••• -•••.. *_... PROGRAM LISTINGS .. FNDFMT ISUBROUTINE) .. FAP -FNDFMT COUNT 150 FNDFMT LBL FNDFMT IFMT,IXCFMT) ENTRY ... .. .. ... ..... ..... .. .. ... .. ... .. .. .. .. .... .. .. ... ...... ... .. .... .. .... .... . .. .... .... .. ... .. .. ••••• ***- ••••••••••••••• - FNOFMT . • •••••• * •••••••••••••• _- LAST CARD IN DECK IS NO. 0202 0001 0002 0003 0004 0005 0006 0007 ----ABSTRACT---0008 0009 TITLE - FNDFMT ACCESS TO LITERAL OR ORDINARY FORMAT 0010 0011 FNOFMT SUPPLIES THE INDEX WITH RESPECT TO THE COMMON 0012 BLOCK OF A FORMAT STATEMENT. THE FORMAT IS SUPPLIED 0013 AS AN ARGUMENT WHICH IS EITHER OF THE ORDINARY FORM 0014 IA HOLLERITH VECTOR WHOSE FIRST CHARACTER IS A LEFT 0015 PARENTHESIS) OR IS A LITERAL HOLLERITH VECrOR ARGUMENT 0016 0017 REPRESENTING THE FORMAT MINUS ITS ENCLOSING PARENTHESES AND TERMINATED BY AN ALL-ONES FENCE. IN THE LATTER 0018 CASE FNDFMT REVERSES THE LITERAL HOLLERITH AND ADDS 0019 THE NECESSARY PARENTHESES. SUBSEQUENT CALLS OF FNDFMT 0020 WITH THE REVERSED HOLLERITH WILL NOT LEAD TO RE-REVERSAl • 0021 0022 AN ORDINARY TYPE FORMAT MUST NOT CONTAIN A ) AS THE 0023 FIRST CHARACTER AFTER ITS (, I ILLEGAL ANYWAY) • 0024 0025 A LITERAL TYPE FORMAT MUST NOT CONTAIN A ) AS ITS 0026 SECOND CHARACTER, OR A I AS ITS FIRST CHARACTER • 0027 0028 LANGUAGE - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) 0029 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0030 STORAGE 0031 - 88 REGISTERS SPEED 0032 0033 AUTHOE - S.M. SIMPSON, SEPTEMBER 1963 0034 ----USAGE---0035 0036 0037 TRANSFER VECTOR CONTAINS ROUTINES - REVER AND FORTRAN SYSTEM ROUTINES - INONE) 0038 0039 FORTRAN USAGE 0040 CALL FNDFMTIFMT,IXCfMTI 0041 0042 INPUTS 0043 0044 0045 FMTII) IS A REVERSED OR UNREVERSED LITERAL HOLLERITH VECTOR, OR AN ORDINARY FORMAT VECTOR, AS DESCRI8EO IN ABSTRACT • 0046 0047 0048 OUTPUTS 0049 0050 IS THE INDEX WITH RESPECT TO COMMON OF THE FORMAT I XCFMT 77461 10CTALI - XLOCFIFORMAT) + 1 0051 0052 WHERE XLOCFIFORMATI XLOCF(FMTI IF FMTII) ORDINARY 0053 = XLOCFIFENCEI OTHERWISE 0054 (THE FENCE IS WIPED OUT) 0055 0056 IS UNDISTURBED IF, ON INPUT, IT WAS EITHER A NORMAL FMTI I I FORMAT VECTOR OR A PREVIOUSLY REVERSED LITERAL FORMAT 0057 VECTOR. IF, ON INPUT, FMTII) WAS A LITERAL FORMAT 0058 THE FOLLOWING REVERSAL TRANSFORMATION OCCURS. 0059 IINPUT) 10UTPUT) 0060 FMTl11 = 6HABCDEF 6HZIOOOM 0061 FMTIO) = 6HGHIJKL 6HTUVWXY 0062 0063 ETC 0064 FMTI-N+l1 = 6HUVWXYZ 6HFGHIJK 0065 FMTI-N) = OCT7777777777 6HIABCDE WHERE M = N+l 0066 0067 0068 EXAMPLES 0069 0070 1. WITH ORDINARY FORMATS 0071 INPUTS - FMT111 ••• 2) = 12HI I5,3X, F9.5) 0072 USAGE CALL FNDFMTIFMT1,IXCF1) 9129/64 •••••••••••••••••••••••• FNDFMT ••••••••••••••••••••••••* PROGRAM LI STINGS • IPAGE 21 * * •• * • * * • • • • • • • •• OUTPUTS - IXCFl I PAGE a 7746110CTALI-XLOCFIFMTll+l, AND FMTlll ••• 21 IS UNCHANGED. 2. WITH LITERAL FORMATS AND REPEATED USAGE INPUTS FMT2131 = 6HI5,12X FMT2121 = 6H,5F9.5 FMT211) • OCT777777777777 FMT312). 3H515 FMT3(11 = OCT777777777777 USAGE 00 10 1=1.2 CALL FNDFMTIFMT213),IXCF2111) 10 CALL FNDFMTIFMT312),IXCF3III) OUTPUTS - FMT2111 = 6HI15,12 FMT2121 = 6HX,5F9. FMT213) 6H510002 lXCF2111 = IXCF2121 77461-XLOCFIFMT211)I+l FMT3111 4HI515 FMT3(21 = 6H 10001 IXCF3111 IXCF3121. 77461-XLOCFIFMT31111+1 = = = PROGRAM FOLLOWS BELOW •* * TRANSFER VECTOR CONTAINS REVER HTR o XRl HTR XR4 o 1,FNDFMT 8CI FNOFMTIFMT,IXCFMTI • ONLY ENTRY. FNDFMT SXD FNDFMT-2,4 FNOFMT-3,1 SXD • GET FIRST TWO CHARACTERS OF FMT(1) CLA. 1,4 FMT 111 STA LFMT IPUT ASIDE POSSIBLE LENGTH I XCA PXA 0,0 LGL 6 81TS S,1 ••• 5 STO Cl PXA 0.0 LGL 6 BITS 6 ••• 11 STO C2 * CHECK FOR C2 I. IF SO, MUST 8E A REVERSED FORMAT. CLA C2 CAS RPAREN TRA *+2 NO TRA CASE2 YES IF SO, MUST BE ORDINARY FORMAT. * IF NOT, CHECK FOR Cl I. CLA Cl CAS LPAREN TRA .+2 NO TRA CASE1 YES • IF NOT WE HAVE CASE OF UNREVERSED LITERAL HOLLERITH = = • •••••••••••••••••••••••• FNDFMT ••••••••••••••••••••••••• • • FIRST FIND ITS LENGTH, LFMT 100ESNT INCLUDE THE FENCE) AXT 0,1 XRl IS COUNTER CLA 1,4 TSX AIFMT),O 0,4 PAC -AIFMTI TO XR4 0,4 CAll CAL LAS FENCE NOP IIMPOSSIBLE) TRA COVER TXI .+1,1,1 TXI CALl,4,-1 • MAKE SETTINGS DEPENDING ON LFMT. COVER LXO FNDFMT-2,4 SXD TXL2,1 SXD CARRY,1 ITEMPI SXA LFMT,l PXA 0,1 ADO 1,4 AIFMTI+LFMT STA LDQ2 AIFMTI+LFMT+l ADD Kl STA SLW2 SUB Kl AIFMTI+LFMT-l SUB Kl STA TSXl STA TSX3 • REVERSE FMTlll ••• FMTll-LFMT+ll TSX SREVER,4 TSX1 TSX •• ,0 **=AIFMTI+LFMT-l 0073 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 00B5 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 2) . ..•••••••••••••••••••••••• FNDFMT •••••••••••••••••••••••• IPAGE PROGRAM LISTINGS •••••••••••••••••••••••• .. TSX CARRY,O TSX •• ,0 .":AIFMT)+LfMT-l LXD FNDFMT-2,4 .. INITIALIZE CARRY REGISTER TO LPAREN CLA LPAREN STO CARRY • fORM fMT(-LFMT+l.-LfMT+2 ••••• 01 TSX3 . SLII2 AXT LDO CAL LGL SLW PXA 1.1 ... ,1 CARRY 30 lGL 6 .... ,1 .... :AffMTl+LFMT .... "'AlfMT)+LFMT+l 0,0 CARRY SLW "+1,1,1 TXI TXL2 TXL LD02,1,." "·=LfMT .. THEN fORM AND SET fMTl1I CAL CARRY 30 lGl ACL RPADJ ACL LFMT 1,4 SlW" .. fINALLY FORM ADDRESS OF FORMAT AS IN CASE 2 .... CASE 2. FORMAT HAS BEEN PREVIOUSLY REVERSED. LENGTH IS GIVEN BY C4.C5.C6 lIN LFMT) CASE2 eLA LFMT TSX A(FMTl+L,O ADD 1,4 TRA LEAVE • CASE 1. FORMAT IS ALREADY CORRECT IN FMT CASEI CLA 1,4 TSX AIFMTl,O .. EXIT ROUTINE. SETS IXCFMT GIVEN MACHINE LOCATION OF fMT IN .. ADDRESS OF AC .. IxeFMT = 77461+1~ADDRESS LEAVE LXD fNDFMT-3.1 STA LFMT ISET ADDRESS ASIDE) CLA KCOMON SUB LFMT ALS 18 STO" 2.4 TRA 3,4 " CONSTANTS, TEMPORARIES Kl PZE 1 RPADJ BCI 1,0)0000 LPAREN BCI 1.000001 RPAREN BCI 1,000001 KCOMON OCT 000000017462 fENCE OCT 111711111117 "*=FMT LENGTH (ALSO TEMP fOR ADDRESS) LFMT PZE .... Cl PZE *" C2 PZE .... CARRY PZE .... (ALSO USEO AS TEMP FOR LFMT IN DECRI END .. • I PAGE 3) LD02 FNDFMT •••••••••••••••••••••••• 0148 0149 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0110 0111 0112 0173 0114 0115 0116 0171 0118 0119 0180 0181 0182 0183 0184 0185 0186 0181 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 3) •• *•••••••••••••• •••••• fRAME (709' ••••••••••••••••••••••••'" ~ • .. FRAME (709) (SUBROUTINE) .. FAP -FRAME (709) COUNT 30 LBL FRAME ENTRY FRAME PROGRAM LISTINGS .•••••••••••••••••••••••• fRAME (709) '" •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0033 0001 0002 0003 0004 0005 0006 '" ----A8STRACT---0007 0008 it TITLE FRAME 0009 • ADVANCE FILM FRAME ON SCOPE 0010 it FRAME ADVANCES THE FILM IN THE SCOPE CAMERA ONE FRAME. 0011 0012 ''"" LANGUAGE - FAP, SUBROUTINE (FORTRAN COMPATIBLE' 0013 • EQUIPMENT - 709 (MAIN FRAME AND SCOPEI 0014 0015 '" STORAGE - 4 REGISTERS 0016 '" SPEED - 500 MS FOR FRAME TO ADVANCE. .. AUTHOR - R.A. WIGGINS DEC, 1962 0017 001B '" ----USAGE---0019 '" it 0020 0021 '" TRANSfER VECTOR CONTAINS ROUTINES - NONE it AND FORTRAN SYSTEM ROUTINES - NONE 0022 it 0023 0024 it FORTRAN USAGE 0025 '" CALL fRAME it 0026 THE FILM IS AOVANCED ONE FRAME 0027 '" 002B 1,FRAME 8CI 0029 FRAME WRS 24 0030 CFF 0031 1,4 TRA 0032 0033 END -.. .. 9/29/64 ........................... . FRAME (7090) • PROGRAM LISTINGS .. FRAME 17090) ISUBROUTINE) .. FAP .FRAME (7090) COUNT 40 LBL FRAME ENTRY FRAME •••••••••••••••••••••••• • FRAME 17090) LAST CARO IN DECK IS NO. 0046 0001 0002 ob03 0004 0005 0006 ----ABSTRACT---0007 OOOB .. TITLE - FRAME (70901 0009 0010 .. ADVANCE FILM FRAME ON SCOPE 0011 FRAME AOVANCES THE FILM IN THE SCOPE CAMERA ONE FRAME • 0012 0013 0014 • LANGUAGE - FAP, SUBROUTINE (FORTRAN II COMPATIBLE) .. EQUIPMENT - 7090 (MAIN FRAME, OATA CHANNEL 0, AND SCOPE) 0015 .. STORAGE - 9 REGISTERS 0016 0017 - 500 MS FOR FRAME TO ADVANCE. • SPEED 001B .. AUTHOR - MIT COMPUTATION CENTER STAFF 0019 ----USAGE---0020 0021 0022 .. TRANSFER VECTOR CONTAINS ROUTINES - NONE 0023 • AND FORTRAN SYSTEM ROUTINES - NONE 0024 .. FORTRAN USAGE 0025 .. CALL FRAME 0026 0027 0028 .. THE FILM IS ADVANCED ONE FRAME. 0029 0030 0031 .. PROGRAM FOLLOWS BELOW 0032 .. FOLLOWING CARD DESIGNATES THE DATA CHANNEL THAT CRT IS ATTACHED TO. 0033 0034 • TO CHANGE, ALTER THE LETTER DESIGNATION ONLY AND REASSEMBLE. X UPENO 01 0035 SCPAD EQU X-lOS 0036 BCI 1,FRAME 0037 003B FRAME PSE SCPAD 0039 WRS SCPAD RCHX lOCO 0040 WRS SCPAD 0041 RCHX lOCO 0042 PSE SCPAD OCTAL FOR CFFX 0043 TRA 1,4 0044 0045 lOCO lOCO 0,0,0 0046 END .. • •. .. .... • . . .. • • •••••••••••••••••••••••• •••••••••••••••••••••••• 9/4/64 •••••••••••••••••••••••• • FRQCTl • •••••••••••••••••••••••• PROGRAM LISTINGS •••••••••••••••••••••••• FRQCTl • •••••••••••••••••••••••• • •••••••••••••••••••••••• FRQCTl * * •••••••••••••••••••••••• IPAGE 2) PROGRAM 1I STINGS •••••••••••••••••••••••• * FRQCTl * •••••••••••••••••••••••• IANS=O NC T=I XHI -IXlO+ 1 NSHIFT=IXlO-l IF (NX) 9991,9991,10 10 IF INCTI 9992,9992,15 15 00 20 I=l,NCT 20 ICTIII=O C SCAN IXIII TO MAKE COUNTS IPUT EACH IX IN RANGE 1 TO NCT FIRST). DO 35 1=1,NX IXI=IXIII-NSHIFT IF IIXII 9992,9992,30 30 IF IIXI-NCTI 35,35,9992 35 ICTIIXII=ICTIIXII+1 GO TO 9999 9999 RETURN 9991 IANS=1 GO TO 9999 9992 I ANS=2 GO TO 9999 END IPAGE 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 2) •••••••••••••••••••••••• • FRQCT2 • PROGRAM II STINGS •••••••••••••••••••••••• 9/29/64 • FRQCT2 I SUBROUTINE I • FAP .FRQCT2 COUNT 200 FRQCT2 LBL ENTRY FRQCT2 IX,LX,B,LB,ICOUNT,IANS) •••••• ~ •• 4 • • • • • • • • • • • FRQCT2 * ••• • • ••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0211 0001 0002 0003 0004 0005 0006 "• 0007 ----ABSTRACT---0008 • 0009 • TITLE - FRQCT2 " FREQUENCY COUNT OF NUMBER OF VALUES OF A SERIES IN GIVEN RANGES. 0010 0011 " FRQCT2 MAKES A FREQUENCY COUNT OF A FLOATING POINT, 0012 " FORTRAN INTEGER, OR MACHINE LANGUAGE INTERGER SERIES FOR 0013 " 0014 THE NUMBER OF VALUES LYING IN SPECIFIED RANGES. IT IS USEFUL IN COMPUTING EMPIRICAL PROBABILITY DENSITIES. 0015 •" 0016 • THERE ARE LB RANGE LIMITS, BIl" 1=1, LB. AND HENCE LB+1 0017 " RANGES. A NUMBER, XIJ), IS SAID TO BE IN THE I-TH RANGE 001B " IF Bll-l1 LSTHN OR EQUAL XIJI LSTHN BIll. A NUMBER IS IN 0019 " THE FIRST RANGE IF IT IS LSTHN BIll, AND IN THE LB+1 0020 " RANGE IF GRTHN OR EQUAL BILB). THE INPUT SERIES XII) MUST 0021 " BE THE SAME MODE IFLOATlNG, INTEGER, ETC.) AS THE RANGE 0022 " LIMITS BECAUSE THE METHOD USES CAS INSTRUCTIONS. 0023 " 0024 ""LANGUAGE - FAP SUBROUTINE IFORTRAN II COMPATIBLE) 0025 " EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0026 "STORAGE - 117 REGISTERS 0027 0028 " SPEED "AUTHOR - J. N. GALBRAITH 0029 0030 " ----USAGE---0031 " 0032 "" TRANSFER VECTOR CONTAINS ROUTINES - NONE 0033 " AND FORTRAN SYSTEM ROUTINES - NONE 0034 0035 "" FORTRAN USAGE 0036 " CALL FRQCT2IX,LX,B,LB,ICOUNT.IANS) 0037 003B "" INPUTS 0039 0040 " X(II l=l ••• LX IS THE GIVEN SERIES. 0041 " MAY BE FLOATING, FORTRAN INTEGER, OR MACHINE INTEGER. 0042 " 0043 " LX IS THE LENGTH OF THE X SERIES. 0044 " MUST BE GRTHN O. 0045 " 0046 " 0047 Bill l=l ••• LB IS VECTOR OF RANGE LIMITS. BII) LSTHN BII+11. " RANGES INTO WHICH THE SERIES IS DIVIDED ARE (-INFINITY, 004B " LSTHN B(1)1,IGRTHN DR =Bll',LSTHN B(2)) ETC. 0049 " MAY BE FLOATING, FORTRAN INTEGER, OR MACHINE INTEGER, 0050 " BUT MUST BE THE SAME AS XII) 0051 " 0052 " LB NUMBER OF RANGE LIMITS. 0053 "• MUST BE GRTHN O. 0054 NOTE - NUMBER OF RANGES =1+ NUMBER OF RANGE LIMITS. 0055 " 0056 "" OUTPUTS 0057 0058 "" 0059 ICOUNTII) I=I ••• LB+l=NUMBER OF X VALUES IN EACH RANGE OF B. " ICOUNT(1)=NO. X LSTHN B(1). ICOUNT(2)=NO. X LSTHN B(2), 0060 0061 " GRTHN OR =B(1). 0062 " ICOUNTILB)=NO. X LSTHN BILB),GRTHN OR=BILB-1). 0063 " ICOUNTILB+I)=NO. X GRTHN OR =BILB). 0064 " IANS IANS=O, NORMAL 0065 " IANS=I, ILLEGAL LX 0066 " IANS=2, ILLEGAL LB 0067 " IANS=3, WEIRD ERROR 0068 " 0069 "" EXAMPLES 0070 0071 "" 1. INPUTS - Xl1 ••• 15) = -21.,-20 •• -15.,-14 •• -12 •• -11 •• -B •• -7.,0.,1 •• 0072 " 2.1,3.,4.,5.,6. LX=15 Bll ••• 5)= -20.,-16.,-7.5,0.,.9 0073 0074 " LB=5 •••••••••••••••••••••••• FRQCT2 ••••••••••••••••••••••••• • IPAGE •••••••••••••••••••••••• PROGRAM LISTINGS it 21 IPAGE OUTPUTS - ICOUNTll ••• 61 = 1,1,5,1,1,6. it • IANS=O • 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT 811 ••• 51=-21.,-11.5,0.,'.5,6. .. OUTPUTS - ICOUNTf1 ••• 6) =0,5,3,5.1,1 IANS=O ... 3. .. .... .... ... " .... INPUTS - SAME AS EXAMPLE 1. EXCEPT 811 ••• 51'"-21.,-11.5,0,4.,5,6.1 OUTPUTS - ICOUNTll ••• 61 =0,5.3,5.2,0 IANS=O 4. INPUTS - SAME AS EXAMPLE 1. EXCEPT 8(1)=0. 8121=.5 IANS=O OUTPUTS - ICOUNTl1 ••• 3) =8,1,6 lB=2 5. INPUTS - SAME AS EXAMPLE 4. EXCEPT LB=O OUTPUTS - ERROR IANS =2 6. INPUTS - SAME AS EXAMPLE 4. EXCEPT OUTPUTS - ERROR IANS " 1 • FRQCT2 •••••••••••••••••••••••• LX=O lB=2 SAVE IRS AND CHECK FOR ILLEGAL PARAMETERS PZE 0 I,FRQCT2 BCI fRQCT2 SXA RETURN,l SXA RETURN+1,2 SXA RETURN+2,4 SXO FRQCT2-2,4 srz .. 6,4 IANS=O CLA. 2,4 GET LX TZE ERR1 TMI ERR1 STO END 4,4 ClA" GET lB TZE ERR2 TMI ERR2 ARS 18 LB IN ADDRESS STO LB ARS 1 LB/2 lIN ADDRESSI STO LBHAlF 1,4 CLA ADDRESS OF X ADO K1MLI AIX+lI STA XAOO TES TLO STA 3,4 ADDRESS OF B CLA ADO K1MLI AI B+lI STA BTESTl STA 8ADO SUB LB STA TESTHI 5,4 CLA ADDRESS Of ICOUNT ADO AIICOUNT+ll K1MLI STA STZCNT STA EQUAL STA STOCNT LXA L8d TXI "+1,1,1 SXO END1.1 1,4 AXT AXT 1,1 ... ,I STZCNT STZ ZERO ICQUNTIII,I"1,L8+1 TXI "+1,1,1 ENOl TXL STZCNT.1,". AXT 1,1 LOOP CLA K1MLI STO L8l0 INITIAL L8LO=1 CUI lR STO lBHI INlTlAL L8HI=L8 LRHALF CLA STO LBCOH INITIAL L8COH"LB/2 1,2 AXT .·,1 TESTlO CLA GET X. 1""=AIX+lI1 BTESTl CAS .·,4 8111 SEE IF IN LOWEST RANGE TRA TESTHI NEXINO TRA TRA EQUAL TESTHI CAS •• =AIBIL811. SEE IF IN HIGHEST RANGE "it TRA HIEST TRA HIEST 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 2) •••••••••••••••••••••••• FRQCT2 ••••••••••••••••••••••••• • (PAGE PROGRAM LISTINGS 31 SEARCH lXA l8COM,2 •• ,1 XAOO CLA •• ,2 801100 CAS TRoll GRATER TRoll NEXINO 0,2 lESS PXA SU8 l8l0 CAS K1HlI .+3 TRoll TRoll EQUAL TRoll ERROR ARS 1 ADD L8LO lOQ L8COH STQ L8HI STO L8COH TRoll SEARCH GRATER PXA 0,2 SU8 L8HI SSP CAS K1HlI .+3 TRoll TRoll NEXIND TRoll ERROR ARS 1 ADD LBCOH LDQ LBCOH STO LBCOH STQ LBLO TRoll SEARCH NEXINO TXI .+1,2,1 •• ,2 EQUAL CLA ADD K1FX •• ,2 STOCNT STO TXI ·+1,1,1 END TXL LOOP,l,·· •• ,1 RETURN AXT •• ,2 AXT •• ,4 AXT TRoll 7,4 LB,2 HIEST LXA TRoll NEXIND ERR1 CLA K1FX 6,4 STD· 7,4 TRoll ERR2 CLA K2FX STO. 6,4 7,4 TRoll ERROR CLA K3FX STD. 6,4 TRoll 7.4 • CONSTANTS AND TEMPORARIES KlFX PZE 0.0.1 0,0,2 K2FX PZE 0,0,3 K3FX PZE 1,0,0 K1MLI PZE L8 PZE 0 lBHAlF PZE 0 lBlO PIE 0 LBCOH PZE 0 LBHI PZE 0 END •••••••••••••••••••••••• FRQCT2 • •••••••••••••••••••••••• • (PAGE GET XIIR11 COHPARE WITH 8(L8COHI X GREATER, NEW L8l0 (~L8COHI GOT IT, INDEX ICOUNTIIR2+1) X LESS, NEW L8HI I~L8COHI L8COH-L8LO=0IF OIF GREATER THAN ONE OIF=l, GOT IT, INDEX ICOUNTlIR21 IMPOSSI8LE OIFI2 NEW L8COH L8COH-L8HI=-0IF Dlf GOT IT, INDEX ICOUNTlIR2+1) IHPOSSI8LE u=AIICOUNT+11 .-=0111 ICOUNT+11 ··"'LX 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 020B 0209 0210 0211 31 •••••••••••••••••••••••• • FSKIP • PROGRAM 1I STINGS •••••••••••••••••••••••• •••••••••••••••••••••••• • FSKIP • • ••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0103 0001 0002 *FSKIP 0003 COUNT 15 0004 LBL FSKIP 0005 ENTRY FSKIP IITAPE.NFILES) 0006 0007 • 0008 ----ABSTRACT---0009 • 0010 • TITLE - FSKI P 0011 • SKIP FORWARD OR BACKWARD OVER FILES ON TAPE 0012 0013 FSKIP SKIPS AN ARBITRARY NUMBER OF FILES FORWARD DR • 0014 BACKWARD ON A TAPE. THE END POSITION OF THE TAPE IS 0015 AT THAT EDGE OF THE FILE MARK WHICH IS FURTHEST FROM 0016 THE BEGINNING OF THE TAPE • 0011 •.. LANGUAGE - FAP. SUBROUTINE (FORTRAN II COMPATIBLE) 0018 0019 .. EQUIPMENT - 109 OR 1090 (MAIN FRAME, DATA CHANNEL AND TAPE UNIT) 0020 • STORAGE - 50 REGISTERS 0021 • SPEED 0022 • AUTHOR - J.F. CLAERBOUT. AUGUST, 1962 0023 • 0024 • 0025 ----USAGE---0026 •.. TRANSFER VECTOR CONTAINS ROUTINES - NONE 0021 lIDS), (RDS), (BSR), (TCO), 0028 " AND FORTRAN SYSTEM ROUTINES I TEF), ITRCl 0029 "" FORTRAN USAGE 0030 0031 " CALL FSKIP IITAPE,NFILES) 0032 0033 "• INPUTS 0034 0035 ITAPE 0036 IS LOGICAL TAPE NUMBER "• 0031 IS FORTRAN II INTEGER 0038 NFILES IS NUMBER OF FILES TO BE SKIPPED. 0039 0040 IF GRTHN 0 SKIPS AHEAD. • 0041 IF LSTHN 0 BACKS UP NFILES lOR TO LOAD POINT, WHICHEVER • COMES FIRST). IF THE TAPE IS PRESENTLY PART WAY THROUGH 0042 • A FILE, IT COUNTS AS ONE FILE • 0043 0044 A FILE IS DEFINED TO BE ARBITRARY NUMBER OF BCD OR 0045 BINARY RECOROS FOLLOWED BY AN END OF FILE. • 0046 IF =0 DOES NOT MOVE THE TAPE IS FORTRAN II INTEGER 0041 • 0048 0049 • THE TAPE IS MOVED 0050 OUTPUTS 0051 • 0052 0053 • PROGRAM FOLLOWS BELOW 0054 0055 1,FSKIP BCI 0056 FSKIP SXA SKIP9,4 0051 CLA. 1,4 0058 STD SKI P3 0059 SKIP3 CAL $( IDS) ,4 0060 TSX 0061 LXA SKIP9,4 0062 SIRDS) SET UP CAL" 0063 :01000 ANA 0064 FOR BTl STA SKPBTl 0065 $IBSR) CLA0066 SSM 0061 FILE INSTRUCTION. STO SKPBSF SET UP BACKSPACE 0068 SITCO) SET UP LDO· 0069 SLQ SKIP4 CHANNel DELAY. 0070 SKIP5 SLO $ITEF) 0011 LDQ0012 SLQ SKPTEF 0013 SLQ A 0014 $ITRC) LOO- "• .. . • .... .. . . . .. ... . .. .. . .. FSKIP (SUBROUTINE) FAP 9/4/64 • ••••••••••••••••••••••• • FSKIP PROGRAM LISTINGS •••••••••••••••••••••••• IPAGE - TRC1 2,4 3,4 ,4 SKIPI $IBSRI XEC* * SKPBSF BSFA TIX --1,4,1 SIRDSI XEC* SKIP4 TCOA TEFA SKIP9 A $IBSRI XECSKPBTl BTT SKIP9 TRA * DONE BACK SKIP * - DONE FORWARD SKIP SKIPI XEC* SIRDSI SKIP5 TCOA SKPTEF TEFA SKI P2 TRA SKIPI SKIPl,4,1 SKIP2 TIX SKIP9 AXT *-,4 TRCI TRCA -+1 TRA 3,4 SKIP3 PZE 16 END -- - FSKIP • •••••••••••••••••••••••• IPAGE 21 SLQ CLATlE POX TPL -..•.•....•............. * * NO SKIPPING WANTED. SET FOR N FILE JUMPS SKIP AHEAD ON TAPE. SKIP 8ACK. GET OVER EOF MARK WHICH IS JUST BEFORE PRESENT POSITION. GO BACK OVER N FILES. PASS OVER EOF -- MUST BE AT BEGINNING OF TAPE TURN OFF BEGINNING OF TAPE LIGHT. AT BEGINNING OF TAPE - PASS A RECORD OELAY. GO TO EOF COUNTER. NO EOF, KEEP PASSING RECORDS. COUNT EOF-S. 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 21 •••••••••••••••••••••••• FT24 .. •••••••••••••••••••••••• • -- FT24 FAP ISUBROUTINE) PROGRAM LISTINGS •••••••••••••••••••••••• FT24 .. • ••••••••••••••••••••••• • LAST CARD IN DECK IS NO. 0847 0001 -FT24 0002 COUNT 750 0003 LBL FT24 0004 ENTRY FT24 ID.A,B) 0005 0006 • ----ABSTRACT---0007 • 0008 0009 - TITLE - FT24 • HIGH SPEED 24 POINT SPECTRUM 0010 0011 • FT24 COMPUTES THE SINE AND COSINE TRANSFORMS OF 24 DATA 0012 0013 POINTS. THE TRANSFORMS ARE EVALUATED AT FREQUENCIES 0014 • FREQ : II-ll.PI/12 1=1 ••• 13 0015 • 0016 • WHERE PI 3.14159265 0017 AND FREQ = PI IS EQUIVALENT TO THE FOLDING FREQUENCY 0018 • 0019 FOR THE DATA SERIES • OOZO • FTZ4 GAINS ITS SPEED FROM 0021 • 0022 • 1. STRAIGHT LINE PROGRAMMING RATHER THAN IN LOOPS 0023 • Z. GROUPING TERMS TO MINIMIZE THE NUMBER OF MULTIPLIES 0024 • NECESSARY 0025 • 3. SUBGROUPING ADDITIONS TO TAKE ADVANTAGE OF VARIOUS 0026 • SYMMETRIES 0027 • 4. SELECTION OF THE NUMBER OF FREQUENCIES SO AS TO 0028 • MAXIMIZE THE NUMBER OF SYMMETRIES GENERATED 0029 • 5. USING FIXED POINT ARITHMETIC 0030 • 0031 • THE EQUATIONS USED WERE DEVELOPED IN SCIENTIFIC REPORT 0032 • NO.1 OF AIR FORCE CONTRACT AF 19(604)737B. APPENDIX J. 0033 • 0034 • LANGUAGE - FAP SUBROUTINE IFORTRAN II COMPATIBLE) 0035 • EQUIPMENT - IBM 709 OR 7090 IMAIN FRAME ONLY) 0036 • STORAGE - 777 REGISTERS 0037 • SPEED - ABOUT 4750 MACHINE CYCLES. 0038 0039 • AUTHOR - CHEH PAN 0040 • ---USAGE---0041 0042 •- TRANSFER VECTOR CONTAINS ROUTINES - FXDATA, FLDATA 0043 .. AND FORTRAN SYSTEM ROUTINES - NONE 0044 0045 • 0046 - FORTRAN USAGE • CALL FT24 ID,A,B) 0047 0048 • 0049 - INPUTS 1=1 ••• 24 IS THE DATA VECTOR THE TRANSFORM IS TO BE 0050 • DIll It MADE OF. 0051 0052 - OUTPUTS 1=1 ••• 13 IS THE COSINE TRANSFORM 0053 • AlII All) = (1/24) .. ISUM IFROM 1=1 TO 241 OF Dill) 0054 IFROM 1=1 TO 24) OF 0055 A1131= 11/241 (SUM • DII)-COSIII-I).PII) 0056 AIJI 111121. ISUM (FROM 1=1 TO 24) OF 0057 DIII-COSIIJ-1).II-II-PIJ) 005'8 FOR J = Z.3 •••• ,12 0059 0060 BU) 1=1 ••• 13 IS THE SINE TRANSFORM Q061 Bill BI131 = 0.0 0062 BIJI = 11/121 • ISUM IFROM 1=1 TO 24) OF 0063 0064 DIII·SINIIJ-11-11-1)·PIJ) • FOR J = Z.3, ••• ,12 0065 0066 • 0067 • EXAMPLES 0068 •.. 1. INPUTS - 011 ••• 241 = 12.,12.,0.,0 •••••• 0. 0069 0070 • OUTPUTS - All ••• 13) 1 •• 1.966.1.866.1.707.1.500.1.259,1.000. 0071 . 0.741.0.500.0.Z93.0.134.0.034.0.000 0072 . .. . .. . -. .... ... .. ... 9129/64 ***** •••••••••• ** ••••••• Ff24 * PROGRAM LISTINGS * (PAGE * 2) B( 1 ••• 131 •* * sua SUB ADD X9 X15 X21 XCA MPY ADO S10 CLA SUB SUB ADO ARS ADD SID ClA sua sue ADO XCA MPY ADO C3 At Al X4 X8 X16 X20 1 Al At X5 X7 X17 Xl9 C5 Al F124 (PAGE 0.,0.259,0.500,0.707,0.866,0.966,1.000, 0.966,0.866,0.707,0.500,0.259,0.000 HTR o BCI 1,fT24 SXD *-2,4 CLA 1,4 ADD =-1 STA MOVED CLA 2,4 ADO =1 STA MDVEA ClA 3,4 ADD =1 SIA MOVEB MOVE DATA INTO PROGRAM * AXT 24,4 MOVED ClA .*,4 S10 XO+1,4 T1X *-2,4.1 CALL FXDATA.KD24,XO,MXOATA,SCAlE INSERI INDIVIDUAL fORMULAE * CAO ClM AXI 24,4 XO+1,4 ADD TIX *-1,4,1 AO STO CA12 ClM AXI 1,4 ADD XO+1,4 XO,4 SUB TXI *+1,4,2 TXl *-3,4,24 510 A12 CAl xo CLA SUB X12 510 Al ClA XI SUB Xli SUB Xl3 ADD X23 XCA MPY CI ADD Al S10 Al X2 ClA sue XIO SUII X14 ADO X12 XCA MPY C2 ADO Al STO Al CLA X3 FT24 •••••••••••••••••••••••• ••••••••••••••••••••••••* •••••••••••••••••••••••• 0073 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0096 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0116 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0136 0139 0140 0141 0142 0143 0144 0145 0146 0147 21 •••••••••••••••••• * ••••• .••••••••••••••••••• . FT24 ** ••• (PAGE 31 CSI CA2 CB2 PROGRAM LISTINGS .* •••• ** •••••••••••••••• . .. FT24 ••••• ** •••••••• ***.* •••• (PAGE STO CLA SUB STO CLA ADO SUB SUB XCA MPY AOO STO CLA ADD SUB SUB ARS ADD STO CLA ADO SUB SUB XCA MPY ADO STO CLA ADD SUB SUB XCA MPY ADD STO CLA ADO SUB SUB XCA MPY ADO STO CLA SUB ADD SUB STO CLA SUB SUB ADD ADD SUB SUB ADD XCA MPY ADO STO CLA SUB SUB ADD ADD SUB SUB ADD ARS ADD STO CLA SUB ADO SUB Al X6 X18 61 Xl XU X13 X23 Sl B1 Bl X2 XI0 X14 X22 1 B1 B1 X3 X9 X15 X21 S3 Bl 61 X4 X8 X16 X20 54 Bl B1 X5 X7 X17 X19 55 Bl 81 XO X6 X12 X18 A2 Xl X5 X7 Xli X13 X17 X19 X23 C2 A2 A2 X2 X4 XB XI0 X14 X16 X20 X22 1 A2 A2 X3 X9 X15 X21 0148 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 01B4 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 019B 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 31 ** •••••• * •••• * ••••••• .••• . * ••••••••••••••••••••••• FT24 (PAGE 4) CA3 C83 CA4 PROGRAM LISTINGS *** ••• * ••••••••••• .••••••FT24 .. •••••••• ** ••••••••• * •••• (PAGE STO ClA ADD SUB SUB ADD ADD SUB SUB ARS ADD S10 ClA ADD SUB SUB ADD ADD SUB SUB XCA MPY ADD STO ClA SUB ADD SU8 ADD SU8 S10 CtA SUB SUB ADD ADD SUB SUB ADD ADD SUB SUB ADD XCA MPY ADD S10 ClA SUB ADD SUfi ADD SUB STO ClA ADD SUB SUB ADD ADO SUB SU8 ADD ADD SU8 SU8 XCA MPY ADD STO CLA SUB ADD SUfi ADD B2 Xl X5 X7 XU X13 X17 X19 X23 1 B2 B2 X2 X4 X8 X10 X14 X16 X20 X22 S4 82 82 XO X4 X8 X12 X16 X20 A3 Xl X3 X5 X7 X9 Xli Xl3 X15 X17 X19 X21 X23 C3 A3 A3 X2 X6 XIO X14 XI8 X22 B3 Xl X3 X5 X7 X9 Xll X13 XI5 X17 X19 X21 X23 S3 B3 83 XO X3 X6 X9 X12 0223 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 026B 0269 0270 0271 0272 0273 0274 0275 0276 0277 0278 0279 0280 0281 0282 0283 0284 0285 0286 0287 0288 0289 0290 0291 0292 0293 0294 0295 0296 0297 4) • ••••••••••••••••••••••• • FT24 * •••••••••••••••••••••••• IPAGE 51 CB4 CA5 SUB ADD SUB STO ClA SUB SUB ADD ADD SUB SUB ADO AOD SUB SUB ADD ADD SUB SUB AOD ARS ADD STO ClA AOD SUB SUB ADD ADD SUB SUB ADO ADO SUB SUB ADD ADD SUB SUB XCA MPY STO ClA SUB STO ClA SUB SUB ADO XCA MPY ADD STO ClS ADD ADO SUB XCA MPY ADD STO ClS ADO ADD SUB XCA MPY ADD STO ClA SUB sue AOD ARS ADD X15 X18 X21 A4 Xl X2 X4 X5 X7 X8 Xl0 X11 X13 X14 X16 X17 X19 X20 X22 X23 1 A4 A4 Xl X2 X4 X5 X7 X8 X10 XU X13 X14 X16 Xl1 X19 X20 X22 X23 S4 B4 XO X12 A5 X5 X7 X17 X19 C1 A5 AI) X2 Xl0 X14 X22 C2 A5 A5 X3 X9 X15 X21 C3 A5 A5 X4 X8 X16 X20 1 A5 PROG~AM 1I STINGS • ••••••••••••••••••••••• FT24 *• ••••••••••••••••••••••• * IPAGE 029B 0299 0300 0301 0302 0303 0304 0305 0306 0301 0308 0309 0310 0311 0312 0313 0314 0315 0316 0317 031B 0319 0320 0321 0322 0323 0324 0325 0326 0327 0328 0329 0330 0331 0332 0333 0334 0335 0336 0337 0338 0339 0340 0341 0342 0343 0344 0345 0346 0347 0348 0349 0350 0351 0352 0353 0354 0355 0356 0357 0358 0359 0360 0361 0362 0363 0364 0365 0366 0367 0368 0369 0370 0371 0372 51 .•••••••••••••••••••••••• . •••••••••••••••••••••••• FT21t (PAGE 6) C85 CA6 C86 STO ClA SUB SUB ADD XCA MPY ADD STO ClA SUB STO CLA ADD SU8 SUB XCA MPY ADD SrD ClA ADD SUB SUB ARS ADD STO ClS SUB AOD ADD XCA MPY ADD sro ClS SUB ADD ADO XCA MPY ADO STO ClA ADD SUB SUB XCA MPY ADO STO ClA SUB ADO SU8 ADO SUB ADO SUB ADD SUB AnD SUB srD ClA SUB ADD SUB ADD SUB ADD SUB ADD SUB ADD A5 Xl Xli X13 X23 C5 A5 AS X6 X18 B5 X5 X7 X17 X19 SI B5 B5 X2 XI0 X14 X22 1 B5 B5 X3 X9 X15 X21 53 B~ B5 X4 X8 X16 X20 S4 B5 85 Xl XU X13 X23 55 B5 B5 XO X2 X4 X6 X8 XI0 X12 X14 X16 X18 X20 X22 A6 Xl X3 X5 X7 X9 XU X13 XIS X17 X19 X21 PROGRAM Ll STINGS .•••••••••••••••••••••••• . FT24 • ••••••••••••••••••••••• (PAGE 0313 0314 0315 0376 0377 0318 0319 0380 0381 0382 0383 0384 0385 0386 0387 0388 0389 0390 0391 0392 0393 0394 0395 0396 0397 0398 0399 0400 0401 0402 0403 0404 0405 0406 0407 0408 0409 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 0430 0431 0432 0433 0434 0435 0436 0431 0438 0439 0440 0441 0442 0443 0444 0445 0446 0447 6) . ..•••••••••••••••••••••••• FT24 •••••••••••••••••••••••• IPAGE 11 CA7 CB7 SUB STO CLA SUB S10 CLS ADD AOD SUB XCA MPY ADD STO CLS ADD ADD SUB XCA MPY ADD STO CLA SU8 SUB ADD XCA MPY ADD STO CLA SUB SUB ADO ARS ADD STO CLS AOD ADD SU8 XCA MPY ADD STO CLS ADD STO CLA ADO SUB SUB XCA MPY ADD STO CLS SUB ADD ADD ARS ADD STO ClS SUB ADD ADD XCA MPY ADD STO CLA I\DD SUB SUB XCI\ X23 B6 XO X12 A7 X5 X7 Xl7 X19 Cl A7 A7 X2 X10 Xl4 X22 C2 A7 A7 X3 X9 X15 X21 Cl A7 A7 X4 X8 X16 X20 I A7 A7 Xl Xl! X13 XV C5 A7 A7 X6 X18 B7 X5 X7 XI7 X19 Sl 87 87 X2 X10 XI4 X22 1 B7 B7 X3 X9 X15 X21 S3 B1 B7 X4 X8 X16 X20 PROGRAM LISTINGS .•••••••••••••••••••••••• .. FT24 •••••••••••••••••••••••• IPAGE 0448 0449 0450 0451 0452 0453 0454 0455 0456 0457 0458 0459 0460 0461 0462 0463 0464 0465 0466 0467 0468 0469 0470 0471 0472 0473 0474 0475 0476 0477 0478 0479 0480 0481 0482 0483 0484 0485 0486 0487 0488 0489 0490 0491 0492 0493 0494 0495 0496 0497 0498 0499 0500 0501 0502 0503 0504 0505 0506 0507 0508 0509 0510 0511 0512 0513 0514 0515 0516 0517 0518 0519 0520 0521 0522 7) ........ -.......-_......• • FT24 •••••••••••••••••••••••• (PAGE 8) CA8 CBB CA9 PROGRAM LISTINGS •••••••••••••••••••••••• .• -......................• FT24 (PAGE MPY ADD STO CLA ADD SUB SUB XCA MPY ADD STO CLA ADD ADD ADD ADD ADD ADD ADD STO CLS SUB SUB SUB SUB SUB SUB SUB SUB SUB SUB SU8 SUB SU8 SUB SUB ARS ADD STO CLA SU8 ADD SUB ADD SUB ADD SUB ADD SUB ADD SUB ADD SUB ADD SUB XCA MPY STO CLA SUB ADD SUB ADD SUB STO ClS ADD ADD SUB SUB ADD ADO SUB SU8 ADD S4 B7 B7 Xl XU X13 X23 S5 B7 B7 XO X3 X6 X9 X12 X15 X18 X21 A8 Xl X2 X4 X5 X1 X8 XIO Xll Xl3 X14 XL6 X17 X19 X20 X22 X23 1 A8 A8 Xl X2 X4 X5 X7 Xii XIO XU X13 X14 X16 Xl7 X19 X2D X22 Xl3 S4 B8 XD X4 X8 X12 X16 X20 A9 Xl X3 X5 X1 X9 Xll X13 XI5 Xl7 XL9 0523 0524 0525 0526 0527 0528 0529 0530 0531 0532 0533 0534 0535 0536 0537 0538 0539 0540 0541 0542 0543 0544 0545 0546 0541 0548 0549 0550 0551 0552 0553 0554 0555 0556 0557 0558 0559 0560 0561 0562 0563 0564 0565 0566 0567 0568 0569 0570 0571 0572 0573 0574 0575 0576 0577 0578 0579 0580 0581 0582 0583 0584 0585 0586 0587 0588 0589 0590 0591 0592 0593 0594 0595 0596 0597 8) *** ••• * ••• .•••••••••••••• FT24 if •••••••••••••••••••••••• (PAGE 91 C89 ADD SU8 XCA MPY ADD STO CLS ADD SU8 ADD SUB CAIO AOD STO CLA ADD SUB SUB ADD ADD SUB SUB ADD AOO SUB SUB XCA MPY ADD STO CLA SUB ADD SUB STO CLS ADD ADD SUB SUB ADD ADD SUB XCA MPY ADD STO CLA SUB SUB ADO ADD SUB CBIO SUB ADD ARS ADD STO CLA SU8 ADD SUB STO CLA ADD SUB SUB ADD ADD SU8 SUB ARS ADD STO CLS SUB X21 X23 C3 A9 A9 X2 X6 XI0 X14 Xi8 X22 89 Xl X3 X5 X7 X9 Xll X13 X15 X17 X19 X21 X23 S3 B9 B9 XO X6 X12 X18 AID Xl X5 X1 XlI XU Xl1 X19 X23 C2 AI0 AIO X2 X4 Xll XIO X14 X16 X20 X22 I AID AID X3 X9 X15 X21 BID Xl X5 X1 XU X13 X17 X19 X23 I BID 810 X2 X4 PROGRAM LISTINGS .•••••••••••••••••••••••• . FT24 ••••••••••••••••• * •••••• (PAGE 0598 0599 0600 0601 0602 0603 0604 0605 0606 0607 0608 0609 0610 0611 0612 0613 0614 0615 0616 0617 0618 0619 0620 0621 0622 0623 0624 0625 0626 0627 0628 0629 0630 0631 0632 0633 0634 0635 0636 0637 0638 0639 0640 0641 0642 0643 0644 0645 0646 0641 0648 0649 0650 0651 0652 0653 0654 0655 0656 0657 0658 0659 0660 0661 0662 0663 0664 0665 0666 0667 0668 0669 0610 0611 0612 9) • ••••••••••••••••••••••• FT24 * ••••••••••••••••••••••••* (PAGE 10) CAll ADD ADO SUB SUB ADD ADO XCA MPY ADD STO CLA SUB STO CLS ADD ADD SUB XCA MPY ADD sro CLA SUB SUB ADD XCA MPY ADD STO ClS ADD ADD SUB XCA MPY ADD sro CBll CLA SUB SUB ADD ARS ADD SID ClS ADD ADD SUB XCA MPY ADD SID CLS ADD STO CLA ADD SUB SUB XCA MPY AOD STO CLS SUB ADO ADD ARS ADD STO CLA ADO SUB SUB XCA X8 X10 X14 X16 X20 X22 S4 BIO B10 XO X12 All Xl XlI Xl3 X23 CI All All X2 XI0 X14 X22 C2 All All X3 X9 X15 X21 C3 All All X4 X8 X16 X20 1 All All X5 X7 Xl1 X19 C5 All All X6 X18 Bll Xl Xll X13 X23 SI Bll Bll Xl XIO X14 X22 1 Bll Bll X3 X9 XIS XlI PROGRAM LISTINGS •••••••••••••••••••••••• FT24 • *•••••••••••••••••••••••• (PAGE 10) 0613 0674 0615 0616 0617 0618 0619 0680 0681 0682 06B3 0684 0685 0686 0687 0688 0689 0690 0691 0692 0693 0694 0695 0696 0691 0698 0699 0100 0701 0102 0103 0104 0105 0706 0701 0708 0109 0110 0111 0712 0113 0114 0715 0716 0117 0118 0719 0720 0721 0722 0723 0124 0725 0126 0721 0728 0729 0130 0131 0132 0733 0134 0735 0736 0137 0738 0739 0740 0141 0142 0743 0744 0745 0746 0747 •••••••••••••••••••••••• - - FT24 PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 111 MPY ADD STO CLS SUB ADD ADD XCA MPY ADD STO CLA ADD SUB SUB XCA MPY ADD STO LDQ FMP STO CALL LDQ FMP STO LDQ FMP STO AXT CLA MOVEA STO CLA MOVES STO TlX SV4 LXD TRA MXDATA PZE SCALE PZE KD26 PZE KD24 PZE SI OCT OCT S3 OCT S4 S5 OCT EQU Cl EQU C2 (;3 EQU EQU C5 Al2 PZE All PZE AIO PZE A9 PZE pze A8 A7 PZE A6 PZE A5 PZE A4 PZE A3 PZE A2 PZE Al PZE AO PZE PZE 812 811 PZE 810 PZE PIE 89 88 PZE 87 PIE PZE 8& 85 PZE 84 PlE 83 PIE PZE 82 PIE 81 PZE 80 - - FT24 •••••••••••••••••••••••• S3 Bll Bll X4 X8 X16 X20 S4 Bll Bll X5 X7 X17 X19 S5 Bll Bll SCALE =12. SCALE FLOATA,KD26,BO,SCALE AO :.5 AO A12 =.5 A12 13,4 AO+ 1 ,4 •••••••••••••••••••••••• MOVE COEFS BACK TO MAIN •• ,4 . BO+1,4 •• ,4 MOVEA-1,4,l FT24-2,4 4,4 0,0,100000 0,0,26 0,0,24 SIN(PII121 102203734074 SIN(PII41 265011714631 335547535014 SIN( PIn I 367215650717 SINIS"PI/12) COS (P III I S5 COS(PII6) S4 COSIPI/41 S3 SI cose5-P1I121 ALWAYS ZERO ALWAYS ZERO (PAGE 1U 0748 0749 0750 0751 0752 0753 0754 0755 0756 0757 0758 0759 0760 0761 0762 0763 0764 0765 0766 0767 0768 0769 0770 0771 0772 0773 0774 0775 0776 0777 0778 0779 0780 0781 0782 0783 0784 0785 0786 0787 0788 0789 0790 0791 0792 0793 0794 0795 0796 0797 0798 0799 0800 0801 0802 0803 0804 0805 0806 0807 0808 0809 0810 0811 0812 0813 0814 0815 0816 0817 0818 0819 0820 0821 082l •••••••••••••••••••••••• • • FT24 •••••••••••••••••••••••• (PAGE 12) X23 X22 X2i X20 Xl9 Xl8 X17 X16 Xl5 Xl4 Xl3 X12 XU X10 X9 X8 X1 X6 X5 X4 X3 X2 Xl XO PIE PZE PZE PIE PZE PZE PZE PZE PZE PZE PZE PIE PIE PZE PZE PZE PZE PIE PZE PZE PZE PZE PIE PZE END PROGRAM LISTINGS •••••••••••••••••••••••• FT24 • • •••••••••••••••••••••••• ( PAGE 121 0823 0824 0825 0826 0821 0828 0829 0830 0831 0832 0833 0834 0835 0836 0831 0838 0839 0840 0841 0842 0843 0844 0845 0846 0841 .•••••••••••••••••••••••• FT24 -II * PROGRAM LISTINGS -II •••••••••••••••••••••••• .. - FT24 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 C C C C C C C C •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0146 0001 0002 SUBROUTINE FT24 (DD.AA.BBI 0003 0004 ----ABSTRACT---0005 0006 TITLE - FT24 -II 0001 HIGH SPEED 24 POINT SPECTRUM 0008 0009 FT24 COMPUTES THE SINE AND COSINE TRANSFORMS OF 24 DATA 0010 POINTS. THE TRANSFORMS ARE EVALUATED AT FREQUENCIES 0011 0012 FREQ = (1-1I"PI/12 1=1 ••• 13 0013 0014 WHERE PI 3.14159265 0015 AND FREQ = PI IS EQUIVALENT TO THE FOLDING FREQUENCY 0016 FOR THE DATA SERIES 0011 0018 FT24 GAINS ITS SPEED FROM 0019 0020 1. STRAIGHT LINE PROGRAMMING RATHER THAN IN LOOPS 0021 2. GROUPING TERMS TO MINIMIZE THE NUMBER OF MULTIPLIES 0022 NECESSARY 0023 3. SUBGROUPING ADDITIONS TO TAKE ADVANTAGE OF VARIOUS 0024 SYMMETRIES. 0025 4. SELECTION OF THE NUMBER OF FREQUENCIES SO AS TO 0026 MAXIMIZE THE NUMBER OF SYMMETRIES GENERA TEO 0021 0028 THE EQUATIONS USED WERE DEVELOPED IN SCIENTIFIC REPORT 0029 NO.1 OF AIR FORCE CONTRACT AF 19(6041131B, APPENDIX J. 0030 0031 LANGUAGE - FORTRAN II SUBROUTINE 0032 EQUIPMENT - IBM 109 OR 1090 (MAIN FRAME ONLYI 0033 0034 STORAGE - 818 REGISTERS SPEED - ABOUT 4100 MACHINE CYCLES. 0035 AUTHOR - R.A. WIGGINS JUNE, 1963 0036 0031 ----USAGE---0038 0039 TRANSFER VECTOR CONTAINS ROUTINES - NONE 0040 AND FORTRAN SYSTEM ROUTINES - NONE 0041 0042 FORTRAN USAGE 0043 0044 CALL FT24 CDD,AA, BBI 0045 INPUTS 0046 OO( I I 0041 1=1 ••• 24 IS THE DATA VECTOR THE TRANSFORM IS TO BE MADE OF. 0048 0049 OUTPUTS AA( I I 1=1 ••• 13 IS THE COSINE TRANSFORM 0050 AAl11 = (1/241 * (SUM (FROM 1=1 TO 241 OF 0(111 0051 AA1131= (1/241 * (SUM (FROM 1=1 TO 241 OF 0052 O( II-COSI (I-ll*PIII 0053 0054 AAIJI = 11/121 " ISUM (FROM 1=1 TO 241 OF 0055 D( I I"COS( IJ-U*I I-ll"PIlI FOR J = 2,3, ••• ,12 0056 0051 0058 1=1 ••• 13 IS THE SINE TRANSFORM BBI I I BBl11 = BBI131 = 0.0 0059 BBIJI = 11/121 .. ISUM IFROM 1=1 TO 241 OF 0060 o ( II .S I NI I J-11. I l-ll.P I I ) 0061 0062 FOR J = 2,3, ••• ,12 0063 EXAMPLES 0064 0065 12.,12.,0.,0., ••• ,0. 0066 1. INPUTS - 0011 ••• 24) 0061 1.,1.966,1.B66,1.101,1.500,1.259,1.000, 0068 OUTPUTS - AAll ••• 131 0.141,0.500,0.293,0.134,0.034,0.000 0069 0010 BB ( 1 ••• 13) 0.,0.259,0.500,0.701,0.866,0.966,1.000 0.966.0.866.0.701,0.500,0.259,0.000 0011 0012 0013 PROGRAM FOLLOWS BELOW 0014 LABEL CFT24 -II C -II (SUBROUTINEI .•••••••••••••••••••••••• FT24 " 9/29/64 •••••••••••••••••••••••• FT24 -II * * •••••••••••••••••••••••• (PAGE 2) 8 8 8 8 10 20 30 PROGRAM ll5TING5 •••••••••••••• * ••• * ••••• FT24 -ll * * •••••••••••••••••••••••• IPAGE DIMEN510N DD(24),AAI13),88113),X(241,AI131,8(131 EQUIVALENCE lXIII, XOI,IX(2),Xl),(XI3),X2),(X(4I,X3I,(X(5"X4) EQUIVALENCE IX(61 ,X51, (X(1) ,X61, (XI8l,X71, (X(91,X8), (X(10),X91 EQUIVALENCE (XIll),XI0),(X(12),XI1),(X(13),XI2),(XI14),X13) EQUIVALENCE (X(15I,XI4),(X(16),XI5),(X(17),X161,IX(18),XI7) EQUIVALENCE IX(19),XI81,(XI20),X19),IXI21),X20),IX(22),X21) EQUIVALENCE IX(23),X22),IXI24),X23) EQUIVALENCE IAll),AO),IAI2),Al),IAI3),A2I,IAI4),A3),IAI51,A4) EQUIVALENCE IA(6),A5),IAI7),A6),IAI8),A7),IAI9),A8),IAII0I,A9) EQUIVALENCE IAI 11) ,AIO), I AI 12), Al11, I AI 13), A12) EQUIVALENCE 18(1),80),1812),81),1813),82),1814),83),1815),84) EQUIVALENCE 18(6),85),1817),86),1818),87),1819),88).18(10),89) EQUIVALENCE 181111,810),181121,811),18(13),812) EQUIVALENCE ICl,55),IC2,541,IC3,53).(C5,51) SI=177411017560 53=200552023632 54=200673317272 55=200756433522 AO=O. DO 10 1=1,24 XII I=DDII 1/12. AO=AO+XII) AO"AOI2. A12=0. 00 20 1=1,24,2 AI2=AI2+X(I)-X(I+l) A12=A12l2. Al=(XO-X12)+(XI-Xll-XI3+X23)*Cl+(X2-XlO-XI4+X22)*C2+ 1 (X3-X9-X15+X21)*C3+(X4-X8-XI6+X20J*.5+(X5-X7-XI7+X19J*C5 81=(X6-XI8J+(X1+XIl-XI3-X23)*SI+{X2+XlO-X14-X221*.5+ 1 IX3+X9-XI5-X21)*S3+(X4+X8-X16-X201*S4+(X5+X7-X17-XI9)*S5 A2=(XO-X6+X12-X18)+(XI-X5-X7+Xll+X13-X17-XI9+X23)*C2+ 1 (X2-X4-X8+X10+XI4-XI6-X20+X22)*.5 82=(X3-X9+XI5-X21)+(Xl+X5-X7-X11+X13+XI7-XI9-X23)*.5+ 1 (X2+X4-X8-XIO+X14+XI6-X20-X22)*S4 A3=(XO-X4+X8-XI2+XI6-X20)+IXl-X3-X5+X7+X9-XII-X13+X15+X17-X19-X21+ 1 X23)*C3 83=(X2-X6+X10-X14+XI8-X22)+(X1+X3-X5-X7+X9+Xll-X13-X15+X17+XI9-X21 1 -X23)*S3 A4=(XO-X3+X6-X9+XI2-XI5+XI8-X21)+(XI-X2-X4+X5+X7-XB-Xl0+Xl1+X131 X14-X16+X17+XI9-X20-X22+X23)*.5 84=(Xl+X2-X4-X5+X7+X8-XlO-Xll+XI3+X14-XI6-X17+X19+X2Q-X22-X231*S4 A5=(XO-XI2)+(X5-X7-XI7+X191*Cl+I-X2+XI0+X14-X22)*C2+ 1 (-X3+X9+XI5-X211*C3+(X4-X8-XI6+X20)*.5+(XI-XII-X13+X23)*C5 85=(X6-XIBI+(X5+X7-XI7-XI91*SI+(X2+XIO-X14-X22)*.5+ 1 (-X3-X9+X15+X21)*S3+(-X4-X8+X16+X20)*S4+(Xl+X11-X13-X23)*S5 A6=IXO-x2+X4-X6+X8-XI0+X12-X14+X16-X18+X20-X22) 86=(XI-X3+X5-X7+X9-Xll+XI3-XI5+XI7-XI9+X21-X231 A7=(XO-X121+(-X5+X7+XI7-XI91*Cl+(-X2+XI0+XI4-X22)*C2+ 1 (X3-X9-X15+X211*C3+(X4-X8-X16+X20)*.5+(-Xl+X11+X13-X23I*C5 87=(-X6+XI8)+(X5+X7-X17-XI91*SI+(-X2-XIO+X14+X221*.5+ 1 (-X3-X9+XI5+X211*S3+(X4+X8-X16-X201*S4+(Xl+Xll-X13-X23)*S5 A8=(XO+X3+X6+X9+X12+XI5+XIB+X21)-IXl+X2+X4+X5+X7+X8+XI0+Xll+X13+ I x14+X16+X17+X19+X20+X22+X23)*.5 88=IXI-X2+X4-X5+X7-X8+XIO-Xll+X13-X14+X16-X17+X19-X20+X22-X23)*S4 A9=(XO-X4+X8-X12+XI6-X20)+(-Xl+X3+X5-X7-X9+Xl1+X13-X15-XI7+X19+ 1 X21-X231*C3 89=I-X2+X6-XIO+XI4-X18+X221+IX1+X3-X5-X7+X9+XII-X13-XI5+X17+X191 x21-X23)*S3 AIO=(XO-X6+X12-X18)+I-Xl+X5+X7-Xll-X13+X17+XI9-X23)*C2+ 1 IX2-X4-XB+XIO+X14-XI6-X20+X221*.5 810 =(X3-X9+X15-X21)+(X1+X5-X7-Xll+XI3+X17-X19-X231*.5+ 1 (-X2-X4+X8+XIO-X14-X16+X20+X22)*S4 A11=(XO-X12)+(-Xl+Xll+X13-X23)*Cl+(X2-XlO-X14+X221*C2+ 1 (-X3+X9+X15-X21)*C3+(X4-XB-X16+X20)*.5+(-X5+X7+XI7-XI9I*C5 811=I-X6+X181+(X1+XII-XI3-X231*Sl+(-X2-X10+XI4+X221*.5+ 1 (X3+X9-X15-X211*53+(-X4-X8+XI6+X201*54+(X5+X7-X17-X191*55 DO 30 1=1,13 AAIII=A(I) SS(II=8(l) RETURN END 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 009B 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 21 •••••••••••••••••••••••• FXDATA * * •••••••••••••••••••••••• PROGRAM LISTINGS 10/1/64 • FXDATA ISUBRDUTINEI * FAP *FXDATA COUNT 230 LBL FXDATA ENTRY FXDATA ILX,X,MXDATA,SCALEI ENTRY FLDATA ILX,X,SCALEI • • • • • * •* • • * • • • • • • • • • • - • • • • • • • • • • • • • • • • • • •• -•• • • • • • • • • • • • • * • • • • • • • • • •••••••••••••••••••••••• • FXDATA • •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0247 0001 0002 0003 0004 0005 0006 0007 ----ABSTRACT---0008 0009 TITLE - FXDATA WITH SECONDARY ENTRY FLDATA 0010 SCALE, CONVERT FLTG. VECTOR TO MACHINE INTEGERS OR CONVERSELY 0011 0012 FXDATA CONVERTS A FLOATING POINT VECTOR XIII I=l ••• LX 0013 TO A MACHINE LANGUAGE INTEGER VECTOR (WITH BINARY POINT 0014 TO RIGHT OF BIT 351 IXIII I=I ••• LX , SUCH THAT THE 0015 GREATEST MAGNITUDE OF IX = MXDATA IAN INPUT PARAMETER). 0016 ROUNDING RATHER THAN TRUNCATION OCCURS IN THE CONVERSION. 0017 THE OUTPUT INTEGERS ARE NECESSARILY LESS THAN 2EXPI7 001S IN MAGNITUDE SINCE MXDATA IS A FORTRAN INTEGER. 0019 0020 FLDATA PERFORMS THE INVERSE OF FXDATA. IT WILL HANDLE 0021 INTEGERS UP TO 2EXP35 - 1, HO~EVER. 0022 0023 0024 LANGUAGE - FAP SUBROUTINE IWITH FORTRAN II TYPE CALLING SEQUENCE) 0025 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLYI - 102 REGISTERS 0026 STORAGE FXOATA TAKES ABOUT 3S.LX MACHINE CYCLES 0027 SPEED FLDATA TAKES ABOUT 3S-LX MACHINE CYCLES 0028 - S.M. SIMPSON 0029 AUTHOR 0030 ----USAGE OF FXDATA---0031 0032 TRANSFER VECTOR CONTAINS ROUTINES NONE 0033 0034 AND FORTRAN SYSTEM ROUTINES NONE 0035 FORTRAN USAGE OF FXDATA 0036 CALL FXDATAILX,X,MXDATA,SCALEI 0037 0038 0039 INPUTS TO FXDATA 0040 LX IS LENGTH Of X SERIES 0041 IS A FORTRAN INTEGER WHICH MUST EXCEED ZERO 0042 0043 XI II I"I,2, ••• ,LX IS A FLOATING POINT VECTOR 0044 0045 MXDATA IS DESIRED MAXIMUM MAGNITUDE OF FIXED SERIES. 0046 0047 IS A FORTRAN INTEGER WHICH MUST EXCEED ZERO 0048 0049 OUTPUTS FROM FXDATA 0050 XIII I=I,2, •••• LX CONTAINS THE MACHINE LANGUAGE INTEGER 0051 VERSION OF THE INPUT SERIES, DEFINED BY 0052 XIII" XFIXFIXIII*SCALEI 0053 WHERE 0054 SCALE = FLOATFIMXDATAI/XMAX 0055 XMAX = GREATEST MAGNITUDE OF ORIGINAL XII) 0056 AND THE FUNCTION XFIXFIYI IS EQUIVALENT TO 0057 1. ROUND Y TO THE NEAREST FORTRAN INTEGER 005B 2. SHIFT Y RIGHT ARITHMETICALLY IS PLACES 0059 XIII IS LEFT=O.O IF XMAX IS FOUND = 0.0 0060 0061 0062 SCALE " FLOATFIMXDATAI/XMAX NORMALLY = -1.0 IF LX OR MXDATA IS ILLEGAL IXIII LEFT AS IS) 0063 0064 " -2.0 IF XMAX IS FOUND = 0.0 0065 0066 FORTRAN USAGE OF FLDATA 0067 CALL FLDATAILX,X,SCALEI 0068 0069 INPUTS TO FLDATA 0070 LX IS LENGTH OF X SERIES 0071 IS A FORTRAN INTEGER WHICH MUST EXCEED ZERO 0072 0073 Xli) I"I ••• LX IS A SERIES CONSIDERED TO BE 35-BIT INTEGERS 0074 .•••• *** •••••••••••••• . *** FXOATA *.*** ••••• * ••• ********** IPAGE 21 .. ... ...... .. ... .. .. . ... •••••••••••••••• **** •••• PROGRAM LISTINGS .. FXOATA .. • ••••• ****.**.*****.*.** IPAGE 21 PLUS SIGN IBINARY POINT TO RIGHT OF BIT 351 SCALE IS A FLOATING POINT SCALE FACTOR USED IN FLOATING XIII MUST EXCEED 0.0 OUTPUTS FROM FLDATA XI II I=l ••• LX IS THE FLOATED, SCALED FORM OF THE INPUT XIII, XIII = FLOATFIXII))/SCALE WHERE FLOATFI I IS AN OPERATION WHICH CONVERTS ANY 36-BIT CONFIGURATION ICONSIOEREO AS A 35-BIT PLUS SIGN INTEGER) To A FLOATING POINT NUMBER HOWEVER XIII IS LEFT UNDISTURBED IF EITHER 1. LX IS ZERO OR NEGATIVE OR 2. SCALE IS ZERO OR NEGATIVE EXAMPLES OF FXOATA • 1. INPUTS - LX=5 XIl ••• 5)= 230.,-400.,51 •• -170.,99.8 MXOATA=10 • OUTPUTS - Xll ••• 5) = OCT 000000000006,400000000012,000000000001, .. 400000000004,000000000002 SCALE = 0.0250 .... .. • .. 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT LX-3 MXOATA=100 OUTPUTS - Xll ••• 3) = OCT 000000000012,400000000144,000000000016 SCALE = 0.250 .. 3. INPUTS - SAME AS EXAMPLE 1. EXCEPT LX = 1 • OUTPUTS - XII) = OCT 000000000012 SCALE = 0.04341826 "• .. • 4. INPUTS - SAME AS EXAMPLE 1. EXCEPT Xll ••• 51= 0.,0., ••• OUTPUTS - XIl ••• 51= 0.,0.,... SCALE = -2.0 • 5. INPUTS - SAME AS EXAMPLE 1. EXCEPT MXDATA .. OUTPUTS - Xl1 ••• 51 = SAME AS INPUT SCALE •.. . .. -2 -1.0 6. INPUTS - SAME AS EXAMPLE 1. EXCEPT LX = 0 OUTPUTS - SAME AS EXAMPLE 5. • EXAMPLES OF FLOATA .. • ITHE FIRST 4 BELOW ARC THC INVERSES OF THE FIRST FOUR EXAMPLES OF FXDATAI .. 1. INPUTS - LX=5 XIl ••• 5) = OCT 000000000006,400000000012, .. 000000000001,400000000004,000000000002 SCALEs.025 .. OUTPUTS - XIl ••• 5) = 240.,-400.,40.,-160.,80. ... .. • . 2. INPUTS - LX:3 Xll ••• 3) = OCT 000000000012,400000000144, 000000000016 SCALE = 0.250 OUTPUTS - Xl1 ••• 31 = 232.,-400.,56. .. 3. INPUTS - LX:l XIII = OCT 000000000012 .. OUTPUTS - XII) : 230. . . SCALE .. 4. INPUTS - LX=5 Xll ••• 5) = OCT 000000000000, ••• .. OUTPUTS - Xll ••• 5) = 0.0, ••• • 5. INPUTS - LX: -3 Xl1 ••• 3) = 1.,2.,3. • OUTPUTS - Xll ••• 3) = 1.,2.,3. 0.04347826 SCALE -2.0 SCALE = 3.4 .. .. 6. INPUTS - LX=4 XIl ••• 4) = OCT 311171177777,001000000000, .. 112402762000,007346545000 SCALE = 1.0 • lIE X = 2EXP35-1,2EXP27,10EXP10,10EXP9) .. OUTPUTS - XIl ••• 4) = 34359738367.0,134217128.0,10000000000~0, • 1000000000.0 • HTR HTR 8CI FXDATA SXO SXO CLA ADO STA STA STA o o 1,FXOATA FXOATA-3,1 FXOATA-2,4 2,4 Kl Fl F4 F7 0075 0076 0077 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 •••••••••••••••••••••••• ... FXDATA " _.................... " 3) (PAGE PROGRAM LISTINGS .•••••••••••••••••••••••• . FXDATA •••••••••••••••••••••••• (PAGE .. GET N, CHECK IT, AND CHECK MXDATA. KFl ClS STO SCALE 1,4 SET N ClA" STO N IN IR1 F1A TIE F7A TMI ClA .. 3,4 TMI F7A F7A TIE N,l lXO TMAX STORE TRIAL MAX STZ F TMAX FIND ClA ·.,1 MAXIMUM Fl S8M TPl F3 OF All F2 Fl CAL" TMAX ABSOLUTE STO fiX F,l,l VALUES F3 " CHECK FOR CASE All XIII=O KF2 ClS STO SCALE TMAX ClA F7A TIE 3,4 flOAT MXDATA ClA" ARS 18 ORA ORF FAD ORF TMAX FOP XCA FIXED OATA=SCAlE"FlOAT(NG DATA SCALE SCAlE=MAX OF FIXED DATA/MAX OF FLOATING DATA STO N,1 SET TO SCALE N QUANTITIES lXD •• ,1 F4 lOQ SCALE SCALE FMP UFA ORF lRS AN ANA llS RQl 8 Rill 0 F7 STO ··,1 F4,1,1 fiX F7A SCALE ClA 4,4 STO" lXO FXDATA-3.1 TRA 5".4 TMAX PZE ORF OCT 233000000000 SCALE PZE AN OCT 000000377777 N PZE Kl PZE 1 K001 OCT 001000000000 266000000000 K266 OCT TEMP PZE TEMP2 PZE KFl DEC 1.0 KF2 DEC 2.0 FlOATA.N,OATA,SCAlE CAll FlDATA SXD FXDATA-3,1 SXD FXDATA-2,4 1,4 ClA" F14 TMI Fl4 TZE N STO ClA 2.4 K1 ADO STA FlO STA Fll 3,4 GET SCALE ClAF14 TMI Fl4 TIE STO SCALE N,l lXD ·.,1 flOAT FlO ClA " ....... . 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0112 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 3) ••••••••••••••••• ** ••••• FXOATA • ••••••••••••••••••••••••• (PAGE PROGRAM II STINGS (PAGE 41 LAS KOOl Q TRA Q TRA ORA ORF FAD ORF FOP SCALE STQ Fll ··.,1 FIOtl,I TlX FXDATA-3,I LXD Fl4 TRA 4,4 • HANDLE BIG NUMBERS Q LRS 27 STQ TEMP ORA K266 FAD ORF STO TEMP2 CLA TEMP ARS 8 ORA ORF FAD ORF FAD TEMP2 TRA Fll-l ENO ••••••••••••• * •••••••••• FXOATA • ••••••••••••••••••••••••• NUMBERS 0225 0226 0227 022B 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 4) •••••••••••••••••••••••• • GENHOL • ••••••••••••••••••••••• PROGRAM LISTINGS GENHOL • ••••••••••••••••••••••••• • ........................ • GENHOL I SUBROUTINE) • FAP ·GENHOL 140 COUNT LBL GENHOL ENTRY GENHOL IHOLI • • •• 3/15/65 LAST CARD IN DECK IS NO. 0144 0001 0002 0003 0004 0005 0006 ----ABSTRACT---- TITLE - GENHOL • GENERATE HOLLERITH FIELD • • • GENHOL GENERATES THE HOLLERITH FIELD THAT WOULD HAVE BEEN PRINTED BY AN IMMEDIATELY SUCCEEDING PRINT STATEMENT. • • LANGUAGE - FAP. SUBROUTINE (FORTRAN II CO~PATIBLE) • EQUIPMENT - 709. 7090 (MAIN FRAME ONLY) - loB REGISTERS • STORAGE • SPEED - R.A. WIGGINS. NOV •• 1962 • AUTHOR • • •• • • ---USAGE---TRANSFER VECTOR CONTAINS ROUTINES - NONE AND FORTRAN SYSTEM ROUTINES - IIOH) • FORTRAN USAGE • CALL GENHOL(HOL) • PRINT FMT, LIST • • • • • • • • • • • • • • • • • • • • • INPUTS LIST IS A LIST OF VARIABLES FOR TRANSMISSION AS DEFINED IN THE FORTRAN REFERENCE MANUAL. FMT IS A STANDARD FORMAT ENTRY TELLING HOW THE LIST IS TO BE TRANSMITTED INTO HOLLERITH. THE FORMAT MAY IMPLY AN ARBITRARY NUMBER OF LINES OF PRINTED OUTPUT. BUT NONE OF THESE LINES MAY EXCEED 132 CHARACTERS. OUTPUTS HOL( II LET NLINES NCIJ) NRIJ) • • • • • • • • • • • • • •• • • • • •• z OF LINES IMPLIED BY THE FORMAT NO. OF CHARACTERS IINCLUDING SPACES) IMPLIED BY THE FORMAT FOR THE J-TH LINE NO. OF REGISTERS OF HOLII) WHICH WILL BE OCCUPIED BY THE CHARACTERS FOR THE J-TH LINE NRIJ) = MAXIMUMI3. INCIJ)+5)/6 ) SUMIJ-l ••• NLINES) OF NRIJ) N HOLl1 ••• NR(1)) HAS CHARACTERS FOR LINE 1 16 PER REGISTER, LEFT ADJUSTED) HOLINR(1)+1, •••• NRI1)+NRI21) FOR LINE 2 ETC. ALL SPARE CHARACTER POSITIONS IN HOLII). IF ANY, WILL BE FILLED WITH BLANKS (OCTAL 60) EXAMPLES 1. EXAMPLE OF GENERATION OF HOLLERITH CHARACTERS WITH NO LIST. INPUTS - FMTl1 ••• 71 s 6HI34H HOLLERITH CHARACTERS WITH NO LIST) CALL GENHOL IHOL) USAGE PRINT FMT OUTPUTS - HOLI1 ••• 61 = 6H HOLLERITH CHARACTERS WITH NO LIST 2. EXAMPLE OF INSERTION OF A NUMBER FROM A LIST. INPUTS • USAGE • = NO. z THEN • • l=l ••• N IS THE HOLLERITH EQUIVALENT TO THE LINEIS) WHICH WOULD NORMALLY BE PRINTED BY THE PRINT STATEMENT. ACTUAL PRINTING DOES NOT OCCUR. = - FMT(1 ••• 6) 6HI25H BOMB SEISMIC RECORD NO. 14) LISTIl) ,., 42 CALL GENHOL IHOL) PRINT FMT. LIST(1) 0007 OOOB 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 ............-........... • GENHOl ..-..................... PROGRAM LISTINGS • • IPAGE 2) . • OUTPUTS - HOLl1 ••• 5) GENHOl IPAGE = 6H BOMB SEISMIC RECORD NO. 42 • 3. EXAMPLE OF GENERATION OF A VARIABLE FORMAT STATEMENT. .. INPUTS - FMTC1 ••• 5) = 6HIIHCI3,3HI7,13,10HX,2H 1214)) • llSTll) a 5 lIST(2) = 35 • USAGE CAll GENHOl IHOll • PRINT FMT, lIST'll, LISTC21 • OUTPUTS HOLCl ••• 4) = 6HI 517, 35X,2H 1214) • * 4. EXAMPLE OF REPEATED LINES. NOTE THAT THE MINIMUM lINE lENGTH IS 18 CHARACTERS. INPUTS - FMTll ••• 151= 6HC24H1 •••• 6 •••• 12 •••• 18 •••• 24/18H1 •••• 6 •••• 12 •••• 18/12Hl •••• 6 •••• 12/6Hl •••• 6/1HlI11Hl * • • .. I * USAGE CAll GENHOL IHOl) PRINT FMT OUTPUTS - HOLl1 ••• 221= 6Hl •••• 6 •••• 12 •••• 18 •••• 241 •••• 6 •••• 12 .. * •. •••• 181 •••• 6 •••• 12 1 1 •••• 6 1 •* HTR BCI GENHOl SXD CAL ADD STA SXA CAL ANA HE CAL STA TRA NOERR CAL STA TRA SSH PZE • * GHO N HOLl HOl A OUT 0 1,GENHOL *-2,4 GET 1,4 POSITION =lB35 OF HOL. HOL N,O RESET N COUNTER. CHECK FOR STANDARD ERROR PROCEDURE. 2.4 =0770377000000 NOERR NOT ZERO. STANDARD ERROR PRESENT. SSH 4,4 2,4 SSH ZERO, NO STANOARD ERROR PROCEDURE. 2,4 2,4 STORAGE TO STORAGE HOLLERITH CSSHI GHO - GENERATE HOLLERITH. .+4 .+2 CLA TRA. $( IOH) MZE ,,3 TRA GHO REENTRY FROM CIOH). SXA SAVE OUT,4 SXA OUT+l,2 INDEX SXA OUT+2,1 REGI STERS. CAL 1,4 GET ADDRESS ARS 18 ADD 1,4 STA HOLl OF RECORD BEGINNING, ,2 AND SAVE POX A,2 SXD N+1,2 SXD LENGTH OF RECORD. AXT SET • .. ,1 .. +1,1, .... INDEX COUNT TXI N,l FOR HOl. SXA 1,2 AXT CLA *·,2 STO .",1 ,,+1,1,1 TIX ,,+1,2,1 TXI HOLl,2, •• TXL •• ,4 AXT AXT .. ·,2 •• ,1 AXT 2,4 TRA END * I SSHI LDQ • • ••••••••••••••••••••••• •••••••••••••••••••••••• 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 2) •••••••••••••••••••••••• * GETHOL • •••••••••••••••••••••••• PROGRAM LI STINGS ••••••• *** •••••••••••••• GETHOL • * • ••••••••••••••••••••••• • GETHOL (SUBROUTINE) 9/29/64 LAST CARD IN DECK IS NO. 0175 • LABEL 0001 CGETHOL 0002 SUBROUTINE GETHOLIJOB,HARG,HOL,NCRS,IXCOM,ICOUNT) 0003 C 0004 C ----ABSTRACT---0005 C 0006 C TITlE - GETHOL 0007 C GET HOLLERITH DATA FROM CALLING SEQUENCE 0008 C 0009 C GETHOL ASSUMES ONE OF ITS ARGUMENTS IS HOLLERITH DATA 0010 GENERATED IN THE CALLING SEQUENCE ISTORED FAP-WISE AND C 0011 C TERMINATED BY AN ALL-ONES FENCE). THEN, AT THE OPTION 0012 OF THE USER, IT fITHER C 0013 C 1. MOVES THE HOLLERITH TO AN OUTPUT ARGUMENT 0014 C REVERSING THE STORAGE ORDER 0015 OR C 0016 C 2. REVERSES THE STORAGE ORDER OF THE HOLLERITH 0017 C AT ITS PRESENT LOCATION (THE FENCE IS ALSO MODIFIED 0018 C AS A FLAG SO THAT GETHOL WILL NOT RE-REVERSE THE 0019 C DATA ON SUBSEQUENT CALLS FOR EITHER OPTION) 0020 C IN EITHER CASE THE FENCE IS NOT PART OF THE NEW HOLLERITH 0021 C VECTOR AND GETHOL RETURNS AS OUTPUTS THE NO. OF CHARACTERS 0022 C IN THE NEW VECTOR (SIX TIMES VECTOR LENGTH) AND THE 0023 C INOEX OF THIS VECTOR WITH RESPECT TO THE FORTRAN 0024 C COMMON BLOCK. 0025 C 0026 C FOR OPTION 2. IT ALSO ADOS ONE TO AN OUTPUT COUNTER. 0027 C 002B C LANGUAGE - FORTRAN II SUBROUTINE 0029 C EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0030 C STORAGE - 169 REGISTERS 0031 C SPEED 0032 C AUTHOR - S.M. SIMPSON. MARCH 1963 0033 C 0034 C ----USAGE---0035 C 0036 C TRANSFER VECTOR CONTAINS ROUTINES - REVERS 0037 C AND FORTRAN SYSTEM ROUTINES - XLOC 0038 C 0039 C FORTRAN USAGE 0040 C CALL GETHOLIJOB.HARG.HOL.NCRS.IXCOM.ICOUNT) 0041 C 0042 C INPUTS 0043 C 0044 JOB = 0 SPECIFIES THAT USER WANTS OPTION 1. ISEE ABSTRACT) C 0045 NOT: 0 SPECIFIES THAT USER WANTS OPTION 2. ISEE ABSTRACT) C 0046 C 0047 HARGI I) C I:1.0.-1 ••••• -LHOL.2 CONTAINS THE LHOL WORDS OF 0048 HOLLERITH OAT A TO BE ACQUIRED C 0049 C I=-LHOL+l IS THE FENCE OCT 777177177177 (FIRST CALL) 0050 NOTESC 0051 C IF GETHOL HAS BEEN CALLED BY THE SAME CALL 0052 STATEMENT PREVIOUSLY WITH JOB NOT= O. THE C 0053 FENCE WILL HAVE BEEN CHANGED TO = OCT 717777777776 0054 C C 0055 C GETHOL CONSIDERS IT AN ERROR IF ONE OF THESE TWO 0056 TYPES OF FENCES DOES NOT OCCUR WITHIN 106 CELLS 0057 C OF HARGill 1635 IS THE MAX NO. CHARACTERS C 0058 EXPRESSIBLE ON 9 CONTINUATION CARDS IN A 0059 C CALL GETHUl STATEMENT). C 0060 C 0061 C OUTPUTS 0062 C 0063 HARG(II 1=1.0 •••• -LHDl.1 IS UNCHANGED IF JOB=O, OR IF 0064 C FENCE = OCT 177777777776 0065 C FOR JOB NOT: 0 AND FENCE : OCT 711111711117 0066 C HARG(1.D ••••• -LHOL.2) IS REVERSED 0067 C HARG(-LHOL.l) : FENCE IS SET: OCT 777777777776 0068 C 0069 C 0070 l=l ••• LHOL IS UNDISTURBED FOR JOB NOT: a C HOLI II FOR JOil : 0 C 0071 HARG(2-I) IF FENCE: OCT 777777777771 HOLII) 0072 C HOLII) : HARG(-LHOl.I.l) IF FENCE=OCT 777777777776 0073 C 0074 C •••••••••••••••••••••••• • GETHOL PROGRAM LISTINGS • •••••••••••••••••••••••• CPAGE 21 C C C •••••••••••••••••••••••• GETHOL ••••••••••••••••••••••••* * I PAGE NCRS IS THE NO. CHARACTERS Of HOLLERITH DATA a 6*LHOL IS SET = -1 If LHOL EXCEEDS 106 INO OTHER OUTPUT IN THIS CASEI IXCOM IS THE INDEX WITH RESPECT TO COMMON Of THE NEW HOLLERITH VECTOR, I.E. THE INDEX Of HOL(l) OR Of HARGI-LHOL+21 WHICHEVER IS APPROPRIATE. C C C C C ICOUNT C C C C EXAMPLES C C C C C C C C C IS NOT US EO fOR OPTION 1. IS INCREASED IN VALUE 8Y 1 fOR OPTION 2. 1. USAGE WI TH J08=O, IGNORING THE IXCOM OUTPUT USAGE OIMENSION HOLII0) CALL GETHOL[0,18HfIRST,SECONO,THIRD,HOL,NCRS,IXCDM, 1 ICOUNT) OUTPUTS - HOLIlI= 6HfIRST, HOL(2): 6HSECONO HOL(3)= 6H,THIRD NCRS=18 ICOUNT IS UNDISTUR8ED 2. SIMILAR TO 1. BUT USING THE IXCOM OUTPUT fEATURE USAGE DIMENSION CM(2), HOl(10) COMMON CM CALL GETHOLIO,12HfIRST,SECONO,HOL.NCRS,IXCOM, 1 ICOUNTI OUTPUTS - HOLIll = CM(IXCOM) 6HfIRST, C HOL(2) = CMIIXCOM+11 s 6HSECOND NCRS=12 C C C C C C C C 3. USAGE WITH JOB NOT: 0 C INPUTS - SET ICOUNT=O C USAGE CALL GETHOLl1,BHI5X,3I5I,DUMMY,NCRS,IXCO".ICOUNT) C CUTPUTS - NCRS-12 CM11XCOMI = 6H(5X,3I CMIIXCOM+11 = 2H5t C CMIIXCOM-11 = OCT777777777776 ITHE NEW fENCE) ICOUNT=l C C C 4. REPEATED USE Of SAME CALL STATEMENT WITH J08 NOT- 0 USAGE DIMENSION CMI21,SPACEI2,4),HOLI2,4I,J0814),NCRS(4) C C COMMON CM JOIH 1) 0 C C JOB(2) 1 C J08(3) = 0 JOB[41 = 1 C ICOUNT=O C C DO 10 1=1,4 C CALL GETHOLIJ081I),7H1234567.HOLl1,Il,NCRSCII, 1 IXCOM,ICOUNTI C C SPACE(l,l) CMIIXCOM) 10 SPACEI2,1) = CMIIXCOM+11 C OUTPUTS - HOLl1.11=HOLl1,31=SPACEl1,II = 6H123456 fOR 1=1,2,3,4 C C HOLI2,1)=HOLI2,31=SPACEI2,1) = 1H7 fOR 1=1,2,3.4 C NCRSII) =12 fOR 1=1,2,3,4 ICOUNT=2 C C 5. ILLEGAL HOLLERITH OATA C INPUTS - SPACEIl ••• 150) 6H2 LONG C USAGE CALL GETHOLIJ08,SPACE(150),HOL,NCRS,IXCOM,ICOUNT) C OUTPUTS - NCRS = -1 C C PROGRAM fOLLOWS 8ELOW C FALSE DIMENSIONS = = DIMENSION ICM(2),CMI2),HOLI2) COMMON ICM EQUIVALENCE ICM,ICM),lfNCEl,lfNCE11,IFNCE2,IFNCE2) 8 fNCE1=777777771777 FNCE2=177777777776 8 LOCCOM=XLOCfICM) C SEARCH FOR fENCE, SETTING SWITCH fOR TYPE fOUND IF ANY IXARG=LOCCOM-XLOCfIHARG)+l DO 50 1=1.106 IXNXT=IXARG-I NEXT=ICMI I XNXTI IfSWCH=O IfINEXT-IFNCE11 40,70,40 40 IFSWCH=l IFINEXT-IFNCE21 50,70,50 0075 0076 0017 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 OllO 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 21 •••••••• ** •••••••••••••• • GETHOL • •••••••••••••••••••••••• (PAGE 3) PROGRAM LISTINGS ••••••••••••••••••••• * •• GETHOL • * •••••••••••••••••••••••• 50 CONTINUE C ILLEGAL IF FALLS THRU 50 NCRS=-l GO TO 9999 C OK IF JUMPS HERE. fORK ON JOB 70 lHl=1 IF{JOBI 100,80,100 C FOR JOB=O MOVE DATA, SET IXCOM, THEN GO CHECK REVERSAL 80 DO 85 I=l,LHl IXNXT = IXARG-lHL+I 85 HOlII'=CMIIXNXTI IXCM=LOCCOM-XLDCFIHOLI+l GO TO 110 C FOR JOB NOT=O SET IXCOM, NEW FENCE, INDEX ICOUNT, THEN CHECK REVERSAL 100 IXCM=IXARG-lHL+l CMIIXCM-1)=FNCE2 ICOUNT=ICOUNT+l C CHECK REVERSAL. IF NOT GO EXIT 110 IFIIFSWCHI 9990,120,9990 C REVERSE 120 CALL REVERSILHL.CMIIXCMI I C EXIT SEQUENCE 9990 NCRS=6*LHl IXCOM=IXCM 9999 RETURN END (PAGE 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 3) •••••••••••••••••••••••• GETRDI • ••••••••••••••••••••••••• PROGRAM 1I STINGS • GETRDI ISUBROUTINE) 10/1/64 • LABEL CGETRDI SUBROUTINE GETRDIIITAPE,NX,IX,IANS) 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 C C C C C C C C C .-........................ • GETRDI LAST CARD IN DECK IS NO. 0172 0001 0002 00D3 0004 ----ABSTRACT---0005 0006 TITLE - GETRDI 0007 ACCESS ROUTINE FOR RAND CORP. MILLION RANDOM OIGITS FROM TAPE 0008 0009 GETRDI FURNISHES THE NEXT NX SEQUENTIAL RANDOM DIGITS 0010 AS FIXED POINT INTEGERS FROM A SPECIFIED TAPE UNIT. 0011 0012 THE TAPE UNIT CONTAINS THE MILLION DIGITS IN BCD FORM 0013 AS LOADED OFF-LINE FROM THE 200eo CAROS CONTAINING THEM, 0014 EACH CARD WITH FORMAT(5011). GETROI KEEPS A BUFFER OF 0015 LENGTH 50 TO PREVENT MISSING ANY DIGITS, BUT DOES NOT 0016 CHECK FOR THE POSSIBILITY THAT THE SUPPLY IS EXHAUSTED. 0017 0018 LANGUAGE - FORTRAN II SUBROUTINE 0019 EQUIPMENT - 709 OR 7090 (MAIN FRAME PLUS 1 TAPE UNIT) 0020 STORAGE - 229 REGISTERS 002i SPEED - SLOW, SINCE TAPE IS BCD 0022 AUTHOR - S.M.SIMPSON JR. 0023 0024 ----USAGE---0025 0026 TRANSVER VECTOR CONTAINS ROUTINES - INONE) 0027 AND FORTRAN SYSTEM ROUTINES - (TSH), IRTN) 0028 0029 FORTRAN USAGE 0030 CALL GETRDIIITAPE,NX,IX.IANS) 0031 0032 INPUTS 0033 0034 I TAPE IS THE LOGICAL TAPE NO. OF THE RANDOM DIGlrS TAPE 0035 MUST LIE BETWEEN 1 AND 20 INCLUSIVE 0036 0037 NX IS TH£ DESIREO NO. OF DIGITS 0038 MUST EXCEED ZERO 0039 0040 OUTPUTS 0041 0042 I XII) 0043 I=I ••• NX WILL CONTAIN THE NEXT NX DIGITS AS FORTRAN FIXED POINT INTEGERS 0044 0045 IANS 0046 o NORMAL 0047 -1 FOR ILLEGAL ITAPE -2 FOR IllEGAL NX 0048 0049 EXAMPLES 0050 0051 1. ILLUSTRATING EFFECTS OF SUCCESSIVE CALLS 0052 INPUTS - THE FIRST THREE RAND DIGITS CARDS ARE AS FOLLOWS 0053 0054 COLUMN NUMBERS C 0055 A 0056 R 0057 00000000011111111112222222222333333333344444444445 12345678901234567890123456789012345678901234567890 D 0058 0059 1 10097325337652013586346735487680959091173929274945 0060 2 37542048056489474296248052403720636104020082291665 0061 0062 3 08422689531964509303232090256015953347643508033606 ASSUME THE CARDS ARE LOADED ON LOGICAL TAPE 9 0063 0064 USAGE REWIND 9 0065 CALL GETROI19,10,IXl,IANS1) 0066 CALL GETRDI19,10,IX2,IANS2) 0067 CALL GETRD119, l,IX3,IANS3) 0068 CALL GETRDl(9,29,IX4,IANS4) 0069 CALL GETRDl19, l,IX5,IANS5) 0070 CALL GETRDI19,55,IX6,IANS6) 0071 0072 REWINO 9 0073 CALL GETRDl19, 3,IX7,IANS71 0074 = • • ••••••••••••••••••••••• •••••••••••••••••••••••• • PROGRAM LISTINGS • GETROI •••••••••••••••••••••••• (PAGE (PAGE 2) C OUTPUTS - C C C C C C IANS1=IANS2 IXl(l ••• 10) IX21l ••• 101 IX31l ••• 11 IX4(1 ••• 29) = 1X511 .... 11 IX61l ••• 55) C C C IX71l ••• 3) C •••••••••••••••••••••••• GETROI • • ••••••••••••••••••••••• • C C C e ° ETC" IANS1 " (NO ILLEGALITIES) 1,0,0,9,1,3,2,5,3,3 1,6.5,2,0,1,3,5,8,6 3 4,6,7,3,5,4,8,7,6,8,0,9,5,9,0,9,1,1,7,3, 9,2,9,2,7,4,9.4.5 3 7,5,4,2,0,4,8.0.5.6,4,8,9,4,1,4,2,9,6,2, 4.8,0,5,2,4,0,3,7,2,0,6,3,6,1,0,4,0.2,0, 0,8,2,2,9,1,6,6,5,0,8,4,2,2.6 8,9,5 INOT = 1,0,0 SINCE GETROl STlLL HAS 44 DIGITS IN ITS BUFFER TO USE UP BEFORE READING FROM TAPE AGAIN) C 2. ILLUSTRATING ILLEGAL USAGE C C C C CALL GETROllO,l,IX,IANSll CALL GETRDlI21,I,IX,IANS2) CALL GETRDlI9,-3,IX,IANS3) USAGE C OUTPUTS - IANS1 = IANS2 = -1 C IANS3 = -2 C C C PROGRAM FOLLOWS BELOW IlllEGAL !TAPE) I ILLEGAL NX) e C DUMMY DIMENSION STATEMENT DIMENSION IX(2) C TRUE DIMENSION STATEMENT DIMENSION INP(50) C CHECK LEGALITIES OF ITAPE,NX IANS=-l IF (ITAPE) 9999,9999,2 2 IF (ITAPE-20) 4,4,9999 4 IANS=-2 IF (NX) 9999.9999,10 10 IOUT=O IANS=O MORE=NX C C ANY DIGITS LEFT IN BUFFER FROM PREVIOUS CALL (IF NO, GO READ C 50 DIGITS). C IF (NBUF) 20,40,20 C C IF YES, CHECK IF REQUEST CAN BE FILLED FROM BUFFER. e e 20 IF (NX-NBUF) C IT CANT. e 30,30,24 EMPTY BUFFER AND THEN GO READ MORE DIGITS. 24 DO 26 I=l.NBUF 26IXII)=INPII) 10UT=NBUF MORE=MORE-NBUF GO TO 40 C C IT CAN BE FILLED FROM BUFFER. e SET UP TO DO SO AND EXIT. 30 NBLOK=NBUF GO TO 66 C C READ 50 DIGITS C 40 READ INPUT TAPE ITAPE,42,IINP(II,I=1,50) 42 FORMAT(50111 C C CHECK IF THIS IS LAST BLOCK OF 50 NEEDED. e IF (MORE-501 60,60,50 C C NO. MOVE BLOCK OF 50 AND GO BACK FOR ANOTHER. C 50 DO 54 1=1,50 II = I + lOUT 0075 0076 0077 0078 0079 0080 OOB1 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 010B 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 2) •••••••••••••••••••••••• • • GETR01 •••••••••••••••••••••••• (PAGE PROGRAM LISTINGS 31 54 IXtll)=INP(11 IOUT=IOUI+50 MORE=MORE-50 GO TO 40 C C YES. SET FOR FINAL MOVE. C 60 N8LOK=50 C C Hove FINAL 8LOCK AND SET UP BUFFER FOR NEXT CALL C 66 00 68 l=l,MORE II=I+IOUT 68 IXIII'=INPtl) N8UFaN8LOK-MORE IF IN8UFI 70.9999.70 70 MRP1=MORE+1 00 74 I=MRP1,NBLOK H=I-MORE 74 INPIIII=INPtI) GO TO 9999 9999 RETURN ENO •••••••••••••••••••••••• GETRD1 • •••••••••••••••••••••••• • (PAGE 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 3) •••••••••••••••••••••••• GETX •••••••••••••••••••••••• . • •.. PROGRAM LISTINGS ••••••••••••••••••••••••. GETX •• ••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0121 0001 0002 ·GETX 0003 COUNT 100 0004 LBL GETX 0005 ENTRY GETX (X.ll.12 ••••• IN) 0006 ENTRY IGETX IIX.Il.12 ••••• INI 0001 • 0008 • ----ABSTRACT---0009 • 0010 • 0011 GETX WITH SECONDARY ENTRY POINT IGETX • TITlE - ALLOWS 0012 VARIABLE DEPTH INDEXING OF VECTORS • 0013 0014 GETX IS A VARIABLE LENGTH CALLING SEQUENCE PROGRAM THAT 0015 GETS A NUMBER BY MEANS OF A CHAIN OF INDEX VALUES. 0016 THUS. THE STATEMENT 0011 0018 Xl = GET X (X.Il.I21 0019 • IS EQUIVALENT TO THE FORTRAN STATEMENTS 0020 0021 Jl ,. IH 121 0022 0023 Xl = XIJlI 0024 IGETX PERFORMS THE SAME FUNCTION AS GETX. 0025 • 0026 0021 .. LANGUAGE - FAP IFORTRAN II FUNCTIONI 0028 • EQUIPMENT - 109 OR 7090 (HAIN FRAME AND SENSE INDICATORS ONLY) 0029 .. STORAGE - 31 REGISTERS - 11+N)*19 MACHINE CYCLES WHERE N=NUMBER OF ARGUMENTS 0030 • SPEED 0031 .. AUTHOR - R.A. WIGGINS. OCTOBER. 1963 0032 • 0033 0034 ----USAGE---0035 0036 .. TRANSFER VECTOR CONTAINS ROUTINES - INOT ANY) 0031 .. AND FORTRAN SYSTEM ROUTINES - INOT ANY) 0038 0039 • 0040 0041 .. FORTRAN USAGE OF GETX 0042 .. Xl = GETX IX.ll.I2 ••••• IN) 0043 0044 • INPUTS 0045 0046 XII) l=l ••••• LX IS A VECTOR OF VALUES. LX SHOULD BE GREATER 0041 THAN ANY OF THE INDICES IN THE INDEX VECTOR 11. 0048 • I l ( I) 0049 l=l ••••• Lll IS A VECTOR OF INDICES. LII SHOULD BE 0050 GREATER THAN ANY OF THE INDICES IN THE VECTOR 12. • 0051 0052 IS SIMILAR TO 11. 12111 • 0053 • 0054 • 0055 • 0056 • 0051 • 0058 IS AN INDEX VALUE. IN • 0059 0060 • OUTPUTS 0061 • 0062 IS NUMBER AS DESCRIBED IN THE ABSTRACT. Xl 0063 0064 0065 0066 .. FORTRAN USAGE OF IGETX 0061 .. IXI = IGETX IIX.Il.I2 ••••• IN) 0068 0069 .. INPUTS ANO OUTPUTS ARE ANALOGOUS TO GETX BUT FIXED POINT. 0070 0071 0072 0073 .. EXAMPLES 0014 .... ... . .... ... . ...... . . .. ... . . . . ...... . . .. . . GETX (FORTRAN FUNCTION) FAP 9/4/64 •••••••••• * ••••••••••••• PROGRAM LISTINGS GETX * * •••••••••••••••••••••••• (PAGE ••••••••••••••••• ** ••••• GET X * * * ••••••••••••••••• *** ••• 2) * 1. INPUTS * USAGE * * OUTPUTS * * • 2. INPUTS * * USAGE * * OUTPUTS * * (PAGE - XIl ••• 5) 1 • .,2.,3.,4.,5. 11=4 XI GETX (X, III I Xl= I GETX IIX,Il) - XI=4. IXl=4 - - IXll ••• 5) : SAME AS EXAMPLE 1. EXCEPT IlIl ••• 7) = 4,1,1,3,5,2,1 1211 ••• 3) = 1,7,5 13 = 3 Xl = GETX IX,Il,l2,I3) IXl= IGETX (IX, 11,12, I31 Xl:5. IXI=5 • • * PROGRAM FOLLOWS • XR4 HTR 0 BELOW XRl HTR 0 1,GETX BCI GETX BSS 0 XR4,4 IGETX SXO SXD XRl,l IND STI SXD GETE,4 • FIND LAST ARGUMENT FIAT LOI 1,4 RIS MASKI OFT CTSXI SWCH TXI OUT,4,1 TIX FIAT,4,1 • GET NUMBER AXT 0,1 OUT SXO XR41,4 CLA 1,4 GET STA ·+1 CLA .*,1 PDX ,1 TIX *+2,1 ,1 AXT 0,1 .+1,4,1 TXI GETE TXL GET,4,.* * LEAVE INO LOI XRI,I LXD LXD XR41,4 TRA 2,4 IND PlE MASKI OCT 000000077777 CTSXZ OCT 770377700000 MASK2 OCT 000000 177777 XR41 PIE END . . CONTAINS IN IT IAL XR4 1,2.3,~,5 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 2) •••••••••••••••••••••••• GNflTl *••••••••••••••••••••••• ** PROGRAM LISTINGS • GNFlTl ISUBROUTINEI 9/29/64 • LABEL CGNFLTl SUBROUTINE GNFLT1IAMSPEC,LSPEC,FLTR,IANSJ 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 C C C C C C C C C •••••••••••••••••••••••• • GNFLTI • •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0163 0001 0002 0003 0004 ----ABSTRACT---0005 0006 TITLE - GNHTl 0007 GENERATE SYMMETRICAL FILTER WITH GIVEN AMPLITUDE RESPONSE OOOB 0009 GNFLT1 GENERATES A SYMMETRICAL ITWO-SIDED) SET OF FILTER 0010 COEFFICIENTS WHOSE AMPLITUDE SPECTRUM APPROXIMATES A 0011 GIVEN AMPLITUDE SPECTRUM AT EQUALLY SPACED POINTS BETWEEN 0012 ZERO AND PI IRADIANS). IF THE DESIRED AMPLITUDE SPECTRUM 0013 IS AMPIII 1=0,1, ••• ,1'1 • THEN THE FILTER COEFFICIENTS, 0014 FILTERII) 1=-1'1,-1'1+1, ••• ,1'1 , ARE GENERATED BY A WEIGHTED 0015 ADDITION OF A SMOOTHED ORTHONORMAL SET OF OPERATORS 0016 ACCORDING TO 0017 1'1 0018 FILTERISI = SUM I AMPIPI-ORTNRMIS,P,M) 1 0019 P=O 0020 FOR S = -1'1, ••• ,1'1 0021 WHERE 0022 ORTNRMIS,P,M) NRMIP,M)*ORTIS,P,MI 0023 NRMIP,M) 11M FOR P = 1,2, ••• ,1'1-1 0024 NRMIP,MI 112M FOR P = 0 AND P = 1'1 0025 AND 0026 ORT( S, P, 1'1) CIS)*11.54+.46*COSIS*PI/MII*COSIS*P*PI/MII 0027 CIS) 0.5 FOR S = 1'1 AND S = -1'1 0028 1.0 OTHERWIS E CISI 0029 PI 0030 3.14159265 0031 THE ORTIS,P,M) SET IS A SCALED VERSION OF THE ORTHONORMAL 0032 SET GIVEN BY TUKEY AND HAMMING 11949, MEASURING NOISE 0033 COLOR, BELL TEL. LAB. MEMO - 1'11'1-49-110-119.1 0034 0035 LANGUAGE - FORTRAN II SUBROUTINE 0036 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0037 STORAGE - 232 REGISTERS 0038 SPEED 0039 AUTHOR - S.M. SIMPSON JR. 0040 0041 ----USAGE---0042 0043 TRANSFER VECTOR CONTAINS ROUTINES - INONE) 0044 AND FORTRAN SYSTEM ROUTINES ~ COS 0045 0046 FORTRAN USAGE 0047 CALL GNFLTIIAMSPEC,LSPEC,FLTR,IANS) 004B 0049 INPUTS 0050 0051 AMSPEC (I I I=l, ••• ,LSPEC CONTAINS THE DESIRED AMPLITUDE RESPDNSE 0052 AMPIJI J=O,I, ••• ,M I M=LSPEC-l 1 , I.E. 0053 AMSPECIII = AMPII-l) = RESPONSE AT II-ll*PI/M RADIANS 0054 AMSPECIII MUST NOT VANISH FOR ALL I VALUES 0055 0056 LSPEC MUST EXCEED 2 AND BE LESS THAN OR = 1001 0057 0058 OUTPUTS 0059 0060 fL TR( IJ 1=1,2, ••• ,12*1'1+11 ARE THE DESIRED FILTER COEFFICIENTS, 0061 FILTERIJI J= -1'1,-1'1+1, ••• ,1'1 , AS DEFINED IN ABSTRACT, 0062 I.E. HTRIII= FILTERII-M-ll 0063 0064 IANS o NORMALLY 0065 -1 FOR ILLEGAL AMSPEC IALL ZERO) 0066 -2 FOR ILLEGAL LSPEC 0067 0068 EXAMPLES 0069 0070 1. A NARROW LOW-PASS AND NARROW BAND-PASS FILTER 0071 INPUTS - Alll ••• 21) = 1.,0.,0 ••••• ,0., Ll 0072 21 A211 ••• 2l) = 0.,0.,1.,0 ••••• 0. L2 0073 21 USAGE CALL GNFLTIIAI,Ll,FLTRl,IANSIJ 0074 •••••••••••••••••••••••• GNFLT1 • •••••••••••••••••••••••• PROGRAM LISTINGS • IPAGE 2) C C C C C C C C C C C C C C C C C C C •••••••••••••••••••••••• GNFLTl • •••••••••••••••••••••••• • IPAGE CALL GNFLT1IA2.L2.FLTR2.IANS2) OUTPUTS - IANS1 = IANS2 =0 FLTR1I1 ••• 411 = .00100 .00214 .00257 .00326 .00420 .00537 .00674 .00828 .00995 .01170 .01350 .01530 .01706 .01872 .02026 .02163 .02281 .02375 .02444 .02486 .02500 .02486 .02444 .02375 .02281 .02163 .02026 .01872 .01706 .01530 .01350 .01170 .00995 .00828 .00674 .00537 .00420 .00326 .00257 .00214 FLTR21l ••• 411 = .00200 .00408 .00415 .00383 .00260 .00000 -.00417 -.00974 -.01610 -.02226 -.02700 -.02910 -.02760 -.02201 -.01252 .00000 .01410 .02792 .03954 .04729 .05000 .04729 .03954 .02792 .01410 .00000 -.01252 -.02201 -.02760 -.02910 -.02700 -.02226 -.01610 -.00974 -.00417 .00000 .00260 .00383 .00415 .00408 .00100 .00200 C C 2. TEST CASE FOR WHITE LIGHT FILTER IFILTER SHOULD 6E AN IMRULSE) INPUTS - AI1 ••• 11) = 1 •• 1 •••••• 1. L = 11 C USAGE CALL GNFLTIIA.L.FLTR.IANS) C OUTPUTS - FLTRll ••• 21) = 0 •• 0 •• 0 •• 0 •• 0.,0.,0 •• 0.,0.,0.,1 •• 0 •••••• 0. C C C 3. ILLEGAL CONDITIONS C 611 ••• 5) INPUTS - All ••• 5) ,0.,0.,0.,0 •• 0. C USAGE CALL GNFLT1IA.5.FLTR.IANSll CALL GNFLTI16.2,FLTR.IANS21 C CALL GNFLTlI6,1005.FLTR,IANS3) C OUTPUTS IANS = -1 IILLEGAL AMSPEC, ALL ZERO) C C IANS2 = IANS3 -2 IILLEGAL LSPECI C = C OIMENSION AMSPECII00).FLTRI2001) C CHECK LSPEC,AMSPEC IANS=-2 IFILSPEC-3) 9999.10.10 10 IFILSPEC-I001) 20.20,9999 20 IANS=-l DO 30 I=l,LSPEC IFIAMSPECII» 50.30,50 30 COIliTINUE C ILLEGAL AMSPEC IF FALLS THRU 30 GO TO 9999 C INPUTS OK, INITIALIZE LOOP WHICH FORMS FILTER 10,1, ••• MI C IN FLTRIM+1 ••••• LSPEC) 50 IANS=O .M=LSPEC-l FM=FLOATFIM) PIOVM=3.14159265/FM IXS=O C ENTER LOOP ON S=O,I, ••• M•••••••••••••••••••••••••••••••••••••••••••••• 100 FIXS=FLOATFIIXSI C=I.0 IF IIXS-M) 115,110.110 110 C=0.5 115 ARGl=FIXS.PIOVM COSl=COSfIARGl) SUM .. O.O IXP=O C ENTER LOOP ON IXP=O.I •••• M•••••••••••••••••••••••••••••••••••••••••••• 130 FIXP=FLOATFIIXP) fNRM=I.0/FM IFIIXP) 140.150.140 140 IFIIXP-M) 160.150.160 150 FNRM=0.5/FM 160 ARG2=ARGl*FIXP ORT=C·II.54+.46.COSII·COSFIARG2» C FINO AMSPEC AND BUMP SUM I=IXP+1 AMP=AMSPECII) SUM " SUM + AMP.FNRM.ORT C INDEX ON IXP AND CHECK FOR MORE I XP=I XP+l 0075 0076 0077 0076 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 2) •••••••••••••••••••••••• • GNFLTl • PROGRAM 1I STINGS •••••••••••••••••••••••• (PAGE 3) IFIIXP-M) 130,130,200 C STORE FILTERIS) AND FILTERt-5) 200 l"IXS+M+1 J=-IXS+M+l FURl [)=SUM FLTRIJ):SUM C INDEX ON IXS AND CHECK FOR MORE IXS=IXS+l IFIIXS-MJ 100,100,300 C ALL DONE 300 GO TO 9999 C EXIT 9999 RETURN END •••••••••••••••••••••••• GNFLTl • • ••••••••••••••••••••••• • (PAGE 0150 0151 0152 0153 0154 0155 015b 0157 0158 0159 OlbO Olbl 01b2 01b3 3) •••••••••••••••••••••••• GNHOL2 • •••••••••••••••••••••••• PROGRAM LISTINGS - LAST CARD IN DECK IS NO. 0157 0001 0002 100 0003 GNHOL2 0004 GNHOL2 10ATA,NOATA,FMT,HOL,NCRS,IXCOM,INOEX) 0005 0006 0007 ----ABSTRACT---0008 0009 TITLE - GNHOL2 GENERATE HOLLERITH CHARACTERS 0010 0011 GNHOL2 GENERATES HOLLERITH CHARACTERS FROM DATA AND 0012 FORMAT INfORMATION IN THE CALLING SEQUENCE. 0013 0014 LANGUAGE - FAP, SUBROUTINE IFORTRAN II COMPATIBLE) DOl!> EQUIPMENT - 709 OR 7090 0016 STORAGE - 74 REGISTERS 0017 SPEED 0018 AUTHOR - R.A. WIGGINS 3/63 0019 0020 0021 ---USAGE---0022 TRANSFER VECTOR CONTAINS ROUTINES - NONE 0023 AND FORTRAN SYSTEM ROUTINES - CIOH).IFIL) 0024 0025 FORTRAN USAGE 0026 CALL GNHOL2IDATA.NDATA.FMT,HOL,NCRS, IXCOM. INDEX) 0027 0028 INPUTS 0029 0030 DATAII) l=l ••••• NDATA CONTAINS FLOATING POINT NUMBERS. FIXED 0031 POINT OR MACHINE LANGUAGE INTEGERS. OR ALPHANUMERIC 0032 CHARACTERS WHICH ARE TO BE INSERTED IN THE HOLLERITH 0033 OUTPUT ACCORDING TO THE FORMAT FMT. 0034 0035 NDATA MUST BE GRTHN=O 0036 0037 FMTlIl I=M ••••• 1 1M ARBITRARY) CONTAINS A FORMAT STATEMENT 0038 0039 WHICH IS TO BE INTERPRETED TO GENERATE THE HOLLERITH. FMT IS STORED IN REVERSE OROER. IE FMTIM) CONTAINS THE 0040 FIRST WORD lAND IS THE ARGUMENT GIVEN GNHOL2', FMTIM-l) 0041 CONTAINS THE SECOND WORD. ETC. 0042 IS MOST EASILY GENERATED BY A HOLLERITH FIELD INSIDE 0043 THE CALL STATEMENT ISEE EXA~PLES). 0044 0045 0046 INDEX IS ANY FIXED POINT INTEGER. 0047 OUTPUTS 0048 0049 HOLI! ) 0050 1=1 ••••• NCRS/6 CONTAINS THE HOLLERITH CHARACTERS 16 PER WORD. IN FORTRAN ORDER} THAT IS GENERATED FROM THE 0051 FORMAT AND DATA VECTORS • 0052 DOH NCRS IS 6 TIMES THE NUMBER OF WORDS IN HOL. 0054 0055 IS THE INDEX. WITH RESPECT TO COMMON OF THE FIRST WORD IXCOM 0056 OF HOL. 0057 0058 INDEX IS INCREASES BY ONE FROM THE INPUT VALUE. 0059 0060 EXAMPLES 0061 0062 1. GENERATION OF HOLLERITH CHARACTERS WITH NO DATA. 0063 0064 INPUTS - NDATA=D INDEX=4 0065 USAGE COMMON HOl 0066 CALL GNHOL2 IOATA,NDATA.21HI16HSAMPlE HOLLERITH). 0067 1 HOL.NCRS.IXCOM,INOEX) OUTPUTS - HOLIl ••• 3) = 6HSAMPLE HOLLERITH NCRS=18 IXCOM=l INDEX=5 0068 0069 0070 2. GENERATE HOLLERITH WITH DATA 0071 INPUTS - DATAll)=5. NDATA=l INDEX=5 0072 USAGE COMMON HOL 0013 CALL GNHOL2 IDATA.NDATA.23HI14H ERROR FLAG F4.1'. 0074 1 HOL.NCRS,IXCDM.INOEX) GNHOL2 • FAP -GNHOL2 COUNT LBL ENTRY • • •• ..... .... .. .. .. .. .. . ...• • •.. .. •.. .. • ..• .. ... .. . .•.. ... .... .... .... ..... ... it .. .. • .. .. it .. .. .. .. • ISUBROUTINE) •••••••••••••••••••••••• GNHOL2 • • ••••••••••••••••••••••• - 9129/64 = •••••••••••••• ** •••••••• • GNHOl2 PROGRAM LISTINGS * •••••••••••••••••••••••• IPAGE ••••••••••••• *.* •••••••• * GNHOL2 21 • * • * ••• ~ •• * ••••• *** ••• * •• * •• OUTPUTS - HOLI1 ••• 31 = 6H ERROR FLAG = 5.0 NCRS = 18 IXCOM = 1 INDEX = 6 * 3. GENERATE HOLLERITH FROM A FORMAT DEFINED OUTS IDE THE CALL STATEMENT 6HI16HSA INPUTS - NDATA = 0 INDEX = 6 FMTI41 * FMTf 31 6HMPLE H * 6HOLLERI FMTf 21 * FMT III 3HTHI • COMMON HOL USAGE * CALL GNHOL2 IDATA,NDATA,FMTI4J,HOL,NCRS,IXCOM, * INOEXI 1 * OUTPUTS - HOLl1 ••• 31 = 6HSAMPLE HOLLERITH NCRS=18 IXCOM=l INDEX=7 * * HTR 0 1,GENHOl 8CI SAVE GNHOl2 SXD *-2,4 EX,l INDEX SXA SXA EX+l,2 REGISTERS. 1,4 GET CAL ADDRESS OF ADD =1635 DATA. STA DATA 2,4 GET NUMBER CAL* OF DATA WORDS. STD NDATA 3,4 GET POSITION CAL OF FORMAT. STA FMT 4,4 GET POS IT ION CAL OF ADD =1635 HOL. STA HOl AlS SET 18 S'UB OUTPUT =32563617 6,4 OF IXCOM. STD* RESET N COUNTER. SXA N,O FMT-1,4 AXC SET IR 4 FOR DUMMY PRINT. DUMMY UNIT DESIGNATION =4817 ISSHI CLA *+2 lDO *INITIALIZE ( IOHI TRA* SIIOHI OUTPUT / STORAGE TO STORAGE HOLLERITH TRA SSH REENTRY FROM IIOHI * SXA OUT,4 SAVE SSH OUT+1,2 INDEX SXA OUT+2,1 REGISTERS. SXA 1,4 CAL GET ADDRESS ARS 18 1,4 OF BEGINNING ADD OF RECORD. STA HOLl ,2 SAVE POX A,2 LENGTH SXD N+1,2 OF RECORD. SXD AXT INCREMENT .·,1 N THE lENGTH TXI *+1,1,** N,l OF HOl. SXA MOVE AXT 1,2 .*,2 HOllERITH HOLl ClA FROM ( IOHI HOL STO * •• 1 BUFFER TO TIX *+1,1,1 HOl. TXI *+1,2,1 A TXL HOl1,2,** AXT .*,4 RESTORE OUT •• ,2 INDICES AXT AXT ANa *·,1 • RETURN TO (lOH I. TRA 2,4 DUMMY PRINT * FORMAT DESIGNATION. FMT PZE **,,1 1,1 INDEXING. AXT *+2,1,.· NDAlA TXl TRA C OUTPUT DATA LDO **,1 LIST. STR NDAlA,l,l INDEXING TXI $(FIL),4 TSX * RETURN TO I IOH I. C FINAL ENTRY FROM (IDHI. GNHOL2-2,4 LXD GET lXA N,2 ,2 NCRS PXA XCA MPY =6617 IPAGE 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 21 •• * ••••••••••••••••••••• GNHOL2 • ••••••••••••••••••••••••• (PAGE PROGRAM LISTINGS 3) srQ. EX CLA* ADO STD. AXT AXT TRA END 5,4 7,4 =1B17 7,4 **,1 ** ,2 8,4 •••••••••••••••••••••••• * GNHOL2 • •....•...•...... _....... (PAGE FOR OUTPUT. INCREMENT INDEX BY ONE; EXIT 0150 0151 0152 0153 0154 0155 0156 0157 31 •••••••••••••••••••••••• GRAPH • ••••••••••••••••••••••••• PROGRAM LISTINGS .--• ... _................•. GRAPH • ••••••••••••••••••••••• • GRAPH ISUBROUTINE) 9/29/64 LAST CARD IN DECK IS NO. 1102 • LABEL 0001 CGRAPH 0002 SUBROUTINE GRAPHIISOL,IDOT,N,TITLE,YUNITS,XUNITS,YTOP.YBOT. 0003 0004 1 XMAX.XMIN,NOPPP.IPAGE,SPACE) 0005 C ----ABSTRACT---0006 C 0001 C C TITLE - GRAPH 0008 C MULTIPLE FRAME SCOPE PLOTS OF VECTOR SETS 0009 0010 C GRAPH MAKES A SIMULTANEOUS PLOT OF AN ARBITRARY NUMBER 0011 C 0012 C OF SERIES ACROSS AS MANY SCOPE FRAMES AS NEEDED. RESULTING PHOTOS CAN BE ABUTTED TO GIVE CONTINUOUS GRAPH. 0013 C 0014 C USER SUPPLIES HOLLERITH LABELS, SCALING AND PLOTTING 0015 C PARAMETERS, FROM WHICH GRAPH DETERMINES SUITABLE CHECK 0016 C MARKS AND LABELS FOR AXES. 0011 C 0018 C SUCCESSIVE FRAMES ARE SERIALIZED FROM AN INPUT VALUE 0019 C C 0020 OPTIONS INCLUDE SOLID OR DOTTED MODE OF PLOTTING AND 0021 C HISTOGRAM-STYLE OR CUBIC-CURVE INTERPOLATION BETWEEN 0022 C SUCCESSIVE POINTS 0023 C 0024 C 0025 - FORTRAN II SUBROUTINE C LANGUAGE C EQUI PMENT - 109 OR 1090 PLUS 140 CRT RECORDER. lAND 180 CRT DISPLAY) 0026 0021 - 1499 REGISTERS C STORAGE OR MORE PER FRAME (7090). - ON THE ORDER OF 2 SECONDS 0028 C SPEED - S.M. SIMPSON JR, NOV 1961 C AUTHOR 0029 C 0030 ----USAGE---0031 C C 0032 DISPLA. LINE. XFIXM. FLOATM. 0033 C TRANSFER VECTOR CONTAINS ROUTINES DSPFMT. FRAME. MVBLOK, SCPSCL C 0034 HSTPLT 0035 C AND FORTRAN SYSTEM ROUTINES (SPH). IFILl. LOG, EXPI2. XLDC 0036 C 0037 C C NDTE-HSTPLT PLOTS THE DATA. THERE ARE SEVERAL 0038 VERSIONS OF THIS ROUTINE WHICH DIFFER IN THE 0039 C PLOTTING STYLE USED IHISTOGRAM. CUBIC INTER0040 C POLATION, VERTICAL LINES). USER SHOULD SELECT 0041 C ONE IALL HAVE CALLING SEQUENCES COMPATIBLE 0042 C TO GRAPH) 0043 C 0044 C FORTRAN USAGE CALL GRAPH IISOL,IDOT,N.TITLE,YUNITS.XUNITS,YTOP,Y80T. 0045 C 1 XMAX.XMIN,NOPPP.IPAGE.SPACEI 0046 C C 0041 PRELIMINARY DEFINITIONS 0048 C GRAPH PLOTS AN ARBITRARY NUMBER.NS,OF FLOATING POINT 0049 C SERIES IN THE SOLID MODE. PLUS AN ARBITRARY NUMBER.ND, 0050 C OF FLOATING POINT SERIES IN THE DOTTED MODE. NS DR 0051 C NO MAY BE ZERO. ALL SERIES HAVE THE SAME NO. OF TERMS. N. 0052 C 0053 C LET THE SERIES TO BE PLOTTED SOLID BE DEFINED BY 0054 C YS1Il ••• N), YS2Il ••• N) ••••• YSNSll ••• N) 0055 C 0056 A TYPICAL MEMBER WILL BE REFERRED TO BY YStl ••• N) C 0051 C 0058 AND THE SERIES TO BE PLOTTED DOTTED BE C YDlll ••• N), YD2Il ••• N) ••••• YDNDll ••• N) 0059 C 0060 A TYPICAL MEM8ER WILL 8E REFERRED TO 8Y YDll ••• N) C 0061 C A TYPICAL SERIES DISREGARDING PLOTTING MODE IS Yll ••• N) 0062 C 0063 YII) IS CONCEIVED AS CONTAINING THE FUNCTION YYIX). C 0064 WITH EQUAL INCREMENTS OF THE INDEPENDENT ARGUMENT X C 0065 OCCURRING BETWEEN SUCCESSIVE INDICES.IE C 0066 Yll.Z ••• N) = YYIXMIN.XMIN+DEL.XMIN+2.DEL ••••• XMAX) C 0061 WHERE DEL = IXMAX-XMINI/N C 0068 C 0069 C INPUTS 0010 C I SOLI I) I=l ••• NS+l IS A VECTOR WHICH GIVES THE LOCATIONS OF ALL 0011 C 0012 SERIES WHICH ARE TO 8E PLOTTED IN THE SOLID MODE C ISOL(l) XLOCFIYSl) 0013 C ••• * •••••••••••••••••••• • GRAPH * PROGRAM LI STINGS •••••••••••••••••••••••• (PAGE 21 C C C C C C C ETC. IDOTIII ETC. N IS THE COMMON LENGTH OF ALL SERIES TO BE PLOTTED MUST EXCEED 1 TITLEII) 1=1 ••• 8 CONTAINS ~8 HOLERITH 18A6 FORMAT) TO BE USED AS A HEADING TITLE ON ALL FRAMES. OPTIONALLY THESE 48 HOLERITH MAY BE GIVEN TO GRAPH BY THE LITERAL APPEARANCE IN THE CALLING SEQUENCE OF 5~HSSS.SSHOLERITHHOLERITHHOLERITHHOLERITHHOLERJTHHOLERITH THE FIRST MODE IS USFUL FOR HOLERITH WHICH THE USER AQUIRES BY FORTRAN READ STATEMENTS. THE SECOND MODE IS USF.FUL WHEN THE TITLE TO BE USED IS A CONSTANT OF THE USERS PROGRAM. THE TWO MODES HAVE A REVERSED SENSE OF STORAGE DIRECTION GRAPH DISTINGUISHES BETWEEN THE MODES BY THE PRESENCE OR ABSENCE OF 6 DOLLAR SIGNS IN TITLElll. CONSEQUENTLY, FOR MODE 1 THE FIRST 6 OF THE 48 HOLERITH MUST NOT ALL BE DOLLAR SIGNS. C C C C C C C C C C C l=l ••• ND+l IS A VECTOR WHICH GIVES THE LOCATIONS OF ALL SERIES TO BE PLOTTED IN THE DOTTED MOOE IDOTlll = XLOCFIYDl) IDOTI2) = XLOCFIYD21 IDOTIND) = XLOCFIYDND) IDOTlND+ll = 0 C C C C C C C XLOCFIYS21 ISOLINSI XLOCFIYSNSI ISOllNS+ll = 0 ITHE TERMINAL ZERO STOPS GRAPH FROM LOOKING FOR MORE SERIES) C C C C C C C C C C C C C IPAGE ISOLI21 C C •••••••••••••••••••••••• GRAPH • ••••••••••••••••••••••••• YUNITSII) 1=1 ••• 6 CONTAINS 36 HOLERITH 16A6 FORMAT) TO BE USED AS A DESCRIPTIVE TITLE, ON THE VERTICAL AXIS, OF THE UNITS OF YIIl. OPTIONALLY THESE 36 HOlERITH MAY BE GIVEN TO GRAPH BY THE LITERAL APPEARANCE IN THE CALLING SEQUENCE OF 42HSS$$$SHOLERITHHOLERITHHOLCRITHHOLERITHHOlE IIF FIRST MODE IS USED YUNITSll) MUST NOT = tSSSSS) C C C C C C C C C XUNITSII) 1=1 ••• 6 CONTAINS 36 HOlERITH 16A6 FORMAT) TO BE USED AS A DESCRIPTIVE TITLE, ON THE HORIZONTAL AXIS, OF THE UNITS OF X OPTIONALLY THESE 36 HOLERITH MAY BE GIVEN TO GRAPH BV THE LITERAL APPEARANCE IN THE CALLING SEQUENCE OF 42H$$S$SSHOLERITHHOLERITHHOLERITHHOLERITHHDLE IIF FIRST MODE IS USED XUNITSll) MUST NOT = .SSSSSI C VTOP DEFINES THE TOP OF THE PLOTTING AREA, SUCH THAT IF SOME VIII = YTOP THEN VIII IS PLOTTED ON THE UPPERMOST EDGE OF THE PLOTTING AREA IF ANV VII) EXCEEDS VTOP IT WILL BE TREATED AS THOUGH IT WERE = VTOP VTOP MUST EXCEED VBOT VBOT DEFINES THE BOTTOM OF THE PLOTTING AREA, SUCH THAT IF SOME VIII = VBOT THEN VIII IS Pl.OTTED ON THE LOWERMOST EDGE OF THE PLOTTING AREA. IF ANY YIII IS LSTHN YBOT IT WILL BE TREATED AS THOUGH IT WERE = YBOT C C C C C C C C C C C C VALUES OF YIII BETWEEN YTOP AND YBOT ARE PLOTTED PROPORTIONALLV BETWEEN THE UPPER AND LOWER EDGES. C C C C C C C C C C C C XMAX IS THE ARGUMENT VALUE CORRESPONDING TO YINI XMAX MUST EXCEED XMIN = YV(XMAX) XMIN IS THE ARGUMENT VALUE CORRESPONDING TO VIII = YVIXMINI NOPPP IS THE DESIRED NO OF POINTS PER PAGE TO BE PLOTTED Yll ••• NOPPPI APPEARS ON FIRST FRAME YINOPPP ••• 2*NOPPP-ll ON SECOND FRAME, ETC. MUST EXCEED 2 0074 0075 0076 0077 0078 0079 OOBO 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 009~ 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 21 •••••••••••••••••••••••• GRAPH * * •••••••••••••••••••••••• IPAGE PROGRAM LISTINGS 31 C C C C C C C • ••••••••••••••••••••••• • GRAPH * •••••••••••••••••••••••• MUST BE LSTHN=401 IPAGE IS AN INITIAL PAGE NO. TO BE PRINTED ON FIRST FRAME IPAGE+l.IPAGE+2.... APPEARS ON SUCCESSIVE FRAMES IS TREATED MODULO 1000 SPACE!I) I=l ••• NOPPP MUST BE AVAILABLE TO GRAPH FOR SCRATCH WORK C C OUTPUTS C C C IPAGE IS LEFT = ILAST+1 WHERE ILAST IS THE PAGE NO. APPEARING ON THE LAST FRAME USED BY GRAPH, THUS UPOATING (PAGE FOR A SUBSEQUENT CALL OF GRAPH. SPACEll) IS USED AS AN ERROR INDICATOR =0.0 IF NO TROUBLE =1.0 IF N,YTOP,XMAX OR NOPPP IS ILLEGAL OR IF BOTH ISOL(1) AND IDOTll1 = 0 C C C C C C C C C SCOPE OUTPUTS C C C C C C C THE SCOPE OUTPUTS WILL BE OEFINED IN TERMS OF THE SCOPE AREAS AFFECTED. IT SHOULD BE NOTED FIRST THAT GRAPH DOES NOT CHANGE FRAMES BEFORE PLOTTING THE FIRST FRAME NOR AFTER PLOTTING THE LAST ONE, THUS PERMITTING THE USER TO PLOT ADDITIONAL INFORMATION ON THESE TWO FRAMES. BY THE SAME TOKEN HOWEVER USER MUST CHANGE FRAMES BETWEEN SUCCESSIVE CALLS TO AVOID SUPERPOSITION. C THE SCOPE FACE IS A SQUARE GRID OF POINTS (X,Y) WHERE X AND Y CAN RANGE FROM 0 TO 1023. LET 10,01 BE THE LOWER LEFT CORNER AND 11023,1023) THE UPPER RIGHT CORNER WITH Y THE VERTICAL DIMENSION. THEN LET (Xl,Yl)-(X2,Y2) STAND FOR THE RECTANGULAR AREA WHOSE DIAGONAL RUNS FROM (X1.Yl) TO (X2.Y2) DEFINE THE FOLLOWiNG AREAS APLOT 1175.150)-11015.990) ATITLE 15,1000)-11013.1021) AYUNIT 131.1081-110.864) AYAROW 131.864)-110.910) AYCKNO (76,140)-(160.1000) AYSCAL (71,120)-(50.981) AXUNIT 187,301-(843,51) AXAROW (843,30)-(880,51) AXCKNO (167,55)-11023.140) AXSCAL 1144,5)-11005.26) APAGE 110,70)-( 157.911 ACHEX (0.0)-(63,21) AERROR 1100.500)-(6B8,521) THEN 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 APLOT IS THE PLOTTING AREA ISQUARE). IT IS BOXED IN ON ALL 4 SIDES BY STRAIGHT LINES WITH CHECK MARKS ALL AROUND. THE VERTICAL CHECK MARK SEQUENCE IBETWEEN 20 AND 50) IS DETERMINED BY GRAPH SO AS TO DEFINE INTEGRAL POWERS OF 10 IN THE UNITS OF Y, AND A SIMILAR SEQUENCE IS DEVELOPED IN THE X DIRECTION. IF THE VALUE Y=O. FALLS BETWEEN YTOP AND YBOT. A CORRESPONDING HORIlONTAL AXIS IS DRAWN IN ON ALL FRAMES IF THE VALUE X=O. OCCURS ON SOME FRAME A VERTICAL AXIS IS DRAWN IN AND SUPPLIED WITH Y UNIT CHECK MARKS C THE DATA VII) ARE PLOTTED EQUALLY SPACED IN THE X DIRECTION ACROSS THE PLOTTING AREA SUCH THAT YllI IS AT THE LEFT EDGE OF fRAME 1, YINOPPP) AT THE RIGHT EDGE OF FRAME 1.YINOPPP) AGAIN APPEARS AT THE LEFT EDGE OF FRAME 2, ETC. TILL THE DATA ARE GONE C C C C C USE UF THE HISTOGRAM VERSION OF SUBROUTINE HSTPLT GIVES THE DATA PLOTTED AS HORllONTAL BARS (WIDTH = PLOTTING WIDTH/INOPPP-l)) CONNECTED BY VERTICAL LINES. THE LINES AND BARS BEING SOLID OR DOTTED ACCORDING C C C C IPAGE 014B 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 016B 0169 0110 0171 0172 0173 0114 0175 0116 0177 0118 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0211 0218 0219 0220 0221 0222 3) •••••••••••••••••••••••• • • GRAPH •••••••••••••••••••••••• PROGRAM LISlINGS • •••••••••••••••••••••••• (PAGE IPAGE TO ISOL, lOOT. THIS VERSION ALSO SUPPLIES AN ADDITIONAL SET OF CHECK MARKS TO THE BOTTOM OF THE PLOTTING AREA lOR TO THE Y-D. AXIS IF PRESENT) WHICH LOCATE THE CENTERS OF THE HISTOGRAM BARS. FOR NOPPP LESS rHAN Bl THERE IS ONE SUCH CHECK FOR EACH BAR, FOR 81 LSTHN= NOPPP LISTHN= 160 ONE CHECK FOR EVERY OTHER BAR, FOR NOPPP GRTHN= 161 ONE CHECK FOR EVERY FIFTH BAR. C C C C C C C C C C THE CUBIC INTERPOLATOR VERSION OF HSTPLT FITS AND PLOTS A CUBIC CURVE BETWEEN SUCCESSIVE POINTS. THE POINTS THEMSELVES ARE DARKENED. THE HORIZONTAL AXIS WITH CHECKS IS PLOTTED AS IN THE ABOVE CASE. THE VERTICAL BAR VERSION OF HSTPLT DRAWS A LINE FROM EACH POINT TO A HORIZONTAL AXIS. THE VERTICAL POSITION OF THIS AXIS IS DEFINED BY THE FIRST VALUE IN THE SERIES. NO HORllONTAL AXIS IS DRAWN FOR THE VALUE Y=D. C C C C C C C C OF THE REMAINING AREAS ONLY ATITLE, AXCKNO AND APAGE ARE CONTINUED BEYOND THE FIRST FRAME. C C C C C AlITLE WILL SHOW THE 48 HOLERITH IN TITLEIl ••• 81 C AYUNIT WILL SHOW THE 36 HOLERITH IN YUNITll ••• 6) C C AYARDW IS A VERTICAL ARROW C C AYCKNO C C C SHOWS A SEQUENCE OF INTEGERS DEFINING THE VALUES OF Y CORRESPONDING TO THE CHECK MARKS ON THE VERTICAL AXIS AYSCAL MAY BE BLANK, OTHERWISE IT CONTAINS A DESCRIPTION OF HOW TO MODIFY THE INDICATED UNITS IN AYCKNO SO AS TO YIELD TRUE SCALE. AXUNIT WILL SHOW THE 36 HOLERITH IN XUNITll ••• 6) C C AXCKNO IS LIKE AYCKNO BUT FOR THE HORIlONTAL AXIS C C AXSCAL IS LIKE AYSCAL BUT APPLIES TO AXCKNO C APAGE IS THE PAGE NO SERIALIZING AREA STARTING WITH VALUE IPAGE ACHEX GIVES THE (NO. HISTOGRAM CHKMARKS)/IDATA POINT) RATIO BLANK IF RATIO = 1 IF 1 CHK 112 DATA PTSI 1/2 IF 1 CHK 1(5 DATA PTS) 115 AERROR NOT USED NORMALLY SAYS ILLEGAL ARGUMENT FOR GRAPH C C C C C C C C C C C C C IF ANY ARGUMENT ILLEGAL C C EXAMPLES C EXAMPLES 1. THRU 4. ARE INTENDED TO BE RUN USING THE HISTOGRAM C STYLE VERSION OF SUBROUTINE HSTPLT. EXAMPLES 6. AND 7. SHOW EFFECTS C OF OTHER VERSIONS. C C C C C C C C C C C C C C C C C C C • GRAPH •••••••••••••••••••••••• 4) 1. SINGLE FRAME EXAMPLE INPUTS - YSlI1 ••• 201)= COSFIO.),1.05),I.IO), ••• YS211.~.201)= .600,.615,.630, ••• YDlll ••• 201)= 2 •• SINFI0.),1.151,1.30), ••• ISOLI1 ••• 2J= XLOCFIYSl1,IYS2) ISOL(3)=0 IDOTlll= XlOCFIYDl) IDOTI21=0 YTOP= 3.5 YBOT- -2.2 N=201 XMAX= 405. XMIN= -630. lITLEll ••• 8)= 48HTHESE CHARACTERS COMPLETELY COVER THE TITLE AREA IPAGE=l NOPPP=201 USAGE CALL FRAME CALL GRAPHIISOL,IDOT,N,TITLE, 1 42H$$$$$$THESE CHARACTERS FILL UP YUNITS AREA, 2 42H$$$$$$THESE CHARACTERS FILL UP XUNITS AREA, 3 YTOP,YBOT,XMAX,XMIN,NOPPP,IPAGE,SPACE) 0223 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 D23B 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0273 0274 0275 0276 0277 027B 0279 0280 0281 0282 0283 0284 0285 0286 0287 0288 0289 0290 0291 0292 0293 0294 0295 4) •••••••••••••••••••••••• GRAPH * • (PAGE PROGRAM LI STINGS •••••••••••••••••••••••• I PAGE 51 C C C C ••••••••••••••• **.* ••••• GRAPH * * OUTPUTS - IPAGE=2 SPACEll)=O. 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 2. DOUBLE FRAME EXAMPLE INPUTS - SAME AS EXAMPLE 1 EXCEPT NOPPP= 120 C C USAGE - SAME AS EXAMPLE 1 OUTPUTS - IPAGE= 3 SPACEI11=0. 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 3. EXPLODED VIEW OF EXAMPLE 2 INPUTS - SAME AS EXAMPLE 2. EXCEPT YTOP= .35 C USAGE - SAME AS EXAMPLE 1 C Y80T"'-.22 0296 0291 0298 0299 0300 0301 0302 0303 0304 0305 0306 0301 0308 0309 0310 0311 0312 0313 0314 0315 0316 0311 0318 0319 0320 0321 0322 0323 0324 0325 0326 0321 0328 0329 0330 0331 0332 0333 0334 0335 0336 0331 0338 0339 0340 0341 0342 0343 0344 0345 0346 0341 0348 0349 0350 0351 0352 0353 0354 0355 0356 0351 0358 0359 0360 0361 0362 0363 ·0364 0365 0366 0361 0368 0369 0310 5) ••••••••••••• * ••••••••• * GRAPH • * •••••••••••••••••••••••• (PAGE PROGRAM LISTINGS 61 C C C C C C C OUTPUTS - IPAGE= 3 ~.* • •• **.**** •••• * •••••• * GRAPH • ._ .•......•..........•.. IPAGE 6) SPACE(1)=.0 C C C C C C C C C C C C C C C C C C C C C 4. SOME EXTREME SCALING C INPUTS - SAME AS EXAMPLE 1 EXCEPT C YSlI1.a.800)= -32456.+COSFIO.),1.051,I.I01,... C ISOl(1)= XLOCFIYS11 ISOLI21=0 IDOTlll=O C YTOP= -32454. YBOT= -32458. C XMAX= .45678.10 •• 1-7) XMIN=.45677.10 •• 1-71 C NOPPP=401 IPAGE=7 C USAGE SAME AS EXAMPLE 1 C OUTPUTS - IPAGE= 9 SPACEIll= O. C C C C N=600 C C C C C C C C C C C C C C C C C C C C C C C C 5. ERROR CONDITIONS C USAGE CALL GRAPHIISOL,IDOT,0,TITlE,YUNITS,XUNITS,10.,5., C 7.,2.,l00,2,SPACEIlll C CALL GRAPHIISOL,IDOT,5,TITLE,YUNITS,XUNITS,5.,5., C 7.,2.,100,2,SPACEI2Il C CALL GRAPHIISOL,IOOT,5,TITLE,YUNITS,XUNITS,10.,5., C l.,2.,100,2,SPACEI3ll C CALL GRAPHIISOL,IOOT,5,TITLE,YUNITS,XUNITS,10.,5., C 7.,2.,2,2,SPACEI4l1 C CALL GRAPHIISOl,IDOT,5,TITLE,YUNITS,XUNltS,10 •• 5., C 7.,2.,500,2,SPACEI5ll C OUTPUTS - SPACEI1l-1. IILLEGAl Nl SPACEI2l=1. (ILLEGAL YTOPl 0371 0372 0373 0374 0375 0376 0377 0378 0379 0380 0381 0382 0383 0384 0385 0386 0387 0388 0389 0390 0391 0392 0393 0394 0395 0396 0397 0398 0399 0400 0401 0402 0403 0404 0405 0406 0407 0408 0409 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 0430 0431 0432 0433 0434 0435 04.36 0437 0438 0439 0440 0441 0442 0443 0444 0445 •••••••••••••••••••••••• • • GRAPH PROGRAM LISTINGS •••••••••••••••••••••••• IPAGE 1) •••••••••••••••••••••••• GRAPH • • ••••••••••••••••••••••• • I PAGE SPACEI3)=1. IILLEGAL XMAX) SPACEI4)=I. I ILLEGAL NOPPP) SPACE(5)=1. IILLEGAL NOPPP) C C C C 6. USE OF CUBIC INTERPOLATION VERSION OF HSTPLT C C C C C C C INOTE- THERE IS A 109 ANO A 1090 VERSION OF THIS HSTPLTI INPUTS - SAME AS EXAMPLE 1 EXCEPT NOPPP=51 USAGE - DITTO OUTPUTS - 01 no IONLY F1RST FRAME SHOWN BELOW) 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 1. USE OF VERTICAL BAR VERSION OF HSTPLT NOTE THAT THE VERTICAL POSITION OF THE HORIZONTAL BAR. FROM C WHICH THE VERTICAL BARS ARE PLOTTED IS DEFINEO BY THE INITIAL C VALUE OF EACH SERIES. C C INPUTS C C USAGE - SAME AS EXAMPLE 1 EXCEPT ISOLI2)=0 .615 •• 630 •• 645 •••• - SAME AS EXAMPLE 1 YD1Il ••• 2011= 2 •• 0446 0441 0448 0449 0450 0451 0452 0453 0454 0455 0456 0451 0458 0459 0460 0461 0462 '0463 0464 0465 0466 0461 0468 0469 0410 041l 0412 0413 0414 0415 0476 0411 0418 0419 0480 0481 0482 0483 0484 0485 0486 0481 0488 0489 0490 0491 0492 0493 0494 0495 0496 0497 0498 0499 0500 0501 0502 0503 0504 0505 0506 0501 71 • ••••••••••••••••••••••• • GRAPH * •••••••••••••••••••••••• (PAGE 81 C PROGRAM LISTINGS •••••••••••••••••••••••• * GRAPH * •••••••••••••••••••••••• OUTPUTS - OITTO 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 PROGRAM FOLLOWS SELOW C C OIMENSION STATEMENT FOR ARGUMENTS OIMENSION ISOLI100I,IDOTII00I,TITLE(8),YUNITSI6J.XUNITSI61. 1 SPACE(401) C TRUE DIMENSION STATEMENTS DIMENSION HSTORG(4),FMTII0) DIMENSION HOLERI8) EQUIVALENCE IONE,IONE1,IDNEK.IDNEK) C CHECK LEGALITIES IF I N-ll 5,5.1 1 IFIYTOP-YBOT) 5,5,2 2 IFIXMAX-XMINI 5,5.3 3 IFINOPPP-2) 5,5,4 4 IFINOPPP-401) 7,7,5 1 IF IISOL) 10.8,10 8 IF IIDOT) 10,5,10 5 CALL DISPLA PRINT 6 6 FORMATI39H2SH100,500,ILLEGAL ARGUMENT FOR GRAPH SPACE 111=1.0 GO TO 310 C INITIAL SETTINGS, ETC 10 XRNGE=XMAX-XMIN YRNGE=YTOP-Y60T NN=N DELX=XRNGE/IFLOATFINN-l)) IPAGE 0508 0509 0510 0511 0512 0513 0514 0515 0516 0517 0518 0519 0520 0521 0522 0523 0524 0525 0526 0527 0528 0529 0530 0531 0532 0533 0534 0535 0536 0537 0538 0539 0540 0541 0542 0543 0544 0545 0546 0547 054B 0549 0550 05')} 0552 0553 0554 0555 0556 0557 0556 0559 0560 0561 0562 0563 0564 0565 0566 0561 0568 0569 0570 0511 0572 0573 0574 0575 0576 0577 0578 0579 0580 0581 0582 8) •••••••••••••••••••••••• GRAPH • * •••••••••••••••••••••••• IPAGE 9) PROGRAM Lt STINGS •..•. _- •.•.•..••........ * * GRAPH •••••••••••••••••••••••• PGOElx=oelX*flOATFINOPPP-11 NoElX=(840.0*128.01/flOATF(NOPPP-ll IPAGE=XMOOFIIPAGE.I0001 B 00lARS=535353535353 VlPOS=175.0 VRPOS=1015.0 H8POS=150.0 HTPOS=990.0 NPlOTO=O IYSClX=76 IXSClY=51 C SET UP FOR BAR PLOTTING BY HSTPlT IFRSTB=l ISKIPB=l If (NOPPP-80) 415,415,1001 1002,1002,1003 1001 IF INOPPP-1601 1002 ISKIP8=2 GO TO 1004 1003 I SKI PB=5 1004 CAll OISPlA PRINT 1005,ISKIPB 1005 FORMAT (9H2SH1,l,I/,II11 CONVERSION CONSTANTS C SET 415 CONVl=IHTPOS-HBPOSI/(YTOP-YBOTI CONVK=HTPOS-YTOP*CONVl CNVl=(VRPOS-VlPOSI/IPGOElXI HSTORGll'=175.0 HSTORG(31=1015.0 C CHECK IF y=o LINE APPEARS ON GRAPH 1420 IS NO) If IYTOPI 420,420,416 416 IF(YBOTI 418,420.420 C IF SO SET 418 HSTORG(21=CONVK HSTORGI41=CONVK GO TO 422 C IF NOT SET 420 HSTORGI21=HBPOS HSTORG(41=HBPOS C INITIALIZE NO. PTS TO PLOT ON FIRST PAGE 422 IF {NOPPP-NNI 424,424,426 424 NOPTP=NOPPP GO TO 428 426 NOPTP=NN C DOES AN x=o LINE OCCUR ON ANY FRAME (440 IS NOI 428 IF (XMAX) 440,432,430 430 IF (XMINI 432,440,440 C IF YES SET THE PAGE NO AND THE X COORD ON THAT PAGE 432 ITEMP1=(-XMIN)/PGOElX IPGXZ=ITEMP1+IPAGE IPGXZ=XMOOFIIPGXl,lOOOI XIER=VlPOS + 840.0*(-XMIN-PGDELX*FlOATFIITEMPlll/(PGOELX) GO TO 450 440 IPGXl=O XIER=O.O C PLOT X AND Y AXIS LABELS WITH ARROWS 450 IF (YUNITS-OOLARS) 4406,4402,4406 4402 DO 4404 1=1,6 J=7-1 4404 HoLER(JI=YUNITS(I+327621 GO TO 4408 4406 DO 4407 1=1,6 4407 HOlER(I)=YUNITS(I) 4408 CALL 01 SPlA PRINT 452,IHOlER(I),I=I,6) 452 FORMATII0H2SV31,108, 6A61 CALL lINE(20.,868.,20.,910.) CALL LINE(2B.,895.,20.,910.1 CALL LINEI12.,895.,20.,910.1 If (XUNITS-OOLARSI 4414,4410,4414 4410 DO 4412 1=1,6 J=1-I 4412 HOLERIJ)=XUNITSII+321621 GO TO 4418 4414 DO 4416 1=1,6 4416 HOlER(I'=XUNITSIII IPAGE 0583 0584 0585 0586 0581 0588 0589 0590 0591 0592 0593 0594 0595 0596 0591 0598 0599 0600 0601 0602 0603 0604 0605 0606 0607 0608 0609 0610 0611 0612 0613 0614 0615 0616 0617 0618 0619 0620 0621 0622 0623 0624 0625 0626 0627 0628 0629 0630 0631 0632 0633 0634 0635 0636 0631 0638 0639 0640 0641 0642 0643 0644 0645 0646 0647 0648 0649 0650 0651 0652 0653 0654 0655 0656 0657 9) • ••••••••••••• ** •••••••• GRAPH * *•••••••••••••••••••••••• (PAGE 10) PROGRAM 1I STINGS •••••••••••••••••••••••• • GRAPH * •••••••••••••••••••••••• 4418 CALL OISPLA PRINT 454,(HOLER(I),1=1,6) 454 FORMAT(9H2SH81.30.6A6) CALL LINE(845.,40.,880.,40.) CALL LINE(865.,32.,880.,40.) CALL LINE(865.,48 •• 880 •• 40.) C GO FINO CHECK MARK SETTINGS FOR VERTICAL SCALE 456 ASSIGN 460 TO ISTOUT TOP = YTOP BOTTOM=Y80T C GO TO INTERNAL SUBROUTINE TO SET UP CHECK MARKS,SCALES GO TO 21 C AFTER COMING BACK GO OUTPUT VERTICAL 460 ASSIGN 462 TO ISCOUT VORH=l.O GO TO 520 C AFTER COMING BACK SCALE STUFFTO SCOPE UNITS FOR FRAME LOOP 462 VUORG=HBPOS+CONVL*(BRLOU-YBOTJ VUDEL=CONVL*DBRLOU VLORG=HBPOS+CONVl*(BRlOl-YBOTl VlDEL=CONVL*OBRLOL INTVL=NBRlOL C GO SET HORIZONTAL SCALES 464 ASSIGN 410 TO ISTOUT TOP =XMIN+PGDELX BOTTOM=XMIN GO TO 21 C GO OUTPUT HORIZONTAL SCALES 470 ASSIGN 412 TO ISCOUT VORH=O.O GO TO 520 C SCALE STUFF TO SCOPE UNITS FOR FRAME LOOP AND GO THERE 412 HUORG=VLPOS+CNVL*(BRLOU-XMIN) HUDEL=CNVL*DBRLOU HLDRG-VLPOS+CNVL*IBRLOL-XMIN) HLDEL=CNVL*DBRLOl INTHl=NBRLOL GO TO 200 C THIS IS AN INTERNAL SUBROUTINE WHICH, GIVEN C TOP = VALUE AT TOP OF SCOPE (IN Y UNITS) C BOTTOM VALUE AT BOTTOM OF SCOPE (IN Y UNITS) C FINDS C BRLOU = Y VALUE FOR LOWEST UNLABELED BAR C DBRLOU = Y INCREMENT BETWEEN UNLABELED BARS C BRLOL = Y VALUE FOR LOWEST LABELED BAR C OBRLOL = Y INCREMENT BETWEEN LABELED BARS C NBRLOL = INTEGER TO PLOT NEXT TO LOWEST LABELEO 8AR C (MAX 3 DIGITS PLUS SIGN) NEXP = POSITIVE OR NEGATIVE INTEGER TO PLOT AS EXPONENT C C (MAXIMUM 2 DIGITS PLUS SIGN) C NCONST = POSITIVE OR NEGATIVE INTEGER TO ADO TO LABELS C = NO. THOUSANDS TO BE ADDED TO LABELS C (MAX 5 DIGITS PLUS SIGN) C THE INCREMENTS FOUND WILL BE SUCH THAT THE TOTAL NO. OF CHECK MARKS C WILL 8E BETWEEN 20 AND 50 C (LOOP ALSO USED IN X DIRECTION) FIRST OF ALL FINO THE CONSTANTS WHICH WOULD RESULT IF C C DATA RANGED FROM 0 TO (TOP-BOTTOM) C INITIALIZE 21 OATMAX=TOP-BOTTOM NCONST=O NBRLOL=O BRLOU=O. BRLOL=O. C BEGIN BY FINDING NEXP AND DBRLOL=lO**NEXP SUCH THAT C 10.**NEXP LSTHN OAT MAX LSTHN=10.**INEXP+1) C SET TRIAL NEXP C (THE CONST IS LOG, TO 8ASE 10, OF E=2.118281828) NEXP=0.43429448*LOGFIDATMAX) IF(DATMAX-l.0) 33,34,34 33 NEXP=NEXP-l 34 OBRLOL=10.**NEXP C SET OBRLOU ACCORDING TO HOW MANY TIMES DBRLOL GOES INTO DATMAX NTMS=DATMAX/OBRLOL IFINTMS-l) 60,60,62 = (PAGE 10) 0658 0659 0660 0661 0662 0663 0664 0665 0666 0667 0668 0669 0610 0671 0612 0613 0614 0615 0616 0617 0618 0619 0680 0681 0682 0683 0684 0685 0686 0681 0688 0689 0690 0691 0692 0693 0694 0695 0696 0691 0698 0699 0100 0701 0102 0103 0104 0105 0106 0107 0708 0709 0710 0111 0712 0113 0114 0715 0116 0111 0718 0719 0720 0721 0722 0723 0724 0725 0726 0721 0128 0729 0130 0131 0132 •••••••••••••••••••••••• - •••••••••••••••••••••••• PROGRAM LI STINGS * GRAPH ••••••••••••••••••••••••" (PAGE 11) {PAGE 111 C NTMS IS I, OR 0 (MEANS OBRLOL: OATMAX PLUS EPSILONI 60 NEXP=NEXP-l DBRLOL=DBRLOL/I0. DBRLOU=DBRLOLl2. GO TO 70 C IS NTMS 2,3, OR GREATER 62 IF(NTMS-3) 64,64,65 C 2 OR 3 64 DBRLOU=DBRLOL/I0. GO TO 70 C 4,5 ••• 9, OR 10IDBRLOL=DATMAX/I0. MINUS EPSILONI 65 DBRLOU=DBRLOL/5. 70 CONTINUE 8 ONE=1 8 ONEK=1750 NTIMS=XFIXMF(O,BOTTOM/DBRLOLI 78,99,74 IFIBOTTOM) 74 IFIDBRLOL-FLOATMFINTIMSI-BOTTOMI 76,78,76 76 NT! MS=NTI MS+ tONE NBRLOL=NTIMS 78 BRLOL=DBRLOL-FLOATMFINTIMSI BRLOU=BRLOL 80 IF IBRLOU-BOTTOMI 84,86,82 BRLOU=BRLOU-DBRLOU 82 GO TO 80 84 BRLOU=BRLOU+DBRLOU IFINBRLOLI 88,98,94 86 C NEG IF INBRLOL+IONEKI 90,90,99 88 90 NCONST=NCONST-IONE N8RLOL=NBRLOL+IONEK GO TO 88 CPOS 94 IF INBRLOL-IONEKI 99,96,96 96 NCONST=NCONST+IONE N8RLOL=N8RLOL-IONEK GO TO 94 98 NBRlOL=O 99 NCONST=XFIXFIFlOATMFINCONSTI) NBRLOL=XFIXFIFLOATMF(NBRLOLI) GO TO ISTOUT,(460,470) C THIS IS AN INTERNAL SUBROUTINE WHICH, GIVEN C NEXP = POSITIVE OR NEGATIVE INTEGER TO PLOT AS EXPONENT C IMAX 2 DIGITS PLUS SIGNI C NCONST = POSITIVE OR NEGATIVE INTEGER TO BE ADDED TO LABELS C (MAX 5 DIGITS PLUS SIGNI VORH 1.0 FOR VERTICAL, 0.0 FOR HORIZONTAL C C PLOTS THE SCALE CONVERSION FIELD IVERTICAL OR HORIZONTAL) AS FOLLOWS C IF NCONST = 0 IN MAGNITUDE THEN C A. NO CONVERSION FIELD IS PLOTTED IF NEXP IS ALSO 0 C B. IF NEXP = 1 IT PLOTS C (MULTIPLY INDICATED UNITS BY 10) NEXP C. OTHERWISE IT PLOTS C ) C IMULTIPLY INDICATED UNITS BY 10 C IF NCONST IS NON-ZERO IT PLOTS C (ADD NCONSTOOO TO UNITS AND A. IF NEXP = 0 IT ADDS A RIGHT I C C B. IF NEXP = 1 IT ADDS AND MULT BY 10) C C C. OTHERWISE IT ADDS NEXP C AND MULT BY 10 ) C C FIRST CHECK STRAIGHT EXIT FOR NCONST=NEXP=O 520 IF (NCONST) 531,522,531 522 IF (NEXPI 524,599,524 C NCONST IS ZERO. NEXP IS NOT. CHECK HOR OR VERT 524 IF (VORH) 528,526.528 C HORIZONTAL 526 CAll DISPLA PRINT 527 I MULTIPLY INDICATED UNITS BY 10) 527 FORMAT(46H2SH144,5. GO TO 542 C VERTICAL 528 CALL DISPLA PRINT 529 = * GRAPH •••••••••••••••••• * ••••• = = 0733 0734 0735 0136 0737 0738 0739 0740 0741 0742 0743 0744 0745 0746 0747 0748 0749 0750 0751 0752 0153 0754 D755 0756 0151 075B 0759 0160 0161 0162 0163 0164 0165 0166 0161 0168 0769 0110 0111 0112 0113 0114 0175 0116 0117 0118 0119 0180 0781 0182 0783 0184 0185 0186 0181 0188 0189 0190 0191 0792 0193 0794 0195 0196 0191 0198 0199 0800 0801 0802 0803 0804 0805 0806 0801 -_ •••••••....•...••..... * GRAPH PROGRAM LISTINGS • •••••••••••••••••••••••• •••••••••••••••••••••••• * GRAPH * •••••••••••••••••••••••• (PAGE 121 (PAGE 121 529 FORMAT(41H2SV11.120. I MULTIPLY INDICATED UNITS BY 101 GO TO 542 C NCONST IS NOT ZERO, CHECK HOR OR VER 531 IF IVORH) 531,532,531 C HORIZONTAL. CHECK NEXP = 0 532 IF INEXP) 535,533,535 533 CALL OISPLA PRINT 534,NCONST 534 FORMATI13H2SH250,5,(AOD,lI6,13HOOO TO UNITS)) GO TO 599 53.5 CALL DISPLA PRINT 536,NCONST 536 FORMAT(13H2SH144,5,(ADD,lI6,21HOOO TO UNITS AND MULT BY 101 GO TO 542 C VERTICAL WITH NCONST NOT O. CHECK NEXP 0 531 IF INEXP) 540,538,540 538 CALL OISPLA PRINT 539,NCONST 539 FORMAT(14H2SV11.300,IAOD.II6,13HOOO TO UNITS)) GO TO 599 540 CALL 01 SPLA PRINT 541,NCONST 541 FORMATI14H2SV11,120,IAOO,lI6,21HOOO TO UNITS AND MUtT BY 10) GO TO 542 C THIS PORTION OF THE INTERNAL ROUTINE FILLS IN THE RIGHT END C NEXP C OF SCALE FIELD I IF NEXP 1, ) OTHERWISE C INDTE PROGRAM ODES NOT GET HERE IF NEXP 01 C FIRST CHECK HORIlONTAL OR VERTICAL 542 IF IVORH) 583,548,583 C HORIZONTAL IUP TO STATEMENT 583) C CHECK NEXP = 1 554,512,554 548 IF INEXP-l) C FILL IN NEXP ACCORDING TO HOW MANY DIGITS INVOLVED (INCLUDING SIGNI 554 IF (NEXPI 556,558,558 C TWO OR THREE 556 IF INEXP+I0) 568,568,564 C ONE OR TWO 558 IF INEXP-I01 560,564,564 CONE OIGIT EXPONENT 560 CALL DISPLA PRINT 562,NEXP 562 FORMAT 110H2SH921,20"lI11 GO TO 572 C TWO DIGIT EXPONENT 564 CALL DISPLA PRINT 566,NEXP 566 FORMATII0H2SH921,20"lI21 GO TO 572 C THREE DIGIT EXPONENT 568 CALL DISPLA PRINT 570,NEXP 510 FORMAT 110H2SH921,20"lI31 C FILL IN RIGHT PAREN AND LEAVE 512 CALL DISPLA PRINT 514 514 FORMAT 110H2SH984,5,)) GO TO 599 C FILL IN EXPONENT BUSINESS FOR VERTICAL FIELD C CHECK FOR NEXP = 1 5B3 IF INEXP-11 5B5,594,5B5 C FILL IN NEXP ACCORDING TO NUMBER OF DIGITS 585 IF INEXP) 586,587,587 586 IF INEXP+I0) 593,593,592 587 IF INEXP-I01 590,592,592 C ONE DIGIT 590 CALL DISPLA PRINT 591,NEXP 591 FORMATII0H2SV61,897"lIl) GO TO 594 C TWO DIGITS 592 CALL DISPLA PRINT 5920,NEXP 5920 FORMATII0H2SV61,897"lI21 GO TO 594 = = = = = = 0808 0809 0810 0811 0812 0813 0814 0815 0816 0817 0818 0819 0820 0821 0822 0823 0824 0825 0826 0821 0828 0829 0830 0831 0832 0833 0834 0835 0836 0831 0838 0839 0840 0841 0842 0843 0844 0845 0846 0841 0848 0849 0850 0851 0852 0853 0854 0855 0856 0851 0858 0859 0860 0861 0862 0863 0864 0865 0866 0861 0868 0869 0810 0871 0812 0813 0814 0815 0816 0877 0818 0819 0880 0881 0882 • ••••••••••••••••••••••• • GRAPH PROGRAM LISTINGS * •••••••••••••••••••••••• •. *-...• * •••••••••• * •••• GRAPH *•••••••••••••••• *** •••••* (PAGE 13) C THREE DIGITS 593 CALL DISPLA PRINT 5930,NEXP 5930 FDRMATIlOH2SV6l,897 .. 1I3) C FILL IN RIGHT PAREN 594 CALL DISPLA PRINT 595 595 FORMAT (11H2SV71,960,)) C EXIT FROM INTERNAL SUBROUTINE 599 GO TO ISCOUT, (462,472) C THIS IS THE FRAME PLOTTING LOOP C C C C C C C C C C C C C C C C C SEQUENCE OF EVENTS IS PLOT TITlE PLOT PAGE NO. PLOT X AXIS IF IT OCCURS ON THIS FRAME PLOT BOX PLOT VERTICAL CHECK MARKS AND LA8ELS PLOT HORIZONTAL CHECK MARKS AND LABELS IF THERE IS DATA FOR SOLID CURVE A. GET AND SCALE DATA SU8SETS FOR THIS FRAME B. USE HSTPLT TO PLOT THEM IF THERE IS DATA FOR DOTTED CURVE A. GET AND SCALE DATA SU8SETS FOR THIS FRAME B. USE HSTPLT TO PLOT THEM IF MORE DATA, RESET, CALL FRAME, RETURN TO PLOT TITLE ABOVE IF NOT, EXIT IMPORTANT PARAMETERS OF THE FRAME LOOP (MOSTLY SCOPE UNITSI C VLPoS IS X COORD OF LEFT VERTICAL FLTG PT VRPOS IS X COORD OF RIGHT VERTICAL C HBPOS IS Y COORD OF BOTTOM LINE C HTPOS IS Y COORD OF TOP LINE C VUoRG IS Y COORD OF FIRST UNLABELED CHECK MARK ON VERTICAL AXIS (0.0 MEANS NONE) C C VUDEL IS Y INCREMENT OF UNLABELED CHECK MARK ON VERTICAL AXIS fO.O MEANS NONEI C C VLORG IS Y COORD OF FIRST LA8ELED CHECK MARK ON VERTICAL AXIS C VLDEL IS Y INCREMENT OF LABELED CHECK MARK ON VERTICAL AXIS C INTVL IS FIRST INTEGER TO LABEL CHECK MARK ON VERTICAL AXIS C HUoRG IS X COORD OF FIRST UNLABELED CHECK MARK ON HOR. AXIS{O.O MEANS C HUDEL IS X INCREMENT OF UNLABELED CHECK MARK ON HoR. AXIS(O.O MEANS NO C HLORG IS X COORD OF FIRST LABELED CHECK MARK ON HOR AXIS C HLDEL IS X INCREMENT OF LABELED CHECK MARK ON HoR AXIS C INTHL IS FIRST INTEGER TO LABEL CHECK MARK ON HOR AXIS C IPAGE IS PAGE NO TO PLOT (INIT=I) C IPGXZ IS THE PAGE NO. ON WHICH X=O OCCURS (NEG IF NONEI C XZER IS THE X COORD OF THE X=O LINE (ON PAGE IT OCCURS ON) C CONVK IS A CONVERSION CONSTANT C CONVL IS A CONVERSION CONSTANT WHERE DATA (SCOPE UNITS) = CONVK + (DATAl INPUT UNITS»)*CONVL C IARGUMENT) C NOPPP IS THE NUMBER OF PTS PER PAGE (FRAME) TO PLOT (ARGUMENT) C NN IS THE TOTAL NUMBER OF DATA PTS C NPLOTD IS THE NUMBER OF DATA POINTS PLOTTED SO FARllNITfALIZED TO ZERO C ICHANlll) = BUFFER BLOCK WHICH FEEDS HSTPLT DATA C IYSCLX = X COORD OF LEFT EDGE OF Y SCALE FIELD IN SCOPE UNITS C IXSCLY = Y COORD OF LOWER EDGE OF X SCALE FIELD IN SCOPE UNITS 1=1,4 = X1,Y1,X2,Y1 AXIS SPEC FOR HSTPLoi C HSToRGIl1 C AXIS = INDICATOR FOR HSTPL, =0.0 MEANS PLOT HOR AXIS, C NDELX = DELTA X FOR PLOT * 2**7 C NOPTP = NO OF POINTS TO PLOT ON EACH FRAME IINIT=MININoPPP,NNI C PLOT TITLE 200 IF ITITLE-DOLARSI 2006,2002,2006 2002 00 2004 1=1,8 J=9-1 2004 HOLERIJI=TITLEII+327601 GO TO 2010 2006 00 2008 1=1,8 2008 HOLER(II=TITLEIII 2010 CALL DISPLA PRINT 202, 'HoLER(II,I=1,81 202 FORMAT (10H2SH5,1000,8A6) CPLOT PAGE NO. CALL DISPLA PRINT 203, IPAGE C C (PAGE 131 0883 0884 0885 0886 0881 0888 0889 0890 0891 0892 0893 0894 0895 0896 0897 0898 0899 0900 0901 0902 0903 0904 0905 0906 0907 0908 0909 0910 0911 0912 0913 0914 0915 0916 0911 0918 0919 0920 0921 0922 0923 0924 0925 0926 0921 0928 0929 0930 0931 0932 0933 0934 0935 0936 0937 0938 0939 0940 0941 0942 0943 0944 0945 0946 0947 0948 0949 0950 0951 0952 0953 0954 0955 0956 0957 ••• ** ••• **** ••• ***.***** GRAPH •*****.** • •••• ** •••••••••• PROGRAM II STINGS _ ••••••••••••••••••••• ** • GRAPH • • •••• ** ••••••• * ••••••••• IPAGE 14) 203 FORMAT 112H2SHl,55,PAGE,ll41 C IF X AXIS OCCURS ON THIS PAGE, PLOT IT ALONG WITH CHECK MARKS (UNlABEl IF IIPAGE-IPGXZI 209,204,209 C AXIS 204 CALL LINE IXZER,HBPOS,XZER,HTPOSI IF IVUORGI 205,207,205 C UNLABELED 205 TEMPl=VUORG TEMP2=XZER-5.0 TEMP3=XZER+5.0 206 CALL LINE ITEMP2,TEMPl,TEMP3,TEMPll TEMPl=TEMPl+VUDEL IFITEMPI-HTPOSI 206,206,201 C LABELED CHECKS PLOTTED WITHOUT LABELS 207 TEMPl=VLORG TEMP2=XZER-IO.0 TEMP3=XZER+8.0 208 CALL LINE ITEMP2,TEMPl,TEMP3,TEMPl1 TEMPl=TEMPl+VLOEL IF ITEMPI-HTPOS) 208,208,209 C PLOT BOX 209 CALL LINEIVLPOS,H8POS,VLPOS,HTPOS) CALL LINEIVLPOS,HTPOS,VRPOS,HTPOSI CALL LINEIVRPOS,HTPOS,VRPOS,HBPOSI CALL LINEIVRPOS,HBPOS,VLPO$,HBPOSI C PLOT UNLABELED CHECK MARKS ON VERTICAL AXIS IF THERE ARE ANY IF IVUORGI 210,220,210 210 TEMPl=VUORG TEMP2=VLPOS+IO.0 TEMP3=VRPOS-IO.0 212 CALL LINEIVLPOS,TEMPl,TEMP2,TEMPll CALL LINEITEMP3,TEMPl,VRPOS,TEMPl1 TEMPl=TEMPl+VUDEL IF ITEMPI-HTPOS) 212,212,220 C PLOT LABELED CHECK MARKS ON VERTICAL AXIS AND LABELS 220 TEMPl=VLORG TEMP2=VLPOS+20.0 TEMP3=VRPOS-20.0 ITEMPl=I NTVL 222 CALL LINEIVLPOS,TEMPl,TEMP2,TEMPII CALL LINEITEMP3,TEMPl,VRPOS,TEMPll ITEMP2=TEMPI-IO.0 CALL OSPFMT (3H2SH,IYSCLX,ITEMP2,4H lI4,FMTI CALL DISPLA PRINT FMT,ITEMPI TEMPl=TEMPl+VLDEL ITEMPl=I+ITEMPl 222,222,230 IF(TEMPI-HTPOSI C PLOT UNLA8ELED CHECK MARKS ON HORIZONTAL AXIS IF THERE ARE ANY 230 IF (HUORG) 232,240,232 232 TEMPl=HUDRG TEMP2=HBPOS-I0.0 TEMP3=HTPOS-IO.0 234 CALL LINE(TEMPl,TEMP2~TEMPl,H8POSl CALL LINE (TEMPl,TEMP3,TEMPl,HTPOSI TEMPl=TEMPl+HUDEL IF (TEMPI-VRPOSI 234,234,236 C RESET CHECK MARK ORIGIN FOR NEXT FRAME 236 HUORG=TEMPI-VRPOS+VLPOS C PLOT LABELED CHECK MARKS ON HORIZONTAL AXIS AND LABELS 240 TEMPl=HLORG ITEMPl=INTHL TEMP2=HBPOS-I0.0 TEMP3=HRPOS+20.0 TEMP4=HTPOS-20.0 242 CALL LINE (TEMPl,TEMP2,TEMPl,TEMP31 CALL LINEITEMPl,TEMP4,TEMPl,HTPOS) ITEMP2=TEMPl+8.0 CALL DSPFMT(iH2SV,ITEMPZ,IXSCLY,4H lI4,FMTI CALL DISPLA PRINT FMT,ITEMPI ITEMPl=l+ITEMPl TEMPl=TEMPl+HLDEL IF (TEMPI-VRPDS) 242,242,2S0 C RESET CHECK MARK ORIGIN AND INTEGER LA8EL FOR NEXT FRAME IPAGE 141 0958 0959 0960 0961 0962 0963 0964 0965 0966 0967 0968 0969 0970 0971 0972 0973 0974 0975 0976 0977 0978 0979 0980 0981 0982 0983 0984 0985 0986 0987 0988 09B9 0990 0991 0992 0993 0994 0995 0996 0997 0998 0999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 •• * ••••••••••••••••••••• • GRAPH * •••••••••••••••••••••••• (PAGE 151 250 PROGRAM LtSTINGS .......................... • GRAPH • •••••••••••••••••••••••• HLORG=TEMPI-VRPOS+VLPOS I NTHL=ITEMPI C IF THERE IS DATA FOR SOLID PLOTS, PLOT THEM ONE AT A TIME C PUTTING AXIS ONLY ON FIRST ONE IAXIS PLOT FOR AXIS=O.OI 261 NSOL=O TYPE=O.O C INDEX FOR NEXT SERIES 262 NSOL=NSOL+l C EXIT WHEN HIT ZERO ADDRESS IFIISOL(NSOLII 4,270,2630 C SET SERIES ADDRESS 2630 ISRCE=ISOLINSOLI-NPLOTD C SET AXIS OR NOT (FIRST ONLYI IF INSOL-l1 264,263,264 263 AXIS=O.O GO TO 265 264 AXIS=1.0 265 ASSIGN 266 TO IPLTEX GO TO 290 266 GO TO 262 C IF THERE IS DATA FOR DOTTED PLOTS, PLOT, THEM ONE AT A TIME C PUTTING AXIS ONLY ON FIRST ONE ANO ONLY IF NO SOLID PLOTS WiRE MADE 270 NOOT=O TYPE=I.0 272 NDOT=NDOT+l IF IIOOTINOOT)I 4,260,273 273 ISRCE=IDOTINDOT)-NPLOTD IFIISOL(lll 277,275,277 275 IF INOOT-ll 277,276,277 276 AXIS=O.O GO TO 276 277 AXIS=1.0 278 ASSIGN 279 TO IPLTEX GO TO 290 279 GO TO 272 C SEE IF THERE IS MORE DATA YET TO PLOT 1300 IS NO) 280 NPLDTO=NPLOTO+NOPPP C INDEX THE PAGE NUMBER BY 1 IPAGE=IPAGE+l IPAGE=XMODFIIPAGE,10001 IF INPLOTD-NN) 2B2,300.300 C IF MORE TO PLOT SET SO FIRST POINT ON NEXT FRAME WILL BE C SAME AS LAST POINT ON PRESENT FRAME 262 NPLOTO=NPLOTO-1 C RESET NO OF POINTS TO BE PLOTTED ON NEXT FRAME I=NOPPP UNLESS NEXT IS NOPTP=NOPPP IF INPLOTD+NOPPP-NN) 286,266,264 264 NOPTP=NN-NPLOTD C READJUST INDEX FOR FIRST BAR ON NEXT FRAME ITEMPl=IFRSTB 2640 ITEMPl=ITEMPl+ISKIP6 IF IITEMPI-NOPPPI 2840,2641,2641 2841 IFRSTB=ITEMPI-NOPPP+l C INDEX THE FILM AND RETURN TO PLOT TITLE ON NEXT FRAME 266 CALL FRAME GO TO 200 C THIS IS AN INTERNAL SU8ROUTINE W.HICH MOVES THE NEXT BLOCK OF C DATA FROM A SPECIFIED SERIES INTO THE SPACE BLOCK ANd C SCALES IT FOR PLOTTING. THEN IT PLOTS IT. ISRCE DEFINES DATA. C TYPE=O.O FOR SOLID, 1.0 DOTTED. AXIS=O.O FOR AXIS,=1.0 NO AXIS~ 290 ISP=XLOCF ISPACE) CALL MVBLOKINOPTP, ISRCE,.ISPI CGO SCALE DATA AND THEN PLOT IT CALL SCPSCL(SPACE,NOPTP,YTOP.YBOT,CONVK,CONVLI CALL HSTPLTINOPTP,SPACE,HSTORG,NDELX,TYPE,AXIS,IFRSTB,ISKIPBI GO TO IPLTEX, 1266,279) C FINAL EXIT 300 SPACEIlI=O.O 310 RETURN END IPAGE 151 1033 1034 1035 1036 1037 1036 1039 1040 1041 1042 1043 1044 104~ 1046 1047 1046 1049 1050 1051 1052 1053 1054 1055 1056 1057 1056 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1061 1062 1083 1084 1065 ID86 1061 1066 1089 1090 1091 1092 1093 1094 1095 1096 1091 1098 1099 1100 1101 1102 •••••••••••••••••••••••• GRAPHX * •••••••••••••••••••••••• . PROGRAM LISTINGS ..• ••••••••••••••••••••••• .. GRAPHX •••••••••••••••••••••••• .. GRAPHX (SUBROUTINE) 9/29/64 LAST CARD IN DECK IS NO. .. LABEL CGRAPHX SUBROUTINE GRAPHX(ISOL,IDOT,N,TITLE,YUNITS,XUNITS,YTOP,YBOT, 1 XMAX,XMIN,NOPPP,IPAGE,SPACE,NFRMlV) C C ----ABSTRACT---C C TITLE - GRAPHX C SUBROUTINE GRAPH EXPANDED OVER ARBITRARY NO. OF VERTICAL FRAMES C C GRAPHX IS FUNCTIONALLY IDENTICAL TO SUBROUTINE GRAPH, C EXCEPT THAT THE PLOTS ARE EXPANDED OVER AN ARBITRARILY C SPECIFIED NO. OF FRAMES, NFRMlV, IN THE VERTICAL C DIRECTION. (THE HORIlONTAL SCALE IS UNMODIFIED.) C C GRAPHX HAS 14 ARGUMENTS. THE FIRST 13 OF THESE ARE C EQUIVALENT TO THE 13 ARGUMENTS OF GRAPH, AND THE 14TH C ARGUMENT IS NFRMlV. THE ARGUMENT VTOP NOW REFERS TO THE UPPER EOGE OF THE TOP ROW OF FRAMES, AND YBOT NOW C C REFERS TO THE LOWER EOGE OF THE BOTTOM ROW OF FRAMES. C C LANGUAGE - FORTRAN II SUBROUTINE C EQUIPMENT - 109 OR 1090 IMAIN FRAME AND SCOPEI C STORAGE - 123 REGISTERS C SPEED - TAKES MAXIMUM OF NFRMlV TIMES AS LONG AS GRAPH C AUTHOR - S.M. SIMPSON, APRIL 1963 C C ----USAGE---C C TRANSFER VECTOR CONTAINS ROUTINES - GRAPH,FRAME C AND FORTRAN SYSTEM ROUTINES - NONE C C FORTRAN USAGE C CALL GRAPHXIISOL,IDOT,N,TITLE,YUNITS,XUNITS,YTOP,YBOT, C 1 XMAX,XMIN,NOPPP,IPAGE,SPACE,NFRMlV) C C INPUTS C C ISOL,IDOT, ••• ,SPACE HAVE SAME MEANING AS FOR GRAPH EXCEPT YTOP C AND YBOT ARE AS DESCRIBED IN ABSTRACT. C C NFRMlV C C C OUTPUTS C C C SPACE(ll 0153 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 001B 0019 0020 0021 0022 0023 0024 0025 0026 0021 0028 0029 0030 0031 0032 0033 0034 0035 0036 0031 0038 0039 0040 OM1 IS THE DESIRED NO. OF VERTICAL FRAMES MUST EXCEED lERO AND BE LESS THAN 101 OUTPUTS ARE SIMILAR TO THOSE OF GRAPH WITH ONE ADDITIONAL ERROR FLAG. = 2. IF NFRMlV IS ILLEGAL. 0042 0043 0044 0045 0046 0041 0048 C OM9 C EXAMPLES C C 1. SHOWING FOUR VECTORS PLOTTED ACROSS 4 FRAMES VERTICALLY. C C USAGE DIMENSION Y116001,Y216001,Y316001,Y4(600),ISOLI41 C DIMENSION IDOTI21,SPACE(3001 C PI2 = 2.0*3.14159265 C DO 10 1=1,600 C FLI = FlOATFII) YIIII = .75 + .10*COSFIFLI*PI2/10.) C C Y2111 -.1 + FLI/250. C Y3(1) = (1.0-FLI/650.I*COSFIFLI*PI2/150.1 C 10 Y4111 = -.75 C DO 20 1=426,549 C 20 Y41 II -.2 C ISOLIlI XLOCFIYlI C ISOL(2) XLOCF(Y21 C ISOLI31 XLOCF(Y41 C ISOLl41 0 C IDOT( 11 XLOCFIY31 C lOOT( 21 0 C IPAGE = 1 C CALL GRAPHXIISOL,100T,600, C 154H$$$$$$THIS IS THE TITLE AREA IN THE EXAMPLE OF G C 2RAPHX , 0050 0051 0052 0053 0054 0055 0056 0057 005B 0059 0060 0061 0062 0063 0064 0065 0066 0067 006B 0069 0070 0071 0072 0073 0074 = • ••••••••••••••••••••••• • GRAPHX .. PROGRAM LI STI NGS •••••••••••••••••••••••• (PAGE ..• **.*.**** •• ** ••• . .._ ••• _.GRAPH X •• - •••••••••• * ••• -.*~* (PAGE 21 C 348H$$$$$$ YUNITS AREA IN THE ILLUSTRATION OF GRAPHX C C C 4, C 548H$$$$$$ XUNITS AREA IN THE ILLUSTRATION OF GRAPH X 6, 1 1.2,-.8,600.,0.,201,IPAGE,SPACE,41 C C C C OUTPUTS - TWELVE FRAMES ARE PRODUCED WHICH WHEN CUT AND PASTED TOGETHER APPEAR AS SHOWN 8ELOW. 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 PROGRAM FOLLOWS BELOW. C C CHECK NFRMlV IF (NFRMlVI 20,20,10 10 IF (NFRMlV-I001 30,30,20 20 SPACE" 2.0 GO TO 9999 C SET UP YTP,Y8T, DELY FOR LOOP 30 DELY" IYTOP-Y80TI/FLOATFINFRMlVI YTP " YTOP YBT " YTP-DELY C PRODUCE NfRMlV ROWS OF OUTPUT 00 10 I"l,NFRMlV CALL GRAPH(ISOL,IDOT,N,TITLE,YUNITS,XUNITS,YTP,YBT, 1 XMAX,XMIN,NOPPP,IPAGE,SPACEI IF (I-NFRMlVI 60,10,10 60 CALL FRAME YTP YTP-DELY YBT = Y8T-OElY 0015 0016 0011 0018 0019 0080 0061 0082 0083 0084 0085 0086 0061 0068 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 21 ••••••••••••••••••• * •• ** GRAPHX •••• * •••••• ** •••• *** •••••* (PAGE 3) PROGRAM LISTINGS •••• ** ••••••••• ** ••••••• • GRAPHX • •••••••••••••••••••••••• (PAGE 3) 70 CONTINUE C EXIT 9999 RETURN END 0150 0151 0152 0153 •••••••• * •••••• ** ••••••• GRUP2 * •••••••••••••••••••••••• • PROGRAM LISTINGS ~ • ••••••••••••••••••• *.* • GRUP2 * •••••••••••••••••••••••• • GRUP2 (SUBROUTINE) 10/1/64 LAST CARD IN DECK IS NO. • LABEl CGRUP2 SUBROUTINE GRUP2 IP,NDELX,DELX,XLO,YLIM,NWANT,IANSI C C ----ABSTRACT---C C TITLE - GRUP2 C DIVIDES THE X AXIS INTO EQUALLY PROBABLE RANGES C C GRUP2 PERFORMS A PROCESS KNOWN AS THE PROBABILITY C TRANSFORMATION WHEREBY A GIVEN PROBABILITY DENSITY IS C TRANSFORMED INTO A RECTANGULAR DENSITY. C THE PRINCIPAL INPUT IS A HISTOGRAM-TYPE PROBABILITY C C DISTRIBUTION FUNCTION PII).I=l ••• NDELX, WHERE PIll = C PROBABILITY DENSITY FOR THE RANDOM VARIABLE X FALLING IN C THE I-TH RANGE OF X VALUES, WHERE ALL RANGES ARE OF EQUAL C LENGTH DELX, AND THE LOWEST RANGE IS FROM XLO TID XlO+DELX. C C GRUP2 DIVIDES THE X AXIS INTO NWANT RANGES FROM XLO TO C NDELX*OELX+XLO, EACH RANGE HAVING EQUAL PR06ABItlTY DELP. C DELP=I./FLOATFINWANT). GRUP2 RETURNS THE X VALUES C CORRESPONDING TO THE RANGES. THE DIVISION IS MADE BY C INTEGRATING THE PROBABILITY DISTRIBUTION ALONG tHE X AXIS~ C LINEAR INTERPOLATION IS MAOE WHEN AN INTEGER MULTIPLE OF C IINWANT LIES BETWEEN SUM UP TO J ANO J+l OF IPII)*OELX). C C LANGUAGE - FORTRAN II SUBROUTINE C EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) C STORAGE - 201 REGISTERS C SPEED C AUTHOR - J.N. GALBRAITH C C ----USAGE---C C TRANSFER VECTOR CONTAINS ROUTINES - NONE C AND FORTRAN SYSTEM ROUTINES - NONE C C FORTRAN USAGE C CALL GRUP2 IP,NDELX,DELX,XLO,YLIM.NWANT.IANSl C C INPUTS C C PII) I=l ••• NDELX IS THE PROBABILITY DISTRIBUTION DEFINED C FROM XLO TO NDELX*DELX+XLO ANO NORMALIZED SUCH THAT C THE SUM FROM 1=1 TO NDELX OF PII)*DELX =1. IF PIll C IS NORMALIZED SUCH THAT SUM CPIII) LESS THAN 1. 6Y MORE C THAN .00001, AN ERROR MAY OCCUR WiTH IANS=-4. IF PII) C IS NORMALIZED SUCH THAT SUM (PIll) GRTHN 1., THE YLIM C WILL BE COMPUTED IN THE USUAL MANNER WITH NORMALIZATION C ASSUMED = 1.0 • C C XLO IS LOWEST VALUE OF X FOR WHICH PIll IS DEFINED. C DELX IS THE INCREMENT IN X. C C MUST BE GRTHN O. C C NDELX IS THE NUMBER OF INCREMENTS. C MUST BE GRTHN 1. C C NWANT IS THE NUMBER OF EQUALLY LIKELY DIVISIONS WANTED. C MUST BE GRTHN 1. C C OUTPUTS C C YLIMIIl 1=1 ••• NWANT+1 IS THE VECTOR OF X VALUES WHICH C CORRESPOND TO EQUALLY LIKELY PROBABILITY DIVIS!ONS. C IYLIMIl)=XLO). IYLIMCNWANT+11=XLO+FLOATFINDELX}*DELX). C ClANS 0 NORMAL C -1 ILLEGAL NDELX C -2 ILLEGAL OELX C -3 ILLEGAL NWANT 0140 0001 0002 0003 00" 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 001B 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 00~1 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 .•••••••••••••••••••••••• ••••••••••••••••••••••••* •••• * ••••••••••••••••••• PROGRAM LI STINGS GRUP2 IPAGE .. GRUP2 IPAGE C -4 WEIRD ERROR (P PROBABLY NOT PROPERLY NORMALIZED) C C EXAMPLES C C 1. INPUTS - ALL P=O. NoELX=1 oELX=O. XlOsO. NWANT-O C OUTPUTS - ERROR IANS = -1 C C 2. C C INPUTS - SAME AS EXAMPLE 1. EXCEPT NoElX=20 OUTPUTS - ERROR IANS=-2 C 3. INPUTS OUTPUTS C SAME AS EXAMPLE 2 EXCEPT oElX=.05 ERROR IANS=-3 NWANT=l C C 4. INPUTS - Pll ••• 20) = 1.,.7,.5,1.3,2.,1.9,.6,.5,.4,.3,.2 •• 111.5, C 1.5,1.5,1.5,1.5,.5,.5,2. NoElX=20 oElX=.05 C XlO=O. NWANT=5 C OUTPUTS - YlIMll, ••• ,6) = 0.,.2125,.35,.68333,.81666.1. C C 5. INPUTS C OUTPUTS C SAME AS EXAMPLE 4. EXCEPT XLO=20. YLIMll, ••• ,61 = 20.,20.2125,20.35,20.68333,20.81666,21. IANS=O C C 6. INPUTS OUTPUT C C - SAME AS EXAMPLE 5. EXCEPT oElX=.0005 - ERROR IANS=-4 C 7. INPUTS - SAME AS EXAMPLE 5. EXCEPT oELX=100. OUTPUTS - YlIM(1, ••• ,6) = 20.,20.2,20.4,20.6,20.8,20.20 C C DIMENSION P(2001,YLIMI2011 CHECK NoELX IANS=-l IFINoELX-ll 9999,9999,5 CHECK oELX C 5 lANS=-2 IFloElXI 9999,9999,10 NUMl=NWANT-l 10 IANS=-3 IF(NUMl1 9999,9999,20 20 YllMlll=XLO YlIMINWANT+ll=XLO+FLOATFINoELXI*oELX DElP=l./FlOATFINWANTI PTEST=DELP ISTART-l SUM=O IANS=O DO 100 J=l,NUMl DO 50 I=ISTART,NDElX DEL TA=PII I *DElX SUM=SUM+OEl TA IF ISUM-.99999*PTESTI 50,60,70 50 CONTINUE C ERROR- USED ALL P WITHOUT FINDING ALL YliM. GO TO 9777 60 YLIMIJ+11=FlOATFIII*DElX+XLO ISTART=I+l GO TO 90 INTERPOLATE C 70 SUM=SUM-DELTA FRACTX=IPTEST-SUM)/DElTA YLIMIJ+ll=IFLDATFII-11+FRACTXI*DELX+XLO I START= I 90 PTEST=PTEST+DElP 100 CONTINUE 9999 RETURN 9777 IANS=-4 GO TO 9999 END C .. • ••••••••••••••••••••••• 21 IANS=O 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 21 •••••••••••••••••••••••• HAlVl • ••••••••••••••••••••••••• REFER TO DU8lX •••••••••••••••••••••••• HALVX * •••••••••••••••••••••••• • REFER TO DU8LX PROGRAM II STINGS •••••••••••••••••••••••• HAlVl • •••••••••••••••••••••••• • REfER TO DUBLX •••••••••••••••••••••••• • HALVX • •••••••••••••••••••••••• REfER TO DUBLX •••••••••••••••••••••••• .* HlADJ •••••••••••••••••••••••• .. HLAOJ .*HlAOJ FAP (FUNCTION) PROGRAM lISTINGS •••••••••••••••••••••••• II HlAD.J .. ••••••••••••••••••••• * •• LAST CARD IN DECK IS NO. 0110 0001 0002 COUNT 100 0003 LBl HLAOJ 0004 ENTRY HLADJ FIHOLl 0005 ENTRY HRAOJ f(HOll 0006 0007 " ----ABSTRACT---OOOB " 0009 " TITLE - HLADJ WITH SECONDARY ENTRY HRADJ 0010 " HOLLERITH LEFT ADJUST OR RIGHT ADJUST FUNCTION 0011 0012 " HLADJ SHIFTS ITS HOLLERITH ARGUMENT lEFTWARDS UNTil THE 0013 0014 LEADING CHARACTER IS NON-BLANK. SPACES ARE INSERTED IN " POSITIONS VACATED. NO ACTION IF ARGUMENT IS A~L SPACES. 0015 " 0016 HRADJ IS THE RIGHT SHIFTING ANALOG OF HlAOJ. 0017 0018 "" LANGUAGE - fAP FUNCTIONS (FORTRAN-II COMPATIBLE) 0019 " EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0020 .. STORAGE - 46 REGISTERS 0021 .. SPEED 0022 S.M. SIMPSON JR., SEPTEMBER 1963 0023 " AUTHOR 0024 " ----USAGE---0025 " 0026 .. TRANSFER VECTOR CONTAINS ROUTINES - (NONE) 0027 • AND FORTRAN SYSTEM ROUTINES - (NONE) 0028 0029 0030 " fORTRAN USAGE " HOLADJ HlADJF(HOL) 0031 " HOLADJ = HRADJF(HOLJ 0032 0033 0034 " INPUTS 003!> " HOL 6 HOLLERITH IN FORMAT(lA61 0036 " 0037 ".. OUTPUTS 0038 0039 • HOLADJ LEFT OR RIGHT AOJUSTED FORM OF HOL 0040 0041 0042 • EXAMPLES 0043 0044 • 1. INPUTS - HOL1 = HOL4 = 6HABCDEF, HOL3 = HOL6 6H .. HOL2 = 6H BC DE, HOL5 = 6HAB DE , 0045 0046 • USAGE H1 HLADJF(HOL11 0047 • HZ HLAOJF(HOL21 .. H3 HlAOJF(HOL31 0048 H4 HRAOJFIHOL41 0049 " 0050 • H5 HRADJFIHOL51 0051 • H6 HRAOJFIHOL6J "OUTPUTS - Hi 6HABCDEF H2 5HBC EF H3 = 6H 0052 • H4 6HABCDEF H5 = 6H AB DE H6 = 6H 0053 .. PROGRAM FOLLOWS BELOW 0054 0055 • " NO TRANSFER VECTOR 0056 HTR 0 XR4 0057 BCI l,HLADJ 0058 • PRINCIPAL ENTRY. HLADJ FIHOLI 0059 HLADJ STZ IIFHL 0060 TRA SETUP 0061 " SECOND ENTRY. HRADJ FIHOll 0062 HRADJ SXA ZIFHL,4 0063 • FIRST SPREAD OUT THE 6 CHARACTERS, THEN BRANCH ON ENTRY 0064 SeTUP SXD HLADJ-2,4 0065 STO HOL 0066 XCA 0067 AXT 6,4 0068 PXA PXA 0,0 0069 LGL 6 0070 C+1,4 SLW 0071 PXA,4,1 T1X 0072 LOO HOL RESTORE HOL 0073 lET IIFHL 0074 . . .. . . . .. . 9/29/64 -. ........................ •••••••••••••••••••••••• PROGRAM LISTINGS HlADJ (PAGE "•••••••••••••••••••••••• (PAGE 21 TRA RADJ • LEFT ADJUST SEQUENCE 6,4 AXT C+l,4 CALHL CAL LAS SPACE TRA "+2 TRA RQL6 TRA LEAVE RQL6 RQL 6 TIX CALHl,4,l TRA LEAVE • RIGHT ADJUST SEQUENCE 1,4 RADJ AXT C+l,4 CALHR CAL LAS SPACE TRA "+2 RQL30 TRA TRA LEAVE RQL30 RQL 30 TXI "+1,4,1 CALHR,4,6 TXL " EXIT LEAVE XCA LXD HLADJ-2,4 TRA 1,4 " CONSTANTS, TEMPORARIES SPACE OCT 000000000060 lIFHL PZE "" PZE •• PZE PZE •• PZE ". PZE PZE C •• •• , •• ,** HOL PZE END •• •• •••••••••••••••••••••••• HLADJ • (GETS Cl FIRST) (GETS C6 FIRST) RESUl T TO AC ""=0 IF HLADJ. NON-ZERO IF HRADJ Cl (LEFTMUST CHARACTER) C2 C3 C4 C5 C6 0015 0076 0017 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 21 •••••••••••••••••••••••• •... _..HRADJ -..... _._*_._._._.• REFER TO HLADJ PROGRAM LISTINGS ••••••••••••••• * •••••••• • HRADJ • .._.... _.. -............ . REFER TO HLADJ •••••••••••••••••••••••• HSTPlT • •••••••••••••••••••••••• • PROGRAM LISTINGS •••••••••••••••••••••••• • HSTPLT • •••••••••••••••••••••••• 9/29/64 LAST CARD IN DECK IS NO. 0345 • HSTPLT ISUBROUTINEI 0001 • FAP .HSTPLT 0002 COUNT 350 0003 0004 HSTPLT LBL ENTRY HSTPLT ILNY.NY,ORG.NDELX.DOT.AXIS.IFRSTB.ISKIPBI 0005 0006 • ---ABSTRACT---0007 • 0008 • 0009 • TITLE - HSTPLT 0010 • HISTOGRAM PLOTTING FOR SUBROUTINE GRAPH 0011 • HSTPLT PLOTS THE INPUT DATA AS A HISTOGRAM OF SOLID OR 0012 • DOTTED LINES. A POINT IS THUS REPRESENTED AS A HORIZONTAL 0013 • 0014 LINE OF LENGTH NDELX/128 SCOPE UNITS. THE FIRST AND LAST • POINTS ARE 1/2 THIS LENGTH. THE ENDS OF THE HORIZONTAL 0015 • BARS ARE CONNECTED WITH VERTICAL LINES TO MAKE THE 0016 • 0017 HISTOGRAM. • 0018 • 0019 IF DESIRED. AN X AXIS WITH SHORT VERTICAL BARS AT • REGULAR INTERVALS IS PLOTTED. THE INDEX OF THE FIRST BAR 0020 • AND THE SPACING OF THE BARS ARE CONTROLLED 8Y INPUT 0021 • ARGUMENTS. 0022 • 0023 • 0024 • 0025 • LANGUAGE - FAP. SUBROUTINE IFORTRAN II COMPATIBLE! 0026 • EQUIPMENT - 709. 7090 WITH SCOPE 0027 - 145 DECIMAL REGISTERS • STORAGE - FAST 10PTIMUM) 0028 • SPEED 0029 - J.N. GALBRAITH 5/16/62 • AUTHOR 0030 • ----USAGE---0031 • 0032 •• TRANSFER VECTOR CONTAINS ROUTINES - LINEH. LINEV 0033 0034 • AND FORTRAN SYSTEM ROUTINES - NONE 0035 • 0036 • FORTRAN USAGE 0037 • CALL HSTPLTILNY.NY,ORG,NDELX,DOT,AXIS.IFRSTB,ISKIPB) 0038 • 0039 • INPUTS 0040 • I=I ••• LNY ARE FORTRAN II INTEGER DATA POINTS StALED FOR 0041 NYIII • SCOPE PRESENTATION. 0042 • MUST 8E GRTHN=O, LSTHN 1024 0043 • 0044 • 0045 LNY IS FORTRAN II INTEGER • SHOULD BE LSTHN 200 FOR GOOD RESOLUTION 0046 • 0047 • 1=1 ••• 3 ARE FLOATING POINT NUMBERS GIVING THE ~,Y 004B ORGIll • COORDINATES OF THE AXIS AND THE X COORDINATES OF THE 0049 • 0050 PLOTTED NY SERIES, ALL IN SCOPE UNITS • 0051 ORGl11=LEFT X COORDINATE OF AXIS • THE FIRST HORIZONTAL IHALFI BAR, CORRISPONDING 0052 • 0053 TO NY111, IS PLOTTED SO ITS LEFT EDGE HAS X • 0054 COORDINATE = ORGIll • 0055 ORGI21=Y COORDINATE FOR AXIS • 0056 ORGI31-RIGHT X COORDINATE OF AXIS • 0057 • 0058 THE SPACING, IN SCOPE UNITS, BETWEEN SUCCESSIVE DATA NOel X • 0059 POINTS MULTIPLIED BY 12 •• 11 • 0060 IS FORTRAN II INTEGER • 0061 • 0062 =0. SOLID LINES PLOTTED DOT • 0063 NOT=O. DOTTED LINES PLOTTED • 0064 • 0065 =0. AXIS AND CROSSBARS ARE PLOTTED AXIS • 0066 NOT=O. NO AXIS IS PLOTTED • 0067 • 0068 IS THE INDEX OF THE FIRST DATA POINT FOR WHICH A IFRSTB • 0069 CROSSBAR IS PLOTTED ON THE AXIS • 0070 IS FORTRAN II INTEGER • 0071 • 0072 IS THE NUMBER OF INDICES WHICH ARE SKIPPED BETWEEN THE ISKIPB • 0073 PLOTTED CROSSBARS • •••••••••••••••••••••••• HSTPLT • •••••••••••••••••••••••• PROGRAM LISTINGS • IPAGE 2) • • • • • •• OUTPUTS • • • DATA PLOTTED ON SCOPE EXAMPLES 1. INPUTS - NYll ••• 101-l00.100,lOO.100.100,lOO.100.100.100.100 LNY=lO ORGll ••• 3)=10.,20.,1010. NDElX=101.2.~7 DOT=O. AXIS=O. IfRSTB=3 ISKIPB=2 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT NYII ••• I01=100,180,260.340.420.50a,580.660.740.820 IFRSTB=l ISKIPB a l • • • •••••••••••••••••••••••• IS FORTRAN II INTEGER • • •• -.••.•...•••.........•.. HSTPlT • • OUTPUTS - fOR EXAMPLES 1 AND 2. IPAGE 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 1 00 01 0102 0103 0104 0105 0106 0107 0108 0109 0110 • • • •• OHI 3. INPUTS - SAME AS EXAMPLE 1. EXCEPT NYl1 ••• 10J=100.108.132,172.228,300,388.484.61Z.748 OOT=I. AXIS=l. • 4. INPUTS • • - SAME AS EXAMPLE 1. EXCEPT NYll ••• 101=100.101.108.l27.164.Z25.316,443.612.829 AXIS=I. • • • • 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 01Z2 0123 2) ••••• ***.* •••••••••••••• - PROGRAM LI STI NGS HSTPlT "•••••••••••• ** •••••••••• (PAGE 3) • •••••••• *** ••••••••••••• .. HSTPlT (PAGE OUTPUTS - FOR EXAMPLES 3 AND 4. •" " " ".. " 5. INPUTS " "" 6. INPUTS " " • .. .. " " " " " * "" - SAME AS EXAMPLE 1. EXCEPT NY(I ••• 10)=100,200,200,300,300,500,50,60,1000.10 OUTPUTS - FOR EXAMPLES 5 AND 6. * -." " " " " " * " " " " PZE BCI HSTPLT SXA AXIS-I, - NYll ••• 100)-500,500,500.500,500,500,500,500,500,500. 500,450,400,350,300,250,200,150,100, 50, 0, 10, 40, 90.160,250,360.490,640,810. 1000,999,992,913,936,815,784,651,488,271. 0, 6. 25, 57, 95,146,206,213,345.421, 500.579,655,127,194,854,905,943,91',994, 1000,024,042,119,092,482,054,272,048,325, 865,661,432,112,346,178,931,625,511,627, 301,755,427,874,444,977,383,988,218,512, 290,402,491,269,463,885,423,639,198,363 lNY-I00 ORGll •• 31=10.,20.,10l0. NOElX=10-2.*7 OOT=O. AXIS=I. " " " " " " " " " " " " " I,HSTPlT BACK,1 • ** ••• ** •••••••• *** •••••• 0124 0125 0126 27 2B 0129 0130 0131 0132 0133 0134 0135 36 131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0170 0111 0112 0173 0114 0115 0116 0177 0178 0119 0180 0181 0182 0183 0184 0185 0186 0181 0188 0189 0190 0191 0192 0193 0194 0195 0196 0191 0198 3) •••• *** ••••••••••••••••• HSTPL T * ••••••••••••••• * •••••• ** (PAGE 41 - SXA SXD lETTRA CLA STO RET CLA ADO STA CLA* SUB STD ADO SUB* STD CLA STO CLA* ARS STO AXT ORl CLA UFA ANA ALS STO TlX CLA* TNZ TSX PlE PlE PZE PZE CLA ADD STO LXA CLA* SUB XCA MPY ALS AOO STO CLASTD XCA MPY ALS STO AXT TRA BAR CLA ADD STO START TSX PlE PlE PZE PZE INDEX TXI TXL NOAX LXA CLA ARS STO ADD STO CLA STO CLA STA STA AOO BACK+ 1,4 HSTPLT-2,4 5,4 DOT THREE MOOE 3,4 ADONE OR1 1,4 ONE END ONE 1,4 INDEX+l NOP INS 4,4 7 DEL 3,1 *·t1 CONST CONST+! 18 NORG+1,1 OR1,1,1 6,4 NOAX SLlNEH,4 NORG NORG-l NORG-2 THREE NORG-l FIFT PROGRAM LISTINGS TEST DOT DOTTED SOLID LOC ORG FIX ORG VECTOR COMPONENTS STORE IN NORG TO NORG-2 FIFTEEN 8ARLI~ 8ACK+1,4 1,4 ONE OEL 17 NORG NPLTX 8,4 INDEX DEL 17 SKIP 1.1 START SKIP NPLTX NPLTX SLlNEV,4 NPLTX NORG-l BARLI M THREE *+1,1,** BAR,!,** BACK+l,4 DEL 1 DELl NORG NLSTX NORG NFSTX 2,4 SUB LDQ AOONE IFRSTB * DEL (CIFRST8-11*NOELX1/128 ISKIPB*DEL •••••••••••••••••••••••• HSTPlf * •••••••••••••••••••••••• - CPAGE 0199 0200 0201 0202 0203 0204 0205 0206 0201 0208 0209 0210 0211 0212 0213 0214 0215 0216 0211 0218 0219 0220 0221 0222 0223 0224 0225 0226 0221 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0210 0271 0272 0273 41 ••• * •••••••••••••••••••• • HSTPLT PROGRAM LISTINGS * • *.**.* •• ***.*.* •• *.* •• * (PAGE 5) STA BEGIN AXT 1.1 TRA BEGIN lOOP CLA NlSTX NFSTX STO ADD Del STO NlSTX ·.,1 BEGIN ClA STO NYBOT NYFST STO SUB SUB .·,1 TZE HOR •• ,1 lOO lOO TMI NEXT NYBOT CLA STO NYTOP STQ NYBOT TRA VERT NEXT STO NYTOP $LlNEV,4 VERT TSX PZE NLSTX PZF NY80T PZ[ NYTOP P1E MODE HOR SLlNEH,4 TSX PZE NFSTX PZE NYFST PZE NlSTX PZE MODE TXT *+1.1,1 LOOP.I, •• END TXl NOP INS TRA CLA STO I illS XEC BEGIN STO NYFST CLA iIILSTX STO NfSTX ADD OEL2 STO NlS IX TRA HOR BACK AXT ··,1 AXT *·,4 TRA 9,4 DOT CLA EIGHT STO MODE TRA RET CONSTANTS AND TEMPORARY STORAGE • MODE DEL DELl 0.0,1 ONE PZE AOONE Pl.E 1,0.0 THREE PZE 0.0,3 0,0,8 EIGHT PZE FIFT PZE 0.0,15 CONST OCT 233000000000 OCT 000000377111 PZE PlE NORG PZE NYTOP EQU NORG NYBOT EaU NORG-l NFSTX EOU NORG-2 NPLTX IIIlSTX EQU IIIPLTX BARLI M NYFST EOU SARLII'! 0 SKIP PZE iIIOP NOP TRA TRA BACK E,..O •••••••••••••••••••••••• HSTPlT ••••••••••••••••••••••••• • (PAGE 0214 0215 0216 0211 021B 0219 02BO 0281 0282 0283 0284 0285 0286 0281 0288 0289 0290 0291 0292 0293 0294 0295 0296 0291 0298 0299 0300 0301 0302 0303 0304 0305 0306 0301 0308 0309 0310 0311 0312 0313 0314 0315 0316 0311 031B 0319 0320 0321 0322 0323 0324 0325 0326 0321 0328 0329 0330 0331 0)32 0333 0334 0335 0336 0337 033B 0339 0340 0341 0342 0343 0344 0345 51 ...................... _- . HSTPLT-I I ••••••••••• a* •••••• __ *._.. PROGRAM LI STINGS ••••••••••••••••••••• * •• .. HSTPLT-I1 .. HSTPLT-II (SUBROUTINE) 9/29/64 LAST CARD IN DECK IS NO. 0335 .. FAP 0001 .HSTPLT-II 0002 COUNT 350 0003 LBL HSTPLT 0004 ENTRY HSTPLT (LNY,NY,ORG,NDELX,DOT,AXIS,IFRSTB,ISKIPBI 0005 0006 • ----ABSTRACT---0001 • 0008 • TITLE - HSTPLT-II 0009 .. BAR GRAPH PLOTTING FOR SUBROUTINE GRAPH 0010 0011 HSTPLT PLOTS A GRAPH OF THE INPUT DATA AS VERTICAL LINES 0012 • FROM A HORIZONTAL LINE. THE Y-COORDINATE OF THE 0013 • HORIZONTAL LINE IS TAKEN AS THE FIRST DATA POINT. THEN 0014 ALL OTHER DATA IS PLOTTED RELATIVE TO THIS LINE. SINCE 0015 • THE LAST POINT WOULD NORMALLY FALL ON THE EDGE OF THE 0016 • DISPLAY BOX, IT IS PLOTTED 4 SCOPE-UNITS TO THE LEfT OF 0011 THE BOX BOUNDARY. 0018 • 0019 • HSTPLT, AS USED BY GRAPH, LIMITS THE COMBINED LENGTH 0020 • OF ISOL AND lOOT TO 20 ENTRIES. 0021 • 0022 • • LANGUAGE - FAP, SUBROUTINE (FORTRAN II COMPATIBLE) 0023 .. EQUIPMENT - 709 OR 7090 (MAIN FRAME AND SCOPEI 0024 - 188 REGISTERS 0025 • STORAGE - FAST (OPTIMUM) 0026 • SPEED - R.A. WIGGINS, 9/5/62 0021 • AUTHOR 0028 • ----USAGE---0029 • 0030 •.. TRANSFER VECTOR CONTAINS ROUTINES LINEH, LINEV 0031 • AND FORTRAN SYSTEM ROUTINES NONE 0032 0033 • • FORTRAN USAGE 0034 • CALL HSTPLTILNY,NY,ORG,NDELX,DOT,AXIS,IFRSTB,ISKIPBI 0035 0036 • 0031 • INPUTS 0038 • NY( II 1=1 ••• LNY ARE FORTRAN II INTEGER DATA POINTS StALED FOR 0039 • SCOPE PRESENTATION. 0040 • MUST BE GRTHN=O, LSTHN 1024 0041 • 0042 IS FORTRAN II INTEGER 0043 • LNY SHOULD BE LSTHN 200 FOR GOOD RESOLUTION 0044 • 0045 • ORG( 11 1=1 ••• 3 ARE FLOATING POINT NUMBERS GIVING THE X,Y 0046 • COORDINATES OF THE AXIS AND THE X COORDINATES OF THE 0047 PLOTTED NY SERIES, ALL IN SCOPE UNITS 0048 ORG(I)=LEFT X COORDINATE OF AXIS AND FIRST NY POINT 0049 ORGIZ)=Y COORDINATE FOR AXIS 0050 ORG(3)=RIGHT X COORDINATE OF AXIS 0051 0052 • NDElX THE SPACING, IN SCOPE UNITS, BETWEEN SUCCESSIVE DATA 0053 • POINTS MULTIPLIED BY (2 •• 71 0054 • IS FORTRAN 11 INTEGER 0055 • 0056 =0. SOLID LINES PLOTTED 0051 • DOT NOT=O. DOTTED LINES PLOTTED 0058 0059 • AXIS =0. THIS IS FIRST CURVE TO BE PLOTTED FOR THIS FRAME 0060 • NOT =0. THIS IS NOT THE FIRST CURVE FOR THIS FRAME 0061 SET = 1. IF HSTPLT IS NOT BEING USED BY GRAPH • 0062 0063 • IFRSTB A DUMMY ARGUMENT FOR THIS HSTPLT IS 0064 • 0065 • ISKIPB IS A DUMMY ARGUMENT FOR THIS HSTPLT 0066 0061 DATA PLOTTED ON SCOPE 0068 • OUTPUTS 0069 •.. EXAMPLES 0070 0071 .. 1. INPUTS - NYIl ••• lO)=lOO,lOO,lOO.lOO.lOO,lOO,lOO,lOO.lOO,lOO 0012 • LNY=lO ORGll ••• 31=10 •• 20.,1010. NDELX=14222 0013 . . . .. . .... ..... . .. ... ... .. .. •••••••••••••••••••••••• . .•••• * ••••••••••••••••••• HSTPLT-I1 PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE •••••••••••••••••••••••• .. .***.* •• * •••••••• *••• *~ • "HSTPLT-II IPAGE 21 .. .. 2. .. ... .. OOT=O. INPUTS AXIS=O. IFRSTB=3 0074 0075 0076 0077 0078 0079 0080 0081 0082 083 84 85 66 87 ISKIPB=2 SAME AS EXAMPLE 1. EXCEPT NYll ••• 101=100,180,260,340.420,500,580,660,740,820 IFRSTB=l ISKIPB=l OUTPUTS - FOR EXAMPLES 1 AND 2. 8 9 .... ..... ... 3. INPUTS ... 4. .. .. .. " INPUTS SAME AS EXAMPLE 1. EXCEPT NYll ••• 101=100,108,132,172,228,300,388,484.612.748 OOT=l. AXIS=l • - SAME AS EXAMPLE 1. EXCEPT NYll ••• 101=100,101,108,127,164,225,316,443.612,829 AXIS=l. OUTPUTS - FOR EXAMPLES 3 AND 4. " " ... •.. " " . ..". .. .. ... .. ..... " . ... .. .. 5. INPUTS " . - SAME AS EXAMPLE 1. EXCEPT NYIl ••• 101=100.200,200,300.300,500,50,60,1000,lO AXIS=l. 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 014.3 0144 0145 0146 21 •••••••••••••••••••••••• • .-••.•••••..•••••..• _--*• PROGRAM LISTINGS HSTPLT-II IPAGE •••••••••••••••••••••••• • HSTPLT-II • • • • • * * • • * • • * • • 6. INPUTS - NYll ••• 1001=500.500.500,500,500.500.500.500.500.500. 500,450,400,350,300,250.200,150,100, 50. O. 10, 40. 90.160.250.360.490,640.810. 1000,999,992.913.936,815.184,651,488,211, 0, 6, 25, 51. 95,146,206,213.345,421. 500,519,655,721,194,854,905,943,915,994. 1000,024,042.119,092.482.054.272,048,325, 865,667.432,112,346,118.931,625,517,621, 301,155.421,874,444,977.383,988,218,512, 290,402,491.269,463,885,423,639,798,363 LNY=100 ORGll •• 3)=10.,20 •• 1010. NDELX=1293 DOT=O. AXIS=I. OUTPUTS - FOR EXAMPLES 5 AND 6. * • • •* PZE 1,HSTPLT BCI HSTPLT SXD *-2,4 ADR,l SXA SXA ADR+l,2 SET UP ADDRESSES CAL 3,4 ADO =IB35 STA ORG+l 2,4 CAL ADD =IB35 STA NY STA NYO FIX DRGII-31 DRG AXT 3.1 ClA ·*,1 UFA :0233000000000 ANA =0317711 AlS 18 STO 10RG+l,l TIX ORG+l,l,1 DETERMINE WHAT IAXIS TO USE * ClA K TNZ Al Bl CLA =IBl1 STO K POX ,1 STl IFIRST 2,4 ClA* STO IAXIS CLA IORG-l STO YORG A4 TRA ClA. Al 6,4 • • • •••• - •••••• _._ •• * •• -.-.- 31 (PAGE 0141 0148 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 164 0165 0166 0161 0168 0169 0110 0111 0172 0113 0174 0115 0116 0177 0178 0119 0180 0181 0182 0183 0184 0185 0186 0181 0188 0189 0190 0191 0192 0193 0194 0195 0196 0191 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 31 *.**.*.*.* •• ************ HSTPLT-I I * •• **** ••• ************** (PAGE 4) - - A2 A3 A4 * NY * B2 NYO TNl A2 CLA =1B17 IFIRST S10 CLA NYL 2,4 SUBTNl Bl YORG eLA 10RG-l SUB Bl TNZ CLA =lB17 STO K TRA A4 CLA IFIRST A3 TNl CLA K ADD =lB17 K STO ,1 POX 2,4 eLA* IAXIS+l,l STO TRA A4 CLA K ADD =IBI7 STO K POX ,1 NYL+l,1 eLA 2,4 SUB* A4 TlE 2,4 CLA* STO IAXIS+l,l STl IFIRST 1,4 CLA* POX ,2 A6+l STD SUB =IBI7 STD A6 PLOT HORIlONTAL AXIS CLA **,2 STO NYL+l,1 IAXIS+l CLA PXA ,1 SSM ADD *-3 STA -+3 TSX $lINEH,4 TSX 10RG TSX ** TSX IORG-2 TSX =4B17 PLOT VERTICAL LINES LXO HSTPLT-2,4 5,4 CLA* TlE *+4 CLA =8B17 STO DOT TRA *+3 CLA =4B17 STo DOT CLA IAXIS+l.t STo IAI 4,4 CLA* ARS 7 STO NOELX CLA IORG STO IX AXT 2,2 CLA IX ADO NOELX IX STO IXI STD eLA ** 1'2 STO NYl SUB IAI HE A6-l TMI A5 PROGRAM LISTINGS ••••••••• ** ••• *.***** ••• HSTPLT-II *••• * ••• * ** •••••• ******.** (PAGE 4) 0222 0273 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0273 0274 0275 0276 0271 0278 0279 0280 0281 0282 0283 0284 0285 0286 0287 0288 0289 02<)0 0291 0292 02<)3 0294 0295 02<)6 •••••••••••••••••••••••• • • HSTPLT-I1 •••••••••••••••••••••••• (PAGE 5) TSX TSX TSX TSX TSX TRA A5 TSX TSX TSX TSX TSX TXI A6 TXL TXL TRA CLA SUB STO TRA LXO A1 AXT AOR AXT TRA DES IORG PZE PZE K IFIRST PZE YORG PZE DOT PZE PZE !At NOELX PZE IX PZE IXI PlE NY1 PZE DES IAXIS PlE DES NYl PlE END SLINEV,4 IXI IAl NYI DOT A6-1 SLINEV,4 IXI NYl IAl DOT •• 1,2,1 B2,2, •• •• 2,2 ••• A1 IX =4Bl1 IX B2 HSTPLT-2,4 •• ,1 **72 9,4 3 19 19 PROGRAM LX STINGS _•••••••••••••••• ** ••••• .*......... .... it HSTPLT-II ~ • *••••••• (PAGE 0291 0298 0299 0300 0301 0302 0303 0304 0305 0306 0301 0308 0309 0310 0311 0312 0313 0314 0315 0316 0311 0318 0319 0320 0321 0322 0323 0324 0325 0326 0321 0328 0329 OHO 0331 0332 0333 OH4 0335 51 • ••••••••••••••••••••••• * HSTPLT -III (709) * •••••••••••••••••••••••• PROGRAM LISTINGS •••••••••••••••••••••••• • HSTPlT -Ill (709) " •••• * •••••• ~ •••• * ••••••• .. HSTPLT-III (709)ISUBROUTINE) 9/29/64 LAST CARD IN DECK (S NO. 0437 * FAP 0001 *HSTPLT -I I I ,(709) 0002 COUNT 400 0003 LBL HSTPLT 0004 HSTPLT ILNY,NY,ORG,NDELX,OOT,AXIS,IFRSTB,ISKIPB) ENTRY 0005 0006 ----ABSTRACT---0007 OOOB * TITLE - HSTPLT-III (709) 0009 * CUBIC CURVE SCOPE PLOTTING FOR SUBROUTINE GRAPH 0010 0011 HSTPLT PLOTS THE INPUT DATA AS DARKENED POINTS WITH CUBIC 0012 CURVES FITTED BETWEEN THE POINTS. EXCEPT AT THE ENDS OF 0013 THE DATA, THE NEAREST FOUR OATA POINTS ARE USED FOR 0014 DETERMINING THE CUBIC. AT THE ENO OF THE DATA SEQUENCE 0015 THE NEXT POINT IS ASSUMED TO BE THE SAME AS THE FINAL 0016 POINT. IF DESIRED, AN X-AXIS WITH SHORT BARS SPACED AT 0017 REGULAR INTERVALS IS PLOTTED. THE BEGINNING POINT AND THE 001B 0019 SPACING OF THE BARS ARE CONTROL LEO BY INPUT ARGUMENTS~ 0020 .. LANGUAGE - FAP, SUBROUTINE IFORTRAN II COMPATIBLE) 0021 .. EQUIPMENT - 709 IMAIN FRAME AND SCOPE) 0022 .. STORAGE - 256 REGISTERS 0023 .. SPEED - FAST 10PTIMUM) 0024 .. AUTHOR - R.A. WIGGINS, 9/5/62 0025 0026 0027 ----USAGE---0028 .. TRANSFER VECTOR CONTAINS ROUTINES - LINEH 0029 .. AND FORTRAN SYSTEM ROUTINES - NONE 0030 0031 .. FORTRAN USAGE 0032 .. CALL HSTPLTILNY,NY,ORG,NDELX,DOT,AXIS,IFRSTB,ISKIPBI 0033 0034 .. INPUTS 0035 0036 NYII) I=I ••• lNY ARE FORTRAN II INTEGER DATA POINTS SCALED FOR 0037 0038 SCOPE PRESENTATION • MUST BE GRTHN=O, LSTHN 1024 0039 0040 IS FORTRAN II INTEGER LNY 0041 0042 SHOULD BE LSTHN 200 FOR GOOD RESOLUTION 0043 " ORGI I) 0044 1=1 ••• 3 ARE FLOATING POINT NUMBERS GIVING THE X,Y * 0045 COORDINATES OF THE AXIS AND THE X COORDINATES OF THE 0046 PLOTTED NY SERIES, ALL IN SCOPE UNITS 0047 ORGIl)=LEFT X COORDINATE 0048 ORG(2)=Y COORDINATE FOR AXIS 0049 ORG(3)=RIGHT X COORDINATE 0050 0051 NDELX THE SPACING, IN SCOPE UNITS, BETWEEN SUCCESSIVE DATA * 0052 POINTS MULTIPLIED BY 12**7) 0053 IS FORTRAN II INTEGER 0054 0055 DOT =0. SOLID LINES PLOTTED 0056 NOT=O. DOTTED LINES PLOTTED 0057 0058 AXIS =0. AXIS AND CROSSBARS ARE PLOTTED 0059 NOT=O. NO AXIS IS PLOTTED * 0060 0061 IS THE INDEX OF THE FIRST DATA POINT FOR WHICH A IFRSTB 0062 CROSSBAR IS PLOTTED ON THE AXIS 0063 IS FORTRAN II INTEGER 0064 IS THE NUMBER OF INDICES WHICH ARE SKIPPED BETWEEN THE 0065 ISKIPB 0066 PLOTTED CROSSBARS * 0067 IS FORTRAN II INTEGER 0068 006') DATA PLOTTED ON SCOPE * OUTPUTS 0070 ** EXAMPLES 0071 0072 .. 1. INPUTS - NYll ••• 10)=100,100,100.100,100.100.100.100.100.100 0073 .. LNY=10 ORGll ••• 3)=10.,20.,1010. NDELX=14222 ... .. .... . .... . .. . .. . ... .... .... .. .. . . ... .. .. .. . ... .. •••••••••••••••••••••••• .. PROGRAM LISTINGS HSTPlT -III 17091 .. •••••••••••••••••••••••• IPAGE 2) IPAGE .. DOT=O. • 2. INPUTS .. .. . .... .... ... ... ... .. .. .. .. • •••••••••••••••••••••••• • HSTPlT -IIf (709) .. •••••••••••••••••••••••• AXIS=O. IFRSTB=3 ISKIPB=2 - SAME AS EXAMPLE 1. EXCEPT NYll ••• 101=100,180,260.340.420,500.580.660.740.820 IFRSTB=l ISKIPS-l OUTPUTS - FOR EXAMPLES 1 AND 2. . it .. .. it .. 3. INPUTS .. . .... it .. 4. INPUTS .... .. . - SAME AS EXAMPLE 1. EXCEPT NYIl ••• 10'=100,108,132,172.228,300,388,484.612.748 DOT=l. AXIS=l. SAME AS EXAMPLE 1. EXCEPT NYIl ••• 10'=100,101,108,127,164,225,316,443.612.829 AXIS:l. OUTPUTS - FOR EXAMPLES 3 AND 4. ... . it . it .. it .... .. it .. .. ... .. .. 5. INPUTS .. it - SAME AS EXAMPLE 1. EXCEPT NYIl ••• lO'=100,200.200.300,300.500,50.60,1000,10 AXIS=I. 0074 0075 0076 0077 007B 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 .0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 21 •••••••••••••••••••••••• • PROGRAM LISTINGS HSTPLT -III 17091 • •••••••••••••••••••••••• IPAGE •••••••••••••••••••••••• • HSTPLT -III 17091 • _.••.•••...•............ 31 • 6. INPUTS • • • • • • • • • • • • • • - NYl1 ••• 1001=500.500.500,500.500,500,500.500.500,500, 500,450,400.350,300.250.200,150,100, 50, 0, 10, 40, 90,160,250,360.490,640,810, 1000,999,992,973,936,875,784,651,488,271, 0, 6, 25, 57, 95,146,206,273,345,421, 500,579,655,727,794,854,905,943,975,994, 1000,024,042,119,092,482,054,272,048,325, 865.667,432.112,346,178,931,625,511,627, 301,755,427,874,444,977,383,988,218,512, 290,402,491,269,463,885,423,639,798,363 LNY=100 ORGll •• 31=10.,20.,1010. NOELX=1293 OOT=O. AXIS=l. OUTPUTS - FOR EXAMPLES 5 AND 6. PZE 8CI I,HSTPLT HSTPLT SXO .-2,4 SXA AOR,l SXA AOR+l, 2 CAL 3,4 ADO =1835 .5TA ORG • FIX ORG11-41 AXT 3.1 ORG CLA ••• 1 UFA =0233000000000 ANA "0377777 ALS 18 STO IORG+l,l TIX ORG,l,1 ClA. 4,4 ARS 7 STO NOElX • 00 HORIZONTAL AXIS IFAXIS=O CLA. 6,4 TNZ A2 TSX SLlNEH,4 TSX IORG TSX IORG-l TSX IORG-2 TSX =4817 LXO HSTPLT-2,4 LOQ NOElX MPY. 7,4 llS 17 ADD IORG STO NX STO III X1 IPAGE 0147 0\48 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0115 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 020,. 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 31 •••••••••••••••••••••••• HSTPLT -III n091 • ••••••••••••••••••••••••• (PAGE PROGRAM LISTINGS •...... .•••.•.•........ _ HSTPLT -Ill (7091 • •_......•.••..•...•..•... 41 LoO NoELX 8,4 MPY· 1,7 LLS STO NoELXl CLA. 1,4 POX .2 CLA IORG-1 ADD -12817 STD LOOP1+4 CLA. 8,4 STD Ai LXD IORG,-1.1 SXA NX1,l LOOPI WTV CPY NX1 .+ 1,1.4 TXI SXA NX1.1 TXL LOOP1.10·· NX CLA ADD NDELXl STO NX STD NXI Al LOOPI-2,2, •• TlX SET UP CONSTANTS FOR MAIN LOOP • A2 CLA* 5.4 TNZ *+4 .. 4817 CLA STO DOT TRA ·+3 CLA "8817 STO DOT CAL 2.4 NYAOD STA ADD =183!l STA A3 1,4 CLh STD AIO+l ADD =1817 All STD CLA 10RG SUB NOELX NX STD STO NXl AXT 3,1 A3 CLA ··,1 NY,1 STo TIX A3,l,l CLA NYl STO NY MAIN LOOP • 3,1 AXT LOoP2 CLA NY2 SUB NYl SSP ADD NOELX LRS 35 OVP DOT XCA ALS 18 OCT CLA =1817 STD NX2 NO. PLOTS 8ETWEEN EACH POINT CLM LoO NDELX LLS IB DVP NX2 STO oELX S~PARATION (SCOPE UNITS) BETWEEN PLOTS LoO =0 CLA =1834 OVP NX2 au STO STQ oUl NYI CLA STO E3 SSM (PAGE 0222 0223 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0213 0274 0275 0276 0217 0278 0279 0280 0281 0282 0283 0284 0285 0286 0287 0288 0289 0290 0291 0292 0293 02'14 02'15 02'16 41 •••••••••••••••••••••••• HSTPl T -II I 17091 * "•••••••••••••••••••••••• (PAGE 51 . A5 ADO STO SSM SUB ADD ARS STO AlS SUB ADD ADD SUB lDQ lRS DVP STQ CENTRAL CLA STO ARS STA CLA AOD STD STO STD AXT WTV CPY fiX AXT CLA SUB TlE STO ClA SUB XCA MPY llS ADD STO ClA SUB XCA MPY llS ADD XCA MPY llS ADD STO ARS STA CLA ADD STO STD WTV CPY ClA AOO STO fiX ClA STO SUB STO SUB ADD STO SUB ADD ADD NY2 E2 NY2 NY3 1 El 1 NY2 NYl NYI NY =0 17 =6B17 E lOOP NYl F3 18 POINT NX NDElX NX NXI POINT 6,4 POINT *-2,4.1 3.2 NX2 =lB11 A9 NX2 DU =2B17 E 17 El A DU =IB17 A 17 E2 DU 17 E3 F+lo2 18 POINT NXI DElX NXI POINT POINT DU DUI DU A5.2,1 F E3 Fl E2 Fl F2 El Fl F2 F2 PROGRAM LI STINGS •••••••••••••••••••••••• HSTPlT -III (709) * "_..•...•.•.....•........ (PAGE 0297 0298 0299 0300 0301 0302 0303 0304 0305 0306 0307 0308 0309 0310 0311 0312 0313 0314 0315 0316 0317 0318 0319 0320 0321 0322 0323 0324 0325 0326 0327 0328 0329 0330 0331 0332 0333 0)34 0335 0336 0337 0338 0339 0340 0341 0342 0343 0344 0345 0346 0347 0348 0349 0350 0351 0352 0353 0354 0355 0356 0357 035B 0359 0360 0361 0362 0363 0364 0365 0366 0367 0368 0369 0370 0371 5) •••••••••••••••••••••••• HSTPLT -III (709) • •••••••••••••••••• * •••••• (PAGE PROGRAM LISTINGS A9 NYAOO A10 All AOR NDElX NDELXl DELX NX NX1 NXl DDT A POINT F3 F2 Fl F E3 E2 El E OU OUi NY] NY2 NYi NY IORG HSfPLT -III (709) • •••••••••••••••••••••••• 6) A6 •••••••••••••••••••••••• • (PAGE SUB Sf 0 CLA POX SUB TZE CLA ADD STO ADD STO ADD STO POX SXA ClA ADD STO STO WTV CPY TIX CLA STO ClA STO CLA STO ClA STO TXI TXl ClA STO TXl lXO AXT AXT TRA PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE END F3 E NX2 ,2 =IB17 A9 E El El E2 E2 E3 E3 ,4 POINT,4 NX1 OELX NX1 POINT POINT A6,2.1 NYl NY NY2 NYI NY3 NY2 **,1 NY3 .+1,1,1 lOOP2,l,** NY2 NY3 lOOP2,I,** HSTPLT-2,4 **,1 **,2 9,4 101 101+1 0372 0373 0374 0375 0376 0377 0378 0379 0380 0381 0382 0383 0384 0385 03B6 0387 0388 0389 0390 0391 0392 0393 0394 0395 0396 0397 0398 0399 0400 0401 0402 0403 0404 0405 0406 0407 0408 0409 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 0430 0431 0432 0433 0434 01035 0436 0437 6) •••••••••••••••••••••••• .. HSTPLT-IIII70901" ...................... _- PROGRAM LISTINGS •••••••••••••••••••••••• HSTPLT-II[170901" •••••••••••••••••••••••• • .. HSTPLT-III 170901 I SUBROUTINE I 9/8/64 LAST CARD IN OECK IS NO. 0445 .. FAP 0001 "HSTPLT-IIII70901 0002 COUNT 450 0003 LBL HSTPLT III 0004 ENTRY HSTPLT (LNY,NY,oRG,NDELX,DOT,AXIS,IFRSTB,ISKIPBI 0005 0006 ----ABSTRACT---0007 0008 • .. TITLE - HSTPLT-III (70901 0009 .. CUBIC CURVE SCOPE PLOTTING FOR SUBROUTINE GRAPH 0010 0011 HSTPLT PLOTS THE INPUT DATA AS DARKENED POINTS WITH CUBIC 0012 CURVES FITTED BETWEEN THE POINTS. EXCEPT AT THE ENDS OF 0013 • THE DATA, THE NEAREST FOUR DATA POINTS ARE USED FOR 0014 DETERMINING THE CUBIC. AT THE END OF THE DATA SEQUENCE 0015 THE NEXT POINT IS ASSUMED TO BE THE SAME AS THE FINAL 0016 POINT. IF DESIRED, AN X-AXIS WITH SHORT BARS SPACED AT 0017 • REGULAR INTERVALS IS PLOTTED. THE BEGINNING POINT AND THE 0018 SPACING OF THE BARS ARE CONTROLLED BY INPUT ARGUMENTS • 0019 0020 .. LANGUAGE - FAP, SUBROUTINE (FORTRAN II <;OMPATIBLEI 0021 0022 • EQUIPMENT - 7090 (MAIN FRAME AND SCOPEI .. STORAGE - 258 REGISTERS 0023 .. SPEED - FAST 10PTlMUM) 0024 .. AUTHOR - R.A. WIGGINS, 9/5/62 0025 0026 • ----USAGE---0027 • 0028 LINEH 0029 • TRANSFER VECTOR CONTAINS ROUTINES .. AND FORTRAN SYSTEM ROUTINES NONE 0030 0031 .. FORTRAN USAGE 0032 • CALL HSTPLTILNY,NY,ORG,NDELX,OoT,AXIS,IFRSTB,ISKIPBl 0033 0034 .. INPUTS 0035 0036 NYI I I I=l ••• LNY ARE FORTRAN II INTEGER DATA POINTS SCALED fOR 0037 • SCOPE PRESENTATION. 0038 MUST BE GRTHN=O, LSTHN 1024 0039 0040 IS FORTRAN II INTEGER LNY 0041 SHOULD BE LSTHN 200 FOR GOOD RESOLUTION 0042 0043 oRG (I I 1=1 ••• 3 ARE FLOATING POINT NUMBERS GIVING THE I,Y 0044 COORDINATES OF THE AXIS AND THE X COORDINATES OF THE 0045 PLOTTED NY SERIES, ALL IN SCOPE UNITS 0046 oRGIl'=LEFT X COORDINATE 0047 DRGI21=Y COORDINATE FOR AXIS 0048 ORGI31.RIGHT X COORDINATE 0049 0.0 LSTHN= OR~III LSTHN= 1023.0 0050 • 0051 NoElX THE SPACING, IN SCOPE UNITS, BETWEEN SUCCESSIVE DATA 0052 • POINTS MULTIPLIED BY 12 •• 71 0053 IS FORTRAN II INTEGER 0054 • 0055 DOT =0. SOLID LINES PLOTTED 0056 • NoT=O. DOTTED LINES PLOTTED 0057 0058 0059 AXIS =0. AXIS AND CROSSBARS ARE PLOTTED NOT=O. NO AXIS IS PLOTTED 0060 0061 it IFRSTB IS THE INDEX OF THE FIRST DATA POINT FOR WHICH A 0062 CROSSBAR IS PLOTTED ON THE AXIS 0063 IS FORTRAN II INTEGER 0064 • 0065 ISKIPB IS THE NUMBER OF INOICES WHICH ARE SKIPPED BETWEEN THE 0066 PLOTTED CROSSBARS 0061 • IS FORTRAN II INTEGER 0068 it 0069 OUTPUTS DATA PLOTTED ON SCOPE 0070 • 0071 .. EXAMPLES 0072 .. 1. INPUTS - NYIl ••• lOI=lOO.lOO,lOO,lOO,lOO,IOO,lOO,lOO,lOO,lOO 0073 0074 .. LNY=IO ORGIl ••• 31=lO.,20.,lOlO. NDELX=14222 ... .. ... . ... . . .. . .. .. .... ... .. .. .. . . . .... .. .. ... .. . •••••••••••••••••••••••• • PROGRAM II STINGS (PAGE 2) • •• OOT=O. 2. INPUTS • • • • • • AXIS-O. IfRST8 a 3 ISKIPB=2 - SAME AS EXAMPLE 1. EXCEPT NYI1 ••• 101=100,180,260,340,420,500,580,660,740,820 IfRSTB a l ISKIPS=1 OUTPUTS - fOR EXAMPLES 1 AND 2. • • • • 3. INPUTS • • - SAME AS EXAMPLE 1. EXCEPT NYll ••• 101=100,108,132,172,228,300,388,484,612,748 OUT-I. AXIS-I. • 4. INPUTS • • - SAME AS EXAMPLE 1. EXCEPT NYll ••• 101=100,101,108.127,164,225,316,443,612,829 AXIS=I. • • • • OUTPUTS - fOR EXAMPLES 3 AND 4. • • • • • • • • • • • • • • • • • • • • • • • • • •• • • 5. INPUTS ....... HSTPlT-III(70901· -••••••• ** •••• ~.* •••••••••••••••••••••••• (PAGE •••• i ••••••••••••••••••• • HSTPlT-III(70901· - SAME AS EXAMPLE 1. EXCEPT NYll ••• 101-100,200,200.300.300,500,50,60,1000,10 AXIS=1. 0075 0076 ·0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 013·5 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 21 •••••••••••••••••••••••• .. HSTPlT-I II 17090) PROGRAM 1I STINGS • •••••••••••••••••••••••• (PAGE •.•....•.. , •.•........•. .. ~ HSTPlT-HI(7090). •• *•• * ••••••••• * ••••••• 31 • ..• • •.. ..• ... . • .• • • 6. INPUTS - NY(I ••• 100)=500,500,500,500,500,500.500.500,500.500. 500.450.400,350,300.250.200,150,100, 50, 0, 10, 40, 90,160,250,360.490,640.810, 1000,999,992,973.936.875,784,657,488,211, 0, 6, 25, 57, 95,146,206,273,345,421, 500,579,655,721,794.854.905,943,975,994, 1000,024,042.119,092,482,054.272.048,325. 865,667.432.112.346,178.931,625,511,621, 301,155,427,874,444,977,383,988.218.512 • 290.402,491,269.463.885.423.639.798.363 lNY=100 ORGll •• 31=10 •• 20.,1010. NOELX=1293 DOT=O. AXIS=l. OUTPUTS - FOR EXAMPLES 5 AND 6 • • • • • • • • • • • • • • • • • • • • ... • • • • 8SS 0 • FOLLOWING CARD DeSIGNATES THE DATA CHANNEL THAT CRT IS ATTAtHED TO. • TO CHANGE, ALTER THE LETTER DESIGNATION ONLY AND REASSEMBLE. X UPENO 01 SCPAD eQU X-105 PIe BCI 1.HSTI I I HSTPlT SXD .-2,4 SXA ADR,l SXA AOR+l,2 CAL 3,4 ADD =lB35 STA ORG • FIX ORGI1-4) AXT 3,1 ORG CLA •• ,1 UFA =0233000000000 ANA =0377777 ALS 1B STO IDRG+ 1.1 TIX ORG,ltl CLA. 4,4 ARS 7 STO NOElX • 00 HORIlONTAl AXIS IFAXIS=O eLA* 6,4 TNl A2 TSX SlINEH,4 TSX IORG,O TSX IORG-l,O TSX IORG-2,0 TSX =4Bl1,0 lXO HSTPLT-2,4 lOQ NOELX (PAGE 0148 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0110 0171 0172 0173 0174 0115 0116 0177 0118 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 IU95 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0201 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 31 •••••••••••••••••••••••• - HSTPLT-II I (7090) • •••••••••••••••••••••••• 4) (PAGE .. • PROGRAM LISTINGS .•••••••••••••••••••••••• HSTPlT-111(1090) ..•.....•• -.•...••..•..• . MPY. 1,4 llS 11 ADD IORG STO NX STO NXI NDELX lDO MPY. 8,4 LLS 11 STO NDELXl CLA. 1,4 ,2 POX CLA 10RG-l ADD =12B17 STO lOOPl+4 8,4 CLASTO Al LXD IORG-l,1 SXA NX1,l LOOPI WRS SCPAO RCHX 101 TXI ·+1,1,4 SXA NX1,l LOOPl,l, •• TXL CLA NX ADD NOELXl STO NX NXI STO Al TIX LOOPl-2,2,-SET UP CONSTANTS FOR MAIN lOOP A2 5,4 CLATNZ -+4 CLA =4B11 STO DOT TRA -+3 CLA =BB11 STO DOT 2,4 CAL STA NYADD ADD =IB35 STA A3 1,4 CLASTD AI0+! ADD =lB11 STD All CLA IORG SUB NOELX STO NX STO NX1 AXT 3.1 A3 CLA **t1 NY,l STO A3,l,1 TIX CLA NYl STO NY MAIN LOOP AXT 3,1 lOOP2 CLA NY2 SUB NYl SSP ADD NDELX LRS 35 DVP DOT XCA ALS 18 OCT CLA =lB11 STO NX2 NO. PLOTS BETWEEN EACH POINT CLM NDElX LOO 18 LlS OVP NX2 STO DElX SEPARATION (SCOPE UNITS) BETWEEN PLOTS LOO =0 CLA =IB34 NX2 DVP (PAGE 0223 0224 0225 0226 0221 0228 0229 0230 0231 0232 0233 0234 0235 0236 0231 0238 0239 0240 0241 0242 0243 0244 0245 0246 0241 0248 0249 0250 0251 0252 0253 0254 0255 0256 0251 0258 0259 0260 0261 0262 0263 0264 0265 0266 0261 0268 0269 0210 0211 0212 0213 0214 0215 0216 0211 0218 0219 0280 0281 0282 0283 0284 0285 0286 0281 0288 0289 0290 0291 0292 0293 0294 0295 0296 0297 4) .•••••••••••••••••••••••• . •••••••••••••••••••••••• HSTPlT-III(10901 {PAGE 51 .. A5 PROGRAM LISTINGS .•••••••••••••••••••••••• HSTPlT-III(10901 . •••••••••••••••••••••••• (PAGE STO STO ClA STO SSM ADD STO SS'" SU8 ADD ARS STO AlS SUB ADD ADD SUR LOO lRS OVP STO CENTRAL CLA STO ARS STA ClA ADO STO STO STD AXT WRS RCHX TIX AXT ClA SUB HE STO ClA SUB XCA "'PY LlS ADD STO ClA SUB XCA MPY LlS ADO XCA MPY LlS ADO STO ARS STA CtA ADD STO STO WRS RCHX CLA AOD STO TIX CLA STO SUB STO SUB DU DUI NY1 E3 NY2 E2 NY2 NY3 1 El 1 NY2 NYl NYI NY =0 17 =6Bl1 E lOOP NYI F3 18 POINT "IX NDELX "IX NXl POINT 6,4 SCPAD 102 *-2,4,1 3,2 NX2 =lB17 A9 NX2 DU =2B17 E 17 El A DU =lB17 A 17 E2 OU 17 E3 F+l,2 18 POINT NX1 DELX "IX 1 POI"lT SCPAD 102 au DU1 DlI A5,2,1 F E3 F1 E2 Fl 0298 0299 0300 0301 0302 0303 0304 0305 0306 0307 0308 0309 0310 0311 0312 0313 0314 0315 0316 0311 0318 0319 0320 0321 0322 0323 0324 0325 0326 0321 0328 0329 0330 0331 0332 0333 0334 0335 0336 0331 033B 0339 0340 0341 0342 0343 0344 0345 0346 0341 0348 0349 0350 0351 0352 0353 0354 0355 0356 0357 0358 0359 0360 0361 0362 0363 0364 0365 0366 0361 0368 0369 0310 0311 0312 5) • •••••••••••••••••••••• * .•••••••••••••••• HSTPlT-III(7090) • * ••••••• (PAGE PROGRAM LISTINGS 6) A6 A9 NYADD AI0 All ADR 101 102 NDElX NDEL Xl DELX NX NX1 NX2 DOT A POINT F3 F2 Fl F E3 E2 El E OU DU1 NY3 NY2 NY1 NY IORG •••.•••...... ..•... .-.*.* HSTPlT-lll(7090) • ••• * ••••••••••••••••••• ~ (PAGE ADO STO SUB ADO ADO SUB STO CLA POX SUB TZE ClA ADO STO ADO STO ADO STO POX SXA ClA ADO STO 510 WRS RCHX TIX CLA STO CLA STO CLA STO CLA STO TXI TXl CLA STO TXl LXD AXT AXT TRA lOCO 10CD PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PZE PlE PZE PZE PZE END F2 El Fl F2 F2 F3 E NX2 ,2 =IB11 A9 E El El E2 E2 E3 E3 ,4 POINT,4 NXI DELX NXI POINT SCPAD 102 A6,2,l NY1 NY NY2 NY 1 NY3 NY2 •• ,1 NY3 .+1,1,1 LOOP2,1,"· NY2 NY3 LOOP2,1, •• HSTPLT-2,4 •• ,1 "·,2 9,4 NX 1" 1 POINT,,1 M M+1 0373 0374 0315 0376 0377 0378 0379 0380 0381 0382 0383 0384 0385 0386 0387 0388 0389 0390 0391 0392 0393 0394 0395 0396 0397 0398 0399 0400 0401 0402 0403 0404 0405 0406 0407 0408 0409 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 0430 0431 0432 0433 0434 0435 0436 0431 04~8 0439 0440 0441 0442 0443 0444 0445 61 •••••••••••••••••••••••• HVTOIV • ••••••••••••••••••••••••• PROGRAM LISTINGS •••••••••••••••••••••••• • HVTOIV LAST CARD IN DECK [S NO. 0109 0001 0002 0003 0004 0005 0006 • 0007 ---ABSTRACT---• OOOB • 0009 • TITlE - HVTOIV 0010 • SPREAD OUT HOLLERITH VECTOR AS FORTRAN INTEGERS 0011 • HVTOIV SPREADS OUT A VECTOR HVII), I=l ••• LHV, AS A 0012 • 0013 FORTRAN INTEGER VECTOR IVII). I=1 ••• 6.LHV. EACH REGISTER • OF HVII) IS ASSUMED TO BE IN FORMATIA6) AND IS SPREAD 0014 • 0015 OUT AS 6 INTEGERS. THE INTEGER VALUES WILL LIE IN THE • 0016 RANGE +0 TO +63. • 0017 • 001B HVTOIV IS THE INVERSE OF SUBROUTINE IVTOHV • 0019 • 0020 • LANGUAGE - FAP SUBROUTINE IFORTRAN II COMPATIBLE) 0021 • EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLU) 0022 • STORAGE - 39 REGISTERS 0023 * SPEEO - 84*LHV MACHINE CYCLES 0024 • AUTHOR - S.M. SIMPSON, MARCH 1963 0025 • 0026 ----USAGE--• 0027 •• TRANSFER VECTOR CONTAINS ROUTINES - NONE 0028 0029 • AND FORTRAN SYSTEM ROUTINES - NONE 0030 • 0031 • FORTRAN USAGE 0032 • CALL HVTOIVIHV,LHV.IV) 0033 • 0034 • INPUTS 0035 • 0036 I=l ••• LHV IS HOLLERITH VECTOR IN A6 FORMAT • HVI I I 0037 • 0038 MUST EXCEED 0 ISTRAIGHT EXIT FOR ILLEGAL LHV) LHV • 0039 • 0040 • OUTPUTS 0041 • 0042 1=1 ••• 6*LHV IS THE INTEGER VECTOR EQUIVALENT TO HVIII I VI I I • 0043 • 0044 • EXAMPLES 0045 • 6HCHARAC 1= OCT2330215121231 0046 • 1. INPUTS - HV(1) 0047 HVI21 " 6HTERS T 1= OCT6325515260631 • 0048 HV(3) " 6HO SPRE 1= OCT466062475125) * HV(4) " 6HAD OUT 1= OCT2124604664631 0049 • HV(51 " 5HIN IV 0050 1= OCT3145603154601 • 0051 •• 0052 USAGE DIMENSION HV(5),IV1130).IV2(6),IV316) 0053 • CALL HVTOIVIHV,5.IVl) 0054 CALL HVTOIVIHVIS),l,IV2} • 0055 • CALL HVTOIVIHV,O,IV3) 0056 OUTPUTS - IV111 ••• 301 19,24,17,41,17,19.51.21.41,50. • 0057 • 48,51.38,48.50,39.41.21.17.20, 0058 • 48,38,52,51,25,37.48,25.53.48 0059 • IV211 ••• 61 25,37.48.25.53.48 0060 • IV3II) IS NOT CHANGED I ILLEGAL LHV) 0061 • 0062 • PROGRAM FOLLOWS BELOW 0063 HTR 0 0064 HTR 0 0065 HTR 0 0066 BCI l,HVTOIV 0067 HVTOIV SXO HVTOIV-2.4 0068 SXD HVTOIV-3.2 0069 SXD HVTOIV-4,1 0070 • SETUP SEQUENCE 0071 AIHV) CLA 1.4 0072 ADD Kl 0073 STA GET 0074 lHV CLA* 2.4 • HVTOIV ISUBROUTINE) • FAP .HVTOI V 100 COUNT HVTOIV LBL HVTOIV IHV,LHV,IV) ENTRY • •••••••••••••••••••••••• 9/29/64 •••••••••••••••••••••••• HVTOIV • •••••••••••••••••••••••• • (PAGE PROGRAM LISTINGS 21 TMI LEAVE HE LEAVE STD TESTLH CLA 3,4 AIIVI ADO K1 STA STO ClA KD6 STD TEST6 • (XR1 CONTROLS ACQUISITION, XR2 CONTROLS STORAGE) AXT 1,1 AXT 1,2 • GET NEXT HOLLERITH GET LDQ •• ,1 ••=AIHVl+1 • SHIFT AND STORE lOOP SHIFT CLA KDO LGL 6 AlS 18 STO •• ,2 .-=AIIVI+1 STO TXI *+1,2,1 TEST6 TXL SHIFT,2,.. ..:6,12, ••• • BUMP DECREMENT OF TESTL AND INDEX 1. TEST FINISH CAL TEST6 ACl KD6 SLW TEST6 TXI .+1,1,1 GET,l, •• TESTLH TXL ··=LHV • EXIT LEAVE LXO HVTOIV-3,2 LXD HVTDIV-4,1 TRA 4,4 • CONSTANTS KDO PZE o 0,0,6 KD6 PZE Kl PZE 1 END •••••••••••••••••••••••• • HVTOIV • •••••••••••••••••••••••• I PAGE 2) 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 .•••••••••••••••••••••••• IDERIV • PROGRAM LISTINGS .. IDERIV I SUBROUTINE) 9/29/64 .. FAP ·IDERIV COUNT 150 LBL IDERIV IDERIV IYOFXl,DYDX,DELX,LY.YOFXI ENTRY ... . .. .. ... .. ... .. .. .. .. . . .. •. .. .. .... ...• • • ... .. .. .. ... .." ..." ... .... ... it " .. .. it .. .. " .. .. .. " .." .. ••••••••••••••••• * ••• ~ •• - IO£RIV - •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0148 0001 0002 0003 0004 0005 0006 0007 ----ABSTRACT---0008 0009 TITLE - IDERIV 0010 INVERSION OF DIFFERENTIATION BY DIFFERENCING 0011 0012 IDERIV PERfORMS THE INVERSE OPERATION TO THAT OF SUBROUTINE OERIVA. I.E. IT FINDS A VECTOR, YOfX, 0013 0014 WHOSE DERIVATIVE BY DIFFERENCING IS A GIVEN VECTOR. OYDX. THE INITIAL VALUE OF YOFX IS REQUIRED AS INPUT. 0015 0016 0017 THE OUTPUT VECTOR YOFX MAY REPLACE THE INPUT VECTOR. 0018 LANGUAGE - FAP SUBROUTINE (fORTRAN-II COMPATIBLE) 0019 0020 EQUIPMENT - 709 OR 1090 IMAIN FRAME ONLY) 0021 STORAGE - 54 REGISTERS 0022 SPEED 7090 709 7090 709 166.0 OR 70.6) + 125.4 OR 2B.6).LY MACHINE CYCLES 0023 0024 AUTHOR - S.M. SIMPSON, AUGUST 1963 0025 0026 ----USAGE---0027 0028 TRANSFER VECTOR CONTAINS ROUTINES - INONE) 0029 AND FORTRAN SYSTEM ROUTINES - (NONE) 0030 0031 FORTRAN USAGE 0032 CALL 10ERIVIYOfXl,OYOX,OELX,lY,YOfX) 0033 0034 NOTE THAT THE ARGUMENTS ARE IDENTICAL TO THOSE OF 0035 SUBROUTINE OERIVA EXCEPT THAT THE ORDER IS REVERSED. 0036 SEE SUBROUTINE DERIVA fOR DETAILED DISCUSSION. 0037 0038 INPUTS 0039 0040 YOFX1 IS STARTING VALUE FOR YOFXll) 0041 0042 OYOXIII l=l ••• lY IS THE DERIVATIVE AS PRODUCED BY DERJVA 0043 WAS THE INON-ZERO) DELTA X USED IN OBTAINING OYDX 0044 OElX 0045 0046 lY MUST EXCEED 1 0047 OUTPUTS STRAIGHT RETURN WITH NO ACTION IF lY lSTHN 2 OR DElX *0. 0048 0049 0050 YDFX( II l=l ••• LY IS THE INTEGRATED FORM OF DYOX. WHERE 0051 YOFX 111 = YOFX 1 0052 YOFX(2) = DElX"DYDXll) + YOFX(1) 0053 YOFXIKI = 2-0ElX.OYOXIK-11 + YOFXIK-2) FOR K = 3,4, •••• lY 0054 0055 0056 EQUIVAlENCEIYOfX,OYOXI IS PERMITTED. 0057 0058 EXAMPLES THESE EXAMPLES ARE THE INVERSES OF THE EXAMPLES USED 0059 FOR DERIVA. 0060 0061 1. INPUTS - 0111 ••• 51 4., 6 •• 6., 2., O. 0062 0211 ••• 5) -2.,-3.,-3.,-1., O. 0063 0311 ••• 21 4., 4. 0064 Y4 = Y5 = -999. 0065 USAGE CALL 10ERIVI 2., 01, 1., 5, Y11 0066 CAll IOERIVI 2., 02, -2., 5, Y2) 0067 CAll IDERIVI 2., 03, 1., 2, Y31 0068 CAll IOERIV( 2., 01, I., 1, Y41 0069 CAll IDERIV( 2 •• 01, 0., 5. Y51 0070 OUTPUTS - Ylll ••• 51 = Y2( 1••• 51 = 2., 6., 14., 18., 18. 0071 Y311 ••• 21 = 2., 6. Y4=Y5 = -999. INO OUTPUT CASES) 0072 0073 2. MULTIPLE INTEGRATION WITH OUTPUTS REPLACING INPUTS 0074 INPUTS - DYIl ••• 61 = 2., 0., -3., 0., 4 •• 4. •••••••••••••••••••••••• • IDERIV ,..••.•..•.•.•....•..... 10ERIV -•.•.•.•......•.• ........ PROGRAM I I STINGS • • •••••••••••••••••••••••• (PAGE 2) • • • • • • • • • FYll ••• 3)" 0 •• 4.. 4. INOTE REVERSAL OF ORDER FROM THAT IN EXAMPLE OF DERIVAt USAGE DO 10 1=1.3 10 CALL IDERIVIFYIII. DY. 1•• 6. DY) OUTPUTS - DYll ••• 61 4 •• 8 •• 12 •• 24., 20 •• 24. PROGRAMS FOLLOWS 8ElOW • NO TRANSFER VECTOR HTR 0 XR4 BCI 1.IOERIV • ONLY ENTRY. IDERIVIYOFX1. OYOX, OElX. lY. YOFX) IDERIV SXD IOERIV-2.4 • CHECK LY IGRTHN=2) AND OElX INON-ZEROI CLA. 4.4 lY TMI LEAVE POX 0.4 TXL lEAVE.4,1 SXD TXl.4 lXO IOERIV-2.4 CLA. 3.4 DEL X HE lEAVE • OK. SETUP XCA FMP Fl2 TWOOX STO 2·0ElX AIOYOX) ClA 2.4 SUB Kl AIOYOX)-1 STA GET2 ADD K2 AI OYOX )+1 STA GET 5,4 CLA Kl AIYOFX)-l SUB STA ST02 AIYOFX)+l ADD K2 STA STORE ADD K2 AI YOFX 1+3 FAD STA YOFX 11 ••• 2) • FORM AND SET OYOX C 1) 2.4 lOO· FMP TWODX OElX.OYOX C1) FOP H2 OlOOY SET ASIDE. STO ClA. 1,4 5.4 STO· OlODY FAD ·**=A COYOX )-1 GET2 lOO •• ST02 STO *uAIYOFX 1-1 •• SAVE OYOX(2) FOR lOOP OlOOY STO • EXIT IF lY=2 lXO TXl.4 TXl lEAVE,4.2 • OTHERWISE PROCEED TO lOOP 3,4 AXT K IN XR4 • lOOP TO SET YOFXI3.4 •••• K•••• lY) •• ,4 •• =AIOYOFX)+l GET CLA OlOOY lDO STO OlDDY FMP TWOOX •• ,4 •• =AIYOFX)+3 FAD FAD STORE STO *.,4 •• = I YOFX 1+1 TXI .+1.4,1 GET.4,·. TXl TXL • EXIT lEAVE lXO IOERIV-2.4 TRA 6.4 • CONSTANTS. TEMPORARIES 2.0 H2 DEC Kl PZE 1 K2 PZF 2 TWOOX PZE 2ttOELX OlOOY PZE OYOX I K-l) END ._,-... .. ,._,_. YOFXl IS YOFXllI. PLUS DElXttGYDXCl) IT BECOMES YOFXI2). OYOFXIK) SET ASIDE. 2.0ElX.OYOFXCK-11 PLUS YOFXIK-21 IS YOFXIK). STARTS AT QYDXI21 IPAGE 0075 0076 0077 0078 0019 0080 00B1 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 21 ****.***** ••• ***** •• **.* • IF (PSEUDO ENTRY) • ***** *****-- •• *."** ***'**** REFER TO SEVRAL PROGRAM Ll STINGS •• *****.******-********. • IF (PSEUDO ENTRY) * **** •• ******* •• ********. REFER TO SEVRAL .•••••••••••••••••••••••• . IFNCTN •••••••••••••••••••••••• PROGRAM 1I STINGS ••••••••••• *** •••• ** •••• .. IFNCTN .. •......•..•.... _....•.•. .. IFNCTN (SUBROUTINE) 9/4/64 LAST CARO IN OECK IS NO. 0443 .. FAP 0001 .IFNCTN 0002 COUNT 400 0003 LBL IFNCTN 0004 ENTRY IFNCTN (YOFX, LYOFX, XFIRST, XLAST, LXOFY, YLO, YHI. 0005 IERRLO. XOFY. IANS) 0006 0007 0008 ----ABSTRACT---0009 0010 • TITLE - IFNCTN 0011 .. INVERSION OF A MONOTONE FUNCTION BY LINEAR INTERPOLATION 0012 0013 IFNCTN TAKES A MONOTONELY INCREASING INON-OECREASING) 0014 OR MONOTONELY DECREASING (NON-INCREASING) SET OF 0015 FUNCTION VALUES 0016 0017 Y(X) FOR X = Xl. Xl+DX, Xl+20x •••• , X2=XI+(LY-IIDX 0018 0019 ANO PRODUCES, BY LINEAR INTERPOLATION, A SET OF FUNCTION 0020 VALUES 0021 0022 XIYI FOR Y = YLO, YLO+OY, ••• , YHI=YLO+CL~-l)DY 0023 0024 WHERE THE PROGRAM INPUTS ARE Y(X),LY,Xl,X2,LX,YLO, AND 0025 YHI. IF YIX) HAS FLAT AREAS WHOSE HEIGHTS ARE IN THE 0026 LIST OF ARGUMENTS OF XIY), THEN THE VALUES C~OSEN FOR 0027 X ARE THE MIDPOINTS OF SUCH AREAS. 0028 0029 0030 .. LANGUAGE - FAP SUBROUTINE IFORTRAN-II COMPATIBLE) 0031 .. EQUIPMENT - 709,7090,7094 (MAIN FRAME ONLY) 0032 .. STORAGE - 20B REGISTERS 0033 .. SPEED - IF YIX)- IS MONOTONE INCREASING, IFNCTN TAKES ABOUT 0034 2BO + 25 LY + 70 LX MACHINE CYCLES ON THE 7090, 0035 ANO IF Y(XI IS MONOTONE DECREASING, 0036 410 + 37 LY + 70 LX MACHINE CYCLES 0037 WITH LY AND LX AS DEFINED IN ABSTRACT • 0038 .. AUTHOR 0039 - S.M. SIMPSON, JUNE 1964 0040 0041 ----USAGE---0042 0043 .. TRANSFER VECTOR CONTAINS ROUTINES - MONOCK, REVER 0044 .. ANO FORTRAN SYSTEM ROUTINES - NOT ANY 0045 0046 .. FDRTRAN USAGE 0047 .. CALL IFNCTNIYOFX, LYOFX, XFIRST, XLAST, LXOFY, YLO, YHI, IERRLO, 0048 .. 1 XOFY, IANS) 0049 0050 0051 INPUTS 0052 0053 YOFX I II I=l ••• LYOFX IS THE SET OF VALUES YIX) OF THE ABSTRACT. 0054 0055 MUST BE EITHER NON-DECREASING OR NON-INCREASING. 0056 LYOFX 0057 IS THE QUANTITY LY OF THE ABSTRACT • 0058 MUST BE GRTHN= 2 • 0059 XFIRST IS THE ARGUMENT Xl OF THE ABSTRACT, I.E., YIXFIRSTI k 0060 YOFX I 11 • 0061 0062 IS THE ARGUMENT X2 OF THE ABSTRACT, I.E.. Y(XLAST) = 0063 • XlAST YOFXILYOFXI • 0064 0065 XLAST MUST NOT XFIRST IBUT MAY BE LESS THAN XLASTI. 0066 LXOFY 0067 IS THE ARGUMENT LX OF THE ABSTRACT • 0068 MUST BE GRTHN= 1 • 0069 YLO 0010 IS GIVEN IN THE ABSTRACT. LET YMIN = MINIMUMIYOFX(11) AND YMAX = MAXIMUMIYOFXII)). THEN YLO MUST SATISFY 0071 0072 YMIN LSTHN= YLO LSTHN YMAX FOR LXOFY GRTHN 1, 0073 OR YMIN LSTHN= YLO LSTHN= YMAX FOR LXOFY = 1 • 0074 .. .... .. ... ... ... .. ... . ... . .... . . ... . . . ..... ... . ... ... .. ... ... .. .. •••••••••••••••••••••••• . [FNCTN "•••••••••••••••••••••••• (PAGE •••••••••••••••••••••••• PROGRAM LISTINGS .. " " " ..... .. ..". . " • .... ...... .. ... .... .. ". ..• YH[ IERRlO [FNCTN (PAGE [S G[VEN [N ABSTRACT, BUT IT IS NOT REFERRED TO IF LXOFY 1 . IF LXOFY GRTHN= 2. THEN YHI SAT[SFY YLO LSTHN YHI LSTHN= YMAX. IS THE DESIRED ERROR VALUE FOR ILLEGAL INON-MONOTONE). SHOULD EXCEED ZERO. tANS IF YOFX MUST IS OUTPUTS YOF XI I I OUTPUT IS SAME AS INPUT EXCEPT THAT THE SIGN BITS OF ALL ZERO MAGNITUDE ELEMENTS, IF ANY, WILL BE MADE POSITIVE IF NOT ALREADY (RESULT OF ACTION BY SUBROUTINE MONOCK I • XOFY III I=I ••• LXOFY IS THE INVERSE FUNCTION, IANS 0 • IANS 0 IERRLO IERRlO+l IERRLO+3 IERRLO+4 IERRLO+5 IERRlO+6 IF IF IF IF IF IF IF COMPUTED ONLY IF All OK YOFX ILLEGAL LYOFX IllEGAL HAST ILLEGAL LXOFY ILLEGAL no ILLEGAL YHI ILLEGAL EXAMPLES " 1. MONOTONE INCREASING CASE " INPUTS - YOFX(1 ••• 91 = 1.,2.,3.,4.,4.,4.,4.,5.,6. lVOFX=9 " XFIRST~I.0 XlAST=9.0 LXOFY=5 YLO-l.5 YHI=5.5 .. IERRLO=1 "USAGE CALL IFNCTNIYOFX, LYOFX, XFIRST, XLAST, LXOFY. .. 1 YlO, YHI. IERRLO, XOFY, IANS) .. OUTPUTS XOFYI1 ••• 51 = 1.5,2.5,3.5,7.5,8.5 IANS-O • .. 2. MONOTONE .. INPUTS .. .. USAGE • OUTPUTS - DECREASING CASE SAME AS EXAMPLE I., EXCEPT YOFXIl ••• 91 = 6.,5.,4.,4.,4.,4.,3 •• 2 •• 1. SAME AS EXAMPLE 1. XOFYll ••• 51 = 8.5,7.5.6.5,2.5.1.5 IANS=O .. 3. NEGATIVE .. INPUTS " USAGE .. OUTPUTS - DELTA X CASE SAME AS EXAMPLE 1. EXCEPT XFIRST = 9.0 XLAST SAME AS EXAMPLE 1. XOFYll ••• 51 - 8.5.7.5,6.5,2.5,1.5 IANS· 0 .. 4. MONOTONE " INPUTS • " USAGE .. OUTPUTS - DECREASING AND NEGATIVE DELTA X CASE SAME AS EXAMPLE 1. BUT WITH THE EXCEPTIONS OF BOTH EXAMPLES 2. AND 3. SAME AS EXAMPLE 1. SAME AS EXAMPLE 1. • ." " " " • " .. .. .. .. • • .. ... " 1.0 5. SPECIAL CASES WITH LXOFY - 1,2,3 INVOLVING A FLAT AREA INPUTS - SAME AS EXAMPLE 1. EXCEPT YLO=2.~ YHI=6.0 AND THE OUTPUT XOFY IS AN ARRAY WITH DPMENSION XOFYtJ,3' Alt OF WHOSE ELEMENTS ARE INITIALLY SET -99. USAGE DO 10 LXY=I,3 10 CALL IFNCTNIYOFX, LYOFX. XFIRST. XLAST, LXY, YLO. 1 YHI, IERRLO. XOFYIl,LXYI. IANS(lXYll OUTPUTS - XOFY(I ••• 3.11 2.0,-99.,-99. XOFY(1 ••• 3,21 2.0.9.0,-99. XOFYll ••• 3,3J 2.0,5.5,9. IANSIl ••• 3) 0,0,0 6. SPECIAL CASE WITH • •••••••••••••••••••••••• 21 LYOFX = 2 INPUTS - SAME AS EXAMPLE 1. EXCEPT lYOFX=2 YLO-l.0 USAGE - SAME AS EXAMPLE 1 • OUTPUTS - XOFY(1 ••• 51 = 1.0.3.0,5.0,7.0,9.0 IANS=O YHI"2.0 • 7. ILLEGAL CASES .. INPUTS - YOFX211 ••• 3) = 0.,20.,10. YOFX SAME AS EXAMPLE 1. .. USAGES CALL IFNCTNIYOFX2,3,l.,2.,2,1.,2.,I,XOFYiIANS11 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0,111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 21 .•••••••••••••••••••••••• .. IFNCTN •••••••••••••••••••••••• PROGRAM llSTINGS .. IFNCTN .. -..•..••.•...•.•......•. •••••••••••••••••••••••• IPAGE 3) .. .. .. • • .. .. .. IPAGE CALL IFNCTN(YOFX,l,l.,2.,2.l.,2.,l,XOFY,JANS23 CALL IFNCTN(YOFX,2,l.,l.,2,1.,2.,1,XOFY.IANS41 CALL IFNCTN(YOFX,2,l.,2.,O,I.,2.,1.XOFY,IANS51 CALL IFNCTN(YOFX,2,1.,2.,2,0.,2.,1.XOFY,JANS6) CALL IFNCTN(YOFX,2,1.,2.,2,1.,20.,I,XOFY,IANS7A) CALL IFNCTNIYOFX,2,l.,2.,2,1.,I.,I,XOFY,fANS78) OUTPUTS - IANSl,2,4,5,6,7A,78, = 1,2,4,5,6,7,1 .. PROGRAM FOLLOWS BELOW . .. .. . .... •.. TRANSFER VECTOR CONTAINS MONOCKIX, LX, lFINCR, IANSNG, fANS) AND REVERIX, LX, XREVD) HTR HTR HTR BCI ONLY ENTRY. IFNCTN SXD SXD SXD .... • •.. .. • .• o o o XRl XR2 XR4 I,IFNCTN IFNCTNIYOFX, LYOFX, XFIRST, XLAST, LXDFY, YLO, VHf, IERRLO, XOFY, IANSI IFNCTN-4tl IFNCTN-3,2 IFNCTN-2,4 SET ADDRESSES CLA STA STA STA ADD STA STA STA STA STA ADD STA STA CLA ADD STA 1,4 TSXYI TSXRl TSXR3 Kl CLAYI CAS1 FS8l CLA2 CLA3 Kl FSB2 CAS2 9,4 Kl STOI A{YOFXI AIYOFXl+1 AIYOFXI+2 AIXOFYI AI XOFY 1+1 AND DECREMENTS CLA .. STD SUB STD CLA· SUB STD SUB Sf[) CHECK 2.4 TXH KDl TXLl 5,4 KOI TXL3 KOI TXL4 LYOFX GRTHN= 2, CLA" ADD POX CLA. STO CAS NOP TRA TRA SUB LRS ORA FAD STO TXI CLA .. 8,4 KOI 0,1 2,4 LYOFX KD2 ·+2 LEAVE K01 18 OCTK OCTK TEMPI "+1,1,2 4,4 LYOFX LYOFX-l LXOfY LXOFY-1 LXOFY-2 XFIRST NOT= XLAST, SET DElX, XNEXT~XFIRST IERRlO IERRLO+1 TO XRl FOR ERROR FLAG5ING LYOFX OK OK NG FLOATED LYOFX-l IERRLO+3 XLAS T 0150 0151 0152 0153 0154 0155 0156 01'51 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0110 0111 0172 0113 0174 0115 0116 0111 0118 0179 0180 0181 0182 0183 0184 018'5 0186 0181 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0201 0208 0209 0210 0211 0212 0213 0214 0215 0216 0211 0218 0219 0220 0221 0222 0223 0224 3) ....................... (PAGE •••••••••••••••••••••••• PROGRAM LISTINGS IFNCTN •* *••••••••••••••••••••••• • 4) XLAST 3,4 LEAVE TEMP1 DELX 3,4 XNEXT 6,4 YNEXT STO FSB* TZE FOP STQ CLA* STO CLA* STO XLAST-XFIRST EQUALITY ERROR = (XLAST-XFIRSTl/ILYOFX-11 INITIALIZE XNEXT = XFIRST AND YNEXT = YLO ** CHECK LXOFY GRTHN= 1, * TXI *+1,1,1 SUB1 ALSO SET * YOXCK TXI STZ LXO CLAYl CLA LOQ* STO STQ CAS* TRA TRA SXD STQ STO MONCK TSX TSXYl TSX TSX TSX TSX TSX LXO ZET TRA ** CHECK * YLO TXI CLA CAS TRA NOP TXI CLA CAS TRA NOP IF LXOFY GRTHN 1, OK OK, BUT BYPASS CHECKS, DELY NG LXOFY-1 FLOATEO IERRLO+6 YlO AGAINST YHI NG NG YHI YOFX IS INCREASING OR DECREASING AND GO CHECK YMAX. *+1,1,-6 ZF I NCR LYOFX,2 IERRLO + ZERO NOW SET lFINCR FOR INCREASING **,2 ** = AIYOFXI+l YOFXll1 TO MQ TRIAL SETTINGS 1,4 YMAX YMIN 1,4 MONCK MONCK ZFINCR,2 YMAX YMIN $MONOCK,4 .*,0 LYOFX,O ZFINCR,O KOl,O TEMP1,0 IFNCTN-2,4 TEMPI LEAVE *+1,1,5 YMIN YNEXT LEAVE *+1,1,1 YHI YMAX LEAVE OELY DEl Y GRTHN ZERO YMIN, GRTHN= FORM IERRLO+4 LXOFY LEAVE 7,4 YHI YNEXT TEMPl DELY * * NOW FIND OUT WHETHER * IT. YLD LSTHN YHI 5,4 LXOFY K01 SUB1 YOXCK,1,2 LEAVE KOI 18 OCTK OCTK TEMP1 *+1,1,2 6,4 7,4 CLA* STO CAS TRA TXI TRA SUB LRS ORA FAD STO TXI CLA. CAS* NOP TRA CLA* STO FSB FOP STQ IFNCTN * •••••••••••••••••••••••• (PAGE 41 YMIN, YOFX(LYOFXl IS INCREASING, OK IS CONSTANT, OK REVERSE SENSE OF ZFINCR AND YMAX AND YMIN ** = AIYOFXl IIANSNG,OI (IANS, Cl YHI LSTHN= YMAX IERRLO+5 I YNEXT NG OK OK YlO I NG OK ** FOR MONOTONE DECREASING, REVERSE YOFX AND THE X VARIABLES THEN ENTER 0225 0226 0227 0228 0229 0230 02.31 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0273 0274 0275 0276 0277 0278 0279 0280 0281 0282 0283 0284 0285 0286 0287 0288 0289 0290 0291 0292 0293 0294 0295 0296 0297 0298 0299 •••••••••••••••••••••••• • •••••••••••••••••••••••• PROGRAM LISTINGS • IFNCTN IFNCTN •........•.•.•.... -....." • •••••••••••••••••••••••• (PAGE 51 •.. • • • NLT TRA TSX CtA lDQ STO STQ ClA CHS STO •. IF I NCR START REV,2 XNEXT XlAST XlAST XNEXT. DElX DElX ENTER lOOP WITH XR1 XR2 • START •.. (PAGE lOOP AXT AXT TRA IYXNXT IXYNXT 1.1 1.2 CtAl RESET FOR NEXT XNEXT. I YXNXT lYOFX YGRYOX CtA FAD STO TXll TXl ClA STO . • CAS TXI TRA FORCING EXACT EQUALITY WITH XNEXT DElX XNEXT. ClA1tl.· .. XlAST XNEXT COMPARE YNEXT AGAINST .• ClAl ClA YNEXT CAS 1 ... NEXT lXOFY . • TXl3 TXl4 ST02 •. CLA FAD TXl TRA TXl ClA STO TXI YNEXT, YNEXT DELY TXl4,2, ... WINDUP ST02,.2, •• YHI YNEXT CASl,2,t FOR tYOFX-1 IFIRST VALUE" YlOI •• " AIYOFXI+1 IBUMP IYXNXT AND GO RESET XNEXTI .... ,1 YGRYOX,l,l EQUAL .*,2 XlAST YOFX(IYXNXTI • YNEXT IS NOW BRACKETED BY • YOFXIIYXNXTI FSB1 FSB ... ,1 STO TEMPI ClA2 CtA ".,1 FSB2 FSB •• ,1 S TO TEMP2 ClA TEMPI FOP TEMP2 FMP DElX FAD XNEXT • ST01 STO •.. RESET FOR 1, 2 ••••• l YOFX 1.2, •••• lXOFY YOFXIIYXNXT-11 lSTHN YNEXT lSTHN ... " AIYOFXI+l -IYOFXIIYXNXTI-YNEXTI ... AIYOFXI+1 •• " AIYOFXI+2 XNEXT-DElX"IYOFX(lYXNXT1-YNEXTII (YOFXIIYXNXT1-YOFXIIYXNXT-1)1 ... " AIXOFYI+1 FORCING ." ... YNEXT EXACTLY. = YHI FOR lXOFY-1 CHECK COMPLETION lXOFY-2 CHECK FOR lAST Y IXYNXT IF YNEXT YOFXIIYXNXTI IT MAY ALSO YOFX( IYXNXT+ 1) ETC. NO. OF SUCH EQUAL IT I ES. • THIS ROUTINE COUNTS NSAMEY 1, AND IT HANDLES THE SPECIAL CASES IN WHICH NSAMEY IN WHICH THE EQUALITIES RUN OFF THE END OF YOFX. .... •EQUAL TXIl TXH ClA3 CAS2 PXD POX lDQ TXI TXH ClA CAS 0,1 0,4 KD1 .+1.4,1 COVER,4, •• .*,4 *·,4 COUNT NSAMEY IN MQ START IYXTEMP " IYXNXT+l •• lYOFX YOFXIIYXTMP+ll •• AIYOFXI+l YOFX{IYXTMPI •• " AIYOFXI+2 0300 0301 0302 0303 0304 0305 0306 0307 030B 0309 0310 0311 0312 0313 0314 0315 0316 0317 0318 0319 0320 0321 0322 0323 0324 0325 0326 0327 0328 0329 0330 0331 0332 0333 0334 0335 0336 0331 0338 0339 0340 0341 0342 0343 0344 0345 0346 0347 0348 0349 0350 0351 0351 0353 0354 0355 0356 0357 0358 0359 0360 0361 0362 0363 0364 0365 0366 0367 0368 0369 0370 0371 0372 0373 0374 51 •••••••••••••••••••••••• IFNCTN * *•••••••••••••••••••••••• (PAGE •••••••••••••••••••••••• * IFNCTN • •••••••••••••••••••••••• PROGRAM LISTINGS 61 TRA XCA ADD * •• • XCA TRA THEN • •WINDUP COVER (CAS CAN'T JUMP HERE, GUARANTEED BY MONOCK) KD1 TXI1 XOFYIIXYNXTI COVER XCA SUB lRS ORA FAD FOP FMP FAD TRA (PAGE XNEXT + DElX.(NSAMEY-l1/2, ** EXIT. • IFNCTN-2.4 0,1 lFINCR RfV,2 IANS=O SEn ING 0,1 10,4 IANS IFNCTN-4,1 IFNCTN-3,2 11 ,4 • INTERNAL SUBROUTINE TO REVERSE • * * YOFX (ASSUMES XR4 RESTORED) lEAVE PXD STOlXD lXD TRA • NSAMEY K01 18 OCTK OCTK K2l DElX XNEXT STOI • FOR MONOTONE DECRfASING, RE-REVERSE lXD AXT lET TSX FOR ANY YOFX LINKAGE XR2, RETURN TO 1,2 (REFIllS XR4 FROM TSX REV TSXRl TSX TSX TSXR3 TSX lXD TRA IFNCTN-l) SREVER,4 **,0 lYOFX,O *·,0 IFNCTN-2,4 1,2 •• AIYDFXI •• AIYOFXI * - CONSTANTS • K1 KDl KD2 K2l OCTK PZE PZE PZE DEC OCT 0,0.1 0,0,2 2.0 233000000000 * • VARIABLES * l YOFX PlE lXOFY YHI OElX OElY XNEXT YNEXT XlAST YMAX YMIN TEMPI TEMP2 ZFINCR PZE PlE PIE PIE PlE PZE PIE PZE PZE PZE PZE PZE E"IO 0,0, •• .... ,, .... ,,_... ... , .. ...-, , .. , •. ..-.... , •. ,_. , .. •..-,-.,_. ,._, .. "., .. ,". 0,0,*. INPUT INPUT INPUT XF I RST (XlASTI YlO XlAST (+DElX ••• I (+DEl Y••• ) (XFIRSTI _.. ,*-,.- 0,0.** *.=0 IF MONO INCR., =lYDFX IF MONO DECR. 0315 0376 0377 031B 0379 0380 0381 0382 0383 0384 0385 0386 0387 0388 0389 0390 0391 0392 0393 0394 0395 0396 0397 0398 0399 0400 0401 0402 0403 0404 0405 0406 0407 0408 0409 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 0440 0441 0442 0443 61 •••••••••••••••••••••••• • IGETX ••••••••••••••••••••••••* REFER TO GETX PROGRAM 1I STINGS •••••••••••••••••••••••• • IGETX • • ••••••••••••••••••••••• REFER TO GETX •••••••••••••••••••••••• • IINTGR • •••••••••••••••••••••••• PROGRAM LISTINGS •••••••••••••••••••••••• .. UNTGR 9/29/64 LAST CARD IN DECK IS NO. 0156 • tINTGR (SUBROUTINE) 0001 • fAP 0002 -IINTGR COUNT 150 0003 [ [NTGR 0004 LBL ENTRY [INTGR (YOfXl.YIGRTO.DELX,LY.YOfX.CIGRTN) 0005 0006 0001 ----ABSTRACT--0008 0009 - TITLE - II NTGR 0010 INVERSION Of TRAPEZOIDAL INTEGRAL 0011 IINTGR PERfORMS THE [NVERSE OPERATION TO THAT Of 0012 0013 SUBROUTINE INTGRA. [.E. [T fINDS A VECTOR, YOfX, WHOSE TRAPEZOIOAL INTEGRAL. [S A GIVEN VECTOR, YIGRTO. 0014 THE INITIAL VALUE Of YOfX [S REQUIREO AS INPUT. THE 0015 • CONSTANT Of [NTEGRAT[ON [S AN OUTPUT • 0016 0011 THE OUTPUT VECTOR YOfX MAY REPLACE THE INPUT VICTOR. 0018 • 0019 0020 - fAP SUBROUTINE (fORTRA.N-I [ COMPATIBLE) • LANGUAGE 0021 - EQUIPMENT - 709 OR 7090 (MAIN fRAME ONLY) - 49 REGISTERS 0022 - STORAGE 7090 709 7090 709 0023 - SPEED 145.2 OR 47.0) + (37.8 OR 41.0).LY MACH[NE CYCLES. 0024 • 0025 LY : VECTOR LENGTH - S.M. SIMPSON. AUGUST 1963 0026 • AUTHOR 0021 • ----USAGE---0028 0029 0030 .. TRANSfER VECTOR CONTAINS ROUTINES - INONE) .. AND fORTRAN SYSTEM ROUT[NES - INONE) 0031 0032 0033 • FORTRAN USAGE 0034 • CALL I[NTGRIYOFX1,Y[GRTD,DELX,LY,YDFX,CIGRTN) 0035 • 0036 NOTE THAT THE ARGUMENTS ARE [OENTICAL TO THOSE OF 0037 SUBROUT[NE INTGRA EXCEPT THAT THE ORDER IS REVERSED. • SEE SUBROUTINE INTGRA FOR DETAILED DISCUSSION. 0038 • 0039 0040 .. INPUTS 0041 YOFXl START[NG VALUE FOR YOfX(ll 0042 0043 .. YIGRTOIIl I=l ••• LY IS THE TRAPEznIDALLY [NTEGRATED VECTOR 0044 0045 0046 WAS THE INON-ZEROl DELTA X USED [N OBTAINING YIGRTD DELX 0047 MUST EXCEEO ZERO 004B LY 0049 .. OUTPUTS STRAIGHT RETURN WITH NO ACTION IF LY LSTHN 1 OR DELX = O. 0050 0051 YOFX II I I:l ••• LY IS THE VECTOR WHICH [NTEGRATES TO Y['RTD 0052 YOFX I 1) YOFXl 0053 YOFXIKl = 12/0ELXI.IYIGRTDIKl-YIGRTDIK-11) - YDFX(K-l' 0054 0055 FOR K = Z,3, ••• ,LY • 0056 0057 EQUIVALENCE(YOFX,YIGRTD) [S PERM[TTED 0058 • 0059 CIGRTN IS SET = YIGRTDll1 0060 •.. EXAMPLES THE EXAMPLES USED HERE ARE THE INVERSES OF THE EXAMPLES 0061 USED FOR INTGRA 0062 • 0063 • 0., 1., 2., ••• , 6 • 0064 .. 1. [NPUTS - YIlll ••• 71 YF= 1. 0.,10.,20., ••• , 60. 0065 VI21l ••• 71 • 0066 0.,-2.,-4., ••• ,-12. YI31l ••• 7l • YI41l ••• 7) 1., 2., 3., ••• , 7. 0067 • -1., o. 0068 YI51l ••• 21 • -1. , 0069 YI6 III • 0070 Y7 = C1 : Y8 : C8 = -999. • 0071 CALL IINTGRI Yf, YIl, 1., 7, Yl, Cll 0072 USAGE • CALL IINTGRI YF, YI2, 10., 7, Y2, C21 0013 • CALL IINTGRI YF, YI3, -2., 7, Y3, (3) 0074 • --... . ... . .. .. .. .. . ..... .. ... . .. .. .... . . .. •••••••••••••••••••••••• • **** ••••••••••••••••••• -..•...•.•••......•.....* PROGRAM LISTINGS IINTGR " "•••••••••••••••••••••••• (PAGE . . .* * IPAGE CALL CALL CALL CALL CALL IINTGR( IINTGRI IINTGRI IINTGRI IINTGRI YF, YF, YF, YF. YF, Y14, YI5, Y16, Yll. YU. . 1., 7, I., 2, 1., 1, 1., O. 0., 7, Y4, Y5, Y6, Y7, YR, C41 C51 C61 C7I C81 OUTPUTS - Y1II)=Y2II)=Y3III=Y4III 1. FOR 1"'1 ••• 7 Y511 ••• 2 I = 1.,1. Y6111 " 1. Cl=O. C2=0. C3=0. C4=1. C5=-I. C6=-I. Y7=C7=Y8=C8 = -999. INO OUTPUT CASES) " 2. MULTIPLE " INPUTS .. " * USAGE " " OUTPUTS - . •••••••••••••••••••••••• 21 * * ... ... "IINTGR OIFFERENTIATION WITH OUTPUTS REPLACING INPUTS YIII ••• n = 0., 1., 6., 19., 44., 85., 146. YOFX111 ••• 3) = 0., 0., 4. INOTE THIS IS REVeRSED FROM EXAMPLE FOR INTGRA) DO 10 1=1,3 10 CALL IINTGRIYOFXIII),YI.1.,7,YI,CIII) YIll •• '11 4 •• 4., ••• ,4. Cll ••• 31 = 0.,0.,0. * PROGRAM FOLLOWS BELOW " "* NO TRANSFER VECTOR HTR XR4 o 1,IINTGR BCI * ONLY ENTRY. IINTGRCYOFX1, YIGRTO, DELX, LY, YOFX, CIGRTNI IINTGR SXD II NTGR-2, 4 " CHECK LY IAT LEAST .. II AND OELX INON-ZERO, UNLESS LY=l) 4,4 LY CLATMI LEAVE POX 0,4 TXL LEAVE,4,0 SXO TXL,4 STORE LY IF OK. LX04,4,1 TXL AVOID DELX BUSINESS IF LY " 1 LXO IINTGR-2,4 3,4 CLA* OElX TZE LEAVE STO TWOVDX ITEMP FOR DELX) CLA H2 FOP TWOVDX 2.0/DElX STQ TWOVOX * SET OUTPUTS FOR LY AT LEAST = 1 LX04 LXD IINTGR-2,4 2,4 YIGRTOl1l CLA" STO LASTYI SAVE FOR LOOP AND STORE IN CIGRTN STO" 6,4 CLA* 1,4 YOFX1 YOFX( 11 STO" 5,4 * THEN SET LOOP FOR LARGER LY CLA 2,4 ADD Kl AIYIGRTOI+l STA GET CLA 5,4 AIYOFX)+l ADD K1 STA STORE AOD K1 A(YOFXI+2 STA SUB * BUT BYPASS THE LOOP IF LY=l LXD TXL,4 TXL LEAVE,4,1 * OTHERWISE GO AHEAD WITH LOOP AXT 2,4 " LOOP TO SET YOFXI2 ••• LYI GET LOQ *.,4 A( Y I GR TO I + 1 ** CLS LASTYI SrQ LASTYI FAD LASTYI YIGRTOIKI-YIGRTOtK-l) XCA HIP TWOVOX TIMES 210ELX .*,4 SUB FSB ."=AIYOFX1+2 MINUS YOFXIK-ll ... ,4 STORE S TO ".=ACYOFX)+l BECOMES YOFXIKI TXI *+1,4,1 TXL TXL GET,4."" ""= LY " HIT LEAVE LXO IINTGR-2,4 0015 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 00B1 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 21 •••••••••••••••••••••••• PROGRAM LISTINGS IINTGR *•••••••••••••••••••••••• * (PAGE 31 1,4 TRA * CONSTANTS, TEMPORARIES Fl2· OEC 2.0 K1 PTE 1 , LASTYI PZE , TWOVDX PZE END .. ....... ..... •••••••••••••••••••••••• IINTGR * •••••••••••••••••••••••• * (PAGE = PREVIOUS 2.0/0ElX YIGRTD VALUE, START YtGRTDC11 0150 0151 0152 0153 0154 0155 0156 31 •••••••••••••• * ••••••••• INDATA * * *.** ••••• * •••••••••• ••• ~ PROGRAM LISTINGS • INDATA * •••••••••••••••••••••••• • INDATA (SUBROUTINE) 10/1/64 LAST CARD IN DECK IS NO. • LABEL CINDATA SUBROUTINE INDATA(ITAPE,IRECND,NOPTS.DATA,ERRI C C ----ABSTRACT---C C TITLE - INDAfA C FAST AND CONVENIENT RETRIEVAL OF CATA FROM A SPECIAL TAPE C C INDATA SEARCHES A TAPE CONSISTING OF MANY DATA SERIES AND C OTHER INFORMATION ABOUT EACH SERIES. THE REQUESTED INFORMATION IS RETURNED TO THE CALLING PROGRAM. THE C C DETAILS OF THE TAPE LAYOUT ARE DESCRIBED ALONG WITH THE SUBROUTINE OUDATA. C C C INDATA ACQUIRES ITS SPEED PRIMARILY THROUGH 1) HIGH C SPEED TAPE SCANNING ALONG WITH INTERNAL TABLES OF DATA C POSITION AND 2) BY ITS ABILITY TO READ DATA OF tIMITED C ACCURACY FROM A TIGHTLY PACKED FORMAT, FOR EXAMPLE, DATA C WITH AN ACCURACY OF ONE PART IN 4096 CAN BE STORED ON C ONE THIRD THE TAPE THAT WOULD BE REQUIRED USING FORTRAN BI NARY TAPE PROCEDURES. C C C INDATA ACQUIRES ITS CONVENIENCE THROUGH THE FACTS THAT C 1) THE PROGRAMMER HAS BOTH THE DATA, AND INFORMATION ABOUT THE DATA AVAILABLE BY MEANS OF A SINGLE CALt STATEMENT C C 2) THE PROGRAMMER NEED NOT KNOW ANY OETAILS ABOUT DATA C ARRANGEMENT, PACKING, TAPE POSITION, ETC. C C THE INDATA-OUDATA SYSTEM INCLUDES PROGRAMMED SUMCHECKS C ON DATA STORAGE AND RETRIEVAL WHICH ARE INDEPENDENT OF C BUILT-IN HARDWARE CHECKS. C C LANGUAGE - FORTRAN II, SUBROUTINE, (WITH SUBROUTINES IN FAP) C EQUIPMENT - 109 OR 1090 (DATA CHANNEL AND ONE TAPE UNIT) C STORAGE - 896 REGISTERS C SPEED C AUTHOR - J.F. CLAERBOUT C C ----USAGE---C C TRANSFER VECTOR CONTAINS ROUTINES - FAPSUM,FSKIP,LOC,MVBlOKlUNPAKN, C VARARG, XSAME, C AND FORTRAN SYSTEM ROUTINES - (FIL),(RLRl,(SPHl,{STHlIITSB). C C FORTRAN USAGE C CALL INDATA(ITAPE,IRECNO,NOPTS,DATA,ERR, •••••••• ~ ••••• ) C THE NUM8ER OF ARGUMENTS IN THE CALL STATEMENT IS VARIABLE C DEPENDING ON THE DESIRED INFORMATION, SEE EXAMPLES. C C INPUTS C ITAPE IS THE LOGICAL TAPE NUMBER TO BE SEARCHED AND READ. IF C C MORE THAN 2 DIFFERENT TAPE UNITS ARE TO BE USEO DURING C ONE J08, IT WILL BE NECESSARY TO CHANGE THE FIRST C DIMENSION CARD IN THIS PROGRAM. THIS IS DESCRI8ED JUST C PRECEDING THAT CARD. C C C C C C C C C C C C C C C C C ...... •......•.••...... - IRECNO THE REQUESTED DATA RECORD NUMBER. THE RECORD NUMBERS OF THE DATA RECORDS ON THE TAPE ARE SUPPLIED BY THE PERSONS WHO ORIGINATEO THE TAPE. THE NUMBERS MAY BE FIXED POINT, FLOATING POINT, OCTAL, OR ALPHANUMERIC. IF THE USER IS INTERESTED IN MERELY READING THE DATA RECORDS IN THE SEQUENCE THAT THEY OCCUR ON THE TAPE, HE MAY SET IRECNO=O IN WHICH CASE THE NEXT RECORD IS READ AND ITS ACTUAL RECORD NUMBER WILL BE RETURNED AS IRECNO. NOPTS NORMALLY THIS IS NOT AN INPUT. If HOWEVER THE PROGRAMMER IS NOT REQUESTING DATA, BUT ONLY INFORMATION ABOUT THE DATA, SUBSTANTIAL TIME CAN 8E SAVED BY AVOiDING THE ACTUAL DATA READ ANO INTERPRETATION. THE DATA WILL NOT BE READ IF NOPTS IS SET =IANY NEGATIVE NUMBERl BEFORE CALLING INDATA. 048B 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0021 0028 0029 0030 0031 0032 0033 0034 0035 0036 0031 0038 0039 0040 0041 0042 0043 0044 0045 0046 0041 0048 0049 0050 0051 0052 0053 0054 0055 0056 0051 0058 0059 0060 0061 0062 0063 0064 0065 0066 0061 0068 0069 0010 0011 0012 0073 0014 •••••••••••••••••••••••• • • INDATA PROGRAM LISTINGS 2) C C ••••••••• SEE ALSO INUATA (PAGE ((SPECIAL REQUESTS») BELOW fOR MORE INPUTS. C OUTPUTS C C C DATA(I) I=I,NOPTS IS THE RETURNED DATA SERIES. NORMAtLY THIS IS ASSUMED fLOATING POINT UNLESS OTHERWISE SPECIfiED BY THE ORIGINATOR Of THE TAPE. DATA MUST BE DIMENSIONED TO THE MAXIMUM Of EITHER 11 NOPTS+l OR 21 SOME NUMBER DEPENDING ON THE AMOUNT Of INfORMATION STORED ABOUT THE DATA.~.AS SUME 200 UNLESS SPECIFIED OTHERWISE BY ORIGINATOR OF TAPE ERR SPECIFIES AN ERROR CONDITION =0. IMPLIES NO ERROR CONDITION =1. REQUESTS NOT ON TAPE, ALL ELSE RETURNED ~ROPERLY =2. SUMCHECK ERROR O~ TAPE, EVERYTHING RETURNEO AS WELL AS POSSIBLE. PROGRAM TRIED TO USE MORE TAPES THAN THERE ARE =3. TABLES DIMENSIONED. SEE INPUTS- ITAPE. END DATA INFORMATION ON TAPE (I.E. THE RECORD NO. =4. CALLED WAS NOT FOUND). ILLEGAL LENGTH Of CALL STATEMENT. I.E. CALL =5. INDATAIARGI,ARG2, ••••••• ARGNI N MUST BE ODD. =6. MORE DATA RECORDS ON TAPE THAN SIZE OF INTERNAL BUfFER. CHANGE DIMENSION STATEMENT BELOW FOR IRECTS AND DEFINITION Of MAXREC. 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 WHEN AN ERROR CONDITION OCCURS, ERR, ITAPE, IRECNO, AND THE REQUEST (IF ERR = I.) ARE PRINTED ON-LINE. IRECNO IF IRECNO WAS SET =0 ON INPUT THEN IT WILL BE RESET TO THE RECORD NUMBER FOUND NEXT ON THE TAPE. NOPTS IF NOPTS WAS SET LSTHN 0 THEN THE CORRECT NOPTS FOR THE IRECNO IS RETURNED. ••••••••• *SEE ALSO IISPECIAL REQUESTS») BELOW FOR MORE OUTPUTS. SPECIAL REQUESTS C INDATA IS A DEPARTURE FROM NORMAL FORTRAN PROGRAMMING IN THAT THE CALLING PROCEDURE DEPENDS ON THE NEEDS OF THE PROGRAMMER. THIS IS BEST EXPLAINED THRU THE EXAMPLES. THE BASIC IDEA IS THAT ONE GENERALLY NEEDS MORE THAN JUST RAW DATA. IN SEISMIC TIME SERIES FOR EXAMPLE ONE OFTEN ALSO NEEDS VARIOUS INFORMATION ABOUT THE SEISMIC EVENT, ITS RECORDING, AND TTS DIGITIZATION. GENERALLY THE ORIGINATOR OF THE TAPE WILL SUPPLY ALL OF THIS INFORMATION ON THE TAPE. IF THIS INFORMATION IS ON THE TAPE AND IF THE PROGRAMMER REQUESTS ANY PORTION OF IT, INDATA WILL RETURN HIS REQUEST. A REQUEST IS MADE BY MEANS OF A NAME 16 CHARACTERS OR LESSI SUPPLIED BY THE TAPE ORIGINATOR. FOR EXAMPLE THE NAME (IDELTATI) MIGHT REfER TO THE DIGITllATION SAMPLING TIME OF THE DATA. C C A MAXIMUM OF 25 SPECIAL REQUESTS IS ALLOWED. C C C C C C C C C C C EXAMPLES C C C C 1. USAGE C C C C C C C C C C C C C C C C • •••••••••••••••••••••••• •••••••••••••••••••••••• (PAGE ••••••••••••••••• ** ••••• • 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 1)118 0119 0120 0121 0122 0123 0124 0125 0126 0127 012B P129 IN THE FOLLOWING EXAMPLES THE VARIABLE NOPTS IS ASSUMED TO BE NON-NEGATIVE ON ENTRY TO INDATA, EXCEPT AS NOTED. CALL INDATAI9,63,NOPTS,DArA.ERRI OUTPUTS - TAPE NUMBER 9 IS SCANNED IN SEARCH OF DATA RECORD NUMBER 63 (WHICH IS GENERALLY NOT THE 63RD RECORO ON THE TAPEI. WHEN IT IS FOUND, NOPTS IS SET TO THE NUMBER OF POINTS IN THE DATA RECORD, (DATAII),I=l,NOPTS) IS RETURNED AND ERR IS SE T =0 2. INPUTS - IRECNO = 0 CALL INOATA{9,IRECNO,NOPTS,DATA,ERR) USAGE OUTPUTS - INSTEAD OF SCANNING THE TAPE THE NEXT RECORD IN POSITION IS READ. ITS RECORD NUMBER IS RETURNED AS IRECNO. OTHERWISE THE READ OCCURS AS IN EXAMPLE 1. 3. USAGE CALL INDATA(9,62,NOPTS,DATA,ERR,6HDELTAT,DT) OUTPUTS - THIS IS LIKE EXAMPLE 1. EXCEPT FOR THE INCLUSI0N OF TWO MORE ARGUMENTS FOLLOWING ERR. THE FIRST OF THESE, (DEL TAT) IS THE NAME WHICH WE CONVENTIONALLY USE FOR 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 014B 0149 2) •••••••••••••••••••••••• INDATA • •••••••••••••••••••••••• PROGRAM LISTINGS • IPAGE 3) •••••••••••••••••••••••• • INDATA • •••••••••••••••••••••••• (PAGE 31 THE TIME ~AMPLING OF THE DATA SERIES. THUS IF-ONE OF OUR SEISMIC TAPES WERE ON TAPE DRIVE 9. SEISMIC RECORD 62 WOULD BE FOUND AND READ INTO DATAII),I=l.NOPTS. NOPTS WOULD BE SET =3301 , DT WOULD BE SET z.Ol INDICATING 3301 POINTS WERE DIGITIZED AT 20 POINTS PER SECOND. GENERALLY THEN, AFTER ERR IN THE CALLING SEQUENCE APPEAR ARGUMENTS IN PAIRS. THE FIRST BEING THE NAME OF THE REQUEST, THE SECOND MEMBER OF THE PAIR BEING THE FORTRAN VARIABLE NAME OF THE REQUESTED INFORMATION. SEE THE FOLLOWING EXAMPLE. C C C C C C C C C C C DIMENSION TC 101 C 4. USAGE CALL INDATAI9.62.NOPTS.DATA,ERR.5HTITLE.T~6HDELTAT. C DT,3HJOB,JI C OUTPUTS - THIS IS JUST LIKE EXAMPLE 3. EXCEPT THAT MORE SPECIAL C REQUESTS ARE MADE. NOTICE THAT THE SPECIAL REQ~EST C ITITLEI IS A VECTOR AND THEREFORE IS DIMENSIONED. REQUEST C IJOBI IS FIXED POINT HENCE IJI IS A FIXED 'OINt VARIABLE C NAME. C C C C C C C C 5. USAGE NOPTS '"-1 CALL INDATAI9,62.NOPTS.DATA,ERR,6HDElTAT4DT' OUTPUTS - THIS IS JUST LIKE EXAMPLE 3. EXCEPT-THAT DATAIII IS NOT READ FROM THE TAPE RESULTING IN A SUBSTANTIAL tIME SAVING NOPTS AND DT ARE RETURNED AS IN EXAMPlE 3. DATA MUS' STILL BE DIMENSIONED AS IN EXAMPLE 3. C C C DIMENSION 1\31 REWIND IJAPE C C C C C 00 10 10 C C C C C C C C C C C C C C C C C C C C C C NOW TEST INDATA DO 10 1=1,10 CALL INDATA IITAPE,IRECNOIII,NOPTS,DATAIII.ERRlflt CONTINUE 10 NOPTS=l OUTPUTS - DATAll ••• 10) = 1,5,9,4,4.4,4,3,2,1 ERR 11 ••• 101 '" 0,0,0.0.0.0,0,0,0,0 USAGE IRECNOll ••• 10) = 1,1 •• 5, 4,9.,5., 4, 4,3., 7 C ASSUME TWO TAPES CONSTRUCTED AS IN EXAMPLE 6. C LOGICAL TAPE 9 CONTAINS FIXED POINT INTE5ERS FOR C RECORD NUMBERS AND UNPACKED DATA, C LOGICAL TAPE 12 CONTAINS FLOATING PO«NT INTEGERS 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 01H 0174 0175 0176 0178 0179 01BO 0181 0182 01B3 01B4 01B5 0186 0187 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 020'0 0205 0206 0207 0208 0209 0210 C DO 10 1.,1, 10 CALL INDATA IITAPEIII,IRECNOIII,NOPTS,DATAIII, 1 ERRII)) 10 CONTINUE OUTPUTS - DATAI1 ••• 101 z 1,1., 5, 4,9.,5., 4, 4,3., 7 ERR 11 ••• 101 = 0, O. 0, 0, 0, 0, 0, 0, 0, 0 = C 0162 01B8 C 8. TEST OF SEQUENTIAL READING OF RECORDS INPUTS - IT APE .. 9 IRECNOI1 ••• 5) 0,0,0,0,0 C USAGE - C ASSUME A DATA TAPE CONSTRUCTED AS IN EXAMPLE 6. C C C C C 0161 0189 1"1.10 CALL OUDATA IITAPE,I.l,I,11 CONTINUE CALL OUDATA IITAPE,0.1,DATA,11 REW I NO IT APE C 7. TEST OF SEARCHING ABILITY ON 2 TAPE UNITS lAND ILLUSTRATE USE OF NON-FIXED POINT RECORD NUMBERS. C INPUTS - ITAPEI1 ••• 10) = 9,12, 9, 9,12,12. 9, 9,12. 9 C C· C 0156 0157 0158 0159 0160 0177 THE FOLLOWING EXAMPLES ARE TESTS THAT ARE TO VERIFY THAT ALL OF THE FEATURES OF INDATA ACTUALLY WORK. A SPECIAL INDATA-OUDAlA TYPE C TAPE IS GENERATED FOR EACH TEST. C C C 6. TEST OF SEARCHING ABILITY ON 1 TAPE UNIT INPUTS - ITAPE • 9" IRECNOI1 ••• 1D)" 1,5,9,4,4,4,4,3.2,1 C USAGE C FIRST CONSTRUCT A TAPE WITH 10 FILES. EACH FILE C C HAVING 1 UNPACKED INTEGER DATA POINT IDENHCAL WITH C C THE RECORD NUMBER, AND WITH NO AUXILIARY IN~O. C C 0150 0151 0152 0153 0154 0155 REWIND ITAPE DO 10 1=1,5 CALL INOATA IITAPE,lRECNOlll.NOPTS,DATAII),ERRlllt 0211 0212 0113 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 •••••••••••••••••••••••• IPAGE -• .••...•.•••.....••...•. INOATA • PROGRAM LISTINGS I NOATA • ••••••••••••••••••••••••• ..., ...•............•... 4) C C C C C C 9. 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 CI0. C C C C C C C C C C C C C C C Cl1. C C C C C C C C C C C C C C C C C C C C C12. C C C C C IPAGE 10 CONTINUE OUTPUTS - IRECNOIl ••• 5) = 1,2,3,4,5 DATA 11 ••• 5) = 1,2,3,4,5 ERR 11 ••• 5) = 0,0.0,0.0 TEST O~ NON-RETURN OF OATA AND GETTING SPECIAL REQUESTS. INPUTS - (FOR CALLING INDATA) ITAPE =12 IRECNO = 0 NOPTS = -1 USAGE C CONSTRUCT A DATA TAPE WITH AUXILIARY INFmRMATION C FOR THIS PURPOSE LET C DT = .05 C TITlEll ••• 8) 6H REPRESENTATIVE TITLE fiOR REC~ C DATA 11 ••• 5' = 1.,2 •• 3 •• 4 •• 5. C REWIND 12 CAll OUDATAI12,6HSAMPlE,5,DATA,3, 1 6HDElTAT.l,DT 2 5HTITLE ,8,TITlE) CALL OUDATA (12,O.l,DATA.I) REWIND 12 C C DIMENSION DATA SO THAT INDATA WILL HAVE (OMPUTATION C SPACE - EVEN THOUGH DATA IS NOT WANTED. DIMENSION DATAI2001.TITLE(8) C CAll INDATA (ITAPE,IRECND,NOPTS.DATA.ERRi 1 6HDELTAT,DT. 5HTITLE .TITLEI OUTPUTS - IRECNO = 6HSAMPlE NDPTS =5 ERR = o. DATA CONTAINS MEANINGLESS NUMBERS DT = .05 TITLEl1 ••• 8) = 6H REPRESENTATIVE TITLE FOR REC TEST OF ERROR CONDITION REQUESTS NOT ON TAPE, ALt ELSE RETURNED INPUTS - ITAPE =12 IRECNO = 0 NOPTS = 0 USAGE - C ASSUME A DATA TAPE CONSTRUCTED AS IN EXAMPLE 9~ C C DIMENSION DATAI2001.TITlEIB) REW I NO IT APE CALL INOATA IITAPE,IRECNO.NOPTS,DATA.ERR, 1 6HOElTAT,OT 2 6HNO REQ,NON) OUTPUTS - IRECNO = 6HSAMPlE DATAl1 ••• 5) = 1.,2.,3.,4.,1. ERR 1.0 DT = .05 NOPTS = ~ AND ON-LINE PRINTED ~ESSAGE NO REQ ERROR IN SUBROUTINE INDATA, ERROR CODE I., TAPEslZ RECORD NUMBER IN OCTAl= 622144474325 = = TEST ERROR CONDITION SUMCHECK ERROR ON TAPE. EVERYTHING RETURNED AS WEll AS POSSIBLE. INPUTS - ITAPE =12 IRECNO = 0 USAGE - C CONSTRUCT A DATA FILE WITH AUXILIARY INFORMATION C BUT CHANGE THE SUMCHECK ON THE DATA C LET DATAIl ••• S) = 1.,2.,3 •• 4.,5. ZERO a O. REW IND 12 CALL OUDATAI12.6H ERROR,5,OATA,l,6HOElTAt,l.DTl 8ACKSPACE 12 BACKSPACE 12 WRITE TAPE 12, IDATAII).1=1.51.ZERO END FILE 12 CALL OUDATA 112,O.l,DATA.l) REWIND 12 C C TEST INDATA CALL INOATA IITAPE,IRECND,NOPTS,DATA,ERR, 1 6HDElTAT,DT) OUTPUTS - IRECNO = bH ERROR NOPTS = 5 DATAll ••• 5) = 1.,2.,3.,4 •• 5 ERR = 2.0 DT = .05 AND ON-LINE MESSAGE (SEE EX. 10) TEST ERROR CONDITION INPUTS USAGE PROGRAM THERE - ITAPE'I ••• 3) '" 9,12,11 IRECNOll ••• 3)= 0, 0, 0 ASSUME TWO TAPES - C THERE IS NO NEED C TRIED TO USE MORE TAPES THAN ARE TABLES DIMENSIONED NOPTSI1 ••• 3) -1.-1,-1 = ARE SET UP AS IN EXAMPLE 7. TO SET UP A TAPE ON lOGICAL 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 ~" 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 ~~ 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0273 0274 0275 0276 0277 0278 0279 0280 0281 0282 02B3 0284 0285 0286 0287 0288 0289 0290 0291 0292 0293 0294 0295 0296 0297 ~~ 0299 4) •••••••••••••••••••••••• INOATA * •••••••••••••••••••••••• PROGRAM LISTINGS • IPAGE ..•.•.•.•••.•.......... INOATA • _..•.•.•.•••......•...•. ~ • 5) c c c C (PAGE UNIT 11 BECAUSE INO~TA WILL NEVER GET THERE. C ,,c , C 00 10 1=1,3 CALL INDATA IITAPElll,IRECNOII),NOPTSII),DATA, 1 ERRIJ II 10 CONTINUE OUTPUTS - ERRl1 ••• 31 '" 0.,0 •• 3. AND ON-LINE MESSAGE ISEE EX. 10l C13. TEST ERROR CONDITION C , C INPUTS USAGE C C ENO DATA INFORMATION ON TAPE (RECORD NO~ CALLED FOR WAS NOT FOUND) - nAPE = 9 IRECNO = 41 ASSUME A DATA TAPE CONSTRUCTED AS IN EXAMPLE 6. - C C OUTPUTS - ERR C C CALL INDATA IITAPE,IRECNO,NOPTS,DATA,ERR) 4.0 AND ON-LINE MESSAGE ISEE EX. 10) , , ILLEGAL LENGTH OF CALL STATEMENT '14. TEST ERROR CONDITION INPUTS - ITAPE = 12 IRECNO = 0 C USAGE CALL INOATA (ITAPE,IRECNO,NOPTS.DATA.ERR, 1 6HDELTAT) C OUTPUTS - ERR = 5. AND ON-LINE MESSAGE (SEE EX. 101 C C15. TEST ERROR CONDITION C C C , INPUTS USAGE MORE RECORDS ON TAPE THAN SIZE OF INTERNAL BUFFER OF INDATA. - nAPE '" 9 IRECNO = 105 CONSTRUCT A DATA TAPE AS IN EXAMPLE 6 EXCEPT - C C PUT 110 FILES ON IT RATHER THAN 10. C C C C OUTPUTS - ERR CALL INDATA (ITAPE,IRECNO,NOPTS.DATA,ERR) 6. AND ON-LINE MESSAGE (SEE EX. 10) C C PROGRAM FOLLOWS BELOW C C C C C C C LET NTAPES BE THE NUMBER OF DATA TAPES BEING READ AND LET MAXREC BE THE MAXIMUM NUMBER OF DATA RECORDS, THEN A DIMENSION STATEMENT OF THE FOLLOWING TYPE IS NEEDED ••• DIMENSION IRECTB(MAXREC,NTAPESI,IPOSITINTAPESI,LOGICLINTAPES), lLENTBLCNTAPESI FOR EXAMPLE THREE CARDS OF THE FOLLOWING FORM MUST BE PRESENT NTAPES=2 MAXREC=100 DIMENSION IRECTBll00,2I,IPOSIT(2I,LOGICL(2l,LENTBL(2l C C C C 10 20 C 22 24 26 2B C 30 C 40 C DO NOT CHANGE THE FOLLOWING CARDS DIMENSION LOCSI50l,REQSI2,25l,DATAl5000l EQUIVALENCEILOCSl6l,REQSllli SET UP VARIABLE LENGTH CALL AND RETURN CALL VARARGlLOCSl GO TO 20 RETURN CONTINUE IS THE CALLING SEQUENCE LEGAL... 1000 NO. OF ARGUMENTSl LCALL=O LCALL=LCALL+l IFILOCSILCAlLIl22,24,22 IFlXMOOFlLCALL,2l126,2B,26 ERR=5. GO TO 310 CONTINUE ERR=O. NOPTSS=NOPTS IS ITAPE ON TABLE OF LOGICAL TAPE NUMHERS 00 30 l=l,NTAPES IUNIT=I IFlITAPE-LOGICLIII) 30,60,30 CONTINUE NO, IS THERE ROOM ON LIST OF TAPE NUMBERS FOR ITAPE 00 40 l=l,NTAPES IUNiT=! IF(LOGICLII I l 40,50,40 CONTINUE IF PROGRAM GETS HERE. THERE ARE TOO MANY TAPES BEING REFERRED TO ERR=3. GO TO 290 0300 0301 0302 0303 0304 0305 0306 0301 0308 0309 0310 0311 0312 0313 0314 0315 0316 0317 0318 0319 0320 0321 0322 0323 0324 0325 0326 0321 032B 0329 0330 OBI 0332 0333 0334 0335 0336 0137 0338 0339 0340 0341 0342 0343 0344 0345 0346 0347 0348 0349 0350 0351 0352 0353 0354 0355 0356 0357 0358 0359 0360 0361 0362 0363 0364 0365 0366 0367 0368 0.369 0310 0311 0312 0313 0314 5) •••••••••••••••••••••••• INDATA •...................... (PAGE 6) C 50 60 C C 70 C 80 C C 90 C C 100 C C C 110 115 120 C C C 124 125 126 127 C C C 130 135 C 138 140 C 150 160 C 170 180 C 185 C 190 200 C -. * PROGRAM LISTINGS ••••••• ** ••••••• *.** •••• .*.. .. INDATA ~** • •••••••••• * •••••• PUT ITAPE ON LIST OF TAPE NUMBERS lOGICLIIUNITI=ITAPE CONTINUE NOW WE KNOW WHICH TAPES ARE READ. AND WHICH TABLES TO REFER TO IF THE REQUESTED RECNO IS ZERO. WE AVOID IRECTB SCAN IFIIRECNO) 70.100.70 CONTINUE IS REQUESTEO RECORD ON IRECTB (FIRST TIME THRU.J=O.DOESNT MATTER) J=LENTBU !UNIT) 00 80 l=l.J 11=1 IF(IRECNO-IRECTB(I,IUNIT») 80.90,80 CONTINUE NOT ON I REC TB SKIP TAPE TO END OF KNOWN PORTION CALL FSKIP(ITAPE,LENTBL(IUNIT)-IPOSIT(IUNIT» IPOSIT(IUNITI=LENTBLIIUNIT) GO TO 100 CONTINUE SKIP TO CORRECT POSITION ON TAPE, FSKIP IS FILE SKIPPING ROUTINE IIPOSIT IS TAPE FILES FROM BEGINNING OF TAPE) CALL FSKIP(ITAPE,II-1-IPDSIT(IUNITII IPOSITIIUNIT)=II-l CONTINUE READ NEXT SEISMOGRAM FROM DATA TAPE READ ABOUT TAPE LAYOUT READ TAPE ITAPE,IREC,NALPHA,NOPTS,MODCOD,SCALE AT END OF TAPE YET IFIIRECI 120,110,120 ERR=4. CALL FSKIP(ITAPE,-11 GO TO 290 CONTINUE IS IREC ALREADY ON TABLE ••• YES, NO, IMPOSSIBLE IF(IPOSITIIUNITI-LENTBLIIUNITII 127,124,124 NO, AUGMENT TABLE LENGTH COUNTER, ADD IREC TO TABLE. CONTINUE LENTBLIIUNITI=LENTBL(IUNITI+1 IFILENTBLIIUNITI-MAXRECI 126,126,125 ERR=6. GO TO 115 J=LENTBlI !UNIT I IRECTBIJ,IUNIT)=IREC CONTINUE AUGMENT TAPE POSITION COUNTER IPOSIT(IUNITI=IPOSITIIUNITI+l IS THIS THE DESIRED RECORD IF IRECNO IS ZERO WE TAKE ANY RECORD IF IIRECNOI 130,138,130 IFIIRECNO-IRECI135,140,135 CALL FSKIP(ITAPE,11 GO TO 100 YES, THIS IS THE DESIRED RECORD IRECNO = IREC CONTINUE PREPARE 10 READ AUX INFO BLOCK READ TAPE ITAPE.(DATAII).I=I.NALPHAI CALL FAPSUMINALPHA-l.0ATA,SUMCKI IF(DATA(NALPHAI-SUMCKI 150.160,150 ERR=2. CONTINUE PICK UP A REQUEST J=O CALL LOCIREQUES.LRI J=J+l END OF "REQUESTS YET ••• IF(REQS(l,JII185.260,185 CALL -MVBLOK(I,REQSll,JI,LRI SCAN AUX. BLOCK TO SEE IF REQUEST WAS ON TAPE 1=1 ALPHA=DATAIII LBLOK=XSAMEFIDATAII+111 IFIREQUES-ALPHA} 210.250.210 HAS ALL OF AUX 8LOK BEEN SCANNED WITHOUT SUCCESS (PAGE 0375 0376 0377 0378 0379 0380 0381 0382 0383 0384 0385 0386 0387 0388 0389 0390 0391 0392 0393 0394 0395 0396 0397 0398 0399 0400 0401 0402 0403 0404 0405 0406 0407 0408 0409 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 0440 0441 0442 0443 0444 0445 0446 0447 0448 0449 6) •••••••••••••••••••••••• • INOATA • •••••••••••••••••••••••• (PAGE 71 210 220 230 240 C 250 C C 260 C 270 272 275 C 280 C 290 300 305 310 320 PROGRAM LI STINGS -..•...•.•.....•........ INOATA • • •••••••••••••••••••••••• IFIALPHAI 240,220,240 ERR=I. PRINT 230,REQUES WRITE OUTPUT TAPE 2,230,REQUES FORMA TllH , A6) GO TO 180 I=I+2+LBlOK GO TO 200 MOVE REQUEST TO CALLING PROGRAM CALL lOCIDATAII+2),ll CALL MVBLOKILBLOK,L,REQSI2,J)1 GO TO 180 ALL SET TO GET DATA. IF NOPTS WAS NEGATIVE, SKIP OVER DATA CONTINUE IFINOPTSSI280,270,270 COMPUTE LENGTH OF DATA BLOCK IDON'T FORGET SUMCHECKl N=INOPTS+MODCOD-11/MODCOD+1 READ TAPE ITAPE,IDATAIII,I=l,NI CALL FAPSUMIN-1,DATA,SUMCKI IFIDATAINI-SUMCK) 272,275,272 ERR=2. CALL UNPAKNIMODCOD,NOPTS,DATA,SCALE) PASS OVER END OF FILE MARK CALL FSKIPIITAPE,l) IFIERR) 290,10,290 ERROR PRINT CONTINUE IFIERR-4.) 310,300,310 IF IIRECNO) 310,305,310 ERR=O. GO TO 10 CONTINUE PRINT 320,ERR,ITAPE,IRECNO WRITE OUTPUT TAPE 2,320,ERR,ITAPE,IRECNO FORMATe 41H ERROR IN SUBROUTINE INDATA, ERROR CODE =,F3.0t 17H t TAPE=tI2~25H RECORD NUMRER IN OCTAL-t015) GO TO 10 END IPAGE 0450 0451 0452 0453 0454 0455 0456 0457 0458 0459 0460 0461 0462 0463 0464 0465 0466 0467 0468 0469 0470 0411 0472 0473 0474 0475 0476 0477 0478 0479 0480 0481 0482 0483 0484 0485 0486 0487 0488 7) .•••••••••••••••••••••••• INDEX • PROGRAM LI STINGS • •. ... <0 .. . ..• • • • • •.. •.. • • • • .. <0 • • •. . • • • • • • • • • • • .. •.. • •• • •. • ...• • • •.. .... .. •. . (FUNCTIONS) • INDEX LAST CARD IN DECK IS NO. 0269 0001 0002 0003 COUNT 300 0004 INDEX LBL 0005 ENTRY INDEX F ( I. ICRTCl! ENTRY VINDEX FII,ICRTCL,IJUMP) 0006 ENTRY SETEST FIX,XNEW,XCRTCL) 0007 0008 ENTRY SETAPT FIX,XNEW,FVAlUE) 0009 CHUSET FIX,Xl,X2,ZIFX1) ENTRY 0010 0011 ----ABSTRACT---0012 0013 TITLE - INDEX, WITH SECONDARY ENTRIES VINDEX,SETEST,SETAPT, AND CHUSET 0014 HYBRID SUBPROGRAMS FO~ INCREMENTING, TESTING, AND SEITING 0015 0016 THESE PROGRAMS ARE OPERATED AS FORTRAN-II FUNCTIONS BUT 0017 ALSO MODIFY THE CONTENTS OF THE STORAGE lOCATION 0018 CORRESPONOING TO THEIR FIRST ARGUMENT. THE FUNCTION 0019 VALUES ARE DESIGNED FOR CONTROL APPLICATIONS IN IF 0020 0021 STATEMENTS. 0022 0023 INDEX ADDS A FIXED POINT 1 TO ITS FIRST ARG~MENT AND 0024 HAS VALUE -1.0. 0.0, 1.0 ACCORDING AS THE SUM IS lSTHN, EQUAL TO, OR GRTHN ITS SECOND ARGUMENT. 0025 0026 VINDEX ADDS ITS THIRD ARGUMENT (FIXED POINT) TO ITS 0027 FIRST AND IS OTHERWISE THE SAME AS INDEX. 0028 0029 SETEST SETS ITS FIRST ARGUMENT EQUAL ITS SECOND AND HAS 0030 VALUE -1.0, 0.0, 1.0 ACCORDING AS ITS SECOND ARGUMENT 0031 IS lSTHN, EQuAL TO, OR GRTHN ITS THIRD ARGUMENT, THE 0032 ARGUMENT MODES BEING ARBITRARY. 0033 0034 0035 SETAPT SETS ITS FIRST ARGUMENT EQUAL ITS SECOND. ANO HAS 0036 VALUE EQUAL ITS THIRO ARGUMENT. 0037 0038 CHUSET SETS ITS FIRST ARGUMENT EQUAL ITS SECOND IIF ITS FOURTH HAS ZERO MAGNITUDE) OR ITS THIRO (IF ITS FOURTH 0039 HAS NON-ZERO MAGNITUOE), AND HAS VALUE EQUAL ITS FOURTH 0040 0041 ARGUMENT. 0042 0043 THE COMPARISONS OF INDEX, VINDEX, AND SETEST TREAT 0044 PLUS AND MINUS ZERO AS EQUAL. 0045 0046 - FAP FUNCTIONS (FORTRAN-II COMPATIBLE) LANGUAGE 0047 EQUIPMENT - 709,7090,7094 IMAIN FRAME ONLY) 0048 - 50 REGISTERS STORAGE 0049 - ABOUT 70 MACHINE CYCLES SPEED 0050 AUTHOR - S.M. SIMPSON, JUNE 1964 0051 0052 0053 ----USAGE---00'54 0055 NO TRANSFER VECTOR 0056 0057 0058 0059 FORTRAN USAGE OF INDEX FUNCTION 0060 ANS : INDEXFll,ICRTCl) 0061 0062 INPUTS TO INDEX 0063 0064 AND ICRTCl ARE FIXED POINT. 0065 0066 OUTPUTS FROM INDEX 0067 0068 I+l 0069 ICRTCl 0070 -1.0.0.0,+1.0 AS 1+1 lSTHN ICRTCl. ANS 0071 GRTHN ICRTel • 0072 0073 0074 • ·INDEX INDEX FAP •••••••••••••••••••••••• • •••••••••••••••••••••••• •••••••••••••••••••••••• 9/4/64 •••••••••••••••••••••••• • INDEX •••••••••••••••••••••••• PROGRAM LISTINGS • • (PAGE INDEX 2) IPAGE • FORTRAN USAGE OF VINDEX FUNCTION • ANS a VINDEXFII,ICRTCl,IJUMP) •• • • • • • • • • • • • INPUTS TO VINDEX I. ICRTCl, AND IJUMP ARE FIXED POINT. OUTPUTS FROM VINDEX a I+IJUMP = -1.0,0.0,+1.0 ANS AS I+IJUMP lSTHN ICRTCll GRTHN ICRTCl. ICRTCl. • • FORTRAN USAGE OF SETEST FUNCTION • ANS • SETESTFIX,XNEW,XCRTCl) •" • • •" • • • • • • • •" • • • • • •• • • • • • • " " " "" " • • "" "" • • • •" " "• •" •" " " " " " INPUTS TO SETEST X. XNEW, AND XCRTCl ARE ANY MODE. OUTPUTS FROM SETEST X XNEW. ANS -1.0,0.0,+1.0 AS GRTHN XCRTCl. XNEW lSTHN XCRTCl. • XCRTCl, FORTRAN USAGE OF SET APT FUNCTION ANS = SETAPTFIX,XNEW,FVAlUE) INPUTS TO SETAPT X, XNEW, AND FVAlUE ARE ANY MODE. OUTPUTS FROM SETAPT XNEW X a ANS • FVAlUE IPOSSI8lY A MISNAMED FIXED POINT VALUE WHICH WIll NOT HURT IN IF STATEMENT APPLICATIONS. USE IANS = XSAMEFISETAPTFIX,XNEW,IFVAlUJt IF THIS IS TROU8lESOME.) FORTRAN USAGE OF CHUSET FUNCTION ANS = CHUSETFIX,Xl,X2,ZIFXl) INPUTS TO CHUSET X. Xl, X2, AND ZIFXl ARE ANY MODE. OUTPUTS FROM CHUSET X ANS EXAMPLES 1. INOEX USAGE Xl • •••••••••••••••••••••••• •••••••••••••••••••••••• IF MAGNITUDE OF • ZIFXl ZIFXl ICOMMENT ABOUT ANS IS ZERO. UNDER • X2 SETAPT GTHERWISE. A'PlIES). CARE MUST BE TAKEN IN THE USE OF INDEX - AND "INDEX FOR SUBSCRIPTING PURPOSES AS IllUSTRATED IN THE lOmp PORTIONS OF EXAMPLES 1. AND 2. I :0 -2 J =0 ANSI = INDEXFII,OI ANS2 = INDEXFII,O) ANS3:o INOEXFII,OI 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 21 .•••••••••••••••••••••••• . •••••••••••••••••••••••• -..•.•.•.•.•.•...•....•. INDEX • -..........•.•........•. IPAGE 3) PROGRAM LISTINGS INDEX IPAGE ~ 31 . 10 J ,. J XIJ+lI '" J I~ IINDEXFCJ,101) 10,10,20 20 CONTINUE OUTPUTS - ANSl,2,3 '" -1.0,0.0.1.0 Xll ••• ll) '" 0.,1., ••• ,10. J 11 • • • • • •• 2. VINDEX AND serEST USAGE K '" 21 10 K '" K YIK) '" K IF IVINDEXF(K,l,-I)) 20,10,10 20 ANSI SETESTFIXl,l.0,2.01 ANS2 SETESTF(X2,-0.O,-0.01 ANS3 SETESTFIX3,-0.0,0.0) it ANS4 SETESTFCX4,0.0~-0.0) ANS5 .. SETESTFIX5,0.0,0.0) ANS6 SETESTF(X6,2.0,l.0) it ANS7 SETESTFIIX,2,l) • OUTPUTS - Yll ••• 21) '" 1.,2., ••• ,21. K '" 0 ANSl,2.3,4,5,6,7 '" -1.0,0.0,0.0,0.0,0.0,1.0,1.0 Xl,2,3,4,5.6 '" 1.0,-0.0,-0.0,0.0,0.0,2.0 IX '" 2 • .. • • • • • • • . • •.. .. • • .. .. • .. .. . 3. SETAPT AND CHUSET USAGE ANSI SETAPTFIX,1.,2.) ANS2 SETAPTF(IX,7,3.1 ANS3 CHUSETFIIYl,1,3,0.0) ANS4 CHUSETFIIY2,1,3,-2.01 ANS5 CHUSETFIIY3,l,3,l.5) OUTPUTS - ANSl,2,3,4,5 '" 2.,3.,0 •• -2.,1.5 X" 1. IY1,2,3 '" 1,3,3 IX .. 7 .. PROGRAM FOLLOWS BELOW •.. • • NO TRANSFER VECTOR BCI 1,INDEX .. PRINCIPAL ENTRY. • INDEX ADD SXD .. SXD4 •.. STQ XCA TRA INDEXF(I,ICRTCLJ KD1 IF SACS, 4 CRTICl 1+1 SWITCH SETTING FOR INDEX, VINDEX, AND SETEST ICRTCL OR XCRTCl TO CRTICL 1+1, I+IJUMP, OR XNEW TO MQ SXA4 SECOND ENTRY. VINDEXFII,ICRTCL,IJUMPI .VINDEX I+IJUMP 32765 ADD ..• THIRD TRAENTRY. SXD4 SETESTFIX,XNEW,XCRTCLI . serEST XCA LDQ TRA . .. FOURTH ENTRY. .SEfAPT ClA •.. TRA FIFTH ENTRY. .CHUSH lET lDQX2 lDQ CLA SfACAC STA ... • STZ 32765 SXD4 XNEW TO AC XCRTCl TO MQ SETAPTFIX,XNEW,FVALUEI lDQX2 STACAC XNEW IN MQ IS OK, SET TO PICK UP FVAlUE FROM 32765 CHUSETFIX,X1.X2,IIFXIJ 32764 32765 CHUSET ClAAC IFSACS Xl IN MQ OK IF IIFXl '" 0 OTHERWISE X2 TO MQ SET TO PICK UP IIFXl FROM 32764 SET TERMINAL PICKUP FOR SETAPT, CHUSET SET SWITCH FOR SETAPT, CHUSET AT THIS POINT WE HAVE MQ '" NEW VALUE, CRTICl '" CRITICAL VALUE (FIRST 3 ENTRIES). BACK UP XR4 TILL -1,4 HAS STORAGE AOORESS FOR NEW 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 •••••••••••••••••••••••• INDEX • •••••••••••••••••••••••• PROGRAM LISTINGS • (PAGE 4) • • SXA4 VALUE (CLA I CAL SXA CAL ANA LAS TXI TRA TXI •••••••••••••••••••••••• INDEX • •••••••••••••••••••••••• • (PAGE OR CLA XI SV4,4 -1,4 ATMASK CLAZ CAL,4,1 GOTCLA CAL,4,1 KNOCK OUT ADDRESS AND TAG • • THEN ANTICIPATE ENTRIES INDEX.VINoEX.SETEST, SET NEW VALUE. TEST. TREAT LAST 2 ENTRIES • • GOTCU ClS XCA STD. AXT SV4 ZET TRA CUAC ClA TRA · Kll (ANTICIPATE FOR NEW lSTHN CRTlCL) -1,4 •• ,4 lFSACS NTSPCS STORE NEW •• = XR4 •• 1,4 .. .- 32161) FOR SETAPT, • 32164 FOR CHUSET • COMPARE, FOR INDEX,VINDEX,SETEST. (NEW IN AC,-1.0 IN MOl • NTSPCS TNZ CAS TEST NZT CRTICL FOR TRA loOI lERO .. IERO CAS CAS CRTICl TRA GETKl NEW GRTHN CRTICl KI NEW EOUAlS CRTICL LoOl loO XCA NEW LSTHN CRTICl TRA 1,4 GETK1 CLA Kll 1,4 TRA •.. CONSTANTS, TEMPORARY •ATMASK CUl K1l Ko1 KI CRTICl lFSACS OCT ClA DEC PlE PlE PIE PlE END 777771000000 0,0 1.0 0,0.1 .. , .. , .. 0 0,0,-. ICRTCL OR XCRTCl •• :0 IF SET APT OR CHUSET, =XR4 OTHERWISE 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 ~" 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0251 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 4) •••••••••••••••••••••••• • INTGRA • •••••••••••••••••••••••• PROGRAM LISTINGS -• .....••..•......•...... INTGRA • • ••••••••••••••••••••••• 9/29/64 LAST CARD IN DECK IS NO. 0174 • I NTGRA I SUBROUTINE) 0001 " FAP "INTGRA 0002 COUNT 150 0003 INTGRA 0004 LBL ENTRY 0005 INTGRA (CIGRTN,YOFX,LY,DELX,YIGRTD.YOFXll 0006 • 0007 ----ABSTRACT---"• 0008 0009 " TITLE - INTGRA 0010 " INDEFINITE INTEGRAL BY TRAPElOIDAL RULE 0011 • INTGRA FORMS A VECTOR, YIGRTD(II I=I ••• LY, REPRESENTING 0012 • THE INTEGRAL OF ANOTHER VECTOR, YOFXCII I=l ••• LYi PLUS 0013 • A GIVEN INTEGRATION CONSTANT, CIGRTN. THE INPUT VECTOR 0014 " YOFX IS CONSIDERED TO REPRESENT EQUALLY SPACED ORDINATE 0015 "• VALUES OF A FUNCTION YIXI AS FOLLOWS 0016 YOFXIl) Y(Xl) 0017 • YOFX(2) YIX21 WHERE X2 Xl+DELX 0018 " YOFX(3) Y(X3) WHERE X3 X2+DELX 0019 " ETC 0020 " YOFX(LY) = YIXN) WHERE XN z XN-1 + DELX 0021 "• NOTE- DELX MAY BE NEGATIVE 0022 0023 " 0024 LET THE INTEGRAL TO BE COMPUTED BE REPRESENTED BY FIX) WITH 0025 •" X 0026 "• FIX) C + 0027 INTEGRAL C YIU) DU ) 0028 U = Xl • 0029 • THEN THE OUTPUT VECTOR IS 0030 • C) (THIS IS ALWAYS YIGRTOIl) = F(Xl) 0031 "• YIGRTD(2) = F{X2) 0032 0033 ETC YIGRTDILY) =FIXN) 0034 •" 0035 "• WHERE C = CIGRTN AND THE TRAPElOIDAL APPROXIMATION IS 0036 USED FOR I~TEGRATING. 0037 " 0038 "• THE OUTPUT VECTOR MAY REPLACE THE INPUT VECTOR. 0039 0040 • INTGRA HAS ONE OTHER OUTPUT, YOFX1, WHICH IS SET EQUAL 0041 • TO THE VALUE OF YOFX(1). USING THIS QUANTITY 0042 • IT IS POSSIBLE TO INVERT EXACTLY THE INTEGRATED VECTOR, 0043 • YIGRTD, AND REOBUIN YOFX. THIS INVERSION IS PERFORMED 0044 • BY SUBROUTINE IINTGR, WHOSE CALLING SEQUENCE IS TRE 0045 " REVERSE OF THAT OF INTGRA. 0046 "• 0047 0048 - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) • LANGUAGE 0049 * EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0050 - 47 REGISTERS • STORAGE 7090 709 7090 109 0051 " SPEED 141.2 OR 43.0) + (37.8 OR 41.0)"LY MACHINE CYCLES 0052 • S.M. SIMPSON, AUGUST 1963 0053 • AUTHOR 0054 0055 ----USAGE--•" 0056 "• TRANSFER VECTOR CONTAINS ROUTINES - INONE) 0057 " AND FORTRAN SYSTEM ROUTINES - INONE} 0058 0059 * 0060 * FORTRAN USAGE " CALL INTGRA(CIGRTN,YOFX,LY,DELX,YIGRTD,YOFX11 0061 0062 • 0063 " INPUTS 0064 " 0065 CIGRTN IS THE CONSTANT OF INTEGRATION " 0066 0067 YOFX I II I=l ••• LY IS THE VECTOR TO BE INTEGRATED •" 0068 " SHOULO EXCEED 0 0069 LY " 0070 " SHOULD BE NON-ZERO, MAY BE NEGATIVE 0071 DElX * 0072 "" OUTPUTS STRAIGHT RETURN WITH NO ACTION IF LY LSTHN 1 OR DELX : O. 0073 0074 • •••••••••••••••••••••••• • INTGRA .."...................... PROGRAM LISTINGS • • IPAGE 21 • • • • • • • • • • • • • •. • •. .• • ... • • • •. • • • ... .. . ..• • .. •.. INTGRA • •••••••••••••••••••••••• •••••••••••••••••••••••• (PAGE YlGRTDU) l"l ••• LY IS THE INTEGRATED VECTOR YIGRTDll) .. CIGRTN YIGRTDIK) : YIGRTDIK-11 + DELX·CYOFXIKI + YOFXIK-1))/l.0 FOR K"2,3, ••• ,LY EQUIVALENCEIYIGRTD,YOFXI I SPERM !TTED YOHI IS SET EQUAL TO YOFXlll EXAMPLES . 1. WITH VARIOUS VALUES OF DELX, CIGRTN AND LY 1., 1., ••• ,1. INPUTS - YU ••• 71 Yl1 .. Y12 ..... =Y18 a -999. YI7 " YI8 CALL lNTGRA( 0., Y, 7, 1., CALL lNTGRA( 0., Y, 7, 10., CALL INTGRA( 0., Y, 7, -2. , CALL INTGRAI 1., Y, 7, 1., CALL lNTGRAC -1., Y, 2, I., CALL INTGRAI -1. , Y, 1. 1., CALL INTGRAI 0., Y, 0, I., CALL lNTGRAI 0., Y, 7, 0., 0., 1., 2 •••••• 6. OUTPUTS - YIlCl ••• 71 YI211 ••• 71 0.,10.,20., ••• , 60. YOIl ••• 71 0.,-2.,-4., •••• -12. YI411 ••• 71 1., 2., 3., •.. , 7. -1. , o. YI5U ••• 2) YI6111 -1. YT7 .. Y17 .. YI8 .. Y18 " -999. INO USAGE a -999. YIl, YUI YI2, Y12) YO, YU) Y14. Y141 Y15, Y151 Y16, Y16) YI7, Y171 Vl8, Y18) Yll 1. Y12 .. 1. Y13 1. Y14 .. 1. Y15 " 1. Y16 .. 1. OUTPUT CASES) .. .. 2. MULTIPLE INTEGRATION WITH OUTPUT REPLACING INPUT INPUTS - Yll ••• 71 " 4.,4., ••• ,4. USAGE 00 10 1=1,3 10 CALL INTGRAI0.,Y,7,1.,Y,YOFXIII)) OUTPUTS - YIl ••• 7) 0 •• I., 6., 19 •• 44., 85., 146. YOFX1I1 ••• 31 = 4., O. , O. . PROGRAM FOLLOWS BELOW NO TRANSFER VECTOR HTR 0 XR4 BC I 1,[ NTGRA • ONLY ENTRY. INTGRAICIGRTN, VOFX, LY, DELX, YIGRTD, YOFXI) INTGRA SXO INTGRA-2,4 • CHECK LY IAT LEAST *1) AND DELX INON-ZERO UNLESS lYzO) CLA.. 3,4 LY TMI LEAVE EXIT IF NEGATIVE, POX 0,4 TXL LEAVE,4,0 OR ZERO. SXO TXL,4 STORED IF OK. TXL LXD4,4.1 AVOID DELX BUSINESS IF lY:1 LXD INTGRA-2,4 CLA. 4,4 DELX TZE LEAVE FOP H2 DELX 12.0 STQ OXOV2 • NOW SET OUTPUTS FOR LV AT LEAST :1 LXD4 LXO INTGRA-2,4 CLA. 2,4 VOFXlll STO lASTY YOFXl STO" 6,4 CLA. 1,4 ClGRTN STO. 5,4 YlGRTOll) .. THEN SET UP LOOP FOR LARGER LY CLA 2,4 ADO Kl AIYOFX)+1 STA GET CLA 5,4 ADO Kl AIYIGRTDI+l STA STORE ADO Kl AIYlGRTO)+2 STA ADD 0015 0016 0071 0018 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 21 .................... _--- .. .. (NTGRA PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE ~ 31 IPAGE .. BUT BYPASS THE LOOP IF LY =1 lXD TXL.4 LEAVE.4,l TXl .. OTHERWISE ENTER LOOP AXT Z.4 .. lOOP TO SET YIGRTDIZ ••• LYI GET LDO **.,4 •• AIYOFXI+1 LASTY CLA LASTY STO LASTY FAD XCA FMP DXOV2 .*",AIYIGRTDI+2 ADO FAD *.,4 STORE STO .·,4 **=AIYIGRTDI+1 TXI .4. YOFXIK)+YOFXIK-1) TIMES DELX/2.0 PLUS YIGRTOIK-11 BECOMES YIGRTOIK' ·+1.4.1 TXL TXL GET *. .. EXIT INTGRA-2.4 LEAVE LXD TRA 7.4 .. CONSTANTS. TEMPORARIES FLZ DEC 2.0 Kl PZE 1 lASTY PIE DXOVl PIE _.,_.,_. E"In _..•.....•............•. .•..•.....• INTGRA •.•........•.. .. ,.-,.* ·*=LY PREVIOUS YOFX VALUES. STARTS WITH YOFXl11 DELX/Z.O 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 31 •••••••••••••••••••••••• INTHOl "•••••••••••••••••••••••• " PROGRAM LISTINGS ••••••••••••••• *" ••••••• • INTHOl .. , ..•.••...••.•.•.•...... .. INTHOL I SUBROUTINE) 9/9/64 lAST CARD IN DECK IS NO. 0155 0001 • FAP .INTHOL 0002 COUNT 200 0003 LBL INTHOL 0004 ENTRY INTHOL INHOL,HOL.FMT.NDATAD,NDATAA,DATA) 0005 0006 0007 ----ABSTRACT---0008 0009 •• TITLE - I NTHOL 0010 0011 • INTERPRET HOLLERITH 0012 SUBROUTINE INTHOL INTERPRETS A SERIES OF HOLLERITH WORDS 0013 • ACCORDING TO A GIVEN fORMAT. 0014 • 0015 • - FAP SUBROUTINE IFORTRAN II COMPATIBLEl 0016 • LANGUAGE 0017 • EQUI PMENT - 709 OR 7090 IMAIN FRAME ONLY) - 72 REGI STERS 0018 • STORAGE .. SPEED 0019 R.A. WIGGINS 4/64 0020 • AUTHOR 0021 0022 0023 ----USAGE---0024 .. TRANSFER VECTOR CONTAINS ROUTINES - FNDFMT 0025 • AND FORTRAN SYSTEM ROUTINES - IIOH),IRTN) 0026 0027 .. FORTRAN USAGE 0028 .. CALL INTHOLINHOL.HOL,FMT.NDATAD,NDATAA.DATA' 0029 0030 • 0031 0032 • INPUTS 0033 NHOL NUMBER OF HOLLERITH WORDS TO BE INTERPRETED 0034 • MUST BE GRTHN= 1. LSTHN= 22 0035 0036 • HOLl II I=I, •••• NHOL HOLLERITH WORDS 16 HOllERITH CHARACTERS PER 0037 WORD) TO BE INTERPRETED. 0038 • 0039 FMTl I) 1=1.2, ••• IS EITHER A NORMAL fORMAT VECTOR. OR LITERAL 0040 0041 HOLLERITH IN A CALLING SEQUENCE WHOSE CHARACTERS IREADING LEFT TO RIGHT) ARE THE DESIRED FORMAT STRIPPED 0042 0043 OF THE ENCLOSING PARENTHESES. THE fiRST AND SECOND 0044 CHARACTERS MUST NOT BE EITHER 'I' OR 'I' . IS USED TO INTERPRET HOLII). 0045 0046 SHOULD BE A FORMAT fOR READING ONLY ONE LINE, I.E. IT 0047 SHOULD CONTAIN NO 'I' • 0048 NUMBER Of DATA VALUES DESIRED FROM HOl ACCORDING TO FMT. 0049 NDAfAD 0050 SHOULD NOT PROVIDE FOR A GREATER NUMBER OF VALUES THAN CAN BE INTERPRETED • 0051 0052 0053 0054 • OUTPUTS 0055 NDATAA NUMBER OF DATA VALUES ACTUALLY INTERPRETED. INTHOl SCANS 0056 • 0057 THE HOl AND fMT ONLY ONCE TO FINO THE DESIRED VALUES. • 0058 • 0059 DATAII) I=I~ •••• NDATAA CONTAINS THE VALUES INTERPRETED. • 0060 0061 • 0062 • EXAMPLES 0063 6HIF6.2) NDATAO=l 0064 • 1. INPUTS - NHOl = 1 HOlIll = 6H-53.31 FMTll) .. OUTPUTS - NDATAA = 1 DATAI11 = -53.31 0065 0066 .. 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT NOATAD 6 0067 0068 • OUTPUTS - SAME AS EXAMPLE 1. 0069 .. 3. INPUTS - NHOl = 2 HOlll ••• 2) = 3HXYI.6H 5 -9 NDATAD = 3 0070 0071 .. USAGE CALL INTHOlINHOL,HOl. 6HA6,213 .NDATAD,NBATAA, .. 1 DATA) 0072 ..... . ... .. . . . . . .. .. .... ..... .. .... . . . . . •••••••••••••••••••••••• INTHOL • •••••••••••••••••••••••• PROGRAM LISTINGS • (PAGE 21 • OUTPUTS - NOAfAA • •• PROGRAM FOLLOWS 8ELOW • XPR1 HPR o HPR HPR BCI INTHOL SXD SXD SXD AXT CLA STO TlX CAL ADD STA CLA. XPR2 XPR4 STD HOL AXT AXT CLA STO TIX TRA TXI NHOL TXl ClA. FMTl CU ADD STA CLA STA TSX TSX TSX ClA SUB ARS STA STD STZ STl • • • DATAIl ••• 3) ~ 3HXYZ.5.-9 o o 1.INTHOl XPR4.4 XPR2,2 XPR1.1 BUFSIZ.2 "0606060606060 -1,2 .-1,2,1 2.4 "1835 HOl 1,4 NHOL 1,1 8UFSIZ.2 SAVE INDEX REGISTERS. PUT 8LANKS IN RUFFER BEFORE TRANSFERRING THE HOLLERITH WORDS ••• 1 -1,2 .+2.2,1 NHOL+1 ,,+1.1,1 HOl,l,.· 4,4 NDATA 6,4 "lB35 DATA 3.4 FMTl $FNDFMT.4 TO •• ,0 THE INPUTOUTPUT BUFFER. SET UP INS TRUCTIONS FOR STORING DATA. SET UP FNDFMT ARGUMI=NTS INUM,O =32562817 INUM 18 FMT IFST INUM CONVERT INDEX WITH RESPECT TO COMMON TO A MACHINE ADDRESS. INITIALIZE ONE-PASS COUNTER. INITIALIZE DATA COUNTER. INITIALIZE IIOHI CLA •• . 3 •••••••••••••••••••••••• • INTHOl " •••••••••••••••••••••••• IPAGE 2) NOP AXC lDQ TRA· NOP =2B17 FMT-l,4 NOP $IIOHI SSH DUMMY ITAPE LOAD IR4 FOR OUMMY READING SEQUENCE GET INPUT (SSH) FLAG • GO INITIALIZE IIOH) RETURN FROM IIOH) - GO BACK SSH ZET TRA SXD TRA • • DUMMY READING • FMT PZE STR DATA AXT STR STQ SXD rxl NDATA TXL TSX RTNI LXD CLA RTN sro· LXD IFST RTNI IFST,4 1,4 IS THIS FIRST RETURN NO, GO EXIT YES. RESET IFST AND • RETURN TO (IOH) IBUFFER WAS SEt UP ABOVE. SEQUENCE •• 1.1 ··,1 INUM,! .+1.1,1 STR,l,·" $(RTNI,4 XPR4,4 INUM 5,4 XPRl.l FORMAT ADDRESS SEQUENCE FOR OBTAINING CONVERTED NUMBERS FROM ( 10H). RESTORE IR 4 OUTPUT ACTUAL NO. OF DATA VALUES STORED. RESOTRE IR 1 0073 0074 0075 0076 0071 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 OU3 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 •••••••••••••••••••••••• • PROGRAM 1I STINGS • INTHOl 3l (PAGE lXO * TRA • IFST PZE INUM PIE 8UFSIZ EQU • • INTHOl •••••••••••••••••••••••• •••••••••••••••••••••••• (PAGE •••••••••••••••••••••••• • END o o 22 RESOTRE IR 2 RETURN TO MAIN. ONE-CARD SW ITCH. DATA COUNT. BUFFER SIZE. 0148 0149 0150 0151 0152 0153 0154 0155 3l * •••• - ••••• -._ ••••• * •• _. • INTMSB • *_ ..................... REFER TO TIMSUB PROGRAM LISTINGS •••••••••••••••••••••••• • INTMSB * •••••••••••••••••••••••• REFER TO TIMSUB •••••••••••••••••••••••• • INTOPR • •••••••••••••••••••••••• PROGRAM LISTINGS •••••••••••••••••••••••• ......•...•........... _- • INTOPR 9/4/64 LAST CARO IN DECK IS NO. 0250 • INTOPR ISUBROUTINE) 0001 • FAP -INTOPR 0002 COUNT 200 0003 LBL INTOPR 0004 ENTRY INTOPR INDATA, XLO, DELX, X, OPER) 0005 0006 0007 ----ABSTRACT---0008 0009 • .. TI TLE - I NTOPR 0010 INTERPOLATION OPERATOR FOR 1 TO 4 EVENLY SPACED DATA VALUES 0011 0012 • INTOPR FINOS OPERll,2, ••• ,N) GIVEN N, X, XLD, DELX 0013 • SUCH THAT FOR ANY N EQUALLY SPACED DATA VALUES, 0014 F(1), F(2), ••• , FIN), WHERE N lSTHN= 4, 0015 0016 • OPER(1).Fll) + ••• + OPERIN).FINI PIX) 0017 • 0018 • WHERE P IS THE EXACT FITTING POLYNOMIAL (OF DEGREE 0019 • N-l), TO THE DATA VALUES AS FOLLOWS. 0020 • 0021 PIXLO) F( 11 0022 F(2) P(XLO+DELX) 0023 0024 ETC. PIXLO+IN-IJ.DELX) FIN) 0025 0026 THE DEGENERATE CASE OF N = YIELDS OPERIU 0027 1.0 • 0028 • 0029 - FAP SUBROUTINE IFORTRAN II COMPATIBLE) 0030 • LANGUAGE .. EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0031 .. STORAGE - 111 REGISTERS 0032 .. SPEED WHERE MC = MACHINE CYCLES 50 MC FOR N=l 0033 90 MC FOR N=2 0034 • 205 MC FOR N=3 0035 435 MC (709) OR 380 MC (7090) FOR N=4 0036 • - S.M. SIMPSON, MARCH 1964 0037 • AUTHOR 0038 • 0039 • ----USAGE--0040 0041 • • TRANSFER VECTOR CONTAINS ROUTINES - INOT ANY) 0042 • AND FORTRAN SYSTEM ROUTINES - (NOT ANY) 00430044 - FORTRAN USAGE 0045 .. CALL INTOPRINDATA, XLO, DELX, X, OPER) 0046 0047 • 0048 .. INPUTS 0049 0050 NDATA IS THE QUANTITY N OF THE ABSTRACT 0051 MAY ONLY HAVE VALUE 1,2,3, OR 4 0052 • 0053 • XLO IS DEFINED IN ABSTRACT 0054 • 0055 DElX IS DEFINED IN ABSTRACT 0056 MUST BE NON-ZERO IMAY BE NEGATIVEI 0057 0058 X IS DEFINED IN ABSTRACT 0059 0060 0061 .. OUTPUTS STRAIGHT RETURN WITH NO OUTPUTS IF NDATA OR DELX ILLEGAL 0062 0063 • OPER(I) I=l ••• NDATA IS THE OPERATOR AS DEFINED IN ABSTRACT 0064 0065 0066 • 0067 • EXAMPLES 0068 .. 1. THIS EXAMPLE FINDS THE OPERATORS FOR X VALUES CORRESPONOING 0069 .. EXACTLY TO THE DATA POINTS, IN WHICH CASE THE 0070 CORRESPONDING COEFFICIENT MUST BE UNITY AND THE OTHERS 0071 0072 • MUST VANISH. 0073 .. INPUTS - NDATAl,NDATA2,NDATA3,NDATA4 = 1,2,3,4 XLO*O.O. DELX=2.0 0074 -. - . ..--. .. . ... .. .... .. . .. . • •••••••••••••••••••••••• INTOPR * *•••••••••••••••••••••••• IPAGE •••••••••••••••••••••••• PROGRAM LISTINGS -..•.•.•.••..•.•........ * (PAGE 2) * USAGE CALL INTOPRINDATA1,XLO,DELX,0.0,OPER111 CALL INTDPRINDATA2,XlO,DELX,0.0,OPER211 CAll INTOPR(NOATA2,XLO,DELX,2.0,OPER221 CAll INTOPRINDATA3,XlO,OELX,0.0,OPER31} CAll INTOPR(NDATA3,XlO,DELX,2.0,OPER321 CAll INTOPR(NDATA3,XlO,OELX,4.0,OPER331 CALL INTOPR(NDATA4,XlO,DElX,0.O,OPER411 CAll INTOPRINDATA4,XLO,DElX,2.0,OPER421 CALL INTOPR(NDATA4,XLO,DElX,4.0,OPER43) CAll INTOPRINDATA4,XlD,DElX,6.0,OPER44J OUTPUTS - OPERNM (N=1 ••• 4, M=I ••• NI IS A VECTOR OF LENGTH N, All OF WHOSE ELEMENTS VANISH EXCEPT OPERNMIM' = 1.0 • • • * * • • • • • • - 2. NON-TRIVIAL EXAMPLES INPUTS - SAME AS EXAMPLE 1. EXCEPT OElX = 1.0 • USAGE CAll INTOPRINOATA2,XLO,DELX,0.5,OPER231 CALL INTOPRINDATA3,XLO,DELX,0.5,OPER341 * CALL INTOPRINDATA4,XlO,DELX,0.5,OPER45) • OUTPUTS - OPER2311 ••• 2J = 0.5,0.5 _ OPER3411 ••• 3) 0.375,0.750,-0,125 • OPER4511 ••• 41 0.3125,0.9375,-0.3125,0.0625 • • 3. ERROR EXITS INPUTS - SAME AS EXAMPLE 1., EXCEPT SET OPERl1 ••• 41 • • USAGE CALL INTOPRIO,XLO,OELX,l.,OPERI • CAll INTOPRI5,XLO,DELX,I.,OPERI • CAll INTOPRINDATA2,XLO,0.,1.,OPERI • OUTPUTS - OPERll ••• 41 = -9999. = -9999. • • • • • PROGRAM FOLLOWS BELOW • NO TRANSFER VECTOR -• - ONLY ENTRY. - -ONLY o o ENTRY. INTOPR INDATA,XLO,DElX,X,OPERI NlT* • INTOPRINDATA, XLO, DELX, X, OPERI HTR HTR BCI INTOPR SXD SXO TRA ClA. TMI POX TXL TXH CLA ADO STA CLA lDQ TXH ClA LDQ TXH TXL XRl XR4 I,INTOPR INTOPR-2,4 INTOPR-3,1 3,4 LEAVE 1,4 lEAVE 0,1 LEAVE,l,O lEAVE,1,4 5,4 KA1 STOOPR K2L K3l FORMY,I,3 KIL K1L FORMY,1,2 STOOPR,ltl DELX ZERO CHECK NOATA CHECK (STAYS IN XR1 TIll WINDUP) AIOPERI IBI ANTICIPATE NDATA=4 ( AI AND TEST FOR IT IB OR K11IF NOT, ANTICIPATE NDA'A I AI AND TEST FOR IT lIT MIGHT BE 2, IT MIGHT BE I) - NDATA=2 • •* ClAFSB* FOP· STQ CLA FSB STO TRA COMPUTE Y 4,4 2,4 3,4 K2 Kll K2 Kl WINDUP * INTOPR K2 IX-XlOI/DElX Kl = l-K2 NORMALIZED X, FOR NDATA = 3, 4 ·3~ OR 1 0075 0076 0077 007B 0079 0080 0081 0082 00B3 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 21 •••••••••••••••••••••••• PROGRAM LISTINGS INTOPR ••••••••••••••••••••••••• " IPAGE ... ... . .. .. . STQ FOP" STQ ClA" FSB" XCA FMP FSR K4 3,4 K3 4,4 2,4 STO Y XCA FMP STO TXH K3 K4 IK4 IS TEMP HERE, FOR AI IK3 IS TEMP HERE, FOR B/DElXI X -XlO "B/OElX -A Y = IX-XlOI .B/OElX - A Y K4 NOEQ4,1,3 IY-SQUARED WILL BE USEFULI RETURN TO THE CASE NDATA=3 AND SET Kl,K2,K3 IREMEMBER K4 AND AC HAVE Y-SQUAREOI FSB FOP STQ ClA FSR STO ClA FAD FOP STQ TRA Y K2L Kl Kll K4 K2 K4 Kl=IYSQR-YI/2.0 K2=II-YSQRI Y K2l K3 WINOUP K3"IYSQR+Y)/2.0 SET Kl,K2,K3,K4 FOR NDATA=4 NDEQ4 CLS FAD XCA FMP FAD XCA FMP FSB FOP STQ Y CLA Y FSB XCA FMP FSB XCA FMP FAD FOP STQ ClS FSB XCA FMP FAD XCA FMP FAD FOP STQ KlL CtA FAD XCA FMP FSB XCA FMP FSB FOP STQ K3l Y KIL Y K3l K4BL Kl Kl=III-V+3)Y+IIV-31/48 Y K9L Y K9L K16l K2 K2=IIIV-1IY-9)V+9'/16 Y KIL V K9L V K9l K16L K3 K3=III-Y-l)V+9)V+91/16 Y K3l Y KIL Y K3l K48L K4 • IPAGE .. IA IS IN MQ, B IN ACI .. ANO THEN BRANCH ON NOATA AGAIN • INTOPR •••••••••••••••••••••••• 31 FORMY •••••••••••••••••••••••• .. K4=IIIY+3IY-IIY-31/48 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 01BO 0181 0182 0183 0184 0185 0186 0181 018B 0189 0190 0191 0192 0193 0194 0195 0196 0191 0198 0199 0200 0201 0202 0203 0204 0205 0206 0201 0208 0209 0210 0211 0212 0213 0214 0215 0216 0211 0218 0219 0220 0221 0222 0223 0224 3) •••••••••••••••••••••••• • • INTOPR PROGRAM LISTINGS • MOVE Kl.K2 •••• TO OPER(l ••• NDATAI WINDUP CLA STOOPR STO TIX • Kl+ltl •• .,1 WINDUP.l.l • EXIT • • LEAVE LXO TRA INTOPR-3.1 6.4 • CONSTANTS. TEMPDRAR I ES • KA1 Kll K2L K3L K9L K16L K48L K4 K3 K2 K1 Y PZE DEC DEC DEC DEC DEC DEC PIE PZE PZE PZE PIE END 1 1.0 2.0 3.0 9.0 16.0 48.0 ......... ..... , .. .... ,,._, .. .. , •. .. , .. , .. • (PAGE 41 • INTOPR •••••••••••••••••••••••• •••••••••••••••••••••••• (PAGE •••••••••••••••••••••••• • **=A(OPERI+l 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0231 0238 0239 0240 0241 0242 0243 0244 0245 0246 0241 0248 0249 0250 41 •••••••••••••••••••••••• INTSUM • •••••••••••••••••••••••• • PROGRAM LISTINGS • INTSUM I SUBROUTINE) • FAP ·INTSUM COUNT 100 LBL INTSUM ENTRY INTSUM I X. LX.XISUMDI ENTRY XNTSUM IIX.LIX,IXISMDI • • •• • • • • • • • • • • • • • • • • • • • •• • •* • • • • • • • • • • • • • • • • • • • • • •• • • • • • • • • • • • • • • • •••••••••••••••••••••••• • INTSUM • •••••••••••••••••••••••• LAST CARD IN DECK IS Ne. 0109 0001 0002 0003 0004 0005 0006 0001 ----ABSTRACT--0008 0009 0010 TI TLE - I NTSUM 001,1 INTEGRATED SUMMATION OF A FLOATING OR FIXED VECTOR 0012 INTSUM FORMS A FLOATING VECTOR WHOSE I-TH ELEMENT IS THE 0013 0014 SUM. THROUGH ELEMENT I, OF THE ELEMENTS OF ANOTHER FLOATING VECTOR. OUTPUT MAY REPLACE INPUT4 0015 0016 XNTSUM DOES THE SAME THING FOR FIXED VECTORS. 0011 0018 0019 INTSUM AND XNTSUM ARE THE EXACT INVERSE OPERATOR.S OF SUBROUTINES OIFPRS AND XDFPRS RESPECTIVELY. 0020 0021 - FAP SUBROUTINES IFORTRAN-II COMPATIBLE) 0022 LANGUAGE 0023 EQUIPMENT - 109 OR 1090 IMAIN FRAME ONLY) 0024 - 21 REGISTERS STORAGE 0025 - INTSUM 35 + 12.4*LX MACHINE CYCLES. LX- VECTGR LENGTH SPEED 0026 XNTSUM 31 + 8.0*LX 0027 - S.M. SIMPSON. AUGUST 1963 AUTHOR 0028 0029 ---USAGE--0030 0031 TRANSFER VECTOR CONTAINS ROUTINES - INONE) 0032 AND FORTRAN SYSTEM ROUTINES - INONE) 0033 FORTRAN USAGE 0034 0035 CALL INTSUM( X. LX.XISUMDI 0036 CALL XNTSUMIIX.tIX,IXISMDI 0031 INPUTS 0038 0039 XU) Isl ••• LX IS A FLOATING VECTOR INPUT TO INTSUM 0040 LX SHOULO EXCEED ZERO 0041 0042 IXI I) l~l ••• lIX IS A FXD VECTOR INPUT TO XNTSUM. THE POSIT,rON 0043 OF THE BINARY POINT IS ARBITRARY. 0044 LlX SHOULD EXCEED ZERO 0045 0046 STRAIGHT RETURN WITH NO OUTPUT IF LX OR LIX LSTHN 1 0041 OUTPUTS 0048 0049 XI SUMDU) I=I ••• LX IS XISUMDIII = SUMIFROM K=t TO I l OF XIK) 0050 IXI SMDI I) l=l ••• LIX IS IXISMDIII .. SUMIFROM Ka1 TO I ) OF IX(KI. 0051 WITH SAME BINARY POINT AS IX. 0052 0053 DANGER OF FIXED POINT OVERFLOW NOT TESTED FOR BY XNTSUM. 0054 EQUIVALENCEIXISUMD,X),IIXISMD,IXI IS PERMITTED 0055 0056 0051 EXAMPLES 0058 0059 1. INPUTS - Xl1 ••• 41 = 1 •• 2 •• 3 •• 4. IXIl ••• 4)" 1.2,3.4 SUM3 a6~ 0060 USAGE CAll INTSUMI X.4, SUMII 0061 CALL XNTSUMIIX.4,ISUMll 0062 CAll INTSUMI X.4. Xl 0063 CALL INTSUMI X.l. SUM21 CALL INTSUMI X,O, SUM3) 0064 OUTPUTS - SUMlll ••• 41 = 1., 3., 6 •• 10. ISUMlll ••• 41 = 1,3.6.10 0065 0066 XIl ••• 4) = 1 •• 3 •• 6., 10. SUM2 = 1. 0067 SUM3 = o. INO OUTPUT CASEI 0068 0069 2. INPUTS - IXII ••• 31 = OCT 000000000001. 000000000002. 000000000003 0010 USAGE CALL XNTSUMIIX,3.IXI OUTPUTS - IXI1 ••• 31 = OCT 000000000001. 000000000003. 000000000006 0071 0012 9/29/64 •••••••••••••••••••••••• • INTSUM • •••••••••••••••••••••••• PROGRAM LISTINGS • INTSUM • • ••• * ••••••••••••••••••• (PAGE 21 •••••••••••••••••••••••• (PAGE 2) • PROGRAM fOLLOWS BELOW • • • NO TRANSfER VECTOR HTR 0 XR4 BCI 1, INTSUM • PRINCIPAL ENTRY. INTSUMIX,LX.XISUMDI INTSUM CLA fAD SETUP STO GET SXD INTSUM-2,4 ClA 1,4 A(XI STA GET CLA 3.4 AIXISUMDI STA STORE CLA. 2,4 LX TMI LEAVE POX 0.4 TXL LEAVE,4.0 TXI .+1,4,-1 lX-1 SXO TXL.4 PXD 0,0 CLEAR AC PDX 0,4 AND XR4 .. LOOP GET NOP fAD •• ,4 OR STORE STO •• ,4 ".=AIXISUMDI TXI "+1,4,1 TXL TXL GET,4,.. *.=lX-1 .. EXIT LEAVE LXD INTSUM-2,4 TRA 4,4 .. SECOND ENTRY. XNTSUM (IX, LIX, YXYSMD) XNTSUM CLA ADD TRA SETUP .. CONSTANTS fAD FAD .... ,4 ADD ADD **,4 END ADD .",4 •• :AIX) 0013 0074 0075 0076 0077 0018 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 •••••••••••••••••••••••• • I PLYEV • PROGRAM LISTINGS •••••••••••••••••••••••• • IPLYEV ISUBROUTINEI 10/2/64 • LABEL CI PLYEV SUBROUTINE IPLYEVILA,A,X,Y.EVR.EVII 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 I •••••••••••••••••••••••• • IPLYEV LAST CARD IN DECK IS NO. 0083 0001 0002 0003 0004 ----ABSTRACT---0005 0006 TITLE - IPLYEV 0007 COMPLEX POLYNOMIAL EVALUATION 0008 0009 IPLYEV EVALUATES THE POLYNOMIAL WITH REAL COEFFICIENTS 0010 0011 0012 0013 Z : X+IY. AT THE POINT 0014 0015 IF X:COSIWI AND Y:SINIWI FOR REAL W THEN THIS POLYNOMIAL 0016 0011 EVALUATION IS EQUIVALENT TO TAKING THE FOURIER TRANSFORM OF AIII.I:l ••• LA AT THE FREQUENCY W. IW=PI IS THE 0018 FOLDING FREQUENCYI. 0019 0020 LANGUAGE - FORTRAN II SUBROUTINE IUSES COMPLEX ARITHMETICI 0021 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLYI 0022 STORAGE - 98 REGISTERS 0023 SPEED - A80UT 126*LA + 86 MACHINE CYCLES ON THE 7090. 0024 AUTHOR - R.A. WIGGINS. 9/26/62 0025 0026 ---USAGE---0021 0028 TRANSFER VECTOR CONTAINS ROUTINES NONE 0029 AND FORTRAN SYSTEM ROUTINES IIFMPI 0030 0031 FORTRAN USAGE 0032 CALL IPLYEVILA.A.X.Y,EVR.EVII 0033 0034 INPUTS 0035 0036 A III l=l ••• LA ARE THE FLOATING POINT COEFFICIENTS OF THE 0031 POLYNOMIAL 0038 0039 LA IS FORTRAN II INTEGER 0040 MUST BE GRTHN= 2 0041 0042 X IS THE REAL PART OF THE NUMBER AT WHICH THE POl'YNOMIAL 0043 IS TO BE EVAL~ATED. 0044 0045 Y IS THE IMAGINARY PART OF THE NUMBER AT WHICH THE 0046 POLYNOMIAL IS TO BE EVALUATED. 0047 0048 OUTPUTS 0049 0050 EVR IS THE REAL PART OF THE POLYNOMIAL EVALUATION. 0051 0052 EVI IS THE COMPLEX PART OF THE POLYNOMIAL EVALUATION. 0053 0054 EXAMPLES 0055 0056 1. INPUTS - All ••• 31=3.,2.,l. LA:3 Y=O. 0051 OUTPUTS - EVR=6. EVI:O. 0058 0059 2. INPUTS - All ••• 31=3 •• 2 •• 1. LA:3 X=O. Y=l. 0060 0061 OUTPUTS - EVR=2. EVI=2. 0062 LA=3 Y=l. 0063 3. INPUTS - All ••• 31=3 •• 2 •• 1. X=l. OUTPUTS - EVR:5. EVI:4. 0064 0065 DIMENSION ZI11.AlI11,EVlll 0066 DIMENSION AI51 0061 Z III =X 0068 0069 Z121=Y A1(2)=0. 0010 EVIlI=AILAI 0071 0072 EVI21=0. 0013 0074 DO 10 I=2,LA c····· • •••••••••••••••••••••••• •••••••••••••••••••••••• • • IPlYEV •••••••••••••••••••••••• (PAGE 2) J=lA-1 All 11 =A( J+lI EV=Al+EV.Z I 10 CONTINUE C····· EVR=EV (11 EV!=EV(2) RETURN END PROGRAM LlSTING.~ •••••••••••••••••••••••• • IPlYEV • f· •••••••••••••••••••••• (PAGE 2) 0015 0016 0011 0018 0019 0080 0081 0082 0083 •••••••••••••••••••••• .**•••••••••••••••••••••••• nOMLJ PROGRAM LISTINGS -It .. 1T0MlI (SUBROUTINE) 9/29/64 .. FAP ·nOMlI COUNT 100 LBL ITOMLI ENTRY ITOMLI (IV,lIV,MlIV,IANSI ........................... ITOMLI .. ......................... . . .. LAST CARD IN DECK IS NO. 0097 0001 0002 0003 0004 0005 0006 •-It ----ABSTRACT---0007 0008 .. TITLE - ITOMLI 0009 • FAST CONVERT FORTRAN INTEGER VECTOR TO MLI VECTOR 0010 0011 ITOMLI CONVERTS A FORTRAN INTEGER VECTOR TO A MACHINE 0012 LANGUAGE INTEGER VECTOR. 0013 0014 .. LANGUAGE - FAP SUBROUTINE (FORTRAN II COMPATIBLE' 0015 .. EQUIPMENT - 709 OR 1090 (MAIN FRAME ONLY) 0016 .. STORAGE - 31 REGISTERS 0017 .. SPEED - lENGTH OF VECTOR TIMES 8 MACHINE CYCLES 0018 .. AUTHOR - S.M. SIMPSON JR, MAY 1961 0019 0020 ----USAGE---0021 0022 .. TRANSFER VECTOR CONTAINS ROUTINES - NONE 0023 .. AND FORTRAN SYSTEM ROUTINES - NONE 0024 0025 •.. FORTRAN USAGE 0026 .. CAll ITOMll(IV,LIV,MlIV,IANS) 0027 0028 .. INPUTS 0029 0030 IVI II I=I,2, ••• ,lIV IS THE FORTRAN FIXEO POINT VECTOR • 0031 0032 • MUST EXCEED 0 0033 • LlV 0034 .. OUTPUTS 0035 0036 • MLlVtI) 1=1,2, ••• ,lIV IS THE MACHINE lANGUAGE FIXED POINT VECTOR • 0031 MllV MAY BE SET EQUIVALENT TO IV. 0038 • 0039 = 0 JOB DONE OK tANS 0040 =-1 lIV IS IllEGAL 0041 0042 .. EXAMPLES 0043 0044 • - 1. INPUTS - IV=I,-1,2,-2,10,-10 lIV=6 0045 OUTPUTS - MlIV=OCT 1,400000000001,2,400000000002,12,400000000012 0046 0047 • IANS=O 0048 • 0049 • 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT lIV=O .. OUTPUTS - IANS=-l 0050 0051 0052 - 3. INPUTS - IV(1)=3 lIV=l 0053 • OUTPUTS - IANS=O MlIV(1)=OCT3 0054 HTR 0055 0 1,ITOMLI BCI 0056 EXIT,l nOMLI SXA 0057 ITOMLI-2,4 0058 SXD A(A(IV)) 0059 1,4 CLA 0060 ADO Kl 0061 STA ClA 0062 2,4 AIAILIVI) ClA 0063 STA GET2 3,4 AI A (Ml IV) I 0064 ClA 0065 ADD K1 0066 STA STO 0067 4,4 A(AI I ANS) I ClA 0068 STA PUT4 .. GET AND CHECK LJ V. 0069 K1 0070 ClS 0071 STO tANS 0012 GET2 ClA AILlV) ARS 0073 18 0074 STO LlV .. .. .. .... . ... .. . -.- . -- •••••••••••••••••••••••• • • ITOHli PROGRAM LISTINGS •••••••••••••••••••••••• IPAGE IPAGE 21 TMl HE LEAVE LEAVE • lOOP CLA KO STO IANS ltV,l LXA •• ,1 CLA CLA ARS 18 •• ,1 STO STO CLA,I,1 T!X • STORE IANS AND EXIT. LEAVE CLA IANS ALS 18 PUT4 STO •• t 1 EXIT AXT 5,4 TRA .. CONSTANTS KO PZE 0 Kl PZE 1 .. VARIABLES IANS PZE •• UV PZE END ... ... •••••••••••••• * ••••••••• ITOMLI ••••••••••••••••••••••••• • AIIVI+l AI MliV 1+1 AIIANSI 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 21 •••••••••••••••••••••••• • IVTOHV • PROGRAM LISTINGS ••••••••••••••••••• a •••• • IVTOHV I SUBROUTINE I • FAP • IVTOHV COUNT 150 LBL IVTOHV ENTRY IVTOHV IIV,LHV,HVI • • • • • • • • • • • • • • • • • • • • • •• • •* • * • • • * • • * • •* • • • • • • • • • • • • • • • • • • • • • • • • • • • • ••••••••••••••••••••••• IVTOHV •• ••••••••••••••••••••••• • LAST CARO IN DECK IS NO. 0147 0001 0002 0003 0004 0005 0006 ----ABSTRACT---0007 OOOB 0009 TITLE - IVTOHV PACK UP FORTRAN INTEGER VECTOR AS HOLLERITH VECTOR 0010 0011 IVTOHV CONVERTS AN INTEGER VECTOR lVIII, I=I ••• 6*LHV, 0012 INTO A PACKED VECTOR HVIII, I-l ••• LHV. THE BITS 12 THRU 0013 17 OF EACH IVIII ARE EXTRACTEO 10THER BITS ARE IGNOREOI. 0014 6 GROUPS LIKE THIS FROM 6 SUCCESSIVE IVIII REGISTERS 0015 ARE PACKED INTO A SINGLE HVIII WORO. 0016 0017 IVTOHV IS THE INVERSE OF SUBROUTINE HVTOIV 001B 0019 0020 LANGUAGE - FAP, SUBROUTINE IFORTRAN 11 COMPATIBLE I EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLYI 0021 - 70 REGISTERS 0022 STORAGE - 59 + 61.LHV MACHINE CYCLES 0023 SPEED S.M. SIMPSON, MARCH, 1963 0024 AUTHOR 0025 ----USAGE---0026 0027 TRANSFER VECTOR CONTAINS ROUTINES - NONE 0028 ANO FORTRAN SYSTEM ROUTINES - NONE 0029 0030 FORTRAN USAGE 0031 CALL IVTOHVIIV,LHV,HVI 0032 0033 0034 INPUTS 0035 IVIII I=I ••• 6.LHV IS AN ARBITRARY INTEGER VECTOR 0036 10NLY BITS 12, ••• ,17 ARE VISIBLE TO IVTOHV, I.E. 0037 POSITIVE FORTRAN INTEGERS LESS THAN: 631 0038 0039 LHV IS THE LENGTH OF THE OUTPUT HOLLERITH VECTOR 0040 MUST EXCEED ZERO ISTRAIGHT RETURN IF NOTI 0041 0042 OUTPUTS IIVTOHV TURNS OFF THE AC OVERFLOW INOICATORI 0043 0044 HVIlI I=l ••• LHV IS THE PACKEO HOLLERITH 0045 HV(lI CONTAINS E.G. IVIl ••• 61 PACKEO 0046 HV(21 CONTAINS IVI7 ••• 121 PACKED 0047 ETC 0048 PACKING IS LEFT-TO-RIGHT IIVlll OCCUPIES BITS 0 ••• 51 0049 EQUIVALENCE ( IV,HVI IS PERMITTED 0050 0051 EXAMPLES 0052 0053 1. INPUTS - IVll ••• 181 = 19,24,11,41,17,19,51,21,41,50, 0054 0055 48,51,38,48,39,17,19,34 LHV = 3 0056 OUTPUTS - HV(ll = 6HCHARAC 1= OCT2330215121231 0.057 HVI21 - 6HTERS T 1= OCT6325516260631 005B HVI31 = 6HO PACK 1= OCT4660472123421 0059 2. SHOWING MASKING BEHAVIOUR AND ILLEGAL LHV 8EHAVIOUR 0060 INPUTS IVll ••• 61. -17,82,83,84,-85,22 0061 lIE IVll ••• 61=OCT400021000000,OD0122000000,000123QOOOOO, 0062 000124000000,400125000000,000026000000 ) 0063 0064 USAGE DIMENSION HVI21, IVI61 0065 CALL IVTOHVIIV,l,HVI 0066 CALL IVTOHVIIV.0,HV(211 0067 OUTPUTS - HVlll = 6HA8CDEF (= OCT2122232425261 0068 HVI21 IS UNDISTURBEO 0069 0070 PROGRAM FOLLOWS BELOW HTR 0 0071 HTR 0 0072 HTR 0 0073 BCI I,IVTOHV 0074 3/15/65 •••••••••••••••••••••••• IVTOHV • •••••••••••••••••••••••• • IPAGE PROGRAM LISTINGS 2) IVTOHV SXO IVTOHV-2,4 SXD IVTOHV-3,2 SXD IVTOHV-4, 1 • SETUP SEQUENCE CLA 1,4 AIIV) STA C1 SUB Kl STA C2 SUB Kl STA C3 SUB Kl STA C4 SUB K1 STA C5 SUB K1 STA C6 CLA. 2,4 LHV TMI LEAVE TZE LEAVE STD TESTlH CLA 3,4 AIHV) ADD K1 STA SLW • IXR2) CONTROLS ACQUISITION, XRl CONTROLS STORAGE) AXT 0,2 AXT 1,1 • LOOP ISTRAIGHT LINE PROGRAM FOR SPEEO) LDQ KO IMUST BE ZERO FOR SHIFTS) NEXT6 STZ WORD C1 CLA •• ,2 •• =AIIV) ANA MSK LGL 12 ACL WORD SLW WORD C2 CLA •• ,2 •• =AIIV)-l ANA MSK LGL 6 ACL WORD SLW WORD C3 CLA •• ,2 •• =AIIV)-2 ANA MSK ACL WORD SLW WORD C4 CLA .*,2 •• =AIIV)-3 ANA MSK ARS 6 ACL WORD SLW WORD C5 CLA **,2 •• =AIIV)-4 ANA MSK ARS 12 ACL WORD SLW WORD C6 CLA •• ,2 *.=AIIV)-5 ANA MSK ARS 18 ACL WORD SLW SLW •• ,1 *.=AIHV)+l • BUMP XRS AND CHECK COMPLETION TXI •• 1,2,6 TXI •• 1,1,1 TESTLH TXL NEXT6,l,.. ..=LHV TOV LEAVE IC1+2 MAY CAUSE OVERFLOW) • EXIT LEAVE LXD IVTOHV-3,2 LXD IVTOHV-4,l 4,4 TRA • CONSTANTS, TEMPORARIES KO PZE o K1 PZE 1 MSK OCT 000077000000 WORO PZE •• END • ••••••••••••••••••••••• IVTOHV • •• ••••••••••••••••••••••• IPAGE 0075 0076 0077 0078 0079 0080 0081 00B2 0083 0084 0085 0086 00B7 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 2) •••••••••••••••••••••••• • IXCARG • , ...•..•..... , •..•....•. PROGRAM LISTINGS ., ••••••• * •• ~ ••• * •••••••• * • IXCARG (SUBROUTINE) • LABEL C I XCARG SUBROUTINE IXCARGIARG,IXCOM) IXCARG • f •• ' •••••••••••••••••••• DECK IS "0. 0066 0001 0002 0003 C 0004 ----ABSTRACT---C 0005 C 0006 C TITLE - I XCARG 0007 C LOCATE ARGUMENT WITH RESPECT TO COMMON 0008 C 0009 IXCARG RETURNS THE LOCATION OF ITS FIRST ARGUMENT TO C 0010 C THE CALtING PROGRAM, THE LOCATION BEING DETERMINED AS 0011 THE INDIX OF THAT ARGUMENT WITH RESPECT TO THE fORTRAN C 0012 COMMON BLOCK. C 0013 0014 C C THUS IXCARG PERMITS ACCESS TO LITERAL DATA IN A CAtLING 0015 SEQUENCE, A PRINCIPAL USE BEING TO LOCATE HmLLERITH DATA. C 0016 9/29/64 LAST CARD I~ C C C C C C 0017 LANGUAGE EQUIPMENT STORAGE SPEED AUTHOR - FORTRAN II SUBROUTINE 709 OR 7090 IMAIN FRAME ONLY) 35 REG ISTERS 42 MACHINE CYCLES PLUS TWO CALLS OF XLOCF S.M~ SIMPSON, MARCH 1963 C - ...--USAGE---C C C TRANSFER VECTOR CONTAINS ROUTINES - NONE AND FORTRAN SYSTEM ROUTINES - XLOC C C C FORTRAN USAGE CALL IXCARGtARG,IXCOM) C C C INPUTS C ARG IS THE ARGUMENT WHOSE LOCATION IS DESIRED C C C C C C OUTPUTS IXCOM C C C C IS THE INDEX OF ARG WITH RESPECT TO COMMON I.E. IF THE CALLING PROGRAM HAS THE FOLLOWING STATEMENTS DIMENSION CM(2) COMMON CM THEN CMIIXCOM) EQUALS ARG C C EXAMPLES C C 1. TYPICAL USE TO LOCATE LITERAL HOLLERITH DATA C C C C C C C C C C C C C C (NOTE HOW OWTPUT SHOWS FAP-STYLE STORAGE WITH FENCE) DIMENSION CM(2) COMMON CM CALL IXCARGI18HFIRST,SECOND,THIRD,IXCOMl 6HFIRST, OUTPUTS - CM~IXCOM) CMCIXCOM-l1 6HSECOND CM~IXCOM-2) = 6H,THIRO CM~IXCOM-31 = OCT 777777777777 (THIS IS THE FENCE) USAGE 2. LOCATION OF LITERAL CONSTANTS USAGE «ALL IXCARG(3.14159265,IXCOM) OUTPUTS - CMtIXCOM) = 3.14159265 PROGRAM FOLLOWS BELOW DIMENSION CM(2) COMMON CM IXCOM = XLOCF(CM) - XLOCFI ARGI +l RETURN END 0018 0019 0020 0021 00211 0021 0024 0025 0026 0027 002B 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 ........................... • KIINTl PROGRAM LISTINGS • •••••••••••••••••••••••• • KIINTI (SUBROUTINE) • LABEL •••••••••••••••••••••••• • KIINTI • •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0128 0601 0002 CKIINTl 0003 SUBROUTINE KIINTI (CHISQ,NDF,PROB,IANS) 0004 C 0905 C ----ABSTRACT---0006 C 0001 C TITLE - MINH 0008 C PROBABILIty THAT A CHI-SQUARED VARIATE EXCEEDS A VALUE~ 0009 C 0010 KIINTI PRODUCES THE PROBABILITY THAT A CHI-SQUARED VARIATE C WILt EXCEED A GIVEN VALUE. THIS PROBABILITY IS tOMP~TED BY 0011 C EQUATIONS GIVEN BY YULE AND KENDALL, 1950, THEORY OF OOU C STATISTICS, PAGE 464 (FOOTNOTE) FOR NDF LES6 THAN 31. 0013 C WHERE NDF = NO. DEGREES OF FREEOOM. . 0014 C FOR HIGHER NDF THE NORMAL APPROXIMATION IS YSED~ 0015 C WHEN THE NORMAL APPROXIMATION IS USED A TABLE OF THE 0016 C NORMAL QISTRIBUTION WHICH APPEARS IN SUBROUTINE NOINTl IS 0017 C 0018 USED AND, SINCE THIS TABLE HAS ONLY 201 VALUES C 0019 COR~ESPCNDING TO VALUES OF X CUNIT NORMAL) F.ROM C 0020 0.0 TO 4.0, PROBABILITIES LESS THAN .00032 ARE SET TO ZE~O C AND THOSE GREATER THAN 99968 ARE SET EQUAL TO ONE_ TH~S 0021 C 0022 DOES NOT OCCUR IF THE EQUATIONS ARE USED. C 0023 C 0024 C LANGUAGE - FORTRAN II SUBROUTINE 0025 C EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0026 - 191 REGISTERS C STORAGE 0027 C SPEED 0028 AUTHOR - S.M. SIMPSON C 0029 C 0030 C ---USAGE--9/29/64 0031 C C TRANSFER VECTOR CONtAINS ROUTINES - NOINTI AND FORTRAN SYSTEM ROUTINES - SQRT, EXPC3 C C C FORTRAN USAGE CALL KIINTltCHISQ,NDF,PROB,IANS) C 0032 0033 0034 0035 0036 0037 0038 C C INPUTS C CHISQ C C C C NDF C C C OUTPUTS C PROB C 0039 IS THE PARTICULAR VALUE OF A CHt-SQUARED MUST 8t.: GRTHN=O. VARIATE~ IS THE NUMBER OF DEGREES OF FREEDOM OF THE VARIATE. MUST BE GRTHN O. IS THE PROBABILITY THAT THE VARIATE GRTHN=CHISQ. C C C C IANS =0 =1 =2 NORMAL IltEGAL CHISQ ILLEGAL NOF C C EXAMPLES C THE AGREEMENT BETWEEN THE PROB VALUE IN THE EXAMPLES AND THE C COMPUTEO PROB VALUE IS TO 3 OR FOUR PLACES SINCE 4 PLACI TABLES C WERE USED TO MAlE UP THE EXAMPLES. C C CHISQ=-l. C 1. INPUTS - NDF=1 IANS=l OUTPUTS - ERROR C C CHISQ=l. 2. INPUTS NDF=O C IANS=2 OUTPUTS - ERROR C C C C 3. INPUTS - NDF=l CHISQ=l. OUTPUTS - PROB=.3119 IANS=O C C 4. INPUTS C - NOF=8 CHISQ=2.7330 OUTPUTS - PROB=.95 IANS~O C CHISQ=38.932 C 5. INPUTS - NOF=21 IANS=O OUTPUTS - PROB=.Ol C C 0040 0041 0042 0043 0044 0045 0046 0041 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0660 0061 0062 0063 0064 0065 0066 0067 0068 0069 0010 0011 0012 0013 0014 ·........_•.....•.....•. • KIINJI PROGRAM LI STINGS • •••••••••••••••••••••••• IPAGE 2) C C C C C C C C C C C •••••••••••••••••••••••• KIINTl • • •••••••••••••••••••••••• (PAGE 6. INPUTS - NOf=]O CHISQ=4].11] OUTPUTS - PROB*.05 IANS=.O 1. INPUTS - NOf=]l, CHISQ=l1. OUTPUTS - PROB=.98 IANS=O 8. INPUTS - NDf=] CHISQ=2.]66 OUTPUTS - PRDB=.50 IANS=O INITIALIZE AND CHECK If NORMAL CURVE APPROXIMATION IS TO BE USED. IANS=l IfICHISQI9999,10,10 10 IANS=2 IflNDfl 9999,99~9,12 12 I ANS=O 15 CHI=SQRTfICHISQJ If INOf-]OI 20,ZO,70 C PROB IS COMPUTED IN THE fORM PROB P1+P2.P3. CHECK NOf fOR EVEN. 20 P2=12.118Z8tB31 •• I-CHISQ/Z.01 NDfH=NDf/2 If INDF-2.NDFHI 25,Z5,]0 C EVEN. SET Pl=O. AND P]=1.0 IF NOf=Z. 25 Pl=O.O IF INOF-2) 21,Zl,50 27 P]=l.O GO TO 60 C ODD. COMPUTE PI, MODIFY PZ AND SET P]=O.O IF NOf=l. 30 CALL NOINTlICHI_P11 Pl=Z.0.11.0-Pll PZ=CHI.PZ*.79188480 If (NOF-l) ]5,35,50 35 P3=0.0 GO TO 60 C EVALUATE P3 AS A POlYNOMIAL fOR NOF GREATER THAN 2. 50 NlOOPS=NOFH-1 P3=1.0 C IF NOf=3 INlOOPS=OI, P]=l. IFINlOOPSI 60,60,52 52 01 V=NOf-2 00 55 I=l,NlOOPS P3=P3*CHISQ/OIV*1.0 55 OIV=OIV-2.0 GO TO 60 C COM8INE PIECES TO FORM PROB. 60 PR08=Pl+P2.P3 GO TO 9999 C USE NORMAL APPROXIMATION FOR NOF GREATER THAN 30. 70 CHIMOO=CHI*1.414Z14-SQRTfIFlOATFINOF).Z.0-1.01 CAll NOINT1LCHI~OO,Pl) PROB=1.0-P1 GO TO 9999 9999 RETURN END OOD~ 0015 0016 0017 001B 0019 OOBO 0081 0082 008] 0084 0085 0086 0087 0088 0089 0090 0091 009Z 009] 0094 0095 0096 0097 0098 0099 0100 0101 010Z 010] 0104 0105 0106 0107 0108 0109 0110 0111 0112 OIl] 0114 0115 0116 0111 0118 0119 0120 01Zl 012Z 0123 01Z4 01Z5 0126 0127 01Z8 21 •••••••••• ~••••••• *.* ••• • KOLAPS PROGRAM LISTINGS f . . . . . . . . . . . . . , •••••••••• • • .............. * ••••••••••••• 9/29/64 • KOLAPS ISUBROUTINE) • FAP .KOLAPS COUNT 200 LBL KOLAPS ENTRY KOlAPS IXMIO,M,TYPE,L,CMIO,ERR) • • • KOLAPS LAST CARD IN DECK IS ----ABSTRACT---- • TI HE - KOLAPS • COLLAPSE OOD-lENGTHED VECTOR ABOUT ITS MIDPOINT • • • • • • • • • •• • • • • • • • • KOLAPS REDUCES A VECTOR XII) I=-M, ••• ,O, •••• M fl ANOTHER VECTOR Cll) 1= -L, ••• wO,~ ••• L BY THE OPERATION CII) = X(I)+XII+2.L)+XCl-2.L)+X(I+4.L}~X(I-4'Ll •••• FOR 1= -IL-1), •••• 0, •••• L-l WHERE SUMMATION TERMINATES AS X SERIES TERMINATES C[LI = C[-LI = ONE-HALF VALUE FROM ABOVE EXPRESSION KOLAPS HANDLES BOTH FIXED AND FLOATING POIN~ VECTORS. OUTPUT MAY BE STORED ON TOP OF INPUT. LANGUAGE EQUIPMENT STORAGE SPEED AUTHOR - FAP SUBROUTINE IFORTRAN II COMPATIBLE) 709 OR 7090 IMAIN FRAME ONLY) 100 REGISTERS ABOUT 12.M MACHINE CYCLES, FOR FIXED PT. DATA ABOUT 21.M MACHINE CYCLES, FOR FLOATING PT~ DATA - J. CLARK 10/61 ----USAGE--- • TRANSFER VECTOR CONTAINS ROUTINES • AND FORTRAN SYSTEM ROUTINES - • NONE NONE • FORTRAN USAGE • CALL KOLAPStXMID,M,TYPE.L,CMID,ERR) • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • INPUTS XMIDI I) CONTAINS THE TWO-SIDED VECTOR XIJI J= -M, ••• ,O ..... ,M SUCH THAT XMIDCll = XIO) , I.E. XMID[I) = XII-II I=-M+1, •• ~.M+l XMIO MAY BE FLOATING POINT OR FIXED POINT M DEFINES LENGTH OF X TO BE Z*M+1 MUST NOT BE NEGATIVE TYPE = 0.0 SIGNIFIES XII} IS FIXEO POINT NOT· 0.0 SIGNIFIES'X[lr IS FLOATING POINT L OEflNES LENGTH OF COLLAPSED VECTOR TO BE 2'L+1 MUST EXCEED ZERO. MAY EXCEED M. OUTPUTS C'HDII) ERR • f •••••••••••••••• • •••••• CONTAINS THE COLLAPSED VECTOR CIJ} Js -L,.J.,L SUCH THAT CMID(1) = CIO) I.E. CMID[I) = C[I-1) I = -L+1, ••• ,L~1 WHERE C[JI IS DEFINED IN ABSTRACT ABOVE EQUIVALENCE (XMID,CMIDI IS PERMITTED 0.0 NORMALLY 1.0 IF l OR M IS ILLEGAL 2.0 IF OVERFLOW OCCURS EXAMPLES IN ALL EXAMPLES, INPUTS ARE ASSUMED TO BE THE SAME AS EXAMPLE 1. UNLESS OTHERWISE STATED 1. OROINARY USA&E IfiXED OR FLOATING) INPUTS - XXt1 ••• 91 = 1.,3.,2.,1 •• 3 •• 5.,1.,1.,1. IXX[1.~.91= 10,30,20,10.30,50,10,10,10 CALL KOlAPS[XXI51.4.1.0,2.CCI3I,ERRIJ USAGE CAll KOlAPSIIXXI5I,4,O.,2,ICCI3I,ERR31 ERRI-O. OUTPUTS - CCtl ••• 51 = 1.5,2.,5.,8 •• 1.5 NO~ 0218 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 OOla 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0021 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 .......................•-. ........................ KOLAPS •••••••••••••••••••••••• P ROGRAI1 LI STINGS - • • • IPAGE 2) • • ICCl1.~.5l = 1~,20.50.80.15 ERR2=0. • 2. STORAGE OF OUTl'UT ON TOP OF INPUT (FIXED OR FLOATING! USAGE CALL KOLAPSIXX(5)~4.1.0.2.XXI5l.ERR1) • • CALL KOLAPSIIXXI5I,4,O.,2,IXXI5l.ERR21 • OUTPUTS - XX(1 ••• 9l 1.,3.,1.5,2.,5.,8.,1.5,1.,1. • IXXll.J.9) = 10.30,15,20,50,80,15,10,10 = • • 3. SPECIAL CASE - LsM IFLOATING) USAGE [ALL KOLAPSIXX(3l 1 2,l.,2,CCI3l,ERR) • • OUTPUTS - CCtl •• ~5l = 2.,3 •• 2.,1.,2. ERR*O. •• • • • • •• • • • • • 4. SPECIAL CASES USAGE L EXCEEDS 11 AND 11=0 CALL KOLAPSIXX(3l.2,l.,4.CCI5l,ERRl) CALL KOLAPSIIXX,O,0.,2,ICC(3I,ERR2} OUTPUTS - CCe1 •• J9l 0.,0 •• 1.,3.,2.,1.,3.,0.,0. ERRI " O. ICCll.J.51 = 0,0,10.0.0 = 5. ERROR CONDITIONS CALL KOLAPSIXX,-1,1.,2.CC,ERR1) USAGE CALL KOLAPS(XX,O,l •• 0,CC,ERR2l OR OUTPUTS - ERRl = 1. (IllEGAL Ml ERR2 = 1. (IllEGAL L) = • 6. INPUTS - IXX(1.~.5l 90000,90000,90000,90000.90000 • USAGE tALL KOLAPSIIXXI31.2,O •• 1.ICC(21.ERR) • OUTPUTS - ERR 2. (OVERFLOWl • = HTR o BCI 1.KOlAI!S KOLAPS SXO KOLAPS-2.4 SXA LEAVE+}'l SXA LEAVE+2,2 • GETL AND CHECK IT (MUST EXCEED ZERO) CLA KF1 STO ERR ClA· 4.4 TI11 LEAVE TlE LEAVE STD KL SET UP FOR FIXED OR FleATlNG AXT 0.1 lET. 3,4 AXT -101 CLA KADD1,l STO NOP2 KADD2,1 ClA STO NOP3 KlRS,l CLA NOR4 STO * SET DECREMENTS ETC. DEPENDING ON L,M CLA KL STD TX13 L 0,1 POC SXD TXJ4.1 -L ADD KL TXIl SfD 2L 0,1 PDC TXI2,l SXD -2L SUB KDl S'1"D TXll 2L-l CLA. 2,4 TMI LEAVE ( IllEGAL M EX IT 1 STD TXH1 M KTXH STD ADD KDl PDC -M-1 0.1 SXD TXH2tl SXD KTXL.1 CLA KTXL s;ro NOPI • SET AODRESS XMltl,CMID CLA 1.4 STA NOP2 STA NOP3 • * KOlAPS •••••••••••••••••••••••• (PAGE 2) ' - 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 Otl4 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 .........'."............•. • KVlAPS PROGRAM 1I STINGS • IPAGE f •• ' •••••••••••• •• •••••• if KOlAPS 3) ClA 5,4 STA STO STA ClA SlfA STQl STA STQ2 • MAIN lOOP. SETS CIIl I=-l •••• ,l-1 • NOTES - XR4 CONTROLS I .. - XR1 CONTROlS XIII,XII-2ll, ••• (XRl GETS BUMPED DOWN) • - XR2 CONTROLS XII+2ll,X(I+4l),... IXR2 GETS BUMPED UP, .. SUMMATION IN PAIRS BY XR1.XR2 MEANS,WHEN XR1 EXCEEDS BOUNDS SO WILL XR2 ClA Kf2 STO ERR TOV .+1 lOC Kl,4 START WITH I=-l IXR4=-ll • OUTER LOOP KO CLEAR AC OUTR CLA PXA 0.4 INITIALIZE XRl AND XR2 TO I PAX 0.1 PAX 0.2 IF SO. STOREZEROI * ICHECK IF FIRST XID IS OUTSIDE RANGE. NOP1 NOP = TXl STO.l,-M-l FOR 1=-l •• J •• -1 TXH STO.l.M FOR I=O,I, •••• l-l * INNER lOOP * .+ 1,2 ••• •• ~2l (BUMP XR2 UP, lOWEST=+ll TXIl TXI AOD ••• 1 OR FAO ••• 1 •• =XMJD NOP2 NOP TXHI TXH *+2,2,·· **=M ADD •• ,2 OR FAD •• ,2 •• =XMID NOP3 NOP TXI2 TXI *. =-2l (XRl IS NEG FOR All TESTS) ·+1.1 •• • TXH2 TXH TXIhl; •• *.=-M-l • STORE AND CHECK FOR MORE •• ,4 STO STO ··=CMID BUMP XR4 TXI ·+1.4.1 TXH TXI3.4.0 ClA KTXH SWITCH TEST ON FIRST XII) NOPI STO FOR 1=0 ON TXI3 TXI .*=+l CHECK ·+1.4 •• .+2,4 ••• TXll TXl .*=2l-1 FOR TRA COMPLETION ODNE OUTR,4,_* •• =-l BACK TXI4 TXI • PATCH UP ENOS DONE lOC Kltl Kl,4 lXO •• =CMID ClA ClA NOP4 NOP =lRS 36 OR fOP KF2 •• ,1 STQl STQ ·.=CMID STQ2 STQ **,4 ··=CMID TOV LEAVE ERR STl lEAVE lXD KOlAPS-2,4 AXT ··.1 •• ;2 AXT ClA ERR 6,4 STO· 7,4 TRA KO PZE 0 KF2 2.0 DEC KFl DEC 1.0 0,0, •• Kl PZE ·"=l KOI PZE 0.0,1 36 THE STORAGE KlRS lRS KF2 ORDER· FOP Of KADDI ADO 001 THESE SIX FAD 0.1 KADD2 ADO IS 0.2 FAD IMPORTANT 0.2 KTXl TXl STm.l,.· "*=-M-l KTXH TXH ·*:M STO.l,"" ERR 1.0.2.0,0.0 PZE "'=ERR SETTING END = .... •• • •••••••••••••••••••••••• (PAGE 3) ••••••••••••••••••• ** ••• 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0201 0208 0209 0210 0211 0212 0213 02 ... 0215 0216 0211 0218 ......................** •• • LIMITS ....•...•............. -. • PROGRAM LISTINGS •••••••••••••••••••••••• LIMITS • • • •••••••••••••••••••••• * 9/B/64 LAST CARD IN DinK IS NO. 0161 • LIMITS (SUBROUTINE) 0001 FAP • *LIMITS 0002 COUNT 150 0003 LBL LIMITS 0004 ENTRY LIMITS (IANSXI,IANS, XI,XIA,XIB, X2,X2A,X2B, .j., 0005 XN,XNA,XNB) 0006 • 0007 • OOOB • ·---ABSTRACT---0009 • 0010 • 0011 • TITlE - LIMITS • CHECK THAT VARIABLES FROM LIST FALL WITHIN GIVEN LIMITS 0012 0013 • LIMITS IS A VARIABLE-LENGTH-CALLING-SEQUENCE IP.ROGR'AM IN 0014 • WHICH THE ARGUMENTS BEYOND THE SECOND OCCUR IN TRIPLETS. 0015 • LIMITS CHECKS TO SEE IF THE FIRST MEMBER OF EACH TRIPLET 0016 • LIES IN THE INCLUSIVE RANGE DEFINEO BY THE NEXT TWO 0017 • MEMBERS. IF THIS HOLDS FOR ALL TRIPLETS. THEN LIMITS 0018 • SETS ITS SECOND ARGUMENT EQUAL TO ZERO. IF NOT, THEN ITS 0019 • SECOND ARGUMENT IS SET EQUAL TO THE FIXED POINT SUM OF 0020 • ITS FIRST ARGUMENT PLUS ONE LESS THAN THE iNDEX OF THE 0021 • FIRST TRIPLET FOUND TO FAIL THE TEST. 0022 • 0023 • THE TRIPLET ARGUMENTS MAY BE ANY MODE, AND +0 )S TREATEO 0024 • EQUAL TO -0 IN THE COMPARISONS. 0025 • 0026 • - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) 0027 • LANGUAGE 0028 • EQUIPMENT - 709,7090,7094 (MAIN FRAME ONLY) - 44 REGISTERS 0029 • STORAGE - ABOUT 26 + 43N MACHINE CYCLES 0030 • SPEEO WHERE N = NUMBER OF TRIPLETS 0031 • - S.M. SIMPSON, JUNE 1964 0032 • AUTHOR 0033 • 0034 • ----USAGE---0035 • 0036 • • TRANSFER VECTOR CONTAINS ROUTINES - (NOT ANY) 0037 • ANO FORTRAN SYSTEM ROUTINES - (NOT ANY) 0038 0039 • 0040 • FORTRAN USAGE • CALL LIMITS(~ANSXl,IANS, xl,xiA,X1B, X2,X2A,X2B, •• J, XN,XNA,XNBI 0041 0042 • 0043 • 0044 • INPUTS 0045 • IANSXI IS ANY FIXED POINT NUMBER, PREFERABLY GRTHN= 1. WHICH IS 0046 • TO BE THE OUTPUT VALUE OF IANS IN THE CASE TfflAT Xl 0047 • FAILS TO LIE WITHIN X1A TO XIB. 0048 • 0049 • Xl IS ANY MODE. 0050 • XIA SHOULD BE SAME MODE AS Xl. 0051 • X1B SHOULD BE SAME MODE AS Xl (MAY BE GRTHN, LSTHN OR EQUAL 0052 • TO XU) • 0053 • 0054 • X2 IS ANY MOOE, NOT NECESSARILY THE SAME AS Xl. 0055 • X2A SAME MODE AS X2. 0056 • X2B SAME MODE AS X2. 0057 • 0058 • CETC UP THRU XN,XNA,XNB WHERE N SHOULD EXCEEO ZEROF. 0059 • 0060 • 0061 • 0062 IL~EGAL RETURN OCCURS IF ARGUMENT COUNT MINUS 2 IS NOT A • OUTPUTS MULTI PLE OF 3. 0063 • 0064 • LET XJ,XJA,XJB STAND FOR J-TH TRIPLET, J.I~2,.~.,N 0065 • AND LET XJLO = MINtXJA,XJB), XJHI = MAXf1XJAjXJBI~ 0066 • THEN 0067 • 0068 • 0069 IANS = 0 IF XJLO LSTHN= XJ LSTHN= XJHI, FOR ALL J. • IANSXl+K-l IF XK FAILS TO SATISFY ABOVE EQUATION, 0070 • WHERE K IS THE LOWEST J VALUE FOR WHICH FAILURE 0071 • 0072 OCCURS. • 0073 0074 • .. ••••••••••••••••••••••••• • LIMITS •••••••••••••••••••••••• • LIMITS • •••••••••••••••••••••••• (PAGE 21 PROGRAM LI STINGS • •••••• •••••••••••• * •••• ~ (PAGE 2) • EXAMPLES • • 1. ZERO TESTS • USAGE CALL LIMITSll.IANS. -0.-0,1. -0.+0.1. +0.-0.1. +0.+0.1, -0.-1.-0. -0.-1.+0. +0.-10-0., ..0.-1i+0. +0.+0.+0. +0.+0.-0. +0.-0.+0. +0.-0.-0. -0,+0.+0, -0.+0,-0. -0.-0.+0. -0.-0.-01 OUTPUTS - IANS = 0 • •. . • 1 2 3 • 2. GENERAL TESTS .. USAGE • CALL LIMITSIl.IANSl. 1.0.2.0.3.0) CALL LIMITSI21.IANS2. 3.1.4, 3 •• 1•• 4~. 1.1.4. 1.2.3, 4,1.4) 1 CALL LIMITSI31.IANS3, 0.,0.,0 •• 1.1.1. 3,1.2, 0.1,21 OUTPUTS - IANS1 1 a 1. IANS2 : 25. I~NS3 34 • • = • ... • 3. USAGE -/SAME AS EXAMPLE 2. BUT REVERSING THE OROER OF tHE SECOND • AND THIRD MEM8ER OF EACH TRIPLET. .. OUTPUTS - SAME AS EXAMPLE 2. .. .• . PROGRAM FOLLOWS BELOW BCI • ONLY ENTRY. • lIMITS •.. • SXA CLA STA CLA STA AXT STZ- l,LIMITS LIMITSIIANSX1,IANS. Xl,X1A,X1B, DONE,l 1,4 ADD 2,4 STO 0,1 2,4 X2.X2AyX2B~ ••• ) AI IANSXl1 AIIANS) XRl IS TRIPLET INDEX MINUS (INITIALIZE IANS TO ZERO) CHECK FOR ANOTHER TRIPLET CAL DONE CAL ANA LAS TRA TRA AXT TRA 3,4 AMASK TSXZ DONE CHECK ··;1 .• COMPARE X AND 3.4 X~O, • CHECK ZET. TRA CLA. LDQTlQ XCA STO &TQ CLA. TNZ SSP CAS CAS1 TRA TRA • • SET • BAD ADD STO . IS C(3,4) A TSX X,O INSTRUCTION NO YES NO C•• = XRl INITIAL) UNLESS WE HAVE ALREADY FOUND A STD TXI 5,4 4.4 ·+2 XHI XLD 3,4 CASI XLD OKLO OKLO DISCREPAN'Y~ X1B XIA X (BIG ZERO FOR lOW CHECK) X AGAINST XlO OK OK IANS FOR DISCREPANCY PXD ADD STO TRA ....... 0.1 • - = AI IAN SX 1) .. A(IANS) TXI • COMPARE X AND XHI •OKLO CAS2 TNZ SSM CAS CAS2 XHI (LITTLE ZERO FOR HI CHECK) X AGAINST XHI 0015 0016 0011 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 ••••••••• tIt*,. .............. . * PROGRAM LISTINGS LIMITS * ** •••••• **.* •••••••• * ••• (PAGE 31 TX! TRA NOP IXI TX! BAD *+1,1,1 CAL,4,-3 * • CONSTANTS • AMASK TSXI XLO XHI OCT TSX PZE PIE END 717117100000 0,0 ·-f*·'-· .*.**,** •••••••••••••••••••••••• • LIMITS • ••••••••••••••••••• *** •• (PAGE 3) X TOO BIG OK OK, TRY ANOTHER. 0150 0151 0152 0153 0154 0155 0156 0151 015B 0159 0160 0161 ......•.•.•..... • LINE ~ (109) ....... • PRo.GRAM LI STINGS • •••••••••••••••••••••••• • .. ..... . ...• .. .. .. .. .. • •.. .. .. it • .. it .. .. it .. .. . it it it it it •.. .. • . • • it it .. • • it .. it .. •.. 1109) LINE (109) • f ••••••••••••••••••••••• LAST CARD IN DECK IS N6.. 0192 0001 (109) 0002 Co.UNT 150 0003 LBL LINE 0004 ENTRY LINE (Xl,Yl,X2,Y2) 0005 0006 ----ABSTRACT---0007 0008 TITLE - LINE (109) 0009 FAST, ARBITRARY STRAIGHT LINE SEGMENT o.N SCo.PE 0010 0011 LINE PLo.TS A STRAIGHT LINE FROM A Po.INT IXl,Yl) TO A 0012 Po.INT (X2,Y2) o.N THE SCOPE. THE PLo.TTING DENSITY IS 0013 ADJUSTED So. THAT THE SEPARATIo.N BETWEEN INDIVIDUAL POINTS 0014 WILt BE LSTHN=2.0 AND GRTHN=1.414 SCo.PE UNITS. 0015 0016 LANGUAGE - FAP. SUBRo.UTINE (Fo.RTRAN II Co.MPATIBLE) 0017 EQUIPMENT - 109 (MAIN FRAME AND SCo.PE UNIT) 0018 STo.RAGE - 91 REGISTERS 0019 SPEED - MAXIMUM 0020 AUTHo.R - S.M': SlfIIPSo.N 0021 0022 0023 ----USAGE---0024 TRANSFER VECTo.R CONfAINS Ro.UTINES - No.NE 0025 AND Fo.RTRAN SYSTEM Ro.UTINES - NONE 0026 0027 0028 Fo.RTRAN USAGE CALL LINE (XI,YI,X2,V2) 0029 0030 INPUTS 0031 Xl IS X CClORDINATE OF 1 END o.F LINE TO. BE PLOTTED. 0032 Yi IS V CIlORDINATE OF 1 END OF LINE TO. BE PLo.TTED. 0033 X2 IS X CClo.RDINATE o.F 2 END OF LINE TO. BE PLo.TTED. 0034 V2 0035 IS Y CIlORDINATE o.F 2 END OF LINE TO. BE PLOTTED. 0036 NOTES 0037 Xl,VI,X2,Y2 ARE FLOATING POINT NUMBERS. 0038 MUST BE LSTHN 1024. GRTHN=O. 0039 IF ARE GRTHN=1024. OR LSTHN 0 NO LINE 0040 I S PLOTTED. 0041 0042 o.UTPUTS II NE PLOTTED o.N THE SCOPE 0043 0044 EXAMPLES 0045 0046 1. INPUTS - Xl=lO. Yl=50. X2=1000. Y2=50. 0047 004B 2. INPUTS - Xls50. Yl=lO. X2=50. Y2=1000. 0049 0050 3. INPUTS - X12200. Yl=20. X2=500. Y2=1000. 0051 0052 4. INPUTS - Xl=100. YI=IOOO. X2=500. Y2=20. 0053 0054 5. INPUTS - X121000. Yl=200. X2=10. Y2=500. 0055 0056 6. INPUTS - X120. Yl=1023. X2=1023. Y2=0. 0057 0058 1. INPUTS X12150. Yl=150. X2=750. Y2=750. 0059 OUTPUTS - THE NUMBERS ON THE DISPLAY CORRESPOND TO THE EXAMPLE 0060 • .1INE • •.. LINE FAP ...-•..•.•...•....•..... IS~BRo.UTIN~) 9/29/64 * •••••••• *.*•• * •• *.~ •••• • LINE (109) PROGRAM LISTINGS - • •••••••••••••••••••••••• (PAGE 2) • IT IS PLOTTED NEAR THE X1,Y1 * * • -• • * • • * • • * * * * 9. INPUTS • • X1~-4. (709) IPAGE NUMBER. - 8. INPUTS LINE • •••••••••••••••••••••••• * * -• • --• •••••••••••••••••••••••• Y1=5. - X1-1021t.15 X2=5. Y1=5. Y2=5. X2=5. Y2=5. OUTPUTS - NOTHING IS PLOTTED. -SAVE INDEX REG AND CHECK LEGALITY OF ARGUMENTS LINE SXA LV,! 1.1t CLATSX CK;l 2,1t CLATSX CK.I 3,4 CLATSX CK.I 4,4 CLATSX CK;l TRA SET ALL OK TMI CK LV BAO CAS KL1024 NOP BAD TRA LV BAD TRA 1,1 OK *SET INITIAL X AND Y 1,4 SET CLA* Xl TSX FXd ALS 18 PTRND STO ALS 1 STO PHRU 2,4 CLAY1 TSX FXH ADD PTRND STO PTRND ANA AN AlS 1 ADD PTTRU STO PTTRU -SET DELTA X. DELTA Y TIMES 2 EXP 1 3,4 X2 CLAMINUS Xl FSB* 1.4 STO DIH 4,4 ClAY2 2,4 MINUS Y1 FSB* STO DIFY -NO PTS PLOTTED WILL BE SET =IMAGIY2-M)+MAGIX2-Xl11/2+1 CLA DIFX SSP fAM DIFY POINT~ 0061 0062 0063 0064 0065 0066 0061 0068 0069 0010 0071 0012 0013 0014 0015 0016 0011 001B 0019 0080 00B1 0082 0083 0084 0085 0086 0081 0088 00B9 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 01:14 0115 0116 0111 0118 Otl9 0120 OUI 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 2) •••••••••••••••••••••• *- (1091 LINE • ••••••••••••••••••••••••• (PAGE PROGRAM LI STINGS 3' FOP H2 XCA TSX FX.l STO NNCSX STORE FXD PT NO. INCRS ORA ORF FAD ORF S10 NNCSl STOR FlTG PT NO. INCRS lOQ DIFX FORM DELTA X • 2EXP1 FMP KU28 FOP NNCSl XCA TSX FX,l AlS 18 XNTRU STO lDQ DIFY FORM DELTA Y • 2EXP1 FMP KU28 FOP NNCSl XCA FX,1 TSX STO YNTRU • SET FOR NO •. PTS = = NO. INCRS PLUS 1 LXA NNCSX,l TXI PlT,l,l .PLOT LINE PlT WTV CPY CPY PTRND CLA PTTRU ADD XNTRU ADD YNTRU PTTRU STO ARS 1 GET RIO OF EXTRA BITS ANA AN2 STO PTRND CPY,l,l TIX .EXIT •• ,1 AXT LV 5,4 TRA YNTRU PZE Y INC TIMES 2 EXP 1 .".0,0 0,,0 ••• XNTRU PZE X INC TIMES 2 EXP 1 *.,0, •• X Y TIMES 2 EXP 1 PTTRU PZE ••• 0, •• X Y FOR SCOPE PTRND PZE ORF OCT 233000000000 000000111111 AN OCT DIFX PZE flOATING POINT X2-X1 •• flOATING POINT Y2 - Yl DIFY PZE •• KL2 DEC 2.0 HTG PT NO INCRS NNCSL PZE FXD PT NO INCRS NNCSX PZE •• KU28 DEC 128. 2EXP1 Kll024 DEC 1024.0 001117001117 AN2 OCT FX UFA ORF lRS ANA AN llS 1,1 TRA END ." ...._......_.••....•.•.. . .. ..-...•...•.•.......... (1091 tiNE • ( PAGE 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0110 0111 0112 0113 0114 0115 0116 0111 0118 0179 01BO 0181 0182 01B3 01B4 0185 0186 0187 0188 0189 0190 0191 0192 31 •••••••••••••••••••••••• • LINE (10901 • •-LINE LINE FAP • PROGRAM LISTINGS ••••••••••••••••••••••••• • --•-•- • - • - - --• ---•--•--• - • • - - • - - - -• - - • • (1090) (SUBROUTINE) ......................... •••••••••••••••••••••••• • tiNE 110901 LAST CARD IN DECK IS NO. 0201 0001 (1090) 0002 0003 COUNT 160 0004 LBL LINE ENTRV LINE (XI,Vl,X2.V2) 0005 0006 0001 ----A8STRACT---0008 0009 TITLE - LINE (1090) 0010 FAST, AR8ITRARV STRAIGHT LINE SEGMENT ON SCOPE 0011 LINE PLOTS A STRAIGHT LINE FROM A POINT (XI.Vll TO A 0012 0013 POINT (X2,V2) ON THE SCOPE. THE PLOTTING DENSITV IS ADJUSTED SO THAT THE SEPARATION BETweEN INDIVID~AL POINTS 0014 0015 WILL BE LSTHN=2.0 AND GRTHN=I.414 SCOPE UNITS. 0016 0011 L.NGUAGE - FAP4 SUBROUTINE (FORTRAN II COMPATIBLE) 0018 EQUIPMENT - 1096 (MAIN FRAME. DATA CHANNEL 0 AND SCOPE) 0019 STORAGE - 95 REGISTERS SPEED - HORllONTAL LINE ACROSS ENTIRE SCOPE FACE TAKES ABOUT 0020 0021 .13 S~C - 109 0022 .036 SIC - 1040 0023 - S.M'; SIMPSON AUTHOR 0024 0025 ----USAGE---0026 0027 TRANSFER VECTOR CONTAINS ROUTINES NONE 0028 AND FORTRAN SYSTEM ROUTINES NONE 0029 0030 FORTRAN USAGE 0031 CALL LINE tX1,Vl,X2.V21 0032 0033 INPUTS 003i> 0035 Xl IS X cmORDINATE OF END OF LINE TO 8E PLOTTED. 0036 0031 IS V cmORDINATE OF END OF LINE TO BE PLOTTED': Vi 003B 0039 X2 IS X COORDINATE OF 2 END OF LINE TO 8E PLOTTED': 0040 0041 V2 IS v cmORDINATE OF 2 END OF LINE TO 8E PLOTTED. 0042 0043 NOTES 0044 Xl.Vl.X2.V2 ARE FLOATING POINT NUMBERS. 0045 MUST BE LSTHN 1024. GRTHN .. O. 0046 IF ARE GRTHN=1024. OR LSTHN 0 NO LINE 0047 IS PLOTTED. 0048 0049 LI NE PLOTTED ON THE SCOPE OUTPUTS 001)0 0051 EXAMPLES 0052 0053 1. INPUTS - X1'"10. Vl-50. X2=1000. V2=50. 0054 0055 2. INPUTS - Xl'"50. YI=lO. X2.:50. Y2=1000. 0056 0051 3. INPUTS - XI'"200. V1=20. X2=500. V2=1000. 0058 0059 4" INPUTS - Xl"'700. Yl=1000. X2"500. V2=20. 0060 0061 5. INPUTS - X1'*1000. Vl=200. X2=10. V2=500. 0062 0063 6. INPUTS - Xl'*O. Vl=1023. X2= 1023. V2=0. 0064 0065 Vl=150~ X2=150. Y2=750. INPUTS - X1"'750. 7. 0066 OUTPUTS - THE NUMBERS ON THE DISPLAY CORRESPOND TO THE UAMPLE 9/4/64 • •••••• _•••• ** ••••••••••• • LINE (1090) PROGRAM LISTINGS • ............................. (PAGE .. 2) •••••••••••••••••••••••• ., UNE (7090) • •••••••••••••••••••••••• (PAGE NUMBER. IT IS PLOTTED NEA~ THE XI,Yl POINT • • • •. • • • • • •. . • • .• • •. it ..• . .. 8. INPUTS • - XIs-4. Yle5. X2=5. Y2=5. .. 9. INPUTS - X1~1024.15 YI=5. X2=5. .. OUTPUTS - NOTHING IS PLOTTED. Y2=5. .. • PROGRAM FOLLOWS BELOW • .. FOLLOWING CARD DESIGNATES THE DATA CHANNEL THAT CRT IS ATTA¢HED TO • • TO CHANGE~ ALTER THE LETTER DESIGNATION ONLY AND REASSEMBLE. X TAPENO 01 SCPAO EQU X-lOS .SAVE INDEX REG AND CHECK LEGALITY OF ARGUMENTS HTR 0 BCI l,tINE LINE SXD LINE-2,4 SXA LV,l CLA. 1,4 TSX CK,Il CLA. 2,4 TSX CKIl CLA. 3,4 TSX CK,a CLA. 4,4 TSX CKH TRA SET ALl OK CK 8AD TMI LV CAS Kll'024 NOP BAD TRA LV BAD 1,1 OK TRA .SET INITIAL X AND Y 1,4 SET CLA. Xl TSX FXH 18 ALS PTRND SlO 1 ALS PTtRU SlO CLA. 2,4 Yl FX,I TSX PTRND ADO PTRND STO AN ANA 1 ALS ADO PTTRU PTTRU STO -SET DELTA X, DElTA Y TIMES 2 EXP 1 CLA. 3,4 X2 1,4 MINUS Xl FSB* 0061 0068 0069 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 010G 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 Ott8 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 21 •••••••••••••••••••••••• LINE 17090) ••••••••••••••••••••••••• PROGRAM LISTINGS • (PAGE 31 STO OIFX CLA4,4 V2 FS82,4 MINUS VI STO DIFV .NO PTS PLOTTED WILL BE SET =IMAGIV2-M)+MAGIX2-XII1/2+1 CLA DIFX SSP FAM DIFV FOP KL2 XCA TSX FXOl STO NNCSX STORE FXO PT NO. INCRS ORA ORF FAD ORF STO NNCSL STOR FLTG PT NO. INCRS LOQ DIFX FORM DELTA X • 2EXP1 FMP KLl28 FOP NNCSL XCA TSX FX,1 ALS 18 STO XNTRU LDQ DIFV FORM DELTA V • 2EXP1 FMP KLl28 FOP NNCSL XCA TSX FX,l S:ro VNTRU PTS ... ... NO. INCRS PLUS 1 - SET FOR NO. LXA NNCSX,1 TXI PLT,l,l .PLOT LINE PLT WRS SCPAD RCHX 10 CLA PTTRU ADO XNTRU ADD VNTRU PTTRU 5'1"0 ARS 7 ANA AN2 GET RIO OF EXTRA 8ITS PTRND STO TIX PLT,l.l 10 VNTRU XNTRU PTTRU PTRND ORF AN DIFX DIFV KL2 NNCSL NNCSX Kl128 Kt.l024 AN2 FX AXT TRA lOCO PZE PZE PZE PZE OCT OCT PZE PZE DEC PZE PZE DEC DEC OCT UFA LRS ANA LLS TRA END ..... 1 5,4 PTRND,O.l .... 0,0 0,0, .... ••• 0, •• ... ,0 •• ' V INC TIMES 2 EXP 7 X INC TIMES 2 EXP 1 X V TIMES 2 EXP 1 X V FOR SCOPE 233000000000 000000177771 ........ FLOATING POINT X2-Xl FLOATING POINT V2 - VI •• .... ... FLTG PT NO INCRS FXD PT NO INCRS 2EXP7 2.0 128. 1024.0 001777001777 ORF o AN o 1,1 •••••••••••••••••••••••• • LINE 11090) • •••••••••••••••••••••••• (PAGE 31 0142 0143 0144 0145 0146 0141 0148 0149 0150 0151 0152 015i 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0111 0172 0173 0114 0115 0116 0177 0118 0119 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0191 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 ...... ...............•. ~ • LINEH (1091 • •••••••••••••••••••••••• PROGRAM LISTINGS ••••••4 ••••••••••••••••• " LlNE~ (109) • LINEH (109) (SUBROUTINE) 9/29/64 LAST CARD IN DECK IS NO. 0151 0001 • FAP .LINEH (109) 0002 0003 COUNT 150 0004 LBL UNEH ENTRY LINEH tNXLEFT, NYLEFT, NXRITE, NDELX) 0005 0006 • 0001 ----ABSTRACT---• 0008 • 0009 • TITLE- LINEH (109) 0010 • PLOT FAST HORIZONTAL LINE ON SCOPE 0011 • LINEH HAS ARGUMENTS NXLEFT, NYLEFT, NXRITE, NDELX~ IT 0012 • PLOTS A HORIZONTAL LINE ON THE SCOPE WITH LEFT INO 0013 • COORDINATES (NXLEFT,NYLEFT), AND RIGHT END COORBINATES 0014 • 0015 (NXRITE,NYLEFT). THE SPACING OF THE POINTS WHICH COMPRISE • THE LINE IS NDLEX. THE LINE IS PLOTTEO FROM LEFt TO RIGHT 0016 • BY PLOTTING THE POINTS (NXLEFT+K.NDELX,NYLEFT) FOR K=O.l, 0017 • 2,.~.,M WHERE M.NOELX IS LESS THAN OR = TO NXRITE. AND 0018 • .K+1)*NDELX IS GREATER THAN NXRITE. IF =,LINE IS FINISHED. 0019 • IF LESS, ONE MORE POINT WILL BE PLOTTED WITH COGROINATES 0020 • (NXRITE,NYLEFT). NOTE INPUT VALUE RESTRICTIONS LISTED 0021 • UNDER INPUTS. 0022 • 0023 • 0024 • LANGUAGE - FAPI SUBROUTINE IFORTRAN II COMPATIBLE) 0025 • EQUIPMENT - 109 WITH SCOPE - 34 DECIMAL REGISTERS 0026 * STORAGE - .5+.141.(LENGTH OF LINE/PLOTTING INCREMENT) MACHINE CYCLES 0021 • SPEED - J.N. GALBRAITH, MAY 10, 1962 002B • AUTHOR 0029 • .. --USAGE---0030 • 0031 • 0032 • TRANSFER VECTOR CONTAINS ROUTINES - NONE 0033 • AND FORTRAN SYSTEM ROUTINES - NONE 0034 • 0035 • FORTRAN USAGE 0036 • CALL LINEHtNXLEFT, NYLEFT, NXRITE, NOELX) 0037 • 0038 • INPUTS 0039 • IS THE X COORDINATE OF THE LEFT END OF THE LINE. 0040 NXLEFT • 0041 • IS THE Y COORDINATE OF THE LEFT END OF THE LINE. 0042 NYLEFT • 0043 • 0044 NXRITE IS THE X COORDINATE OF THE RIGHT END OF THE LINE. • 0045 ABOVE COORDINATES ARE INTEGERS IN THE DECREMENT ANO ARE 0046 ASSUMED TO BE IN SCOPE UNITS (BETWEEN 0 AND 1023) • 0041 • 0048 IS THE PLOTTING INCREMENT. IT DETERMINES THE SPACING OF NOEL X 0049 THE POINTS WHICH MAKE THE LINE. A LARGE NDELX WILL • 0050 PLOT A DOTTED LINE. NDElX AN INTEGER IN THE 0ECREMENT. • 0051 • 0052 NO POINT IS PLOTTED IF NXLEFT IS GREATER THAN NXRITE. AND • NO POINT IS PLOTTED IF NDELX:Q EXCEPT WHEN NXLIFT~NXRITE. 0053 • 0054 IN THIS CASE THE POINT (NXLEFT,NYLEFTI IS PLOTTED. NO • ERROR INDICATORS ARE SET FOR THESE CASES AND NO CHECK IS 0055 • MAOE ON THE MAGNITUDES OF THE INPUT VALUES. QUANTITIES 0056 • 0051 GREATER THAN 1023 ARE PLOTTED MODULO 1024. • 0058 • 0059 • OUTPUTS 0060 HORIZONTAL LINE ON SCOPE. • 0061 • 0062 • EXAMPLES 0063 •• 1. INPUTS - NXLEFT~O, NYLEFT=O, NXRITE=1023, NDELX=l 0064 0065 • OUTPUTS - LINE ON SCOPE (LOWER LINE IN PICTURE) 0066 •• 2. INPUTS - NXLEFT~O, NYLEFT=100, NXRITE=900, NDELX=2 0067 0068 • OUTPUTS - LINE ON SCOPE (SECOND LINE FROM BOTTOM IN PICTURE) 0069 •• 3. INPUTS - NXlEFT-O, NYLEFT-200, NXRITE=775, NDElX-3 0070 0011 • OUTPUTS - LINE ON SCOPE (THIRD FROM BOTTOM IN PICTU~E) 0012 •• 4. INPUTS - NXlEFT~O, NYLEFT=300, NXRITE=650, NDElX-4 0013 • • * •• ff •••••••••••••••••••• * ••••••••••••••••••••••• LINEH (709) ••••••••••••••••••• * •••••* (PAGE PROGRAM LISTINGS LINE~ 21 * •••••••••••••••••••••••• • (709) • •••••••••••••••••••••••• (PAGE 2) OUTPUTS - LINE ON SCOPE (FOURTH FROM BOTTOM IN PICTUREI • • 5. INPUTS - NXLEFT~O, NYLEFT=400. NXRITE=525, NOELX=5 • OUTPUTS - LINE ON SCOPE (FIFTH FROM BOTTOM IN PICTURE) •• 6. INPUTS - NXLEFT=O, NYLEFT=500, NXRITE=400, NOELX=6 OUTPUTS - LINE ON SCOPE (SIXTH FROM BOTTOM IN PICTURE) • • * • 7. INPUTS - NXLEFT=O, NYLEFT=600, NXRITE=275, NOELX=1 OUTPUTS - LINE ON SCOPE (SEVENTH FROM BOTTOM IN PICTURE) *• * 8. INPUTS - NXlEFT=O, NYLEFT=100, NXRITE=150, NOELX=8 OUTPUTS - LINE ON SCOPE (EIGHTH ~ROM BOTTOM IN PICTURE) - • 9. INPUTS - NXLEFT~O, NYLEFT=800, NXRITE=O, NDELX=O • OUTPUTS - POINT ON SCOPE (800 SCOPE UNITS UP IN PICTURE) •-10. • INPUTS - NXLEFT~O, NYLEFT=900, NXRITE=10, NOELX=O OUTPUTS - NO POINTS ON SCOPE (BLANK FILM 900 SCOPE UNITS UPJ * INPUTS - NXLEFTslOO, NYLEFT=1000, NXRITE=10, NOELX=l OUTPUTS - NO POINTS ON SCOPE (BLANK FILM 1000 SCOPE UNITt UP. •*11. •- •• PICTURE OF SCOPE OUTPUT APPEARS BELOW. • • • • • • • • • • * • • • • • • • • • PZE BCI LINEH SXA SXA SXO CLA. ARS STA CLA. SUB. TlE TMI POX CLATlE STO STO CLA. STD POX LOOP WTV CPY INCR TXI SXO END TIX TXL 1,LINEH BACK,l BACK+H2 LINEH-2,4 2,4 18 POINT 3,4 1,4 LAST BACK ,1 4,4 BACK END INCR 1,4 POINT ,2 POINT .+1,2, •• POINT,2 LOOP.l, •• BACK,l,O Y COORD. X RIGHT X LEFT 0014 0015 0016 0071 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 OU2 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 • ••• ~ ••••• **.**** ••• **.* .. LINEH (709) ••••••••••••••••••••••••• (PAGE 3) LAST CLA" STO WTV CPY BACK AXT AXT TRA POINT PZE END 3.4 POINT POINT ••• 1 **.2 5,4 0 PROGRAM LISTINGS •••••••••••••••••••••••• .. LINEH ••• 4 •••• (709) .. *_ ..... **** •• *** (PAGE 3) 0149 0150 0151 0152 0153 0154 0155 0156 0157 ...•.............. _..... . LI NEH (1090) .. •••••••••••••••••••••••• PROGRAM LI STINGS ..••.•...••..-.......... f ••••••••••••••••••••••• .. LINEH (7090) .. LINEH (7090) (SUBROUTINE) 9/4/64 LAST CARD IN DECK IS NO. 0167 .. FAP 0001 "lINEH (7090) 0002 COUNT 140 0003 LBL LINEH 0004 ENTRY LINEH tNXLEFT. NYLEFT. NXRITE, NDELX) 0005 0006 ----ABSTRACT---0007 0008 .. TITLE - LINEH (7090) 0009 .. PLOT FAST HORIZONTAL LINE ON SCOPE 0010 0011 LINEH HAS ARGUMENTS NXLEFT, NYLEFT, NXRITE, NOElXJ IT 0012 PLOTS A HORIZONTAL LINE ON THE SCOPE WITH LEFT END 0013 CODRDINATES (NXLEFT,NYLEFT), AND RIGHT END COORGINATE~ 0014 INXRITE.NYLEFTJ. THE SPACING OF THE POINTS WHICH COMPRISE 0015 THE LINE IS NDLEX. THE LINE IS PLOTTED FROM LEFt TO RIGHT 0016 BY PLOTTING THE POINTS (NXLEFT+K*NDELX,NYLEFT) FOR K~O.l • 0017 2 •• J •• M WHERE M*NDELX IS LESS ThAN OR = TO CNXRJTE-NXLEFTI 0018 AND (M+I)*NDELX IS GREATER THAN (NXRITE-NXLEFT). IF =• 0019 LINE IS FINISHED. IF LESS, ONE MORE POINT WILL BE PLOTTED 0020 WITH COORDINATES INXRITE.NYLEFT). NOTE INPUT VjLUE 0021 RESTRICTIONS LISTED UNDER INPUTS • 0022 0023 .. LANGUAGE - FAPJ SUBROUTINE (FORTRAN II COMPATIBLE) 0024 .. EQUIPMENT - 7090 WITH SCOPE 0025 .. STORAGE - 35 DECIMAL REGISTERS 0026 .. SPEED - .5+.141.(LENGTH OF LINE/PLOTTING INCREMENT) MACHINE OYCLES 0027 .. AUTHOR - J.N. GALBRAITH. MAY 10, 1962 0028 0029 ----USAGE--0030 0031 .. TRANSFER VECTOR CONTAINS ROUTINES - NONE 0032 .. AND FORTRAN SYSTEM ROUTINES - NONE 0033 0034 .. FORTRAN USAGE 0035 .. CALL LINEHfNXLEFT, NYLEFT, NXRITE. NDELX) 0036 0031 .. INPUTS 0038 0039 NXLEFT 0040 IS THE X COORDINATE OF THE LEFT END OF THE LINE. 0041 NYlEFT IS THE Y COOROINATE OF THE LEFT END OF THE LINE. 0042 0043 • NXRITE IS THE X COORDINATE OF THE RIGHT END OF THE LINE. 0044 ABOVE COORDINATES ARE INTEGERS IN THE DECREMENT AND ARE 0045 ASSUMED TO BE IN SCOPE UNITS (BETWEEN a AND 1023) 0046 0047 NOEL X IS THE PLOTTING INCREMENT. IT DETERMINES THE SPACING OF 0048 • THE POINTS WHICH MAKE THE LINE. A LARGE NDEL~ WILL 0049 PLOT A DOTTED LINE. NOELX AN INTEGER IN THE 9ECREMENT • 0050 NO POINT IS PLOTTED IF NXLEFT IS GREATER THAN NXRITE. AND 0051 NO POINT IS PLOTTED IF NDELX=O EXCEPT WHEN NXlEFT~NXRITE • 0052 IN THIS CASE THE POINT (NXLEFT,NYLEFT) IS PLOTTED. NO 0053 ERROR INDICATORS ARE SET FOR THESE CASES AND NO CHECK IS 0054 MADE ON THE MAGNITUDES OF THE INPUT VALUES. QUANTITIES 0055 GREATER THAN 1023 ARE PLOTTED MODULO 1024 • 0056 0057 .. OUTPUTS 0058 0059 HORIZONTAL LINE ON SCOPE • 0060 0061 0062 • EXAMPLES 0063 • .. I. INPUTS - NXLEFT=O, NYLEFT=O, NXRLTE=1023. NOELX=l 0064 .. OUTPUTS - LINE ON SCOPE (LOWER LINE IN PICTURE) 0065 0066 .. 2. INPUTS - NXLEFT~O, NYLEFT=100, NXRITE=900, NDELX=2 0067 0068 .. OUTPUTS - LINE ON SCOPE ISECOND LINE FROM BOTTOM IN PICT~RE) 0069 .. 3. INPUTS - NXLEFT=O, NYLEFT=200. NXRITE=715. NDELX=3 0070 .. OUTPUTS - LINE ON SCOPE ITHIRD FROM BOTTOM IN PICTURE) 0071 0072 .. 4. INPUTS - NXLEFT=O. NYLEFT=300, NXRITE=650. NDElX=4 0073 ...... ... . .. .... .. .... .. . . . ... . . ... .. ... .. ... ... .. . .. .. . .. •••••••••••••••••••••••• ........................ • LINEH (1090) (PAGE • PROGRAM LJ STINGS 2) .• • •• , •• ** •••••••••••••••• • LINEW (1090) eUTPUTS - LINE ON SCOPE (FOURTH FROM BOTTOM IN PICTURE) .. 5. INPUTS - NXtEFT"'O,. NYLEFl=400, NXRITE=525, NOELX=5 .. OUTPUTS - LINE Ol SCOPE (FIFTH FROM BOTTOM IN PICTURE) •.. .. •• 6. INPUTS - NXLEFT"'O, NYLEFT=500, NXRITE=400, NOELX=6 OUTPUTS - LINE ON SCOPE (SIXTH FROM BOTTOM IN PICTURE) 1. INPUTS - NXlEFT"'O, NYLEFT=600. NXRITE=275, NOELX=l OUTPUTS - LINE ON SCOPE (SEVENTH FROM BOTTOM IN PICTURE) ...• 8. ..•• 9. • .. INPUTS NXLEFT~O, NYLEFT=100, NXRITE=150, NOELX=8 OUTPUTS - LINE ON SCOPE (EIGHTH FROM BOTTOM IN PICTURE) INPUTS NXlEFt"'O, NYLEFT=800, NXRITE=O, NOELX=O OUTPUTS - POINT aN SCOPE (800 SCOPE UNITS UP IN PICTURE) -10. INPUTS - NXLEFT~O, NYLEFT=900, NXRITE=10, NOELX=O .. OUTPUTS - NO POINTS ON SCOPE (8LANK FILM 900 SCOPE UNITS UP) - - II. INPUTS • --.. - NXLEFT"'100, NYLEFT=1000, NXRITE=10, NOELX=l OUTPUTS - NO POINTS ON SCOPE (BLANK FILM 1000 SCOPE UNITS UP) PICTURE OF SCOPE OUTPUT APPEARS 8ELOW. .-. .-. .--• • • ..- --.. .-. -.. .. PROGRAM FOLLOWS BELOW ..... FOLLOWING CARD DESIGNATES THE OATA CHANNEL • •••••••••••••••••••••••• (PAGE 2) THAT CRT IS ATTA&HEO TO. .. TO CHANGE, ALTER THE LETTER DESIGNATION ONLY, AND REASSEMBLI. X TAPENO 01 SCPAD EQU X-lOS PZE 8CI 1,tINEH LINEH SXA BACK.1 SXA BACK+l.2 LINEH-2,4 SXO 2,4 CLAY COORD. ARS 18 STA POINT 3,4 CLA. X RIGHT SUB. 1,4 X LEFT LAST TlE TMI BACK POX ,1 CLA. 4,4 8ACK TlE STO END STD INCR 0014 0015 0016 0071 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 •••••••••• *** ••••••••••• • • LINEH (7090) •••••••••••••••••••••••• (PAGE 3) ClA. STD POX lOOP WRS RCHX INCR TXI SXD TIX END TXl LAST ClA. STO WRS RCHX BACK AXT AXT TRA POINT PZE 10 lOCO END 1.4 POINT .2 SCPAO 10 ·+1:.2 ••• POINT.2 lOOP,l, •• BACK,I.O 3.4 POINT SCPAO 10 .·,1 *.,2 5,4 0 POINT,O.1 PROGRAM LI STINGS .,•••••••••••••••••••••••• LINEft (7090) • •••••••••••••••••••••••• (PAGE 0149 0150 0151 0152 0153 0154 0155 0156 0151 015B 0159 0160 0161 0162 0163 0164 0165 0166 0161 3) ................-.......• ' • LINEV (7091 •••••••••••••••••••••••• PROGRAM LI STINGS •••••••••••••••••••••••• • LINEV (7091 9/29/64 LAST CARD IN DECK IS NO. 0160 • LlNEV 11091 (SWBROUTINEI .. FAP 0001 .LlNEV (7091 0002 COUNT 150 0003 LBL LlNEV 0004 ENTRY LINEV lNXBOT, NYBOT, NYTOP, NOELY) 0005 0006 • 0001 ----ABSTRACT---• OOOB • 0009 • TITLE - LINEV (709) PLOT FAST VERTICAL LINE ON SCOPE 0010 0011 • lINEV HAS ARGUMENTS NXBOT, NYBOT, NYTOP. NDElY. IT PLOTS A 0012 • VERTICAL LINE ON THE SCOPE WITH BOTTOM COORDINATES 0013 • INXBOT, NYBOT), AND TOP COORDINATES (NXBOT, NYTBPJ. THE 0014 • SPACING OF THE POINTS WHICH COMPRISE THE LINE IS NOELY. 0015 • THE LINE IS PLOTTED FROM BOTTOM TO TOP BY PLOTTING THE 0016 POINTS tNXBOT, NYBOT+K-NDELY) FOR K-0,I,2,.~.,M WHERE 0011 • M-NDELY IS LESS THAN OR - TO NYTOP. AND (M+ll.NDElY IS 0018 GREATER THAN NYTOP. IF -, LINE IS FINISHED. IF LESS. ONE 0019 • MORE POINT WILL BE PLOTTED WITH COORDINATES (NXBOTINYTOP). 0020 NOTE INPUT VALUE RESTRICTIONS LISTED UNDER INPUtS. 0021 0022 • LANGUAGE - FAP; SUBROUTINE (FORTRAN II COMPATIBLE) 0023 0024 • EQUIPMENT - 109 WITH SCOPE • STORAGE - 34 DECIMAL REGISTERS 0025 • SPEED - .5+.141*(LENGTH OF LINE/PLOTTING INCREMENT) MIL~ISECONDS 0026 0021 • AUTHOR - J.N. GALBRAITH • MAY 10, 1962 0028 ---USAGE---0029 0030 • TRANSFER VECTOR CONTAINS ROUTINES - NONE 0031 .. AND FORTRAN SYSTEM ROUTINES - NONE 0032 0033 • 0034 • FORTRAN USAGE • CALL LINEVtNXBOT, NYBOT, NYTOP, NOELY) 0035 0036 .. INPUTS 0031 0038 NXBOT IS THE X COORDINATE OF THE BOTTOM OF THE LINE 0039 0040 NYBOT IS THE Y COORDINATE OF THE BOTTOM OF THE LINE 0041 0042 it NYTOP IS THE Y COORDINATE OF THE TOP OF THE LINE 0043 ABOVE COORDINATES ARE INTEGERS IN THE DECREMENT 0044 0045 AND ARE ASSUMED TO BE IN SCOPE UNITS (BETWEEN ZERO AND 1023 DECIMAL) 0046 0047 0048 NDElY IS THE PLOTTING INCREMENT. IT DETERMINES THE SPACING OF • 0049 THE POINTS WHICH MAKE THE LINE. A LARGE NDELY WILL PLOT • A DOTTED LINE. NDELY IS AN INTEGER IN THE DE«REMENT. 0050 • NO POI~T IS PLOTTED IF NYBOT IS GREATER THAN NYTOP, AND 0051 • NO POINT IS PLOTTED IF NDELY=O EXCEPT WHEN NYTmp~NYBOT • 0052 0053 IN THIS CASE THE POINT (NXBOT,NYBOTI IS PLOTTEI. NO ERROR 0054 INDICATORS ARE SET FOR THESE CASES AND NO CHEC& IS MADE • 0055 ON THE MAGNITUDES OF THE INPUT VALUES. QUANTITIES GREATER • 0056 THAN 1023 ARE PLOTTED MOOULO 1024 • 0051 • 0058 • OUTPUTS 0059 VERTICAL LINE ON SCOPE. •it 0060 0061 • EXAMPLES 0062 •• 1. INPUTS - NYSOT-O, NXBOT-O, NYTOP=1023, NDELY=1 0063 .. OUTPUTS - LINE ON SCOPE (LEFT-MOST IN PICTURE) 0064 0065 0066 .. 2. INPUTS - NYBOT-O, NXBOT-IOO, NYTOP-900, NOELY=2 0061 .. OUTPUTS - LINE O~ SCOPE (SECOND FROM LEFT IN PICTURE) it 0068 0069 - 3. INPUTS - NYBOT-O, NXBOT-200, NYTOP-115, NOELY-3 0010 • OUTPUTS - LINE ON SCOPE (THIRO FROM LEFT IN PICTURE) 0011 0012 .. 4. INPUTS - NYBOT=O~ NXBOT-300, NYTOP-650, NDElY-4 .. OUTPUTS - LINE ON SCOPE (FOURTH FROM LEFT IN PICTURE) 0073 0074 • - -..- . .. . ... ... . . .. • •••••••••••••••••••••••• .............................. LINEV (109) •................... ,. ...... .• (PAGE PROGRAM LISTINGS ............................ .. tINEV (709) (PAGE 2) • 5. INPUTS - NYBOT=O, NXBOT=400, NYTOP=525, NDELY=5 • OUTPUTS - LINE ON SCOPE (FIFTH FROM LEFT IN PICTURE) •• • • 6. INPUTS - NYBOT=O, NXBOT=500, NYTOP= 400, NOELY=6 OUTPUTS - LINE ON SCOPE ISIXTH FROM LEFT IN PICTURE) • 7. INPUTS - NYBOT=O. NXBOT=600, NYTOP=275, NDELY=7 • OUTPUTS - LINE 0 .. SCOPE (SEVENTH FROM LEFT IN PICTURE) . • 8. INPUTS - NYBOT=O, NXBOT=700, NYTOP=150, NDELY=8 OUTPUTS - LINE ON SCOPE (EIGHTH FROM LEFT IN PICTURE) ....• • 9. INPUTS NYBOT=O, NXBOT=800, NYTOP=O, NOELY=O OUTPUTS - POINT ON SCOPE 1800 SCOPE UNITS FROM LEfT IN PICTUREI •.10. • • INPUTS - NYBOT=O, NXBOT=900, NYTOP=IO, NOELY=O OUTPUTS - NO POINTS ON SCOPE (BLANK FILM 900 SCOPE UNITS fROM LEFT) .11. INPUTS - NYBOT=100, NXBOT=1000, NYTOP=10, NDELY=O • OUTPUTS - NO POUlTS ON SCOPEIBLANK fILM 1000 SCOPE UNITS fROM LEFU • .. .. PICTURE Of SCOPE OUTPUT APPEARS BELOW. • • ... • •. .. •.. • .• .. . ..•. • •. . . •. PlE BCI LINEV SXA SXA SXD CLA. STD CLASUB. HE TMI POX CLA. HE STO I NCR END BACK+l~2 CLA. POX SXA CPY TXI SXA TIX POINT *+1,2,.* POINT,2 Lomp,I, ... sro LOOP l,UNE\! BACK.l llNEV-2,4 1,4 POINT 3,4 2,4 LAST BACK ,1 4,4 BACK END INCR 2,4 ,2 POINT,2 wrv • f ... f ......................... .. X COORD. YTDP YBOT OELTA 0075 0076 0077 0018 0019 0080 0081 0082 0083 0084 00B5 0086 0081 008B 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 Oll6 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 2) ••••••••• * •••••••••• ,•••• LlNEV (7091 • •........................... (PAGE 3) TXL CLA. ARS STA WTV Cpy BACK AXT AXT TRA POINT PZE END LAST BACK,I,O 3,4 18 POINT ··.1 POINT •• ,2 5,4 0 PROGRAM L[ STINGS •• ••••••••••••••••••••••• LINEV (709) • •••••••••••••••••••••••• (PAGE 3) 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 •••••••••••••••••••••••• ........................ • LINEV (1090) • ' PROGRAM LI STINGS •• ••••••••••••••••••••••• LINEV (1090) • • ••••••••••••••••••••••• • LINEV (1090) (SUBROUTINE) 9/4/64 LAST CARD IN gECK IS NO. 0168 0001 • FAP .LlNEV 11090) 0002 COUNT 140 0003 LBL LINEV 0004 ENTRY LINEV 'NXBOT, NYBOT, NYTOP, NDELYI 0005 0006 • ----ABSTRACT---0007 • 0008 • • TITLE - LINEV (1090) 0009 • PLOT FAST VERTICAL LINE ON SCOPE 0010 0011 • LINEV HAS ARGUMENTS NXBOT, NYBOT. NYTOP~ NDELY. IT PLOTS A 0012 • VERTICAL LINE ON THE SCOPE WITH BOTTOM COORDINAtES 0013 • INXBOT, NYBOT), AND TOP COORDINATES INXBOT, NYTOP). THE 0014 • SPACING OF THE POINTS WHICH COMPRISE THE LINE IS NDELY. 0015 • THE LINE IS PLOTTED FROM BOTTOM TO TOP BY PLOTTING T"E 0016 • POINTS tNXBOT, NYBOT+K.NDELY) FOR K=O,l.2,.~~.M W~ERE 0011 • M-NDELY IS LESS THAN OR = TO CNYTOP-NYBOT), AND 0018 • (M+l)*NOELY IS GREATER THAN (NYTOP-NYBOT). IF -, LINE IS 0019 • FINISHED. IF LESS, ONE MORE POINT WILL BE PLOTtEO WITH 0020 • COORDINATES (NXBOT,NYTOP). NOTE INPUT VALUE RElITRICTIONS 0021 • LISTED UNDER INPUTS. 0022 • 0023 •• LANGUAGE - FAP4 SUBROUTINE (FORTRAN II COMPATIBLE) 00210 • EQUIPMENT - 1090 WITH SCOPE 0025 • STORAGE - 35 DECIMAL REGISTERS 0026 • SPEED - .5+~141*ILENGTH OF LINE/PLOTTING INCREMENT) MILkISfCONDS 0021 • AUTHOR - J.N. GALBRAITH , MAY 10, 1962 0028 0029 • ----USAGE-0030 • 0031 •• TRANSFER VECTOR CONTAINS ROUTINES - NONE 0032 • AND FORTRAN SYSTEM ROUTINES - NONE 0033 0034 •• FORTRAN USAGE 0035 • CALL LINEVINXBOT, NYSOT, NYTOP, NDELY) 0036 0031 • 0038 • INPUTS 0039 * IS THE X COORDINATE OF THE BOTTOM OF THE LINE 0040 • NXBOT 0041 THE NYBOT IS Y COORDINATE OF THE BOTTOM OF THE LINE 0042 • 0043 NVTOP IS THE Y COOROINATE OF THE TOP OF THE LINE 0044 ABOVE COORDINATES ARE INTEGERS IN THE DECREMENT 0045 AND ARE ASSUMED TO BE IN SCOPE UNITS CBETWEEN 0046 lERO "AND 1023 DECIMAL) 0041 0048 IS THE PLOTTING INCREMENT. IT DETERMINES THE SP.ACtNG OF 0049 • NDELY THE POINTS WHICH MAKE THE LINE. A LARGE NDELY WILL PLOT 0050 A DOTTED LINE. NDELY IS AN INTEGER IN THE DEtREMENT. 0051 • NO POINT IS PLOTTED IF NYBOT IS GREATER THAN NYTOP' AND 0052 • NO POINT IS PLOTTED IF NDELY=O EXCEPT WHEN NYTGP4NY80T. 0053 • IN THIS CASE THE POINT CNXBOT,NYBOT) IS PLOTTED. NO ERROR 0054 • INDICATORS ARE SET FOR THESE CASES AND NO CHECl IS MADE 0055 • ON THE MAGNITUDES OF THE INPUT VALUES. QUANTITIES GREATER 0056 • THAN 1023 ARE PLOTTED MODULO 1024. 0057 • 0058 •• OUTPUTS 0059 0060 • VERTICAL LINE ON SCOPE. 0061 • 0062 • 0063 • EXAMPLES 0064 •• 1. INPUTS - NY.OT=O, NXBOT=O. NYTOP=1023. NDELY=l 0065 • OUTPUTS - LINE ON SCOPE (LEFT-MOST IN PICTURE) 0066 0061 •• 2. INPUTS - NY80T=O, NXBOT=100, NYTOP=900, NDELY=2 0068 • OUTPUTS - LINE ON SCOPE (SECOND FROM LEFT IN PICTURE) 0069 0010 •• 3. INPUTS - NY80T=O, NXBOT=200, NYTOP=115, NDELY=3 0011 • OUTPUTS - LINE ON SCOPE (THIRD FROM LEFT IN PICTURE) 0012 0073 •• 4. INPUTS - NY80T=0, NXBOT=300, NYTOP=650, NDELY=4 0014 ---- . . . . . . . . . . . . . . . . . . . . . .:* .... ..........,..........".... • LINEV (7090) • PROGRAM LISTINGS - (PAGE 2) • •• • • •••••••••••••••••••••••• • LINEV (7090) • •••••••••••••••••••••••• (PAGE 2) OUTPUTS - LIME ON SCOPE (FOURTH FROM LEFT IN PICTURE' 5. INPUTS - NYBOT=O, NXBOT=400. NYTOP=525, NDELY=5 OUTPUTS - LINE OJ SCOPE (FIFTH FROM lEFT IN PICTURE) • 6. INPUTS - NYBOT=O, NXBOT=500. NYTOP= 400, NDELY=6 • OUTPU1S - LINE ON SCOPE (SIXTH FROM lEF.T IN PICTURE) •• • 7. INPUTS - NYBOT=O, NXBOT=600. NYTOP=27S, NDElY-7 OUTPUTS - lINE ON SCOPE (SEVENTH FROM lEFT IN PICTURE) • B. INPUTS - NYBOT=O. NXBOT=700, NYTOP=150. NDElY=8 OUTPUTS - lINE ON SCOPE (EIGHTH FROM lEFT IN PICTURE) • 9. INPUTS - NYBOT=O, NXBOT=800. NYTOP=O, NDElY=O OUTPUTS - POINT ~N SCOPE (800 SCOPE UNITS FROM lEFT IN PICTUREt •• •• • .10. INPUTS - NYBOT=O, NXBOT=900. NYTOP=10, NDElY=O • OUTPUTS - NO POINTS ON SCOPE (BLANK FILM 900 SCOPE UNITS FROM LEFT) •.11. • •• • INPU1:S - NYBOT=100, NXBOT=1000, NYTOP=10, NDELYeO OUTPUTS - NO POINTS ON SCOPE(BlANK FILM 1000 SCOPE UNITS FROM lEFTt PICTURE OF SCOPE OUTPUT APPEARS BELOW. • • • • • • • • • • • • • • • • • • • • • • • • • • •• •• PROGRAM FOLLOWS BELOW FOLLOWING CARD DESIGNATES THE DATA CHANNEL THAT CRT IS ATTACHED TO. • TO CHANGE, ALTER THE lETTER DESIGNATION ONLY, AND REASSEMBLE. X TAPENO 01 SCPAD EQU X-I05 PZE BCI l,LlNEV LlNEV SXA BACK,l SXA BACK+l.2 SXD llNEV-2,4 CLA. 1,4 X COORO. POINT STO 3,4 ClA. YTOP 2,4 YBOT SUB* LAST TlE TMI BACK POX ,I ClA. 4,4 DELTA BACK TZE STO END INCR STD 2,4 CLA. 0075 0076 0077 0078 0079 OOBO 0081 0082 00B3 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0.142 0143 0144 0145 0146 0147 0148 0149 •••••••'.-_ ••• -***-**-*.-.-• * L1NEV (7090) ••••••••••••• ** •• * ••• *** (PAGE 3) POX SXA WRS RCHX INCR TXI SXA END TIX TXL LAST CLA· ARS STA WRS RCHX BACK AXT AXT TRA POINT PZE 10 lOCO END LOOf' PROGRAM LISTINGS ••••• t*_._.*._•••••••• *. * tlNEV (7090) (PAGE ,2 POINT,2 SCPAD 10 *+1,2,11" POINT,2 LOOP,1, .. • BACK,l,O 3,4 18 POINT SCPAD 10 **.1 **.2 5,4 0 POINT,O.l * •••••••••••••••••••••••• 0150 0151 0152 11153 0154 0155 0156 0151 0158 0159 0160 0161 1)162 0163 0164 0165 0166 0161 016B 3) ........................ • LINTRI • •••••••••••••••••••••••• PROGRAM LISTINGS •• •••••••••••••••••••••••• ~fNTRl •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0092 • LINTRI ISUBROUTINEI 9/29/64 0001 • LABEL 0002 CLI Nl'R 1 0003 SUBROUTINE lINTRl (X,XlO, DELX, TABLE,NTABLE, YOFXI 0004 0005 -~--ABSTRACT---C 0006 C 0007 C TITLE - 1I NTRI 0008 C LINEAR INTERP~LATION IN A TABLE 0009 C 0010 LINTRI INTERPOLATES LINEARLY IN A TABLE TO FIND A VALUE C WHICH lIES BETWEEN THE TABULATED VALUES. XLV IS THE 0011 C 0012 ARGUMENT CORRESPONDING TO THE LOWEST TABULATED 'ALUE~ DELX C IS THE ARGUMENT DIFFERENCE BETWEEN TABULAR VAlUISJ . 0013 C 0014 THE TABLE IS lOCATED IN TABlEel). X IS THE ARGUMENT AND C 0015 YOFX IS THE INTERPOLATED VALUE. HENCE C 0016 C XTRA 0017 C . 0018 YOFX = TABLEIll + ITABlEIl+ll - TABLEILI) * - C 0019 DELX C C 0020 ' \ 0021 WHERE L IS SUCH THAT C 0022 XlO+IL-ll*DElX LSTHN= X LSTHN XLD+L'DELX C 0023 AND XTRA = X-XLO-iL-ll*DELX C 0024 C 0025 DELX IS CONSTRAINED TO BE POSITIVE C 0026 X MUST LIE IN THE ARGUMENT RANGE OF THE TABLE. C 0027 C 0028 C LANGUAGE - FORTRAN II SUBROUTINE 0029 C EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0030 - 96 REGISTERS C STORAGE 0031 C SPEED 0032 - S. M. SIMPSON C AUTHOR 0033 C 0034 ----USAGE--C 0035 C 0036 C TRANSFER VECTOR CCNTAINS ROUTINES - NONE 0037 AND FORTRAN SYSTEM ROUTINES - NONE C 0038 C 0039 C FORTRAN USAGE 0040 CALL LINTRIIX,XlO,DELX,TABlE,NTABLE,YOFXI C 0041 C 0042 C INPUTS 0043 C 0044 IS ARGUMENT FOR WHICH INTERPOLATION IS DESIRED. X C 0045 XLD LSTHN OR = X lSTHN OR = XLD+(NTABLE-ll.DELX. C 0046 C 0047 IS THE ARGUMENT CORRESPONDING TO THE FIRST TABULAR C XLO 0048 ENTRY. C 0049 C 0050 IS THE ARGUMENT DIFFERENCE BETWEEN TWO SUCCESSIVE DElX C 0051 TABULAR ENTRIES. C 0052 MUST EXCEED 0.0, BUT THIS CONSTRAINT IS NOT CHECKED. C 0053 C 0054 TABLE I I ) I=l.,.NTABlE IS A GIVEN ARRAY IN WHICH TABLEeJI C 0055 CONTAINS YeXLO+DELX'(J-l". C 0056 C 0057 NTABLE IS THE LENGTH OF THE TABLE. C 0058 C 0059 C OUTPUTS 0060 C 0061 WILL CONTAIN THE LINEARLY INTERPOLATED VALUE YOFX C 0062 C 0063 C EXAMPLES 0064 C 0065 XlD=5. OELX"2.5 TABLEn.~.91,"lJ.4 •• 9' •• C 1. INPUTS - X=7.5 0066 16.,25.,3&.,49 t ,64.,Bl. NTABlE=9 C 0067 OUTPUTS - YOFX=4. C 0068 C 0069 C 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT X=21.3 0070 OUTPUTS - YOFX=56.B C 0071 C 0072 3. INPUTS SAME AS EXAMPLE 1. EXCEPT X=25. C G073 OUTPUTS - YOFX=81. C 0074 C c '~ • ••••••••••••••••••••••• • lINTRl .. •••••••••••••••••••••••• (PAGE PROGRAM LI STINGS .......................... "UNTRI 2) C 4. INPUTS - SA~E AS EXAMPLE 1. EXCEPT X=13. OUTPUTS - YOFX=17.8 C DIMENSION TABlEI21 C SET UP. XMXLO=X-XlO 20 ILO=XMXlO/DELX+l.O C INTERPOLATE ONLY IF ILO DOESNT CORRESPOND TO LAST TABULAR ENTRY. IF (ILO-NTABLEI 30,40,30 30 FLILO=ILO-l OIFX=XMXlO-FlILO.DELX IHI=I LO+l YOFX=TABlEIllO)+(TABlEIIHII-TABLECIlO))"OIFX/DElX GO TO 9999 40 YOFX=TABlEINTABLE) GO TO 9999 9999 RETURN END C .. ............................ (PAGE 0075 0076 0071 0018 0079 0080 OOBl 0082 0083 0084 0085 0086 0081 00B8 0089 0090 0091 0092 2) .......... ............... .• LISTNG , PROGRAM LISTINGS • •••••••••••••••••••••••• • LISTNG ISUBROUTINE) 9/29/64 • LABEL ClISTNG SUBROUTINE LISTNG IITAPE,JTAPE,DATA) •••••••••••••••••••••••• LISTNG • •••••••••••••••••••••••• • LAST CARD IN DECK IS NO. 0220 0601 0002 0003 0004 C -A8STRACT---C 0005 0006 C C TITLE - LlSTNG 0007 C LIST AUXILIARY INFORMATION FOR A INDATA-OUDATA TYPE TAPE 0008 0009 C LISTNG REWINDS A SPECIFIED TAPE, WRITES THE RECBRO NUMBER, C 0010 LENGTH OF OATA, AND AUXILIARY INFORMATION, AND CHECKS THE 0011 C SUMCHECK FOR EACH RECORD ON THE TAPE, AND THEN REWINDS 0012 C THE TAPE AGAIN. SEE THE WRITE-UP FOR OUDATA FOR A C 0013 C DESCRIPTION OF THE FORMAT OF THE TAPE. 0014 0015 C THE RECORD NUMBER ANO AUXILIARY INFORMATION ARE 0016 C C INTERPRETED AS FLOATING POINT, FIXED POINT, OCTAL, AND 0017 HOLLERITH. THE HOLLERITH PRINT-OUT IS SUPPRESSEB If C 001B ILLEGAL CHARACTERS ARE PRESENT. 0019 C C 0020 C LANGUAGE - FORTRAN II SU8ROUTINE 0021 0022 C EQUIPMENT - 709 OR 1090 (MAIN FRAME, DATA CHANNEL) 0023 - 755 REGISTERS C STORAGE 0024 C SPEED 0025 NOV., 1962 C AUTHOR - R.A. WIGGINS C 0026 - .....-USAGE--0027 C 0028 C 0029 C TRANSFER VECTOR CONTAINS ROUTINES - FAPSUM, SAME, XSAME4 FS.IP, SHFTRI AND FORTRAN SYSTEM ROUTINES - (FIL),IRLRI,(RWTJ,ISPH)~(STHJ; 0030 C 0031 ITSBI C 0032 C 0033 C FORTRAN USAGE 0034 C CALL LISTNGIITAPE,JTAPE,DATA) 0035 C 0036 C INPUTS 0037 C IS LOGICAL TAPE NUMBER FOR THE TAPE THAT IS TO BE LISTED~ 0038 C ITAPE 0039 IS FORTRAN II INTEGER. C 0040 C JTAPE IS LOGICAL TAPE NUMBER FOR OUTPUT TAPE 0041 C 0042 (LISTNG OOES NOT REWIND THIS TAPE BEFORE OR AFTER C 0043 OUTPUT) C 0044 C DATAIO l=l,N IS A BUFFER FOR TEMPORARY USE BY LISTNG. 0045 C 0046 N MUST BE GREATER THAN THE LONGEST DATA SERIES ON TME C TAPE. 0047 C 0048 C 0049 C OUTPUTS THE OUTPUT IS A LISTING OF THE TAPE AS SHOWN IN THE EXAMPLE NOTE THAT ONLY THE FIRST 50 WORDS OF EACH AUXILIARY 0050 C INFORMATION IS PRINTED. 0051 C 0052 C 0053 C EXAMPLES 0054 C 0055 EXAMPLES FOR DUDATA LOADED ON LOGICAL UNIT 9. C DIMENSION DATA(lOOOO) 0056 C USAGE 0051 CALL LISTNG 19,2,DATAJ C 0058 OUTPUTS - WRITTEN ON LOGICAL TAPE NO.2 C 0059 C CII111111122222223223J333333334444444444555555555566666666667l.7711177788 .0060 0061 C12345678901234561890123456789012345678901234567890123456'89012345678901 0062 C 0063 C (PAGE 1 CONTAINS) 0064 C C THIS IS A LISTING OF THE AUXILIARY INFORMATION AND STATlSTU:S FORAN 0065 0066 C IIINDATA-OUDATAII TYPE TAPE 0061 C 0068 C IPAGE 2 CONTAINSI 0069 C 0070 C FILE CONTAINS 0071 C 0072 -74852 (INTERPRETED AS AN INTEGER) RECORD NO. C 0073 -0.051516E 06 IINTERPRETED AS FLOATING POINT) C •••••• ** •••••••••••••••• lISTNG * •••••••••••••••• * ••••••• PROGRAM LISTINGS • • IPAGE LISTNG 2) IPAGE 622144414325 IINTERPRETED AS OCTAL) SAMPLE IINTERPRETED AS ALPHANUMERIC) C C C C C C C C C C C LENGTH OF AUXILIARY INfORMATION BLOCK IS 2 NUMBER OF DATA POINTS IS 3 NUMBER OF DATA POINTS STORED PER .EGISTER IS fLOATING FIXED 1 OCTAL AI:PHANUMERIC IPAGE 3 CONTAINS) C C FILE C 2 CONTAINS RECORD NO. C C C C C WITH TITLE C 3 0.001122E-38 000003000000 003000 I INTERPRETED (INTERPRETED I INTERPRETED IINTERPRETED AS AS AS AS AN INTEGER) FLOATING POINt) OCTALI ALPHANUMERIC) SAMPLE INDATA-OUDATA TYPE TAPE RECORD C C LENGTH OF AUXILIARY INFORMATION BLOCK IS 3 C NUMBER OF DATA POINtS IS C NUMBER OF DATA POINTS STORED PER REGISTER 21 IS 2 C flOATING C C C C C FIXED OCTAL Del TAT 0.49999999E-01 63891 174631463146 RDAY OJ01121915E-3B 30 000036000000 Ai:PHANUMERIC C C RUNITS -0. 16491062E-2B -18003 443123514645 MICRON C C TITlE -0.48000000E 02 0.03516110E 14 -0.12662410E 08 0.61124052E 04 -0.61013036E-21 0.056B0151E 14 -0.33042351E-16 -0~06095231E 02 -6B992 89113 -18944 12913 -30064 89192 -38192 -68656 606600000000 256031452421 632140466424 21632160637g 412560632141 256051252346 512460606060 606060606060 SAMPL E INDA TA-OUO ATA TY PE TAP E RECO RD C C C C C C C C C DIMENSION DATA(10000) DEFINE THE MAXIMUM NUMBER OF ELEMENTS TO BE PRINTED IN AUX. INFO. MA 50 DEFINE THE PRINTED OUTPUT TAPE NO. N = JTAPE REWI NO IT APE ERR:O. WRITE OUTPUT TAPE N,10 FORMATI91HITHIS IS A LISTING OF THE AUXILIARY INFORMATION AND STAT 1ISTICS FOR AN IIINDATA-OUDATAI) TYPE TAPE) IFILE=1 READ TAPE ITAPE.IRECNO,LAUXBK,NOPTS,MODCOD,SCALE IFIIRECNOI 18,16,18 CONTI NUE REWIND !TAPE RETURN READ TAPE ITAPE.IDATAIIJ,I=I,LAUXBKI CALL FAPSUM ILAUXBK-1.DATA.SUMCKI IFISUMCK-DATACLAUXBKI) 20,30,20 ERR=I. CONTINUE J1 1 TES " SAMEFIIRECNOI GO TO 5000 WRITE OUTPUT TAPE N.210,IFILE,IRECNO,IRECNO,lRECNO,IRECNO FORMATI5HIFILE,14,9H CONTAINSI15X11HRECORD NO. 114,28H tINTERPRETE 10 AS AN INTEGER)/16XE14.6,32H (INTERPRETED AS FLOATING '01NTl/16KO 214,23H (INTERPRETED AS OCTALI/24XA6,30H IINTERPRETEO AS ALPHANUMER 3IC II GO TO 225 WRITE OUTPUT TAPE N, 210.IFllE,IRECNO,IRECNO,IRECNO SCAN FOR TITLE T" 5HTI TlE = C 10 15 16 18 20 30 200 210 215 C 225 • ••••••• ** ••••••••••••••• •••••••••••••••••••••••• = 0014 0015 0016 0071 0018 0019 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0121 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 01',1 0142 0143 0144 0145 0146 0141 0148 21 •••••••••••••••••••••••• • LISTNG * •••••••••••••••••••••••• IPAGE 3) 35 40 50 60 70 C 80 C 220 230 C 90 100 310 101 320 330 340 360 110 370 108 120 130 140 150 C 155 160 170 180 PROGRAM LISTINGS •••••••••••••••••••••••• LISTNG * •••••••••••••••••••••••• • L=l IFIOATAtL)) 40,80,40 IFIOATAIL)-T) 50,60,50 L=L+2+XSAMEFIOATAIL+111 GO TO 35 IMIN:L+2 IMAX=L+1+XSAMEFtOATAIL+111 WRITE OUTPUT TAPE N,70,tOATAIII,I=IMIN,IMAX) FORMATI15HO WITH TITLE5X12A~) EITHER NO TITLE FOUND, OR TITLE FOUND AND PRINTED CONTINUE PRINT INFORMATION ASOUT DATA WRITE OUTPUT TAPE N.230,LAUXBK,NOPTS,MODCOD FORMATI41HOLENGTH OF AUXILIARY INFORMATION BLOCK IS, 116/25H NUMBER OF DATA POINTS IS.t6/45H NUMBER Of DATA POINTS STORE 20 PER REGISTER IS,I61123X8HFLOATING7X5HFIXE07X5HOCTAL4X12HALPHANUM 3ERICI PRINT AUX INFO. 10NLY FIRST MA ELEMENTS IF A VECTOR) L=l IFIOATAIL)l 100,150,100 Jl = 2 TES = OATAIl+21 GO TO 5000 WRITE OUTPUT TAPE N, 101. DATAIll,DATAIL+21,DATA(L+21,DATAIL+2I, 1 DATAIL+21 FORMATI1H03XA6,5XE18.8,19,015,4XA6) GO TO 330 WRITE OUTPUT TAPE N, 101. DATAIL),OATAIl+21,OATAIL+2),OATAfL+ZI IF IXSAMEFIOATAtL+111-1) 140,140,340 IMIN = l+3 IMAX=XMINOFfMA,XSAMEF(OATAIl+1)) + l+l J1 = 3 00 108 J=IMIN,IMAX TES = OATA(J) GO TO 5000 WRITE OUTPUT TAPE N,110,OATAIJ),DATAIJ),OATAIJ),DATAIJ) FORMATI15XE18.8.19,OI5,4XA6) GO TO 108 WRITE OUTPUT TAPE N,110,DATAIJ),DATAIJ),DATAIJI CONTINUE IFIXSAMEFIDATAll+1))-MA) 140,140,120 WRITE OUTPUT TAPE N,130,IDATA(l+1)1 FORMATIIH025X4HETC,I6.8H IN ALL.) l=l+2+XSAMEFIDATAIl+I)1 GO TO 90 CONTINUE AUXILIARY INFO IS LISTED IFIERR) 160,155,160 NN=(NOPTS+MODCOD-l)/MODCOD +1 READ TAPE ITAPE~IDATAII}.I=I,NN) CALL FAPSUMtNN-l,DATA,SUMCK) IfISUMCK-OATAINN}) 160,180,160 CONTINUE WRITE OUTPUT TAPE N,170,IFllE PRINT 170,IFIlE FORMAT I 21H 8AO SUMCHECK ON FIlE,I6) IFJlE=IFtlE~l CAll FSKIPIITAPE,+l} GO TO 15 C THIS IS AN INTERNAL SUBROUTINE TO CHECK IF A DATA WORD KAS ILLEGAL CHARACTERS FOR ALPHANUMERIC PRINTING. C 5000 00 1 1=1,6 CAll SHFTR2{18-1*6,TES,l,TEZ,IANSI 8 TEZ=TEZ*000077000000 K=XSAMEFITEZI+l GO TOll,l,lil,1'1,l,l,l,l,2,l,2,2,2,2,l,l,l,I,l.1.111,1.1,2,1.1,2, 1 2,2,1,1,1,1,1,1,1,1.1,1,2,2,1,2,2,2,1,1,1,1,1,1,1,1,1,1,2, 2 1,l,2,2,21,K CONTINUE GO TO 1200,310,360),J1 GO TO 1215,320,370l,Jl 2 END IPAGE 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 3) . ••• ** •••••••••••• **** ••• ••• * •••••••••••••••••••• PROGRAM LISTINGS . .*** ••••••••••••••• ** ••• .. LOC ... .. .. • ...... LOC (SUBROUTINE) FAP COUNT LBL ENTRY .. .. .. .. .. . .. .. •.. ..... .. .... * .... 9/29/64 0001 0002 0003 0004 0005 0006 0007 30 LOC LOC (VAR,IADO) OOOB TITLE - LOC CORE LOCATION WITH INOEXABLE ARGUMENT LOC GIVES THE CORE ADDRESS OF A VARIABLE. MAY BE SUBSCRIPTED. LANGUAGE EQUIPMENT STORAGE SPEED AUTHOR THE VARIA8LE - FAP, SUBROUTINE (FORTRAN II COMPATIBLE) - 709 OR 7090 (MAIN FRAME ONLY) - 4 REGISTERS - ABOUT 12 MACHINE CYCLES - R.A. WIGG[NS, MAY, 1962 ----USAGE---- TRANSFER VECTOR CONTAINS ROUTINES AND FORTRAN SYSTEM ROUTINES FORTRAN USAGE CALL LOC NONE NONE (VAR,[ADD) INPUTS VAR [S VARIABLE NAME (NEED NOT BE FLOATING POINT NAME). OUTPUTS [ADO . IS THE CORE ADDRESS FOR THE VAR[ABLE NAME. IS FORTRAN II INTEGER .. EXAMPLES * .. 1. INPUTS - SUPPOSE VAR(I ••• 5} IS STORED BEGINNING AT 77461 OCTAL USAGE CALL lOC (VAR,IADDl OUTPUTS - IACD = 32561 (=OCTAl 77461) .. .. .... 2. INPUTS - SAME AS EXAMPLE 1. 1=3 CALL lOC (VAR(I},IADO) OUTPUTS - IAOD = 32559 (=OCTAL 77457) .. .. .. . .. LAST CARD IN DECK IS NO. 0053 --~-ABSTRACT---- . •.. LOC ••• ** •••••••••••••• **.** USAGE lOC CAL ALS STO* TRA END 1,4 18 2,4 3,4 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0026 0029 0030 0031 0032 0033 0034 0035 0036 0037 0036 0039 0040 0041 0042 0043 0044 0045 0046 -0047 0048 0049 0050 0051 0052 0053 . •••••••••••••••••••••••• LOCATE ••••••••••••••••••••••••• .•• ••••••••••••••••••••••• LOCATE • ••••••••••••••••••••••• PROGRAM LISTINGS 3/15/65 • LOCATE (SUBROUTINEI .. FAP ·LOCATE DEDICATED TO JACKIE LAST CARD IN DECK IS NO. 2007 . • .. .. COUNT LBL ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY ENTRY 2000 LOCATE LOCATE WHERE CALL CALL2 SETSBV SETUP RETURN XlNDEX ARG XARG STORE XNARGS XNAME (SUBRU1.SUBRUZ ••••• SUBRUNI (SUBRU.IANS.LOC.NARGSI (SUBRU.IANS.SPACER.ARG1.ARGZ ••••• ARGNI ( SUBRUV, IAN S I (SUBRU.SUBRUV.ARG1,ARG2 ••••• ARGNI ILOCALL.NARGS.XR1.XR21 (LOCALL,XR1.XRZ) ILOCALL.NUMARG) (FUNCTION) (LOCALL.NUMARG.IXVECT) (FUNCTION) ILOCALL.NUMARG.IXVECTI (FUNCTION) (ARGU.LOCALL.NUMARG.IXVECT) (L"OCALU (FUNCTION) IHNAME1.HNAMEZ) (FUNCTION) ---ABSTRACT--- .. TITLE - LOCATE • WITH SECONDARY ENTRIES WHERE.CALL.CALLZ.SETSBV.SETUP. .. RETURN.XINDEXIFUNCTION). .. ARGIFUNCTIONI.XARGIFUNCTIONI. • STORE.XNARGSIFUNCTIONI. .. AND XNAMEIFUNCTIONI. .• .... .. • • ..... .. • ...• .. ..• .... .. ... .... .. ...• ..• • • .• . .•.. ... • ..• LOCATE AND OPERATE SUBROUTINES BY PROXY CALL STATEMENTS LOCATE AND ITS ASSOCIATED ENTRIES ENABLE A FORTRAN II PROGRAM (AT LEVEL 11 TO INDUCE A SUBROUTINE (AT LEVEL 21 TO OPERATE. VIA PROXY CALL STATEMENTS (ENTRIES CALL AND CALL21. ONE OR MORE STILL LOWER LEVEL SUBROUTINES. WHERE THE SUBROUTINE AT LEVEL 2 NEED NOT KNOW IN ADVANCE ANYTHING ABOUT THE LOWER LEVEL SUBROUTINES II.E •• HOW MANY SUBROUTINES THERE ARE. WHAT THEIR NAMES ARE. WHAT THEIR FUNCTIONS ARE. OR WHAT THE NUMBER OF ARGUMENTS ASSOCIATED WITH EACH lSI. THE MOST SIGNIFICANT APPLICATION OF SUCH A FEATURE IS IN THE CONSTRUCTION OF A CONTROL SUBROUTINE WHOSE FUNCTION IS TO OPERATE. WITHIN THE FORMAL FRAMEWORK OF SOME GOAL • A REPERTOIRE OF LOWER LEVEL SUBROUTINES WHICH IS VARIABLE IN NUMBER AND NAMES AND PERHAPS EVOLVING WITH TIME. THE CONTROL SUBROUTINE CAN BE ISOLATED FROM SUCH CHANGES AND REMAIN WITHIN THE FORTRAN-II SYSTEM. AND THE MACHINE MEMORY REQUIREMENTS DURING ANY ONE EXECUTION ARE CONFINED TO THOSE OF THE SPECIFIC SUBSET OF SUBROUTINES DESIRED DURING THAT EXECUTION • CHAINS OF SUCCESSIVE PROXY CALL STATEMENTS WILL WORK PROPERLY. AND ONE OF THE ENTRIES (CALLI PERMITS PROXY CALL STATEMENTS OF UNORTHODOX SUBROUTINES ISUCH AS DISPLA AND GENHOL OR LOCATE ITSELF) WHICH UTILIZE INFORMATION FROM THE STATEMENT IS) IMMEDIATELY FOLLOWING THEIR CALL STATEMENT. AS BY-PRODUCTS OF THE ABOVE FUNCTIONS. THE LOCATE GROUP ALSO ENABLES 1. FORTRAN PROGRAMS TO FINO. AT EXECUTION TIME. THE ABSOLUTE MACHINE LOCATIONS OF THE ENTRY POINTS OF ANY SUBROUTINES WHOSE NAMES ARE KNOWN IN ADVANCE IENTRIES LOCATE AND WHEREI. 2. THE OPERATION OF A SUBROUTINE UNDER ONE DR MORE PSEUDONYMS. AND THE OPERATION OF DIFFERENT SUBROUTINES UNDER THE SAME NAME (ENTRY LOCATEI. 3. FORTRAN SUBROUTINES TO BE WRITTEN WITH VARIABLELENGTH CALLING SEQUENCES (ENTRIES SETUP ANO RETURNI • 4. SUCH A VARIABLE-LENGTH-CALLING-SEQUENCE PROGRAM TO OBTAIN EASILY ANY OF ITS ARGUMENTS. EVEN IF ITS SUBROUTINE CARD LISTS NO ARGUMENTS AT ALL IENTRIES XINDEX. ARG. AND XARG IALL FORTRAN FUNCTIONSI). 5. THE OPERATION OF A SUBROUTINE WHOSE ARGUMENT COUNT 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 -.................. ........LOCATE •••••••••••••••••••••••• (PAGE 2) .. PROGRAM 1I STl NGS • ••••••••••••••••••••••• . IS LIMITED ONLY BY THE MEMORY SIZE (ENTRY CALL2). 6. THE TRANSMISSION THRU SUBROUTINE LAYERS OF ARBITRARILY COMPLEX CALLING SEQUENCES VIA SINGLE NUMBERS (ENTRIES SETUP, XINDEX, ARG AND XARG, XNARGS AND STORE). 1. DIRECT RETURN LINKAGES FROM LOW LEVEL SUBROUTINES TO HIGH LEVEL ROUTINES WHICH BYPASS INTERMEDIATE LEVELS AND STILL ALLOW RETURN MESSAGES (ENTRIES RETURN AND STORE). 8. SUBROUTINE TRANSFER PATHS WHICH ARE CIRCULAR, E.G., A SUBROUTINE CALLING ITSELF, OR CALLING A SUBROUTINE WHICH CALLS IT BACK IENTRIES SETUP AND RETURN). . . ... ... .. .. .. . .. THE LOCATE GROUP IS DEPENDENT ON THE SUBROUTINE LINKAGE CONCEPT (TRANSFER VECTOR AND ARGUMENT VECTOR (TSX ARG,OI) OF THE FORTRAN SYSTEM AND MONITOR SYSTEM. IT WILL NOT WORK ON SYSTEMS WITH DIFFERENT LINKAGE PATTERNS. WITHIN THE FORTRAN II SYSTEM, HOWEVER, THESE PROGRAMS WORK INDEPENDENTLY OF THE INCLUSION OR EXCLUSION OF THE STANDARD ERROR PROCEDURE WHICH IS AN OPTIONAL FUNCTION AFFECTING LINKAGE FORMAT • .... .. .. LANGUAGE .. .. .. eQUIPMENT .. STORAGE .. - FAP SUBROUTINES (COMPATIBLE WITH FORTRAN-II AS SUBROUTINES OR FUNCTIONS DEPENDING ON THE ENTRY) - 109 OR 7090 IMAIN FRAME ONLY) - 512 REGISTERS LOCATE IS A MINIMUM STORAGE PROGRAM .. .... - VARIABLE OEPENDING ON ENTRY. SINCE THE SYSTEM IS DESIGNED FOR PRACTICAL APPLICATIONS INVOLVING NON-TRIVIAL SUBROUTINES THE EXTRA TIME TAKEN BY THE LOCATE ROUTINES TO ESTABLISH LINKAGE SHOULD NOT BE SIGNIFICANT • APPROXIMATE TIMES lIN MACHINE CYCLES) ARE LOCATE - 160 (MINIMUM) WHERE - 400 (MINIMUM) CALL - 570 IMINIMU~) CALL2 - 610 (MINIMUM) SETSBV - 330 IMINIMUM) SETUP - 430 (MINIMUM) RETURN - 250 XINDEX - 44 ARG (OR XARG) - 41 STORE - 157 XNARGS - 82 (MINIMUM) XNAME - 58 (MINIMUMI . .. .. .. ... .. ... . .. SPEED . LOCATE • ••••••••••••••••••••••• ..... AUTHOR - S.M. SIMPSON, MARCH 1963 ----USAGE---.... TRANSFER VECTOR CONTAINS ROUTINES - (NONE) AND FORTRAN SYSTEM ROUTINES - (NONEI ... .... PRELIMINARY NOTES 1. ILLEGAL ARGUMENT COUNTS . IF ANY OF THE 8 SUBROUTINE ENTRIES IN THE LOCATE GROUP .. ARE CALLED WITH AN INCORRECT ARGUMENT COUNT EXECUTION STOPS ON AN HPR 71117(OCTALI INSTRUCTION, WITH ... AC = 6HCNAME OF ENTRY CALLED ILLEGALLY) MQ = NO. OF ARGUMENTS liN ADDRESS OF MQ) . INDEX REGISTER 4 : ADDRESS OF ILLEGAL CALL STATEMENT CNOT TWOaS COMPLEMENT OF ADDRESS) .... IF COMPUTER IS RESTARTED CONTROL RETURNS IMMEDIATELY TO THE STATEMENT FOLLOWING THE ILLEGAL CALL STATEMENT • ... FOR THE VARIABLE-LENGTH-CALLING-SEQUENCE ENTRIES THE ILLEGAL ARGUMENT COUNTS ARE .. LOCATE - ZERO CALL - LESS THAN THREE .. SETSBV - LESS THAN TWO (PAGE 0075 0076 0077 0078 0019 0080 0081 0082 0083 00B4 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 2) •••••••••••••••••••••••• LOCATE .. •••••••••••••••••••••••• PROGRAM LI STI NGS .. (PAGE ... ... 3) NO ARGUMENT COUNt CHECK IS MADE FOR THE FUNCTION ENTRIES. 2. RESTORATION OF INDEX REGISTERS {PRIMARILY OF CONCERN TO USERS MIXING FAP ANO FORTRAN PROGRAMS' ALL ENTRIES OF LOCATE RESTORE INDEX REGISTERS 1 AND 2 WITH PROVISOS IN THE CASES OF CALL. CALL2. AND RETURN. INDEX REGISTER 4. USED FOR LINKAGE. IS SOMETIMES NOT RESTOREO. CALL ANO CALL2 DEFEND ON THE SUBROUTINE BEING OPERATED TO RESTORE INDEX REGISTERS 1 AND 2 (THE CORRECT VALUES ARE SET UP FOR THE SUBROUTINE BEFORE IT IS ENTERED'. THE RESTORATION OF XR1 AND XR2 BY RETURN DEPENDS ON THE EXISTENCE OF CONTIGUOUS SXD INSTRUCTIONS AS THE VERY FIRST INSTRUCTIONS IN THE SUBROUTINE FROM WHICH THE RETURN (OR THE APPARENT RETURN IN THE CASE OF SKIP RETURNS' IS DESIRED. FAP PROGRAMS USING ENTRY RETURN SHOULD CONFORM TO THIS .CONVENTION. .... ... . ..... .... . ..... .... .••••••••••••••••••••••••• . LOCATE ••••••••••••••••••••••• XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY LOCATE .. FORTRAN USAGE OF LOCATE ... .. SUBROUTINE LOCATE ESTABLISHES AN EQUIVALENCE BETWEEN NAMES AND ABSOLUTE MACHINE LOCATIONS OF SUBROUTINES. WHICH EQUIVALENCE IS UTILIZED IN SUBSEQUENT PROXY CALL STATEMENTS. AN APPROPRIATE CALL LOCATE STATEMENT MUST BE EXECUTED PRIOR TO THE USE OF THE ENTRIES WHERE. CALL. OR CALL2. HOWEVER A CALL LOCATE STATEMENT NEED NOT BE PRESENT INA ROUTINE WHICH MAKES PROXY CALL STATEMENTS. PROVIDED SOME OTHER ROUTINE HAS CALLED LOCATE PREVIOUSLY. LOCATE IS CALLED WITH AN ARBITRARY NU~BER OF ARGUMENTS. N. AS FOLLOWS. ..... ... .. .. .. .. .. .. .. ... .... CALL LOCATEISUBRU1.SUBRU2 ••••• SUBRUNI WHICH MUST BE FOLLOWED IMMEDIATELY BY N CALL STATEMENTS AS FOLLOWS CALL SUBR1 IARG11.ARG12 ••••• ARG1M1' CALL SUBR2 IARG21.ARG22 ••••• ARG2M2J CALL SUBRN IARGN1.ARGN2 ••••• ARGNMN) ... THE N CALL STATEMENTS FOLLOWING THE CALL LOCATE STATEMENT ARE NOT EXECUTED. LOCATE RETURNS CONTROL TO THE STATEMENT FOLLOWING CALL SUBRN. liT DOESNT MATTER IF THE IN+1'TH STATEMENT FOLLOWING CALL LOCATE IS ALSO A CALL STATEMENT.) IN THE ABOVE ILLUSTRATION THE CALL SUBR STATEMENTS ARE WRITTEN WITH INDIVIDUAL ARGUMENT lISTS • THE OPERATION OF LOCATE. CALL AND CALL2 IS UNAFFECTED BY THE LENGTHS OR CONTENTS OF THESE ARGUMENT LISTS. THE CALL SUBR STATEMENTS CAN BE WRITTEN EQUALLY AS WELL WITH NO ARGUMENTS. ... ... . ... it ..... .... . INPUTS TO LOCATE SUBRU1 IS 6 OR LESS HOLLERITH TO BE USED IN SUBSEQUENT WHERE • CALL OR CALL2 STATEMENTS AS THE NAME OF THE FIRST SUBROUTINE IN THE LIST OF N CALL SUBR STATEMENTS WHICH IMMEDIATELY FOLLOW THE CALL LOCATE STATEMENT. THE NAME SUBRU1 DOES NOT HAVE TO BE IDENTICAL TO THE REAL SUBROUTINE NAME. SUBR1. AS IT APPEARS IN THE CALL SUBR1 STATEMENT. IF IT IS DIFFERENT FROM THE REAL NAME • SUBRU1 DOES NOT HAVE TO CONFORM TO FORTRAN NAMING CONVENTIONS IE.G •• IT COULD BEGIN WITH A NUMBER • INCLUDE SPECIAL CHARACTERS. OR EVEN BE 6 BLANKS'. SUBRU1 MUST BE IN FORMATI1A6). IF SUBR1 INVOLVES LESS THAN 6 CHARACTERS THE POSITIONING OF THESE CHARACTERS IS IMMATERIAL (SINCE WHERE. CALL AND CALL2 LEFT ADJUST NAMES BEFORE COMPARING' BUT THE MISSING CHARACTERS MUST BE BLANKS (OCT 60' AND EXTERNAL TO THE NAME. IF SUBRU1 INVOLVES A BLANK CHARACTER BETWEEN TWO NON-BLANK CHARACTERS THE BLANK CHARACTER IS CONSIDERED PART OF THE NAME • SUBRU2 IS 6 OR LESS HOLLERITH TO BE USED AS THE NAME OF THE .... .... .... ..... .... .. (PAGE 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 3' •••••••••••••••••••••••• LOCATE • * •••••••••••••••••••••••• (PAGE PROGRAM LISTINGS 4) • • • • • • • • • • • • • • • • • • * • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • ••••••••••••••••••••••• LOCATE *• ••••••••••••••••••••••• * (PAGE SECOND SUBROUTINE IN THE LIST Of CALL SUBR STATEMENTS fOLLOWING THE CALL LOCATE STATEMENT. IT HAS THE SAME CHARACTERISTICS AS SUBRUI. SUBRU2 SHOULD NOT BE IDENTICAL TO SUBRUI (I.E •• IT IS IMPOSSIBLE IN THIS SYSTEM TO GIVE THE SAME NAME SIMULTANEOUSLY TO TWO DiffERENT SUBROUTINES ALTHOUGH IT CAN BE DONE SEQUENTIALLY BY REPEATED CALL LOCATE STATEMENTS AS DESCRI8ED BELOWI. If THEY ARE IDENTICAL THEN SUBSEQUENT REfERENCE IN PROXY CALL STATEMENTS TO SUBRU2 : SUBRUI WILL BE TRANSLATED AS A REFERENCE TO SUBRI. AND SUBR2 WILL NEVER BE OPERATED. IN GENERAL IF SUBRUK IS IDENTICAL TO SUBRUL (K LESS THAN LI AND DIFFERENT FROM SUBRUJ (FOR ALL J LESS THAN KI THEN THE NAME SUBRUL:SUBRUK IMPLIES THE SUBROUTINE SU8RK. HOWEVER THE CONVERSE WILL WORK. I.E •• SU8Rl MAY BE THE SAME AS SUBR2. SO THAT SU8Rl CAN BE OPERATED EITHER UNDER THE NAME SUBRUI OR UNDER THE NAME SU8RU2. SUBRUN IS THE NAME TO BE USED FOR THE LAST SUBROUTINE (SUBRN) OF THE CALL LIST. THE NO. OF CALL STATEMENTS. NC. FOLLOWING THE CALL LOCATE STATEMENT SHOULD MATCH EXACTLY THE NO. OF ARGUMENTS. NA. IN THE CALL LOCATE STATEMENT. IF NC IS LESS THAN NA CONTROL WILL BE RETURNED TO THE STATEMENT FOLLOWING THE CALL SUBRNC STATEMENT AND ARGUMENT NOS. NC+l.NC+2 ••••• NA OF CALL LOCATE WILL NOT BE RECOGNIZABLE IN PROXY CALL STATEMENTS. If NC IS GREATER THAN NA. LOCATE RETURNS CONTROL TO THE STATEMENT FOLLOWING CALL SUBRNA. AND THE CALL SUBR(NA+ll STATEMENT WILL BE EXECUTED. AS PRESENTLY WRITTEN LOCATE KEEPS RECORDS ONLY OF THE lAST 14 CALL STATEMENTS MADE (AS EXECUTEO FROM DIffERENT POSITIONS IN THE MEMORY. I.E •• REPEATED EXECUTION OF THE SAME CALL LOCATE STATEMENT. SAY IN A LOOP, COUNTS ONLY ONCE). LOCATE KEEPS ITS TABLES IN A REVOLVING fASHION (CALL NO. 15 REPLACES CALL NO.1) SO THAT ALL CALL LOCATE STATEMENTS CAN BE ASSIGNED TABLE INDICES FROM 1 TO 14 (WHICH ARE NOT NECESSARILY IN THE SAME RELATIVE ORDER AS THEIR TIME-Of-EXECUTION INDICES). IF TWO DIFFERENT CALL LOCATE STATEMENTS WITHIN THE LAST 14 EXECUTED ATTEMPT TO DEfINE THE SAME PROXY NAME THEN THE DEFINITION ASSoCIATEO WITH THE LOWEST TABLE INDEX IS USED. (THE LIMIT OF 14 ON lOCATE.S MEMORY CAN BE MOVED UP OR DOWN BY MAKING THE FOLLOWING CHANGES TO THE PROGRAM (SEE LISTING NEAR END) 1. CHANGE THE CONSTANT KTABLE FROM 14 TO THE NEW VALUE DESIRED 2. CHANGE THE BSS 12 INSTRUCTION (FIRST INSTRUCTION IN LIST OF VARIABLES) TO 8SS (NEW VALUE - 2). ) A SCHEME SUCH AS THE FOLLOWING WILL ENABLE ONE TO OPERATE A SINGLE SUBROUTINE UNDER DIFFERENT NAMES. ITIME:O SUBRU1:5HSUBRU SUBRU2=5HDUMMY GO TO 50 (OPERATE SUBRI UNDER THE NAME SUBRUI SU8RUl=5HDUMMY SU8RU2=5HSUBRU GO TO 50 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 024B 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0273 0274 0275 0276 0277 0278 0279 0280 0281 0282 0283 0284 0285 0286 0287 0288 0289 0290 0291 0292 0293 4) • ••••••••••••••••••••••• . •••••••••••••••••••••••• PROGRAM LISTINGS LOCATE (PAGE 5) .. .. .. .... . it • ••••••••••••••••••••••• LOCATE •••••••••••••••••••••••• it (PAGE 2 (OPERATE SUBR2 UNOER THE NAME SUBRUI 50 CALL LOCATECSUBRUl.SUBRU21 CALL SUBRl CALL SUBR2 IT 1ME" IT IME+ 1 GO TO (1.21.ITIME . ... XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY WHERE ... . FORTRAN USAGE OF WHERE ..... INPUTSCALLTO WHERE(SUBRU.IANS.LOC.NARGSI WHERE .. SUBRU IS TOTHEBE PROXY NAME. IN FORMATC1A6J. OF THE SUBROUTINE FOUND ACCORDING TO THE DATA STORED BY LOCATE. SUBRU SHOULD APPEAR AS ONE OF THE ARGUMENTS OF SOME ... PRIOR CALL LOCATE STATEMENT • it ..... OUTPUTS ... IANS ... .. .. ...... .. .. .. .. .. . ... . .. FROM WHERE o MEANS SUBROUTINE WAS LOCATED. " -1 -2 -3 -4 MEANS NOT LOCATED. BUT THE TABLES ARE IN OROER. MEANS NOT LOCATED. SUBRU WAS FOUND AS ONE OF THE ARGUMENTS OF A CALL LOCATE STATEMENT. BUT THE ASSOCIATED LIST OF CALL STATEMENTS WAS TOO SHORT TO EQUATE SUBRU WITH A REAL SUBROUTINE. MEANS NOT LOCATED. NO CALL LOCATE STATEMENTS HAVE BEEN MADE YET • MEANS NOT LOCATED. THE MEMORY CAPACITY (201 OF LOCATE HAS BEEN EXCEEDED AND THIS NAME MAY HAVE BEEN ASSOCIATED WITH A CALL LOCATE STATEMENT NOW FORGOTTEN • LOC IS UNDISTURBED UNLESS IANS=D. IF IANS"D THEN LOC GIVES THE ABSOLUTE MACHINE ADORESS OF THE ENTRY POINT OF THE SUBROUTINE WHOSE PROXY NAME IS SUBRU (REAL NAME = SUBRI NARGS IS UNDISTURBED UNLESS IANS=O. IF IANS=O THEN NARGS IS THE NO. OF ARGUMENTS OF SUBROUTINE SUBR AS WRITTEN DOWN IN THE CALL SUBR STATEMENT IN THE LIST FOLL.OWING THE CALL LOCATE STATEMENT WHICH DEFINED SUBRU. (THE PROXY CALL STATEMENTS USE WHERE TO FINO SUBROUTINES 8UT DO NOT UTILIZE THE OUTPUT NARGS.I XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY CALL .. FORTRAN USAGE OF CALL .. .. . ... .... .. .... .. .... . THE PROXY STATEMENT CALL CALLISUBRU.IANS.SPACER.ARG1.ARG2 ••••• ARGNI IS FUNCTIONALLY EQUIVALENT TO THE STATEMENT CALL SUBRCARGl.ARG2 ••••• ARGNI PROVIOED 1. THE NAME SUBRU HAS BEEN EQUATED TO SUBR BY A PRIOR CALL LOCATE STATEMENT 2. SUBR IS A SUBROUTINE WHICH ONLY USES INFORMATION AI FROM ITS ARGUMENTS ARGl ••• ARGN AND POSSIBLY BI FROM THE STATEMENTS FOLLOWING THE CALL CALL STATEMENT SUBROUTINES WHICH UTILIZE INFORMATION PRIOR TO THEIR CALL STATEMENTS MAY OR MAY NOT BE SUCCESSFULLY PROXIED (THE SUBROUTINE SETUP DESCRIBEO BELOW IS ONE WHICH CAN BEl • THE QUESTION MUST BE RESOLVED IN EACH CASE REFERENCING 0294 0295 0296 0297 0298 0299 0300 0301 0302 0303 0304 0305 0306 0307 030B 0309 0310 0311 0312 0313 0314 0315 0316 0317 0318 0319 0320 0321 0322 0323 0324 0325 0326 0327 0328 0329 0330 0331 0332 0333 0334 0335 0336 0337 0338 0339 0340 0341 0342 0343 0344 0345 0346 0347 0348 0349 0350 0351 0352 0353 0354 0355 0356 0357 0358 0359 0360 0361 0362 0363 0364 0365 0366 0367 0368 51 •••••••••••••••••••••••• LOCATE • •••••••••••••••••••••••• PROGRAM LISTINGS • IPAGE 61 • •• • • • •••••••••••••••••••••••• • LOCATE • • ••••••••••••••••••••••• IPAGE THE LOGIC DETAILS OF SUBROUTINE CALL. INPUTS TO CALL SU8RU IS 6 HOLLERITH FOR THE PROXY NAME, IN FORMAT(1A6) • • SPACER IS ANY OUMMY VARIABLE (ITS VALUE IS NEITHER USED NOR CHANGED) • • ARGl ••• ARGN • •• • • • • • • • • • • • • • •• • • • • • • • • • • • • • • • • ARE THE SUBROUTINE ARGUMENTS, N IN NUMBER WHERE N MAY BE ZERO. o INDICATES NO TROUBLE, IN WHICH CASE THE IMPORTANT s OUTPUTS ARE THOSE (IF ANY) OF SU8ROUTINE SU8R -1 THRU -4 HAS SAME SIGNIFICANCE AS FOR SU8ROUTINE WHERE, AND THE SUBROUTINE WAS NOT OPERATED. THE SUBROUTINE CALL ITSELF MAY BE PROXIED. CALL CALLI4HCALL,IANSl,SPACER,SUBRU,IANS2,SPACER, 1 ARG1,ARG2, ••• ,ARGN) IS EQUIVALENT TO THE A80VE WHERE IANS1 NOW REFERS TO WHETHER OR NOT CALL HAS APPEARED IN A CALL LOCATE STATEMENT, AND IANS2 REFERS TO SU8RU. FAP DESCRIPTION OF THE FUNCTIONING OF CALL IBASIC OUTLINE) THE STATEMENT CALL CALLISU8RU,IANS,SPACER,ARG1,ARG2, ••• ) COMPILES TO LOCALL +1 +2 +3 +4 +5 TSX TSX TSX TSX TSX TSX . SCALL.4 AISU8RU).4 A(JANSItO AISPACER).O A(ARGlhD A(ARG2),0 AIC) STANDS FOR ADDRESS OF C CALL FINDS FROM WHERE THE ENTRY (LDC) OF THE DESIRED SUBROUTINE. THEN CONVERTS LOCALL+3 TO REAO TSX LOC.4. ANO FINALLY TRANSFERS CONTROL TO LDCALL+3. • • • FORTRAN USAGE OF CALL2 • • • • • • • • • • • • CALL2 DIFFERS FROM CALL PRINCIPALLY IN THAT ALL THE INFORMATION ABOUT THE SUBROUTINE BEING PROXIED IS PACKED UP IN A SINGLE VECTOR. AND THAT THE CLASS OF PROXYABLE SU8ROUTINES IS SLIGHTLY SMALLER. THE STATEMENT CALL CALL2ISUBRUV.IANS) IS FUNCTIONALLY EQUIVALENT TO THE STATEMENT CALL SUBRIARG1.ARG2 ••••• ARGN) PROVIDED 1. THE SUBROUTINE VECTOR SUBRUV(1 ••• N+4) IS SET UP IN ADVANCE AS DEFINED BELOW 2. SUBR IS A SUBROUTINE WHICH UTILIZES INFORMATION ONLY FROM ITS ARGUMENTS. • INPUTS TO CALL2 • • • • • • • • • • 0382 0383 0384 0385 0386 0387 0388 0389 0390 0391 0392 0393 0394 • XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X ENTRY CALL2 • • • • 0380 0381 OUTPUTS FROM CALL IANS 0369 0370 0371 0372 0373 0374 0375 0376 0377 0378 0379 SUBRUVII) 1=102 ••••• N+4 DEFINES THE SUBROUTINE DESIRED AND ITS ARGUMENTS AS FOLLOWS SUBRUV(1) " SUBRU s PROXY NAME OF SUBROUTINE. IN FORMATe lA6) (2) .. N=NARGS .. NO. OF ARGUMENTS OF THE SUBROUTINE IFIXED POINT) (3) FENCE .. OCTAL 7171777n717 IMUST BE PRESENT EVEN IF NaO) (4) .. IXARGI MUST 0395 0396 0397 0398 0399 0400 0401 0402 0403 0404 0405 0406 0407 0408 0409 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 0440 0441 0442 0443 6) •••••••••••••••••••••••• CPAGE • ••••••••••••••••••••••• PROGRAM LISTINGS LOCATE ••••••••••••••••••••••••• • • • • • • • • • • • IPAGE C51 = IXARG2 BE FIXEO IN+3l CN+41 = IXARGN POINT 777777777777 IMUST EVEN WHERE IXARG IS THE INDEX OF ARG WITH RESPECT FORTRAN COMMON BLOCK. OBTAINABLE FOR EXAMPLE STATEMENTS COMMON COM IXARG = XLOCFCCOM) - XLOCFIARGI + 1 • • • • FENCE = OCTAL BE IF TO BY PRESENT N=O) THE THE THE SUBROUTINE VECTOR. SUBRUVCI). IS A MIXED VECTOR WITH A NAMING PROBLEM. IT CAN BE CONSTRUCTED BY FORTRAN STATEMENTS FOLLOWING AN EQUIVALENCE STATEMENT TO G[VE SUBRUVCI) A F[XED POINT ALIAS, SAY ISUBRVCI). BUT THIS PROCEDURE [S CUMBERSOME. IT IS EAS[ER TO USE THE NEXT ENTRY SETSBV TO CONSTRUCT SUBRUVCII WITH A SINGLE CALL STATEMENT. * *• •* * • * • OUTPUTS • • •• LOCATE ••••••••••••••••••••••••* 7l THE PRINCIPAL OUTPUTS ARE FROM THE SUBROUTINE OPERATED C[F IT HAS OUTPUTS). BUT THE SUBROUTINE WILL BE OPERATED ONLY IF THE IANS OUTPUT BELOW IS ZERO. * SUBRUVtl1 CAlL2 lEAVES SUBRUVC3.4 •••• ,NARGS+4) MODIF[ED, AND SOME CAUTION MUST BE TAKEN [N REPEATED USE OF THE SAME CALL CALL2 STATEMENT OR OF A SUBSEQUENT CALL CAlL2 STATEMENT INVOLV[NG THE SAME SUBROUTINE VECTOR SUBRUVII). THE BASIC RULES ARE 1. REPEATED OR SUBSEQUENT USE WORKS PROPERLY [F A) SUBRUVC1 ••• N+41 [S NOT DISTURBED BY THE CALL[NG PROGRAM FOLLOW[NG THE FIRST USE (I.E •• LEFT THE WAY CAlL2 MODIF[ED IT). CNOTE THAT THIS ALLOWS ONE TO CHANGE ANY OR ALL OF THE VALUES OF THE ARGUMENTS ARGl, ••• ,ARGN PROVIDED ONLY THAT THE[R LOCATIONS WITH RESPECT TO COMMON DONT CHANGE.) OR BI SUBRUV(1 ••• N+4) IS COMPLETELY RECONSTRUCTED BEFORE SUBSEQUENT USE OR CI ONLY THE NAME OF THE SUBROUTINE IS CHANGED. 2. REPEATED USE WILL NOT WORK PROPERLY IF AI NARGS IS CHANGED IN SUBRUV(21. EVEN IF THE SUBROUTINE REQUESTED HAS A VARIABLE LENGTH CALL[NG SEQUENCE OR BI SUBRUVC3 ••• N+41 IS MODIFIEO OR ONLY PARTIALLY RECONSTRUCTED. REPEATED USE OF THE SAME SUBRUV VECTOR IN DIFFERENT CALL STATEMENTS IS PERMITTED • IANS • • * • * • * * • • • • • • • • • • * • * • • ° * INDICATES NO TROUBLE -1 ••• -4 HAS SAME SIGNIFICANCE AS FOR SUBROUTINE WHERE AND THE SUBROUTINE WAS NOT OPERATED. -5 IF THIS IS THE FIRST CALL2 WITH THIS SUBRUV VECTOR CCALLED FIRST IF SUBRUV(3) = FENCE), BUT SOMETHING IS ILLEGAL ABOUT SUBRUVCI). = -6 [F THIS IS A SECONDARY CALL2 WITH THIS SUBRUV VECTOR BUT THE VECTOR HAS BEEN ILLEGALLY CHANGED. * * CALL2, LIKE CALL, IS ALSO PROXYABLE. EITHER CALL OR CALL2 CAN BE USED TO PROXY BOTH CALL AND CALL2. * * • • • • * • • • FAP DESCRIPTION OF THE FUNCTIONING OF CALL2 (BASIC OUTLINE) * • • • • • THE STATEMENT CALL CALL2(SUBRUV,IANS) COMPILES TO LOCALL TSX SCALL2.4 WITH +1 TSX ACSUBRUV,O +2 TSX AIIANSI.O SUBRUVCN+41=OCT SUBRUVCN+31=PZE 777777777777 O,O,IXARG 0444 0445 0446 0447 044B 0449 0450 0451 0452 0453 0454 0455 0456 0457 0458 0459 0460 0461 0462 0463 0464 0465 0466 0467 0468 0469 0470 0471 0472 0473 0474 0475 0476 0477 0478 0479 0480 0481 0482 0483 0484 0485 0486 0487 0488 0489 0490 0491 0492 0493 0494 0495 0496 0497 0498 0499 0500 0501 0502 0503 0504 0505 0506 0507 0508 0509 0510 0511 0512 0513 71 •••••••••••••••••••••••• LOCATE * •••••••••••••••••••••••• • ••••••••••••••••••••••• • LOCATE • • ••••••••••••••••••••••• PROGRAM LISTINGS • CPAGE 81 • • • +3 SUBRUVC51 SUBRUVC41 SUBRUVC31 SU8RUVC21 SUBRUVC11 • • • • • • • • • • • • • * PZE PZE OCT PZE BC I 0,0, IXARG2 0,0, IXARGI 777777777777 O,O,NARGS 1, SUBROU CALL2 FINOS FROM WHERE THE ENTRY CLOCI OF THE OESIRED SUBROUTINE AND SETS SUBRUVCN+41 TO READ TSX LOC,4. SUBRUVC4 ••• N+31 IS REVERSED AND CONVERTED TO READ TSX ACARGNI.O ••• TSX ACARGll.0 RESPECTIVELY. SUBRUVC31 IS REPLACED BY TRA LOCALL+3. AND FINALLY CONTROL IS TRANSFERRED TO SU8RUVCN+41. ON A REPEAT USE OF THE SAME SUBRUV CDETECTED BY SUBRUVC31 NOT = FENCEI SUBRUVCN+41 AND SUBRUVC31 ARE RESET TO CPOSSIBLYI NEW VALUES. BUT SU8RUVI4 ••• N+31 IS LEFT ALONE. • • • • • •• •• • • CPAGE XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY SETSBV FORTRAN USAGE OF SETSBV SETSBV WILL CONSTRUCT A SU8ROUTINE VECTOR SUBRUVCII IN THE FORMAT REQUIRED BY SUBROUTINE CALL2. BY THE SINGLE STATEMENT CALL SETSBVISU8RU.SUBRUV.ARG1.ARG2 ••••• ARGN) *. * INPUTS TO SETSBV • • •* SUBRU IS 6 HOLLERITH FOR THE SUBROUTINE NAME. IN FORMATIIA61 ARGl ••••• ARGN ARE THE ARGUMENTS. IF ANY. OF THE SUBROUTINE ** OUTPUTS FROM SETSBV •* • • • SUBRUVCII I=I ••• N+4 IS THE SUBROUTINE VECTOR DESCRIBED ABOVE UNDER CALL2 USAGE. CSUBRUVCII MUST BE OIMENSIONED AT LEAST OF LENGTH N+4. WHERE N=O IF THERE ARE NO ARGUMENTS I • XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRIES SETUP AND RETURN •• • • • • FORTRAN USAGE OF SETUP AND RETURN SETUP AND RETURN INSTRUMENT LINKAGE BETWEEN THE CALLING PROGRAM AND A FORTRAN-II SUBROUTINE WHICH HAS VARIABLE LENGTH CALLING SEQUENCE. A CALL SETUP STATEMENT SHOULD BE THE FIRST STATEMENT IN THE FORTRAN SUBROUTINE. THE CALL RETURN STATEMENT SHOULD APPEAR AT LEAST ONCE ANYWHERE IN THE PROGRAM. FOR EXAMPLE - • • • •• • • SUBROUTINE SUBRCA.B.CI CDIMENSION AND EQUIVALENCE STATEMENTS. ETC •• IF ANYI CALL SETUPCLOCALL.NARGS.XR1.XR21 • • CALL RETURNILOCALL.XRl,XR21 • • • • • • • • • * • • . * * •* •* CALL RETURNCLOCALL,XRl,XR21 NOTE THE SUBROUTINE CARD NEED NOT HAVE ANY ARGUMENTS LISTED ON IT. AND IF IT DOES THE NUMBER OF ARGUMENTS SO LISTED NEED NOT CORRESPOND TO THE ACTUAL NO. CNARGSI OF ARGUMENTS USED BY THE CALLING PROGRAM. HOWEVER. IF THE NUMBER OF ARGUMENTS LISTED ON THE SUBROUTINE CARD IS LESS THAN THAT USED BY THE CALLING PROGRAM THE SUBROUTINE HAS AN ACQUISITION ANDIOR STORAGE PROBLEM 0514 0515 0516 0517 0518 0519 0520 0521 0522 0523 0524 0525 0526 0527 0528 0529 0530 0531 0532 0533 0534 0535 0536 0537 0538 0539 0540 0541 0542 0543 0544 0545 0546 0547 0548 0549 0550 0551 0552 0553 0554 0555 0556 0557 0558 0559 0560 0561 0562 0563 0564 0565 0566 0567 0568 0569 0570 0571 0572 0573 0574 0575 0576 0577 0578 0579 0580 0581 0582 0583 0584 0585 0586 0587 0588 81 •••••••••••••••••••••••• .•••••••••••••••••••••••• . LOCATE IPAGE PROGRAM LISTINGS 9) .. .. .•• ••••••••••••••••••••••• . LOCATE ••••••••••••••••••••••• SOME OR ALL OF ITS ARGUMENTS SINCE IT HAS NO SPECIFIC NAMES FOR THEM. THIS PROBLEM IS SOLVED BY USE OF ONE OR MORE OF THE FIVE ENTRIES XINOEX, ARG, XARG, STORE, AND XNARGS WHICH ARE DISCUSSED BELOW. CO~CERNING . .. INPUTS TO SETUP .. .. ... . SETUP HAS NO INPUT ARGUMENTS EXCEPT INDEX REGISTER 4 WHICH WAS SET BY THE CALL SETUP STATEMENT AND DEFINES THE LOCATION OF THAT STATEMENT. ISETUP PROCEEDS TO SCAN FROM THIS POINT BACKWARDS (LOWER ADDRESSES) TILL IT FINDS SXD X,Y INSTRUCTIONS (IN SUBROUTINE SUBR).) ... OUTPUTS FROM SETUP ..... ... .. .. .... ... . ... .... ... LOCALl IS THE ABSOLUTE MACHINE LOCATION OF THE CALL SUBRIARG1, • •• ,ARGN) STATEMENT IN THE CALLING PROGRAM. IN ORDINARY USAGE LOCALL SHOULD NOT BE CHANGEO BY SUBROUTINE SUBR PRIOR TO THE CALL RETURN{LOCALL, XR1,XR2) STATEMENT. NARGS IS THE NO. OF ARGUMENTS ASSOCIATEO WITH THE PRESENT CALL SUBR STATEMENT IN THE CALLING PROGRAM. (NARGS IS DETERMINED AS THE NO. OF SUCCESSIVE TSX Y,O INSTRUCTIONS WHICH IMMEDIATELY FOLLOW THE ADDRESS lOCALLl • XRl IS THE VALUE TO WHICH INDEX REGISTER 1 MUST BE RESET IBY RETURN) BEFORE RETURNING TO THE CALLING PROGRAM. XR2 IS THE ANALOGOUS VALUE FOR INDEX REGISTER 2. IN ORDINARY USAGE XRl AND XR2 SHOULD NOT BE CHANGED BY SUBROUTINE SUBR PRIOR TO THE CALL RETURN{LOCALl,XR1,XR2) STATEMENT • CALL SETUP CAN NOT BE PROXIED BY A CAll2 STATEMENT. TO RETURN ... INPUTS AS DEFINED UNDER OUTPUTS OF SETUP .. . LOCAll XRl AS DEFINED UNDER OUTPUTS OF SETUP ... AS DEFINED UNDER OUTPUTS OF SETUP . XR2 .. OUTPUTS FROM RETURN .. RETURN RETURNS CONTROL PROPERLY TO THE CALLING PROGRAM ... AND RESTORES INDEX REGISTERS FOR THE CALLING PROGRAM • .. BY USING RETURN IN A SLIGHTLY UNORTHODOX WAY IT IS POSSIBLE TO HAVE LOW lEVEL ROUTINES RETURN CONTROL .. DIRECTLY TO CALLING PROGRAMS 2 OR MORE LEVELS ABOVE THEM PROVIDED THE INTERMEDIATE ROUTINES PASS DOWN THE LOCALL, XR1, AND XR2 VALUES OF THE HIGH lEVEL ROUTINE • ... FOR EXAMPLE .. lEVEL 1 lE VEL 3 lEVEL 2 .... SUBROUTINE SUBBllOC,X,Y) SUBROUTINE SUBA{ ••• ) CALL SETUPILOC,N,X,y) . .. CALL SUBA ( ••• ) CAll RETURNILOC,X,Y) . ... CAll SUBBCLOC,X,y) . . ... lIN THIS USAGE IT IS IMMATERIAL WHETHER ANY OF THE ROUTINES INVOLVEO HAVE A FIXED OR VARIABLE NO. OF ARGUMENTS.) ... (PAGE 05B9 0590 0591 0592 0593 0'594 0595 0596 0597 0598 0599 0600 0601 0602 0603 0604 0605 0606 0607 0608 0609 0610 06ll 0612 0613 0614 0615 0616 0617 0618 0619 0620 0621 0622 0623 0624 0625 0626 0627 0628 0629 0630 0631 0632 0633 0634 0635 0636 0637 0638 0639 0640 0641 0642 0643 0644 0645 0646 0647 0648 0649 0650 0651 0652 0653 0654 0655 0656 0657 0658 0659 0660 0661 0662 9) •••••••••••••••••••••••• . .. LOCATE .••••••••••••••••••••••••• . LOCATE ••••••••••••••••••••••• PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 10) .. (PAGE 101 CALL RETURN CAN BE PROXIED BY CALL OR CALL2 • .. PROGRAMS USING LINKAGE BY SETUP AND RETURN CAN BE CALLED BY PROXY. AND SKIP RETURNING TO PROGRAMS CALLED BY PROXY IS PERMITTED • SETUP AND RETURN PERMIT THE USER TO PROGRAM CIRCULAR LOOPS BETWEEN SUBROUTINES. A PROGRAM IN SUCH A LOOP MUST SAVE LOCALL, XRl, XR2 IN SEPARATE LOCATIONS ACCORDING TO THE SUBROUTINE WHICH CALLED IT (DETERMINED, FOR EXAMPLE, FROM ONE OF ITS ARGUMENTS). AND THEN CALL RETURN WITH THE APPROPRIATE VALUES OF LOCALL, XRl. AND XR2. FOR ILLUSTRATION SEe COMPUTATIONAL EXAMPLE B. .... .. ... it it it . ..... .. it .. ... XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY XINDEX FORTRAN USAGE OF XINDEX (FUNCTION) XINDEX FUNCTION ENABLES A VARIABLE-LENGTH-CALLINGSEQUENCE SUBROUTINE TO LOCATE ABSOLUTELY ANY OF ITS ARGUMENTS. AND REFER TO IT AS AN ORDINARY VECTOR (IN COMMON). REGARDLESS OF WHETHER OR NOT ITS SUBROUTINE CARD HAS NAMES FOR THE ARGUMENTS. THE USAGE IS - .. . it .. . ... ... IXCOM=XINDEXFILOCALL.NUMARG) .. INPUTS TO XINDEX LOCAll IS THE ABSOLUTE MACHINE ADDRESS OF THE CALLING STATEMENT lAS PRODUCED BY SETUPI NUMARG IS THE ARGUMENT NUMBER ... OUTPUTS FROM XINDEX ... .. DESIRED it IXCOM IS THE INDEX WITH RESPECT TO THE COMMON BLOCK OF ARGUMENT NO. NUMARG. FOR EXAMPLE - ... CAllING PROGRAM ... it .. .. ... .. ...... .... . CALL SUBRIARG1.ARG2.ARG3 •••• ) IWHERE ARG3 IS SUPPOSEO TO BE A VECTOR) SUBROUTINE SUBROUTI NE SUBR DIMENSION COM(2) COMMON COM CALL SETUPILOC.N.Xl.X2) IX=XINOEXF(LOC.31 A=COM(IX+4) (THEN A = ARG3(511 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRIES ARG AND XARG FORTRAN USAGE OF ARG AND XARG (FUNCTIONS) ARG AND XARG FUNCTIONS GIVE A VARIABLE-LENGTH-CALLINGSEQUENCE SUBROUTINE IMMEDIATE ACCESS TO ANY OF ITS ARGUMENTS (INCLUDING ANY ELEMENT OF ANY VECTOR ARGUMENTI • THE FUNCTION IS SIMILAR TO THAT OF INDEX FUNCTION BUT MORE DIRECT. ARG AND XARG DIFFER ONLY ACCORDING TO WHETHER THE USER WISHES TO GIVE THE ARGUMENT A FLOATING OR FIXED POINT NAME RESPECTIVELY. THE USAGE IS .. . .. ARGU it IARGU it .. OR = ARGF(LOCALL.NUMARG.IXVECT) XARGFILOCALL.NUMARG.IXVECTI it .. INPUTS .. . ... .. LOCALL IS THE ABSOLUTE MACHINE ADDRESS OF THE CALLING PROGRAM • NUMARG IS THE ARGUMENT NUMBER REQUIRED. (EVERY ARGUMENT IS CONSIDERED BY ARGF AND XARGF TO BE A VECTOR.I IXVECT IS THE SUBSCRIPT INDEX OF THE DESIRED ELEMENT WITHIN THE 0663 0664 0665 0666 0667 0668 0669 0670 0671 0672 0673 0674 0675 0676 0677 0678 0679 0680 0681 0682 0683 0684 0685 0686 0687 0688 0689 0690 0691 0692 0693 0694 0695 0696 0697 0698 0699 0700 0701 0702 0703 0704 0705 0706 0707 0708 0709 0710 0711 0712 0713 0714 0715 0716 0717 0718 0719 0720 0721 0722 0723 0724 0725 0726 0727 0728 0729 0730 0731 0732 0733 0734 0735 0736 0737 •••••••••••••••••••••••• LOCATE • •••••••••••••••••••••••• PROGRAM LISTINGS • (PAGE 111 • • • • • • • • • • •• • (PAGE 11) REQUIRED ARGUMENT VECTOR. (IF THE REQUIRED ARGUMENT IS' CONSIDERED BY THE SUBROUTINE TO BE A SINGLE VARIABLE, NOT A VECTOR, THEN IXVECT SHOULD 8E SET a 1) • • •• • • • • ••••••••••••••••••••••• LOCATE • ••••••••••••••••••••••••• OUTPUTS ARGU OR IARGU IS THE DESIRED ELEMENT. REFERRING TO THE EXAMPLE UNDER XINDEX, ARG3C51 COULD EQUALLY WELL HAVE BEEN OBTAINED BY SUBR BY THE SINGLE STATEMENT A = ARGF(LOCALL,3,51 THUS BYPASSING THE NEED FOR THE DUMMY VECTOR, COM, AND ITS ASSOCIATED DIMENSION AND COMMON STATEMENTS. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY STORE • FORTRAN USAGE OF STORE •• STORE IS THE STORAGE COUNTERPART OF THE RETRIEVAL FUNCTIONS ARG AND IXARG. THE USAGE IS • • .• CALL STORE (ARGU,LOCALL,NUMARG,IXVECTI ..• INPUTS TO ..•.. ARGU LOCALL •. NUMARG IXVECT .... OUTPUTS • .. .. .... STORE IS THE QUANTITY TO BE STORED. (MAY HAVE FIXED POINT NAME) SAME AS FOR ENTRY ARG DITTO DITTO FROM STORE ARGU IS STORED AS VECTOR ELEMENT NO. IXVECT, IN THE VECTOR ARGUMENT NO. NUMARG, RELATIVE TO CALL STATEMENT AT LOCALL. AN IMPORTANT PROPERTY OF XINDEX, ARG, XARG, AND STORE IS THAT THEIR PROCESSES ARE,RELATIVE TO THE CONSTANT LOCALL WHICH IS UNDER PROGRAM CONTROL. LOCALL CAN BE INITIALIZED BY ONE SUBROUTINE USING SETUP AND THEN PASSED AS AN ARGUMENT UP DR DOWN THRU ARBITRARY SUBROUTINE LEVELS PERMITTING THE ARGUMENTS OF THE INITIALIZING SUBROUTINE TO BE TAPPED AS NEEDED BY THE OTHER ROUTINES. THUS, IN THE EXAMPLE OF A SKIP RETURN GIVEN ABOVE, THE SUBROUTINE SUBB AT LEVEL 3 COULD ACQUIRE DIRECTLY THE ARGUMENTS PASSED TO SUBA FROM LEVEL 1 BY USING XINOEX, ARG, OR XARG. IF THE INITIAL ARGUMENT STRING IS VARIABLE LENGTH IT MAY BE IMPORTANT THAT THE NUMBER OF ARGUMENTS BE ACCESSIBLE AT ALL LEVELS. THE INITIALIZING PROGRAM CAN PASS THIS INFORMATION ALONG WITH LOCALL, BUT THIS REQUIREMENT CAN BE SUPPRESSED BY REQUIRING THAT THE ROUTINES OBTAIN THE ARGUMENT COUNT FROM THE NEXT ENTRY XNARGS • .. • .... • .. •. .. ..... ... .. .. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY XNARGS • • FORTRAN USAGE OF XNARGS (FUNCTION) •.. •• ... •. NARGS=XNARGSF(LOCALL) INPUTS TO XNARGS LOCALL IS THE MACHINE ADORESS OF ANY FORTRAN CALL STATEMENT (ANY TSX X,4 INSTRUCTION) .. OUTPUTS FROM XNARGS ... . NARGS = NUMBER OF ARGUMENTS ASSOCIATED WITH THE CALL STATEMENT EXCEPT 0138 0739 0740 0741 0742 0743 0744 0745 0746 0747 0748 0749 0750 0751 0752 0753 0754 0755 0756 0757 075B 0759 0760 0761 0762 0763 0764 0765 0766 0767 0768 0769 0770 0771 0772 0773 0774 0775 0776 0777 0778 0779 0780 0781 0782 0783 0784 0785 0786 0787 0788 0789 0790 0791 0792 0793 0794 0795 0796 0797 0798 0799 0800 0801 0802 0803 0804 0805 0806 0807 0808 0809 0810 0811 0812 •••••••••••••••••••••••• .. LOCATE PROGRAM LISTINGS .. •••••••••••••••••••••••• (PAGE 12) .••••••••••••••••••••••••• . LOCATE ••••••••••••••••••••••• [PAGE 12) = -1 IF LOCALL IS NOT THE ADDRESS OF A CALL STATEMENT ... .. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXSXXXXXXXX X ENTRY XNAME .. ..... FORTRAN ... ..... .. .... ...... .. .. USAGE OF XNAME IFUNCTION) XNAME FUNCTION IS A CONVENIENCE FOR MAKING IDENTITY CHECKS BETWEEN TWO HOLLERITH NAMES OF 6 CHARACTERS OR LESS, WHERE THE RELATIVE LEFT OR RIGHT ADJUSTMENT (IN CASE OF LESS THAN 6 CHARACTERS) OF THE NAMES IS CONSIDERED IMMATERIAL. IT CAN BE USEFUL IN PROGRAM SYSTEMS WHERE PROTOCOL IS BASED ON NAME EXCHANGING. THE USAGE IS NEGDIF : XNAMEFIHNAME1,HNAME21 INPUTS TO XNAME HNAME1 IS THE FIRST OF THE TWO HOLLERITH NAMES IN FORMAT(lA6). HNAME2 IS THE SECOND OF THE TWO NAMES. FROM XNAME .... OUTPUTS NEGDIF (NEGATIVE ... ... ... .. . .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .... IF DIFFERENT) +0 -1 IF THE NAMES MATCH IF THE NAMES DIFFER XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX COMPUTATIONAL EXAMPLES 1. EXAMPLES OF PAUSES ON ILLEGAL ARGUMENT COUNTS IN THE FOLLOWING PROGRAM THE COMPUTER WILL STOP AFTER EACH STATEMENT ON HPR 77777. ASSUME THE OPERATOR RECOROS AC,MQ.XR4 AND RESTARTS. USAGE 1 CALL LOCATE 7. CALL WHERE IA.BI 3 CALL WHERE (A,B,C,D,EI 4 CALL CALL[AI 5 CALL CALL2 6 CALL CALL2 IA,B,CI 7 CALL SETSBV (AI 8 CALL SETUP (AI 9 CALL SETUP (A,B,C,D,EI 10 CALL RETURN 11 CALL RETURNIA.B.C,DI 12 CALL STOREIA.B.C.D.EI 13 CALL STOREIA,BI OUTPUTS - PAUSE NO. AC: MQ= XR4= 434623216325 000000000000 ADDR. STATHNT 663025512560 000000000002 PLUS 1 000000000005 PLUS 3 DITTO 232143436060 000000000001 PLUS 6 000000000000 PLUS 2 232143430260 000000000003 PLUS 1 DITTO 000000000001 PLUS 4 622563622265 622563644760 000000000001 PLUS 2 000000000005 PLUS 2 DITTO 512563645145 000000000000 PLUS 6 000000000004 OITTO PLUS 1 000000000005 PLUS 5 626346512560 000000000002 PLUS 6 DITTO [ADD 2 TO THE PLUS*S IF STD. ERR • PROC.) 1 7. 3 4 5 6 7 8 9 10 ... .... 11 12 13 .... ... ..... 2.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX EXAMPLE INVOLVING ONLY LOCATE ANO WHERE, TO SHOW THE VARIOUS .... . CONOITIONS OISTINGUISHED 8Y WHERE USAGE DIMENSION IANSI81. LOC(8), NARGSI81 1=1.8 00 10 0813 0814 0815 0816 0817 0818 0819 0820 0821 0822 0823 0824 0825 0826 0827 0828 0829 0830 0831 0832 0833 0834 0835 0836 0837 0838 0839 0840 0841 0842 0843 0844 0845 0846 0847 0848 0849 0850 0851 0852 0853 0854 0855 0856 0857 0858 0859 0860 0861 0862 0863 0864 0865 0866 0867 0868 0869 0870 0871 0872 0873 0874 0875 0876 0877 0878 0879 0880 0881 0882 0883 0884 0885 0886 0887 ........................ it PROGRAM LISTINGS • LOCATE •••••••••••••••••••••••• IPAGE 131 IPAGE 131 • • IANSlll=~99 •. 10 . .. . •. .. .. .-. ..• ....• . ••••••••••••••••••••••• .••••••••••••••••••••••••• LOCATE • 1 it 2 3 4 it 5 6 it 7 8 LOCII) =-99 NARGSII)=-99 CALL WHEREI6HANYSU8,IANSI1I,LOC(1),NARGSllI1 CALL LOCATEI6HLOCATE,6HLOCOUMI CALL LOCATEIA,B,CI CAll LOCATE CALL WHEREI6HLOCATE,IANS(2I,LOCI2I,NARGS(211 CALL WHERE(6HLOCDUM,IANS(3I,LOCI3I,NARGSI311 CALL WHERE(6HANYSUB,IANS(4I,LOCI4),NARGS(4)) CALL LOCATEI5HWHERE,6H OUM2) CALL WHEREIA,B,C.O,E,F,G,H,I,J,K.L,M,N,O,PI A=B CALL WHEREI6H WHERE,IANS(5),LOCI51.NARGSI5)1 CALL WHEREI4HOUM2,IANS(6),LOCI61.NARGS(6)1 CALL LOCATEIOUMI A=8 CAll LOCATEI DUM) A=B CAll LOCATE(OUM) A=B I ETC, 13 PAIRS IN TOTAL) CALL LOCATEtDUM) A=8 CALL WHEREI6HLOCATE,IANS(7),LOCI7),NARGS(71) CALL WHEREISHWHERE,IANSIS),LOC(S),NARGS(SI) it • • .• OUTPUTS - 1= 1 2 3 4 5 6 7 8 . • • • .• !ANSII)= -3 o o -1 o -2 -4 o LOCII)= -99 ADORESSILOCATE) SAME AS LOC(2) -99 ADDRESSIWHEREI (GRTHN LOC(2)1 -99 -99 SAME AS LOC(5) ...• 3.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX EXAMPLE OF PROXY CALL STATEMENTS BY CALL AND CALL2 IWITH .. NARGSI 1)= -99 3 o -99 16 -99 -99 16 AND WITHOUT SETSBV) it .. .. .. • • .. .. INPUTS • •. USAGE . . .• •. •. .... .. it • • .• .. .• - SUPPOSE THE SU8ROUTINE TO BE PROXIED HAS THE FUNCTION OF SETTING ITS SECOND ARGUMENT = TWICE ITS FIRST ARGUMENT AS FOLLOWS SUBROUTINE OUBLERII,KI K=2-1 RETURN END OIMENSION SU8RUV(6),ISUBRVI6I,COM(2),IANSISI,KIS) EQUIVALENCE ISUBRUV,ISUBRV) COMMON COM CALL LOCATEI6HDUBLER) CALL DU8LER C FIRST TRY REPEAT EO USE OF CALL CALL 00 10 J=1,3 I=J CALL CALLI6HDUBLER,IANSIII,SPACER,I,KIJ)) 10 CONTINUE C NOW SET UP A SUBROUTINE VECTOR THE HARD WAY SUBRUV(1)=6HDU8LER ISUBRV(2)=2 B SUBRUV(3)=777777777777 ISUBRVI41=XLOCFICOMI-XLOCFIIJ+1 ISUBRVI51=XLOCFICOM)-XLOCFIKTEMPI+1 B SUBRUV(6)=777777777777 C THEN TRY REPEATED USE OF CALL2 FROM THE SAME STATEMENT DO 20 J=4,6 I:J CALL CALL2ISUBRUV,IANSIJII KIJI=KTEMP CONTINUE 20 088S 0889 0890 0891 0892 0893 0894 0895 0896 0897 0898 0899 0900 0901 0902 0903 0904 0905 0906 0907 0908 0909 0910 0911 0912 0913 0914 0915 0916 0917 0918 0919 0920 0921 0922 0923 0924 0925 0926 0927 0928 0929 0930 0931 0932 0933 0934 0935 0936 0937 0938 0939 0940 0941 0942 0943 0944 0945 0946 0947 0948 0949 0950 0951 0952 0953 0954 0955 0956 0957 0958 0959 0960 0961 0962 . • ••••••••••••••••••••••• • LOCATE •••••••••••••••••••••••• PROGRAM LISTINGS IPAGE 141 " ". ." ... OUTPUTS - IANSll ••• 81=0 Kll ••• 81=2,4,6,8,10,12,14,16 " .."" 4.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX EXAMPLES OF SETUP AND RETURN . " .. " " " " " " " " " " " ". INPUTS - SUPPOSE COUNT 1 IS A SUBROUTINE WHICH SETS ITS FIRST ARGUMENT EQUAL TO ITS ARGUMENT COUNT (PROVIDED THE COUNT IS NON-ZEROI SUBROUTINE COUNTltlCOUNTI CALL SETUPILOCALl,NARGS,XRl,XR21 IF (NARGSI 20,20,10 10 ICOUNT=NARGS 20 CALL RETURNIlOCAlL,XR1,XR21 END USAGE 10 . "" " "" "" "" " " " " .. " " " .. " " " " " " " " " " " " " " " " " " " " " " " OIMENSION ICOUNTI31 00 10 1=1,3 ICOUNTt I 1=0 CALL COUNT11ICOUNTl11,A,B,C,D,E,FI CALL COUNTl CALL COUNT11ICOUNTI311 OUTPUTS - ICOUNTll ••• 31 = 1,0,1 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 5. EXAMPLE OF SETUP, RETURN, XINDEX, XARG AND STORE INPUTS - SUPPOSE A VARIABlE-lENGTH-CALLING-SEQUENCE SUBROUTINE, ADARGS, HAS THE FUNCTION OF SETTING THE FIRST ELEMENT OF ITS FIRST ARGUMENT = NO. OF ITS ARGUMENTS, AND THE SECOND ELEMENT - SUM OF THE REMAINING ARGUMENTS. IT WILL COMPUTE TWO WAYS, USING XARG AND XINDEX, AND COMPARE BEFORE STORING. IT WilL EXIT FOR lESS THAN TWO ARGUMENTS. SUBROUTINE ADARGS DIMENSION ICOMI21 COMMON ICOM CAll SETUPILOCALL,NARGS,XR1,XR21 IF INARGS-21 99,10,10 C FIRST COMPUTE USING XARG 10 ITEMP1=0 DO 20 1-2,NARGS 20 ITEMP1=ITEMP1+XARGFILOCALL,I,11 C THEN USE XINDEX AND COMPARE RESULTS ITEMP2=0 00 30 1=2,NARGS IX=XINDEXFIlOCALl,II 30 ITEMP2=ITEMP2+ICOMIIXI IF(ITEMP1-ITEMP21 99,40,99 C SET OUTPUTS WITH STORE 40 CALL STOREINARGS,lOCAlL,l,ll CALL STOREIITEMP1,LOCALL,1,21 99 CALL RETURNILOCAlL,XRl,XR21 END USAGE 10 . IPAGE 14) C NOW TRY IT FROM ANOTHER SPOT WITH THE SAME SUBRUV C VECTOR 1"1 CALL CALL2ISUBRUV,IANSI111 KI11=KTEMP C NOW REESTABLISH SUBRUV THE EASY WAY AND RETRY CALL2 CALL SETSBVI6HDUBLER,SUBRUV,8,KI811 CALL CALL2ISUBRUV,IANSISII ."" " .." • ••••••••••••••••••••••• LOCATE "• ••••••••••••••••••••••• OIMENSION IAI21,IBI21,ICI21 DO 10 1=1,2 IAIII=-99 IBI I 1=-99 ICI I )=-99 CALL ADARGSIIA,l,2,3,41 0963 0964 0965 0966 0961 0968 0969 0910 0911 0912 0913 0914 0915 0916 0911 0918 0919 0980 0981 0982 0983 0984 0985 0986 0981 0988 0989 0990 0991 0992 0993 0994 0995 0996 0991 0998 0999 1000 1001 1002 1003 1004 1005 1006 1001 1008 1009 1010 1011 1012 1013 1014 1015 1016 1011 1018 1019 1020 1021 1022 1023 1024 1025 1026 1021 1028 1029 1030 1031 1032 1033 1034 1035 1036 1031 .......•.........-...... . • LOCATE ....•.....•.•... _....... PROGRAM LISTINGS LOCATE • ••••••••••••••••••••••• IPAGE 15) IPAGE 15) •. • •• .. .•...... _. __ .............. CALL ADARGSIIB,11 CALL ADARGS(ICI CALL ADARGS OUTPUTS - IA(1,21 = 5,10 IBll,21= 2,1 IC(1,2)= -99,-99 • - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - • 6. EXAMPLE OF TWO-WAY DIRECT COMMUNICATION THRU AN INTERMEDIATE • SUBROUTINE, USING SETUP,RETURN,XNARGS,XNAME,STORE •- INPUTS • .. .. .. .. .. • • .. • • • - SUPPOSE SUBROUTINE PASSER MERELY TRANSMITS ITS LOCALL, XR1 AND XR2 VALUES TO NAMECK SUBROUTINE PASSER CALL SETUPtLOCALL,NARGS,XR1,XR21 CALL NAMECKILOCALL,XRl,XR21 END AND NAMECK HAS THE FUNCTION OF SETTING THE FIRST ARGUMENT (RELATIVE TO LOCALLl EQUAL 1 OR -1 ACCORDING TO WHETHER OR NOT THE REMAINING ARGUMENTS IASSUMING AT LEAST 3 TOTALI ALL REPRESENT THE SAME HOLLERITH NAME, AND THEN SKIP RETURNING. SUBROUTINE NAMECKILOCALL,XRl,XR2) NARGS = XNARGSF(LOCALLI HNAME1 = ARGF(LOCALL,2,11 DO 10 I=3,NARGS HNAMET = ARGF(LOCALL,I,l) IF (XNAMEFtHNAME1,HNAMETII 20,10,10 10 CONTINUE CALL STORE(l,LOCALL,l,ll GO TO 99 20 CALL STOREI-l,LOCALL,1,11 99 CALL RETURN(LOCALL,XR1,XR2) ENO • • •.. USAGE CALL PASSER IIANSl,3H-A4,4H .A4,5H -A4,6H CALL PASSER IIANS2,6H I 1,3HI II CALL PASSER IIANS3,6HABCDEF,6HABCDEEI - OUTPUTS - IANS1 =1 -. •• - IANS2 = 1 *A41 IANS3 = -1 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - 7. EXAMPLE OF A GENERAL PURPOSE SUBROUTINE -. .-- .. INPUTS ... . -.. .. ... . •. • • USAGE • •. . .. - - SUPPOSE SUBROUTINE GNPURP MERELY OPERATES, USING CALL2, AN ARBITRARY NUMBER OF SUBROUTINE VECTORS PASSED TO IT AS ARGUMENT NOS. 2,3, ••• BUT REPORTS BACK, IN ITS FIRST ARGUMENT (VECTORI THE IANS RESULT OF CALL2 FOR EACH SUBROUTINE SUBROUTINE GNPURPIIANSI DIMENSION IANS(21,COMI21 COMMON COM CALL SETUPILOCALL,NARGS,XR1,XR21 IF INARGS-ll 99,99.10 10 DO 20 I=2,NARGS IX = XINDEXFILOCAlL,11 J=I-1 20 CALL CALL2ICOMIIXI,IANS(JI) 99 CALL RETURN(LOCALL,XRl,XR21 END AND SUPPOSE SUBROUTINES DUBLER,COUNT1,ADARGS,PASSER AND NAMECK ARE AS DEFINED PREVIOUSLY DIMENSION SUBRVDI61,SUBRVC(9I,SUBRVA(121,SUBRVPI71, ISUM(21,IANS(4) CALL LOCATE(6HDUBLER,6HCOUNT1,LHADARGS,6HPASSERI CALL DUBLER CALL COUNTl CALL ADARGS CALL PASSER C INOTE-NAMECK DOESNT NEED TO BE LOCATED, BUT IS NEEDED 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 109B 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 •••••••••••••••• * ••••••• • PROGRAM LISTINGS • LOCATE •••••••••••••••••••••••• IPAGE 16) .. .. ... . C • OUTPUTS .• • ••••••••••••••••••••••• LOCATE • • ••••••••••••••••••••••• • (PAGE 16) FOR EXECUTIONI CALL SETSBV(6HDUBLER,SUBRVD,16,IDUBLI CALL SETSBV(6HCOUNTl,SUBRVC,ICOUNT,A,B.C,01 CALL SETSBV(6HADARGS,SUBRVA,ISUM,3.5,7,11,13,17,191 CALL SETSBVI6HPASSER,SUBRVP,IANSP.4HSAME.6H SAMEI CALL GNPURPIIANS,SUBRVD,SUBRVC,SUBRVA,SUBRVPI - IANSI1 ••• 41 = 0 (MEANING ALL SUBROUTINES FOUND I AND IDUBL = 32 ICOUNT = 5 ISUMI1 ••• 21 .. 8.75 IANSP = 1 ..... XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 8. EXAMPLE OF USE OF SETUP ANO RETURN FOR LOOP LOGIC BETWEEN .. .. SUBROUTINES - A CALLS B, B CALLS C, C CALLS B. B RETURNS TO C. C CAllS B, B RETURNS TO A. .. .. .. .. .. INPUTS . .. .. . SUBROUTINE ADD1IISUM,CALlERI CAll SETUPllOCTMP,NARGS,XR1TMP,XR2TMPI ISUM=ISIJM+1 C NOW FINO OUT WHO IS CALLING SUBAD7=4HADD7 IF IXNAMEFISUBAD7,CALLER» 10,20.20 C IF NOT AD07 SeT ASIOE LOCTMP, XRITMP, XR2TMP, C INITIALIZE COUNTER AND THEN CALL ADD7 10 LOCBAK=lOCTMP XR1BAK=XRlTMP XR2BAK=XR2TMP ICOUNT=l CAll ADD7IISUM) C IF IT IS ADD7, RETURN TO CALLING PROGRAM IF ICOUNT C HAS REACHED 2. 20 IF IICOUNT-2) 40,30,30 30 CALL RETURNllOCBAK.XR1BAK,XR2BAKI C IF ICOUNT IS STIll = 1, INCREASE IT BY 1 AND RETURN TO C ADD7. 40 ICOUNT=ICOUNT+l RETURN C NOTE - ABOVE STATEMENT IS EQUIVALENT TO C CALL RETURNllOCTMP.XRITMP,XR2TMPI END .. .. ... . .• •.. • .... . ... . . SUBROUTINE ADD7IISUM) ISUM=ISUM+7 CAll ADDlIISUM,6H ADD71 ISUM=ISUM+7 CAll ADDIIISUM,5H ADD71 RETURN C INOTE - ABOVE RETURN STATEMENT WILL NEVER BE EXECUTEDI END ..• •. .. .. ... . •. - SUPPOSE SUBROUTINES ADDI AND ADD7 MERELY ADO 1 AND 7 RESPECTIVELY TO THEIR FIRST ARGUMENTS. (ADDI AND ADD7 WIll PLAY THE ROLES OF SUBROUTINES 8 AND C ABOVE RESPECTIVELY. ADDI WIll HAVE THE PRIMARY lOGIC RESPONSIBILITIES.) ISUM .. O CAll ADDIIISUM,4HMAINI USAGE OUTPUTS - ISUM=17 (I.E., 3 CAllS OF ADD1, 1 CAll OF ADD7 AND 1 RETURN TO ADD71 . • .. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .... PROGRAM FOllOWS BELOW .. . .. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY lOCATEISUSRU1,SUBRU2, ••• ) ... HTR HTR 0 0 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 •••••••••••••••••••••••• • •••••••••••••••••••••••• • PROGRAM LISTINGS LOCATE *-* ••••••••••••••••••••• •• ••••LOCATE * ••••••••••••••••••• (PAGE 11) (PAGE 111 HTR 0 BCI 1.LOCATE LOCATE SXD LOCATE-4,1 CLS Kl TSX EXCHQR,l • SEE IF THIS XR4 VALUE IS ALREADV IN TABLE PXA 0,4 LXA NKEVS,2 TXL NEWKEV,2,0 NOT IF NKEVS=O CASL CAS KEVS+l.2 TRA .+2 TRA LBACK yeS IT IS TIX CASL,2.1 • PUT XR4 IN TABLE IF IT IS NEW, • AND INDEX NKEVS AND NXKEV BV I, • BUT PREVENT NKEVS FROM EXCEEDING KTABLE (SET KOVER IF IT TRIES TOl, - AND RESET NXKEV TO 1 WHEN IT REACHES KTABLE+l NEWKEV LXA NXKEV,l STA KEVS+l,1 CLA NXKEV ADO Kl STO NXKEV LDQ Kl CAS KTABLE STQ NXKEV NOP CLA NKEVS ADD Kl CAS HABLE STO KOVER TRA *+3 KTABLE OR KTABLE+l S10 NKEVS TRA LBACK NZT KOVER WHICH IS IT STO NKEVS • NOW GET INTERNAL SUBROUTINE SKIP TO HELP US GET BACK * FIRST JUMP GIVES NO. ARGUMENTS OF THE TSX SLOCATE,4. * IF MQ NEG, EXIIT TO 1,4. OTHERWISE, SKIP NARGS TIMES OR UNTIL * MO GOES NEGATIVE, WHICHEVER FIRST. LBACK TSX SKIP,l TOP -+2 TRA LEXIT PAX 0,2 JUMPI TXI *+1,4,-1 TSX SKIP,1 TOP .+2 TRA LExn TIX JUMP1,2,l LEXIT LXD LOCATE-4,l LXD LOCATE-3,2 TRA 1,4 • * • XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRV WHEREISUBRU,IANS,LOC,NARGS) • • • • THE IANS OUTPUT OF WHERE IS = 0 IF LOCATED OK. =-1 NOT LOCATED, BUT THE TABLES ARE IN ORDER. * =-2 NOT LOCATED. [T WAS FOUND AS ONE OF THE ARGUMENTS OF * A CALL LOCATE STATEMENT, BUT THE ASSOCIATEO LIST OF CALL STATEMENTS WAS TOO SHORT. =-3 NOT LOCATED, NO CALL LOCATE STATEMENT HAS BEEN MADE VET. * =-4 NOT LOCATED, BUT THE KEVS LIST HAS OVERFLOWED, * ANO [T MAV HAVE BEEN LOST FROM A P~[OR CALL LOCATE STATEMENT. * * • - • BC[ I,WHERE WHERE SXD LOCATE-4,1 K4 CLA EXCHQR,l TSX • LEFT ADJUST THE NAME 1,4 LDQADJUST,I TSX 6HSUBROU 11BB 11B9 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 122.3 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 •••••••••••••••••••••••• LOCATE * ••••••••••••••••••••••••* (PAGE 18) PROGRAM LISTINGS •••••••••••••••••••••••• LOCATE • *• ••••••••••••••••••••••• STQ SU8ROU CLA 3.4 AILOC) STA STOW1 CLA 4.4 A(NARGS) STA STOW2 * IMMEDIATE EXIT WITH IANS=-3 IF NKEYS=O ZET NKEYS TRA GOTAK CLS KD3 • EXIT CHANNEL (ALSO USED 8Y CALL. CALL2) LEAVEW LXD LOCATE-2.4 STOw 2.4 TRA SKIPEX • OTHERWISE INITIALIZE IXKEY=O AND START GOTAK STZ IXKEY • INDEX IXKEY ANO CHECK IF IT EXCEEOS NKEYS NXTKEY CLA IXKEY ADD Kl STO IXKEY CAS NKEYS TRA GIVUP NOP TRA KEYOK • IF SO SET IANS=-1 IF KOVER=O • =-4 IF KOVER=l. ANO EXIT. GIVUP CLS K01 NZT KOVER TRA LEAVEW CLS KD4 TRA LEAVEW • GET THIS KEY AND SET XR4 AND LARG WITH IT KEYOK PAX 0.2 CLA KEYS+l.2 PAX 0,4 (SET FOR LATER SKIPPING) PAC 0.2 SXA LARG.2 • RUN DOWN THE ARGUMENTS OF LOCATE, UNTIL A NON-TSX X.O • INSTRUCTION IS REACHED. XR2 KEEPS NECATIVE TRACK OF ARG NO. AXC 1.2 LARG CAL ••• 2 •• =A(TSX SLOCATE.4) STA GOTARG TSX CKTSXl.l TRA NKTKEY • FOR EACH TSX X.O GET THE ARGUMENT AND COMPARE WITH SU8ROU. • 8ACK TO TRY NEXT ARGUMENT IF DOESNT MATCH GOTARG LDO.. ..:A(A(TSX SLOCATE,4)-XR2) XR2=-ARG NO. TSX ADJUST.l STO TEMP CAL TEMP LAS SU8ROU TRA *+2 TRA MATCH TXI LARG,2,-1 • WHEN IT MATCHES. -(XR2)=INDEX OF THE MATCHING ARG • GET THIS INDEX AND USE SKIP THIS MANY TIMES • TO LOCATE THE CORRESPONDING TSX SSU8ROU,4 • BUT ERROR EXIT IF SKIP HITS A NON SPECIAL INSTRUCTION MATCH PXA 0,2 PAC 0.2 SKP TSX SKIP,l TOP CONTIN CLS KD2 TRA LEAVEW CONTIN TXI *+1.4.-1 TIX SKP.2.1 • FIGURE OUT THE SU8ROUTINE ENTRY POINT AND SET LOC. * ENTRY POINT = ADDRESS PORTION OF THAT REGISTER lIN THE TRANSFER • VECTOR) WHOSE ADDRESS IS THE ADDRESS PORTION OF THE • TSX SSU8ROU,4 WHICH SKIP JUST STOPPED AT. * (NOTE ADVANCE OF XR4 8Y 1 AT CONTINI CLA 0,4 PICKS UP TSX SSU8ROU,4 STA *+1 CAL •• ANA MSK3 ALS 18 (PAGE 18) 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 •••••••••••••••••••••••• • • LOCATE •••••••••••••••••••••••• PROGRAM LISTINGS • IPAGE 19) SET IANS=O. EXIT • • •• XXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY CALLISUBRU.IANS.SPACER.ARG1.ARG2 •••• ) • • CALL LEAVES IANS .. 0 IF EVERYTHING OK .. SAME AS FROM WHERE IF CANT FIND SUBROUTINE 1-1.-2,-3,-4) • •• •• • SET WHICH CALL INDICATOR ICALL .. 0 FOR CALL BCI 1.CALL CALL SXD LOCATE-4.1 • CALL MUST HAVE AT LEAST 2 ARGUMENTS ~O 3,4 MUST BE SOME KIND OF A • TSX ITSX X,4 ON REPEAT ENTRY) CLS K2 CKCALL TSX EXCHQR,l STl ICALL CAL 3,4 TSX CKTSXA,l TRA CKCALL (WITH AC HUGE,NEG OR POS) TRA LXOCC2 • •• • •• • • • • • • • • •• • • LOCATE • ••••••••••••••••••••••• IPAGE 19) •• ..sAILOC) STOW1 SLW • USE SKIP AGAIN TO GET THE ARGUMENT COUNT. TSX SK IP'.l 18 ALS ....AINARGS) STOW2 STO •• ISET lANS) KO CLA LEAVEW TRA • ••••••••••••••••••••••• XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY CALL2 (SUBRUV,IANS) CALL2 LEAVES IANS = 0 IF EVERYTHING OK = SAME AS FROM WHERE IF SUBROUTINE NOT FOUND 1-1,-2,-3.-4) .. -5 IF FIRST CALL2 WITH THIS SUBRUV BUT SOMETHING IS ILLEGAL ABOUT SUBRUV ICONSIDERED FIRST CALL I.F.F. SUBRUV(3)=FENCE) -6 IF SECONDARY CALL2 WITH THIS SUBRUV BUT SOMETHING IS ILLEGAL ABOUT SUBRUV SET ICALL NON-ZERO (=XR4) FOR CALL2 BCI 1,CALL2 CALL2 SXO LOCATE-4,1 CLA K2 TSX EXCHQR.1 SXA ICALL,4 • THESE TWO CALLS RUN TOGETHER UNTIL THE SUBROUTINE IS FOUND LXDCC2 LXD LOCATE-4,1 SXA AXT4W,4 CLA 1,4 A(6HSUBROU=SUBRUVI1)) STA TSXW1 SUB K1 STA NGET SUB Kl STA GTFNCE STA CALC2 STA CLAR STA LDQR CLA 2,4 AIIANS) STA ANSEl NGET C L S . . ..=AINARGS) ICALL2) ARS 18 ADD 1,4 SUB K3 AISUBRUVINARGS+41) STA STTSX4 • USE WHERE TO FIND SUBROUTINE AND IANS lIT ALSO SAVES 6HSUBROU) • AND THEN CHECK IANS • (NOTE XRl AND XR2 HAVE ORIGINAL VALUES AT THIS POINT.) TSX WHERE,4 TSXW1 TSX •• ,0 ....AI6HSUBROU) 133B 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 13116 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 •••••••••••••••••••••••• - • LOCATE •••••••••••••••••••••••• CPAGE 20) PROGRAM LI STINGS • ••••••••••••••••••••••• .*.................. _._.-- TSX TEMP2,0 IANS TSX LOC,O TSX TEMP3,0 (DUMMY FOR NARGS) CLA TEMP2 AXT4W AXT **,4 SXD LOCATE-2,4 TNI LEAVEW • IF OK, FORK ON CALL TYPE lET ICALL TRA NTCAll * FOR CALL SET ADDRESS OF THE TSX LOC,4 3,4 LDC LOCATE-2,4 TXI *+1,4,3 SXA STTSX4,4 - THIS IS WHERE CALL AND CALL2 TRANSFER TO SUBROU (SETTING IANS=O) FUNEL LXD LOCATE-4,1 LXD LOCATE-3,2 CLA KO ANSET STO ** --=A(IANS) CLA LOC ARS 18 ADD TSX4 STTSX4 STO **=ACTSX LOC,4) TRA* STTSX4 - IF SUBRUV(3) IS NOT 777 ••• ASSUME THAT THIS IS A - REPEAT ENTRY WITH THE SAME SUBRUV VECTOR AND 1. SUBRUV(3) = TRA X CBUT X MUST BE RESET) • 2. SUBRUVt4,5, ••• ,NARGS+3) IS STILL SET UP FROM LAST CALL2 * 3. SUBRUV(NARGS+41 IS STILL TSX Y,4 CBUT Y MUST BE RESET) NTCALL CLA* NGET = NARGS GTFNCE CAL _. **=ACSUBRUV(3)) = FENCE OR TRA X LAS FENCE HPR CALL2-1 (MACHINE ERROR OR FENCE SMASHED) TRA *+2 NEW TRA REPEAT * OTHERWISE WE WANT TO REVERSE AND CONVERT * SUBRUV(4 ••• ,NARGS+3), PROVIDED NARGS ISNT IERO, * AND THEN SET LINKAGE IN SUBRUV(3) * FIRST CHECK FENCE IN SUBRUV(NARGS+4) CAL* STTSX4 = SUBRUVCNARGS+4) LAS FENCE TRA .+2 TRA -+2 TRA BADSBV - IF OK CHECK FOR NEG OR ZERO NARGS CLANGET TZE RVOVR TPL REV • EXIT WITH IANS=-5 FOR ILLEGAL SUBRUV BADSBV CLS KD5 TRA LEAVEW • FOR A REPEAT ENTRY, CHECK THAT WE STILL HAVE TRA X, - NARGS IS NON-NEG, AND THE TSX*S ARE STILL THERE REPEAT ANA MSKI LAS TRAl TRA *+2 TRA TRAOK CHANGE CLS KD6 TRA LEAVEW TRAOK CLANGET TMI CHANGE ADD KD1 (ALWAYS HAVE A TSX Y,4) POX 0,2 CALC2 CAL .-,2 ** = A{SU8RUV(3)) TSl( CKTSXA,1 TRA CHANGE TIX CALC2,2,1 TRA RVDVR * FORM {NARGS+l)/2 (TO CATCH MIDDLE TERM IF ODD) * AND SET XRl TO WORK ON HIGH END (LOW ADDRESSES) • AND XR2 TO WORK ON LOW END (HIGH ADDRESSES) REV POX 0,1 XR1=NARGS ADD KDl ARS 1 STD TXLR *. LOCATE (PAGE 20) 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1431 1438 1439 1440 1441 1442 1443 1444 1445 1446 1441 1448 1449 1450 1451 1452 1453 1454 1455 1456 1451 1458 1459 1460 1461 1462 1463 1464 1465 1466 1461 1468 1469 1410 1411 1412 1413 1414 1415 1416 1411 1418 1419 1480 1481 1482 1483 1484 1485 1486 1481 •••••••••••••••••••••••• • lOCATE • •••••••••••••••••••••••• IPAGE 21) PROGRAM lISTINGS • ••••••••••••••••••••••• • lOCATE • • ••••••••••••••••••••••• AXT 1,2 XR2=1 • lOOP START ClAR ClA •• ,2 •• =AISUBRUV(3» lOQR lOQ •• ,1 •• :AISUBRUV(3)} • CONVERT AND EXCHANGE AC AND MQ TSX CNVTAC,4 XCA TSX CNVTAC,4 • STORE THE VALUES AND INDEX FOR MORE STO. ClAR STQ. lOQR TXI .+1,1,-1 TXI .+1,2.1 TXlR TXl ClAR,2,.. ..=INARGS+l)/2 • FINISHEO REVERSING. • SET RETURN lINKAGE IN SUBRUV(3), AND GO ENTER SUBROUTINE RVOVR lOC lOCATE-2,1 TXI .+1,1,3 SXA TRA,l ClA TRA TRAIAITSX SCAll2,4)+3) STO. GTFNCE TRA FUNEl • • • XXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY SETSBVISUBRU,SUBRUV,ARGl,ARG2, ••• ) • • SETS SUBRUV(1) 6HSUBROU • (2) = NARGS • (3) OCT 111111111111 1= FENCE) • (4) IXARGI • (5) lXARG2 • ETC • IN+41 = OCT 111111111111 • BCl 1,SETSBV SETSBV SXD lOCATE-4,1 ClS K2 TSX EXCHQR,l • COUNT ARGUMENTS INARGS=COUNT-2). TSX SKIP,l lXD lOCATE-2,4 SUB K2 PAX 0.2 XR2=NARGS • SET SUBRUVll ••• 3) ClA. 1.4 6HSUBROU STO. 2,4 ClA 2.4 AISUBRUVll» SUB Kl STA STONRG AISUBRUV(2») SUB Kl STA STOFNS AISUBRUV(3») STA STOIXA ClA FENCE STOFNS S T O . . ..=AISUBRUV(3) I PXO 0,2 STONRG S T O . . ..=AISUBRUV(21)=AINARGS) • THEN FIll IN SUBRUV(4 ••• NARGS+3), IF NARGS NOT = o. SXO TXlCAl,2 AXT 1.2 SR2 STORES SUBRUVI4,5, ••• 1 TZE BAKFNS lOC lOCATE-2,1 AITSX SSETSBV,4) TXI .+1.1.3 SXA CAlTRG.1 AXT 0,1 XRl PICKS UP TSX ARGI. TSX ARG2, ••• CAlTRG CAL •• ,1 •• =AITSX ARG1,01 ANA MSK3 EXTRACT ADDRESS SSM AND ADO KCOMPI CONVERT AlS 18 STOIXA STO ••• 2 •• =AISUBRUV(3» TXI .+1.1,-1 TXI .+1.2,1 TXlCAl TXl CAlTRG.2... ..=NARGS • ADO THE FINAL FENCE AT SUBRUVINARGS+4) AND EXIT. BAKFNS ClA FENCE IPAGE 21) 1488 1489 1490 1491 1492 1493 1494 1495 1496 1491 1498 1499 1500 1501 1502 1503 1504 1505 1506 1501 1508 1509 1510 1511 1512 1513 1514 1515 1516 1511 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1531 1538 1539 1540 1541 1542 1543 1544 1545 1546 1541 1548 1549 1550 1551 1552 1553 1554 1555 1556 1551 1558 1559 1560 1561 1562 •••••••*••••••••• •••••• ~ • • LOCATE •••••••••••••••••••••••• PROGRAM LISTINGS IPAGE 22) STOTRA • - • ••••••••••••••••••••••• • • LOCATE • ••••••••••••••••••••••• (PAGE 22) STOIXA SklPEX - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY SETUPILOCALL,NARGS,XR1,XR2) - SETUP SETS LOCALL, XR1, XR2 FROM FIRST SXD X.4. SXD Y.1. SXD Z,2 ENCOUNTERED IN FRONT OF THE TSX $SETUP.4 • 8CI I, SETUP SETUP SXD LOCATE-4.1 CLA k4 EXCHQR,l TSX • FIRST GET ANO SET XR1. XR2. LOCALl=-XR4 1,2 AXT TSX FNDXRS.1 STO. 3,4 XR1 TSX FNDXRS.1 XR2 4.4 STOTSX FNDXRS,l PDC 0.1 0,1 PXD STO. 1,4 LOCAll 0,4 PDC -LOCALL TO XR4 FOR NARGS COUNT .. THEN GET NARGS AND EXIT SklP,l TSX AlS 18 NARGS TO DECREMENT LXD LOCATE-2,4 2,4 NARGS STO" TRA SklPEX ..•• XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX •.. ENTRY RETURNILOCAlL.XR1,XR2) RETURNS CONTROL TO NEXT STATEMENT FOLLOWING TSX $SU8,4 AT LOCALL RESTORES XRl AND XR2 IFROM DECREMENTS) • • BCI RETURN SXD CLA TSX CLA. STD CLA. PDX CLA. PDC TRA 1 ,RETURN LOCATE-4,l k3 EXCHQR,l 2.4 lOCATE-4 3,4 0,2 1.4 0.4 SPCLEX XR1 ISAVED FOR SPCLEX TO RESTORE) XR2 lOCALL ".. •.. "• .• XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY XINDEXCLOCALl.NUMARGJ XINDEX FUNCTION SETS AC • INDEX WRT COMMON OF ARGUMENT NO. NUMARG WHERE LOCAll = AITSX $SU8ROU.4). NUMARG MAY BE NEGATIVE. BCI XINDEX SXD TSX ClA SSM ADO AlS EXITF LXD TRA . •• - 1.XINDEX lOCATE-4,1 GETSXZ.1 TEMP kCOMPl 18 LOCATE-4,1 1.4 XXXXX ENTRIES ARGllOCALL,NUMARG,IXVECT) AND XARGILOCALL,NUMARG.IXVECT) • ARG FUNCTION AND XARG FUNCTION SET AC = CIADDRESS PORTIONILOCAlL+NUMARG)-IXVECT+1) .• ARG XARG BCI EQU SXD l,ARG - LOCATE-4.1 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 •••••••••••••••••••••••• e PROGRAM LISTINGS • LOCATE IPAGE 23) IPAGE 231 GETSXl,1 e+l •• ".=AIARGI EXITF .•• XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX • ENTRY STORECARGU.LOCALL,NUMARG,IXVECTI • STORE PUTS ARGU IN THE REGISTER WHOSE ADDRESS .. = ADDRESS PORTION ILOCALL+NUMARGI -IXVECT +1 • 1,STORE BCI STORE SXD LOCATE-4,1 K4 CLA TSX EXCHOR,I - SET UP 77715, AC, MO FOR GETSXl CLA. IXVECT 4.4 STO 32165 CLA. LOCALL 2.4 3.4 NUMARG LDO" TSX GETSXl,1 STA "+2 CLA. ARGU 1.4 STO n=STORAGE ADDRESS FOR ARGU •• TXI EXITF.4.-4 • • .. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY XNARGSILOCALLI • • XNARGS FUNCTION LEAVES .. AC NO. OF ARGUMENTS RELATIVE TO LOCALL .. -1 IF LOCALL NOT = TSX X,4 . BCI I,XNARGS XNARGS SXD LOCATE-4.1 SXD LOCATE-2,4 PDC 0.4 .. CHECK FOR TSX X,4 AT LOCALL CAL 0,4 TSX CKTSX4,1 TRA CNTRGS CLS KDl LXDN LXD LOCATE-2,It TRA EXlTF .. THEN COUNT ARGUMENTS AND LEAVE SKIP,1 CNTRGS TSX TRA LXDN .- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY XNAMEIHNAMEl,HNAME21 " .. .. FORTRAN FUNCTION COMPARING TWO HOLLERITH NAMES .. AC=+O IF SAME, =-1 IF DIFFERENT ... LEFT ADJUST THE TWO NAMES AND THEN COMPARE I,XNAME BCI XNAME SXD LDCATE-4,1 STO TEMP2 ADJUST,1 TSX STO TEMP3 LDQ TEMP2 AOJUST,I TSX XCA TEMP3 CAS TRA "+2 TRA SAME • SET AC NEGATIVE IF DIFFERENT CLS KDl TRA -+2 .. SET AC=O IF THE SAME SAME CLA KO TRA EXITF .. - . LOCATE • ••••••••••••••••••••••• •••••••••••••••••••••••• TSX STA CLA TRA • ••••••••••••••••••••••• • 1638 1639 1640 1641 1642 1643 1644 1645 1646 1641 1648 1649 1650 1651 1652 1653 1654 1655 1656 1651 1658 1659 1660 1661 1662 1663 1661t 1665 1666 1661 1668 1669 1610 1611 1612 1613 1674 1675 1616 1677 1678 1619 1680 1681 1682 1683 1681t 1685 1686 1681 1688 1689 1690 1691 1692 1693 1691t 1695 1696 1697 1698 1699 1700 1701 1102 1103 1104 1105 1706 1707 1108 1109 1710 1711 1712 •••••••••••••••••••••••• .•••••••••••••••••••••••• . LOCATE ••••••••••••••••••••••• .••••••••••••••••••••••••• . LOCATE PROGRAM LI STINGS (PAGE 24) (PAGE 24) ... SAVES .. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX INTERNAL SUBROUTINE EXCHOR INDEX REGISTERS 2 AND 4 AND CHECKS FOR LEGAL ARGUMENT COUNT .. FOR AN ILLEGAL COUNT IT .. 1. SETS AC = 6H(NAME OF ENTRY INVOLVED) .. 2. SETS MO : NO. ARGUMENTS (IN ADDRESS) .. 3. SETS XR4 : MACHINE ADDRESS OF ILLEGAL CALL STATEMENT .. 4. STOPS ON HPR 77777 .. IF RESTARTED IT WILL RETURN CONTROL TO CALLING PROGRAM ... ... ... . LINKAGE WITH XRl (RETURN TO I,ll ASSUMES AC AODRESS) : LEGAL COUNT IF POSITIVE (MAY BE ZERO) : MINIMUM LEGAL COUNT IF NEGATIVE ASSUMES 0,4 : CALLING STATEMENT ASSUMES -3,1 : BCI 1,(NAME OF ENTRY) USES TEMP4, TEMP5, AND INTERNAL ROUTINE SKIP EXCHOR SXD SXD SXA LDO LOCATE-3,2 LOCATE-2,4 SAVI0,1 Kl TEMP4 ·+2 TEMP4 STl TEMP4 IS SWITCH TPL (ZERO FOR EXACT COUNT) STO SSP STO TEMP5 SKIP,l TSX CAS TEMP5 TEMP4 ZET TRA SAVIQ .. FOR IllEGAL COUNT SET UP MO, XR4, AC, AND PAUSE XCA LOCATE-2,4 LDC LXA SAVI0,1 -3,1 CLA HPR 32767 .. GENERAL EXIT FUNNEL USING SKIP SKIPEX LXD LOCATE-3,2 LXD LOCATE-2,4 SPCLEX TSX (USED BY RETURN) SKIPtl LXD LOCATE-4,1 TRA 1,4 .. GOOD COUNT SAVIO AXT **,1 LXD LOCATE-2,4 TRA Itl .. .. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX INTERNAL SUBROUTINE SKIP .. ... SKIP TO NEXT TSX,4 OR TO NON-SPECIAL INSTRUCTION, WHICHEVER FIRST .. LINKAGE WITH XRl, XR2 UNCHANGED .. ASSUMES 1,4 IS FIRST LOCATION TO BE CHECKED .. LEAVES AC : NO. TSX X,O INSTRUCTIONS PASSED THRU (IN ADDRESS) .. STOPS WHEN FINDS AN INSTRUCTION .. 1. WHICH: TSX X,4 .. OR 2. WHICH IS NOT:TSX X,O INTR,PZE PAIRS IGNORED) .. LEAVES MQ: PLUS FOR CASE 1., MINUS FOR CASE 2. .. LEAVES 1,4 TSX X,4 FOR CASE 1. .. = 1 BEYOND LAST TSX OF EITHER KIND FOR CASE 2. .. IBUT WONT BACK UP PAST ORIGINAL 1,4) .. EXAMPLES • SUPPOSE ON INPUT 0,4=TSX A.B WHERE B IS ARBITRARY .. LET NSI:NON SPECIAL INSTRUCTION,ANY=ANY INSTRUCTION,X,Y ARBITRARY .. THEN SAMPLE OUTPUT SETTINGS OF XR4 ARE .. .. ... .. .. CASES WITH NO TSX X,O FOUND 0,4 1,4 TSX A,B NSI TSX A,B NTR PZE NSI TSX A.B TSX X,4 ANY TSX A,B NTR PZE TSX X,4 ANY 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 .. ..•••••••••••••••••••••••• LOCATE ........................ • ••••••••••••••••••••••• • LOCATE • •••••••••••••••••••••••• PROGRAM LISTINGS (PAGE 25) (PAGE 251 .... CASES WHERE ONE TSX X,O FOUND • • • • • • • SKIP 0,4 1,4 TSX A,B TSX X,O NSI TSX A,B TSX X,O NTR PZE NSI TSX A,B TSX X,O TSX Y,4 ANY TSX A,B TSX X,O NTR PZE TSX Y,4 ANY SXA SV2S,2 SXA SV1S,1 TXI .+1,4,-1 SXD TXLSKP,4 TXI .+1,4,1 AXT 0,2 XR2 WILL COUNT NO. INSTRUCS=TSX X,O • FIRST CHECK FOR TSX X,O CALS CAL 1,4 TSX CKTSXZ,l TRA NOTSX • IF SO, INDEX, TSX X,O COUNTER AND CONTINUE SCAN TXI •• 1,2,1 • GO 8ACK BACKS TXI CALS.4,-1 • IF NOT TSX X,O CHECK FOR NTR X,O,Y • GO BACK IF IT IS, BUT DONT INDEX COUNTER NOTSX ANA MSK2 KNOCK OUT DECReMENT ALSO LAS NTR TRA ELSE TXI 8ACKS,4,-1 • CHECK FOR TSX X,4 WHEN ALL OTHER POSSIBLITIES FAIL ELSE CAL 1,4 (WE LOST THE DECREMENT) TSX CKTSX4,l TRA T4 (YES) • FOR NON-SPECIAL INSTRUCTION 8ACK UP TILL O,4 a ANY KIND OF TSX • (FIRST SET MQ NEGATIVE) LDQ MSKI BACKl CAL 0,4 TSX CKTSXA,I TRA •• 2 TRA EXITS GOT IT TXLSKP TXL .+2,4... ..=ORIG XR4-1 TRA EXITS TXI BACK1.4,l • SET MQ POSITIVE FOR TSX X,4 AND EXIT T4 LDQ K1 • SET AC=ND. TSX X,O INSTRUCTIONS AND RETURN EXITS PXA 0,2 SVlS AXT •• ,1 SV2S AXT •• ,2 TRA 1,1 • • • XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX INTERNAL SUBROUTINE ADJUST • • • LEFT ADJUST THE CONTENTS OF MQ AS HOLLERITH • LINKAGE XRl • RESULT IN MQ 1=606060606060 IF ALL SPACES) • AC LEFT=O • ADJUST SXA ALEVE,2 AXT 0,2 XR2 COUNTS NO. SPACES • CHECK SPACE CLAA CLA KO LGL 6 CAS K48 TRA .+2 TRA SPAFND • BACK PEDAL 1 AND LEAVE IF NOT SPACE LGR 6 * LEAVE ALEVE AXT **,2 TRA 1,1 • INSERT A SPACE IN MQ AND CHECK FOR 6 SPAFND TXI .+1.2,1 17B8 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 •••••••••••••••••••••••• • • LOCATE •••••••••••••••••••••••• PROGRAM LISTINGS • (PAGE 26) • • • •• .. STO CAL ACL LGR TXL TRA (PAGE 26) TEMP TEMP K48 36 CLAA,2,4 ALEVE XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX INTERNAL SUBROUTINE CNVTAC FORMS TSX A(ARGI,O IN AC (FOR CALL2 ONLY) LINKAGE WITH XR4 (RETURN TO 1,4) •CNVTAC ARS ANA SSM ADD ADO TRA 18 MSK3 KCOMPI TSX 1,4 . • .• XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .. .. • .. • .. • •FNOXRS STA ANA lAS TRA TXI TXI CLAFXR ClA SV4FXR AXT TRA .. .•• INTERNAL SUBROUTINE FNDXRS FNDXRS FINDS FIRST SXD X,Y IN FRONT OF 0,4, AND THEN LEAVES CONTENTS OF X IN AC Y IS CONTROLLED 8Y XR2 (1 IMPLIES 1),(2 IMPLIES 2), (3 IMPLIES 4) LINKAGE WITH XR1 XR4 IS lEFT UNDISTURBED XR2 IS lEFT INCREMENTED BY 1 SXA CAlFXR CAL SV4FXR,4 -1,4 CLAFXR MSKI SXD1+1,2 ·+2 ClAFXR,2,1 CAlFXR,4,1 POSSI8LE SXD X,Y •• •• ,4 1,1 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX INTERNAL SUBROUTINE GETSXl GETSXl SETS TEMP (ADDRESS) • = ADDRESS PORTION OF C(LOCAlL+NUMARG) • SETS AC (ADDRESS) = DITTO-IXVECT+1 • LINKAGE WITH XR1 • ASSUMES AC lOCALL, MO s NUMARG, 77775 IXVECT • GETSXl STO ADD ARS STA CAL ANA STO AlS SUB ADO ARS TRA •. TEMP TEMP 18 .+1 •• **=AITSX X,O) MSK3 TEMP 18 32765 KD1 18 1,1 • XXXXXXXXXXXXXXXXXXXXXXXXXX INTERNAL SUBROUTINES CKTSX4, CKTSXA, CKTSXl • • CHECK LOGICAL WORD IN AC, RETURNING AS FOllOWS • CKTSX4- 1,1 IF AC TSX X,4 ,2,1 • CKTSXA- 2,1 IF AC TSX X,ANYTHING, 1,1 • CKTSXZ- 2,1 IF AC TSX X,O 1,1 .. CKTSX4 ANA LAS MSK1 TSX4 • LOCATE • ••••••••••••••••••••••• •••••••••••••••••••••••• KNOCK OUT ADDRESS IF NOT IF NOT IF NOT 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 •••••••••••••••••••••••• PROGRAM LISTINGS LOCATE "•••••••••••••••••••••••• " •. IPAGE 271 2,1 1,1 2,1 MSK4 ·+2 MSK1 TSX 1,1 2,1 1,1 KNOCK OUT ADDRESS AND TAG • XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX TABLE OF CONSTANTS • • KTABLE KO Kl K2 K3 K4 K48 KDl KD2 KD3 K04 KD5 KD6 KCDMPI KS2LXD MSKI MSK2 MSK3 MSK4 FENCE TSX TSX4 • • " • " SXDI NTR TRAZ PlE PlE PLE PlE PLE PlE PZE PLE PlE PlE PZE PIE PZE OCT OCT OCT OCT OCT OCT OCT TSX TSX SXD SXO SXD OCT TRA TTR TTR "• •" USEO ONLY BY LOCATE TO DIMENSION KEY TABLE 1 2 3 4 48 0,0,1 0,0,2 0,0,3 0,0,4 0,0,5 0,0.6 000000077462 010000000000 777777700000 700000700000 000000077777 777777000000 777777777777 0,0 0.4 0.4 0,2 0,1 100000000000 0.0.0 (a 1 SPACE IN BITS 30-35) ADDRESS OF COMMON BLOCK PLUS 1 o XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX TABLE OF VARIABLES KEYS NKEYS NXKEY KOVER IXKEY TRA SUBROU lOC TEMP TEMP2 TEMP3 TEMP4 TEMP5 ICALL • 14 o BSS PIE PZE PZE PZE PZE PZE TRA PZE PZE PZE PZE PZE PLE PZE PIE 12 ." ." o 1 o ."". •• (ETC UPWARDS) •• =XR4 FROM SECOND CALL LOCATE ".=XR4 FROM FIRST CALL LOCATE (AND 15THI ."=NO. KEYS PRESENTLY IN TABLE ".=INDEX OF NEXT KEY TO BE INSERTED IN TABLE ."=OINORMAL),=IIMORE THAN 14 CALL LOCATES) ""=INDEX OF KEY ABOUT TO BE USED ".=6HSUBROU 0.0 ..... ...". 0.0,." "" •• •• XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX END • LOCATE • ••••••••••••••••••••••• (PAGE 271 TRA TRA TRA CKTSXA ANA TRA CKTSXl ANA LAS TRA TRA TRA •••••••••••••••••••••••• • END 193B 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 .......................... . - PROGRAM LISTINGS , lSHFT •......................... • • " ·lSHFT •••••••••••••••••••••••• • lSHFT • f ••••••••••••••••••••••• lSHFT (FUNCTION) FAP LAST CARD IN DECK IS NO. 0071 0001 0002 COUNT 100 0003 LBL LSHFT 0004 lSHFT (N,X) ENTRY 0005 ENTRY XLSHFT IN,X) 0006 0007 • ... ~~~ABSTRACT-- ... OOOB 0009 "• TITlE - LSHFT 0010 • LOGICAL SHIFT FUNCTION 0011 0012 lSHFT RERFORMS A LOGICAL RIGHT OR LEFT SHIFT OF A WORD. 0013 0014 " XlSHFT PERFORMS THE SAME OPERATION. 0015 0016 - FAP FUNCTION (FORTRAN II COMPATIBLE) 0017 " LANGUAGE 0018 • EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) - 12 REGISTERS 0019 " STORAGE - ABOUT 25 MACHINE CYCLES. 0020 • SPEED - R.A. WIGGINS JUlY,1963 0021 • AUTHOR 0022 --,..-USAGE--0023 0024 • TRANSFER VECTOR CONTAINS ROUTINES - NONE 0025 • AND FORTRAN SYSTEM ROUTINES - NONE 0026 0027 "" FORTRAN USAGE 002B • Xl LSHFTFIN,XI 0029 0030 • 11 = XlSHFTFIN,XI 0031 "" INPUTS 0032 0033 N IS THE NUMBER OF PLACES TO BE SHIFTED. 0034 IF GRTHN 0 SHIFTING IS TO THE RIGHT. 0035 " IF LSTHN 0 SHIFTING IS TO THE lEFT. 0036 MUST BE GRTHN= -35, LSTHN= 35 0037 " 0038 " x IS WORD TO BE SHIFTED. 0039 NEEO NOT HAVE FLOATING POINT NAME. 0040 0041 0042 • OUTPUTS 0043 " Xl IS THE SHIFTED WORD 0044 " 0045 " Il IS SAME AS Xl. 0046 " 0047 "" EXAMPLES 0048 0049 0050 • 1. INPUTS - N=6 X OCT 774200011201 • OUTPUTS - X1= OCT 007742000112 0051 0052 "" 2. INPUTS - N=-6 X = OCT 774200011201 0053 " OUTPUTS - Xl: OCT 420001120100 0054 0055 "" PROGRAM FOllOWS BELOW 0056 0057 XlSHFT BSS 0058 0 lSHFT ARS IB 0059 STA SFTR 0060 STA SFTl 0061 CLM 0062 TPL 0063 SFTR SFTl LGl 0064 •• TRA 0065 ·+2 SFTR LGR 0066 •• 0067 llS 0 0068 lGL 36 TOV 0069 ·0+1 TRA 1,4 0070 END 0071 9/29/64 • •" • • • " " • " • • • • • • = •• * •••••••• ~ •• * •••• ~ •••• • lSllNE • •••••••••••••••••••••••• PROGRAM LI STINGS •••••••••••••••••••••••• • lSllNE • LSllNE (SUBROUTINEl 10/1/64 lAST CARD IN DECK IS NO. LABEL ClSllNE SUBROUTINE ~SlINE IYY.lY~XMIN.XMAX.CO.Cll C C -~--ABSTRACT---C C TITLE - LSllNE C lEAST-SQUARE LINE C C lSlINE FITS A lINE TO AN EQUAllY SPACEO INPUT SIRlES BY C lEAST-SQUARES. THAT IS, GIVEN AN EQUAllY SPACED DATA C SERIES YIXMINJ ••• VIXMAXl, lSllNE FINDS THE COEFfICIENTS C CO AND Cl SO THAT C 2 2 C (Y(XI'IINl-CO-CI-XMINI + ••• + (Y(XMAXI-CO-CHXMAX) C C IS A MINIMUM. C C lANGUAGE - FORTRAN II SUBROUTINE C EQUIPMENT - 709 OR 7090 IMAIN FRAME ONlYl C STORAGE - 117 REGISTERS C SPEED - ABOUT 380 MACHINE CYCLES ON 709 (lESS ON 7090) C AUTHOR - R.A. WIGGINS C C ----USAGE---C C TRANSFER VECTOR CONTAINS ROUTINES - NONE C AND FORTRAN SYSTEM ROUTINES - NONE C C FORTRAN USAGE C CAll lSlINEIVV,lV,XMIN,XMAX,CO.C11 C C INPUTS C C VVIII I=l ••• tV CONTAINS THE DATA POINTS VIXMIN) ••• VI~MAXI FOR C AN EQUAllV SPACED SERIES. C C lV MUST EXCEED ONE. C C XMIN IS THE X COORDINATE CORRESPONDING TO YY(II. C C XMAX IS THE X COORDINATE CORRESPONDING TO YYIlY). C C OUTPUTS C C CO IS THE FIRST COEFFICIENT FOR THE BEST lEAST-SQUARE LINE. C C Cl IS THE SECOND COEFFICIENT. C THUS. THE lINE IS GIVEN BY CO + C1.X. C C EXAMPLES C C 1. INPUTS - LV = 5 YYll ••• 51 = 2.,3 •• 4.,5.,6. C XMIN 2. XMAX = 6. C OUTPUTS - CO = O. Cl = 1. C C 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT XMIN t O. XMAX ~ 4. C OUTPUTS - CO = 2. Cl = 1. C C 3. INPUTS - SAME AS EXAMPLE 1. EXCEPT XMIN • -1. XMAX = 7. C OUTPUTS - CO = 2.5 Cl = .5 C DIMENSION YYII0) XlV=lY DElX IXMAX-XMIN)/IXlV-l.1 X=XMIN-OElX SMX=O. SMXX=O. SMY=O. SMXY=O. 00 10 I=l.lY X=X+OELX SMX=SMX+X SMV=SMY+YVIll = • •••••••••••••••••• ~ ••• * • 0081 0001 0002 0003 0004 OOO~ 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 OO~ 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 006~ 0066 0067 0068 0069 0070 0071 0072 0073 0074 •••••••••••••••••••••••• PROGRAM LISTINGS lSllNE * * •••••••••••••••••••••••• (PAGE 2) 10 SMXX=SI'XX+X*X SMXY=SMXY+X*YYII) OEN = XlY.SMXX-S"X*S"X CO = (SMY*SMXX-SI'XY.SMXI/OEN C1 = (XlY*SMXY-SI'X*S"YI/OEN RETURN END _•••••••••••••••••• ** ••• • lSllNE * •••••••••••••••••••••••• (PAGE 0015 007b 0017 0078 0079 0080 0081 21 ·........................ ' .. lSSSl .. PROGRAM LISTINGS •••••••••••••••••••••••• lSSSl (SUBROUTINE) 9/29/64 .. lABEL ClSSSl SUBROUTINE lSSSl (ll,AA,RR,GG,FF,AlP) 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 C C C C C C C C f .. f .....................~ ....... .. • lSSSI .. ••••••••• *•••••••••••••• LAST CARD IN DECK IS NO. 0115 0001 0002 0003 0004 ----ABSTRACT---0005 0006 TITLE - lSSSl 0007 LEAST SQUARE SHAPER BY SIDEWAYS ITERATION OOOB 0009 LSSSI PERFORMS A SIDEWARDS ITERATION OF A SHAPER FILTER 0010 FiK.LI (K REFERS TO THE K-TH ELEMENT IN A VECTOR OF 0011 lENGTH LI TO CORRESPOND TO A SIMILAR ITERATION OF A 0012 CROSSCORRELATION VECTOR G(K). THAT IS, GIVEN A VECTOR 0013 FiKfll THAT SATISFIES THE EQUATIONS 0014 0015 FIL,U"RIOI + GCL-ll 0016 0017 + FCl,U"RIl-21 " GIL-21 0018 + 0019 0020 .. GIO) 0021 0022 AND AiK1L-lJ AND AlPIO,L-1) THAT CORRESPOND TO RITI tAS 0023 GIVEN BY RLSPRI THEN LSSSI COMPUTES THE VECTOR F1IK.l) 0024 WHICH SATISFIES 0025 0026 FlIL,Ll-RIO) 0027 + ••• + F1C1~L)"R(l-11 - GIL-2J 0028 0029 0030 F1Il,ll"R(-L+11+ ••• + = GI'-11 0031 0032 SEE SUBROUTINE RLSSR FOR AN INTERPRETATION OF RtK) AND 0033 GIK). 0034 0035 LANGUAGE - FORTRAN II SUBROUTINE 0036 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0037 0038 STORAGE - 122 REGISTERS 0039 SPEED - ABOUT .000210"L + .00019 SECONOS ON THE 7094 MOD I • AUTHOR 0040 - R.A. WI6GINS 3/63 0041 0042 ----USAGE---0043 TRANSFER VECTOR CONTA I NS ROUTINE - FOOT 0044 AND FORTRAN SYSTEM ROUTINE - NONE 0045 0046 0047 FORTRAN USAGE 0048 CALL LSSSI lLL,AA,RR.GG,FF,ALPI 0049 0050 INPUTS 0051 =L IS THE LENGTH OF A, R, AND F VECTORS. 0052 LL 0053 MUST BE GRTHN=2 0054 I-1, ••• ,LL CONTAINS THE PREDICTION ERROR OPERATOR 0055 AACII AIO,l-l) THROUGH All-1,L-1). 0056 0057 RR( II 0058 I-I, ••• ,ll CONTAINS THE AUTOCORRELATION VECTOR RtOt 0059 THROUGH RIl-11. 0060 0061 GGII) I=l, •• ~,ll+1 CONTAINS THE CROSSCORRELATION VECTOR Gf-ll 0062 THROLGH GIL-ll. 0063 0064 FFII) I=l, •••• Ll CONTAINS THE SHAPER FILTER Fe1,ll THROUGH 0065 Fll,ll. 0066 0067 CONTAINS THE ERROR COVARIANCE AlP(O,l-ll ALP 0068 0069 OUTPUTS 0070 I=I, ••• ,ll CONTAINS THE SHAPER FILTER Fl(l~l) THROUGH 0071 FFII I 0072 FlIl,ll. 0073 •••••••••••••••••••••••• • PROGRAM liSTINGS • lSSSI • - ll"'O USAGE C C C C C C OUTPUTS C C 2. INPUTS C 10 Ll=2 RRll)=1.25,.5 GGll ••• 2)=0.,1. DIMENSION FF(2) DO 10 1=1,2 CAll RlSPR Ill,AA,RR,AlP) CAll RlSSR Ill,AA,RR,GG(2),FF,ALP) CALL lSSSlILl,AA,RR,GGll),FF,ALP) FFll ••• 2) = -0.381,0.9524 RRll ••• 51=1.25,.5,0.,O.,0. GGll ••• 9)=0.,O.,0.,0.,I.,0.,O.,0.,0. USAGE DO 10 1=1,5 CAll RlSPR IlL,AA,RR,AlP) CALL RLSSR Ill,AA,RR,GGI5},FF,AlP) 10 CONTINUE DO 20 1=1,4 J=5-I CAll lSSSlILl,AA,RR,GGIJ},FF,AlP) 20 CONTINUE OUTPUTS - Ll=5 AAll ••• 5)=1.000,-0.498,0.246,-0.117,0.041 FFll ••• 51=0.047,-O.117,O.246,-0.498,0.99' C C C C C C C C C C C Ll"O C PROGRAM FOLLOWS BELOW C DIMENSION AAII0),RRII0),GGII0},FFIIO) ll=Ll L2=Ll+2 FL=FFlll) DO 10 I=2,Ll J=l2-I K=J-l FF{JI=FF~KI-Fl.AAII) 10 20 • IPAGE 21 C EXAMPLES C C 1. INPUTS lSSSl • ••• _••••••••••••• **** •• •••••••••••••••••••••••• IPAGE •••••••••••••••••••••••• CONTINUE CALL FDOTlll-l,FFI2),RR(21,Cl1 F= (CClll-Clll ALP FFllI=F DO 20 I=2,Ll FFII)=FFII)+F*AAIII CONTINUE RETURN END 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 Ot11 0112 0113 0114 0115 2) •••••••••••••••••••••••• .......................... • MATINV PROGRAM LISTINGS • , • MATINV ISUBROUTINE) 9/29/64 it LABEL CMATINV SUBROUTINE MATINV (LA.A.B.SPACE.ERR) •••••••••••••••••••••••• • MATINV • •••••••••••••••••••••••• LAST CARD III DECK IS NO. 0078 0001 0002 0003 C 0004 -·--ABSTRACT---0005 C 0006 C C TITLE - MATINV 0001 C INVERSE OF A MATRIX 0008 C 0009 MATINV FINDS THE INVERSE OF AN N BY N DIMENSIONAL MATRIX. C 0010 C 0011 C LANGUAGE - FORTRAN II SUBROUTINE 0012 C EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY} 0013 0014 - 90 REGISTERS C STORAGE - ABOUT 33.N*N*N + 110.N*N + 163*N + 209 MACHINE CYCLES 0015 C SPEEO 01\; THE 7090. 0016 C - R.A. WIGGINS 2/63 0011 C AUTHOR 0018 C C ----USAGE---0019 C 0020 C TRANSFER VECTOR CONTAINS ROUTINES - SIMEQ 0021 C AND FORTRAN SYSTEM ROUTINES - NONE 0022 C 0023 0024 C FORTRAN USAGE C CALL MATINVILA.A.B.SPACE.ERR) 0025 0026 C C INPUTS 0027 0028 C LA IS THE DIMENSION OF ONE SIDE OF THE MATRIX. 0029 C C MUST EXCEED ZERO. 0030 C 0031 All) I=l •••• LA.LA IS A SQUARE MATRIX STORED CLOSELY PACKED 0032 C BY COLUMNS. I.E. 0033 C C All ••• LA) CONTAINS COLUMN 1. 0034 AILA+l ••• 2*LA) CONTAINS COLUMN 2. C 0035 C ETC. 0036 0037 C SPACEI I) IS COMPUTATIONAL SPACE NEEDID 0038 C I=1 ••••• LA*ILA+11 BY MATINV. C 0039 C 0040 0041 C OUTPUTS 0042 C BI II l=l ••• LA*LA IS THE INVERSE OF A. IT I S STORED BY 0043 C COLUMNS. CLOSELY PACKED. 0044 C 0045 C ERR =0. IF SOLUTION WAS SUCCESSFUL. 0046 C C =1. IF OVERFLOW OCCURRED. 0047 0048 =2 .. IF THE MATRIX A WAS SINGULAR. C 0049 C 0050 C EXAMPLES C 0051 A(1 ••• 4) C 1. INPUTS 2 0052 3.00. 1.20, 2.50. 1.10 - LA 3.67, -4.00, -8.33, 10.00 flCl ••• 41 0053 C OUTPUTS 0054 C A11 •••. 4) 3.00, 2.50, 1.20, 0055 C 2. INPUTS - LA = 2 1.10 3.67, -8.33. -4.00, 10.00 0056 C OUTPUTS Bl1 ••• 41 0057 C 0058 PROGRAM FOLLOWS 8ELOW C 0059 C DUMMY DIMENSION OF INPUT VARIABLES. 0060 C DIMENSION A(9).BI9),SPACEI12) 0061 0062 LAA=LA*LA 0063 LAl=LA+l 0064 C 0065 C MOVE A INTO B, AND CLEAR PART OF SPACE 0066 DO 10 l=l,LAA 0067 81 Il=AII) 10 SPACEIII=O. 0068 0069 C 0070 C SET UP A UNIT MATRIX IN SPACE. DO 20 I-1,LAA,LA1 0011 0072 20 SPACE I II-I. 0073 C 0074 C INVERT A •••••••••••••••••••••••• MATINV • •••••••••••••••••••••••• • (PAGE PROGRAM LISTINGS 21 0=1. CAll SIMEQ tlA,lA,lA,B,SPACE.D,SPACE(lAA+11,ERRI RETURN END •.•....•..• .•...•..••.. • MATINV • _..•••••...•.•.......... ~ (PAGE 0075 0076 0071 0078 21 •••••••••••••••••••••••• MATMLl * * •••••••••••••••••••••••• PROGRAM LI STINGS * MATMLl I SUBROUTINE) * FAP *MATMLl COUNT 100 LBL MATMLl ENTRY MATMLI ILA.A.B.C,MI * * * * * * * * * * * ** * * * * * * • * * * * * ** * * • * * * * * * * * * * * * * * • * * * * * * * * • * * * * * * ** ** •* * •••••••••••••••••••• ** •• * MATMLI * •••••••••••••••••••••••• 9/29/64 LAST CARD IN DECK IS NO. 0136 0001 0002 0003 0004 0005 0006 ----ABSTRACT---0001 0006 TITlE - MATMLl 0009 SQUARE MATRIX MULTIPLICATION 0010 0011 MATMLI MULTIPLIES TWO SQUARE MATRICES. A AND B. TO OBTAIN 0012 THE PRODUCT C. 0013 0014 0015 0016 A. BAND C ARE ASSUMED TO BE CLOSELY PACKED BY COLUMNS. 0017 0018 0019 LANGUAGE - FAP SUBROUTINE IFORTRAN II COMPATIBLE) EQUIPMENT - IBM 709 OR 7090 IMAIN FRAME ONLY) 0020 STORAGE - 61 REGISTERS 0021 - IF ZIFSTO=l. ABOUT IB*N*N*N + 9*N*N + 10*N + 66 0022 SPEED MACHINE CYCLES, 0023 0024 IF lIFSTO=O. ABOUT 18*N*N*N + 12*N*N + 10*N + 66 MACHI~E CYCLES ON THE 7090, 0025 0026 WHERE ZIFSTO=O. IF THE PRODUCT IS STORED IN THE OUTPUT AREA AND =1. IF THE PRODUCT IS ADDED TO THE D~TPUT 0027 AREA. 0028 AUTHOR - R.A~ WIGGINS 2/63 0029 0030 0031 ----USAGE--0032 0033 TRANSFER VECTOR CONTAINS ROUTINES - NONE AND FORTRAN SYSTEM ROUTINES - NONE 0034 0035 0036 FORTRAN USAGE CALL MATML1ILA,A,B.C.M) 0037 0038 0039 INPUTS 0040 LA IS THE LENGTH OF THE COLUMNS lOR ROWS) OF A, Bi ANO C. 0041 0042 IS FORTRAN INTEGER MUST BE GRTHN=I. 0043 0044 All) 0045 I=l ••• LA*LA IS A SQUARE MATRIX STORED BY COLUMNS. I.E. AII ••• LA) CONTAINS COLUMN 1. 0046 AILA+l ••• 2*LAI CONTAINS COLUMN 2. 0041 0048 ETC. 0049 I=l ••• LA-LA IS A SQUARE MATRIX STORED BY COLUMNS. 0050 BI II 0051 SEE ABOVE 0052 0053 M =0 THE CONTENTS OF C ARE SET TO ZERO BEFORE 0054 MULTI PLICATION. 0055 NOT =0 THE MULTIPLICATION IS ADDED TO THE PREVlOUS 0056 CONTENTS OF C. 0057 0058 OUTPUTS 0059 CII) 0060 I-I ••• LA*LA IS THE SQUARE MATRIX ISTDRED BY COLUMNS) 0061 THAT IS THE PRODUCT OF A AND B. 0062 0063 EXAMPLES 0064 BI1o •• 4) 0065 A(I ••• 4) = 1.,1 •• 2.,1. 1. INPUTS - LA22 0066 M = 0 0067 0068 OUTPUTS - CI1 ••• 4) = 4.,3 •• 11.,7. 0069 0070 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT M=l Cll ••• 4) 0071 0072 OUTPUTS - Cll ••• 41 = 5.,4.,12.,6. 0073 •••••••••••••••••••••••• MATMLl ••• *••••••• * ••••• •••• * ••• PROGRAM LISTINGS ~ 2) CPAGE IPAGE • PROGRAM FOLLOWS 8ElOW • HTR 8tl MAlMLl SXO SXA SXA CAL ADO Sf A CAL ADO STA CAL ADO STA STA Sf A CLA. STO STD XCA MPY AlS STO STO STO ClA. TNZ LXD Cl STl TIX LXD Tl LXD LXD A LDQ 8 FMP FAD C STO TlO TIX TIX LXD SXD TIX EX AXl AXT LXD TRA SXD Tl3 TRA Tl5 LXD TIX SXD LXO T20 TIX TRA no TIX TRA PZE LA pze LAA lAAl PZE LAA2 PZE END •••••••••••••••••••••••• MATMLl • ••••••••••••••••••••••••• 0 I,MATMll .-2,4 EX,l EX+l,2 2,4 =1 A 3,4 =1 8 4,4 =1 C C+l Cl 1,4 LA TlO LA 11 LAA lAAl lAA2 5,4 Tl LAA,4 •• ,4 Cl,4,1 LAA,l lAA,2 LAA,4 ••• 1 ••• 2 ••• 4 ••• 4 T30,l, •• TI5,1,1 LAA.l LAAI.1 TI3,2,1 •• ,1 ••• 2 MATMLl-2,4 6,4 LAA2.2 T20 LAAl,1 .+ 1,1,1 LAAl,l LAA2.2 A,4,1 EX A,2,1 EX SAVE INDEX REGISTERS. GET ADDRESS OF A. GET ADDRESS OF 8. GET ADDRESS OF C. GET lA AND SAVE. DETERMINE lA·lA DETERMINE MOOE OF M. SET C = O. LOAD INDEX REGISTERS. CENTRAL lOOP. A INDEXED 8Y ROWS. EXIT 8 INDEXED 8Y COLUMNS. 0014 0015 0016 0011 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 2) •••••••••••••••••••••••• MATML3 ••••••••••••••••••••••••* • PROGRAM LISTINGS • MATML3 (SUBROUTINE) 9/29/64 • LABEL CMATMl3 SUBROUTINE MATML3 IN,M.L,AA,BB,TRAN.CC.Ml) 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 C C C C C C C C C _••'.f ••••••••••. _••• _._ • MATML3 - f •••••••• -.-._ ••• _ •• _ ••• LAST CA«D IN DECK IS NO. 0104 0001 0002 0003 0004 0005 0006 TITLE - MATMl3 0001 N X M MATRIX BY M X L MATRIX MULTIPLICATION 0008 0009 MATML3 MULTIPLIES AN N X M MATRIX A BY AN M X L MATRIX B 0010 TO OBTAIN AN N X L PRODUCT MATRIX C. 0011 0012 M 0013 L L ( I ( I 0014 N (C) • I ) N A 0015 ( ) I BI M 0016 0011 I I 0018 I I 0019 A IS AS5UMMED TO BE STORED BY COLUMNS. B MAY BE STORED 0020 BY COLUMNS OR ROWS. 0021 0022 0023 LANGUAGE - FORTRAN II SUBROUTINE EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0024 STORAGE - 120 REGISTERS 0025 0026 SPEED - ABOUT (11B*M + 9BI*N + 141*L + lOB MACHINE CYCLES ON 0021 THE 1090. AUTHOR - R.A. WIGGINS 0028 3/63 0029 0030 ----USAGE---0031 TRANSFER VECTOR CONTAINS ROUTINES - DOTJ 0032 AND FORTRAN SYSTEM ROUTINES - NONE 0033 0034 0035 FORTRAN USAGE CALL ~ATML3tN.MjL,AA,BB,TRAN,CC,M11 0036 0031 0038 INPUTS 0039 0040 IS THE NUMBER OF ROWS IN A. N MUST BE GRTHN=l 0041 0042 M 0043 IS NUMBER OF COLUMNS IN A. 0044 IS NUMBER OF ROWS IN B (AFTER TRANSPOSITIONI 0045 MUST BE GRTHN=1 0046 0047 IS NUMBER OF ROWS IN B {AFTER TRANSPOSITIONI L MUST BE GRTHN=1 004B 0049 0050 AAIII I=I, ••• ,N*M CONTAINS THE MATRIX A STORED BY CO~UMNS. 0051 THAT IS CONTAINS COLUMN I OF A. 0052 AAll ••• NI 0053 AAIN*I ••• 2*NI CONTAINS COLUMN 2 OF A. 0054 ETC. 0055 0056 I=l, •• J,M*L CONTAINS THE MATRIX B STORED BY EItHER ROWS BBUI 0057 OR COLUMNS. 0058 0059 IF NCT = O. BB IS TRANSPOSED BEFORE MULTIPLICATION. TRAN 0060 IF = O. THE MULTIPLICATION IS MADE WITH B8 AS STORED. 0061 0062 Ml IF GRTHN 0 THE PRODUCT C IS ADDED TO TH~ VALUE OF C 0063 ON INPUT. 0064 IF LSTHN=O C IS CLEARED BEFORE MULTIPLICATION. 0065 0066 OUTPUTS 0067 006B I=l, •••• N*L CONTAINS THE MATRIX C STORED BY COLUMNS. CC { II 0069 0010 EXAMPLES 0071 0072 AA{1I=2. BBIlI=3. Ml:0 TRAN"'O. 1. INPUTS - N=l M=l L=l 0013 OUTPUTS - CCll'=6. 0074 •••••••••••••••••••••••• MATMl3 * * •••••••••••••••••••••••• (PAGE •••••• *.* •••• * •••• *.*~ •• MATMl3 * PROGRAM LISTINGS • •••••••••••••••••••••••• 21 C 2. INPUTS C - N=3 M=2 l=2 TRAN=O. C OUTPUTS - CCt1 ••• 6) C IPAGE AAll ••• 6) 1.,1.,3.,2.,1.,1. BBll ••• 4) 1.,5.,3.,1. CCl1 ••• 6) 6.,0.,0.,0 •• 0.,0. 11.,36.,8.,11.,52.,16. C C 3. INPUTS - SAME AS EXAMPLE 2. EXCEPT TRAN = 1. OUTPUTS - CCtl •• J6) = 7.,22.,6.,19.,54.,22. C C C PROGRAM FOllOWS BELOW C 5 6 1 10 20 DIMENSION AAII0),BBII0),CCII0) J3=0 lI=l IF !TRANI 5,6,5 Ll=ll l2=1 13=1I GO TO 7 ll=lI*M l2=M l3=1 00 20 1=I,ll,l2 J2=1 00 10 J=l,N J3=J3+1 CAll DOTJIM,N,AA(J),l3,BBII),CC(J3),Ml,1.) CONTI NUE CONTINUE RETURN END Ml ° 0075 0016 0071 007B 0019 0080 0081 00B2 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 2) ......... ......•.....•. PROGRAM LISTINGS ~ MATRA .............. ............• • - MATRA FAP • (SUBROUTINE) 9/29/64 -MATRA --• --•. . • - COUNT LBL ENTRY 100 MAIRA MATRA tA,N,M,ATRAN) ----ABSTRACT---- - TITLE - MATRA • MATRIX TRANSPOSE .. .. - -..-. •• ••••••••••••••••••••••• MATRA • •••••••••••••••••••••••• , LAST CARD IN DICK IS NO. 0176 0001 0002 0003 0004 0005 0006 0007 OOOB 0009 0010 0011 MATRA fINDS THE MATRIX TRANSPOSE OF A MATRIX WHICH HAS ITS ROWS CLOSELY PACKED. EQUIVALENCE OF INPUT AND OU.TPUT AREAS IS ALLOWED. DURING THE PROCESS OF TRANSROSITION, THE LOW ORDER BIT (BIT 36) OF THE DATA WORDS IS SET TO ZERO. LANGUAGE EQUIPMENT STORAGE SPEED .. AUTHOR - fAP SUBROUTINE (fORTRAN II COMPATIBLE) - 709 OR 7090 (MAIN fRAME ONLY) - 92 REGISTERS ABOUT (.000080 +OR- .000010)*N*M + .000200 S.CONDS ON THE 7094 MOD 1 WHERE N-M IS THE TOTAL NUMIER O~ ELEMENTS. - R.A. WIGGINS AND S.M. SIMPSON, 3/63 ---USAGE--- • TRANSFER VECTOR CONTAINS ROUTINES - NONE - . AND FORTRAN SYSTEM ROUTINES - NONE •• fORTRAN USAGE .... CALL MATRA - INPUTS •. AU) l=t, •• J,N-M IS THE N X M MATRIX TO BE TRARSPOSEDJ MATRIX IS ASSUMED TO BE STORED CLOSELY PACKED BY •.. COLUI'!NS. .... N IS NUMBER Of ROWS IN THE INPUT MATRIX. .. IS NUMBER OF COLUMNS IN THE OUTPUT MATRIX. MUST BE GRTHN=l ..•. M IS NUMBER OF COLUMNS IN THE INPUT MATRIX. ... IS NUMBER OF ROWS IN THE OUTPUT MATRIX. MUST BE GRTHN=l ~A,N~M,ATRAN) • .- OUTPUTS ATRANII) it • • • 1=1, •••• M.N IS THE M X N TRANSPOSEO MATRIX STORED CLOSELY PACKEO BY COLUMNS. THE LOW ORDER BIT HAS BEEN SEr TO ZERO. MAylBE EQUIVALENT TO All). • • •. EXAMPLES 1. INPUTS - N=li OUTPUTS - Md 2 AI1 ••• I0)=1.,2.,3.,4 •• 5.,6.,7.~B •• 9.j10 • ATRANI 1 •• ':10 1=1. ,6., 2.,7.,3.,8.,4.• ,9';.5. ,110. .... 2. INPUTS - N=1 OUTPUTS - 1'1=4 All ••• 4)=1.,2.,3.,4. ATRANll ••• 4)=1.,2.,3.,4. N=1 3. INPUTS OUTPUTS - 1'1"'1 All) ATRANIlI ..• • • • • • PROGRAM FOLLOWS BELOW • MATRA HTR HTR HTR BCI SXD SXO S){O o o o l,MATRA MATRA-4,l MATRA-3,2 MATRA-2,4 2. 2. THE 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 002B 0029 0030 0031 0032 0033 0034 0035 0636 0037 0038 0039 0040 0041 1)042 0043 0044 0045 0046 0047 004B 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 006B 0069 0070 0071 0072 0073 0074 •••••••••••••••••••••••• • PROGRAM II STINGS . MATRA (PAGE •••••••••••••••••••••••• MATRA • .. •••••••••••••••••••••••• •••••••••••••••••••••••• 2) IPAGE .. GET ADDRESSES OF A ANO ATRAN CAL 1,4 ADO =IB35 STA A CAL 4.4 sa AT! STA AT2 STA An ADO =1635 STA AT • GET NAND M AND ~TORE IN NSCALO AND MM. CLA" 2,4 TlE EXIT TMI EXIT ARS 18 STO NSCALD CLA.. 3,4 TlE EXIT TMI EXIT ARS 18 STO MM XCA MPY NSCALD XCA PAX ,1 TIX .+1,1,1 SXO ENDCC,l TXI .+1,1,1 • SET VDP,VLM, ANO ALS INSTRUCTIONS. AND NSCALD CAL =0771700177717 ANS VDP ANS VLM CLA MM ORA =0233000000000 FAD =0233000000000 ANA =0017000000000 ARS 9 DRS YDP ORS YLM POX ,2 SXA ALS,2 CLA NSCALD ALS ALS." ... =NO. BITS IN 1M) STO NSCALD .. PUT A.FLAG IN BIT 35 OF DATA AND MOVE TO OUTPUT AREA. A CAL ••• 1 .... =AORIA)+1 ORA =IB35 AT SLW ... ,1 .... =AORIATRANI+1 TIX Ad'! • .. TRANSPOSE THE OUTPUT • THE GENERAL SCHEME IS TO MOVE A WORD FROM 11 TO 12 • .. • 12 = 111N + XMOOF(11,N).M • THEN SET 11 •• = 12 AND REPEAT. WHEN WE LOOP BACK ON OURSELF WE SEARCH FOR A NEW BEGINNING 9DINT • UNTIL ALL TERMS ARE TRANSPOSEO. • • • BEGIN WITH 11=0 (FOR THE LOOP WE LET THE FIRST VALUE HAVE INDEX 0) AXT 1tl 0,4 AXT CLA *.,4 An LBT TXI AT 3,4.1 NWI STO TEMP SXD ECC,4 • GET NEXT INDEX NXTI LOQ =0 ,4 PXA VDP YOP NSCALO.O, .. • SID Tl STQ T KEEPS TOTAL COUNT KEEPS PRESENT LOCATION .... =ADRIATRAN) ".=NO. BITS IN 1M) 0015 0016 0011 0018 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 OIlO 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 2) .•••••••••••••••••••••••• MATRA ••••••••••••••••••••••••" (PAGE 3) PROGRAM LISTINGS ••••• * •••••••• ***** ••••• MATRA "•••••••••••••••••••••••• " IPAGE MM LOO VLM VLM T1.0,** "". NO. BITS IN IMI ADO T PAX ,4 .. EXCHANGE THE NUMBERS *.,4 All LOO "*·ADRIATRAN) CAL TEMP ANA -0777717171776 Al2 SLW **.4 * •• ADRIATRAN) TEMP STO TXI *+1,1.1 ECC TXH NXTI,4.** **.FIRST LOOP VALUE. .. IF NOT ALL VALUES HAVE BEEN TRANSPOSED, SEARCH FOR NEXT STARTING POINT EXIT,l ..... ENDCC TXH AT3.4,1 SRCH TXI MATRA-4. 1 EXIT LXD LXD MATRA-3.2 MATRA-2,4 LXD TRA 5,4 .. T PZE PZE Tl TEMP PZE MM PZE NSCALO PZE . END ". ... .. .. -MIIN ADDRESS) ...·NIIN ADDRESSI*2 EXPlNO.BITS IN!M» 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 31 •••••••••••••••••••• * ••• • MATRAI • PROGRAM LI SHNGS • MATRAI LAST CARD IN DECK IS NO. 0094 0001 0002 0003 0004 000.5 0006 • -----ABSTRACT---0001 0008 •.. TI TLE - MArRA 1 0009 • SQUARE MATRIX TRANSPOSE 0010 0011 • MArRAl TRANSPOSES A SQUARE, CLOSelY PACKED MATRiX. 0012 • 0013 •- LANGUAGE - FAP SUBROUTINE IFORTRAN II COMPATIBLE) 0014 .. EQUIPMENT - IBM 109 OR 1090 IMAIN FRAME ONLY) 0015 - STORAGE - 42 REGISTERS 0016 0011 • SPEED - ABOUT 11.LA*LA - 9-LA - 50 MACHINE CYCLES ON tHE 7090 • WHERE LA IS NUMBER OF ROWS OR COLUMNS IN THE ~ATRIK. 0018 .. AUTHOR - R.A~ WIGGINS 2/63 0019 0020 • ----USAGE---0021 • 0022 • TRANSFER VECTOR CONTAINS ROUTINES - NONE 0023 .. AND FORTRAN SYSTEM ROUTINES - NONE 0024 0025 • 0026 - FORTRAN USAGE .. CALL MATRAlILA,A) 0021 0028 .. INPUTS 0029 0030 • A III I=l ••• LA.LA IS A SQUARE, CLOSELY PACKED MATRIX. 0031 I.E. AI1 ••• lA) CONTAINS COLUMN 1, 0032 AIlA+l ••• 2.LA) CONTAINS COLUMN 2, 0033 • ETC • 0034 0035 LA MUST BE GRTHN=l. 0036 IS FORTRAN II INTEGER • 0031 0038 • 0039 • OUTPUTS 0040 • AlII l=l ••• LA.LA IS THE MATRIX STORED BY ROWS. 0041 I.E. Al1 ••• LA) CONTAINS ROW 1, 0042 AILA+l ••• 2*LAl CONTAINS ROW 2, 0043 ETC. 0044 • 0045 • 0046 • EXAMPLES 0041 • • 1. INPUTS - lA~2 Al1 ••• 4) = 1.,2.,3.,4. 0048 0049 • • OUTPUTS - A{1 ••• 4) = 1.,3.,2.,4. 0050 0051 0052 • PROGRAM FOllOWS BELOW 0053 HTR 0054 0 I,MATRAl BCI 0055 MATRAI SXD *-2,4 0056 SXA EX,l 0051 SXA EX-1,2 0058 ClA. 1,4 0059 GET STO lUI LA. 0060 STD T20 0061 ADD =1811 0062 STD T21 0063 LDQ LAA1 0064 MPY LAA1 0065 AlS 17 0066 STO LAA1 0061 2,4 CAL GET ADRIAI 0068 AOD =1 0069 STA A 0010 srA Al 0011 SJ.A A2 0012 STA 0013 A3 lOAD LXD LAAld 0074 . • . ... ... . .. •. . . • •••••••••••••••••••••••• •••••••••••••••••••••••• .. MATRAI ISUBROUTINE) • FAP -MArRA 1 COUNT 10'0 LBL MATRAI ENTRY MATRAl ILA,A) f ••••••••••••••••••••••• 9/29/64 ........................ , MATRAI • ••••••••••••••••••••••••• (PAGE PROGRAM II STINGS 2) A Al A2 A3 T20 T21 EX T25 no LAAI LXD TRA CLA LOQ STQ STO TIX LXO TIX AXT AXT lXO TRA SXD LXD TRA TlX TRA PlE END lAA1,2 T20 ··01 •• ,2 •• ,1 ••• 2 T30,1, •• LAA1,1 T25,1, •• ·.,1 • •• 2 MATRAl-2,4 3,4 lAAl,l LAA1,2 T20 A,2,1 EX INDICES. LOOP. (LA) ( LA+ll EXIT • •••••••••••••••••••••••• MATRAl • ••••••••••••••••••••••••• (PAGE 2) 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 ••• **.**.*.*.**.*.*.*.** MAXAB •• *.*.*** * •• ** •• ****** •• *. REFER TO MAXSN *** ••• *.***.************ * MAXABM ***.** •• * ••• *********.*. REFER TO MAXSNM PROGRAM LISTINGS •••••••• * ••••••••••••• ** • MAXAB * • •••••• ** ••••••• *** ••••• REFER TO MAXSN ••••• ** •••••••• ******.*. MAXABM * •••••• ** ••••••• *** •• * •••* REFER TO MAXSNM ............................ MAXSN • ............................ • • •.MAXSN • • •• • • • • • • • • • • • • • • • • • • • • • • • • •• • • • • • • ;, • • • • • • • • • • • •• • • • • • • • • • •• • • • • PROGRAM LISTINGS ... .........••......... •••••••••••••••••••••••• • _ NAXSN LAST CARD IN DECK IS NO. 0169 0001 0002 0003 COUNT 150 0004 LBL MAXSN 0005 ENTRY MAXSN fLX.X.XMAX1.1) 0006 ENTRY MINSN (LX.X.XMINl.l) MAXAB tLX,X,XMAX2,1) 0007 ENTRY 0008 ENTRY MINAB (LX,X,XMIN2.1) 0009 0010 ----ABSTRACT---0011 0012 TITLE - MAXSN , WITH SECONDARY ENTRY POINTS MINSN. MAXAB. AND MINAB 0013 FIND SIGNED OR UNSIGNED EXTREMAL VALUES OF A VECTOR. 0014 MAXSN FINDS THE MAXIMUM SIGNED NUMBER._ AND 1 TS INDEX, IN 0015 0016 A VECTOR OF NUMBERS IEITHER FIXED DR FLOATING POINT]. 0017 MINSN FINDS THE MINIMUM SIGNED NUMBER. 0018 0019 MAXAB FINDS THE MAXIMUM OF THE ABSOLUTE VALUES. 0020 0021 0022 MINAB FINDS THE MINIMUM OF THE ABSOLUTE VALUES. 0023 0024 LANGUAGE - FAP SUBROUTINE (FORTRAN II COMPATIBLE) 0025 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0026 STORAGE - 54 REGISTERS 0027 SPEED - APPROX. 14N MACHINE CYCLES, N LENGTH OF VECTOR 0028 AUTHOR - J.F. CLAERBOUT 0029 0030 ----USAGE---0031 0032 TRANSFER VECTOR CONTAINS ROUTINES - NONE 0033 AND FORTRAN SYSTEM ROUTINES - NONE 0034 0035 FORTRAN USAGE FOR MAXSN 0036 CALL MAXSN (LX,X,XMAXl,I) 0037 0038 INPUTS 0039 0040 XIII l=l ••• LX IS A VECTOR OF NUMBERS. 0041 MAY BE FIXED OR FLOATING POINT. 0042 0043 IS FORTRAN II INTEGER. LX 0044 MUST BE GRTHN=l. 0045 0046 OUTPUTS 0047 0048 XMAXI IS THE MAXIMUM SIGNED VALUE IN THE X VECTOR. 0049 0050 IS THE INDEX OF THE MAXIMUM SIGNED VALUE. 0051 I.E. XII) = XMAXI 0052 0053 FORTRAN USAGE FOR MINSN 0054 CALL MINSN ILX.X.XMINI.I) 0055 0056 SAME AS FOR MAXSN INPUTS 0057 0058 OUTPUTS 0059 0060 IS THE MINIMUM SIGNED VALUE IN THE X VECTOR XMINI 0061 IS THE INDEX OF THE MINIMUM SIGNED VALUE. 0062 0063 0064 FORTRAN USAGE FOR MAXAB 0065 CAll MAXAB llX.X,XMAX2.1) 0066 0067 SAME AS FOR MAXSN INPUTS 0068 0069 OUTPUTS 0070 0071 IS THE MAXIMUM ABSOLUTE VALUE IN THE X VECTOR. XMAX2 0072 NOTE THAT XMAX2 MAY BE NEGATIVE. 0073 MAXSN I SUBROUTINE) FAP 9/29/64 • .......................... ........................... • MAXSN (PAGE " ......................... • MAXSN • PROGRAM LISTINGS • •••••••••••••••••••••••• (PAGE 2) 2) • •• • • • •• • • • • • • • • IS THE INDEX OF THE MAXIMUM ABSOLUTE VALUE. FORTRAN USAGE FOR MINAB CALL MINA8 (lX,X,XMIN2.11 INPUTS SAME AS FOR MAXSN OUTPUTS XMIN2 IS THE MINIMUM ABSOLUTE VALUE IN THE X VECTOR. NOTE TNAT XMIN2 MAY 8E NEGATIVE. IS THE INDEX OF THE MINIMUM ABSOLUTB VALUEJ EXAMPLES • 1. INPUTS • • • • • • • • •* - X(t ••• IO) • -11.,-8 •• -5 •• -2.,1.,4., 1 • .,10 •• 13.':16. LX = 10 USAGE CALL MAXSN ILX.X,XMAX1.11I tAll MINSN CLX.X.XMINhI2) tALL MAXAB CLX.X.XMAX2.13' CALL MINA8 ILX.X.XMIN2.14) XMAXI '" 16. OUTPUTS 10 II 12 .. 1 XMINI =-11. 13 .. 10 XMAX2 = 16. 14 .. 5 XMIN2 1. • 2. INPUTS - XC1 ••• IO) i: -16':.-13 •• -10 ...-1 •• -4.,-1 •• 2 •• 5 •• 8..J.,lJl~ • lX 10 USAGE - SAME AS EXAMPLE 1. • • OUTPUTS XMAXI 11. 11 .. 10 • XMINI --16. 12" 1 • XMAX2 =-16. 13" 1 • XMIN2 .. -1. 14 '" 6 = = •* 3. INPUTS XCI ••• IO) .. -16.-13.-10.~7.-4.-1.2.5.8.11 - SAME AS EXAMPLE 1. USAGE XMAXI 11 11 10 OUTPUTS XMINI =-16 12 1 * XMAX2 =-16 13" 1 • XMIN2 .. -1 14" 6 • • • LX .. 10 = • MAXSN MINSN MAXAB MINAB START HTR 8CI CLA STO TRA CLA STO CLA STO ClA S,TO TRA CLA STO TRA CLA STO CLA STO CLA STO SXA SXD CLA. POX CLA ADO STA STA CLASTOCLA ALS 0 I.MAXSN MX USE .+3 MN USE NOP A-I SU8 A START MX USE ·+3 MN USE SSP A-I SBM A SV.l MAXSN-2.4 1.4 .1 2.4 =1 A+2 A 2.4 3.4 =1 18 0014 0015 0016 0011 0018 0019 0080 0081 0082 0083 0084 0081) 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 OlU 0114 0115 0116 OU7 ARRAY LENGTH TO IR1 GET TRIAL EXTREMUM SET CORRECT INDEX FOR TRIAL EXTRIMUM 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 • ••••••••••••• * •••••• _** MAXSN - - PROGRAM LISTINGS (PAGE 3) STO eLA. HTR HTR A USE HTR eLA STD. SXO TIX B eLA STOAXT SV TRA NOP NOP SUB SUB SSP SSP SBM SBM ~X TPL MN TMI INDEX BSS END LOOP (PAGE INOEX 3,4 0 *.,1 B •• ,1 3,4 INOEX,l LOOP,l,l INDEX 4,4 .*,1 5,4 0,1 0,1 B B 1 •••••••••••••••••••••••• MAXSN • •••••••••••••••••••••••• if •• a •••••••••••• _._._ •••• EITHER NOP OR SSP EITHER SUB OR SBM EITHER TPL OR TMI 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 3) •••••••••••••••••••••••• ............... MAXSHM _*-.......... PROGRAM LI STINGS •••••••••••••••••••••••• MAXSHM • .. ••• f . . . . . . . . . . . . . . . . . . . . ... .. MAXSNM «SU8ROUTINES. 9/4/64 LAST CARD IN DECKJS NO. 0246 0001 fAP -MAXSNM 0002 COUNT 206 0003 LBL MAXSNM 0004 ENTRY MAXSNM (fOfIJ,LI,LJ,IDIMEN,fMAXSN,IMAXSN,JNAXSN. 0605 MIHSNM CfOfIJ,LI,LJ,IOIMEN,fMINSN,IMINSN,JNINSNI ENTRY 0006 ENTRY MAXABM (fOfIJ,LI,LJ,IOIMEN,fMAXA8,IMAXAB,JMAXABI 0007 ENTRY MINABM (fOflJ,Ll,LJ,IDIMEN,fMINAB,IMIHAB,JNINA!1 0008 0009 0010 • ~---A8STRACT-~0011 0012 .. TITLE - MAXSNM, WITH SECONOARY ENTRIES MINSNM, MAXA8M. AND MINASM 0013 .. EXTREMAL VALUES Of MATRIX ELEMENTS 0014 0015 MAXSNM FINDS THE LARGEST ELEMENT OF A MATRIX. 0016 MIHSNM FINDS THE SMALLEST ELEMENT OF A MATRIX. 0017 • MAXABM FINDS THE ElEMENT WHOSE MAGNITUDE 15 lARGES1T,j 0018 MINA8M FINOS THE ELEMENT WHOSE MAGNITUDE IS SMALLEST. 0019 0020 THE FORTRAN INDICES OF THE EXTREMAL VALUE ARE ALSO 0021 GIVEN AS OUTPUTS. THE MATRIX ELEMENTS MAY 8E 'IXED 0022 OR FLOATING POINT • 0023 0024 .. LANGUAGE - FAP SU8ROUTINE, FORTR'AN II COMPATIBLE 0025 .. EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0026 - 61 REGISTERS 0027 • STORAGE .. SPEED - APPROXIMATELY 14N MACHINE CYCLES, WHERE N IS THE 0028 NUMBER OF ELEMENTS IN THE MATRIX • 0029 .. AUTHOR - S.M. SIMPSON, MARCH 1964 0030 (BASED ON THE VECTOR VERSION, MAXSN, BY J. ClAIRBOUT' 0031 0032 OOH 0034 0035 ----USAGE-..-0036 .. TRANSFER VECTOR CONTAINS ROUTINES - (NOT ANY) 0037 .. AND FORTRAN SYSTEM ROUTINES - (NOT ANYI 0038 0039 .. fORTRAN USAGE 0040 .. CALL MAXSNMtFOFJJ, LI, LJ, IDIMEN, FMAXSN, IMAXSN, ~MAXSN) 0041 .. CALL MINSNMfFOFJJ, LI, LJ, IOIMEN. FMINSN, IMINSN, JMINSNJ 0042 .. CALL MAXABM{FOFIJ, LI, LJ, IDIMEN. fMAXAB, IMAXAB, JMAXAB. 0043 .. CALL MINABMI·FOFJJ, LI. LJ, 10IMEN. fMINAB, IMINAB, JMINA8' 0044 0045 0046 .. INPUTS TO ALL ENTRIES 0047 0048 fOfIJ(I.J) l=l.J~LI, J=I ••• LJ IS THE MATRIX TO 8E SCANNED. ITS 0049 MODE MAY BE EITHER FLOATING POINT OR FIXED .O«NT ~ 0050 0051 MUST EXCEED ZERO INOT CHECKED). 0052 1I 0053 LJ MUST EXCEED ZERO INOT CHECKEO). 0054 0056 IDIMEN IS THE CALLER'S DIMENSION fOR THE INDEX IN 0056 FOFIJeI,J) • 0051 MUST BIf GRTHN= LI (NOT CHECKED). 0058 0059 0060 .. OUTPUTS fROM MAXSNM 0061 0062 fMAXSN IS A VALUE SELECTED fROM THE MATRIX SUCH THAT 0063 fMAXSN GRTHN= FOflJII,J) OVER l=l ••• LI. J=l ••• LJ. 0064 0065 .. IMAXSN, JMAXSN ARE INDICES FOR WHICH 0066 0067 .. FOFIJIIMAXSN,JMAXSN) = FMAXSN. 0068 0069 .. OUTPUTS FROM MINSNM 0070 0011 0012 IS A VALUE SELECTED FROM THE MATRIX SUCH THAT • fMINSN FMINSN LSTHN= FOfIJII,JI OVER I=l.J.LI; J~l.JJLJ~ 0013 0014 - -. .. ..... .. .. .. .. . .. .. . .. .... ... .... .... .. ... . .. .. . ... •••••••••••••••••••••••• • • • •• • • • • • • •• •• ••••••••••••••••••••••• MAXSNH • PROGRAM LISTINGS MAXSNM • ........................... IPAGE 2) • •••••••••••••••••••••••• I PAGE 2) IMINSN. JMINSN 'ARE INDICES FOR WHICH FOFIJIIMINSN.JMINSN) .. FMINSN. OUTPUTS FROM MAXABM FMAXAB IS A VALUE SELECTED FROM THE MATRIX SUCH THAT II FMAXAB II GRTHN= FOFIJCI.J) OVER l~l ••• LI, J"l ... lJ WHERE II II STANDS FOR ABSOLUTE VALUE. NOTE THAT FMAXAB MAY BE NEGATIVE. IMAXAB. JMAXAB • • • ARE INDICES FOR WHICH FOFIJeIMAXAB,JMAXAB) .. FMAXAB. • OUTPUTS FROM MINABM • • FMINAB •• IMINAB, JMINAB • • • .. • IS A VALUE SELECTED FROM THE MATRIX SUCH THAT II FMINAB II LSTHN .. FOFIJCI.J) OVER l=l ••• lf, .t=I ••• LJ • NOTE THAT FMINAB MAY BE NEGATIVE. ARE INDICES FOR WHICH FOFIJIIMINAB,JMINAB) .. FMINAB. • • CHOICE DF VALUES IN CASE OF DUPLICATE EXTREMAL! • • • • • FOR All ENTRIES THE ORDER OF SCANNING IS, IN TERMS OF THE INDICES I,J. LI ••• 1~1 lI ••• 1,2 ETC. ll ••• l.LJ IF THE EXTREMAL VALUE OCCURS MORE THAN ONCE THE tNDICES SELECTED FOR OUTPUT CORRESPOND EITHER TO THE fIRST OR TO THE LAST OCCURRENCE OF THE VALUE IN THIS SCAN ORDER, ACCORDING TO THE fO~lOWJNG TABLE. • ..• • • • • • •• • • • • • • • • • • • • • ..• • • • • • • • • • • • • • • • .. • 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 MAXSNM MINSNM MAXABM MINABM EXTREMAL POSITIVE FIRST LAST FIRST LAST EXTREMAL NEGATIVE LAST FIRST FIRST LAST EXAMPLES 1. INPUTS USAGE - FII ••• ),I ••• 3) = 5.,-2 •• 8 •• ~ DIMENSION FI5.3) 00 10 lJ=I.3 DO 10 LI=I.3 CALL MAXSNMlf, LI. LJ. JlILJ,lJll 1 CALL MINSNMIF. LI. lJ. J2ILI.LJ) ) 1 CAll MAXABMIF. lI, LJ. J3ILI,lJ)) 1 CAll MINABMIF, LI. lJ. 10 J4(LI.lJII 1 OUTPUTS - 2. INPUTS USAGE (FOR 1I flll ••• 3,l ••• 3) 111'1 ••• 3.1 ••• 3) JI( 1••• 3.1 ••• 31 F21·1 ••• 3.1 ••• 3) 1211 ••• 3.1 ••• 31 J211 ••• 3,l ••• 3) F311 ••• 3.1 ••• 3l 13110 •• 3.1 ••• 31 J311 ••• 3.1 ••• 31 F4fI ••• 3.1 ••• 3) 1411 ••• 3.1 ••• 31 J4(1 ••• 3.1 ••• 31 3 •• 2 •• 4 •• ~ -12 •• -1 •• -12. 5. FlILI.lJ). IlILhlJJ. 5, F2ILI.LJ), t20.. lotJ). 5. F31L1.LJ), I3IU,lJJ, 5. F4CLI,lJ). I4(thLJJ. 3,. 2 2 3" 5 •• 5 •• 8 ... ,5., 5 •• 8 ••• 1. 1. 3" 1. 1. 3,. 1. 1. h. 1. t. 1" .. 1. 1. = .. 5 1.•• 5 1.•• 3) 1 5 •• 2 Ii •• 8~ I. I. t. 3 I, t 5.,-2.,-2 •• ,3.,-2.,-2 •• ,-12 •• -12 •• -12. 3 1. 2. 2" 1. 2. 2 •• t. h = ,. = 3, J 3. 1" 2, 10 I,. 8.,,5., 5 •• 8 ••• -12 ••-1~ •• -12. 1, 3 1. 1. 1. 3 •• 1. 3 •• it 3 1., 1, I. 1 .. 3. 3. 2. , 5•• -2.,-2.,,3., 2 •• 2 ... , 3 •• 2. 1, 2 2. 2 •• 19 2. 1. 2. 2 •• 2, 2 2 .. 1. 1. 1 •• 2. 2 .. 2 •• IFt1 ••• 3.1 ••• 3) 5.-2.8 •• 3.2.4 •• -12.-5.-12 - SIMILAR TO EXAMPLE 1 •• REPLACING f BY If. Fl BY tFI. ETC. OUTPUTS - SIMILAR TO EXAMPLE 1., EXCEPT IFI. IF2, ••• WILL BE 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0121 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 •••••••••••• * ••••••• ** •• • PROGRAM LISTINGS MAXSNM (PAGE •••••••••••••••••••••••• 31 • • • • • • (PAGE FIXED POINT. PROGRAM FOllOWS BELOW NO TRANSFER VECTOR o HTR BCI • ENTRY~ MAXSNM ClA TRA •- SECOND ENTRY. MINSNM(fOFIJ,ll,lJ,IOIMEN,FMINSN,IMINSN,~MINSNt MN TEST NOP SUB MERGE STO CLA lOQ TRA - MAXSNM(FOFIJ.ll,lJ.IDIMEN,FMAXSN,IMAXSN,JMAXSNl MX MINSNM+1 *MINSNM ClA •- XR4 1,MAXSNM *• PRINCIPAL THIRD ENTRY. MAXAaM CLA TRA MAXABMtFOfIJ,lI,lJ,IOIMEN,FMAXAB,IMAXAB,JNAXAII MX MINABM+l - • fOURTH ENTRY. MINABM ClA S,TO ClA lOQ •• MINABMlfOFIJ,lI,lJ,IOIMEN,FMINAB,IMINAB,JMINAB) MN TEST SSP SBM FINISH SETTING UP THE lOOP INSTRUCTIONS. • MERGE • STO STQ SXD SXA SXA ClA ADO STA ClA' ARS STA SIGN DIH MAXSNM-2,4 lEAVE,l lEAVE+l.2 1,4 K1 DIf;f 4.4 1B 101M A(FOFIJI • lOOP SIGN DIFF TEST ClAa POX ClA. STO AXT TRA CLA"lOP NOP NOP • • REPLACE •ClAOIF TIX 2,10 0,1 3.4 TXl 1.2 ClAOIF 5.4 IDIMEN 1I lJ FMAXAB OR FMINAB OR ETC NOP OR SSP •• = A{FOFIJ)+l SUB.*,l OR SBM*'.1 TPl TIX OR TMI T1X OIH 5,10 0,1 6,4 0,2 7.10 lOOP,l,l • RESET FOR NEXT LINE • fOf I J { LI , 11 FMAXAB BY NEW TRIAL IF FAllS THRU TEST ClA' STD' PXO STO* PXO STO. TIX 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 01M 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 01B1 0182 0183 01B4 0185 0186 0187 01B8 0189 0190 0191 01"12 • SET XR2 TO COUNT J ~ 1,2 •••• ,lJ XRl TO COUNT I ~ ll.ll-l, ••• ,l • THEN ENTER lOOP SO THAT fIRST TRIAL IS SET • •••••••••••••••••••••••• MAXSNM • • ••••• * ••••••••••••••••••* NEW TRIAL STORED NEW STORED NEW J STORED (-JOIM •••• I 0193 0194 0195 0196 0197 019B 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0113 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 3) •••••••••••••••••••••••• (PAGE PROGRAM LISTINGS **._...•••.•••.•. MAXSNM •• *_ •••• * 4) CAL SU8 STA CLA* POX TXI TXL TXL LEAVE AXT AXT TRA OIFF 101M OIFF 2,4 0,1 *+1,2,1 LOOP,2.** SU8 SSP SBM MX MN K1 101M NOP SUB SSP SBM TPL TMI PZE pze END ~AY RESET XR1 TO LI LJ •• ,1 ·*t2 B.4 **.1 **t 1 TIX TIX 1 ** ••••••••••••••••• * •• * •• (PAGE (NOTE OIFF * • CONSTANTS. VARIABLES • NOP ~ MAXSNM * •••••••••••••••• * •• **** •• ** IDIMEN BE NEG OR POSt 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 023B 0239 0240 0241 0242 0243 0244 0245 0246 4) •••••••••••••••••••••••• ........................ • MOOT PROGRAM LISTINGS • - • • CMOOT 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 C C C C C C C C C MOOT (SUBROUTINE) LABH ...•.•.......,••.••..... ••••••••••••••••••• *•••• .. MOOT • LAST CARD IN DECK IS NO. 0093 0001 OOOl SUBROUTINE MOOT IN,L,AA,BB,CC,ORDERI 000.3 0004 0005 - ...-ABSTRACT---0006 0007 TITLE - MOOT DOT PRODUCT OR REVERSED DOT PRODUCT OF VECTORS OF MAtRICES 0008 0009 MOOT FJNDS THE DOT PRODUCT 0010 0011 C = AlII-BIll + ••• + AILI.BILI 0012 0013 OR THE REVERSED DOT PRODUCT 0014 0015 C = AIU.BILI + ••• + 0016 0017 OF TWO VECTORS OF N X N MATRICES AIK) AND 8CKIJ THE 0018 MATRICES ARE ASSUMED TO BE STORED BY COLUMNS AND 0019 CLOSH Y PACKED. 0020 0021 LANGUAGE - FORTRAN II SUBROUTINE 0022 EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0023 STORAGE - 109 REGISTERS 0024 SPEED - ABOUT 118.Ll*N*N*N + I 12*L-31.N.N + 0025 + 117 MACHINE CYCLES ON THE 7090. 0026 AUTHOR - R.A. WIGGINS 3/63 0027 0028 0029 - .... --USAGE---0030 TRANSFER VECTOR CONTAINS ROUTINES - MATML1 0031 AND FORTRAN SYSTEM ROUTINES - NONE 0032 0033 FORTRAN USAGE 0034 CALL MOOT 0035 0036 INPUTS 0037 0038 N IS THE DIMENSION OF THE MATRICES IN THE A AND I VECTORSJ 0039 MUST flE GRTHN= 1 0040 0041 IS THE NUMBER OF MATRICES IN THE A AND B VECTORS~ L 0042 MUST 8E GRTHN= 1 0043 0044 AAIII l=l, ••• ,L*N*N CONTAINS THE VECTOR OF MATRICES A(l) 0045 THROUGH ACLI STORED CLOSELY PACKED BY COLUMNS. 0046 0047 BB( Il 0048 I=I, ••• ,L*N*N CONTAINS THE VECTOR OF MATRICES lIlt THROUGH BIll STORED CLOSELY PACKED BY COLUMNS. 0049 0050 ORDER IF GRTHN= 0 THE DOT PRODUCT IS FOUND. 0051 IF LSTHN 0 THE REVERSE DOT PRODUCT IS FOUND. 0052 0053 OUTPUTS 0054 0055 I=l, •••• N.M CONTAINS THE DOT PRODUCT C AS DESCRIBED 0056 CCIII IN THE ABSTRACT. STORED BY COLUMNS. 0057 0058 EXAMPLES 0059 0060 0061 1. INPUTS - N"'l L"'3 UIl ••• 3) 0062 ORDER=I. 0063 OUTPUTS - CCtll '" -13. 0064 0065 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT ORDER=-l. 0066 OUTPUTS - CCfl) '" -3. 0067 1.,2.,1.,2.,3.,4.,3 •• 4. 0068 3. INPUTS - N=2 L=2 AAI1 ••• 8) 0069 ORDER=l. B811 ••• 81 = 2.,2.,2.,2.,4.,4.,4.,4. OUTPUTS - CCll •• J4) = 28.,40.,28.,40. 0070 0071 0072 4. INPUTS - SAME AS EXAMPLE 3. EXCEPT ORDER=-I. 0073 OUTPUTS - CCll ••• 41 = 20 •• 32.,20.,32. 0074 9/29/64 = •••••••••••••••••••••••• • • •••••••••••••••••••••••• PROGRAM LISTINGS MOOT IPAGE 2) C PROGRAM FOllOWS 8ElOW C 10 20 100 DIMENSION AAIIO),BBCIO),CCCIO) 101=0 Nl=N NN=Nl·Nl NNl=NN K=l J"l IF 10RDER) 10,20,20 K=ll-l).NN+1 NNl=-NN DO 100 (=l,l CAll MATMlIINl,AAIJ),BBIK),CC.MI J=J+NN K=K+NNI 101=1 RETURN END •••••••••••••••••••••••• MOOT • •••••••••••••••••••••••• • IPAGE 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 2) .............................. .................. ... ....... ' • MOOn .. ' - PROGRAM LISTINGS •••••••••••••••••••••••• MOOT3 • .. ••••• *................ •• MDOT3 ISUBROUTINEl 9/29/64 LAST CARD IN DECK IS NO. 0119 • LABEL 0001 CMDon 0002 SUBROUTI NE Moon I N,M, L. LAB. AA, BB, TRAN, CC, ORDER I 0003 C 0004 C ----ABSTRACT---0005 C 0006 C TITLE - Moon 0007 C DOT PRODUCT OR REVERSED OOT PRODUCT OF VECTORS OF MATRICES 0008 C 0009 C MOOT FINOS THE DOT PRODUCT 0010 C 0011 C C = AIll*Btll + ••• + AILABI-B(LAB} 0012 C 0013 C OR 0014 C 0015 C C Atl).Bll1 + ••• + AILABl*BILABl B. 8 TRANSPOSE 0016 C 0017 C OR THE REVERSED DOT PRODUCT 0018 C 0019 C C AIll.B(LAB} + ••• + AILABl"Bll1 0020 C 0021 C OR 0022 C 0023 C C Af1).BILABI + ••• + AILA8l"8(1) 0024 C 0025 C WHERE AtK) IS A VECTOR OF N X M MATRICES STORED 8Y 0026 C COLUMNS AND BIK) IS A VECTOR OF M X N MATRICES STORED 0027 C BY COLUMNS OR 8Y ROWS. BOTH VECTORS ARE CLOSELY PACKED. 0028 C 0029 C LANGUAGE - FORTRAN II SUBROUTINE 0030 C EQUIPMENT - 709. 7090. 7094 (MAIN FRAME ONLY) 0031 C STORAGE - 122 REGISTERS 0032 C SPEED - ABOUT L«18*M+98}"N +14)*L + 147l*LAB + lIt MACHINE 0013 C CYCLES ON THE 7094 IF THE VERSION OF MATNL3 ~RIrTEN 0034 C MARCH. 1963. IS USED. 0035 C AUTHOR - R.A. WICGINS 3/63 0036 C 0037 C ----USAGE---0038 C 0039 C TRANSFER VECTOR CONTAINS ROUTINES - MATML3 0040 C AND FORTRAN SYSTEM ROUTINES - NONE 0041 C 0042 C FORTRAN USAGE 0043 C CALL MDOT3 (N.M'L.LAB.AA.B8,TRAN,CC,ORDERl 0044 C 0045 C INPUTS 0046 C 0047 C N IS THE NUM8ER OF ROWS IN THE MATRICES IN AJ 0048 C MUST BE GRTHN=l 0049 C 0050 C M IS THE NUM8ER OF COLUMNS IN THE MATRICES IN A AND 8 0051 C tAFTER TRANSPOSITIONl 0052 C MUST BE GRTHN=l 0053 C OO~ C L IS THE NUMBER OF ROWS IN THE MATRICES IN B (AFTER 0055 C TRANSPOSITION) 0056 C MUST Bit GRTHN=l 0057 C 0058 C LAB IS THE NUMBER OF MATRICES IN THE A AND 8 VECTORSJ 0059 C MUST BE GRTHN=1 0060 C 0061 C AAIII I=I, •• ~,LA8*N*M CONTAINS THE VECTOR OF MATRICES Afl) 0062 C THROCGH AIL) STORED CLOSELY PACKED 8Y COLUMNS. 0063 C 0064 C BBIII I-l, •• J,LAB*M"l CONTAINS THE VECTOR OF MATRICES 8(1) 0065 C THROUGH 81Ll STORED CLOSELY PACKED. 0066 C 0067 C TRAN IF = O. 8 IS ASSUMED TO BE STORED 8Y COLUMNS. 0068 C IF NOT~ O. B IS ASSUMED TO BE STORED 8Y ROWS AND THE DOT 0069 C PRODUCT OF B TRANSPOSE IS FOUND. 0070 C 0071 C ORDER IF GRTHN=O THE DOT PRODUCT IS FOUND. 0072 C IF LSTHN 0 THE REVERSE OOT PRODUCT IS FOUND. 0073 C 0074 ~ • * ••••••••••• •••••••• ** ~ Moon * ........ -.. _.......... _.• (PAGE •••••••••••••••••••••••• PROGRAM 1I STINGS • 21 C OUTPUTS C C C CC{II I-l, •• ~,N*l CONTAINS THE DOT PROOUCT C AS OESCR1BED IN THE ABSTRACT, STORED BY COLUMNS. C C EXAMPLES C C 1. INPUTS - N-l M=1 l=1 lAB=3 AAll ••• 31-1.,2.,3~ BIl •• J3) ORDER=I. TRAN=O. OUTPUTS - CCfl) = -13. C C ~1 •• -1 •• -4. C C C 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT OROER=-I. OUTPUTS - CCll1 = -3. C = AAII ••• 81 1.,2 •• 1.,2.,3.,4.,3 •• 4. N~2 M~2 C 3. INPUTS - LAB=2 ORDER=I. BBll ••• 8) = 2.,2.,3.,2 •• 4 •• 1.,4 •• 4. t=2 TRAN=O. C OUTPUTS - CCll ••• 4) = 19.,28.,29.,42. C C C 4. INPUTS - SAfillE AS EXAMPLE 3. EXCEPT ORDER'" -1. OUTPUTS - CCll ••• 4) = 17.,26.,23.,36. C C C 5. INPUTS - SAME AS EXAMPLE 3. EXCEPT TRAN C OUTPUTS - CC'I ••• 4) - 29.,42.,19.,28. C C 6. INPUTS - SAME AS EXAMPLE 3. EXCEPT ORDER OUTPUTS - CCll ••• 4) - 23.,36.,17.,26. C C C PROGRAM FOllOWS BELOW C 10 40 100 * MOOT] •••••••••••••••••••••••• {PAGE 21 DIMENSION AAII01,BBIIOI,CCII0) Ml=D IOA=N*M IOB=M·L J=1 K=I IFIOROERI 10,40,40 K-IlAB-l)*IOB+l IDB=-IOB 00 100 I=I,lAB CAll MATML3 IN,M,L,AAIJI,BB(K),TRAN,CC,MI1 J:J+IOA K=K+IDB MI-Ml+1 RETURN END J.,. -1. TRAN " 1. 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 00Q9 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 .................. .......• MEMUSE " PROGRAM LISTINGS • MEMUSE • ......................... •••••••••••••••••••••••• • MEMUSE «SUBROUTINE) • LABEL CMEMUSE SUBROUTINE MEMUSE(ITPOUT) f •••••••••••• , •••••••••• • LAST CARD IN DECK IS NO. 0068 0001 0002 0003 0004 C 0005 C ----ABSTRACT---0006 C 0001 C C TITLE - MEMUSE 0008 C OFF:"lINE PRINT OF MEMORY USAGE - PROGRAM AND COMMON 0009 0010 C ME MUSE PRINTS ONE LINE ON A SPECIFIED TAPE UNIT GIVING C 0011 TOTAL PROGRAM STORAGE, TOTAL DIMENSIONED COMMON SPACE, 001-2 C C AND REMAINING AVAILABLE COMMON SPACE. IT IS A'PLICA6LE 0013 ONLY UNDER THE FORTRAN MONITOR SYSTEM. 0014 C 0015 C 0016 - FORTRAN-II SUBROUTINE C LANGUAGE (MAIN FRAME PLUS 1 TAPE DRIVEl 0017 C EQUIPMENT - 709,7090,7094 0018 - 71 REGISTERS C STORAGE C SPEED - TAKES TIME REQUIRED TO OUTPUT ONE 95 CHAR. BCD RECORD 0019 - S.M. SIMPSON, JUNE 1964 0020 C AUTHOR 0021 C 0022 C ...--USAGE---C 0023 0024 C 0025 C TRANSFER VECTOR CONTAINS ROUTINES - XlCOMN AND FORTRAN SYSTEM ROUTINES - (STH), (FIL) 0026 C 0027 C C FORTRAN USAGE 0028 CALL MEMUSE(ITPOUTI C 0029 0030 C 0031 C 0032 C INPUTS 0033 C ITPOUT IS THE LOGICAL TAPE NUMBER FOR OUTPUT 0034 C 0035 C 0036 C OUTPUTS A ONE-tINE MESSAGE IS PRINTED AS ILLUSTRATED BELOW 0037 C 0038 C 0039 C 0040 C EXAMPLES C 0041 - SUPPOSE THAT THE FOLLOWING MAIN PROGRAM IS OPERATED, 0042 C 1. USAGE AND THAT THE MAIN PROGRAM PLUS MEMUSE, EXIT AND LOWER 0043 C LEVEL ROUTINES OCCUpy OCTAL LOCATIONS 144 THROUGH 4521. 0044 C DIMENSION C(2000) 0045 C 0046 COMMON C C CALL MEMUSE(2) 0047 C 0048 C CALL EX IT 0049 C END 0050 OUTPUTS - ONE LINE (COLUMNS 2 THRU 95) IS FORMED ON lOGI¢AL 2 AS C FOllOWS. 00.51 C MEMORY USAGE (DECIMAL) - 2288 FOR PROGRAM, C 0052 2000 FOR DIMENSIONED COMMON, 0053 C 28114 UNUSED COMMON 0054 C 0055 C 0056 C 0057 C PROGRAM FOLLOWS BELOW 0058 C 0059 NOTE 32,462 DECIMAL = 100,000 144 -(77,777-77,461) OCTAL C 0060 C 0061 LDCOM = XLCOMNF(I.0) LUCOM ~ XLCOMNF(O.O) - lDCOM 0062 0063 LPROG = 32462 - LUCOM - LDCOM 0064 WRITE OUTPUT TAPE ITPDUT,70,LPROG,LDCOM,LUCOM 70 FORMAT(26H MEMORY USAGE (DECIMAL) - • 15. 13H FOR PROGRAM •• 16, 0065 1 24H FOR DIMENSIONED COMMON" 16, 14H UNUSED COMMmN) 0066 0067 9999 RETURN END 0068 9/4/64 ......................... PROGRAM LI STINGS , • MFACT • •••••••••••••••••••••••• • MFACT (SUBROUTINE) • LABEL CMfACT SUBROUTINE'MfACT (N,AA,BB) •••••••••••••••••••••••• * MFACT • •••••••••••••••••••••••• LAST CAAD II BECK IS NO. 0102 0001 0002 0003 0004 C - ......-ABSTRACT-0005 C 0006 C 0007 C TITLE - MFACT C fACTOR A SY~METRIC POSITIVE DEFINITE MATRIX 0008 0009 C MFACT FINDS A TRIANGULAR MATRIX B(I,J) (I REFERS TO nlE 0010 C ROWj J REFERS TO THE COLUMN) SUCH THAT 0011 C 0012 C A = 8 • (8 TRANSPOSE) 0013 C 0014 C WHERE A IS A SQUARE, POSITIVE DEFINITE MATRtX. 0015 C 0016 C THE FACTORIZATION IS MADE ACCORDING TO THE SCHEME 0011 C 0018 C ( 0 -GRTHN J 0019 C ( 0020 C ( 0021 N C .. J 0022 C I IAIJ,J)-SUM (8( I.O.8( IoK»)) ••• 5 0023 K=J+l BU,JJ=I C 0024 C I ( N 0025 C ( (ACI,Jl-SUM IB(I.K).8(K,J»)1/8(JIJ) LSTHN J 0026 C 0027 K=J+l C I 0028 C 0029 WHERE N IS THE NUMBER OF ROWS AND COLUMNS AND THE C 0030 CALCULATION PROCEEDS AS C 0031 C 0032 J=N I=N.N-l.N-2, ••• ,1 C J=N-l I=N,N-l,N-2, ••• ,1 0033 C 9/29/64 0034 C C C I=N.N-l,N-2, ••• ,1 C C LANGUAGE - FORTRAN II SUBROUTINE C EQUIPMENT - 7094 7090. 7094 IMAIN FRAME ONLY) - 187 REGISTERS C STORAGE - ABOUT .0000060.N.N.N + .000102.N.N + .000302.N + .000110 C SPEED SECONDS ON THE 1094 MOD 1 • C C AUTHOR C C C R.A. WIGGINS 3/63 ---USAGE--- C TRANSFER VECTOR CONTAINS ROUTINES - DOTJ, STZ AND FORTRAN SYSTEM ROUTINES - SQRT C C C C FORTRAN USAGE CALL MFACT (N,AA,B8) C C INPUTS C N C C IS THE NUMBER OF COLUMNS OR ROWS IN THE MATRICES A AND B. MUST BE GRTHN=l C AACI ) C C C C OUTPUTS C B8( II C C I=l, ••• ,N.N CONTAINS THE MATRIX ACI,J) STORED'LOSELY PACKED. l=l, •••• N.N CONTAINS THE MATRIX BCI,J) STORED 1tL0SELY PACKED 8Y COLUMNS. C C EXAMPLES C C 1. INPUTS OUTPUTS C N=l AA(1) = 4. 8Btl)=2. C C 2. INPUTS C C C - N=2 AAll ••• 4) = 5.,6.,6.,9. OUTPUTS - 8B(1 •• ~4) = 1.,0 •• 2.,3. 3. INPUTS - N=3 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 .......................... • "FACT PROGRAM LI STINGS 2' C C AA(1 ••• 91 OUTPUTS - BBI1 ••• 9) MFACT • •••••••••••••••••••••••• IPAGE 21 •••••••••••••••••••••••• (PAGE •••••••••••••••••••••••• • • 4.69,4.74,2.40,4.74,6.13,3.40,2.40.3~~0'4.00 a 1.00,0. ,0. ,1.50,1.80,0. C C PROGRAM FOLlOWS BELOW C DIMENS(ON AAIIO),BBI101 N1=N 30 NN=Nl.NI CALL STZ(NNj8BI J=NN DO 10 (zl,NI 11=(-1 J=J-(l JI=J IN=J+Nl CALL DOTJ 111,Nl,BBIJNI,N1,BB(JNI,DOT,O,l.1 BBIJ)=SQRTFtAAIJI-DOT) J=J-l IFIJ. 100,100,50 50 12=1+1 DO 60 K=12.NI JNl=J+N1 CALL DOTJ l(l,Nl,BBIJN11,NI,BBIJN),DDT,O,1.1 BBIJI-IAAIJI-DOTI/BBIJll J=J-1 60 70 CONTINUE 100 RETURN END ,l.20_1~70.Z.00 0075 0016 0011 0078 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 •••••••• .... * •••,••••••• ~ • MIFLS PROGRAM LISTINGS • •••••••••••••••••••••••• • MIFLS (SUBROUTINEl 9/B/64 .. LABEL CMIFLS SUBROUTINE MIFLS IN,LL,BB,RR,GG,FF,Cl 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 C C C C C C C C C •••••••••••••••••••••••• • MIFLS • •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0166 0001 0002 0003 0004 ----ABSTRACT---0005 0006 0007 TITLE - MIFLS MULTI-INPUT FILTER BY LEAST SQUARES 0008 0009 0010 MIFLS INCREASES THE LENGTH OF A MULTI-INPUT LEAST SQUARE FORWARD SHAPER FILTER BY ONE. THAT IS, GIVEN THI VECTOR 0011 OF MATRICES FIK,Ll IK REFERS TO A PARTICULAR 1 X N MATRIX 0012 ELEMENT IN A VECTOR OF L ELEMENTS) THAT SATISFlfS THE 0013 EQUATIONS 0014 0015 FIL,U*R(Ol + GfL-lJ 0016 0017 0018 + + FCl,L)'RIL-2l GIL-2JI 0019 0020 0021 0022 FIL.L)*RI-L+ll+ ••• + Fll,Ll.RIOI GIOt 0023 0024 AND BETtO,LI AND BIK,LI AS DESCRIBED IN MIPLS 0025 THEN MIFLS INCREASES THE LENGTH OF FIK,LI BY ONf SO THAT 0026 IT SATISFIES THE EQUATIONS 0027 0028 FtL+l,L+II'R(OI + ••• + Fll,L+II'RCLI = GfLl 0029 ETC. 0030 IF RIKl REPRESENTS THE N X N MATRIX VALUED AUTOItORRELATlON 0031 OF AN N X M MATRIX VALUED WAVELET XIT) 0032 0033 0034 RfK) ~ SUM (X1T+Kl'XITITRANSPOSEI 0035 0036 AND G(KI REPRESENTS THE 1 X M MATRIX VALUED CROSS0037 CORRELATION OF A DESIRED OUTPUT OtT) WITH THE WAVELET XITI 0038 0039 GlKI • SUM (D(TI'XIT-KITRANSPOSEI 0040 THEN THE FIRST SET OF EQUATIONS ABOVE ARE THE NGRMAL 0041 0042 EQUATIONS FOR • S~APER FILTER 0043 DITI - IF(L,LI'XIT-L) + ••• + FII,L).XIT-Ill ~ ZETfT.LI 0044 0045 0046 WHERE ZETIT,L) IS AN 1 X M MATRIX VALUED ERROR SERIES. 0047 0048 SEE THE ABSTRACT OF MIPLS FOR THE INTERPRETATION OF 0049 BIK,LI AND BET(O,ll. 0050 0051 LANGUAGE - FORTRAN II SUBROUTINE EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLYI 0052 0053 STORAGE - 276 REGISTERS 0054 SPEED - If L = 1, THE TIME IS ABOUT 0055 36*N*N + 244'N + 744 MACHINE CYCLES, 0056 OR IF L GRTHN I, THE TIME IS ABOUT U057 36*N'N'LL + 224*N'LL + 2B7.LL + 36*N'N MACHINE CYCLES ON THE 7090, WHERE LL« L+l • 0058 0059 ITHESE ESTIMATES ARE BASED ON THE VERSION OF MATML3 WRITTEN MARCH, 1963.) 0060 0061 AUTHOR - R.A. WIGGINS 0062 0063 ----USAGE---0064 TRANSFER VECTOR CONTAINS ROUTINES - MATML3,MOVREV 0065 AND FORTRAN SYSTEM ROUTINES - NONE 0066 0067 0068 FORTRAN USAGE 0069 CALL MIFLS tN,Lt,BB,RR,GG,FF,Cl 0070 0011 INPUTS 0072 0073 IS THE DIMENSION OF THE MATRICES IN THE F, B, AND R N 0074 VEe TORS. •••••••••••••••••••••••• • MtFlS • •••••• •••• *•••* •••• ••• ~ IPAGE PROGRAM lISTINGS ~ •••••••••••••••••••••••• • MIFlS 2) 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 IPAGE MUST BE GRTHN=l II =l+~ IS THE NUMBER OF MATRICES IN THE F VECTOR AFTER THE PROGRAM HAS OPERATED. MUST BE GRTHN=1 BBtl) l=l ••••• ll.N.N CONTAINS THE VECTOR OF N X N MATRICES BIO,l) THROUGH BIL.l) AS DESCRIBED IN THE ABSTRACT. IF NN = N.N, THEN BBl1 ••• N) CONTAINS COLUMN 1 OF BIO.L) BBIN+1 ••• 2.NI CONTAINS COLUMN 2 OF 810.l) B81IN+11.N+l ••• NNI CONTAINS COLUMN N OF 810.l} 8BINN+l ••• (N+ll.N-11 CONTAINS COLUMN 1 OF 811.L) ETC. RRII) I=l ••••• LL.N.N CONTAINS THE AUTOCORRELATION VECTOR OF N X N MATRICES RIO) THROUGH RIL) AS DESCRI8ED IN THE A8STRACT STORED SIMILARLY TO B8(1). GGIII I=I ••••• LL.N.N CONTAINS THE CROSSCORRElATION VECTOR OF 1 X N MATRICES GIO) THROUGH GILl AS DESCRI8ED IN THE ABSTRACT, STORED SIMILARLY TO 8BII). FFIII I=l, •••• ILl-l).N IS THE FILTER VECTOR OF 1 X N MATRICES Fl1.l1 THROUGH FIL.LI AS DESCRI8ED IN THE A8STRACT. STORED SIMILARLY TO BB. CIII I=1 •••• ,6.N.N IS COMPUTATION SPACE NEEDED BY MIFLS. I=l ••• ~.N.N CONTAINS ALP(O.LI AS DESCRI8ED IN MIPlS~ I=N.N+l ••• 2.N*N CONTAINS 8ETIo.LI AS DESCRIBED IN MIPLS4 I=2.N*N+l, ••• ,3*N.N CONTAINS ALPIO,LI INVERSE I=3.N*N+l, •••• 4*N.N CONTAINS 8ETIO.LI INVERSE rTHESE VALUES ARE UNDISTURBED BY MIFLS) C C OUTPUTS C C C • ••••••••••••••• * •••••••• FFII) I=l, •• J,LL*N CONTAINS THE NEW FILTER Fll.l+11 THROUGH FIL+l,L+l1 C C EXAMPLES C C 1. SINGLE-INPUT CASE C INPUTS - N=l Ll=l B811 ••• 21 = 1.,-.4 RRll ••• 3) 2 1.25 •• 5.0. C GGtl ••• 3) = 1 •• 0 •• 0. CCll ••• 41 = 1.25.1.25 •• 8,.8 C FFll1 = .8 C OUTPUTS - FFrl •• ~2) = 0.9524,-0.3810 C C 2. MULT-INPUT CASE - USE OF MIPLS IN CONJUNCTION WITH MIFLS C INPUTS - N=l L=4 C RRll •• J201 = 1.89, 0.89, 0.89. 1.05, GGll ••• 8)d-l.20.-.55 C 1.20, 0.60, 0.55.-0.18, -0.50,-.50 C 0.50, 0.10, 0.50. 0.01. .00, .00 C .00. .00, .00. .00 .00 • • 00 C USAGE tL=O C DO 10 I=l,L C CALL MIPLS IN,LL.AA.B8,RR,C.ERRI C 10 CALL MIFLS IN.LL.8B.RR.GG.FF.C) C OUTPUTS - FFtl ••• 8) =-0.8564. 0.0288 C 0.2111. -0.2008 C 0.1531, 0.3455 C -0.3259, 0.1564 C C PROGRAM FOLLOWS 8ELOW C DIMENSION 881101.RRI101,GGII0).FFII01.CII01 NI=N LI=LL-l NN=NI.NI NN2=NN+1 NN4=NN2+NN+NN NN5=NN4+NN LNl=LI*NI+l 0075 0076 0071 0018 0079 0080 0081 0082 0083 0084 0085 0086 0081 OOBB 00B9 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 OllB 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 2) •••••••••••••••••••••••• • MlflS • PROGRAM LISTINGS •••••••••••••••••••••••• IPAGE 3) 20 30 50 60 80 90 LNNl=llNl-l)·NI+l CALL MOVREVtNI,1,GGtlNl),1,CINN5),-1.) IF Ill) 90,60,30 CONTINUE J=lNl 00 50 I=NN2,lNNl,NN J=J-NI CALL MATMlJ Il,NI,NI,FFIJI,RRII),0.,C(NN5),11 CONTINUE CAll MATMlJ Il,NI,NI.CINN51.CINN4),0 •• FFILNll,Ol CALL MOVREVtNI,l,FFIlN11,l,CINN5I,-1.1 J=lNl DO 80 Il=l,~NNltNN CALL MATMl3 11,NI.NI.CINN5).BBIIl),0.,FFIJ),Il-11 J=J-NI RETURN END •..•.•.•.••..•...... _-_ . M(FLS • ..•......... _.•......•. . * IPAGE 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 3) ••••••••••••• * •• * •••• * •• MINAB * . •••••••••••••••••••••••• REFER TO MAXSN _*._ ....•.. ......•...•..... MINABM _•••••••••••••• - ••••••• * PROGRAM LISTINGS •••••••••••••••••••••••• MINAB .. •..••....••............ - • REFER TO MAXSN _••••••••••••••••••• * ••• • "INABM .. • ••••••••••••••••••••• ** REFER TO MAXSNM REFER TO MAXSNM ................. -_ ..... . MINSN ••• *.*.* ••• _ •• _*._ ...... . ................... _*-.... MINSN .. ••• * ••• * •••••• _••••• REFER TO MAXSN ** •• *•. _.*._-* •••. .. ..***e••••• MINSNM •• * ••••••••• **_._ .. _. REFER TO MAXSNM REFER TO MAXSN • MINSNM -_.* . • •• ~ •• * ••• *** •••• * •• ** •• REFER TO MAXSNM •••••••••••••••••••••••• • MIPLS • PROGRAM LISTINGS •••••••••••••••••••••••• • MIPLS • • ••••••••••• * ••••••••••• ••••••••••••••••••••••••• • MIPLS CSUBROUTINEI 9/29/64 LAST CARD 1M DECK IS NO. 0253 * LABEL 0001 CMIPLS 0002 SUBROUTINE MIPLS CN.LL,AA,BB,RR,C,ERR) 0003 C 0004 ~-ABSTRACT---0005 C C 0006 0007 C TITLE - MIPLS C MULTI-INPUT PREDICTOR BY LEAST SQUARES OOOB C OOM C MIPlS INCREAses THE LENGTH OF MULTI-INPUT LEAST SQUARE 0010 PREDICTION AND RETROSPECTIVE ERROR OPERATORS BY ONE. 0011 C THAT IS~ GIVEN THE VECTOR OF MATRICES A1K,L) AND Bl'K,LJ 0012 C C IK REFERS TO A PARTICULAR N X N MATRIX ELEMENT IN A 0013 VECTOR OF L+l ELEMENTSI THAT SATISFY THE EQUATIONS 0014 C C 0015 AtL,L).RIOI + + All,l)*RIL-l) + AIO.L)*Rlll * 0 0016 C C 0017 C AtL.L}*R(-ll +. + ACl.L)*RCL-2) + ACO'LI*RIl-tl* 0 0018 C 0019 C 0020 C 0021 A(L.L)*RI-L+ll+. ••• + ACl.LI*RCOI + ACOILI*RI~ll * 0 0022 C C 0023 AND 0024 C C 0025 C BCO.U*RI-ll + BC loU*RCOl + .... + BCL.U.RCl-lI* 0 0026 C 0027 BtO.LJ*RI-21 + B(I,l'.RI-lI + + BCl'lJ.RIl-2l* 0 0028 C C 0029 C 0030 C 0031 BtO.l)*RI-ll + Bll.ll.RI-l+11+ ••• + Bll.ll.RIOI • 0 0032 C C 0033 WHERE Ato,ll AND BIO.ll ARE CONSTRAINEO TO BE I.ENTITY 0034 C C MATRICES. THEN MIPlS INCREASES THE lENGTHS OF A AND B 0035 BY ONE SO THAT THEY SATISFY THE EQUATIONS 0036 C C 0037 AC'l+l,l+lI*RIOI+ ... +All,l+l)*RIL-ll+A(O,L+U.RlL' • 0 0038 C C ETC. . 0039 AND 0040 C BI0,L~1).RI-11+811,L+11.R(0)+ ••• +8IL+1,L+l'.R(l) • 0 0041 C ETC. 0042 C C 0043 C IF RIKI REPRESENTS THE AUTOCORRELATION OF AN N X M MATRIX 0044 VALUED TIME SERIES XITI 0045 C C 0046 RCKI • EXPECTED VALUE (XIT+KI,XlTITRANSPOSEI 0047 C C 0048 THEN THE FIRST SET OF EQUATIONS ABOVE ARE THE NORMAL 0049 C C EQUATIONS FOR THE PREDICTION ERROR OPERATOR 0050 C t t t C t t t t t C C C C C C C C C C OO'H All,LI.XIT-LI •••• + AC1.ll.XIT-ll+A(0~LI*X(TI ~ EPSCT.L) ANO THE SECONO SET OF EQUATIONS ABOVE ARE THE NaRMAL EQUATIONS FOR THE RETROSPECTIVE ERROR OPERATOR BI0,lJ*XITI+BIl.L)*XIT+11 +••• + 8IL.Ll*XIT+Ll • ETAfT.Ll WHE~E EPS ANO ETA ARE THE N X M MATRIX ERROR SERIES. AS A MATTER OF TERMINOLOGY. WE DEFINE A~l.L).Rlll +••• + ACl.LI*RtLI+AlO.LJ*RCL+l) • AlPCL+l.LI AtL.LJ*RI-LI+ ••• + ACl.ll*Rl-l)+ACO,LI*RCO) ALPIO.ll AND 810.ll.RIOI • BCl.LI*RCtl •••• + BIl.LI*RILI BETIO~L) B(0,L)*RI-L-ll+BI1.ll*RC-ll+ ••• +Bll.LJ*RI11 -BETt-l-I.L) WHERE AlPIO.LI AND BETIO.LI ARE THE COVARIANCE MATRICES OF EPSIT.LI AND ETA(T.l). RESPECTIVELY. THAT IS C C C C ALPIO.LI • EXPECTED VALUE IEPStT.L'*EPSlT.L)TRANSPOSEI BETIO.ll = EXPECTEO VALUE (ETACT.L)*ETACT'L'TRANSPOSEI 0052 0053 0054 0055 0056 0057 005B 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 ...,........................ • MIPLS •••••••••••••••••••••••• PROGRAM LISTINGS • • MIPLS •..•......... ,.•..•..••.• •••••••••••••••••••••••• IPAGE 2) C C IPAGE MIPlS RETURNS TH€ VALUES OF ALP(O.LI AND BETIO.t) FIlR THE NEW OPERATORS OF LENGTH L+1. C C C C C C C C C C C C C C LANGUAGE EQUIPMENT STORAGE SPEED AUTHOR - FORTRAN II SUBROUTINE 109 OR 7090 IMAIN FRAME ONLY) 511 REGISTERS IF Ll=O ABOUT 33.N.N.N + 14S.N.N + 163.N + 1281 MACHI~E CYCLES ON THE 1090. IF LL=l ABOUT 156'N.N.N + 769.N.N + 369'N + 2369 MACHINE CYCLES ON THE 7090. IF LL GRTHN 1 ABOUT 136'LL+120)'N'N'N + (216.tL*f63"N*N + 128'LL+3681'N + 396'LL + 1990 MACHINE CYCLIS ON THE 7090. - R.A. WIGGINS C TRANSFER VECTOR CONTAINS ROUTINES - IXCARG.MATINV.MATML3.MAtRA_ MDOT3.MOVREV.STZ C C AND FORTRAN SYSTEM ROUTINES - NONE C C FORTRAN USAGE C CALL MIPLS (N.Ll.AA.B8.RR,C.ERR) C C INPUTS C N IS THE DIMENSION OF THE MATRICES IN THE A. B, AND R VECTORS. MUST BE GRTHN=l C C C C C C C C C C LL AAIII aL+1 THE NUMBER OF MATRICES IN THE A AND B VECTORS WHEN THE PROGRAM IS ENTERED ITHIS IS ALSO AN OUTPUT). MUST BE GRTHN=O I-l ••••• LL.N.N CONTAINS THE VECTOR OF MATRICES AIO.L) THROUGH AIL.LI AS DESCRIBED IN THE ABSTRACT. If NN = N.N THEN CONTAINS COLUMN 1 Of MATRIX A(O'LI AAll ••• NI AA(N+1 ••• 2NI CONTAINS COLUMN 2 OF MATRIX AIO.Ll C C C C AA(IN-l)'N+1 ••• NNI CONTAINS COLUMN N Of MATRIX AIO'LI AAINN+l ••• NN+N-ll CONTAINS COLUMN 1 OF MATRIX All.LI ETC. C BBII) I=I ••••• LL.N.N CONTAINS THE VECTOR OF MATRICES BIO.LI THROUGH BIL.LI AS DESCRIBED IN THE ABSTRACT. STORED SIMILARLY TO AAIII. RRIII I=l ••• ~.(LL+ll'N.N CONTAINS THE CORRELATION VEtTOR Of MATRICES RIOI THROUGH RIL+ll AS DESCRI8ED IN THE A8STRACT. STORED SIMILARLY TO AAIII. C C C C C C C C C C 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 C C C C 0016 0011 0089 ----USAGE---- C C C C 0015 CII) I=1 ••••• 5.N.N+N IS COMPUTATION SPACE NEEDED BY MIPLS. I=t ••••• N.N CONTAINS ALP(O.LI I=N.N+l ••• 2'N.N CONTAINS BETIO.LI 1=2'N*N+l ••• 3*N'N CONTAINS ALP(O,LIINVERSE I=3.N*N+l.~.4'N*N CONTA1NS 8ETI0.LIINVERSE 0116 0117 OilS 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 C C OUTPUTS 0134 C 0135 C LL =L+2 INCREASED ONE FROM ITS INPUT VALUE. AAIII 1-1, •••• LL.N.N INEW LLI CONTAINS AIO.L+ll AIL+l.L+ll. C C C THROU~H C C C C C C C C C C 8BCI) l-l ••••• LL.N.N INEW lLI CONTAINS BIO.L+l) THROUGH BIL+l.L+ll. CIII l=l ••• ~.N*N I-N*N+l ••• 2'N*N I=2*N*N+l ••• 3'N*N I-3'N*N+l ••• 4'N.N ERR CONTAINS CONTAINS CONTAINS CONTAINS ALPIO.L+lJ BETIO.L+l1 ALPIO.l+lIINVERSE BETtO.l+lIINVERSE =0. If SOLUTION WAS SUCCESSfUL. 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 2) •••••••••••••••••••••••• • MIPLS PROGRAM LISTINGS • 3) =1. IF ANY MATRICES THAT \jERE INVERTED WERE SINGULAR;' =2. IF OVERFLO\j OR UNDERFLO\j OCCURRED DURING INVERSION. =3. IF THE VALUE OF L IS ILLEGAL t t t t t t t t t t t t t t t t EXAMPLES 1. SINGLE-INPUT EXAMPLE INPUTS - N=l LL=O RRll ••• 31 = 1.25,.50,0. OUTPUTS - AA(I)=l. B611'=I. Cll~~.4) = 1.25,1.25 •• 8,.8 LL-l 2. CONTINUATION OF ITERATION FROM EXAMPLE 1. INPUTS - SAME AS OUTPUTS FOR EXAMPLE 1. OUTPUTS - AAll ••• 21 = 1.,-.4 BBll ••• 2) = 1.,-.4 Cll ••• 4) = 1.05,1.05,0.9524,0.9524 IfRR"O. t 3. MULTI-INPUT EXAMPLE t t t t t t t t t C t C C C t C C C C MIPLS INPUTS • •••••••••••••••••••••••• IPAGE 3) •••,•••••••••••••••••••• * IPAGE f ••• _ •••••••••• _ •••••••• • - N=1 L=5 LL=O RRll ••• 24) I.B9, 0.89, 0.89, 1.05, 1.20, 0.60, 0.55.-0.18, 0.50. 0.10, 0.50. 0.01. 0 •• 0.,0.,0.,0.,0.,0.,0.,0.,0.10.,0. USAGE 00 10 1-1,L 10 CALL MIPLS IN,LL,AA,BB,RR.C,ERRI OUTPUTS - AA(I •• ~201 = 1.0000, O. , O. ,1.0000, -0.B564,-0.5639, 0.0288, 0.lB52, 0.2117, 0.6365,-0.2008,-0.4866, 0.1531, 0.2426, 0.3455,-0.6331, -0.3259, 0.2593, 0.1564,-0.7539 BBll ••• 20) 1.0000, O. ,0. , 1.0000, -0.7383,-0.2250,-0.1260, 0.0671, 0.0209,-0.2111, 0.1523,-0.3603, 0.4137, 0.7391,-0.1588,-0.8445, -0.2272, 0.3056,-0.0745,-0.80a6 C 11 ••• 161 0.8837, 0.3902, 0.3902, 0.7371, 0.9542, 0.5186, 0.5186, 0.8050, 1.4768,-0.1816,-0.7816, 1.7703, 1.6128,-1.0390,-1.0390, 1.9116 LL = 5 ERR '" O. = C t C C C PROGRAM FOLLOWS BELOW C DIMENSION AAII0),BBII0I,RRII0),CII0),CMIIO) COMMON CM NI=N LI=Ll NN=NI*NI NN2=NN+l CALL IXCARG IC,I(1) IC2=IC1+NN IC3=IC2+NN IC4=IC3+NN IC45=IC4+NN IC5=IC45+Nl LNNl=U *NN+ 1 LNNO=LNN1-NN CALL lXCARG IAA{LNN11,IAL) CALL IXCARG IBSiLNN1),ISL) IF ILl) 10_20,40 C ILLEGAL LL. 10 ERR=3. 15 RETURN C SPECIAL CASE LL:O 20 CALL STZ INN,AA) CALL STZ INN,SS) Nl=NI+l 00 30 I-l,NN,Nl AAIII=l. 30 8BII)=I. CALL MOVREV INN;l,RR,I,CMIICI),l) CALL MOVREV INN,I,RR,I,CMIIC2),I) CALL MATINV INI,CMI ICll ,CMI IC3),CMI I(4),ERRI CALL MOVREV INN,1,CMIIC3),I,CMI!C4),1) LL=1 GO TO 15 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0170 0171 0172 0113 0174 0115 0176 '0117 0178 0179 0180 0181 0182 0183 0184 0185 0186 0181 0188 01S9 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0211 0218 0219 0220 0221 0222 0223 0224 ••••••••••• ** ••••••••••• • MIPLS • PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 4) C GENERAL CASE. Ll GRTHN 1. C C CONSTRUCT A(L+l'L+l) 40 CALL MOOT3 (NI,NI,NI,LI,AA,RR(NN2),0.,CMtIC5),-I.) CALL MATML3lNI,~I,NI.CM(IC5),CMIIC4),O.,CMtIAL).O) CALL MOVREVINN,1,CMIIAL1,I,CM(IAL),-I.1 C CONSTRUCT BfL+l,L+l) CALL MATRA (CMIIC51,N,N,CMIIC4)) CALL MATML3(NI,NI,NI,CMIIC4),CMIIC3),0.,CMtIBL),0) CALL MOVREVtNN,l,CMIIBLI,I,CMIIBLI,-I.1 IF ILl-I) 10,76,bO C FILL IN OTHER TERMS OF A AND B. bO CONTINUE J=LNNO 00 70 12=NN2,lNNO,NN CALL MOVREV INN,I,AAIJI,I,CMtIC31,1.) CALL MATML3 tNI,NI,NI,CMIIALI,BBII21,O.,AAIJ),I) CALL MATMl3 (NI.NI,NI,CMIIBL),CM(IC3),0.,BBI12),1) 70 J=J-NN C GET NEW ALP AND BET 75 CONTINUE CALL MATML3 INI,NI,NI,CMIIAL).CM(IC41,O.,CMIICll.11 CALL MATINV INI,CMIICI',CMIIC31,CMIIC41.ERRl) CALL MATML3 INI,NI,NI,CMIIBLI,CM(IC5)'O.,CMIIC2),l1 CALL MATINV INI,CMIIC21,CMIIC41,CMIIC45),ERR2) ERR=ERRl+ERR2 LL=LI+l GO TO 15 END •••••••••••••••••••••••• • MtPLS • • •••••••••••••••• ** ••••• IPAGE 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 023b 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 4) .......,.................. . ............................ , • MISS •. PROGRAM LISTINGS • , •.. ••••••••••••••••••••••• MI5S It ••• f •••••••••••••••••••• , LAST CARD IN DECK IS NO. 0149 0001 0002 CMISS SUBROUTINE MISS IN,L.AA,BB,RR,GG,FF,Cl 0003 0004 C --'-...-ABSTRACT---0005 C 0006 C 0007 C TITLE - MISS C MULT1-INPWT SIDEWARDS ITERATION 0008 0009 C MISS PERFORMS A SIDEWARDS ITERATION OF A MULTI-INPUT 0010 C MATRIX VALUED FILTER FIK,L} ~K REFERS TO THE K-tH 1 X N 0011 C MATRIX ELEMENT IN A VECTOR OF L ELEMENTS) TO CORRESPOND 0012 C TO A SIMILAR ITERATION OF A CROSSCORRELATION VE£TOR GCK). 0013 C 0014 THAT IS, GIVEN A VECTOR FIK,L) THAT SATISFIES C 0015 C 0016 GIL-ll C + 0017 C GIL-2) 0018 fCL.U.RI-ll + C 0019 C 0020 C 0021 C .. GIO} 0022 C 0023 C AND THE E,RROR OPERATORS A(K.L-ll AND BIK,L-l) WHH TI!IEIR 0024 C 0025 RESPECTIVE COVARIANCE MATRICES AlPIO,l-ll AND BtnIO;'l-ll C 0026 THAT CORRESPOND TO THE R(TI ABOVE ISEE ABSTRACT Of; C MIPlS FeR A DESCRIPTION Of THESE QUANTITIES] 0027 C 0028 THEN MI~S COMPUTES THE VECTOR OF MATRICES F11K,ll C 0029 WHICH SATISFY C 0030 C 0031 '" GIL-2') C + 0032 C 0033 C 0034 C 0035 = GI-lll C 0036 C 0037 SEE THE ABSTRACT OF MIflS FOR A DESCRIPTION OF RtT). GeT) C 0038 C 0039 C LANGUAGE - FORTRAN II SUBROUTINE 0040 C EQUIPMENT - 709 OR 1090 IMAIN FRAME ONLY) 0041 - 335 REGISTERS C STORAGE 0042 - ABOUT (54*l-IS1.N*N + 1346.l-911*N + 411.l + 522 C SPEEO 0043 MACHINE CYCLES ON THE 7090. C 0044 - R.A~ WIGGINS 3/63 C AUTHOR 0045 C 0046 ----USAGE--C 0047 C 0048 C TRANSFER VECTOR CONTAINS ROUTINES - MATMl3,MDOT3,MOVREV 0049 AND FORTRAN SYSTEM ROUTINES - NONE C 0050 C 0051 C FORTRAN USAGE 0052 CALL MISS tN.L.AA,BB,RR,GG,FF.C) C 0053 C 0054 C INPUTS 0055 C 0056 IS THE DIMENSION OF THE MATRICES IN THE A, B. R. F. N C 0057 AND Fl VECTORS. C 0058 MUST BE GRTHN=1 C 0059 C 0060 IS THE NUMBER OF MATRICES IN THE A. B, R, F, AND F1 C l 0061 VECTORS. C 0062 MUST BE GRTHN=1 C 0063 C 0064 AA( I ) I=I, •• J,L*N*N CONTAINS THE N X N MATRIX VALUED PREDICTION C 0065 ERROR OPERATOR AIO,L-I) THROUGH AIL-I.L-I) A~ COMPUTED C 0066 BY MIPLS. C 0067 C 0068 BBI I) I=l ••••• l.N*N CONTAINS THE N X N MATRIX VALUED C 0069 RETROSPECTIVE ERROR OPERATOR BIO.l-l) THROUGH C 0070 BIL-l.L-l) AS COMPUTED BY MIPlS. C 0071 C 0072 RR(U I=l ••• ~.L*N*N CONTAINS THE N X N MATRIX VALUED C 0073 AUTOCORRELATION VECTOR R(O) THROUGH RILl STORED CLOSELY C MISS (SUBROUTINE) LABEL 10/5/64 G. ........................ . ' • PROGRAM LI STINGS ' MISS • (PAGE •••••••••••••••••••••••• • •••• *•• *.* •••••••~* •••• * MISS 2) PACKED BY COLUMNS. C C C GG( !} l=l, ••• ,lL+ll*N CONTAINS THE 1 X N MATRIX VALUID CROSSCORRELATION VECTOR GI-l) THROUGH G(L-l) AS DESCRIBED IN THE ABSTRACT. FFI l=l, ••• ,L*N CONTAINS THE 1 X N MATRIX VALUED SHAPER FILTER Fl1,LI THROUGH Fll,L) AS COMPUTED BY MIFlS. C C C C C C J) CII) C C C C C I=1, ••• ,6*N*N IS COMPUTATION SPACE NEEDED BY MDSSJ I=l, ••• ,N.N CONTAINS THE COVARIANCE MATRIX ALPlO'LI AS COMPUTED BY MIPLS. I=N*N+l, ••• ,2*N*N CONTAINS THE COVARIANCE MATRIX BET'O~L) AS COMPUTED BY MIPlS. C C OUTPUTS C C C C C C FFI I) 1=1, ••• ,L*N*N CONTAINS THE 1 X N MATRIX VALUED SHAPER FILTER F111,LI THRDUGH FIIL,LI AS DESCRIBED IN THE ABSTRACT. EXAMPLES C C 1. INPUTS C - L=2 N~l RRI1 ••• 21 1.25,.5 GGIU •• 2) 0 •• 1. IG1=2 IG2=1 USAGE Iol=O DO 10 I-1,L CALL MIPLS IN,LL,AA,BB,RR,C,ERRI CALL MIFLS IN,lL,BB,RR,GGIIG1),FF,CI 10 CAll MISS IN,L,AA,BB,RR,GGIIG21,FF,C) OUTPUTS - ERR=O. FF(I ••• 2) = -0.3810,0.9524 C C C C C C C C C 2. INPUTS C USAGE C - L=2 N~2 RRl1 ••• 81 ~ 1.25,0.,0.,1.16.0.5,0.,0 •• 0.4 GGf1 ••• 4) = 1.,0.,0.,0. IG1=3 IG2-1 - SAME AS EXAMPLE 1. OUTPUTS - ERR=O. FF(1 •• ~41 - 0.9524,0.0,-0.3810.0.0 C C C C C 3. INPUTS RRl1 ••• B) - 1.89,0.89,0.89.1.05, 1.20,0.60,0.55,-0.18 GGtl •• J4) = -1.2,-0.55,-0.5,-0.5 IGI-3 IG2=1 USAGE - SAME AS EXAMPLE 1. OUTPUTS - ERR-O. FFIl •• J41 - -0.5050,-0.6413,0.6842,-0.9015 C C C - L=2 N~2 C C C PROGRAM FOLLOWS BELOW C 10 20 30 • •••••••••••••••••••••••• (PAGE 2) DIMENSION AAI21.8BI21,RRI21,GG(2),FF(2),C(2) NI-N LI-l NN=NI*NI NN2-NN+1 NN3-NN2+NN NN5-NN3+NN+NN NN6=NN5+NI lAB=lI *NN IF1=LI*NI-Nl+l CAll MOVREV~NI,1.FFIIFl),I,FF(IF1),-I.) J=Ifl-NI DO 10 I=NN2,LAS.NN CALL MATML3tl,NI,NI,FFIIF1),BBlt),0.,FFIJI,1) J=J-N I CALL MOOT3 tl.NI,NI,ll-1,FF,RRINN21,-1.,CINN5).1.1 CALL MOVREVIIF1-1,1,FF,1,FFINI+1',l.) J=NN5 DO 20 I=I,NI CeJ)-GG( I )-CIJI J-J+1 CALL MATMl3(l,Nl,NI'CINN5"CINN31,0.,CINN6),0) J=l 00 30 I=l,lAB,NN CALL MATML3(l,NI,NI,CINN6),AAII),O •• FFIJ),1-11 J=J+NI RETURN END 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 •••••••••••••••••••••••• MLI2A6 • •••••••••••••••••••••••• PROGRAM LISTINGS • "• ....................... .MLI2A6 •••••••••••••••••••••••• 9/29/64 MLI2A6 (SUBROUTINE) • FAP -MLI2A6 COUNT 200 LBL MLI2A6 ENTRY MLI2A6 (MLI,MLIHDL.NCRS) LAST CARD IN DECK IS NO. 0217 0001 0002 0003 0004 0005 0006 0007 . ----ABSTRACT---• 0008 • TITLE - MLI2A6 0009 CONVERT MACHINE LANGUAGE INTEGER TO EQUIVALENT HOLLERITH 0010 • 0011 MLI2A6 CONVERTS A MACHINE LANGUAGE INTEGER (CONSIDERED 0012 • DECIMAL) INTO A 2-REGISTER FORTRAN VECTOR D~ EQglVALENT 0013 • HDLlERI1H (FORMAT(2A6)I WITH LEADING ZEROES SUP~RESSED. 0014 • PLUS SIGN SUPPRESSEO. SIGNIfICANT DIGITS RIGHT ADJUSTED, 0015 AND MINUS SIGN IIF PRESENT) RIGHT ADJUSTED AGAUISl MOST 0016 • SIGNIfICANT DIGIT. 0017 • 0018 •• LANGUAGE - fAP SUBROUTINE (fORTRAN II COMPATIBLE) 0019 • EQUIPMENT - 709 OR 1090 (MAIN FRAME ONLY) 0020 0021 • STORAGE - 128 REGISTERS 0022 • SPEED • AUTHOR - S.M. SIMPSON JR., JUNE 1962 0023 0024 • -';'-USAGE--0025 • 0026 .. TRANSFER VECTOR CONTAINS ROUTINES - NONE 0027 .. AND fORTRAN SYSTEM ROUTINES - NONE 0028 0029 • .. fORTRAN USAGE 0030 • CALL MlI2A6(Mll.MLIHOl.NCRSI 0031 0032 .. INPUTS 0033 0034 Mll IS THE MACHINE LANGUAGE INTEGER. 0035 • 0036 •.. OUTPUTS 0037 0038 • MlIHOL IS THE HOLLERITH EQUIVALENT Of Mll IN 2A6 fORM~Tj 0039 0040 • " IS THE NO. Of NON-BLANK CHARACTERS INVOLVED (INtLUDING 0041 • NCRS THE MINUS SIGN If PRESENT). 0042 0043 • 0044 - EXAMPLES 0045 • 1. INPUTS - MLI OCT 173 I~OECIMAl 123) 0046 • OUTPUTS - MlIHOUil,2) = OCT 606060606060,.606060010203 NCRS"') 0047 0048 .. 2. INPUTS - Mll • OCT 400000000173 I-DECIMAL -123) 0049 • OUTPUTS - MLIHOL(:l,2)= OCT 606060606060,606040010203 NCRS*4 0050 0051 0052 - 3. INPUTS - Ml1 • OCT 144 1= DECIMAL 100) 0053 • OUTPUTS - MLIHOL(1.2)= OCT 606060606060.606060010000 NCRS*3 0054 0055 - 4. INPUTS - MLI OCT 0 (= +0) 0056 .. OUTPUTS - MLIHOL~1,21 = OCT 606060606060,606060606000 NCRS"'l 0057 .. 5. INPUTS - MLI = OCT 400000000000 (s -0) 0058 0059 OUTPUTS - MllHOltl,2) = OCT 606060606060.606060604000 NCR'.Z 0060 • 0061 • 6. INPUTS - MLI OCT 400000000144 (=DECIMAL -1001 0062 • OUTPUTS - MlIHOl{l,21 = OCT 606060606060.606040010000 NtRS"'4 0063 • 0064 • 7. INPUTS - MLI = eCT 777777777777 (=DECIMAL -3435973B367) 0065 • OUTPUTS - MUHOU:l,21 = OCT 400304030511,070310030607 NCRS.U 0066 HTR o 0067 BCI 0068 1. MLI 2A6 MLI2A6 SXA 0069 EXIT .1 SXA EXIT+1.2 0070 SXA 0071 EXIT+21i4 M1I2A6-2,4 0072 SXO CLA 0073 1.4 0074 STA GEll - • - . . .. . . . . . - .. = = = . .._.............. ......... ......MLI2A6 .................. ... , ' (PAGE PROGRAM LISTINGS ........................... .. MlI2A6 • ......................... 2) CLA 2,4 STA PUT2A SU8 Kl STA PUT28 CLA 3,4 STA PUT3 • STORE MAGN(MLII AND SET FOR SIGN. GET1 C L A . . A(MLII TMI NEG STO MLI STZ NCRS CLA SPACE STOSN STO SIGN TRA CNVRT NEG SSP STO MLI CLA K1 HO NCRS CLA MINUS TRA STOSN • NOW CONVERT THE MAGNITUDE INTO TWELVE REGISTERS. .. XRl IS THE DIGIT iNDEX =11,10, ••• ,1 • XR2 IS THE DIGIT 0,1, ••• 9 • XR4 IS A LEADING ZERO SUPPRESS INDICATOR • XR4 = 1 MEANS CONVERT DIGIT=O TO SPACE • = 0 MEANS DONT SUPPRESS A ZERO DIGIT. CNVRT lXA Kl.4 CLA SPACE STA HOLVl-5 CLA MLI S~D TEMP LXA K1t,1 GTEMP CLA TEMP LXA KO,2 • (NOTE - ZEROES ARE PLUS ZEROES IN SU8TRACTIONS BELOW) SUB SUB POWRS+l,l TMI ADO TXI SUB,2,1 .. (NOTE - ZEROES WILL BE MINUS ZERO IN ADDITION BELOW, BUT NO HARM.' ADD ADO PO~RS+l,l STO TeMp • AT THIS POINT XR2 CONTAINS DESIRED DIGIT. .. STORE DIGIT IF tSUPPRESS IS OFF) OR (SUPPRESS IS ON AND THIS IS DIGIT .. 11. TXL PXA.4,O TXL STNDGS.1,1 .. OTHERWISE SUPPRESS DIGIT IF ZERO PXA 0,2 TZE GTSPA • IF GETS HERE, THIS IS FIRST DIGIT~ TURN OFF SUPPRESS, SET NDIGS, .. SET NOIGS, SET SIGN CHARACTER, AND STORE DIGIT. LXA KO,4 STNDGS SXA NDIGS,l CLA SIGN S~A HOLV2,1 TRA PXA .. THIS SETS SPACE IN PLACE OF LEAOING ZERO. GTSPA CLA SPACE TRA STA PXA PXA 0,2 STA S~A HOLV2+1,1 fiX GTEMP,l,l • STORE NCRS. CLA NDIGS ADO NCRS STO NeRS • NOW FOKM MLIHI AND MLIH2 BY .. PACKING UP HOLVI AND HOLV2 RESPECTIVELV. STZ MLIHI STZ MLIH2 CLA K30 STO LSH 1FT LXA K6.1 STSHFT etA LSHIFT STA LGll (PAGE 0015 0016 0011 0018 0079 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 21 •••••••••••••••••••••••• Mll2A6 ••••••••••••••••••••• * •••• (PAGE PROGRAM LISTINGS 3) STA lGL2 CAL HOlVl+1,1 lGll lGL •• ORA MlIHl SlW MUHl CAL HOlV2+1,1 lGl2 lGL •• ORA MUH2 SlH MlIH2 ClA lSHIFT SUB K6 STO lSHIFT TlX STSHFT fl, 1 TRA LEAVE • LEAVE, STORING RESULTS LEAVE CLA NCRS ALS 18 pun STO •• CLA MUHl PUT2A STO •• CLA MUH2 PUT2B STO •• EXIT AXT .*,1 •• ,2 AXT AXT *.,4 4,4 TRA • CONSTANTS DEC 10600000000 OEC 1000000000 DEC 100000000 DEC 10000000 DEC 1000000 DEC 100000 DEC 10000 DEC 1000 DEC 100 DEC 10 POWRS DEC 1 SPACE OCT 60 MINUS OCT 40 KO PZE 0 Kl PZE 1 K6 PZE 6 KI0 PZE 10 Kll PZE 11 K30 PZE 30 - TEMPORARIES MLI PZE *. SIGN PZE PZE •• PZE PZE PZE PZE •• HOLVI PZE •• PZE PZE •• PZE PZE •• PZE •• HOlV2 PZE •• MUHl PZE •• MUH2 PZE •• NDIGS PZE •• NCRS PZE •• LSHIFT PZE •• TEMP PZE •• END -- .-.-*. _. .- 30,24, •••• 0 30,24, •••.••• ,0 A(NCRS) A(MlIHOLl U 1 A(MLIHOL (2)) MAGN nUOE OF MLI = OCT 60 OR OCT 40 SPACE OR MINUS 0,1,,2, •••• 9 DR SPACE OR MINUS ETC ETC ETC ETC ETC ETC ETC ETC ETC 0.1.2, ••• ,9 (NOT SPACE OR MINUS) COMPLETED HOL FOR MLIHOLlll COMPLETED HOL FOR MLIHOL(2) 1,2, ••• ,11 30t24,~ •• ,O •..••••••••••••••••••••••• M1I2A6 • •••••••••••••••••••••••• (PAGE 31 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 OU3 0214 0215 0216 0217 •••••••••••••••••••••••• • MlISCl • •••••••••••••••••••••••• PROGRAM LISTINGS •••••••••••••••••••••••• MllSCl • •••••••••••••••••••••••• • 9129/64 lAST CARD IN DECK IS NO. 0114 • MLISCl ISUBROUTINE) 0001 • FAP .MLISCl 0002 COUNT 100 0003 lBl MllSCl 0004 0005 ENTRY MlISCl IMlIV,lMlIV,ISCAlE,MlIVSC,IANS) 0006 • ~--ABSTRACT---0007 • 0008 •.. TITLE - MLISCl 0009 0010 MULTIPLY AN MLI VECTOR BY A FORTRAN FIXED POINT INTEGER • 0011 • 0012 MLISCl "ULTIPlIES EACH ELEMENT OF AN MLI VECTOR BY A • GIVEN FORTRAN FIXED POINT INTEGER, CHECKING FOR OVERFLOW. 0013 • 0014 •.. LANGUAGE - FAP SUBROUTINE IFORTRAN II COMPATIBLE) 0015 0016 • EQUIPMENT - 709 OR 1090 IMAIN FRAME ONLY) 0017 - 47 REGISTERS • STORAGE 0018 - lENGTH OF VECTOR TIMES 25 MACHINE CYCLES • SPEED 0019 - S.M. SIMPSON JR, JUNE 1962 • AUTHOR 0020 • 0021 - ....~-USAGE--• 0022 0023 • TRANSFER VECTOR CONTAINS ROUTINES - NONE 0024 • AND FORTRAN SYSTEM ROUTINES - NONE 0025 •.. FORTRAN USAGE 0026 0027 • CALL MLISCLIMLIV,LMLIV,ISCALE,MLIVSC,IANS) 0028 0029 • INPUTS 0030 0031 MLIVI I ) I=l ••• lMlIV IS THE MLI VECTOR • 0032 0033 LMLIV MUST EXCEEO 0 • 0034 • 0035 IS THE FORTRAN FIXED POINT MULTIPLIER. I SCALE • 0036 • 0037 • OUTPUTS 0038 • 0039 .. MLIVSCII) l=l ••• lMLIV =ISCALE"MLIV(l.~.LMLIVI AS A MLI VICTOR~ 0040 • INOTE MLIVSC MAY BE EQUIVALENT TO MlIV}. 0041 • 0042 IANS = 0 MEANS JOB DONE OK • 0043 =-1 MEANS ILLEGAL LMLIV • 0044 "'-2 MEANS OVERFLOW OCCURREO. • 0045 • 0046 • EXAMPLES 0047 0048 .. 1. INPUTS - MLIV= OCT 1,2,3 LMLIV=3 ISCALE=4 0049 OUTPUTS - IANS=O MlIVSC= OCT 4,10,14 • 0050 •• 2. INPUTS - SAME AS EXAMPLE 1 EXCEPT LMlIV=-2 0051 0052 • OUTPUTS - IANS=-l 0053 •• 3. INPUTS - SAME AS EXAMPLE 1. EXCEPT MlIVI1)= OCT 371777711771 0054 0055 .. OUTPUTS - IANS=-2 0056 •• 4. INPUTS - MLIV(1)= OCT2 LMLIV=1 ISCALE=5 0057 0058 .. OUTPUTS - MLIVSCt1) • OCT12 IANS=O 0059 • 0060 HTR 0 0061 BCI I, MLI SCL 0062 MLISCL SXA EXIT .1 0063 SXO MLlSCL-2.4 0064 CLA AIAIMlIV1) 1.4 0065 ADO Kl 0066 lDQ STA (1067 CLA 2,4 AIAILMLIV)) 0068 STA GET2 0069 3,4 CLA AIAIISCALEll 0070 STA GET3 0071 4,4 AIAIMlIVSCl1 CLA 0072 ADO Kl 0073 STQ STA 0074 5,4 AIAIIANSII CLA . . . . •••••••••••• **** •••• ** •• • MlISCl • PROGRAM LISTINGS •••••••••••••••••••••••• I PAGE 2) STA PUT5 • GET lMlIV.ISCAlE. AND CHECK lMlIV. ClS K1 STO IANS GET2 C l A . . AIlMlIVI ARS 18 STO lMLlV TMI lEAVE HE LEAVE GET3 C l A . . AIISCAlEI ARS 18 STO I SCALE • SET IANS FOR POSSIBLE OVERFLOW DURING lOOP. CLS K2 STO IANS • LOOP. CHECKING fOR OVERflOW. lXA LMLIV. 1 lDQ 109 •• ,1 AIMlIV)+l MPY ISCALE STQ STQ •• ,1 AIMLIVSCI+I TNI LEAVE TIX lDQ,I,! * ALL OK IF fAllS THRU LOOP. CLA KO STO IANS * SET IANS AND EXIT. lEAVE CLA IANS ALS 18 PUT5 S T O . . AIIANSJ EXIT AXT •• ,1 TRA 6.4 • CONSTANTS KO PZE 0 K1 PIE 1 K2 PIE 2 • VARIABLES lMLIV PZE .. ISCAlE PIE •• IANS P Z E . . -1.-2.0 END •••••••••••••••••••••••• MllSCl • • • •••••••••••••••••••••• * IPAGE 0015 0016 0071 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 21 •••••••••••••••••••••••• - MONOCK - •••••••••••••••••••••••• PROGRAM LISTINGS • ••••••••••••••••••••••• MONOCK • ••••••••••••••••••••••• - .. MONOCK (SUBROUTINE) 9/4/64 LAST CARD IN DECK IS NO. 0164 .. FAP 0001 -MONOCK 0002 COUNT 100 0003 LBL MONOCK 0004 ENTRY MONOCK (X, LX, ZFNDCR, IANSNG, IANS) 0005 0006 0007 ----ABSTRACT---0008 0009 0010 • TITLE - MONOCK • CHECK VECTOR FOR MONOTONE INCREASING OR DECREASING BEHAVIOR 0011 0012 • MONOCK CHECKS EITHER THAT A GIVEN VECTOR IS MONOTONE 0013 • INCREASING (NON-DECREASING) OR THAT IT IS MONOTONE 0014 • DECREASING (NON-INCREASING). MINIMUM VECTOR LENGTH IS 0015 2. VECTOR MAY BE FIXED OR FLOATING POINT, AND MONOCK 0016 FORCES THE SIGN BIT POSITIVE FOR ALL VECTOR ELEMENTS OF 0017 • ZERO MAGNITUDE. 0018 • 0019 • - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) 0020 • LANGUAGE 0021 • EQUIPMENT - 709.7090.7094 (MAIN FRAME ONLY) - 48 REGI STERS 0022 - STORAGE .. SPEED - (709.7090) 50+8.LX MACHINE CYCLES. LX VECTOR LENGTH 0023 .. AUTHOR - S.M. SIMPSON, JUNE 1964 0024 0025 0026 0027 ----USAGE---0028 • .. TRANSFER VECTOR CONTAINS ROUTINES - INOT ANY) 0029 .. AND FORTRAN SYSTEM ROUTINES - (NOT ANY) 0030 0031 •.. FORTRAN USAGE 0032 .. CALL MONOCK(X, LX, lFNDCR, IANSNG, IANS) 0033 0034 • 0035 .. INPUTS 0036 0037 XII) I = 1 ••• LX IS THE VECTOR, MAY BE FIXED DR FLOATING. 0038 0039 0040 LX SHOULD EXCEED 1. 0041 • ZFNDCR 0042 =0 REQUESTS A CHECK FOR NON-DECREASING BEHAVIOUR. NOT= 0 REQUESTS A CHECK FOR NON-INCREASING BEHAVIOUR. 0043 • 0044 IANSNG IS THE DESIRED IANS OUTPUT IF THE CHECK FAILS. 0045 0046 0047 .. OUTPUTS STRAIGHT RETURN WITH NO OUTPUT IF LX LSTHN= O. 0048 0049 XI I ) OUTPUT WILL EQUAL XII) INPUT EXCEPT THAT THE SIGN BIT 0050 OF ALL ZERO MAGNITUDE VALUES, IF ANY, WILL BE POSITIVE 0051 ON OUTPUT. THIS WILL BE TRUE REGARDLESS OF THE 0052 • OUTCOME OF THE TEST. 0053 0054 • I ANS o IF LX = 1, OR IF XII) PASSES THE TEST. 0055 IANSNG IF X( II FAILS THE TEST • 0056 0057 • 0058 .. EXAMPLES 0059 0060 • 1. INPUTS - IXlI1 ••• 5) = 1,2,2,3.4 IX2(1 ••• 5) = 1,2,1,3,4 0061 0062 IANS7 = 43 XlI1 ••• 5) 4.,3.,2 •• 2 •• 1. 0063 X211 ••• 5) = 4.,3 •• 1.,2.,1. USAGES CALL MONOCK!IXl.5,D.,-I,IANS1) 0064 CAll MONOCKIIX2,5,0.,-2,IANS2) 0065 CALL HONOCK! Xl,5,1.,-3,IANS3) 0066 CALL HONOCK! X2,5,1.,-4,IANS4) 0067 CALL HONOCKIIX2,2,0.,-5,IANS5) 006B 0069 CAll HONOCKIIX2,1,0.,-6,IANS6) CALL MONOCKIlx2,0,0.,-7,IANS7) 0070 OUTPUTS - IANSl,IANS2, ••• ,IANS7 = 0,-2,0,-4,0,0,43 0071 0072 IX4(1 ••• 3) = +0,-0,+0 0073 2. INPUTS - IX311 ••• 3) 0074 IX5(1 ••• 3) lX6(1 ••• 31 = -0,+0,-0 --. . -- ...-. . ... ... . .. ... ... . ... . ... ... ..... ... .. - .•••••••••••••••••••••••• • •••••••••••••••••••••••• • ••••••••••••••••••••••• MONOCK • • ••••••••••••••••••••••• PROGRAM LISTINGS • MONOCK (PAGE 2) • -0,+0,-1 IX811 ••• 3) = +0,-0,+1 IX10 • -0 USAGES CALL MONOCK(IX3, 3,0., -8,IANS8) CALL MONOCKIIX4, 3,1., -9,IANS91 CALL MONOCKtIX5, 3,0.,-10,IANSI0) CALL MONOCKIIX6, 3,1.,-11,IANS11) CALL MONOCKIIX1, 3,0.,-12,IANSI2) CALL MONOCKIIX8, 3,1.,-13,IANSI3) CALL MONOCKIIX9, 1,0.,-14,IANSI4) CALL MONOCKIIXI0,I,i.,-i5,IANSI5) OUTPUTS - lANS8 ••• IANSI5 0,0,0,0,-IZ,-13,0,0 IX311 ••• 3) ,. IX4(1 ••• 3) IX511 ••• 3 ) . IX6(1 ••• 3) +0,+0,+0 +0,+0,+1 IX111 ••• 3) +0,+0,-1 IX811 ••• 3) IX9 ,. IXI0 +0 IX111.~.l) • " • • " " " .. • .. .. .. IX9 = = .. = ." • .. • • • " • • IPAGE = = PROGRAM FOLLOWS 8ELOW NO TRANSFER VECTOR HTR BCI ONLY ENTRY. MONOCK SXD CLA STA STA ADD STA STA STA CLA. STO LOO" . o XR4 I,MONOCK HONOCK(X, LX, ZFNDCR, IANSNG, IANS) MONOCK-Z,4 1,4 CASI CAS2 Kl CLAI CLA2 CLA3 4,4 IANSNG 3,4 AIX) A(X)+l IANSNG BROUGHT IN ZFNOCR IN MO FOR A WHILE .. CHECK OUT LX AND, IF OK, SET IT IN XR4. 1, EXIT IF LX • IT IS ZERO MAGNITUDE. " CLAI CLA" TMI HE POX CLA TNZ STZ" PXO XCA TXI TXL TNZ 2,4 TRA TRA 0,4 +0 IF THEN SET XILX) OTHERWISE BRANCH TO LOOP. LX INo ACTION EXITS) •• ,4 ** ,. AIX)+I, GIVES ZFNDCR IN AC, LX-l IN XR4 +0 CLAI 0,0 *+1,4,-1 LEAVE,4,0 CLA3 * • INCREASING CASE. COMPARE XIJ) IN AC AGAINST • lAND FORCE ZEROES POSITIVE) •CLA2 CASI "• CLA TNZ SSP STO. CAS LOQ TIX TlX TRA •• ,4 CAS2 CLA TNZ SSP STO· CAS TIX ". '" AIX)+1 CASI CLA2 •• ,4 IANSNG CLAZ, 4, 1 CLA2,4,1 LEAVE DECREASING CASE. •CLA3 X(LX) "+Z ." AIX) NG OK OK SAME COMPARISON SEQUENCE. •• ,4 CAS2 ". = AI Xl+l CLA3 .*,4 CLA3,4,1 .. OK A(X) IN MO X(J+l) J LX-i, ••• ,1 0015 0016 0011 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 2) •• * •••••••••• - •••• __ •••• - PROGRAM LISTINGS - I'ONOCK •••••••••••••••••••••••• (PAGE 31 TlX -• TRA LOO TIX • LEAVE LXO STOTRA TRA (PAGE TIX IANSNG CLA3,4,1 • EXIT SETTING IANS • ••••••••••••••••••••••• MONOCK • ••••••••••••••••••••••• • FROM MO. MONOCK-2,4 5,4 6,4 OK NG 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 • CONSTANTS, TEMPORARIES 0160 Kl PZE IANSNG PLE END 0161 0162 0163 0164 - 1 ··.··t·· - 31 .•••••••••••••••••••••••• .. MOUT PROGRAM LISTINGS 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 C C C C C C C C C MOUT (SUBROUTINE) LABEl HOUT • ••••••••••••••• **.** •••• •••••••••••••••••••••••• .. CMOUT • • • • • • • • • • • • cII . . . . . . . . . . . . .. LAST CARD IN DECK IS NO. 0100 0001 0002 SUBROUTINE MOUT {ITAPE,NSPACE,X.XNAME,NRX,NCX,LX} 0003 0004 0005 ----ABSTRACT---0006 0007 TITLE - MOUT MATRIX OUTPUT IN G FORMAT 0006 0009 MOUT WRITES A VECTOR OF MATRICES ON AN OUTPUT TAPE. THE 0010 MATRICES ARE ASSUMED TO BE STORED TIGHTLY PACKEO BY 0011 COLUMNS. THE MATRIX IS HEADED BY A LINE SUCH AS 0012 0013 MATRIX I 1 ••• 3, 0014 1 ••• 2 ) '" 0015 AND THEN EACH SUCCEEDING ROW IS PRINTEO IN FORII'IAH5G15.7J 0016 WITH DOUBLE SPACES BETWEEN ROWS AND TRIPLE SPACES BETWEEN 0017 MATRICES. 0018 0019 0020 LANGUAGE - FORTRAN II SUBROUTINE EQUIPMENT - 709 OR 7090 (MAIN FRAME AND TAPE UNIT) 0021 0022 STORAGE - 130 REGISTERS SPEED 0023 AUTHOR 3/64 0024 - R.A. WIGGINS 0025 0026 0027 ----USAGE---0026 TRANSFER VECTOR CONTAINS ROUTINES - CARIGE 0029 AND FORTRAN SYSTEM ROUTINES - (FIl),ISTH) 0030 0031 FORTRAN USAGE 0032 0033 CAll MOUT fITAPE,NSPACE,X,XNAME,NRX,NCX,LXI 0034 0035 INPUTS 0036 0037 0038 ITAPE LOGICAL TAPE NUMBER FOR OUTPUT 0039 NSPACE NUMBER OF SPACES FOR CARRIAGE TO BE MOVEO 8EFORE PRINTING 0040 IF LSTHN O. THE PAGE IS RESTORED. 0041 0042 0043 XIII I=l ••• NRX,l ••• NCX,l ••• lX IS THE VECTOR OF MATRJCES TO BE WRITTEN. THE COLUMNS, AND MATRICES, MUST BE CLOSElY 0044 SPACED. 0045 NEED NOT BE FLOATING POINT. 0046 0047 XNAME IS A 6, OR FEWER, CHARACTER HOLLERITH NAME FOR THE ARRAY. 0048 0049 NRX NUMBER OF ROWS IN EACH X MATRIX. 0050 MUST BE GRTHN= 1 0051 0052 0053 NCX NUMBER OF COLUMNS IN EACH X MATRIX. 0054 MUS T BE GRTHN= 1 0055 0056 NUMBER OF MATRICES IN X. LX MUS T BE GRTHN~ 1 0057 0058 0059 NOTE - THE LEGALITY OF ITAPE, NRX, NCX, AND LX IS NOT CHECKED. 0060 0061 0062 OUTPUTS - ARRAY IS WRITTEN ON TAPE ITAPE. 0063 0064 0065 EXAMPLES 0066 0061 1. INPUTS - ITAPE ~ 2 NSPACE = 1 XNAME = IHX XI 1 ••• 2.1 ••• 2, 1 ••• 21 = 1.,2.,3.,4. ,6,7,8,9 0068 0069 NRX = 2 NCX = 2 LX = 2 0070 OUTPUTS - THE FOLLOWING LINES ARE WRITTEN ON LOGICAL TAPE 2 • X (1... 2, 1... 2, 1... 2 -) '" 0071 0072 0073 1.0000000 3.0000000 0074 9/B/64 •••••••••~ •••• * •••• * •••• PROGRAM LIS TI NGS .......................... • MOUT IPAGE • 2.0000000 4.0000000 C C .6 8 C C 1 9 C C C PROGRAM FOllOWS BELOW C 10 20 30 40 MOUT • •••••••••••••••••••••••• IPAGE 2) 2) C •••••••••••••••••••••••• • DIMENSION X('2) CALL CARIGE IITIPE,NSPACE) WRITE OUTPUT TAPE ITAPE, 10,XNAME,NRX,NCX,lX FORMAT(3XA611H t 1 ••• I5,7H, 1 •• ~15,7H. 1 ••• I5,5H , '" J lXM=NRX.NCX lXT=lXM.lX DO 40 11=I.lXT,LXM Jl'"ll+NRX-l J2=Il+lXM-l DO 30 I2=Il,Jl WRITE OUTPUT TAPE ITAPE, 20, (XII),I=I2,J2,NRX) FORMATI/15X5GI5.1») CONTINUE CALL CARIGE (ITAPE,l) CONTINUE RETURN END 0075 0016 0077 0018 0079 0080 0081 00B2 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 ••••••••• *••••••••• •••• ~ • MOUTAI •••••••••••••••••••••••• • MOUTAI· • •••••••••••••••••••••••• PROGRAM LISTINGS • •••••••••••••••••••••••• • MOUTAI (SUBROUTINE) 9/4/64 LAST CARD 1M BECK IS NO. 0294 • LABEL 0001 CMOUTAI 0002 SUBROUTINE ~nUTAI(ITAPE,NSPACE,FOFIJ,FNAME.LI.LJ.IDIMEN; 0003 1 NDIGS,SCALE,SPACEl 0004 C 0005 C 0006 C ---ABSTRACT--0007 C OOM C TIlLE - MOUTAI C OUTPUT A MATRIX AS INTEGERS DENSELY PACKED OFF-L,INE 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 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 MOUTAI IS DESIGNED FOR TIGHTLY PACKED PRIN·TED fJUTPtlT OF RELATIVELY LOW ACCURACY MATRIX OATA. MOUTA. FINDS OR IS GIVEN A SUITABLE SCALE FACTOR TO CONVERT A 'LOATING POINT MATRIX TO FIXEO POINT OATA WITH A SPECIF.ED MAXIMUM NO. 11 TO 5) OF DIGITS. THESE ARE THEN PRINTEa IN FORMAT OF 6012, OR 4013, OR 3014. OR 2515, OR 2016 RESPECTIVELY. VARIOUS SCALING OPTIONS EXIST, BUT THE ORIGINAl MATRIX ALWAYS REMAINS UNDISTURBED SINCE THE SCALING IS D9NE ROW BY ROW INTO A SCRATCH VECTOR PROVIDED BY TME USERJ LANGUAGE EQUIPMENT STORAGE SPEED AUTHOR - FORTRAN II SUBROUTINE 709 OR 7090 (MAIN FRAME PLUS 1 TAPE DRIVE) 357 REGISTERS A MATRIX F OF DIMENSION F(50.20) TAKES ABOWT .48 SECONDS ION THE 7094) IF MOUTAI DOES THI SCALING' ABOUT .42 SECDNOS IF F IS ALREADY FIXED PO.NT. - S.M. SIMPSON. MARCH 1964 .---USAGE---- TRANSFER YECTOR CONTAINS ROUTINES - CARIGE.GNHOL2,MAXABN,RNO."OVE' MULPLY,FIXVR,SAME ANO FORTRAN SYSTEM ROUTINES - eXp(2,IFIL),LOG,(ST~) FORTRAN USAGE CALL MOUTAI IITAPE, NSPACE, FOFIJ, FNAME. Llo LJ. IOIMEN. 1 NDIGS~SCALE.SPACE) INPUTS ITAPE IS LOGICAL TAPE NO. FOR OUTPUT SHOULD LIE BETWEEN 1 AND 20 (NOT CHECKED) NSPACE IS DESIRED NO. OF INITIAL BLANK LINES BEFORE OWTPUT BEGINS. MAY BE ZERO. IF LESS THAN ZERO A PAGE RESTORE IS CREATED. FOFIJ'I,J) l=l.J.LI, J=l ••• LJ IS THE LI BY LJ MATRIX TO BE PRINTED. FOFIJ IS FLOATING POINT EXCEPT IN THE CASE SCALE = 0.0 AS DESCRIBED BELOW. FNAME IS 6 HIDllERITH (FORMAT,flA6)) .TO BE USED AS A tABEt FOR FOF IJ. C C C C C C LI SHCULO EXCEED ZERO INOT CHECKED) LJ SHOULD EXCEED ZERO INOT CHECKED) IDIMEN IS THE VALUE TO WHICH THE INDEX I IN FOFIJ II,J) IS OIMENSIONEO IN THE CALLING PROGRAM C C C C C C C C C NOIGS SPECIFIES THE MAXIMUM NUMBER OF DIGITS (EXCLUSIVE OF SIGN) WHICH MAY BE USED TO EXPRESS THE SCALED VALUES OF THE MATRIX. NDIGS MAY ONLY HAVE VALues 1.2~3.4. OR 5. fHE FIELD WIDTH IN PRINTING WILL BE ONE GREAtER THAN NDIGS. C C OO~ = SCALE SPECIALIZES THE TYPE OF SCALING TO BE PERFORMED. FOR SCALE=O.O. IT IS ASSUMEO THAT FOFIJ (S ALREADY IN INTEGER FORM (COMPATIBLE WITH NOIGS). IN THIS CASE 0066 0067 0068 0069 0070 0071 0072 0073 0074 ......................... MOUTAl •••••••••••••••••••••••• • MOUTAI .. •••••••••••••••••••••••• (PAGE 21 PROGRAM II STINGS , , • • •••••••••••••••••••••••• IPAGE 2) MOUTAI DOES NO SCALING. C C C C C C C C C C C C C C C C C IF StALE EXCEEDS 0.0, IT IS ASSUMED THAT SCAtE IS A SCALE FACTOR THE CALLING PROGRAM WISHES MOUTAI TO USE AS FOLLOWS, OUTPUT INTEGER", (SCALE" FOHJ) ROUNOED Till :fNTEGER.I IF SCALE=-I., MOUTAI FINOS ITS OWN SCALE FACtOR. THE FACTDR RESTRICTED TO BEING A POWER OF 10; SU€H THAT THE LARGEST OUTPUT MAGNITUOE, CALL IT MAXMAG~ WILL SATISFY 10EXPCNOIGS-l1 LSTHN= MAXMAG LSTHN 10EXP(NDtGS). IF SCALE=-2., MOUTAI FINDS ITS OWN SCALE SUCR THAT 'HE lARGEST OUTPUT MAGNITUDE, MAXMAG, WILL =10EX.CNDIGS-l'_ SPACE!I) C C C C OUTPUTS C C C C C C EXAMPLES C C 1. INPUTS C C C USAGE C C C C l=l ••• ll+1 MUST 8E AVAILABLE FOR SCRATCH THE ONLY OUTPUT WILL BE ON LOGICAL ITAPE. VAlUES ALONG ROWS ON THE PRINTED PAGE WILL CORRESPOND TO INCREASING VALUES OF THE INDEX I IN FOFIJII.JI. SEE EXAMPLES BELOW FOR GENERAL FORMAT. = FOFIJI1 ••• 9.1 ••• 21 11.,21 ••••• ,91 ••• IFOFIJIl ••• 75) - 1,2, ••• ,75 DIMENSION FOFIJCI5.2),IFOFIJI15,1).SPACfC16) DO 10 NDIGS=1,2 tALL MOUTAI12,2.FOFIJ.6HFOFIJI,9,2.1.5.NDtGS",U 1 SPACE) CALL MOUTAI12,2.FOFIJ.6HFOFIJ2.9.2.15.NDIGS_-IJ. 1 SPACE) CALL MOUTAI12,2.FOFIJ,6HFOFIJ3.9.2,15.NDIGS.-2.1' 1 SPACE) tALL MOUTAII2.2.lfOFIJ.6HIFOFIJ.75.H75,IiIDIGSjO., 1 SPACE) C C C C C -12J.-2Z.4J~~.-9J. 10 C C C C OUTPUTS - 64 OUTPUT LINES ARE CREATED ON LOGICAL 2 J COLUMNS 2 THRU 51 ARE SHOWN BELOW ICOLUMN 1 IS ALWAYS BLANK.. 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 9 9 FOFIJ3(I,J)" 0.10810E-DI ANO ROUNDED J I =1 ••• 9 I =1 .~. 75 11 0 0 0 0 1 1 1 1 1 2/-0-0-0-0-1-1-1-1-1 IFOFIJII,J) J 1/ 1 2 3 4 5 6 7 8 910111213141516171819202122 0075 0076 0071 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 008$ 0690 0091 0092 0093 0094 0095 0096 0091 0098 0099 0106 0101 0102 0103 0104 0105 0106 0107 0108 0109 Otl0 0111 01la 0113 0114 0115 0116 Ot11 0118 OU9 0120 0121 0122 0123 0124 0125 0126 Oll7 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 ·...•...•.•.....•....-.. • MOUTAI f ••••••••••••••••••••••• PROGRAM LI STINGS .. "MOUTAI (PAGE 3) I PAGE 616263646566676869707172731475 C C C FOFIJIII,JI .. C 0.10000E 00 ANO ROUNOED C I J c = 1 • .1. 9 11 1 2 3 4 5 6 1 8 9 21 -1 -2 -3 -4 -5 -6 -7 -8 -9 C C C C FOFIJ21I,J) .. C 0.10000E 01 AND ROUNDED C I = 1 J C 9 C C 1/ 11 21 31 41 51 61 11 81 91 2/-12-22-32-42-52-62-72-82-92 C C C FOFIHII,Jl C to 0.10870E 00 AND ROUNOED C J C I = 1 9 C 1/ 1 2 3 4 5 7 8 9 10 2/ -1 -2 -3 -4 -5 -1 -8 -9-10 C C C C C C IFOFIJII,JI C J C C C 11 = 1 • J. C C PROGRAM FOLLOWS BELOW C C C DUMMY DIMENSIONS C DIMENSION FOFIJ(21,SPACEI2) C C TRUE DIMENSIONS C DIMENSION FMTI5',NW(4) C C BRING IN SOME INPUTS, DO INITIAL CARtAGE SPACING C lTP = lTAPE LX = LI LY = LJ 101M IDIMEN NDGS " NDIGS SCA = SCALE 81GEST = 10~0 •• NDGS LSP = LX+1 CALL CARIGELITP~NSPACE) = C THE NO. WORDS PER ROW, NWINDGSI, IS C NWI1 ••• 5) = 60, 40, 30, 25, 20 C 30 35 NW IF NW GO NW 75 1 2 3 4 5 6 1 8 9 10 11 12 13 14 1 41 42 43 44 45 46 47 48 49 50 51 52 53 14 5 C C c • •••••••••••••••••••••••• •••••••••••••••••••••••• = 5.19-NDGS) INDGS-2) 35,30,40 = 40 TO 40 = 60 C C CONSTRUCT THE FORMAT FMTI1 ••• 5) C .0 NWI21 = NDGS+1 IF INW-LXI 50,45,50 45 NW=NW+1 50 NW I 3) =NW ( 11 NWI41=NW(2) FOR OUTPUTING ROWS 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0170 0111 0112 0113 0174 0175 0176 0171 0178 0119 0180 0181 0182 0181 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0191 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 3) •••••••••••••••••••••••• MOUTAI • •••••••••••••••••••••••• •••••••••••••••••••••••• MOUTAI • •••••••••••••••••••••••• PROGRAM Ll STINGS • • 4' IPAGE IPAGE CALL GNHOL2 INW'4,41H(9HI1XI4,IH/12,IHIII,4H/C6XI2,lHII1,2HII), 1 FMT,IOUMjIDUM,IDUM) C C NOW WE HAVE TO SET THE SCALE FACTOR SCL C (ANTICIPATE FOR THE CASE SCALE GRTHN= 0.) C SCL = SCA IF ISCAl 100,200,200 C C FOR THE NEGATIVE CASE WE ARE GOING TO NEED THE RESULT FROM C MAXA8M REGARDLESS. TEST THE RESULT FOR ZERO, THEN BRANCH C ON SCALE -I. OR -2. IANTICIPATING A -2.1 = C 100 120 CALL MAXA8M'FOfJJ,LX,LY,IDIM,FMAXAB,TEMP,TEMPI SCL = 0.0 X = A8SF(FMAXA8) IF IX) 120,200,120 SCL = .1.8IGEST/X IF ISCA+l.0) 200,150,200 C C SET SCALING FOR THE CASE SCALE = -1.0 C C THIS IS ALMOST THE SAME AS THE FOLLOWING PROBLEM C GIVEN X GRTHN O. N = INTEGER GRTHN= 0, FIND M = POS. OR NEG. INTEGER SUCH THAT C C 10EXPCN) LSfHN= X*10ExprMI LSTHN C WHOSE SOLUTION IS C M = N - ILOGIX))TRUNCATED + EPS WHERE EPS = 0 IF X GRTHN=O, C ~ 10EXPCN+ll, 1 IF X LSTHN O. C C OUR CASE IS SLIGHTLY OIFFERENT DUE TO A TERMINAL ROUNDING C OF X.I0EXPCMI, WHICH MAY ROUND IT UP INTO 10EXP(N+ll. C C IN OUR CASE N C 150 160 170 180 = NDIGS-l. X = A8SFIFMAXAB) = M NDGS-I-XFIXFI.43429448*LOGFIX)1 IF IX-l.0) 160.170,170 M = M+1 SCL = 10.0•• M IF IRNDFISCt.XI-BIGESTI 200,180,180 SCL = SClIIQ.O C C PROCEED WITH THE HEADING OUTPUT C IF (SCLl 215,205,215 WRITE OUTPUT TAPE ITP,210,FNAME,LX FORMATIIX,A6,5HtI,JI,II,4X,IHJ,30X,10HI = 1 ••• ,I4,I,lH GO TO 700 215 WRITE OUTPUT TAPE ITP,220,FNAME,SCL,LX 220 FORMAT(IX,A8,8H(I,Jl * ,EI3.5,12H AND ROUNDED,II. 1 4X,lHJ,30X,10~1 = 1 ••• ,I4,I,lH I 200 205 210 C C OUTPUT THE ROWS ONE BY ONE, FIRST MOVING THEM INTO C WITH SCALING AND CONVERSION IF NECESSARY C 700 730 740 760 770 C C EXIT DO 770 IXROW=I,LY SPACE'11 = SAMEFIIXROWI IXF = l+(IXROW-l)*IDIM IF ISCL) 740.730,740 CALL MOVEILX,FCFIJIIXFI,SPACE(21) GO TO 760 CALL MULPLY(FOFIJIIXFI,LX,SCL,SPACEt2ll CALL FIXVRISPACEI21,LX,SPACEI211 WRITE OUTPUT TAPE ITP,FMT,(SPACEtll,I=l,LSPI CONTINUE SPACEI2.J~LX~lt 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 OU7 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0213 0274 0275 0276 0217 0278 0279 0280 0281 0282 0283 0284 0285 0286 0287 0288 0289 0290 0291 C '1999 RETURN END 0292 0293 0294 41 •••••••••••••••••••••••• PROGRAM LISTINGS .....••.•.......••...*_. • MOVE • • • MOVE (SUBROUTINE) FAP •....•......_•...•..••.. • MOVE • •••••••••••••••••••••••• LAST CARD 1111 DECK IS NO .. 0091 0001 0002 COUNT 75 0003 MOVE 0004 LBL ENTRY MOVE (~.SOURCE.DEST) 0005 0006 -~--ABSTRACT~--0007 0008 0009 • TITLE - MOVE 0010 • MOVE A VECTOR TO A DIFFERENT LOCATION 0011 MOVE MOVES A VECTOR TO A DIFFERENT LOCATION. OVERLAP 0012 OF THE SOURCE AND OESTINATION VECTORS IS ALLOWED. 0013 0014 0015 • LANGUAGE 1 FAP. SUBROUTINE (FORTRAN II COMPATIBLE) 0016 • EQUIPMENT - 709. 7090, 7094 (MAIN FRAME ONLY) 0017 • STORAGE - 32 REGISTERS 0018 - ABOUT 8*N + 34 MACHINE CYCLES ON THE 7094 WHERE N IS • SPEED 0019 • THE LENGTH OF THE VECTOR. 0020 • AUTHOR - J.F. CLAERBOUT, JUNE, 1962 0021 0022 -"--USAGE--0023 * 0024 • TRANSFER VECTOR CONTAINS ROUTINES NONE 0025 • AND FORTRAN SYSTEM ROUTINES NONE 0026 * 0027 • FORTRAN USAGE * CALL MOVE tN,SDURCE,DEST) 0028 0029 0030 • INPUTS 0031 • 0032 • SOURCE(I) I-I ••• N IS A VECTOR OF WORDS. 0033 • INEEO NOT HAVE FLOATING NAME) 0034 0()35 N IS FORTRAN II INTEGER. 0036 MUST BE GRTHN-O. 0037 • OUTPUTS 0038 0039 DESTI II I=I ••• N IS THE SOURCE VECTOR. INEEO NOT HAVE FLOATING NAME) 0040 • 0041 0042 • EXAMPLES 0043 0044 • LET SOWRCEII),I=l ••• K BE EQUIVALENT TO OESTIJ)_J=l.JJK 0045 • 1. INPUTS - SOURCEtl ••• 3) = 1.,2.,3. N-3 1=1 J=5 0046 • OUTPUTS - OEST(5 ••• 7) = 1.,2.,3. 0047 • 0048 • 2. INPUTS SAME AS EXAMPLE 1. EXCEPT J=2 0049 • OUTPUTS - OESTI2~ •• 41 = 1 •• 2.,3. 0050 0051 • 3. INPUTS - SAME AS EXAMPLE 1. EXCEPT J-l 0052 • OUTPUTS - OESTll ••• 3) = 1.,2.,3. 0053 0054 • 4. INPUTS - SOURCEf3 ••• 5) = 1.,2.,3. N=3 1=3 J=1 0055 • OUTPUTS - OESTll ••• 3) = 1 •• 2.,3. 0056 0057 • 5. INPUTS - SOURCE~I ••• 3) 1.,2 •• 3. N=O I-I J-5 0058 • OUTPUTS - OEST(5~ •• 71 IS UNCHANGED. 0059 • 0060 HTR o 0061 BCI I,MOVE .-2.4 0062 MOVE SXO NZT. 1,4 0063 0064 4,4 TRA 0065 2,4 CLA 0066 ADO -1 0067 STA SPA 0068 STA SPB 3,4 0069 CLA ADO 0070 =1 STA OPA 0071 OPB 0072 STA 2,4 0073 DECIDE WHICH ONE OF THE TWO MOVING CLA 3,4 LOOPS IS BEST I IN CASE OF OVERLAP) 0074 SUB 9/29/64 • • • • • • • • • • • • • • • • • • • • = • .............. * .......... . • MOVE PROGRAM LISTINGS - ••••••••• * ••• * •••• *** ••• (PAGE SPA DPA PB SPB DPB PBL SV4 PB 1,4 ,4 ••• 4 ••• 4 .-2,4,1 SV4 1, " PBL 1,4 .-.4 -.,4 ·+1,4,1 5P8,4,1I. MOVE-2~4 4,4 MOVE •.•••.......... _.-.....-(PAGE 2) TMI eLAPOX eLA Sil"O TIX TRA elASTD AXT eLA STO TXI TXL LXO TRA END _....••..•.•.•.......... II OEST IS IN HIGHER MEMORY Loe SOURCE IS IN HIGHER MEMORY Loe 0075 0076 0077 0078 0079 0080 0081 0082 00B3 0084 0085 0086 0087 0088 0089 0090 0091 21 •••••••••••••••••••••••• • MOVECS PROGRAM II STINGS f ••••••••••••••••••••••• • " 9129/64 LAST " MOVECS (SUBROUTINE) • FAP .MOVECS COUNT 150 LBL MOVECS ENTRY MOVECS (LXY1.X1~Y1 ••••• lXYN.XN.YN) MOVECS • •••••••••••••••••••••••• •••••••••••••••••••••••• IW OECK IS NO. 0105 0001 0002 0003 0004 0005 0006 • 0007 ----ABSTRACT---• 0008 • 0009 • TITLE - MOVECS 0010 • MOVE AN ARBITRARY SET OF VECTORS 0011 • MOVECS IS A VARIABLE-LENGTH-CALllNG-SEQUENOE SlfBROUHNE. 0012 • THE ARGUMENTS ARE CONSIDERED IN TRIPLETS. EACH TRIPLET 0013 • 0014 SPECIFYING THE MOVING OF ONE VECTOR (LENGTH. SOURCE. • DE~TINATION). THE OUTPUT VECTORS MAY OVER~AP THE SOURCE 0015 • VECTORS IN ANY MANNER. 0016 • 0017 "" LANGUAGE - FAP SUBROUTINE IFORTRAN-II COMPATIBLEI 0018 0019 • EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0020 - 24 REGISTERS • STORAGE - 5 + 28tN + 8.M MACHINE CYCLES. WHERE N = NO. VECTORS 0021 • SPEED MOVED. AND M = THEIR COMBINEO LENGTH. 0022 • 0023 - S.M. SIMPSON. AUGUST 1963 " AUTHOR 0024 • 0025 --USAGE---• 0026 •• TRANSFER VECTOR CONTAINS ROUTINES - MOVE 0027 0028 • ANO FORTRAN SYSTEM ROUTINES - (NONE) 0029 • 0030 • FDRTRAN USAGE " CALL MOVECStLXYl.Xl.Y1.LXY2.X2.Y2 ••••• LXYN.XN.YNI 0031 0032 • THE ARGUMENT COUNT MUST BE A MULTIPLE OF 3. IF NOT. 0033 " 0034 AN IMPROPER RETURN WILL RESULT. " 0035 "• INPUTS 0036 0037 • Xl( Il 0038 I=1 ••• LXY1 IS FIRST VECTOR (ANY MODEl TO BE M@VED " 0039 " LXVi EXCEEDS ZERO 0040 0041 •" 0042 ETC " 0043 " 0044 XN(II I=l ••• LXYN IS LAST VECTOR (ANY MODEl TO BE MOVED "• 0045 0046 LXVN EXCEEDS ZERO • 0047 "" OUTPUTS 0048 IF ANY LXY IS ZERO DR NEGATIVE THE CORRESPONOING 0049 VECTOR IS NOT MOVED. • 0050 • 0051 YlC II I-l ••• LXYl WILL - Xll1 ••• LXYl) IF LXYI EXCEEDS 0 • 0052 0053 ETC •" 0054 • 0055 YNCI I l=l ••• LXYN WILL = XNl1 ••• LXYNJ IF LXYN EXOEEDS 0 0056 •" EQ~IVAlENCE IYI~J.XILII PERMITTED FOR ANY K.l 'AIR~ 0051 • 0058 VECTORS ARE MOVED IN SAME ORDER AS THEY APPEAR 'IN THE "• 0059 ARGI:JMENT STRING 0060 • 0061 • EXAMPLES 0062 •" 1. INPUTS - XIl.~.31-1 •• 2 •• 3. IXIl.~.4).1.2.3.4 U-O.O 0063 0064 • USAGE CALL MOVECSI3.X.Y.4.IX.IY.l,IX.IZI 0065 • CAll MOVECSI3.X.W.0.X.U.3.W.ZI 0066 OUTPUTS - Vlt ••• ll-l •• 2 •• 3. IYll ••• 41-l.2.3.4 IZ-l • 0067 • WIl ••• 31 - 1 •• 2 •• 3. U = 0.0 INO OUTPUT CASEI 0068 • Zll.J.31 = 1 •• 2 •• 3. 0069 • 0070 • 2. INPUTS - SAME AS EXAMPLE 1. 0071 "USAGE CALL MOVECSI2.X(2).Xtl),3.IXIl),IX(2)1 0072 " OUTPUTS - XIl ••• 31=2 •• 3.,3. IXIl ••• 4)=1,1.2,3 0073 • CA~D •••,••••••••••••••••• ** •• • MOVECS • ••••••••••••••••• ** ••••• (PAGE 2) PROGR AM LI STINGS •••••••••••••••••••••••• • MOVECS • •••••••••••••••••••••••• (PAGE 21 • PROGRAM FOllO~S BELO~ • • TRANSFER VECTOR HAS MOVEILXY~X.YI HTR 0 XR4 ORIGINAL BCI 1, MOVEtS • ONLY E~TRY. MOVECStLXY1.X1,Yl •••• ,LXYN.XN,YN) MOVECS SXD MOVECS-2.4 • CHECK IF NEXT ARGUMENT IS TSX A.O GETlU CAL 1,4 S~A LXY ISTART SETTING MOVE CALl SEQUENCE' ANA MASK LAS TSXl TRA LEAVE NO TRA MORE YES • EXIT WHEN FIRST OF TRIPLET IS NON-TSX A.O LEAVE TRA 1,4 NO. • COMPLETE CALLING SEQUENCE FOR MOVE. TSXS. BACK FOR NEXT tHREE MORE CLA 2.4 STA X CLA 304 STA Y SXA SV4.4 TSX SMOVE ,4 LXV TSX ••• 0 •• =AINEXT LXY) X TSX •• ,0 •• sAINEXT Xl V TSX •• ,0 •• =A(NEXT Yl SV4 AXT ••• 4 •• =XR4 VARIABLE TXI GETLXV,4,-3 • CONSTANTS MASK OCT 171177100000 TSXl TSX 0,0 END 0074 0015 0076 0017 0078 0019 0080 0081 0682 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 •••••••••••••••••••••••• .......................... • MOVREV • PROGRAM LISTINGS LAST CARD 1M DECK IS NO. 0155 0001 0002 150 0003 MOVREV 0004 MOVREV ILXY,IX~X.IY.Y.SIGN) 0005 0006 ~~-ABSTRACT---0007 0008 0009 TITLE - MOVREV MOVE, REVERS. CHANGE SPACING, OR CHANGE SIGN OFA VEl TOR 0010 0011 MOVREV MOVES A VECTOR XII) TO YIJ) ACCORDING TO 0012 0013 YO) 0014 '" SIGN.XllI YIl+1Y1 SIGN.X(l+IXI 0015 0016 0017 YO+lXY.IY) SIGN.X(l+LXY"IX) 0018 0019 OR ACCOROING TO 0020 0021 YO) '" SIGN.XI1+LXY.IX) 0022 YU+[YJ '" SIGN.XCl+(LXY-ll·IX) 0023 0024 0025 YCl+LXY.IY) = SIGN.Xlll 0026 0027 WHERE LXV, IX, IY, AND SIGN (=+1. OR -1.) ARE INPUT 0028 PARAMETERS. OVERLAP OF INPUT AND OUTPUT IS AL~O.ED 0029 EXCEPT WHEN THE REVERSE AND MOVE FEATURE ARE USED AT 0030 THE SAME TI ME. 0031 0032 0033 - FAP SU8ROUTINE IFORTRAN II COMPATIBLE) LANGUAGE 00310 EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) - 74 REGISTERS 0035 STORAGE 0036 - 100 + lO.LXY MACHINE CYCLES SPEED 0037 R.A. WIGGINS, JULY,1963 AUTHOR 0038 0039 --USAGE---0040 0041 TRANSFER VECTOR CONTAINS ROUTINES - NONE 0042 AND FORTRAN SYSTEM ROUTINES - NONE 0043 0044 FORTRAN USAGE 0045 CALL MOVREVCLXY.IX,X.IY,Y,SIGN) 0046 0047 INPUTS 0048 DEFINES NUMBER OF [ATA VALUES TO BE MOVED. 0049 LXY 0050 MUST BE GRTHN=l 0051 0052 DEFINES THE INCREMENT OF THE X INOEX. IX 00'53 MUST BE GRTHN=O 0054 XII) I=I,l+IX, ••• ,I+ILXY-l).IX CONTAINS THE SERIES to BE MOVED 0055 0056 NEED NOT BE FLOATING POJ.NT. 0057 0058 IY DEFINES THE INCREMENT OF THE Y INDEX. 0059 IF NEGATIVE THE SERIES WILL BE REVERSED ON OUT'UT. 0060 IF GRTHN 0 THE SIGN IS NOT CHANGED 0061 SIGN IF LSTHN=O THE SIGN OF EACH TERM MOVED IS CHAN5ED. 0062 0063 0064 OUTPUTS 0065 YII) I=l,I+IY, •••• l+ILXY-l).IY CONTAINS THE MOVED SiRlES 0066 0067 MAY OVERLAP XIII WHEN IY"'l 0068 0069 EXAMPLES 0070 0071 1. INPUTS - LXY"'3 IX=1 IY"'2 Xll ••• 3) = 1.,2 •• 3. 0072 SIGN=I. Y(1 ••• 6) = .1,.1, ••••• 1 0073 OUTPUTS - YI1 ••• 6) '" 1.,.1,2.,.1,3 ••• 1 0074 • MOVREV • FAP .MOVREV COUNT LAL ENTRY • • •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •" " •" • • • (SUBROIH I NE I •••••••••••••••••••••••••• MOVREV • •••••••••••••••••••••••• • , 9129/64 •••••••••••••••••••••••• • MOVREV • •••••••••••••••••••••••• • MOVREV • •••••••••••••••••••••••• PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 2) IPAGE • 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT SIGN=-l • OUTPUTS - Y(l ••• bl " -1.,.1,-1.,.1,-1.,.1 IX=O • • 3. INPUTS - SAME AS EXAMPLE 1. EXCEPT IY--l • OUTPUTS - Yll ••• ]1 - 3.,2.,1. • • PROGRAM FOllOWS • XRl HTR XR2 XR4 HTR HTR BCI MOVREV SXD SXD SXD HI CLA CLS SIR CLA STA CtA STA SUB TMI RIR PXD CAS. CLS TRA CAS· TRA NOP LDQ CAS. NOP LDQ SlQ CAS. SIR RIR ADM. RNT SUB STD Al A2 SPA DPA TXIi TXI2 lV XIX XIY CLA. RNT SUB STD RNT TRA CLM PAX RNT TRA CLM PAX CLA. POX CLA STO TXI TXI TlX lDI LXD lXD LXD TRA CLA. SUB XCA MPY· ARS TRA CLA· SUB BELOW o o o 1,MOVREV XRl,1 XR2,2 XR4,4 51 3 5,4 DPA 3,4 SPA 5,4 ·+2 3 ,0 1,1t • LV 2,4 LV SAVE INDEX REGISTERS AND INDICATORS. LOAD INDICATORS. =ADRIXI :AORIYl DECIDE WHICH DIRECTION TO MOVE SAVE IN lEFT HALf INDICATOR CHECK FOR ILLEGAL VALUES OF LXY .EXIT IF ZERO OR NEGATIVE. AND IX .EXIT IF NEGATIVE. CLA 6,4 CHECK SIGN CONVENTION CLS SPA ZERO OR NEGATl VE POS IT IVE. CHECK SIGN OF IY 4,4 1 2 4,4 2 =32766617 TXI2 2,4 1 =32768B17 TXIl 1 XIX ,1 2 XIV ,2 1,4 ,4 ·.,1 •• f2 .+ 1,1,.· ·+1,2, •• SPA,4,1 SI XRl,1 XR2,2 XR4,4 1,4 1,4 -lB17 2,4 I Al 1,4 -1617 SET INDICATORS 0075 0076 0071 0018 0019 0080 0081 0082 0083 0084 0065 0086 00B1 0088 0089 0090 0091 0092 0093 0094 009'5 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 OU8 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 !l132 0133 0134 0135 0136 0137 0136 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 21 *_ ••••••••• __ ••••••••••• MOVREV *•••••••••••••••••••••••• " (PAGE 3) XCA SI MPY* ARS TRA PZE END 4,4 1 A2 PROGRAM LI STINGS *•••••••• *.*.***** ••••• * "MOVREV " •••••••••••••••••••• * ••• (PAGE 3J 0150 01')1 0152 0153 0154 0155 ..................... ..... MPSEQ1 •••••••••••••••••••••••••• "MPSEQ.l •••••••••••••••••••••••• PROGRAM LISTINGS ' • •••••••••••••••••••••••• 9129/64 • MPSEQ1 (SUBROUTINE) • FAP .MPSEQ1 COUNT 200 MPSEQI LBL MPSEQI IX,LX,B,LB,IX,IXLO,IANS) ENTRY LAST CA~D IN DECK IS NO~ • .•• TITlE - MPSEQ1 --·-A8STRACT---MAPS A SEQUENCE OF NUM8ERS INTO AN .• MPSEQI MAPS A SEQUENCE XII), • • • .• I=I ••••• LX INTO AN INTEGER SEQUENCE IXII), I.1 •••• ,LX. THE MAPPING IS CONTROLLED 8Y A GIVEN VECTOR OF RANGE LIMITS 8(1), J·l ••• J,L8~ WHE~E 8(1) IS ~ONOTONELY INCREASING FROM 8(1) TO BIL8., THUS SPECIFYING L8-1 SEPARATE RANGES. EACH RANGE IS CONSIOERED CLOSED ON THE LOWER END, OPEN ON THE HIGH END AND THE RANGES ARE INDEXED FROM lXLO+l TO IXLO+LB-IJ WHERE (XLO IS A PARAMETER. IXII) IS THEN SET EQUAL TO THE .iNDEX OF THE RANGE TO WHICH XII) BELONGS, WITH THE FOLLOWING TREATMENT OF EXTREMAL X VALUES IF XII) IS LSTHN 8e 1), IXII) = IXLO IF XI)I IS GRTHN- BIL8), IXII) " IXLO+LB NOTE- THE LOGIC USED IS ALMOST IDENTICAL TO THAT OF FRQCT2 • •" • • • • •" • .. • .. • .• • • • • INTEGER SERIES LANGUAGE EQUIPMENT STORAGE SPEED AUTHOR - FAP SU8ROUTINE WITH FORTRAN II CALLING SEQUENCE - 109 OR 1090 IMAIN FRAME ONLY) - 110 REGISTERS - J. N. GALBRAITH -----USAGE--.-- TRANSFER VECTOR CONTAINS ROUTINES NONE AND FORTRAN SYSTEM ROUTINES - NONE " FORTRAN USAGE CALL MPSEQltX.LX,8,LB,IX,IXLO,IANS) .• • INPUTS "• • •" ." ." • • " •" • • • • XII) I-I ••• LX IS THE INPUT SERIES TO 8E MAPPED. MAY BE FLOATING, FORTRAN INTEGER, OR MACHINE LANGUAGE INTEGER, BUT MUST 8E THE SAME ~ODE AS 8IJ)~ LX IS LENGTH Of X VECTOR. MUST 8E GRTHN-1 • BI II I-I ••• l8 GIVES INPUT RANGES Of MAPPING INTERVALS. MUST 8E SAME MOOE AS XII}. 8(1) MWST INCREASE MONOTONELY, I.E. 811+1) GRTHN BIll. L8 IS LENGTH Of RANGE VECTOR. MUST Bi: GRTHN.l. IXLO IS LOWER LIMIT OF OUTPUT MAPPING. LOIlEST RANGE. .• OUTPUTS IXU) • • • • • • "• •• • • • • IXLO+1 ~ INDEX OF I=I ••• tX IS THE INTEGER MAPPING OF XII}. IANS "0 =1 -2 -3 NORMAL ILlEGAL LX ILlEGAL L8 WEIRD ERROR EXAMPLES 1. INPUTS - LX~O Xl1 ••• 16)--5.,-4.,-3.2,-3.1,-2.,-2.1,O •• -1.1. -.5,5.~4.,3.5,3.,2.9.1.1,1. LB=16 Bl1.~.91~-4 •• -3., -2.,-1.,0.,1.,2.,3.,4., OUTPUTS - ERROR IANS-l IXLO-O 0196 OOOt 0002 0003 0004 0005 0006 0001 OOOB 0009 0010 0011 00ll! 0013 OOH 0015 0016 0011 0018 0019 0020 0021 0022 0023 0024 0025 0026 0021 002B 0029 0030 0031 0032 0033 0034 oa35 0036 0031 003B 0039 0040 0041 0042 0043 0044 0045 0046 0041 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0061 0068 0069 0010 0071 0072 0073 0074 ........................... • MPSEQ1 • •••••••••••••••••••••••• (PAGE 21 PROGRAM LISTINGS •..••..•.....,.......... MPSEQI • •••••••••••••••••••••••• (PAGE 2) • .. 2. INPUTS - X AND 8 SAME AS EXAMPLE 1 LX=16 LB-O IXlOsO .. OUTPUTS - ERROR IANS=2 • .. 3. INPUTS - X AND B SAME AS EXAMPLE 1 LX=16 LB-9 IXLO-O • OUTPUTS - IXH,.~.,·16) .. 0,0,0,0 .. 2 .. 1,4 .. 2,3 .. 7.7.7,7.6,5,;5 IANS*O .. • 4. INPUTS - X, B. ~X, AND LB SAME AS EXAMPLE 3 IXLO=13 • OUTPUTS - IXU".J.,16)=12,12,12,12,14,13,16,14,15,19H9,19fl,:9,18, • 17;17 IANS=O " PZE 0 1, MPSECll BCI MPSEQI SXA RETURNH RETURNil1,2 SXA SXA RETURN+2,4 SXO MPSEQ1"2,4 7,4 IANS=O srz" CLA. 2,4 GET LX ERR1 TZE TMI ERfU STO END 4,4 GET LB CLATZE ERR2 ERR2 TMI ARS L8 IN ADDRESS 18 SfO LB ARS LB/2 lIN ADDRESS) 1 LBHALF STO 1,4 CLA ADDRESS OF X ADD KIMLI AIX+11 STA XADD STA TESTLO ADDRESS OF 8 CLA 3.4 AIB+1) ADO KlIILI STA BTESTl STA BADD SUB LB STA TESTHI CLA. 6,4 GET IXLO K2FX SUB IXLO-2 STD XLDW 5,4 CLA ADDRESS OF IX AIIX+l) ADD K1MLI S·TA IXSTO I,): AXT AXT 1,4 LOOP CLA K1MLI STO INITIAL LBLO=l LBLO CLA LB STO LBHI INITIAL LBHI=LB lBHALF CLA INITIAL LBCOM=LB/2 STO LBCOH AXT 1,2 GET X. C•• =AIX+l)) TESTLO CLA BIl) seE IF IN LOWEST RANGE 8TEsn CAS ·"44 TRA TESTHI TRA NEXIND TRA NEXIND •• "ACBILB)). SEE IF IN HIGHEST RANGE TESTH'I CAS •• TRA HIEST HIEST TRA SEARCH LXA LBCOMi2 GET XIIRl) XADD CLA BADD CAS ·••• 2 COMPARE WITH BCLBCOM) X GREATER. NEW LBLO I:L8COM) TRA GRATER TRA GOT IT, SET IXCIRl+1) NEXINO 0,2 X LESS, NEW LBHI (:LBCOM) LESS PXA LBCOM-LBLO=DIF SUB LBtO CAS K1MLI TRA OIF GREATER THAN ONE ·+3 OIF=l, GOT IT, SET IX(IRl+1) TRA EQUAL TRA ERROR IMPOSSIBLE OIF/2 ARS 1 ADD NEW LBCOM LBLO LDQ LBCOH ··n ··H 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 DIU 0112 0111 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 •••••••••••••••••••••••• MPSEQ1 • ••••••••••••••••••••••••• (PAGE PROGRAM LISTINGS 3) STQ L8HI STO l8COM TRA SEARCH GRATER PXA 0,2 SU8 l8HI SSP CAS K1MLI TRA ·+3 TRA NEXIND TRA ERROR ARS 1 ADD lBCOM lDQ lBCOM STO l8COM STQ l8l0 TRA SEARCH NEXIND TXI ·+1,2,1 EQUAL PXD ,2 ADD XlOW •• ;1 IXSTO STO .+1,1,1 TXI TXl END lOOP,l';" •• ,1 RETURN AXT •• ,2 AXT ••• 4 AXT TRA 8,4 HIEST lXA lB,2 TRA EQUAL ERR1 ClA K1FX 7,4 STO8,4 TRA ERR2 ClA K2FX TRA ERRl+! ERROR ClA K3FX TRA ERRl+1 - CONSTANTS AND TEMPORARIES K1FX PlE 0,0.1 K2FX PZE 0,0.2 K3FX PZE 0.0.3 K1MLI PZE 1,0.0 PZE l8 0 l8HAlF PIE 0 laLO PZE 0 l8COM PZE 0 l8HI PZE 0 XLOW PZE END •••••••••••••••••••••••• MPSEQl • "• ••••••••••••••••••••••• (PAGE l8COM-l8HIs-0IF DIF DIF:l, GOT IT, SET IXIlR1+1) IMPOSSI8LE .... ADORESS OF IX+! ··=lX STORE IANS RETURN 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0170 0171 0172 0173 0114 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 3) •••••••••••••••••••••••• .......................... • PROGRAM LI STINGS MRVRS , C C C C C C C C C C C C C C C C C C C C C C ••••••••••••.•.•.•• -._.* MRYRS 9/29/64 OO~-l C INPUTS C C C N IS NUMBER OF ROWS IN A MATRIX IN AA. MUS T BE GRTHN= 1 C C C M IS NUMBER OF COLUMNS IN A MATRIX IN AA. MUST BE GRTHN= 1 LA IS NUMBER OF MATRICES IN THE VECTOR OF MATRICES AA. MUST BE GRTHN=1 AA( [) l=l ••• J.LA*N*M IS A VECTOR OF MATRICES STORED [LOSELY PACKED. C C C C C C C C C OUTPUTS C AA(Il C C EXAMPLES I=l ••••• LA*N*M IS THE REVERSED INPUT VECTOR. C C 1. INPUTS - N=l M=1 LA=l OUTPUTS - AIII=3. C AAI1l=3. C C 2. INPUTS OUTPUTS C C C C • LAST CARD IN DECK IS NO. 0066 0001 0002 0003 0004 ----ABSTRACT---0005 0006 TITLE - MRVRS 0001 REVERSE VECTOR OF MATRICES 0008 0009 0010 MRVRS REVERSES THE ORDER OF MATRICES IN A VECTOR. 0011 0012 LANGUAGE - FORTRAN II SUBROUTINE 0013 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLYl 0014 STORAGE - 61 REGISTERS SPEED ~ 10-N*M*LA + 41*LA + 110 MACHINE CYCLES ON THE 1090 0015 WHERE N.M IS THE NUMBER OF ELEMENTS IN A MATRIX ANO 0016 0011 LA IS THE NUMBER OF MATRICES IN THE VECTOR. AUTHOR 001B - R.A. WIGGINS 3/63 0019 0020 ----USAGE---0021 0022 TRANSFER VECTOR CONTAINS ROUTINES - REVERS 0023 AND FORTRAN SYSTEM ROUTINES - (NOT ANY) 0024 0025 FORTRAN USAGE 0026 CALL MRVRS 'N.M~LA.AA) MRVRS (SUBROUTINE) * LABEL CMRVRS SUBROUTINE MRVRS (N.M.LA.AA) C C f ••••••••••••••••••••••• • N=2 M=1 LA=3 AA(1 ••• 6J=1 •• 2 •• 3 •• 4 •• 5 •• 6. AAI1 ••• 6l=5 •• 6 •• 3.,4 •• 1 •• 2. 3. INPUTS - N=2 M=1 LA=4 AA(I ••• 8l=1 •• 2 •• 3•• 4 •• 5.,6 •• 1 •• 8. OUTPUTS - AAl1 ••• 8J=7 •• 8 •• 5 •• 6 •• 3 •• 4 •• 1.,2. C C PROGRAM FOLLOWS BEL~W C 10 DIMENSION AA(21 NM = N*M NMLA = NM*LA CALL REVERSINMLA. AAI DO 10 I=I.NMLA.NM CALL REVERSfNM, AAIIlJ RETURN END 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0041 0048 0049 0050 0051 0052 0053 0054 0055 0056 0051 0058 0059 0060 0061 0062 0063 0064 0065 0066 •••••••••••••••••••••••• • MSCONI ' , •••••••••••••••••••••••• PROGRAM LISTINGS ......................... • • MSCUNI • MSCONI (SUBROUTINE) 9/29/64 LAST CARD 1M DECK IS NO. • LABEL CMSCONI SUBROUTINE MSCONI (NORDER.P,PHI,DEPEND,IANS) C C --~-ABSTRACT---C C TITLE - MSCON1 C MEAN SQUARE CONTINGENCY ANO DEPENDENCY FROM PROBABILITY DENSITY~ 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 MSCONI COMPUTES THE MEAN SQUARE CONTINGENCY AND A DEPENDENCY MEASURE AS DEFINED ON PAGE 282 OF CRAMER, MATHEMATICAL METHODS OF STATISTICS. PRINCTON UNIVJ PRESS. 1951. THE COMPUTATION REQUIRES THE SECOND PROBABILITY DENSITY WHICH CAN BE COMPUTED WITH SUBROUTINE PRoa2 (SEE WRITE-UP OF PROB2l. IF PHI IS THE MEAN SQUARE CmNTINGENCY. DEPEND IS THE DEPENDENCY MEASURE, AND NORDER IS TME ORDER OF THE 5ECOND PROBABILITY MATRIX. P(t.J), TMEN DEPEND = PHI/(NORDER-l) LANGUAGE - FORTRAN II SUBROUTINE EQUIPMENT - 709. 1090 IMAIN FRAME ONLY) STORAGE - 238 REGISTERS SPEED AUTHOR ~ J.N. GALBRAITH ----USAGE--TRANSFER VECTOR CONTAINS ROUTINES - NONE AND FORTRAN SYSTEM ROUTINES - NONE FORTRAN USAGE CALL MSCONILNOROER,P,PHI,DEPEND,IANS) INPUTS NORDER INTEGER. THE ORDER OF THE PII,Jl PROBABILITY DENSITY MATRIX. GRTHN ONE, LSTHN OR EQUAL 25. P(I,J) I=l, ••• NORDER, J=l, •• ,NORDER. PROBABILITY DENS)TY MATRIX NORMALIZED SUCH THAT THE SUM OVER I AND J IS = TO 1. PII,J) HAS DIMENSION 125,25), P(I,J) MUST NOT HAVE AN ENTIRE ROW OR COLUMN SUM EQUAL TO ZERO, OR NEGATIVE. OUTPUTS PHI THE MEAN SQUARE CONTINGENCY. C C DEPEND C ClANS C C C C C EXAMPLES C C 1. INPUTS C C C OUTPUTS C C 2. INPUTS C C OUTPUTS C C 3. INPUTS C C OUTPUTS C C 4. INPUTS C C OUTPUTS C • •••••••••••••••••••••••• ' - THE DEPENDENCY MEASURE. ERROR INDICATOR =0 NORMAL =-1 ILLEGAL NORDER. LSTHN 1 DR GRTHN 25 =-2 ILLEGAL P MATRIX. ROW OR COLUMN SUM ZERO OR NEGATIVE. - P{t,I)~.2 .P(I,I),1=2,5 =.1, P{l,I),1=2,5 ALL OTHER P{I,J)=O. NORDER=O - PHI=O. DEPEND=O. IA'NS=-1 - SAME AS EXAMPLE 1 EXCEPT NORDER=26 - PHI=O. DEPENO=O. IANS=-l - SAME AS EXAMPLE 1 EXCEPT NORDER=5 - PHI=1.6666666 DEPEND=.41666666 - SAME AS EXAMPLE 1 EXCEPT Pll,5)=0., PI5,l)=.1 NORDER=5 - PHl=1.7333333 DEPEND=.43333333 IANS=O IANS=O ~.1 0107 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 001B 0019 0020 0021 0022 0023 0024 0025 0026 0021 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0061 0068 0069 0010 0011 0012 0013 0014 ••••••••••••••••••••••• * • MSCONI • PROGRAM LISTINGS •• ~ ••••••• *** ••• ** •••••• IPAGE 2) C 5. INPUTS - SAME AS EXAMPLE 4 EXCEPT PI5,51"0. C OUTPUTS - IANS=-2 C C DIMENSION Pt25,251,PSROWI25~,PSCOL(25) CHECK NORDER C lANS:-l IFINORDER-lt 9999,9999,5 IFINORDER-261 6.9999,9999 5 FIND ROW AND COLUMN SUMS C 00 10 J:l,NDRDER 6 PSROWIJI=O. PSCOLI J):O. 00 10 l:l,NDRDER PSROWIJI:PSROWIJ)+PIJ,11 10 PSCOLIJI=PSCOLIJI+PII,JI C CHECK ROW AND COLUMN SUMS IANS=-2 00 15 1=I,NORDER IFIPSROWIIIJ 9999,9999,12 12 IFIPSCOLIIII 9999,9999,15 15 CONTINUE C COMPUTE MEAN SQUARE CONTINGENCY PHI=O. 00 20 I=I,NORDER 00 20 J=I,NClRDER 20 PHI=PHI+PCI,JI*PII,JI/IPSRDWII1*PSCOLIJ1) PHI=PHI-l. C COMPUTE DEPENDENCY MEASURE DEPEND=PHl/tFLOATFINORDER-l11 IANS=O 9999 RETURN END ..._.......•.•.......... • MSCONl • •••••••••••••••••••••••• IPAGE 0075 0076 0077 0078 0079 0080 0061 0062 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 21 ••••••• ** ••••• * ••••••••• MULK •••••••• * •••••••• * ••• **.* I'tEFER TO ADDK PROGRAM LISTINGS * ••••• * •• * •••• * ••••••••• HULK ••••••••••••••••••••••• **" REFER TO ADDI< •••••••••••••••••••••••• MULK -II • •••••••••••••••••••••••• PROGRAM LISTINGS • -.. .•.•.•...•....•...•. _ ., MUlK -tl LAST CARD IN DECK IS NO. 0017 0001 0002 0003 0004 C 0005 ---ABSTRACT--C 0006 C 0007 C TITLE - MULK -II 0008 C MULTIPLY ANY NO. OF VARIABLES BY A SINGLE FLTG. PT. CONSTANT 0009 C HULK IS A VARIABLE-LENGTH-CALLING-SEQUENCE SUBROUTINE 0010 C WHICH MULTIPLIES EACH OF ITS ARGUMENTS BEYONO tHE FIRST 0011 C 0012 BY THE FIRST ARGUMENT, ASSUMED TO BE FLOATING 1t0lNTJ C 0013 C THIS SUBROUTINE IS THE FORTRAN EQUIVALENT OF TNE 0014 C FAP SUBROUTINE OF THE SAME NAME. 0015 C 0016 C - FORTRAN II SUBROUTINE 0017 C LANGUAGE 0018 C EQUIPMENT - 709 OR 7090 CMAIN FRAME ONLY) 0019 - 76 REGISTERS C STORAGE 0020 C SPEED - S.M. SIMPSON, AUGUST 1963 0021 C AUTHOR 0022 C 0023 C ---USAGE-0024 C 0025 C TRANSFER VECTOR CONTAINS ROUTINES - SETUP, ARG, STORE, RETURN 0026 C AND FORTRAN SYSTEM ROUTINES - (NONE) 0027 C 0028 C FORTRAN USAGE C CALL MULK IC,Xl;X2, ••• ,XN) 0029 0030 C C INPUTS 0031 0032 C 0033 C IS THE VALUE BY WHICH Xl ••• XN ARE TO BE MULTI'LIED C MUST BE FLTG. PT. 0034 C 0035 C C OUTPUTS NO OUTPUTS IF ARGUMENT COUNT IS LESS THAN 2 (PURE RETURN) 0036 0037 C 0038 Xl C " C • Xl 0039 C X2 C • X2 0040 ETC. C 0041 C XN " C • XN 0042 C 0043 EQUIVALENCES OF ANY ARGUMENTS ARE PERMITTED, THE C BEHAVIOUR DEPENDS ON THE FACT THAT XI.~.XN ARE SET 0044 C IN THAT ORDER. 0045 C 0046 C 0047 IS AN QUTPUT IF ANY X IS EQUIVALENT TO C. IF SO C C SUCCEEDING ARGUMENTS ARE MULTIPLIED BY THE NEW CJ 0048 C 0049 C 0050 C EXAMPLES 0051 C 0052 C 1. INPUTS - X=l., V=2., Z=3., U=4 •• V=5 •• W=6. CALL MULKI 2.,X.Y,Z.U} 0053 C USAGE tALL MULKIV,WI 0054 C tALL MULKIV) 0055 C 0056 C CALL MULK 0051 C OUTPUTS X=2 •• Y=4., Z=6 •• U=B. 1/:30., 0058 C 0059 C "=5. NO OUTPUTS FROM LAST TWO CALLS 0060 C 0061 C 0062 C 2. INPUTS - SAME AS EXAMPLE 1 EXCEPT C a 2. 0063 CALL MULK CC, X, y, i, c, u. V, V, WI USAGE C 0064 X:2 •• V=4., Z:6 •• C=4., U=16., V=80~. W=24J C OUTPUTS 0065 C 0066 C PROGRAM FOLLOWS BELOW 0061 C C GET ARGUMENT COUNT AND CHECK IT 0068 CALL SETUPClOCAlL,NARGS,XRl,XR2) 0069 0070 IF INARGS-2) 9999,10,10 0071 C LOOP TO SET X1.~.XN 0012 10 DO 20 NUMARG=2;NARGS XOUT=C.ARGF{LOCALL,NUMARG,11 0073 0074 20 CALL STOREIXOUTiLOCALL,NUMARG,I) " HULK -II ISUBROUTINE) • LABEL CMULK -II SUBROUTINE MULk ICI = • • • • • 11 • • • •·. . . . . . . . . . . . . . . ." 9129164 •••••••••••••••••••••••• HULK -II • •••••••••••••••••••••••• • (PAGE PROGRAM LISTINGS 21 C EXIT 9999 CALL RETURNtLOCALL,XR1,XR2) END •••••••••••••••••••••••• MULK -II • • •••••••••••••••••••••••• (PAGE ·2) 0075 0076 0077 •••••••• * ••••••••••••• ** HULKS * * •••••••••••••••••••••••• PROGRAM LISTINGS •••••••••••••••••••••••• * HULKS * •••••••••••••••••••••••• REFER TO REFER TO AODK ADDK •••••••••••••••••••••••• MULLER • •••••••••••••••••••••••• ... .•.•.•.............. .......................... _ PROGRAM LISTINGS • • • MU~LER • MULLER (SUBROUTINEI 9/9/64 LAST CARD IN BECK IS NO. • LABEL CMULLER SUBROUTINE MULLER ICOE,N1,ROOTR,ROOTI) C C C ---ABSTRACT-C C TITLE - MULLER C POLYNOMIAL RoeT FINDER C C MUtlER FINDS THE REAL AND COMPLEX ROOTS DF A pmLYNDMIAL C WITH REAL COEFFICIENTS. THE METHOD USED IS TAKEN FROM C MULlER4 'A METHOD OF SOLVING ALGEBRAIC EQUATIONS USING C AN AUTOMATIC COMPUTER', MTAC 119561, 280-215. C C ALL ARITHMETIC IS DONE IN THE COMPLEX MODE. THEREFORE C ALL RomTS FOUND WilL HAVE REAL AND IMAGINARY PARTS. C REAL RCOTS WILL HAVE SMALL IMAGINARY PARTS ON THE ORDER C OF 7 DECIMAL PLACES lESS THAN THE REAL PARTS. C C THE PROGRAM WILL FIND MULTIPLE ROOTS BUT TKE ACCURACY C DECREASES AS THE MULTIPLICITY INCREASES. A NON-MULTIPLE C ROBT IS NORMALLY ACCURATE FRDM 6 TO B DECIMAL 'LACES. C WHEN THE MULTIPLICITY IS 4, THE ACCURACY DECREASES 2 C DECIMAL PLACES. C C LANGUAGE - FDRTRAN II SUBROUTINE C EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) C STORAGE - 757 REGISTERS C SPEED - ABOUT .010*N.N SECONDS DN THE 7094 MOD C WHERE N IS THE DEGREE OF THE POLYNOMIAL. C AUTHOR - IRA HANSON, LMSN. SUNNYVALE CAL. JUNE, 1960 C C C ----USAGE--C C TRANSFER VECTOR CONTAINS ROUTINES - (NOT ANY) C AND FORTRAN SYSTEM ROUTINES - SQRT C C FORTRAN USAGE C CALL MULLER ICOE,Nl,ROOTR,ROOTII C C C INPUTS C C COE (II 1"'1, ••• ,Nl+l IS THE ARRAY OF POLYNOMIAL CO!:FFICIENTS. C C N1 IS THE DEGREE OF THE POLYNOMIAL C MUST BE GRTHN=l C C C OUTPUTS C C ROOTRCI) I=I,~.J,Nl IS THE REAL PARTS OF THE COMPLEX RomTS. C C ROOTIIll l=l, •• J,Nl IS THE CORRESPONDING IMAGINARY PARTa OF THE C COMPLEX ROOTS. C C C EXAMPLES I. C 0231 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0011 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0051 0058 0059 0060 0~1 C 1. INPUTS - N1 = 2 COEll ••• 3) = 2.21,-1.00,1.00 C OUTPUTS - ROOTRIl ••• 21 = 0.5, 0.5 C ROOTIll ••• 21 = 1.4,-1.4 C C 2. INPUTS - Nl = 10 COEll ••• l11 = 1332.5,-7690.8,26130.,-46510.. C 51730.,-38520.,19350 •• -6153.9,968.28,-4.2000;1.0000 C OUTPUTS - ROOTRll ••• 10) a 0.2, 0.2, 1.5, 1.5, 1.0, 1.0, 0.5. 0.5, C -1.1,-1.1 C ROOTIIl ••• I0) =-0.3, 0.3, 0.4.-0.4,-1.0, 1~0,-1.4i 1,4. C -31.0, 31.0 C C PROGRAM FOLLOWS BELOW 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 C M" •• *••••••••••••••••••••• • MULLER • PROGRAM LISTINGS ** •••••••• * •• *.*.* •••• ~. IPAGE 2) 19 7 9 10 11 12 13 14 113 lIe 110 200 III DIMENSION COEI161,ROOTRI151,ROOTI(15) N"'NI N2=N+1 N4=0 1=1 IFICOEIII)9.1,9 N4=N4+1 ROOTRIN4):0. ROOTI (N41 =00' 1=1+1 IFIN4-N 119,37,19 CONTINUE AXR=0.8 AXI=O. L=l N3=1 ALPIR=AXR ALPlI=AXI 1'1=1 GOT099 BETlR=TEMR BETlI=TEMI AXR=0.B5 ALPZR=AXR ALP21=AXI M=Z GOT099 BETZR=TEMR BET21=TEMI AXR=0.9 ALP3R=AXR AU'3I=AXI 1'1=3 GOT099 BET3R=TEMR BET3I=TEMI TE1=ALP1R-ALP3R TEZ=ALPlI-ALP3 I TE5=ALP3R-ALPZR TE6=ALP3I-ALP2I TEM=TE5.TE5*TE6*TE6 Tr3=ITE1*TE5+TE2*TE61/TEM Tf4=ITE2*TE5-TEl*TE61/TEM TE7=TE3+1. TE9=TE3*TE3-TE4-TE4 TE10=2 •• TE3I>TE4 OE15=TE7.BET3R-TE4*BET3I DE16=TE7*BET31+TE4*BET3R TEll=TE3·BET2R-TE4*BET21+BETIR-DE15 TE12=TE3*BETZI+TE4*BETZR+BETII-0EI6 TE7=TE9-1. TE1=TE9*BETZR-TE10*BETZI TEZ=TE9*BETZI+TEIO*BETZR TE13=TEI-BETIR-TE7*BET3R+TE10*BET31 TE14=TE2-BET11-TE7*BET3I-TEI0*BET3R TE15=OE15*TE3-0E16*TE4 TE16=OEI5*TE4+0E16*TE3 TE1=TEI3*TEI3-TE14*TEI4-4.*(TE11*TE15-TE12*TE16) TEZ=2.*TEI3*TEI4-4.*ITEIZ*TEI5+TEll*TE161 TEM=SQRTFITE1*TEl+TEZ*TE21 IFITE11113,113,112 TE4=SQRTFI.5*(TEM-TEl11 TE3=.5*TE2/TE4 GO TO 111 TE3=SQRTFI.5*ITEM+TEIJ) IFITEZII10,ZOO,200 TE3=-TE3 TE4=.5*TEZ/TE3 TE7=TE13+TE3 TEB=TE14+TE4 TE9=TE13-TE3 TEI0=TE14-TE4 TEl=2.*TE15 TE2=2.*TEI6 IFITE7*TE7+TE6*TEB-TE9*TE9-TE10*TEI0J204,204,205 •••••••••••••••••••••••• • MULLER • •••••••••••••••••••••••• IPAGE 2) 0075 0076 0077 007B 0079 OOBO 0081 0062 0063 0064 0085 00B6 00B7 0088 0089 0090 0091 009Z 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 '0116 0119 0120 0121 0122 0123 0124 0125 0126 0127 01Z8 0129 0130 0131 0132 0133 0134 0135 0136 0137 0136 0139 0140 0141 0142 0143 0144 0145 01'.6 0147 0148 0149 ••••••,. ............ **.•••• .. MULLER • PROGRAM LISTINGS •••••••••••••••••••••••• CPAGE 3) 204 TE1=TE9 TE8=TElO 205 TEM=TE1.TE1~TE8.TE8 TE3=CTEl·TE1+TE2·TE81/TEM TE4=CTE2.TE1-TEl·TE81/TEM AXR=AlP3R+TE3*TE5-TE4*TE6 AXI=ALP31+TE3*TE6+TE4*TE5 ALP4R=AXR ALP41=AXI M-4 GO TO 99 15 N6=1 38 IFCABSFCHELtl+ABSFCBELll-1.E-20118,18,16 16 TE1=ABSFCAlP3R-AXRI+ABSFIALP3!-AXll IFCTE1ICABSFIAXRI+ABSFCAXIII-1.E-1118,lB,11 11 N3=N3+1 AlPI R=Al P2R AlPII=ALP21 ALP2R=ALP3R AlP2I=ALP3I ALP3R=ALP4R ALP3I=ALP4I BE TlR=BET2R BET!I=BET2I BET2R=BET3R BEl2I=BET31 BET3R=TEMR BET3I=TEMI IFIN3-100114,lB,18 18 N4=N4+1 RfJOTRCN41=AlP4il ROOTI CN4) =Al P4 I N3=0 41 IFCN4-N )30,31,37 31 CONTINUE 00 380 l=l,N IF IABSFIROOTIII)I-1.E-51 310,310,360 310 ROOTI CI) =0. 380 CONTINUE RETURN 30 IFCABSFCROOTICN411-1.E-5110,10,31 31 l=l GO TO 132,10 I ,L 32 AXR=ALPIR AXI=-ALPlI AlPll=-ALPl1 M=5 GO TO 99 33 BETlR=TEMR BET! I"TEMI AXR=ALP2R AXI=-ALP21 ALP21=-AlP21 M"6 GO TO 99 34 BET2R=TEMR BET2I=TEMI AXR=AlP3R AXI=-AlP31 ALP31"-AlP31 l=2 M=3 99 TEMR=COEIN21 TEMI=O.O DO 100 I=l,N n=N2-1 TEl=TEMR.AX.-TEMI*AXI TEMI=TEMI*AXR+TEMR*AXI 100 TEMR= TEl+COECIll HELL=TEMR BELl=TEMI 42 IFIN4l102,103,102 102 001011 =1 ,N4 TEMl=AXR-ROOTRIJI TEM2=AXI-ROOTIII) ••••••••••••••••••••••••• .. "U~lER •••••••••••••••••••••••• CPAGE 3) 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0110 0111 0112 0173 0114 0115 0116 0111 0118 0119 0180 01B1 0182 0183 01B4 0185 0186 0181 01B8 0189 0190 0191 0192 0193 0194 0195 0196 0191 0198 0199 0200 0201 0202 0203 0204 0205 0206 0201 0208 0209 0210 0211 0?l2 0213 0214 0215 0216 0211 0218 0219 0220 0221 0222 0223 0224 •••••••••••••••••••••••• • MULLER PROGRAM LISTINGS * •••••••••••••••••••••••• (PAGE 4) TE1=TEM1*TEM1+TEM2*TEM2 TE2=(TEMR*TEMl+TEMI*TEM2IfTEl TEMI=(TEMI*TEMI-TEMR*TEM2IfTEl 101 TEMR=TE2 103 M=M GO TO(11,12,13,15,33,341,M END •••••••••••••••••••••••• * MULLER * •••••••••••••••••••••• *(PAGE 0225 0226 0221 0228 0229 0230 0231 41 •••••••••••••••••••••••• MUlPlY • •••••••••••••••••••••••• • PROGRAM LI STINGS 9/29/64 • MULPLY (SU8ROUTlNE) • FAP .MULPLY COUNT 150 LBL MUI:PLY ENTRY MULPLY ( X, LX,XMLPLR,XMLPLD) ENTRY XMlPLY (IX,LIX,IXMPLR,IXMPLD) • • • • • • • • • • • •• • e • • • • • • •• • •• • • • • • • • • • • • • • • • • • • •• • • e • • • • • • • • • • • • • • •• •• . •..•.........•........_ MUlP!:Y • •••••••••••••••••••••••• f LAST CARD 1M 8ECK IS NO. 0113 0001 0002 000) 0004 0005 0006 0007 ---ABSTRACT--0008 0009 TITLE - MULPLY WITH SECONDARY ENTRY XMLPLY 0010 MULTIPLY VECTOR BY FLOATING OR FIXED CONSTANT 0011 0012 MULPLY SETS A VECTOR EQUAL TO A GIVEN VECTOR TIMES A OOlll FLTG CONSTANT, OUTPUT MAY REPLACE INPUT. 0014 0015 XMI:PLY SETS A VECTOR EQUAL TO A GIVEN VECTOR TIMES A 0016 FXD CONSTANT. OUTPUT MAY REPLACE INPUT. 0017 0018 LANGUAGE - FAP SUBROUTINES (FORTRAN-II COMPATIBLE) 0019 EQUIPMENT - 709 OR 7090 eMAIN FRAME ONLY) 0020 STORAGE - 34 REGISTERS 0021 7090 709 0022 SPEED MULPLY 40 + (19 OR 22.2)eLX MACHINE CYCLES, 0023 XMLPLY 42 + 120.6 OR Z4.B).LX LX = VECTOR LENGTH 0024 - S.M. SIMPSON, AUGUST 1963 0025 AUTHOR 0026 0027 0028 TRANSFER VECTOR CONTAINS ROUTINES - INONE) 0029 AND FORTRAN SYSTEM ROUTINES - INONE) 0030 0031 FORTRAN USAGE 0032 CALL MULPLYV X, LX,XMLPLR,XMLPLD) 0033 CALL XMLPLYCIX,~IX,IXMPLR,IXMPLD) 0034 0035 INPUTS 0036 00.37 XII) 1=1 ••• lX IS A FLTG VECTOR 0038 0039 LX SHOULD EXCEED ZERO 0040 0041 XMLPLR IS A FlTG VARIABLE. EQUIVALENCE eXMLPLR, SOME _CIJl IS OK 0042 0043 IXlll l=l ••• LIX IS A FXD VECTOR 0044 0045 lIX SHOULD EXCEED ZERO 0046 0047 IXMPLR IS A FXD VARIABLE. EQUIVALENCE IIXMPLR, SOME I_II) IS OK 0048 0049 STRAIGHT RETURN WITH NO OUTPUT IF LX OR LIX LSTHN 1. 0050 OUTPUTS 0051 XMLPLOCI) I-I ••• LX HAS VALUES XMLPLR. XII) 0052 EQWIVAtENCE eXMLPlD,XI IS PERMITTED. 0053 0054 IXMPLDeI) I=l ••• tIX HAS VALUES IXMPLR. IXCI) 0055 EQUIVALENCE (IXMPLD,IX) IS PERMITTED. 0056 0057 THE INITIAL VALUE OF THE MULTIPLIER IS USED THRU01#T~ 0058 00')9 0060 EXAMPLES 0061 1. INPUTS - Xll ••• 4)=1.,2 •• 3.,4. IX(1 ••• 4)=1.2~3.4 u.o.o 0062 USAGE CAll MULPLYIX,4.2~,YI 0063 0064 CALL XMLPlYIIX,4,2.IYI CALL MULPLYIX,1,2.,Z) 0065 0066 CALL MULPlYIX.0.2 •• U) CALL MUlPLYIX,4.X(3),X) 0067 OUTPUTS - YIl ••• 41=2.,4 •• 6.,8. IYll ••• 4)=2.4.6,8 0068 Z=2. U=O.O (NO OUTPUT CASE) Xll ••• 4)=3.,6.,9.,12. 0069 0070 PROGRAM FOLLOWS BELOW 0071 0072 NO TRANSFER VECTOR 0073 HTR 0 XR4 0074 *.* •••••••• * ••••• * •• *.~. • MULPLY * •••••••• ** ............... . PROGRAM LI STINGS • (PAGE MULPLY * ••••••••••••••• **.**** •• ••••••••••••••••••• *** •• (PAGE 2) I, MULPL Y BC I * PRINCIPAL ENTRY. MULPLY(X,lX,XMLPLR,XMLPLOI FMP MULPLY CLA NOP LOO SETUP STO MlPLY VARY STO SXO MULPLY-2,4 1,4 Kl CLA A{XI+l ADD Kl sa GET 4,4 CLA AIXMLPLO)+l ADD Kl S'TA STORE 3,4 XMLPLR CLASTO TEMP 2,4 LX CLA* TMI LEAVE 0,4 POX LEAVE,4,O TXL • MULTIPLICATION Leap LOQ .*,4 **=AIX)+l GET =FMP TEMP OR MPY IlILPLY NOP VARY NOP = NOP OR ALS 11 u=AIXMLPLOI+l STORE STO ."',4 GET ,4 ,I TIX • EXIT LEAVE LXO MULPLY-2,4 TRA 5,4 - SECONO ENTRY. XMLPlY{IX,LIX.IXMPlR,IXMPLOI XMLPlY CLA MPY LOO ALS TRA SETUP - CONSTANTS. VARIABLES FiliP FMP TEMP Nap NOP MPY MPY TEMP ALS ALS 17 TEMP PlE **j-*,** MULTIPLIER END TEMP 0075 0076 0077 G07B 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 21 -. ....•••............... • MUVADD •.•............•.• ...... PROGRAM LlSTlNGS ". •••••••••••••••••••••••• MUYADO * • f ••••••••••••••••••••••• 9/29/64 LAST CARD IN IECK IS NO. 0244 • MUVADD (SUBROUfINE) 0001 • FAP .MUYADD 0002 COUNT 200 0003 L8L MUll ADD 0004 ENTRY MUYADO IIV.ILO.IHl,LADD,MUVSUM,NSUMS.IANS) 0005 0006 * --A8STRACT---0007 • 0008 •• TITLE - MUVADD 0009 • FAST MOVING SUMMATION OF A FIXED POINT VECTOR 0010 0011 • MUVAOD MAKES A MOVING SUMMATION lOVER A SPECIFIED SVMMING 0012 • LENGTH 1 OF A FIXED POINT FORTRAN V~CTOR WITHIN A 0013 • SPECIFIEO RANGE OF THE VECTOR. OVERFLOW CHECK )S MADE. 0014 • 0015 •* LANGUAGE - FAP SUBROUTINE IFORTRAN II COMPATIBLE) 0016 • EQUIPMENT - 709 OR 7090 IMAtN FRAME ONLYI 0017 - 129 REGISTERS 0018 • STORAGE - FOR VECTORS LONG WITH RESPECT TO SUMMING LENGTH T1ME 0019 • SPEED IS LENGTH OF RANGE TIMES 10 MACHINE CYCLES 0020 • ~ S.M. SIMPSON JR, MAY 1962 0021 • AUTHOR 0022 • ----USAGE---0023 • 0024 •• TRANSFER VECTOR CONTAINS ROUTINES - NONE 0025 • AND FORTRAN SYSTEM ROUTINES - NONE 0026 0027 •• FORTRAN USAGE 0028 • CALL MUVADDIIV.IlO.IHI,LADD,MUVSUM,NSUMS.IANSJ 0029 0030 •* INPUTS 0031 0032 • IVII 1 I=JLO.J.IHI IS THE SPECIFIED VECTOR RANGE. 0033 • 0034 • MUST EXCEED 0 0035 • ILO 0036 • IHI MUST EQUAL OR EXCEED ILO 0037 0038 •* LAOD IS THE SUMMING LENGTH. IT MUST EXCEED O. 0039 • 0040 • 0041 • OUTPUTS 0042 *• MUVSUMIIJ I=1.2, ••• ,NSUMS CONTAINS THE MOVING SUMS 0043 0044 • WHERE • MUVSUMlll=IVIILO)+IVIILO+1)+ ••• +IV(ILO+LADQoo}1 0045 • MUVSUMI21=IVIILO+1)+IVIILO+2)+.'.+IYIILO+~ADD) 0046 0047 • ETC. • MIIIVSUMINSUMSI=IVC IHI-LADD+l)+ ••• +IVI UII-U+fVUHI' 0048 • NOTE - SEE EXCEPTION 8ELOW UNDER IANSJ 0049 0050 • IHI-JLO+2-LADD OR ONE, WHICHEVER IS LARGER. 0051 • NSUMS 0052 • * IANS 0053 " a MEANS J08 IS DONE IN TltlS CASE 0054 " 1 MEANS LADD EXCEEDED LENGTH OF RANGE. • NSUMS IS SET =1. 0055 • =-1 MEANS ILLEGAL SPECI~ICATION OF lLOt, IHI. OR LAOO 0056 • INSUMS WIll ~Ol. 0057 • =-2 MEANS OVERFLOW OCCURRED BUT ALL SUMS COMPUTE04 0058 • • • • 0059 EXAMPLES • h * • INPUTS - IVU ••• 101=1,2,1t,8.16.32.10.'h8.7 ILO"2, {HI-e, tAOO*2 OUTPUTS - IANS=Oi NSUMS=6, MUVSUMI1 ••• 61=6.12.21t,48,42,1. • 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT LACD " 1 • OUTPUTS - IANS=O_ NSUMS=7. MUVSUMll ••• 71=2,4,8,16,32110,. • • 3. INPUTS • •• • •• SAME AS EXAMPLE 1. EXCEPT LADD=12 OUTPUTS - IANS=I. NSUMS=I, MUVSUMll'=81 4. INPUTS - SAME AS EXAMPLE 1. EXCEPT IHI=2 OUTPUTS - IANS=1.NSUMS=l,MUVSUM(11=2 5. INPUTS - SAME AS EXAMPLE 1. EXCEPT IHI=2 AND LADO"1 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 ••••••~.,. ••••••••* •••• f* • MUVAOO • PROGRAM LISTINGS *.*.* •••••••••••• ~ •••••• IPAGE 2) • • f ••••••••••••••••••••••• • MUVAOO OUTPUTS - IANS-O. NSUMS=I. MUVSUMll)=2 • 6. INPUTS SA~E AS EXAMPLE 1. EXCEPT LADD=7 • OUTPUTS - IANS-O. NSUMS-l. MUVSUMll)-81 •• • • •• - •• - 7. INPUTS SAME AS EXAMPLE 1. EXCEPT IV(2)=131068 (THIS PRODUCES OVERFLOW ON FIRST SUM ONLY SINCE 131068+4=2**lT) OUTPUTS - IANS=-2, NSUMS=6, MUVSUMl1 ••• 6)=0.12,24,48i42,19 8. EXAMPLES 8., 9., AND 10. TEST ILLEGALITY CHECKS. INPUTS - SAME AS EXAMPLE 1. EXCEPT ILO-O OUTPUTS - IANS=-I, NSUMS-O 9. INPUTS SAME AS EXAMPLE 1. EXCEPT IHI=1 OUTPUTS - IANS=-I, NSUMS=O - 10. INPUTS - SAME AS EXAMPLE 1. EXCEPT LADD=-50 OUTPUTS - IANS=-l, NSUMS=O • • • •••••••••••••••••••••••• (PAGE 2) HTR 0 HTR 0 HTR 0 BC I 1. ''IV VAIlD MUVADD SXD MUVADD-4,1 SXD MUVAOD-3,2 SXO MUVADD-2,4 * ADDRESS SETUP. CLA 1,4 STA IV CLA 2,4 STA GET2 CLA 3,4 STA GET3 CLA 4,4 SlfA GET4 CLA 5,4 STA MUVSUM CLA 6,4 STA PUT6 CLA 7,4 STA pun • INPUT CHANNEL FOR IlO, IHI, LADD GET2 CLA *. AIILO) ARS 18 STO ILO GET3 CLA .. AI IHI ) ARS 18 STO IHI GET4 ClA •• AILADD) ARS 18 SiO LACD * CHECK ILO~ IHI, LADD CK2 ClA IlO CAS KO TRA CK3 ItO MUST NOP EXCEED 0 TRA ILEGL CK3 ClA IHI CAS IlO NOP OR EXCEED ILO. CK4 IHI MUST TRA TRA ILEGl CK4 CLA LADO KO CAS TRA STNSM lADD MUST NOP EXCEED 0 TRA ILEGl • NOW SET NSUMS AND CHECK IF ZERO OR NEGATIVE, WHICH MEANS lAmD IS • lONGER THAN RANGE. STNSM CLA IHI SUB IlO ADO K2 SUB LAOD S TO NSlJMS CAS KO 0075 0076 0017 0078 0079 OOBO 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 OUI 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 ••••••••••••••••• ** ••••• MUVAOO ••••••••••••••••• ** ••••• IPAGE PROGRAM LISTINGS f ••••••••••••••••••••••• • MUVAOO , ••• f •••••••••••••••••••• 3) TRA NORML NOP TRA SHORT • IF RANGE SHORT SET LFRST=LENGTH OF RANGE AND NSUMS=l AND NMORE.O AND • IANS=l. SHORT CLA Kl STO NSUMS STO IANS ADD IHI SUB ILO STO LFRST STZ NMORE TRA SETUP • NORMALLY LFRST=LAOO. NMORE=NSUMS-l, IANS~O NORML SUB Kl STO NMORE CLA LAOO STO LFRST STZ IANS TRA SETUP • NOW SETUP THE TWO LOOPS ANO THEN GO TO FIRST ONE AFTER TURNING OFF • OVERFLOW IF ON. SETUP CLA IV SUB ILO ADO K2 STA LIADO STA L2SUB SUB LAOO STA L2ACO CLA MUVSUM STA LISTO STA L2STO CLA NMORE ALS 18 STO TXL STO L2TXL TOV Ll TRA Ll • FIRST LOOP FORMS FIRST SUM. L1 LXA LFRST,l CLA KO LIAOO ADO •• ,1 AIIV)-ILO+2 TIX LIACD,},1 • STORE FIRST SUM LISTO S T O . . A(MUVSUMI • THEN CHECK IF MORE SUMS ARE TO BE DONE IKEEP FIRST IN AO). • IF NOT GO CHECK FOR OVERFLOW AND LEAVE. LXA Kl,1 TXL TXL L2ADD,1.'* '*=NMORE TRA CKOV • SECOND LOOP FORMS REST OF SUMS BY ADDING ONE. SUBTRACTING ONE. L2AOO ADO .*,1 AIIVI-ILO-LACO+2 L2SUB SUB .*,1 AIIV1-ILO+2 L2STO STO .*,1 AIMUVSUMI TXI *+1.1.1 L2TXL TXL L2ADD,l,** INMORE) • WHEN DONE, GO CHECK OVERFLOW ANO LEAVE. TRA CKOV * EXIT FOR ILLEGAL INPUTS. ILEGl CLS Kl STO IANS STZ NSUMS TRA LEAVE • CHECK FOR OVERFLOW BEFORE LEAVING. CKOV TOV OVSET TRA LEAVE OVSET CLS K2 S10 IANS TRA LEAVE • STORE IANS, NSUMS. AND EXIT. LEAVE ClA IANS ALS 18 PUT7 STO ** AIIANS) CLA NSUMS ALS 18 IPAGE 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 3) "••••••••••••••••••••••••. • •••••••••••••••••••••• * MUVADD IPAGE PROGRAM LISTINGS ....MUVADD-4,1 AINSUMSI 0 1 2 "* .... .. IPAGE MUVADD-3,2 MUVADD-2,4 8,4 ........ ........ ........." MU¥ADO ............................. " 4t PUT6 S'fO EXIT LXD LXD LXD TRA .. CONSTANTS KO PZE Kl PZE K2 PZE • VARIA8LES ILO PZE IHI PZE LADD PZE NSUMS PZE tANS PZE IV PZE MUVSUM PZE NMORE PZE LFRST PZE END ••• f . . . . . . . . . . . . . . . . . . . .. .. MUST BE MOVED FROM DECREMENTS MUST BE MOVED TO DECREMENTS • " .. =AI I'll ,,"=AIMUVSUMI NSUMS-l IS NO. OF ELEMENTS IN FIRST SUM. 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 4) ••••••••••••••••• ....... * ~ • "VBLOK • PROGRAM LI STINGS •••••••••••••••••••••••• 9/29/64 • MVBLOK ( SUBROUTINE) • FAP .MVBLOK COUNT 75 LBL MVBLOK ENTRY MVBLOK (NN,ISORCE,IDESTl 4 •• ~*.* • ••• ' ••••••••• * ••• "VBLOK LAST CARO IN DECK IS NO. 0082 0001 0002 0003 0004 0005 0006 • ----ABSTRACT--0007 • 0008 • 0009 • TITLE - MVBLOK 0010 • MOVE DATA BLOCK 0011 • MVBLOK MOVES A OATA SERIES FROM ONE AREA IN CORlE TO 0012 • ANOTHER AREA. THE TWO AREAS MAY NOT OVERLAP, UNLESS 0013 • THE SOURCE AREA HAS A HIGHER CORE ADDRESS THAN THE 0014 • DESTINATION AREA. 0015 0016 • 0017 • LANGUAGE - FAPI SUBROUTINE (FORTRAN 11 COMPATIBLE) 0018 • EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0019 • STORAGE - 19 REGISTERS 0020 • SPEED - 28 ~ 6N MACHINE CYCLES WHERE N=LENGTH OF DATA SERIES. • AUTHOR - S.M. SIMPSON, NOVEMBER, 1961 0021 0022 • 0023 ----USAGE--• 0024 • • TRANSFER VECTOR CONTAINS ROUTINES NONE 0025 0026 • ANO FORTRAN SYSTEM ROUTINES NONE 0027 • 0028 • FORTRAN USAGE 0029 • CALL MVBLOKINN,JSORCE,IDESTI 0030 * 0031 • INPUTS 0032 * 0033 IS THE lENGTH OF THE DATA BLOCK. • NN IS FORTRAN II INTEGER. 0034 • MUST BE GRTHN=l. 0035 • 0036 • 0037 ISORCE IS THE CORE ADORESS OF THE SOURCE DATA BLOCK. • 0038 IS FORTRAN II INTEGER. • 0039 • 0040 IDEST IS THE CORE ADDRESS OF THE DESTINATION DATA BLOCK. • 0041 IS FORTRAN II INTEGER. • 0042 • 0043 • OUTPUTS 0044 • 0045 THE CONTENTS OF ISORCE THRU ISORCE-N+l REPLACES THE • CONTENTS OF IDEST THRU IDEST-N+l. 0046 • 0047 • 0048 * EXAMPLES 0049 • lET SORCE AND DEST BE THE TWO DATA AREAS, THEN THE 0050 • PROGRAMMING SEQUENCE 0051 * 0052 • 0053 ISORCE = XLCCFISORCEl * IDEST = XLOCF(DESTI 0054 • CAll MVBLOK INN, ISORCE, IDEST) 0055 • 0056 00')7 IS EQUIVALENT TO 0058 • 0059 DO 10 I=l,NN • 0060 J = NN-I+l • 0061 DESTIJ) = SCRCEIJI 10 • 0062 • 0063 HTR o 0064 BCI l,MVBlOK 0065 MVBLOK SXD *-2,4 CLA. 0066 2,4 0067 ARS 18 0068 AOD K1 ISRCE+1 0069 STA MOV 3,4 0070 CLA0071 ARS 18 0072 ADD K1 IDS T+l STA MOV+1 0073 0074 1,4 N ClA* • • • • •••••••••••••••••••••••• •••••••••••••••••••••••• • • MV8LOK PROGRAM LISTINGS 21 MOV Kl POX CLA STO TlX LXO TRA PZE END 0,4 •• ,4 ••• 4 MOV.4,l MV8LOK-2,4 4,4 1 MV8LOK • • •••••••••••••••••••• *** •••••••••••••••••••••••• (PAGE ••••••••••••••••••••••• * • (PAGE TO XR4 *·=ISRCE+l •• =IOST+l 0075 0076 0077 0078 0079 0080 0081 0082 21 ••••••••••••••••••• ** ••• ._....................•. • MVINAV • PROGRAM LI STINGS • MVINAV (SUBROUTINE) 9/29/64 • LABEL CMVINAV SUBROUTINE MVINAV (REC.LREC.K.RECAV.IANSI 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 C C C C C C C C •••••••••••••••••••••••• MVINAV • •••••••••••••••••••••••• - LAST CARD IN DECK IS NO. 0115 0001 0002 0003 0004 ----ABSTRACT---0005 0006 TITLE - MVINAV 0007 MOVING AVERAGE Of A VECTOR 0008 0009 MVINAV FINDS THE MOVING AVERAGE. RECAVI II. Of 0010 A fLOATING POINT VECTOR. RECII) 1=1 ••••• LREC. A!CORDING 0011 TO THE EQUAT ION 0012 0013 I+K 1 0014 RECAVI II I REC I J) ) SU~ 0015 2K+l J=I-K 0016 0017 FOR I = 1.2 ••••• LREC 0018 WHERE K AND LREC ARE INPUT PARAMETERS. 0019 AND THE COMPUTATIONS ARE MADE AS THOUGH REC(J) 0020 WERE ZERO FOR J LESS THAN 1 AND GREATER THAN LREC 0021 0022 LANGUAGE ~ fORTRAN II SUBROUTINE 0023 EQUIPMENT - 709 OR 1090 IMAIN fRAME ONLY) 0024 STORAGE - 221 REGISTERS 0025 SPEED - 65.LREC MACHINE CYCLES FOR LARGE LREC 0026 AUTHOR - S.M. SIMPSON, MARCH 1963 0027 0028 --~-USAGE--0029 0030 TRANSfER VECTOR CONTAINS ROUTINES - NONE 0031 AND fORTRAN SYSTEM ROUTINES - NONE 0032 0033 fORTRAN USAGE 0034 CALL MVINAVfREC.LREC,K.RECAV,IANSI 0035 0036 INPUTS 0037 0038 REC (1) 1=1 •••• ,LREC IS A FLOATING POINT VECTOR 0039 0040 LREC MUST EXCEED ZERO 0041 0042 K SPECIFIES THE AVERAGING LENGTH AS 2K+l POINTS 0043 MUST BE ~ON-NEGATIVE, AND 0044 2*K+l MUST BE LESS THAN LREC (UNLESS K=OJ 0045 0046 OUTPUTS 0047 0048 RECAVI!) 1=1 •••• ,LREC IS THE MOVING AVERAGE GIVEN IN A8STRACT 0049 0050 IANS o NORI'ALLY 0051 -2 fOR ILLEGAL LREC (NO OTHER OUTPUT IN THIS CASE) 0052 -3 FOR ILLEGAL KINO OTHER OUTPUT IN THIS CASE) 0053 0054 0055 EXAMPLES 0056 0051 1. INPUTS - RECll ••• 6) = 9.,9.,0 •• 36 •• 36.,9. 0058 LREC=6 Kl=O K2=1 K3=2 0059 USAGE CALL MVINAVIREC,LREC.KI,RECAV1,IANS1) 0060 CALL MVINAVIREC,LREC.K2,RECAV2,IANS21 0061 CALL MVINAVIREC,LREC,K3,RECAV3.IANS3) 0062 OUTPUTS - IANS1=0 RECAV111 ••• 6) = 9 •• 9 •• 0.,36 •• 36.,9. 0063 IANS2=0 RECAV2(1 ••• 6) = 6.,6.,15.,24 •• 21.,15. 0064 IANS3=0 RECAV311 ••• 6) = 3.6,10.8,18 •• 18 •• 16.2.16.2 0065 2. 1 LLEGAL CASES 0066 USAGE CALL MVINAVIREC,0,0,RECAV,IANS11 0067 CALL MVINAVIREC,3,-1.RECAV.IANS2) 0068 CALL MVINAVIREC,7.3,RECAV,IANS3) 0069 OUTPUTS - IANSI ~ -2 (ILLEGAL LREC) 0070 IANS2 ~ IANS3 = -3 IILLEGAL Kl 0071 0072 DUI'MY DIMENSIONS 0073 DIMENSION REC(2),RECAVI2) 0074 • •••••••••••*** ••••••••• - MVINAV •............. * ••• * •••••• IPAGE 2) PROGRAM LISTINGS ••••••••••••• f •••••••••• f HVINAV • • ••••••••••••••• * •• ** ••• C CHECK INPUTS. lREC GRTHN 0, K GRTHN=O, 2.K+1 lSTHN lREC IANS=-2 IFIlREC) 9999,~999.10 10 IANS=-3 IFIKI 9999.30.20 20 IFI2.K+1-lREC) 40,9999,9999 C SPECIAL TREATMENT FOR K=O 30 IANS=O D'O 35 l=l.lREC 35 RECAV(II=RECIII GO TO 9999 C TREAT LEFT EDGE EFFICT - SET RECAVll ••• K+l1 C FIRST SET RECAvt1} 40 IANS=O lEND=K+1 RECAve 1)=0. DO 50 I=l.lENO 50 RECAvell=RECAVlll+RECIII C THEN SET RECAVI2 ••• K+l1 DO 60 I=2,tEND IADD=I+K 60 RECAVCI)=RECAVIJ-ll+RECIIADDI C NOW TREAT CENTRAL TERMS - SET RECAVIK+2, ••• ,lREC-KI IXlO=lEND+1 IXHI=lREC-K DO 70 I=IXlO.IXHI IAOD= I +K ISUB=I-lEND 70 RECAV(II=RECAVIJ-l)+RECIIAoOI-RECIISUBJ C NEXT TREAT RIGHT EDGE EFFECT - SET RECAV IlREC-K+l, •••• lREC~ IXlO=lREC-K+l DO 80 I=IXlO.lREC ISUB=I-lEND 80 RECAV(IJ=RECAVII-l'-RECIISU8' C FINAllY AVERAGE THE RESULT SCALE=1./FLDATFt2-K+l1 00 90 l=l.lREC 90 RECAV(IJ=RECAVIJJ-SCALE C EXIT 9999 RETURN END IPAGE 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 21 ........ •......•.....-. ~ • MVNSUM • •••••• * •••••••••• ~ •••••• PROGRAM LI STINGS •••••••••••••••••••••••• • MVNSUM • •••••••••••••••••••••••• 9/4/64 LAST CARD IN DECK IS NO. 0201 • MVNSUM (SUBROUTINE) 0001 • FAP 0002 ."'VNSUM 0003 COUNT 250 MVNSUM LBL 0004 ENTRY MVNSUM (X. LX. LSUM. OVSR. SUMOVO. LSUMOO) 0005 0006 • 0007 * OOOB ----A8STRACT---* 0009 0010 ** TITLE - MVNSUM * MOVING SUMMATION WITH OIVISION BY A CONSTANT 0011 0012 MVNSUM COMPUTES 0013 •* 0014 • 1 I +L-l 0015 S( 1) SUM X(J) • = 1.2 •• ~ •• N=LX-L+1 0016 •* D J=I 0011 * 0018 * 0019 GIVEN X(l~ •• LXl. LX. L. AND D. * 0020 • 0021 COMPUTATIONS ARE SPED UP FOR D 1.0 THE OUtPUT VECTOR * MAY REPLACE THE INPUT VECTOR. THE LENGTH N )S AN 0022 * ADDITIONAL OUTPUT. 0023 * 0024 •• LlNGUAGE - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) 0025 0026 • EQUIPMENT - 709.7090.7094 (MAIN FRAME ONLY) * STORAGE 0027 - 71 REGISTERS 0028 - ON THE 7090. MVNSUM TAKES • SPEED 7B.6 + B.4*L + 22.8*N MACHINE CYCLES IF D " 1.0 0029 • 74.6 + 8.4*L + 39.8*N MACHINE CYCLES IF o NOT" 1.0 0030 * WHERE Li NAND 0 ARE DEFINED ABOVE. 0031 • * AUTHOR 0032 - S.M. SJMPSON~ JULY 1964 0033 * 0034 * ----USAGE---0035 • 0036 •• TRANSFER VECTOR CONTAINS ROUTINES - (NOT ANY) 0037 * AND FORTRAN SYSTEM ROUTINES - INOT ANY) 0038 0039 *• FORTRAN USAGE 0040 0041 • CALL MVNSUMfX. LX. LSUM. DVSR. SUMOVD. LSUMOO) 0042 *• 0043 0044 INPUTS * 0045 I=l ••• LX IS A FLOATING POINT VECTOR. 0046 • XU) 0041 • LX 0048 MUST EXCEED ZERO. • 0049 • LSUM IS THE SUMMING LENGTH. L OF THE ABSTRACT. 0050 • MUST EXCEED ZERO AND BE LSTHN= LX. 0051 * 0052 • OVSR IS THE DIVISOR. 0. OF THE ABSTRACT. 0053 •* MUST BI NON-ZERO. 0054 0055 0056 * STRAIGHT RETURN WITH NO OUTPUT IF LX. LSUM. OR DVSR * OUTPUTS 0057 ILLEGAL. 0058 • 0059 • • SUMOVO'I) I=l ••• LSUMOD IS THE MOVING SUM SI1 ••• N) OF tHE 0060 0061 • ABStRACT. 0062 *• LSUMOD WILL LX-LSUM+l • 0063 0064 * 0065 0066 •*• EXAMPLES 0067 006B *• 1. UNITY DIVISOR CASES 0069 0070 • INPUTS X(1 ••• 3) = 1.,2 •• 4. OVSR = 1.0 • S(1 ••• 3,1 ••• 3,1 ••• 3) = -9.,-9., ••• 0071 • LSll •• 43,1 ••• 3) • -9,-9, ••• 0072 0073 • USAGE 00 10 LX=1,3 0074 * 00 10 LSUM=l,LX • • •••••••••••••••••••••••• • MVNSUM _.•••....••..•.......... MVNSYM • •••••••••••••••••••••••• PROGRAM LISTINGS • • •••••• ~ •• * •• * ••• ** •• * ••• (PAGE IPAGE 2) • • • * • • •• • • • • 10 CALL MVNSUMIX,LX.LSUM.DVSR,SI1,LSUM,lX), 1 LSILSUM,LX») OUTPUTS - SII ••• 3,1 ••• 3,1) 1.,-9.,-9.,,-9.,-9.,-9 •• ,.-9.,-9 •• -9. S(1 ••• 3,1 ••• 3 t 2} 1., 2.,-9.,~ 3.,-9.,-9 •••-9.,-9.,-9. Sll ••• 3,1 ••• 3,3) 1., 2., 4." 3., 6.,-9 ••• 7.,-9.,-9. LSl1 ••• 3,1 ••• 3) 1,-9,-9,.2,1,-9,,3,2,1 2. NON-UNITY INPUTS USAGE OUTPUTS - • DIVISOR CASES SAME AS EXAMPLE 1. EXCEPT DVSR: 0.5 SAME AS EXAMPLE 1. SAME AS EXAMPLE 1. EXCEPT THAT ALL VALUES OF NOT EQUAL -9. WILL BE OOUBLEO. • 3. CASE WHERE OUTPUT REPLACES I~PUT • INPUTS - SAME AS EXAMPLE 1. • USAGE tALL MVNSUMIX,3,2,OVSR,X,LSUMOD) OUTPUTS - XII ••• ]) : 3.,6.,4. LSUMOD: 2 • • • 4. ILLEGAL USAGES • INPUTS - SAME AS EXAMPLE 1. CALL MVNSUMIX,O, 2,1.0,S,LS) • USAGE CALL MVNSUM{X,2,-l,l.0,S,LS) CALL MVNSUMIX,2, 3,1.0,S,LSI CALL MVNSUMIX,3, 2,O.O,S,LS) OUTPUTS - S .. -9. LS:-9 • • • • • • • • • • PROGRAM FOLLOWS BELOW NO TRANSFER VECTOR HTR BCI 0 l,MVNSWM XR4 • • ONLY ENTRY. MVNSUMC;X. LX, LSUM, OVSR, SUMOVD, •MVNSUM SXD MVNSUM-2,4 • • CHECK OUT LSUMi DYSR, LX. SET LSUMOD. • CLA. 3,4 LSUM • ARS TMI TZE S10 CLA· STO TZE FSB STO CLA. TMI TZE SUB. ADD TMI TZE STO' STD S10 1B LEAVE LEAVE LSUM 4,4 DVSR LEAVE Kll ZFDI 2,4 LEAVE LEAVE 3,It KD1 LEAVE LEAVE 6,4 TXll TXL2 IN ADDRESS STORED DVSR SET SWITCH FOR DVSR = 1.0 LX LX-LSUM LX-LSUMH : LSUMOO LSUMOD STORED • THEN SET ADDRESSES AND OVSR • CLA AOD STA STA STA ADD SUB STA STA CLA ADD STA l,lt K1 fADl LDQl LDQ2 Kl LSUM FAD2 fAD3 5,4 Kl STO AIX) AIX)+l AIX)+2 AIXI+2-LSUM AISUMOVD) AISUMOVD)+l LSUMt'lD) S WHICH DO 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 2) ........................,. • MVNSUM ... ••••••••••••••••••••••••• •••••••••••••••••••••••• lPAGE 31 PROGRAM LISTINGS • • •••••••••••••••••••••••• IPAGE 31 STA • • FORM • FAD1 • STO XtLSUM1+X{LSU~-11+ LXA PXD FAD TIX lET TRA TRA ••• +X(11. LSYM,4 0,0 .·,4 FADl,4f1 lFDl LDQ2 LDOl • LOOP WITHOUT DIYISltlN . FA02 LD01 STO TXLl • FAO FSB LDO STO STO TXI TXL TRA "VNS~M .... 4 LEND ".,4 LEND •• ,4 ·+1,4.1 FAD2,4.". LEAVE THEN 8RANCH TO PROPER LOIJP LSUM TO XR4 ZERO TO AC •• = AIX)+l (NOTE XR4 IS NOW ." '"' 11 A(X)+2-LSUM *" (SET •• AIX)+l ASIDE LEFT END ELEMENT) AISUMOVD)+l ." LX-LSUM+1 = LSUMOD "" •• AU 1+2-LSUM *" AISUMOVOI+l • LOOP WITH DIVISION BY OVSR •CLA FAD3 LOO2 STO • TXL2 CLA FAD FS8 LOO STQ STO FOP STO TXI TXL TEMP "·,4 LEND ••• 4 LEND TEMP OVSR ... ,4 "+1,4,1 CLA,4 ••• LXD TRA MVNSUM-2,4 7,4 ... AIX)+l LX-lSUM+1 = LSUMOD • EXIT "lEAVE ".. CONSTANTS. • K1 PIE K01 K1L LSUM OVSR TEMP LEND ZFDI PlE DEC PlE PlE PZE PlE PZE END TEMPORARIES 1 0,0.1 1.0 ..... 0.0 *" ..... , .. = 0.0 ...... , .. ...... , .. - •.•• ,f. = LSUM INPUT OVSR XI1l.X(2), ••• IF OVSR = 1.0, NOT 0.0 OTHERWISE 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 ...... .................. .... MVNTIN *** ••• ••• * •••••••• * •••• : , PROGRAM LI STINGS . MVNTlN ( SUBROUTINE. LAST CARD IN OECI( I S NO. 0233 0001 0002 COUNT 250 0003 MVNTIN LBL 0004 ENTRY MVNTIN IX, LX, DEL, LINT, XMI, LXHIl 0005 MVNTNA IX, LX, DEL, LINT, XAMI, l.XAM II ENTRY 0006 0001 0008 -~-ABSTRACT---0009 0010 TITLE - HVNTIN, WITH SECONDARY ENTRY MVNTNA 0011 MOVING TRAPElOIDAl INTEGRAL OR ABSOLUTE VALUE INTEGRAL 0012 0013 MVNTI N COMPUTES 0014 0015 XI II X(HUNT-II I+LINT-2 0016 SUM X(J) XMltl) = DEL" 1---- + 0011 + ------2 J=I+l 2 0018 0019 FOR I = l,2, ••• ,LXMI=LX-l.INT+l 0020 0021 GIVEN THE VECTOR Xll ••• LX). THE LENGTH LX. THE 0022 INCREMENT DEL, AND THE INTEGRATING LENGTH LINT. THE 0023 LENGTH; LXHI, OF THE MOVING INTEGRAL IS AN ADOITIONAL 0024 OUTPUT. THE OUTPUT VECTOR MAY REPLACE THE INP~T VECTOR. 0025 0026 MVNTNA COMPUTES THE SAME EXPRESSION AS DOES "VHTIN 0021 EXCEPT THAT THE MAGNITUDES OF THE XCII VALUES ARE USED. 002B 0029 0030 - FAP SUBROUTINES (FORTRAN-II COMPATIBLE) LANGUAGE 0031 EQUIPMENT - 109,1090,1094 (MAIN FRAME ONLY) 0032 - B8 REGISTERS 0033 STORAGE - ON THE 1090 EITHER ENTRY TAKES ABOUT 0034 SPEED 50 * l8.B*LINT + 52.6.LXMI MACHINE CYCLES 0035 - S.M. SIMPSON, AUGUST 1964 0036 AUTHOR 0031 0038 ----USAGE--0039 0040 TRANSFER VECTOR CONTAINS ROUTINES - (NOT ANY) 0041 AND FORTRAN SYSTEM ROUTINES - (NOT ANY) 0042 0043 fORTRAN USAGE 0044 CALL MVNTINIX. LX, DEL, LINT, XMI, LXMIl 0045 CALL MVNTNAfX, LX, DEL, LINT, XAMI, LXAMI) 0046 0041 INPUTS 0048 0049 XIII l=l ••• lX IS THE VECTOR TO BE INTEGRATED. 0050 0051 0052 LX MUST BE GRTHN= 2. 0053 IS THE INCREMENT BETWEEN XII) VALUES. MAY BI NEGATIVE 0054 DEL OR AERO. 0055 0056 0051 LINT IS THE INTEGRATING LENGTH • 005B MUST BE GRTHN= 2 AND LSTHN= LX • 0059 0060 OUllPUTS STRAIGHT RETURN WITH NO OUTPUTS IF LX OR LINT 0061 0062 IS ILLEGAL • 0063 XMII I ) I=l ••• LXMI IS OUTPUT FROM MVNTIN AS GIVEN IN ABSTRACT. 0064 EQUIVALENCE IX,XMI) IS PERMITTED • 0065 0066 0061 LXMI LX-tINT+l IS OUTPUT FROM MVNTIN. 0068 EQUIVALENCE ILX,LXMII IS PERMITTED • 0069 0010 XAMIIl> I=I ••• LXAMI IS OUTPUT FROM MVNTNA AS GIVEN IN ABSTRACT. EQUIVALENCE CLX,LXAMII IS PERMITTED • 0011 0012 LXAMI LX-LINT+l IS OUTPUT FROM MVNTNA. 0073 •.HVNTIN FAP .. • • it • ...• • ... ... .. . .. ... . •.. * .. • • . • .. .. .. ..... .. .. * • •. .. .. • ..• ... .. .... .. . it ..... it • •• ••••••••••••••••••••••• MVNTIN .. ............................. ~ 9/4/64 •••••••••••••••••••••••• MVNTIN • •••••••••••••••••••••••• {PAGE •••••••••••••••••••••••• • NVNTIN • •••••••••••••••••••••••• I PAGE 2) PROGRAM LI STINGS • 2) • •• EQUIVALENCE (lX.LXAMI) IS PERMITTED •. EXAMPLES l' • 1. TESTING EXTREMAL VALUES Of lX. LINT IINCLUDING ILLEGAt VALUES) • INPUTS XI1 ••• 4)" -1.,2 •• -4 •• 8. DEL - 2.0 • XMlll ••• 3.l ••• 4.1 ••• 4) " XAMII1 ••• 3.1 ••• 4.1 ••• 4) • • -99.,-9Q., ••• • • LXMlll ••• 4.1 ••• 41 .. LXAMlI1 ••• 4.1 ••• 4) • -9.-9 ••• _ USAGE DO 10 lX-1.4 00 10 lI=1.4 CALL MVNTINIX.LX.DEL.L1. XMIC I,Ll ,LX," LlIMU'lJ,lXJJ 10 CALL MVIIITIIIAIX.lX.DEl.lI.XAMJll.LJ,LXl,LXAMHlhLXlJ OUTPUTS - ALt XMI VALUES -99. AND ALL LXMI VALUIS -9 EXCEPT AS fOLLOWS. XMlll .... l.2.2) " 1.0 LXM JI 2,2) oj 1 XMII1 ••• 2.2,3) 1.0.-2.0 LXMlC2.3) oj 2 XMlll ••• 1.3.3) -1.0 LXMJ(3.3) 1 XM 111 ••• 3,2.4) 1.0,-2.0,4.0 LXMIC2.41 .. '3 XMI11 ••• 2,3,4) .. -1.0. 2.0 LXMJlh4) .. 2 LXM 11.4,4) ,. 1 XMIl1 ••• 1.4.4) 3.0 • • • • • .. • • • • • • • • • • .. ALL XAMI VALUES -99. AND ALL LXAMI VAl:UES EXCEPT AS fOLLOWS. XAMIC 1 ••• 1;2,2) .. 3.0 LXAMJI.3.2) .. 1 XAMH 1 ••• 2.2,3) .. 3.0,6.0 LXAMIU.3) 2 XAMJll ••• 1,3.3) 9.0 LXAMIU.3) .. 1 XAMIC1 ••• 3,2.4) 3.0.6.0.12.0 LXAMIU.4) .. 3 XAM Ie 1 ••• 2~ 3. 41 .. 9.0.18.0 LXAMII3.4) .. 2 XAMIC 1 ••• 1.4.4) =21.0 LXAMI14.4) .. 1 • • • • • • . • 2. CASE WHERE OUTPUTS REPLACE INPUTS • INPUTS - SAME AS EXAMPLE 1. EXCEPT LX .. 4 • USAGE tAll MVNTINIX,lX,DEL,2~X,lX) • OUTPUTS - XII ••• 4) 1.0.-2.0.4.0.8. = • LX .. 3 * • PROGRAM FOllOWS BELOW •* • NO TRANSFER VECTOR HTR BCI • • FIRST ENTRY. •MVNTlN •• ClA lDQ TRA XR4 MVNTlNIX, LX. DEL. LINT, XMI, lXM}) FAD4 FSB4 MERGE CHOOSE INSTRUCTIONS FOR SIGNED ADDITION, SUBTRACTION. SECOND ENTRY. MVIIITNA(X.lX.DEL,lINT,XAMI,LXAMI) *MVNTNA CLA •* • 0 I, MVNTI N LDQ MERGE SXD STO S,TO HO STQ STQ SET LXOK DEL/2.0. CLA* FOP STQ CLACAS TRA TRA TRA CLA* SUB TMI HE FAM4 FSM4 MVNTlN-2,4 FAZ FAl FA2 FSl FS2 CHECIL 3,4 K2L DElHAF 2,4 KDl lXOK lEAVE LEAVE 4,4 KDl LEAVE LEAVE LX, CHOOSE ABSOLUTE VALUE INSTRUCTIONS. LINT. DEL DELI2.0 LX MUST EXCEED 1 LINT LINT-l CHECK FOR UNDERS IlED LINT to -9 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 Otl97 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 OU4 0115 0116 0117 0118 0119 0120 0121 0122 Ol23 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 -'0146 0147 0148 . . . . . . . . . . . . . . . . . . . . . <• • • • • • MVNTlN •••••••••••••••••••••••• MVNTIN • PROGRAM 1I STI NGS • .......................... •••••••••••••••••••••••• 3) (PAGE • • • STD SU8. CHS TMI TZE LEAVE LEAVE LINT-I-LX LX-LINT+l = LXMI CHECK FOR OVERSIZED LINT INPUTS OK. STOSrD SU8 S'fD CLA" ARS sro CLA STA ADD STA SfA SU8 STA ADD SfA CLA ADD SO • • • .. • TXll 2,4 (PAGE 6,4 TXL3 KDt TXL2 4,4 18 LINT 1,4 FS2 Kl FAI FSI LINT FA2 Kl FA! 5,4 Kl STD LXMI STORED LXMI-l LINT AlX) AlXI+l A(Xl+l-lINT AlX)+2-LINT AI XM II AIXMII+l START COMPUTATIONS 8Y FORMING Xill + 2.X(21 + ••• + 2.XILINT-1l + X(UNTI. SIll AVOIDING MIDDLE TERMS IF LINT = 2. AND STORE IN SLAS1. FAI XEC TXll • AXT PXD NOP TXI XEC XEC TXI TXL XEC STO XR4 .. I = 1••• LINT FAD IFAM) ••• 4 TXlh4.1 FAI FAI ·+1,4,1 XEt,4, •• FAl SLAST • MAIN LOOP FORMS •• .... A(X)+l "LINT-l • SIIJ-X(ll-XlI+l)+X(I+LINT-l)+XII+LINTl .. SNEXT • SETS XMIII) = (DElI2.0).SLAST SNEXT • SETS SLAST • (NOTE FORMULA IS OK FOR LINT = 2) • • CLA FSl FS2 FAt FA2 LDQ STO TXI2 TXL2 TXl3 • • EXIT •LEAVE • S(I~ll 0,4 TXI2 SLAST AXT TRA CtA NOP NOP NOP NOP STO LOQ FMP STO CLA STO TXI TXL TXL SNEXT SLAST ·+1.4,1 CLA,4, •• LDQ,4,'. LXD TRA MVNTIN-2,4 7,4 KDl PZE PZE OF A80VE FORMULA IS (FSM) •• ,4 •• IFSM) •• ,4 •• lFAM) •• ,4 •• c (FAM) •• ,4 .... NOW IN XR41 AIX)+l AIKI AOO+2-11NT A !lO+ I-LINT SNEXT SLAST DELHAF ••• 4 • CONSTANTS, TEMPORARIES •Kl (I FSB FSB FAD FAD 1 0,0,1 •• AIX"I)+l = 1,2, ••• ,LKMI+1 LXMI-l .* = LXMI (AVOIDS XR4 •• FORMING SflXM~*11) 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0116 0117 0178 0119 0180 0161 01B2 01B3 01B4 0185 01B6 01B7 0188 0169 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 020B 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 31 ........... _..........•. • MVNTIN PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 4) K2L DEC FA04 FSB4 FAM4 FSM4 FAD FSB FAM FSM LINT PZE PZE PZE SLAST PZE DELHAF SNEXT END ••••••••••••• 4 •• ** •••••• MVNTIN * •.••.....••........ _- ... • * IPAGE 2.0 **.4 0224 **;4 0226 .*.4 0221 0226 0229 0230 0231 0232 0233 .*,4 •• ,0.0 ··.-·t·· ·_,··t.· _·t··,·* 0225 .* = LINT DEL/2.0 SII+1I SI II 1=1.2 ••••• LXMI-l I=1.2 ••••• LXMI 4) •••••••••• * •••••••••• * •• MVNTNA ••••••••••••••••••••••••* • REFER TO MVNTlN PROGRAM LISTINGS •••••••••••••••••••••••• • • •REFER ••••••••••••••••••••••• TO MVNTNA MVNTIN ••••••••• ** ••••••••••••• • MVSQAV •••••••••••••••••••••••• MVSQAV • •••••••••••••••••••••••• PROGRAM LI STINGS • • .........'.... ** ........... . • MVSQAV ISU8ROUTINEI 9/29/64 • LA8EL CMVSQAV SUBROUTINE MVSQAV IREC.LR£C.K,RECAV.IANS) C C LAST CARD IN DECK IS ---A8STRACT---- C C TIlLE - MVSQAV C MOVING MEAN SQUARE AVERAGE OF A VECTOR C C C MVSQAV FINDS THE MOVING SQUARE AVERAGE, RECAVln, OF A FLOATING POINT VECTOR, RECII) 1=1 •••• ,LREC. AtCORDING TO fHE EQUATION C C C C C C C C C RECAV( Il 2K+l I+K 2 SUM ( REC (J) , J=I-K FOR I = 1,2, ••• ,LREC WHERE K ANO lREC ARE INPUT PARAMETERS. ANO THE COMPUTATIONS ARE MADE AS THOUGH RECIJI WERE ZERO FOR J LESS THAN 1 ANO GREATER THAN LREC C C C LANGUAGE ~ FORTRAN II SUBROUTINE C EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLYI C C C STORAGE SPEEO AUTHOR - 236 REGISTERS • 97.lREC MACHINE CYCLES FOR LARGE LREC - S.M. SIMPSON, MARCH 1963 C --...-USAGE---- C C C TRANSFER VECTOR CONTAINS ROUTINES - NONE C AND FORTRAN SYSTEM ROUTINES - NONE C C FORTRAN USAGE C CALL MVSQAVrREC~LREC,K,RECAV,IANSI C C INPUTS C C REC (Il l=l •••• ,LREC IS A FLOATING POINT VECTOR LREC MUST EXCEEO ZERO K SPECIFIES THE AVERAGING LENGTH AS 2K+l POINTS MUST BE NON-NEGATIVE, ANO 2'K+l MUST BE LESS THAN lREC (UNLESS K=OJ C C C C C C C C C OUTPUTS C RECAVI I) C C C IANS I=l, ••• ,LREC o -1 -3 C IS THE MOVING AVERAGE GIVEN IN ABSTRACT NORMALLY FOR ILLEGAL LREC INO OTHER OUTPUT IN THIS CASEI FOR ILLEGAL K (NO OTHER OUTPUT IN THIS CASE) C C C EXAMPLES C - RECll ••• 6) = 3.,-3.,0 •• 6.,-6 •• 3. LREC=6 K1=0 K1=1 K3=2 USAGE CALL MVSQAV(REC.LREC.K1,RECAVl,IANS1} C CALL MVSQAVIREC,LREC,K1.RECAV1,IANS1) C CALL MVSQAVIREC,LREC,K3.RECAV3,IANS31 C OUTPUTS - IANS1=0 RECAV111 ••• 61 9.,9.,0.,36.,36.,Q. C IANS1=0 RECAV1ll ••• 61 = 6.,6.,15.,24.,17.,15. C IANS3=0 RECAV311 ••• 6) = 3.6,10.8,lB.,lB.,16.2.16.2 C 2. ILLEGAL CASES C USAGE CALL MVSQAVIREC,O,O,RECAV,IANSl) C CALL MVSQAVIREC,3,-l,RFCAV.IANS21 C CALL MVSQAVIREC.7.3,RECAV.IANS31 OUTPUTS - IANSI -2 I ILLEGAL LREC) C C IANS2 = IANS3 = -3 IILLEGAL KJ C 1. INPUTS C C = = C C OU"'fIIY DIMENSIONS DIMENSION REC(2),RECAVI2J NO~ 0115 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 •••••••••••••••••••••••• • MVSQAV • •••••••••••••••••••••••• (PAGE 2) PROGRAM LI STINGS _.•••.••.....•.•.....•.. • MVSQAV • •••••••••••••••••••••••• (PAGE 2) C CHECK INPUTS. tREC GRTHN 0, K GRTHN=O. 2*K+l lSTHN tREC IANS=-2 IFIlRECI 9999,9999,10 10 IANS=-3 IFIK) 9999,30,20 20 IFI2*K+I-lREC) 40,9999,9999 C SPECIAL TREATMENT FOR K=O 30 I ANS=O DO 35 l=l,lREC 35 RECAVCI)=RECII).RECIII GO TO 9999 C TREAT lEFT EDGE EFFECT - SET RECAVll ••• K+ll C FIRST SET RECAV(l) 40 IANS=O lENO=K+l RECAVIl)=O. DO 50 l=l,lENO 50 RECAVCll=RECAVlll+RECIII*RECIII C THEN SET RECAVI2 ••• K+ll DO 60 1=2,lENO IAOO=I+K 60 RECAVIII=RECAVII-11+RECIIAOOI*RECIIAOOI C NOW TREAT CENTRAL TERMS - SET RECAVIK+2, ••• ,lREC-KI IXlO=lENO+l IXHI=lREC-K 00 70 I=IXlO,IXHI IAOD=I+K ISUB=I-lENO 70 RECAVIII=RECAVII-ll+REC(IAOO).RECIIAOD)-RECIISUB)*RECIISUB) C NEXT TREAT RIGHT EDGE EFFECT - SET RECAV ILREC-K+1 •••• ,lRECI IXlO=lREC-KH 00 80 I=IXlO,LREC ISUB=I-lENO 80 RECAVII)=REtAVII-1)-RECIISUBI*RECCISUBI C FINAllY AVERAGE THE RESULT SCAlE=1./FLOATFI2*K+ll DO 90 l=l,lREC 90 RECAVCII=RECAVIJI*SCALE C EXIT 9999 RETURN END 0075 0076 0077 0078 0079 OOBO 0081 0082 0083 0084 0085 0086 0087 008B 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 •••••••••••••••••••••••• MXRARE • PROGRAM LISTINGS • •••••••••••••••••••••••• • MXRARE • MXRARE (SUBROUTINE) 9/29/64 lAST CARO IN DeCK IS NO. • LABEL CMXRARE SUBROUTINE MXRAREIDN,OO,LO,DNFRAC,ODFRAC,MNREWI,RAMX,ILO,IHI.tANSI C C -~-ABSTRACT---C C TITLE - MXRARE FINDS REGION TO MAXIMIZE RATIO OF TWO DISTRIBUTION FUNCTIONS C C C MXRARE FINDS A REGION ISUBJECT TO CONSTRAINTS), IN TERMS C OF THE iNDICES ILO AND IHI, WHICH MAXIMIZES THE FOLLOWING RATIO C C C DNIIHI) - DNIILO) C RATIO -------------------DOl IHI) - DDIILO) 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 WHERE DNl1 ••• LD) DOl1 ••• LD) IS ANY DISTRIBUTION FUNCTION IS ANY OTHER DISTRIBUTION FUNCTION AND BOTH DISTRIBUTION FUNCTIONS MUST SATISFY 1) 011+1) EQUALS OR EXCEEDS 01) 2) DIlDl EXCEEDS OIl) THE lENGTH lD IS ARBITRARY IHI-IlO ,THE WIDTH Of THE MAXIMIZING RE'~ON. IS CONSTRAINED BY THE USER IN THREE WAYS DNI IHI )-DNI ILOI 11 -------------- MUST BE GRTHN= DNFRAC DNILD1-ON(1) AND 2) DOl IHIl-DDI ILOI ------------DDIlDl-DD(1) MUST BE GRTHN" DDFRAC AND 31 IHI-110 MUST BE GRTHN- MNREWI WHERE DNFRAC, DDFRAC, AND MNREWI ARE INPUTS 0249 0001 0002 0003 OO~ 0005 0006 0001 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0021 0028 0029 0030 0031 0032 0033 0034 0035 0036 0031 0038 0039 O~O IF ZERO DENOMINATORS OCCUR THEY ARE TREATED AS FOllOWS0/0 IS TAKEN TO HAVE VALUE ZERO, AND A FLAG IS SET. 35 KIO WITH K GRTHN O. IS TAKEN TO HAVE VAlue 10 AND IS CHOSEN AS THE MAXIMUM RATIO. fA FLAG IS ALSO SET IN THIS CASE.) IF SEVERAL REGIONS HAVE THE SAME MAXIMUM RATIO THE ONE WITH MINIMUM ILO IS CHOSEN IIf SEVERAL HAVE THE SAME MINIMUM IlO. THEN THE ONE OF THIS SUBSET WITH MINIMUM IHI IS (HOSEN) lANGUAGE EQUIPMENT STORAGE SPEED AUTHOR - FORTRAN II SUBROUTINE - 109 OR 1090 IMAIN FRAME ONLY) - 302 REGISTERS - S.M. SIMPSON, MARCH 1963 ----USAGE--- TRANSFER VECTOR CONTAINS ROUTINES - NONE AND FORTRAN SYSTEM ROUTINES - EXPI2 FORTRAN USAGE CAll MXRARE(DN,DO,lO,DNfRAC,OOfRAC,MNREWI,RAMX,IlO,IHI,JANS' INPUTS DNIII I=l ••• LD IS THE NUMERATOR DISTRIBUTION FUNCTION Doell l=l ••• LD IS THE DENOMINATOR DISTRIBUTION FUNCTION ISEE ABSTRACT FOR CONDITIONS ON ONI I) AND DOlI).' C C C C • •••••••••••••••••••••••• •••••••••••••••••••••••• 0041 0042 0043 0044 0045 0046 0041 0048 0049 0050 0051 0052 0053 0054 0055 0056 0051 0058 0059 0060 0061 0062 0063 0064 0065 0066 0061 0068 0069 0010 0011 0012 0013 0014 .••••••••••••••••••••••• .* MXRARE •••••••••••••••••••••••• (PAGE ••••••••••••••••••• ** ••• .. MXRARE .. PROGRAM LI STINGS •••••••••••••••••••••••• 2) C IPAGE LO MUST ElICEEO 1 ONFRAC IS THE CONSTRAINT ON ONIIHIJ-ONIILOI MUST BI GRTHN= O. AND LSTHN= 1. (SEE DOFRAC IS THE CONSTRAINT ON OOIIHI}-ODIILOI MUST BE GRTHN= O. AND LSTHN= 1. I SEE ABStRACn. MNREWI IS THE CONSTRAINT ON IHI-ILO MUST ElICEED ZERO AND BE LESS THAN LD ISEE ABStRACTJ. C C C C C C C C C C ABS1:RACn~ C OUTPUTS C C RAMX IS THE MAXIMUM VALUE FOUND FOR RATIO ILO IS THE LOW INDEX OF THE MAXIMIZING REGION IHI IS THE HIGH INDEX OF THE MAXIMIZING REG LON C C C C C IANS C o NORMALLY C -1 C = -2 C -3 = -4 C C -5 C -6 1 C C C 2 FOR ILLEGAL ON INO OTHER OUTPUT IN TIt! S CASE I 10 I TTO) FOR I LLEGAL DO 10ITTO} FOR ILLEGAL LD I DITTO) fOR ILLEGAL ONFRAC IDITTO) FOR ILLEGAL OOFRAC (DITTO) FOR ILLEGAL MNREWI IF A % RATIO WAS FOUND IF A K/O RATIO WAS FOUND (SUPERSEDES IANS~l CASEI EXAMPLES C C 1. BEHAVIOUR WITH REGION UNCONSTRAINEO lIN THIS CASE IHI-ILO WILL ALWAYS COME OUT = 1) - DN{1 ••• 10) = 1.,B.,16.,26.,36.,37.,38.,58 •• 59 •• 74. DO{1 ••• 101 = -1.,0.,1.,2.,3.,4.,5 •• 6.,7.,8. LD = 10 ONFRAC = O. DDFRAC = O. MNREWI = 1 OUTPUTS - IANS = 0 RAMX = 20. ILD = 7 IHI = 8 C INPUTS C C C C C C C C C C C C C C C 2. BEHAVIOUR WITH REGION WIDTH CONSTRAINED TO BE 1,2 ••••• 6 INPUTS - SAME AS EXAMPLE 1. EXCEPT MNREWI IS SET IN USA~E DIMENSION RAMX{61.ILO(6),IHI{61,IANSI61 USAGE 00 10 I R= 1. 6 CALL MXRAREIDN.DD.LD.DNFRAC,DOFRAC.IR, 10 RAMX(IRI,ILOIIRI,LHIlIRI.IANSIIRH 1 0, 0, 0, 0, 0, 0 OUTPUTS - IANSI1 ••• 61 RAMX(1 ••• 61 20.0, 12.0, 12.0, 9.25,8.400,B.333 ILOl1 ••• 61 7, 7, 7, 6, 3, 2 IHIll ••• 61 8, 10, 10, 10, 8, 8 C C C C C C C 3. BEHAVIOUR WITH CONSTRAINT ON NUMERATOR ONLY INPUTS - SAME AS EXAMPLE 1. EXCEPT DNFRACIl ••• 31 = .35,~70,.80 00 10 1= 1, 3~ USAGE 10 CALL MXRAREION,DD,LO,DNFRAC{II,OOFRAC,MNREWI, 1 RAMX{ I)' ILOI Il ,IHII I), IANSI IX) 0, 0, 0 OUTPUTS - IANSll ••• 31 RAMXl1 ••• 31 12.0.8.286,8.250 ILOIl ••• JI 7. 3, 2 IHID ••• 31 10, 10, 10 C C C C C 4. C C C C C C BEHAVIOUR WITH CONSTRAINT ON DENOMINATOR ONLY INPUTS - SAME AS EXAMPLE 1. EXCEPT OOFRAC 11 •• 31 = .25,.70 •• 80 1=1,3 00 10 USAGE CALL MXRAREIDN.OO,LO,DNFRAC,DDFRACII),MNREWI, 10 1 RAMXII),ILOIIl,IHIIIl,IANSCIlIl OUTPUTS - SAME AS EXAMPLE 3. C 5. CASES INVOLVING JERO/ZERO RATIO C C C C C C C C C INPUTS - SAME AS EXAMPLE 1. EXCEPT 00(1)=0. AND ONIll = 8. AND MNREWI IS SET IN USAGE CALL MXRAREION,OO,LO,ONFRAC,OOFRAC,1.RAMX1. USAGE 1 ILOl, Ilill, IANSlI CALL MXRAREIDN,OO.LO,ONFRAC,OOFRAC,2.RAMX2. Il02,IliI2,IANS21 IHI1=8 RAMXl=20.0 IL01=7 OUTPUTS - IANS1= 1 IHI2=lO RAMX2=12.0 IL02=7 IANS2= o 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 01ll 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 21 • •••••••••• * •••••••••••• PROGRAM LI STINGS • MXRAAE * ....... ,•••'........ * •••••••• 1 PAGE 3) e e e e e e e e e e e e ••••• t ••• t~~ •• _.**.***.* MXRAAE * ........................ ~ 6. CASES INVOLVING KIO RATIO INPUTS SAME AS EXAMPLE 1. EXCEPT 00(1) : O. AND MNREWI IS SET IN USAGE USAGE - SAME AS EXAMPLE 5. OUTPUTS - IANS1: 2 RAMX1:10 •• 35 IL01=1 IHIl=2 IL02:1 IANS2: 0 RAMX2:l5.0 IHI2:3 7. ILLEGAL CASES INPUTS - SAME AS EXAMPLE 1 EXCEPT AS MODIFIED IN USAGE CALL MXRAREIDN.DD,l,O.,O •• l,RAMX,ILO.IHI.IANSl' CALL MXRAREIDN,DD.2,2.,0.,I,RAMX,IlO,IHI.1ANS3) CALL MXRAREIDN,DD,2,0.,-1.,I,RAMX,ILO.IHf,JANS31 CALL MXRAREION,DD,2,O.,O •• 2,RAMX,ILOiIHI,IANS4) e e DNI1I = 8. e CALL MXRAREIDN.OD,2,O.,0.,l,RAMX,llO.IHI,IANS5) 00(2) : -2. C e CALL MXRAREION,DD,3,0 •• 0 •• I.RAMX.ILO,IHI,IANS61 C OUTPUTS - IANSl= -3 IANS2: -4 IANS3= -5 IANS4=-6 C IANS5= -1 IANS6=-2 C PROGRAM FOLLOWS BELOW DUMMY DIMENSIONS DIMENSION DN(2).ODI21 C CHECK INPUTS IN THE ORDER LD. IDN,D01. DNFRAC,DDFRAC,MNAEWI C C C IANS=-3 IFILD-I) 9999,9999,10 10 DNTOTL=DNILD)-ONI11 DDTOTL=DDILDI-DOI11 IFIDNTOTLI 30,30.15 15 IFIDDTOTL) 35,35,20 20 DO 25 I=2,LD IFIDNIII-ONII-IJl 30,23,23 23 IFIODII1-OOtl-111 35,25,25 25 CONTINUE GO TO 40 30 IANS=-1 GO TO 9999 35 IANS=-2 GO TO 9999 40 IANS=-4 9999,45,45 IFIDNFRACI 45 IFIDNFRAC-l.O) 50,50,9999 50 IANS=-5 IFIDOFRAC) 9999,55,55 55 IFIDDFRAC-l.0) 60,60,9999 60 IANS=-6 IFIMNREWII 9999,9999,65 65 IFIMNREWI-LDI 10,9999,9999 C ALL OK ClANS WIll BE ZERO NOW UNLESS SPECIAL CASES ENCOUNTERED 70 IANS =0 ILOT:O ONAMNT=DNFRAC*DNTOTL DDAMNT=DDFRAC*OOTOTL RAMX=O. C Sf ART NEW LOW INDEX LOOP BY INCREASING ILOT BY 1. AND SETTING C IHIT=ILOT+MNREWI THEN CHECK FOR COMPLETION UNDER EACH OF THE C THREE CONSTRAINTS 100 ILOT=ILOT+l IH IT= I LOT,+MNREW J ONILDT=DNIILOTI ODILOT=DDIILOT! C CHECK FOR COMPLETION WHEN HIGH INDEX RUNS OFF 110 IFIIHIT-LDI 130,130,9999 C IF INDEX OK, CHECK NUMERATOR AND DENOMINATOR CONDITIONS 130 IFIDNIIHITI-DNItOT-DNAMNTI 150,140,140 140 IFIDDIIHITI-ODILOT-DDAMNT) 150,170,170 C IF CONDITIONS ON NUM AND DEN OM NOT MET INCREASE lHIT BY C AND GO RECHECK INDEX 150 IHIT=IHIT+1 GO TO 110 C IF ALL CONSTRAINTS SATISFIED, LOOP ON HIGH INDEX 170 DO 250 IXHI=IHIT,LD C CHECK FOR ZEROES IPAGE 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0111 0172 Ot13 0174 0115 0176 0177 0118 0179 0180 0181 0182 0183 0184 Ot85 01B6 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0191 0198 0199 0200 0201 0202 0203 0204 0205 0206 0201 020B 0209 02tO 0211 0212 0213 0214 0215 0216 0211 0218 0219 0220 0221 0222 0223 0224 3) •••••••••••••••••••••••• ................... ....... . IPAGE 4) • MXRARE PROGRAM LISTINGS • , TOpaDNCIXHIJ-DNILOT BOT=DDIIXHIJ-DDILOT IFIBOTl lBO,180,220 180 IFITOPI 190,190,200 C SPECIAL IANS SETTING FOR 0/0 CASE 190 IANS=l GO TO 250 C SPECIAL EXIT FOR K/O CASE 200 IANS=2 RAMX=lO ••• 311 ILO=ILOT IHI=IXHI GO TO 9999 C CHECK RATIO FOR BOT NOT ZERO 220 IF (TOP/BOT-RAMXI 250,250,230 C RESET TRIAL RATIO AND INDICES 230 RAMX=TOP/BOT ILO=ILOT IH·I" UHI 250 CONTINUE C WHEN FALL THRU, GO BACK FOR NEXT ILOT GO TO 100 C EXIT 9999 RETURN END •••••••••••••••••••••••• • MXRARE • •••••••••••••••••••••••• (PAGE 41 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 •••••••••••••••••••••••• • • PROGRAM LISTINGS •••••••••••••••••••••••• •••••••••••••••••••••••• • NEXCOS • ••••••••••••••• ** ••••••• REFER TO SEQSAC •••••••••••••••••••••••• •• ••••••••••••••••••••••• NEXSIN • NEXCOS REFER TO SEQ SAC NEXSIN ••••••••••••••••••••••••• * REFER TO SEQSAC •••••••••••••••••••••••• REFER TO SEQ SAC •••••••••••••••••••••••• • NMlMGI • .*...................... PROGRAM LISTINGS 'NMlMGI •••••••••••••••••••••••• 9/29/64 • NMZMGl (SUBROUTINE) • fAP 'NMlMGl COUNT 75 LBL NMlMGI ENTRY NMIMGl {LX,X,XMAX.SCALEI IN OEnK IS NO. 0096 0001 0002 0003 0004 0005 0006 0007 ----ABSTRACT---• OOOB • 0009 • TITLE - NMZMGl DOlO • NORMALIZE A VECTOR TO GIVEN MAXIMUM VALUE 0011 • 0012 NMZMGI NORMALIZES A FLOATING POINT SERIES TO A SPECIFIED • 0013 MAXI~UM ABSOLUTE VALUE AND RETURNS THE SCALING fACTOR USED • 0014 IN THE NORMALIZATION. • 0015 • 0016 • LANGUAGE - FAP. SUBROUTINE (FORTRAN II COMPATIBLE) .. EQUIPMENT - 709 OR 1090 (MAIN FRAME ONLY) 0017 0018 ~ 34 REGISTERS • STORAGE 0019 .. SPEED - (LENGTH OF SERIES)'33 MACHINE CYCLES .. AUTHOR 0020 1 R.A. WI'GINS. 17/9/62 0021 • 0022 ---USAGE---0023 • 0024 • TRANSFER VECTOR CONTAINS ROUTINES NONE 0025 • AND FORTRAN SYSTEM ROUTINES NONE 0026 • 0027 • FORTRAN USAGE 002B • CALL NMIMGltLX,X.XMAX.SCALEI 0029 • 0030 • INPUTS 0031 • X(ll 0032 I-I ••• LX IS A FLOATING POINT SERIES 0033 • 0034 LX MUST BE GRTHN= 1 0035 XMAX MAXIMUM VALUE WHICH THE X SERIES IS TO ATTAIN 0036 • 0037 0038 .. OUTPUTS 0039 • XCI) U040 I=I ••• LX IS THE NORMALIZEO (TO THE VALUE OF XMlXI SERIES 0041 • SCALE I S THE SCALING FACTOR THAT THE OR IGINAL SER IES WAS 0042 0043 DIVIDED BY TO OBTAIN THE NORMALIZED SERIES 0044 SCALE ~ MAXIMUM ABSOLUTE VALUE IN XSERIES/XMAX • 0045 .. EXAMPLES 0046 0047 •• 1. INPUTS - X(I ••• 51=1 •• 3 •• -2.,.5.0. LX=5 XMAX=6. 0048 0049 • OUTPUTS - XI1 ••• 5)=2 •• 6 •• -4 •• 1.,O. SCALE=.5 0050 0051 • 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT XMAX=I. 0052 • OUTPUTS - X(I ••• 5)=.333,1.,-.667,.1667,0. SCALE=3. 0053 •• 3. INPUTS - Xll ••• 5)=I.,-4.,2.,0.2,0.01 LX=~ XMAX=I. 0054 0055 • OUTPUTS - Xlf ••• 51=0.25,-1.,0.5.0.D5.0.0025 SCALE=4. 0056 0057 • 4. INPUTS - SAME AS EXAMPLE 3. EXCEPT XMAX=-l. 0058 • OUTPUTS - XI1 ••• 5)=-0.25.1.,-0.5.-0.05,-0.0025 SCALE=-4. 0059 • 0060 • 5. INPUTS - SAME AS EXAMPLE 3. EXCEPT XMAX-O. 0061 • OUTPUTS - Xll ••• 61=0 •• -0.,0.,0 •• 0. SCALE=O. 0062 0063 HTR o 0064 BCI l,NMZMGl 0065 NMIMGl SXO *-2,4 U066 SXA ADR,1 0067 CLA. 1,4 0068 POX .1 2,4 0069 CLA 0070 ADD =lB35 0071 STA A STA A+2 0072 0073 STA C 0074 C+2 STA .. .. . ... .. . .. . . . • f.f ••••••••••• , ••••••••• LAST CA~D •••••••••••••••••••••••• • • NMIMG1 •••••••••••••••••••••••• (PAGE 2) A B C AOR MAX CAL· STO CLA SSM TPL CAL S,TO TIX CLA FOPSTO· STO CLAPOX CLA FOP STQ TIX AXT TRA PIE END 2,1t MAX MAX ··.1 B .*.1 MAX A-1, 1,1 MAX 3,4 4,4 MAX 1,4 ,1 •• ,1 MAX ·*,1 C,l,l .*,1 5,4 PROGRAM LISTINGS •••••••••••••••••••••••• • NMlMG1 • •••••••••••••••••••••••• (PAGE 0015 0016 0011 0018 0019 OOBO 1'081 0082 0083 0084 0085 0086 00B1 0088 0089 0090 0091 0092 0093 0094 0095 0096 2) ........................ .......-................. , • NOINTI • PROGRAM LISTINGS 9129/64 • NOINH 1 SUBROUTINE) • FAP -NOINH COUNT 310 LBL NOINH NOINH IX,PROB) ENTRY ENTRY NOINT2 (XMEAN,XSD,NDIV,XOIV,IANS) • • • • • • • • • • • • • • • • • • • • • • • • II • II II II * II • • • • • • II • • • • • • • • • * • • II * * •II • • • •* • .. ••••••••••••••••••••••• NOINTI • , JS NO. 0314 0001 0002 0003 0004 0005 0006 0001 -~ABSTRACT---OOOB 0009 TITLE - HOINTI WITH SECONDARY ENTRY NOINT2 0010 NORMAL DISTRIBUTION AND DIVISION INTO EQUALLY LIKELY SECTIONS 0011 0012 0013 NOINTI FINDS THE INTEGRAL OF THE ZERO MEAN, UNIT VARIANCE', NORMAL RROBABIlITY DENSITY FUNCTION FROM MINUS INFINITY 0014 TO X. THIS IS DONE BY TABLE LOOK UP IN A TABLE OF 201 0015 VALUES OF THE NORMAL DISTRIBUTION WHICH CORRESPBND 0016 TO VALUES OF X FROM 0.0 TO 4.0 IN INCREMENTS OF .02 0011 LINEAR INTERPOLATION IS USED FOR VALUES OF X LYING 0018 BETWEEN TABULATED VALUES. THE PROGRAM RETURNS ZERO FOR X 0019 VALUES lESS THAN -4.0, AND RETURNS 1.0 FOR X VALUES 0020 GREATER THAN 4.0. 0021 0022 HOINT2 DIVIDES UP THE ENTIRE X AXIS INTO AN ARB~TRARY OC23 NUMBER, NDIV, OF RANGES WHICH ARE EQUALLY LIKELY NITH 0024 RESPECT TO A GIVEN NORMAL DISTRIBUTION SPECIFIED BY 0025 ITS MEAN AND STANDARD DEVIATION. 0026 0021 THE INTEGRAL OF THE NORMAL DISTRIBUTION GIVES THE 002B PROBABILITY THAT X LIES IN A CERTAIN RANGE. NOINT2 0029 REVERSES THE PROCESS BY FINDING THE X RANGES WITH 0030 A GJVEN PROBABILITY. IINDIV = PROBABILITY FOR EACH 0031 DIVISION. FOR K-TH DIVISION, XAXIS LIMITS CORRESPOND 0032 TO THE PROBABILITIES IK-l1/NDIV, K/NDIV. STORED VALUES 0033 OF THE ANTISYMMETRIC INTEGRAL OF THE UNIT NORMAL 0034 DISTRIB~TION FOR X VALUES ZERO TO 4 IN INCREMENTS OF .02 0035 ARE SEARCHED FOR PROBABILITY VALUES GIVEN BY K/NDIV. 0036 INTERPOLATION WHERE NECESSARY IS LINEAR. I.E. FINO NEAREST 0037 VALUE OF X TO CORRESPONDING TO P WHEN P DOES NOT APPEAR 003B IN TABLE EXACTLY. IF R-TH VALUE IN TABLE IS LESS THAN P. 0039 AND (R+l) TH VALUE IS GREATER, THEN X VALUE = HP-RTH 0040 VALUE)/t(R+llTH-RTH VALUE»-.02+RII.02. THIS VALUE IS 0041 THEN SCALED FOR THE PARTICULAR NORMAL DISTRIBUTiON SUCH 0042 THAT THE OUTPUT X = XIIXSD+MEAN. SINCE ONLY HALF OF THE 0043 NORMAL INTEGRAL IS STORED, THE X VALUES CORRESPONDING TO 0044 PI GREATER THAN .5 ARE COMPUTED FIRST AND THE VALUES 0045 0046 FOR P2 lESS THAN .5 ARE SYMMETRIC AND EQUAL TO I-Pt. 0041 NOTE - NOINT1 AND NOINT2 ARE INDEPENDENT EXCEPT FOR 0048 THEIR M~TUAL NEED OF THE DISTRIBUTION FUNCTION TABLE. 0049 0050 0051 LANGUAGE - FAP SUBROUTINE (FORTRAN II COMPATIBLE) 0052 EQUIPMENT - 109 OR 7090 IMAtN FRAME ONLY) 0053 - 369 REGISTERS STORAGE 0054 SPEED - S.M_ SIMPSON AND J.N. GALBRAITH 0055 AUTHOR 0056 0051 ---USAGE--0058 0059 TRANSFER VECTOR CONTAINS ROUTINES - lINTRl 0060 AND FORTRAN SYSTEM ROUTINES - NONE 0061 0062 FORTRAN USAGE OF NOINTl CAll NOINHIX,PROB) 0063 0064 0065 INPUTS TO NOINTl 0066 x 0061 = UPPER LIMIT OF THE INTEGRAL (FLT PT.'. 006B 0069 OUTPUTS FROM NOINTI 0070 0071 1 X 2 PROB 0012 ----~---INTEGRAL (EXPI-X 12IDX). SQRTt2PIl -INFINITY 0013 0014 • .•........................ LAST CARD IN DEC~ ••• -...,.*•• ............. * •••••••••••••••••••••••• NOINT1 • PROGRAM LI STINGS ~ • NOINT1 • ..... '••• *....... ,. .......... . (PAGE 2t .. • •••••••••••••••••••••••• (PAGE 21 IS FLOATING POINT .. fORTRAN USAGE OF NOINT2 .. CALL NOINT2{XMEAN,XSO,NOIV,XOIV,IANSI •.. . INPUTS TO NOINT2 • • • XMEAN = MEAN OF X SERIES XSO = STANDARD DEVIATION OF X SERIES. MUST BE GRTHN O. • NOIV = NUMBER OF EQUALLY LIKELY DIVISIONS INTO WHICH X SERIES IS TO BE PLACED. MUST BE GRTHN 1 •. ...• .. OUTPUTS FROM NOINT2 • • • • .• .... • ..... ... • .• • .. . XDIVIH I=I ••• NDIV-l ARE THE X VALUES FOR EQUALLY LIKELY DIVISIONS. FIRST DIVISION IS FROM -INFINITY to XDIV.ll, THE SECOND IS FROM XDIVll) TO XOIV(2) ETC. THE LAST DIVISION IS FROM XDIV(NOIV-l) TO +INFINITY. IANS =0 =1 =2 NORMAL IllEGAL XSD ILLEGAL NOIV EXAMPLES OF NOINTI 1. INPUTS - X=-5. OUTPUTS - PROB=O. 2. INPUTS - X=-4. OUTPUTS - PRDB=.32 E-04 3. INPUTS - X=.013 OUTPUTS - PROB=.5052 .. 4. INPUTS - X=4. .. OUTPUTS - PROB=.999968 •.. 5. INPUTS - X=4.1 OUTPUTS - PROB=l. • • .• EXAMPLES OF NOINT2 • 1. INPUTS - XMEAN=O. XSO=l. NDIV=3 .. OUTPUTS - XOIVll)=-.430122 XDIV(2)=.430122 IANSoIO • 2. INPUTS - XMEAN=O. XSO=2. NDIV=3 • OUTPUTS - XDIVll)=-.861444 XOIV(2)=.861444 lANS"O • . .. 3. INPUTS OUTPUTS • . .. .. 4. INPUTS XMEAN=I. XSD=2. NOIV=3 XOIV(I)=.1385185 XOIV(2)=1.861444 - XMEAN=O • OUTPUTS - XOIVIl)=O. INPUTS - XMEAN=3.5 OUTPUTS ERROR IANS=2 .. 5. INPUTS •. . XMEAN=3.5 OUTPUTS - XOIVIU=3.5 .. 6. • .• • 1. INPUTS - XMEAN=3.5 OUTPUTS - ERROR IANS=l XSO=l. NDIV=2 IANS=O XSO=l • NDIV=2 IAN SaO XSD=I. NOIV=l XSo=o. NDIV=2 • 8. INPUTS XMEAN=O. XSD=l. NDIV=4 * OUTPUTS - XOIVll ••• 31=-.614602,0.,+.614602 • * • IANS=O 9. INPUTS - XMEAN=O. XSD=I. NOIV=5 OUTPUTS - XOIV(1 ••• 41=-.B411856.-~253334,.253334 •• 8411856 •*1 NITI ALI ZE. PZE 0 IANS"'O 0075 0076 0077 0078 0019 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 DUO 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 •••••••••••••••••••••••• NOINll • ••••••••••••••••••••••••• PROGRAM LISTINGS • (PAGE 31 ..• " • ••••••••••••••••••••••• NelNTl • .•.......•.......... BCI 1 ,NOI Nfl LV.4 NOINTl SXA NOINTl ... 2,4 SXD 1,4 CLA STA GET X 2,4 CLA STA STORE -GET,STORE X AND ITS SIZE. COMPARE SIZE WITH •• ..=ADORESS OF X GETX CLA s;ro xx SSP STO SX CAS K4Ft TRA BIGGER TRA I NTRP TRA INTRP -(OR ZERO FOR NEG Xl. BIGGER CtA K1FL 510 TEMP TRA CHECK .INTERPOLATE IF SIZE lESS THAN OR " 4.0. -NOTE LINTRl MUST BE USED BACKWARDS SINCE OUR .TABLE IS FORWARDS. INTRP CLA K4FL FSB SX STO SXMOD TSX SLINTRl,4 TSX SXMOO SXMOO=4.0-SX TSX KO XLO=O.O TSX KDElX KDELX"0.02 TSX Y+ 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 2) •••••••••• * •• *.* •••••••• POlYSN •••••••••••••••••• * ••••••* (PAGE PROGRAM LISTINGS 3) IFST=1 NT=3 C CONVlV AND RESET lPOlY AND PlYCOSIII 100 CONTINUE CAll CONVlV (lPlY ,POlY,NT,T.SPACEI lPlY =lPlY *NT-l CAll MOVE IlPlY ,SPACE,POlYI 120 CONTI NUE SC=SCAlE IF (Sct 140,130.140 130 SC=l./POlY(ll 140 CONTINUE 00 150 I=I,lPlY 150 POlY(IJ=SC-POlY{II lPOlY=lPlY 999 RETURN END •••••••••••• * •••••• **-** • ~ * pnlYSN •••• * ••••• * •••• * •••••• * (PAGE 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 31 ••••••• *** •••••••• **•••• . •••••••••••••••••••••••• PROGRAM LI ST INGS POWER ••••••••••••••••••••• • **** • POWER .. • ••••••• ** •••••••••• **** lAST CARD IN DECK IS NO. 0129 0001 .POWER 0002 COUNT 150 0003 lBl POWER 0004 POWER tX,lX,N,X2NTHl ENTRY 0005 ENTRY SMPROV IX,lX,N,XBASE,SXMB2NI 0006 0007 ----ABSTRACT--~OOOB • 0009 • - TITLE - POWER , WITH SECONDARY ENTRY SMPRDV 0010 .. RAISE VECTOR TO POWER OR SUM POWER OF DEVIATIONS FROM BASE 0011 0012 POWER RAISES ELEMENTS OF A VECTOR TO A POSITIVE OR 0013 • NEGATIVE INTEGER POWER. OUTPUT MAY REPLACE INPUT. 0014 • 0015 • SMPRDV SUMS THE N-TH POWER OF THE DEVIATIONS OF A 0016 • VECTOR FROM A CONSTANT. WHERE N IS POSITIVE OR 0017 • NEGATIVE. OOlB • 0019 .. lANGUAGE - FAP SUBROUTINES, FORTRAN-II COMPATIBLE 0020 709 OR 7090 IMAIN FRAME ONLY) 0021 - EQUIPMENT 50 REGISTERS 0022 • STORAGE 7090 709 0023 - SPEED (46 OR 50) + 170 TO 270)-lX MACHINE CYCLES, 0024 DEPENDING ON ARGUMENTS 0025 - S.M.SIMPSON, SEPTEMBER 1963 0026 • AUTHOR 0027 -,.---USAGE---0028 • 0029 • • TRANSFER VECTOR CONTAINS ROUTINES - tNONE) 0030 • AND FORTRAN SYSTEM ROUTINES - EXPI2 0031 POWER FAP • (SUBROUTINE) 9/29/64 • . . -- - ,)0~~ • FORTRAN USAGE • CAll POWER (X,lX,N,X2NTH) • CAll SMPROV(X,lX,N,XBASE.SXMB2N) • •. • •. -.• INPUTS XII) I=l ••• lX lX MUST EXCEEO ZERO. N IS THE DESIRED POWER IPOS OR NEG OR ZEROI .•• OUTPUTS ..• X2NTH(IJ •. • • • ...• XBASE SXMB2N IS A FlTG PT VECTOR IS THE BASE (FOR SMPRDVI STRAIGHT RETURN WITH NO OUTPUT IF lX lSTHN 1. eXCEPT THAT SXMB2N ~'ll BE SET O. I=l ••• lX IS X2NTH(I) EQUIVAlENCEIX2NTH,Xl IS = SUMtFROM (XI II)nN IS PERMITTED 1=1 TO lX) OF IXIIJ-XBASE) ... N EXAMPLES 1. INPUTS - XIl ••• 41 = I., 2., 3., -4. XN4 • USAGE CAll POWER IX, 4, 3, XNIJ • CAll POWER IX, 4, -2, XN21 • CAll POWER IX, I, 3, XN31 • CAll SMPRDVIX, 4, 3, I., SXNll CAll POWER IX, 4, 3, Xl • .. CAll POWER IX, 0, 3, XN4) • OUTPUTS - XNlI1 ••• 41 1., 8., 27., -64. .. XN211 ••• 4) I., .25, .1111111, .0625, • XN3 = 1. • SXNl = -116. • Xl1 ••• 4) I., 8., 27., -64. • XN4 = -999. INO OUTPUT CASE) • • •. PROGRAM FOllOWS BELOW ~ -999. 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 •••••••••••••• ** •••••••• • POWER • •••••••••••••••••••••••• (PAGE PROGRAM LISTINGS •••••••••••••••••••••••• POWER ••••••••••••••••••••••• • ** 2) • TRANSFER VECTOR CONTAINS EXP{2 HTR 0 XRl HTR 0 XR4 1,POWER BCI • PRINCIPAL ENTRY~ PDWER{X,lX,N,X2NTHl 4,4 POWER ClA ADO Kl AIX2NTHI+l STO STA BASE CLEAR BASE STl ZIFPOW AND ENTRY INDICATOR STl ClA TRAP TRA SETUP • SECONDARY ENTRY. SMPRDV (X, LX-,eN, XBAS E, SXM82N) 4,4 SMPRDV ClA* XBASE $TO BASE 5,4 AISMXNTH) ClA STA FAD 5,4 CLEAR SUM STl· ClA TRAS ZIFPOW_4 SXO (lIFPOW NON-ZERO) POWER-2,4 SETUP SXD SXD POWER-3,l STA TRA 1,4 Kl ClA Kl AIX)+l ADD CLA STA ClA. 3,4 N STO POWR ClA. 2,4 lX TM! LEAVE POX 0,1 lEAVE,l,O TXl • lOOP ClA CLA .·,1 **=AIX)+l FSB BASE lOQ POWR TSX SEXPI2.4 TRA TRA **=STD OR FAD ** STO STO **=AIX2NTH)+1 ·*.1 TRA TIX FAD FAO **=AISMXNTHI ** FAD STO* ClA,I,l TIX TIX • EXIT POWER-2,4 lEAVE lXD lXO POWER-3.1 lET lIFPCW 6,4 TRA 5,4 TRA TRAP PlE STO TRAS PZE FAD 0.0 OR X6ASE BASE PZE POWR PIE N 0,0,** 0,0.,*. IIFPOW PZE **=0 IF POWER,=NON ZERO IF SMPRD¥ ENO ··f··f·· IPAGE 0015 0016 0011 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0096 0099 0100 0101 0102 0103 0104 0105 0106 0101 0106 0109 0110 Otll 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 21 •••••••••••••••••••••••• PROGRAM LI STINGS PRBFIT ••••••••••••••••••••••••• • •••••••••••••••••••••••• • PRBFIT • PRBFIT CSUBROUTINE) 9/29/64 LAST CARD IN OECK IS NO. • LABel CPRBFIT SUBROUTINE PRBFITINOR,XMOM.NOUT,X,F,PHI,IANS) C C ----ABSTRACT---C C TITLE - PRBFIT C GENERATE PROBABILITY DISTRIBUTION WITH SPECIFIED MOMENTS C C PRBFIT SENERATES A ZERO-MEAN OISTRIBUTION FUNCTION~ FJX), C WHOSE HIGHER MOMENTS 12ND,3RD, ••• ,NTH WHERE N )S LESS C THAN OR EQUAL 6) ASSUME GIVEN VALUES. FIX) HAS THE FORM C OF A NORMAL DISTRIBUTION rIMES A POLYNOMIAL IN X, AND C CONSEQUENTLY IS USEFUL FOR APPROXIMATING EMPIRICAL C DISTRIB~TIONS WHICH ARE ROUGHLY NORMAL IN APPEARANCE. C BUT FOR WHICH THE NORMAL APPROXIMATION IS INADEQUATE. C IT SHOULD BE NOTED THAT THE PROCEDURE CAN YIELD NEGATIVE C VALUES FOR THE DISTRIBUTION IN CASES WHERE THE DEVIATION C FROM NORMALITY IS SEVERE. C AN ANALYSIS OF THE PROCEDURE USED MAY BE FOUND IN C CRAMER, H., 1951, MATHEMATICAL METHODS OF STATI9TICS. C PRINCETQN UNIVERSITY PRESS, PRINCETON, PAGE 222. C C THE FORM OF THE CALCULATION IS C C C13) D 0 DCPHICUll C FIX) = PHICU) + - - - * (--*--*-----) C 1*2*3 DU DU DU C C C(4) D 0 0 DIPHIIU)) C + ------- • (-~---.--*---------) + ••• + ~ ! .. , .. ~ .. 4 nil nil 011 nu C C CINOR) 0 OIPHIIU)) C C 1.2 ••••• NOR DU DU C C EVALUATED FOR A GIVEN SET OF X ~ALUES C X.Xt1),X(2) •••• ,XINOUT) C WHERE C D C DENOTES DIFFERENTIATION WITH RESPECT TO U C DU C C U X/SIG C C PHIIU) = EXPI-.5.U*U)/CSQUARE ROOTI2.PII) C II.E. NORMAL CURVE) C C PI 3.14159265 C C K XMOM(L) C OIK) = SUM - - - - . AIK,l) I C L=O SIG C C AIK,L) COEFFICIENT OF LTH POWER OF X IN THE KTH C HERMITE POLYNOMIAL IX) C C XMOMlL) LTH PROBABILITY MOMENT C IINPUT PARAMETER VECTOR) +---------- • 1--•... ------1 C C C t C C C C C SIG = SQUARE ROOTlXMOM(2) I.E. STANDARD DEVIATION LANGUAGE - FORTRAN II SU8ROUTINE EQUIPMENT - 709, 7090 IMAIN FRAME ONLYI STORAGE - 373 REGISTERS SPEED AUTHOR ~ R.J. GREENFIELD, JAN 1963 C C • f ••••••••••••••••••••••• ----USAGE---- C C t TRANSFER VECTOR CONTAINS ROUTINES - NONE 0186 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 001~ 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 00" 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 •••••••••••••••••••••••• it PROGRA~ • PRBFIT •••••••••••••••••••••••• 'R8FIT • LISTINGS • •••••••••••••••••••••••• •••••••••••••••••••••••• IPAGE 2) IPAGE AND FORTRAN SYSTEM ROUTINES - SORT, EXPI2, EXP C C C FORTRAN USAGE C CALL PRBFITINOR,XMOM.NOUT,X,F.PHI.IANSI C C INPUTS C NOR IS THE ORDER OF THE HIGHEST ORDER MOMENT GIVEN MUST BE GRTHN= 2 AND LSTHN = 6 XMOMII) I"I ••• NOR CONTAINS THE MOMENTS WHICH WILL BE USED TO DEVELOP THE EXPANSION. THE FIRST MOMENT, XMOMltl. IS NOT ACTUALLY USED, BUT IS ASSUMED TO 8E =0. II.E. ZERO MEAN ASSUMPTION). NOUT IS THE NUMBER OF X VALUES AT WHICH THE EXPANSIeN WIll BE EVALUATED C XO) C C C I=l ••• NOUT IS THE LIST OF VALUES AT WHICH THE IXPANSION WILL BE EVALUATED PHI I II USED FOR STORAGE MUST BE DIMENSIONED AT LEAST AS LARGE AS NOUT C C C C C C C C C C C C C C OUTPUTS C C C C C C C C FIll IANS I:l ••• NOUT ARE THE VALUES OF THE EXPANSION FOR THE NOUT VALUES OF X. I.E. FII) : FIXIII) AS DEFINED IN ABSTRACT o 1 NORMAL IllEGAL NOR C C EXAMPLES C 1. tNORMAL APPROXIMATION) INPUTS - NOR : 2 XMUDIl ••• 41" 0.,4.,8.,10. XIl ••• 41= 0 •• 5 ••• 8.-.8 C OUTPUTS - Fll ••• 4)= .39894,.017528,.36828,.36828 C C C NOUT : 4 IANS: 0 C SAME AS IN EXAMPLE 1. EXCEPT NOR: 3 C 2. INPUTS OUTPUTS - Ftl ••• 4)= .39894 •• 041265 •• 29854 •• 43800 C C IANS"' 0 C C C IANS= 0 3. INPUTS - SAME AS IN EXAMPLE 1. EXCEPT NOR" 4 OUTPUTS - Fll ••• 41= .28051,.0333501 •• 22328,.36272 C 4. INPUTS - SAME AS EXAMPLE 1. EXCEPT NOR: 0 OUTPUTS - ERROR IANS: 1 C C C C C 5. INPUTS - SAME AS IN EXAMPLE 1. EXCEPT NOR=10 OUTPUTS - ERROR IANS: 1 DIMENSION A/7.71,CI71.PHIIIOO),XMOMI7),XII001.XMUD(71 DIMENSION XMU(71,Ft21 NORDER = NOR +1 C TEST INPUT DATA IF (NOROER-21 31,31,32 IANS:l RETURN IFtNORDER-7) 33,33,31 32 33 IANS=O XMU(l): 1. XMU(21= O. DO 50 K=2,NOR 50 XMU(K+ll=XMOMIKI C SET UP A TABLE 00 1 J=I,7 A(J.J)=l. A(3,l)=-I. A(4,2)=-3. A( 5, 1)=3. A/5,31=-6. A(6,21:15. AI6,4)z-10. 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 Olllt 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 olit 2 0143 0144 0145 0146 0147 0148 0149 21 ....•.......... *._.•.... • PRBFIT • PROGRAM LISTINGS •••••••••••••••••••••••• IPAGE 3) IPAGE AI7,1l=-15. AI7,3)=45. AI7,5) =-15. C All SUBSCRIPTS ADVANCED BY 1 C XII) INPUT NORMALIZED BY CALLING PROG IZERO MEAN) C XMU ARE NOT NORMALIZED BUT ARE FOR ZERO MEAN C SEC TO COMP C SIG= SQRTFIXMUI311 DO 51 I=l,NOUT 51 XIII= XIII/SIG FACT=l. DO 5 K=l,NORDER CIK)=O. IFIK-ll 41,41,40 40 ~ACT=FACT*FlOATfIK-11 41 DO 4 L=l,K 4 CIK)=CIKI+IXMUILI/ISIG**IL-11)I*AIK,L) 5 C(KI=CIKI/fACT C SET UP TABLE OF PHI DC 6 l=l,NOUT 6 PHIII)=EXPFI-XII1*XII)*.5)*.3989413 C COMPUTE FIll FOR NORMAL DISTRIBUTION DO 7 l=l,NOUT 7 F ( Il =C III .P H II J) IFINORDER-4) 99,8,8 C COMPUTES OTHER ORDER F 8 DO 19 K=4,NORDER DO 12 l=l,NDUT HER=AIK,ll DO 10 L=2,K 10 HER=HER+AIK,L)*XII1**IL-1) 12 FII)=FIII+PHIII).CIK).HER 99 98 •••••••••••••••••••••••• PRBFIT * •••••••••••••••••••••••• • DO 98 l=l,NDUT XII)= XIII-SIG RETURN END 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 31 •••••••••• ** ••• * •••••••• • PROB2 PROGRAM LISTINGS • •••••• ••• * ••••••• * ••• *.~ 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 C C C C C C C C •••••••••••••••••••••• ** LAST CARD IN DECK IS NO. 0174 0001 0002 0603 0004 0005 ----ABSTRACT---0006 0007 TI TlE - PROB2 OOOB SECOND PROBABILITY OENSITY OF INTEGER SERIES AT GIVEN LAG. 0009 0010 PROB2 COMPUTES THE SECOND PROBABILITY DENSITY FOR AN 0011 INTEGER SERIES BY A FREQUENCY COUNT METHOD. THE SECOND PROBABILITY DENSITY, PIM,L), OF A SERIES IXIKl IS THE 0012 PROBABILITY THAT XIK) = M AND XIK+NI=L, WHERE N IS THE 0013 C014 LAG. PROB2 COMPUTES THIS QUANTITY FOR A GIVEN N. THE 0015 INTEGER SERIES MUST BE SCALED SUCH THAT THE LOWEST VALUE 0016 OF IXIK) =1 AND THE HIGHEST VALUE IS IXHI. IXHI MUST BE LESS THAN OR EQUAL TO THE DIMENSION OF THE P(I,J) MATRIX. 0017 0016 THE PROGRAM BELOW DIMENSIONS PII,JI TO PI25.25l. 0019 PROB2 COUNTS INTO AN INTEGER MATRIX, IPII,J}, THE NUMBER 0020 0021 OF TIMES IX(K)=M AND IXIK+N)=L OVER ALL INDEX PAIRS 0022 K, K+N SUCH THAT BOTH K ANO K+N LIE IN THE INCLUSIVE 0023 RANGE 1 TO LX WHERE LX IS T~E SERIES LENGTHJ N MAY 0024 BE NEGATIVE. 0025 0026 THE INTEGER FREQUENCY COUNT MATRIX IS flOATED II!iIH'l PfI,J' 0027 AND NORMALIZED SUCH THAT SUM OVER I AND J OF PIJ,J) IS 1. 0028 THIS IS DONE BY DIVIDING EACH ELEMENT BY R, WHERE 0029 R=LX-XABSFIN1. PII,JI AND IPII,Jl MAY BE EQUIVALENT IF THE 0030 FREQUENCY COUNT IS NOT NEEDEO. (THIS CAN BE RECONSTRUCTED 0031 SINCE LX AND N ARE KNOWN.) 0032 0033 LANGUAGE - FORTRAN II SUBROUTINE 0034 EQUIPMENT - 709.7090 IMAIN FRAME ONLY) 0035 STORAGE - 229 DECIMAL REGISTERS 0036 SPEED 0037 AUTHOR - J.N. GALBRAITH 0036 0039 ----USAGE--0040 0041 TRANSFER VECTOR CONTAINS ROUTINES - NONE 0042 AND FORTRAN SYSTEM ROUTINES - NONE 0043 0044 FORTRAN USAGE 0045 CALL PROB2 IIX,LX,N,IP,P,IXHI,IANSl 0046 0047 INPUTS 0048 0049 I X(I I INTEGER SERIES. IXII) GRTHN 0, LSTHN OR : IXHI 0050 C051 LX INTEGER. LENGTH OF IX SERIES. GR1HN ZERO 0052 0053 INTEGER. LAG OR SEPARATION FOR COUNT. CAN BE +~-, OR O. N 0054 XABSINl LSTHN OR = LX 0055 l=l, ••• IXHI,J=l, •• ,IXHI SPACE FOR COMPUTATION OF 0056 I PI I, J I 0057 FREQUENCY RATIOS. MAY BE EQUIVALENT TO PII_Jl. WILL 0058 CONTAIN FREQUENCY RATIOS WHEN RETURN IS MADE If NB 0059 EQUIVALENCE HAS BEEN MADE. 0060 0061 INTEGER. LARGEST VALUE IX TAKES ON. PROGRAM ASSUMES IXHI 0062 IXHI LSTHN DR = 25. MUST BE LSTHN OR EQUAL DIMENSION OF PI I ,J) MATRIX. 0063 0064 0065 OUTPUTS 0066 0067 I=l, ••• IXHI.J=l, •• ,IXHI. PROBABILITY DENSITY FOR LAG OF N 0068 NORMALIZED SUCH THAT SUM OVER I AND J OF PCI," IS 1. 0069 0070 INTEGER. ERROR INDICATOR IANS 0071 =0 NORMAL 0072 =-1 IllEGAL IX VALUE. SOME IX LSTHN 1 OR GRTHN IXHI. 0073 =-2 ILLEGAL LX. LX LSTHN 1 0074 =-3 ILLEGAL N. XABSFINI GRTHN LX. • PROB2 ISUBROUTINE) 10/6/64 • LABEL CPROB2 SUBROUTINE PROB2 IIX,LX,N,IP,P,IXHI,tANS) C •• ••••••••••••••••••••••• PROB2 • •••••••••••••••••••••••• PROB2 • •••••••••••••••••••••••• PROGRA~ • IPAGE •••••••••••••••••••••••• • PROB2 • LISTINGS •••••••••••••••••••••••• IPAGE 21 2) 3, INPUTS - SAlliE AS EXAMPLE 2 EXCEPT lX=O OUTPUTS - IANS=-2 4. INPUTS - SAME AS EXAMPLE 2 EXCEPT IXHI=O OUTPUTS - IANS"-6 5. INPUTS - SAME AS EXAMPLE 4 EXCEPT IXHI=26 OUTPUTS - IANSa-6 6. INPUTS - SAME AS EXAMPLE 2 EXCEPT IX151=5, N=-6 OUTPUTS - IANS=-3 c AS EXAMPLE 1 EXCEPT Nz-1 - SAME IANS=O C 8. INPUTS C OUTPUTS C C C C IPII,JI= C C C C 9. INPUTS C OUTPUTS C 4 2 0 0 0 0 2 2 0 0 0 0 0 1 0 0 2 0 2 1 2 0 0 0 2 .2 .0 .1 .1 PI ltJI= .0 .0 .0 .1 .0 .0 .0 .0 .05 .1 .0 .0 .. 0 .05 .0 .0 .0 .0 .1 .1 .1 - C SAME AS EXAMPLE 1 EXCEPT lX=24, N=3 lANS=O 4 1 2 0 0 .19 .05 0 0 1 2 1 .0 .0 IPII,JI= 0 0 0 1 2 PI I,J)= .0 .0 .1 2 0 0 0 1 .0 2 2 0 0 0 .1 .1 C C C C C10. INPUTS - SAME AS EXAMPLE 1 EXCEPT lX .. 20, NzO C OUTPUTS - JANS=3 C C 6 0 0 0 0 .3 .0 C 0 4 0 0 0 .0 .2 IPII,JI= 0 0 3 0 0 C PII,JI= .0 .0 C 0 0 0 3 0 .0 .0 C 0 0 0 0 4 .0 .0 C DIMENSION IX(1000I,IPI25,25),PI25,251 CHECK LX C IANS=-2 IF(lXI 9999,9999,1 2 IANS=-6 CHECK IXHI C IFIIXHII 9999,9999,3 3 IFIIXHI-251 4,4,9999 C CHECK IX SERIES 4 IANS=-l DO 1 [=l,lX [FCIXII)) 9999,9999,11 IFI[XIII-IXHII 1,1,9999 11 1 CONTINUE IANS=-3 CHECK N c .1 .05 .0 .0 .0 .0 .0 .15 .0 .0 .0 .1 .0'1 .0 .0 .;0 .. 0 .. 0 .. 15 .. 0 .0 .05 .1 .05 .0 .0 .0 .0 .0 .a •••••••••••••••••••••••• PR082 * •••••••••••••••••••••••• • IPAGE PROGRAM LISTINGS 3) 41 C 5 6 7 8 9 10 IFIXABSFIN1-lX) 41,9999.9999 I ANS=O CLEAR IPII,J) DO 5 1=1,25 DO 5 J=1.25 IPII ,J)=O IFIN) 6,7.8 lFRST=-NH llAST=lX GO TO 9 IANS=3 lFRST=l llAST=lX-N DO 10 l=lFRST,llAST J=IXIIl. KK=I+N K=IXIKKI IPIJ,KlzIPIJ,KI+1 l=llAST-lFRST+1 TOTAl=l DO 15 l=l,IXHI DO 15 J=l,IXHI 15 PII,J)~FlOATF(IPII,JI)/TOTAl 9999 RETURN END •••••••••••••••••••••••• • PR082 * • ••••••••••••••••••••••• IPAGE 0150 0151 0152 01')3 0154 "15~ 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 3) ••••••••• '... *** ••• ** ••••• .. PROCOR • •• 4 •••••••••••• ****.*** PROGRAM LI STINGS .. • •••••••••••••••••••••••• PROCOR .. •••••••••••••••••••••••• 9129/64 LAST CARD IN DECK IS NO. 1498 • PROCOR (SUBROUTINE) 0001 • FAP .PROCOR 0002 COUNT 1500 0003 LBL PROCOR 0004 PROCOR (X,LX,MAXX,PROGl,PROG2,ERRI ENTRY 0005 ENTRY FASCOR (Y,KMIN,KMAX,CORlER,ERRORl 0006 ENTRY FASEPC (Y,KMIN,KMAX,CORZER,ERRORI 0007 ENTRY FASCRI (Y,KMIN,KMAX,CORZ~R,ERRORI 0008 FASEPI (Y,KMIN,KMAX,CORZER,ERROR) ENTRY 0009 0010 ----ABSTRACT---0011 • 0012 • 0013 • TITLE - PROCOR WITH SECONDARY ENTRY POINTS FASCOR,FASEPC,FASCRhFASEPI • FAST CORRELATIONS FOR LONG SERIES OF FIXED POINT iNTEGERS 0014 0015 • PRDCDR WRITES A MACHINE LANGUAGE PROGRAM DESIGNED TO 0016 COMPUTE AT HIGH SPEED A SINGLE FIXED POINT CROSS PRODUCT 0017 OF A GIllEN SERIES, XIl •• :'LX), WITH AN ARBITRARY SERIES. 001B • YII ••• LX), WHERE THE Y SERIES CAN BE LAGGED ARBITRARILY. 0019 • SPEED OF ONE CROSS PRODUCT APPROACHES 2LX MACHINE CYCLES 0020 AS LX GETS LARGE WITH RESPECT TO MAXIMUM MAGNIT~DE OF X 0021 (CONSIDERED AS 35 BIT-PLUS SIGN INTEGERS). USER PROVIDES 0022 SPACE FOR OBJECT PROGRAM WHICH IS SOMEWHAT LONGER THAN 0023 X SERIES. ONCE THE PROGRAM IS GENERATED XII) IS NO 0024 LONGER NEEDED AND THE PROGRAM IS REUSABLE. HIGH SPEED 0025 IS ATTAINED BY GROUPING MULTIPLIERS SO AS TO SUBSTITUTE 0026 • SUMMATIVN FOR MULTIPLICATION AND BY CARRYING Out THE 0027 • SUMMATIIDN BY A STRAIGHT LINE PROGRAM. FOR EXAMP.LF If 002B • Xll ••• 81 = 1, 2,-1, 0,-2, 0, 1. 2 0029 • 0030 YIl ••• BI = 2.-1, 2. 0, I, 2,-2. 1 • THE CROSS PRODUCT 0031 . .. ... .... . . .• • •. . .. .- ..--. • • .• ... .-.• .- • • • • ..• . .-. . ..• i.~ t ~.,-ii - i-2 • v-v - 2-i T v-2 T i-\-L~ T WOULD BE COMPUTED BY THE OBJECT PROGRAM IN THE FORM 12 - 2 - 21*1 + 1- 1 - 1 + 11.2 FASCOR SUCCESSIVELY OPERATES THE PROGRAM GENERATED BY PROCOR TO PRODUCE A SPECIFIED TRANSIENT CORRELATION FUNCTION. XP{K). BETWEEN XIII AND YIII XPIK) LX SUM I XI I)-YI I+K) ) 1=1 FOR K= KMIN,KMIN+l, ••• ,O.l, ••• ,KMAX WHERE KMIN = NEGATIVE OR ZERO INPUT PARAMETER KMAX = POSITIVE OR ZERO INPUT PARAMETER YIL) IS, FOR PURPOSES OF THE ABOVE EQUATION, CONSIOERED = 0 WHENEVER L FA~LS OUTSIDE OF THE INCLUSIVE RANGE 1 TO LX (THIS IS THE TRANSIENT ASSUMPTION) • XIII IS RESTRICTED TO HAVE MAGNITUDES NOT EXCEEDING VALUE 1000 FASEPC IS IDENTICAL TO FASCOR EXCEPT THAT IT DOIS NOT MAKE THE TRANSIENT ASSUMPTION ABOUT YIIJ. FASCRI IS IDENTICAL TO FASCOR EXCEPT THAT XPIK) IS AODED INTO THE OUTPUT AREA RATHER THAN BEING STORED INTO IT~ ITHIS IS A SPACE-SAVING FEATURE OF VALUE, FOR INSTANCE, WHEN DOING AVERAGED CORRELATIONS ON SEGMENTED SERIES.' FASEPI IS IOENTICAL TO FASEPC EXCEPT THAT XPIK) IS ADDED INTO THE OUTPUT AREA RATHER THAN BEING STORED INTO ~T. PROCDR IS SEPARATED FROM THE OTHER ENTRY POINTS TO PERMIT EFFICIENT COMPUTATION OF SUCCESSIVE CORRELATIONS OF XII) WITH A SET OF OTHER SERIES, SAY YCI),Zll),AND W(IO. IN THIS CASE PROCOR IS CALLED JUST ONCE TO ESTABLISH THE OBJECT PROGRAM SPECIALIZED TO THE X SERIES. THiN ANOTHER ENTRY IS CALLED SUCCESSIVELY FOR EACH OF THE OTHER SERIES. IAFTER THE CALL OF PROCOR YII) CAN BE 0033 0034 0035 0036 0031 0038 0039 0040 0041 0042 0043 0044 0045 0046 0041 004B 0049 0050 0051 0052 0053 0054 0055 0056 0051 0058 0059 0060 0061 0062 0063 0064 0065 0066 0061 0068 0069 0010 0011 0012 0013 •••••••••••••••••••••••• • . PROCOR PROGRAM LI STINGS 2) --..• . .. • .. .. .. .. .. .. .. .. .. BY PROPER SEQUENCES OF CALLS THESE PROGRAMS CAN BE USED TO PRODUCE AUTOCORRELATIONS. CROSS CORRELATJONSr AND CONVOLUTIONS. FOR EITHER EQUAL LENGTH OR UNEQUAt LENGTH SERIES. AND FOR EITHER THE TRANSIENT OR FOR THE EQUALPRODUCTS ASSUMPTION. LANGUAGE EQUIPMENT STORAGE SPEED - FAP; SUBROUTINE CFORTRAN II COMPATIBLE) 709, OR 7090 CMAIN FRAME ONLY) 770 REGJSTFRS PROCOR TAKES ABOUT 64-LX + 78-MAXX MACHINE CYCLES WHERE MAXX = MAXIMUM MAGNITUDE OF XCI) FASCCR TAKES ABOUT 120-MAXX + IKMAX+ll-C2-LX - KMAX + 20"MAXXI + KMN-12-LX - KMN + 20 .. MAXX) MACHJ CY«LF.S WHERE KMN = MAGNITUDE OF KMIN FASEPC JAKES ABOUT lZ0-MAXX + (KMAX+KMN+l)-(Z-LX+9"MAXXJ MACH. CYCLES FASCR1 TAKES THE SAME TIME AS FASCOR FASEPI TAKES THE SAME TIME AS FASEPC - S.M. SIMPSON JR, -.-- 10/15/62 ----USAGE OF PROCOR-FASCOR-FASEPC-FASCRI-FASIP1---- - TRANSFER VECTOR CONTAINS ROUTINES AND FORTRAN SYSTEM ROUTINES - NONE NONE .- FORTRAN USAGE OF PROCOR ...• INPUTSCALLTO PROCORIX.LX,MAXX.PROGl,PROG2.ERR) ... XC PROCOR l-l.2 •••• ,LX IS A SERIES OF MACHINE LANGUAGE .. (BINARY POINT BEYOND BIT 351 • ALL HAVE MAGNITUDES LESS THAN OR = MAXX .. LX IS A FORTRAN INTEGER GREATER THAN OR = 1 it II .. .. . .... .. . INTEGERS MAXX IS A FORTRAN INTEGER = UPPER BOUND TO XII) SERtES. MUST LIE BETWEEN 1 AND 1000 INCLUSIVELY. FOR MAXIMUM SPEED MAXX SHOULD BE MADE AS SMALL AS POSSIBLE PROGI WILL BE THE FIRST INSTRUCTION OF THE OBJECT PRWGRAM PROGI TO PROG2 IS TO BE MADE AVAILABLE FOR THE PROGRAM WHOSE LENGTH DEPENDS ON BOTH LX AND MAll PROG2 DEFINES HIGH ADDRESS END OF SPACE BLOCK AVAILABLE FOR PROGRAM. PROG1 AND PROG2 MUST SATISFY XLOCF(PROG2) - XLOCF(PROGl) EQUALS OR EKCEEgS LX + 10*(MAllX+H -. .. OUTPUTS FROM PRDCOR •. .... ... .. THE PRINCIPLE OUTPUT IS THE PROGRAM STORED IN MACHINE ADDRESSES PROG1, PROG1+1 •••• ERR = 0.0 a = . a -- IF NO TROUBLE ARISES 1.0 IF OBJECT PROGRAM HAS INADEQUATE SPACE 2.0 IF ILLEGAL LX 3.0 IF SOME XIII EXCEEDS MAXX ~.O IF MAXX IS ILLEGAL .. FORTRAN USAGE OF FASCOR .. CALL FASCORIY,KMIN.KMAX,CORIER,ERRORI .. INPUTS TO FASCOR FASCDR ASSUMES PROCOR HAS ESTABLISHED ITS OBJECT PROGRAM ...• YII) - IPAGE MOVED INTO THE XIII AREA TO SAVE SPACE IF NECESSARY.) ...-. AUTHOR ... PROCDR •••••••••••••••••••••••• •••••••••••••••••••••••• (PAGE -......................... .. I:1 ••• LX IS A SERIES OF MACHINE LANGUAGE INTEGIRS TO BE 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 2) ............... . ........... PROCOR • PROGRAM LI STINGS ' IPAGE • .•• .. .. .. .. .. • .. • • .. • • • • •.. • • • •• • • • • • • •. PROCOR CORRELATEO WITH XCI). YtI) OOES NOT HAVE TO BE BOUNOED BY MAXX AS XII) IS, BUT FIXEO POINT OVERFLOW IS POSSIBLE. KMIN IS LARGEST NEGATIVE LAG DESIRED IN CORRELATION IS A FORTRAN INTEGER EXCEEDING -LX AND LSTHN= 0 KMAX IS LARGEST POSITIVE LAG DESIRED IN CORRELATION IS A FORTRAN INTEGER GRTHN=O ANO LSTHN LX OUTPUTS FROM FAStOR CORlERCII 1= -KMN+1,-KMN+2, ••• ,0,1, ••• ,KMAX+1 WILL CONTAtN THE CROSS PRODUCTS XPCKMIN, ••• ,KMAX) WHERE XP4K) IS DEFINED IN THE ABSTRACT ABOVE, AND KMN = MAGNITUOE OF KMIN. tTHIS STORAGE FORMAT PLACES XPIO) IN CORlERI1'j} THE CROSS-PRODUCTS ARE MACHINE LANGUAGE INTEGERS AS ARE X AND Y. OVERFLOW IS POSSIBLE IF Y DOES NOT HAVE REASONABLE BOUNDS. (PROGRAM EXITS IMMEeIATELY WHEN AN OVERFLOW IS DETECTED.' OVERFLOW IS lMPOSSIBLE IF LX.MAXX*MAXY IS LESS THAN 2EXP35 IAPPROX 3.10EXPIO) WHERE MAXY = MAXIMUM Y MAGNITUDE. ERROR • 0.0 1.0 2.0 3.0 NORMALLY IF OBJECT PROGRAM NOT YET WRITTEN FOR ILLEGAL KMIN OR KMAX INO COMPUTATIONS MADEl IF OVERFLOW OCCURS AT SOME LAG. (IF THIS HAPPENS PROCOR MUST BE OPERATED AGAIN BEFORE CALLING fASCOR AGAIN. (fASCOR FAILS TO DETECT ONE KIND Of OVERFLOW - SEE NOTES ON EXAMPLES I., 19., AND 20. BELOW) fORTRAN USAGE OF FASEPC CALL FASEPCIY,KMIN,KMAX,CORlER,ERRORI INPUTS TO FASEPC IDENTICAL TO THOSE OF FASCOR EXCEPT THAT THE MAGNITUDES OF KMIN AND KMAX ARE NOT RESTRAINED BY ANY UPPER BOUND. • OUTPUTS FROM FASEPC • • • IDENTICAL TO THOSE OF fASCOR EXCEPT THAT THE COMPUTATION OF XP(K) DOES NOT ASSUME THAT YILl WHEN L IS OUTSIDE THE INCLUSIVE RANGE 1 TO LX • • • ~ 0 • FORTRAN USAGE OF FASCRI • CALL FASCR1IY,KMIN,KMAX,CORlER,ERRORI • • • INPUTS TO FASCRI • • IDENTICAL TO THOSE Of FASCOR • OUTPUTS FROM fASCRl •. • • IDENTICAL TO THOSE OF FASCOR EXCEPT THAT XP IS ADDED TO CORlER. IE CORlERIIl = CORZERII) + XPII-ll • fORTRAN USAGE OF FASEPI • CALL FASEP1IY,KMIN,KMAX,CORZER,ERRORI • ...• INPUTS TO FASEPI •.. IDENTICAL TO THOSE OF FASEPC • .. OUTPUTS FROM FASEPI IDENTICAL TO THOSE OF FASEPC ..• . CORlER, IE CORZERII) = EXCEPT THAT XP IS ADDED TO eORLERII) + XPII-l) • EXAMPLES • • IPAGE 3) • • • • • • • • • • •••••••••••••• **** •• ** •• • ••••••••••••••••••••••• •••••••••••••••••••••••• THE NOTATION MLI, USED BELOW, STANDS FOR MACHINE LANGUAGE 0149 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0110 0171 0172 0173 0174 0115 0176 0117 0118 0179 0180 0182 0183 0184 0185 0186 01B7 0188 0189 0190 0191 01n 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0113 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 3) ••••••••••••••••••••••• * • PROGRAM lISTINGS PROCOR (PAGE PROCOR • •••••••••••••••••••••••• (PAGE 41 4) • • • • • • • • •* • • • * • * • • • • • • • • • • • • • • • • * • * * • • • • • * • • * • • • * * • * • • •••••••••••••••••••••••• - * •••••••••••••••••••••••• INTEGERS, I.E. FIXED POINT INTEGERS WITH BINARY POJNT TO RIGHT OF BIT 35. OTHERWISE FORTRAN II CONVENTIONS ARE USED WITH RESPECT TO NUMERICAL CONSTANT REPRESINTATION. TO INOEXING OF VARIABLES, ETC. THE OUTPUTS ERR ANO ERROR ARE =0.0 IN THE EXAMPLES BELOW UNLESS OTHERWISE STATED. THE INPUTS IN All EXAMPLES ARE THE SAME AS THOSE OF EXAMPLE 1. UNLESS OTHERWISE STATED. 1. ILLUSTRATION OF OBJECT PROGRAM FORMAT-ITHIS EXAMPLE ONLY FOR THOSE INTERESTED IN PROCOR LOGIC) MlI 1.0,-3.3.-3.-0.1.0,-3.-3,6.0 •••• INPUTS - SET XII ••• 20)= YII ••• 20)= MlI 1.1,1,1,1,0,0,0.0.0.011,0.0~0, •• ~ ZI1 ••• 20)= MlI 10,10,10,10.10,0,0.0,0.0,0.10.0.0, •• CORll ••• 50)= Mll 0.0.... II.E. CLEAR O~TPUT AREAl USAGE CALL PROCORIX.I0.3.SPACEII00).SPACEI1),ERR) CUTPUTS - THE FAP OBJECT PROGRAM BELOW SPACEI(00) PZE 3 N+l=ll PZE 2 PIE 1 PZE 0 SPACE(96) CLA 9.1 SUR 5.1 ADD 3,1 PZE 0 PIE 0 PZE PZE PZE SPACEI881 CLA 10,1 (SPACE(881 IS ENTRY PT. AOD 4,1 TO OBJECT RROGRAM) XCA MPY SPACE(98) XCA ADO SUM ISUM IS AN INTERNAL STO SUM ADDRESS IN PROCOR) SPACE(81) CLS 8.1 ADD 7,1 (NOTE-NO BLO¢K EXISTS SUB 6,1 FOR MAGNITUDES XII): SUB 2,1 2) SUB 1,1 XCA MPY SPACEIIOO) XCA ADD SUM STO SUM SPACE(71) TRA 1,4 SPACE(70) THRU SPACE(66) = SINCE NO X = 2 DR -2 SPACE(65) THRU SPACE(49) IS TABLE SPACE FOR FASCOR. SPACEI481 THRU SPACEll) IS EXTRA SPACE NOT USED. (NOTE THAT IF THE RESULT OF AN MPY INSTRUCTION EXCEEDS 35 BITS THIS SHOULD BE CONSIDERED AN OVERFLOW IUT IT WILL NOT BE CAUGHT.) °°° ° * 2. COMPLETE TRANSIENT CROSS-CORRELATION OF XIl ••• 5) WITH YII.J.51 CALL PROCORIX,5,3.SPACE(100),SPACEI1),ERRI USAGE CALL FASCORIY,-4,4,CORI5J,ERROR) * • OUTPUTS - CORI1 ••• 19J = MLI -3,0.-3,-3,-2.1,-2,l,l,O.0 •• J. • * • 3. COMPLETE TRANSIENT AUTO-CORRELATION OF Xtl ••• 5) • USAGE CALL PROCORIX.5.3,SPACECI00),SPACEIl),ERR) • CALL FASCORIX,0,4,COR(1),ERROR) * OUTPUTS - CORCI ••• 19) = MLI 28,-IB,6,3,-3,0,0, ••• * • 4. PARTIAL TRANSIENT AUTO-CORRELATION OF Xl1 ••• 5) • USAGE CALL PROCORIX,5,3,SPACEII00),SPACE(lJ,ERR) • CALL FASCOR(X,O,2.CORC1),ERROR) • OUTPUTS - CORIl ••• 191 : MLI 28,-18,6.0,0 •••• • * 5. PARTIAL TRANSIENT CROSS-CORRELATION WITH REUSE OF XCI ••• i). AFTER • • • • * PROCOR, TO STORE CORRELATION CALL PROCORIX,5.3,SPACE(100).SPACEIl).ERRl CALL FASCORCY,-2,2,XI3),ERRORl OUTPUTS - XC1 ••• 15) = MLI -3,-3,-2.1,-2,-0,1.0,-3,-3.0.0 •• ~. USAGE 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0273 0274 0275 0276 0271 0278 0279 0280 0281 0282 0283 0284 0285 0286 0281 0288 0289 0290 0291 0292 0293 0294 0295 0296 0297 0298 •••••••••••••••••* •••••• • PROCOR • •••••••••••••••••••••••• (PAGE 51 -. -• --. ---.----. -----.. .. --. . -.--- PROGRAM LI STINGS •••••••••••••••••••••••• PROCOR • •••••••••••••••••••••••• • IPAGE 6. REPEATED PARTIAL TRANSIENT CROSS-CORRELATION OF Xll.~.51 WITH YIl ••• 5) AND WITH lll •• ~51 USAGE tALL PROCORIX,5,3,SPACEII00I,SPACE(1),ERRI CALL FASCORIY,-2,2.CORI5I,ERRORI CALL FASCORll,-2,2,CORI15},ERROR) OUTPUTS - CORII ••• 201 = MLI 0,0,-3,-3,-2,1,-2.0,0,0,0,0,-30.-30. -20,10,-20,0,0,0 7. REPEATEO PARTIAL TRANSIENT CROSS-CORRELATION OF Xll ••• 51 WITH YI1 ••• til AND WITH lll ••• 51 WITH SUMMATION OF OWTPUT CORRELATIONS. USAGE CALL PROCORIX,5,3.SPACEII00),SPACEI1),ERR) tALL FASCORIY,-2,2,COR(3),ERRORI CALL FASCRIIZ,-2,2,CORI3I,ERRORI OUTPUTS - CORII ••• 20) = MLI -33,-33,-22,11,-22,O.0,.~. STAYS 8. EQUI-PRODUCTS CORRELATION OF XIl ••• 5) WITH YII) SUCH THAT IN THE RANGE 1 ••• 20 USAGE CALL PROCORIX,5,3,SPACEIIOO),SPACEIII,ERRI CALL FASEPCIYI161,-15,0,COR(16),ERROR) OUTPUTS - CORll ••• 161 = MLI -2,1,-2,1,1,0,0,-3,3,-3,0,1,0.010,0 9. EQUI-PRODUCTS CORRELATION OF Xll ••• 51 WITH YIII AND WITH ZII). I IN THE RANGE 1.~.20, WITH SUMMATION OF O~TPUT CORRELATIONS. USAGE CALL PROCORIX,5,3,SPACEII00),SPACEI1),ERRI CALL FASEPCIYI161,-15,0,COR(16),ERRORI CALL FASEPIIZI161~-15~0,COKI161,ERROR) OUTPUTS - CORll ••• 161 = MLI -22,11,-ZZ.11,11,O,O.-33_33,-33'0'11,O, 0,0,0 - 10. COMPLETE TRANSIENT CROSS-CORRELATIONS Of UNEQUAL LENGTH SERIES. ...... _ ........ ,... ... " .... ........ "6.ln ...... .,,)L".I.U1'1 ........................... ...... Atl ••• " TERMINAL ZEROES AND USING fASEPC INPUTS - Xll ••• SI AND Yll ••• 121 AS IN EXAMPLE 1. INSERT 4 ZEROES AT EACH END OF YII) BY LETTING WIl ••• 41=0 WC5 ••• 16I k YII ••• 12) WI17 ••• 201=0 USAGE CALL PROCORIX.5,3.SPACEII00},SPACE(1),ERR) CALL fASEPCCW(16),-15,O,CORI16I,ERROR) OUTPUTS - CORll ••• 16) = MLI -3,O,-3.-3.-2,l.-2,l.I,O~O,-3,3;-3'0.1 .•"II. . -.. --• . .-. -.• . -... •-... 1'.~,.. ~, ~~~! 0332 0333 0334 0335 0336 0337 0338 033Q COMPLETE TRANSIENT CROSS-CORRELATIONS OF UNEQUAL LENGTH SERIES, XII ••• S) WITH Yll ••• IZ) USING FASCOR FOR END E~FECTS AND FASEPC fOR CENTRAL VALUES USAGE CALL PROCORIX,5.3.SPACEIIOOI,SPACE(I}.ERRI CALL FASCORly,-4,O,COR(5),ERRORI CALL FASEPCIYI7I,-5,0,CORIll),ERRORI CALL FASCORIYI81.0,4,COR(12),ERRORI OUTPUTS - CORIl ••• 161 = MLI -3,O,-3,-3,-Z,I,-Z,I,I.0~O,-3,3;-3.0,1 NOTE- THE GENERAL FORMAT IN THIS CASE FOR XIl ••• LX) YII ••• LYI WITH LX LSTHN LY IS Nl=-LX+l N2= LY-LX N3=-ILY-LX-21 N4= LY-l N5= LY-LX+l N6= LX-I CALL PROCORCX,LX,MAXX.PROGl,PROG2,ERR} CALL FASCORIY,Nl,O.CORllX},ERROR) (OMIT IF N3=11 CALL fASEPCIYINZ),N3,0,CORIN41,ERRORl CALL FASCORtY(N5},O,N6,CORILY),ERRORI WHICH LEAVES CORRELATION IN CORfl.2 ••••• LX+LV-l) -12. COMPLETE CONVOLUTION OF TWO UNEQUAL LENGTH SERIES XIl ••• 51 WITH YIl ••• 12) INPUTS - SAME AS EXAMPLE I. EXCEPT REVERSE XII) I.E. XI1.J.5'*-3, 3.-3,0,1 USAGE - SAME AS EXAMPLE II. OUTPUTS - CORll ••• 161 = MLI l,I,-2,1.-2,-3,-3,O,-3.0;0,1~0.-3.3,-3 ..-13. . 0299 0300 0301 0302 0303 0304 0305 0306 0307 0308 0309 0310 0311 0312 0313 0314 0315 0316 0317 0318 0319 0320 0321 0322 0323 0324 0325 0326 0327 0328 0329 0330 EXAMPLES 13. THROUGH 20. ILLUSTRATE ERROR CONDITIONSJ USAGE CALL PROCORIX,5,3,SPACE(45),SPACE(1).ERRl OUTPUTS ERR=l.O (SPACE 8LOCK TOO SMALL) "14. USAGE CALL PROCORIX,O,3.SPACEll00),SPACEll),ERR) 0340 0341 0342 0343 0344 0345 0346 0347 0348 0349 0350 0351 0352 0353 0354 035, 0356 0357 0358 0359 0360 0361 0362 0363 0364 0365 0366 0367 0368 0369 0370 0371 0372 0373 5) •••••••••••••••••••••••• - - PROCOR PROGRAM 1I STINGS ••••••••••••••••••••• * •• IPAGE 6) - • •••••••••••••••••••••••• • PROCOR • •••••••••••••••••••••••• IPAGE OR CALL PROCORIX,15000,3,SPACEI200001,SPACEIII.ERRJ OUTPUTS - ERR"2.0 IILLEGAL LX) -15. USAGE CALL PROCORIX,5,2,SPACEII001,SPACE(lJ,ERRI • OUTPUTS - ERR,,3.0 IXIII FOUND GREATER THAN MAXXI . -16. USAGE CALL PROCOR(X,5,0,SPACEII00),SPACE(1),ERRJ • OR CALL PROCORIX,5,1100.SPACE(5000).SPACE(11.ERRI OUTPUTS - ERR=4.0 IILLEGAL MAXX) - - 17. USAGE • - -• CALL PROCORIX.0.3,SPACEIlOO).SPACEI11.ERR) CALL FASCORIY.-4,4.COR(5),ERRORI OUTPUTS - ERR"2.0 (SAME AS EXAMPLE 14.) ERROR" 1.0 INO OBJECT PROGRAM) -18. USAGE • •.. • * CALL CALL OR CALL OR CALL OR CALL OUTPUTS - ERR=O.O ERROR-2~0 * * PROCORIX,5,3.SPACEII00).SPACECIJ,ERR) FASCORIY,-5,4,CORII0),ERRORI FASCORIY, 2,4,CORII01,ERROR) FASCORIY,-4,6,CORII0),ERROR) FASCORIY,-4,-I,CORII0},ERROR) CILLEGAL KMIN OR KMAX) *19. INPUTS - XIl ••• 5) = MLI 20,40.60,80,100 • YIl ••• 51 " MLI 200000000,200000000 •••• -OCT 001372741000 * USAGE CALL PROCORIX,5,100,SPACEII016),SPACEI11.ERRI • CALL FASCORIY,O,O,COR.ERROR) OR CALL FASEPCIY,O,O,COR,ERRORI • OR CALL FASCRIIY,O,O,COR.ERRORI • OR CALL FASEPIIY,O.O,COR.ERRORI • OUTPUTS - ERR"O.O ERROR-3.0 {OVERFLOW CAUGHT. CORII)-6'10EXPIOI • • .20. INPUTS SAME AS EXAMPLE 19. EXCEPT XII ••• 5) " 60,60.60.60,60 • USAGE - SAME AS EXAMPLE 19. • OUTPUTS - ERR=O.O ERROR=O.O {OVERFLOW NOT CAUGHT} • .21. • • • • • • • SPECIAL CASE TEST - ALL XIII ARE ZERO IPROGRAM HAS 8YPASS FOR THIS) INPUTS - Xli ••• 5) = MLI 0,0, ••• Yll ••• 10) - MLI 5,4,3,2,1,0.-1,-2,-3,-4 CORll.~.} " MLI 1,2,3,4,5,6,7,8, ••• USAGE CALL PROCORIX,5,10,SPACEI2001.SPACE,ERR) CALL FASCORIY,O,4,COR,ERROR) OR CALL FASEPCIY(5),-4,0.CORI5),ERRORI OUTPUTS - CORl1.J.) - MLI 0,0,0,0,0,6,7,8, ••• *22. INPUTS - SAME AS EXAMPLE 21. • USAGE CALL PROCORIX,5,10,SPACE(200), SPACE.ERR) .. CALL FASCRIIY,0,4,COR,ERROR) • OR CALL FASEPIIYI51.-4,O,COR(5I,ERRORI • OUTPUTS - CORI1 ••• ) = MLI 1,2,3,4,5,6.7,8, ••• ..23. " .. .. .• SPECIAL CASE TEST X SERIES HAS LENGTH" 1 • INPUTS - SAME AS EXAMPLE 21. EXCEPT XI!) " MLI 2 USAGE CALL PROCORIX.l,10,SPACEI200I,SPACE,ERRI CALL FASCORIY,O,O,COR,ERROR) OUTPUTS - CORll.~.1 " MLI 10,2,3,4,5.6,7,8, ••• "24. INPUTS - SAME AS EXAMPLE 23 • .. USAGE CALL PROCORIX,1,10,SPACE(200),SPACE,ERRl • CAll FAS"EPCIY(5),-4,2.CORI51,ERROR) • OUTPUTS - CORll ••• ) " MLI 10,8,6,4,2,0,-2,8,9, ••• •. • PROGRAM FOLLOWS BELOW .. NOTATION OIFFERENCES BELOW ARE N '" LX • POSMAX " KMAX NEGMAX '" KMIN T '" K = LAG NUMBER S-MAXX • • •. * HTR HTR HTR BCI °0 0 I,PROCOR 0174 0375 0376 0377 0378 0379 03BO 0381 0382 0383 0384 0385 0386 0387 0388 0389 0390 0391 0392 0393 0394 0395 0396 0397 0'198 0399 0400 0401 0402 0403 0404 0405 0406 0407 0408 0409 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 0440 0441 0442 0443 0444 0445 0446 0447 0448 61 ••••••••••••• * •••••• ** •• .•••••••••••••••••••• *.*** PROGRAM LI ST INGS PROCOR (PAGE ••••••••••• * •••• * ••••••• .. PROCOR • • ••••••••••••••• ** •••••• n (PAGE PROCOR SXO PROCOR-4,1 SXO PROCOR-3,2 SXD PROCOR-2,4 "GET X ADDRESS AND S.ET X+l ADDRESSES ClA 1,4 STA Tl ADD Kl STA X20 STA X41 SIfA X44 STA X48 .. GET N VALUE AND SET DECREMENTS, ETC (AFTER CHECKING NI K5 ClA K5=2.0 STO T27 ;N 2,4 ClA" STO T2 TMI X65 HE X65 CAS KS K8= 0,0,10000 X65 TRA NOP S10 X24 S10 X53 ARS 18 S1A T7 S14 Tll .. GET S VALUE AND SET DECREMENTS ( AFTER CHECKING SI ClA K29 K29= 4.0 STO T27 ClA. 3,4 =S STO T3 TMI X65 , LL AU ... CAS TRA NOP K30 X65 S,ro K30= 0,0,1000 X36 X63 STO .MAKE 08JECT PROGRAM S IlE CHECK ClA K4 K4= 1.0 T27 STO 4,4 CLA STA T4 5,4 CAL FORM ANA K20 T4 SUB PROG2-PROGl STA H7 ClA GET S (IN DECR) 13 ADO K7 S+1 XCA MPY K31= 10 K31 XCA 10C S+11 ADO T2 N+I0( S+1I ARS 18 MOVE TO ADDRESS CAS Tl7 COMPARE WITH PROG2-PROGI TRA X65 TRA .+1 OK .. CLEAR PROGI THRU PROGl+N+10(S+1) .. (lOOP TAKES 3(N*10($+1)+lJ HI SPEED INSTRUCTIONS) ADO Kl N+I0IS+l)+1 ADO T4 PROGI + DITTO STA X2 SU8 T4 N+I0(S+1)+1 IN DECR AlS 18 S10 X3 K7", 0,0,1 lXD K7,1 STZ •• ,1 X2 * .. =PROGl+N+10IS+1)+1 TXI "+t,l,1 X3 TXl X2,1,*. **=N+IO(S+11+1 .SET AOORESSES=PROGl+S AND PROGl+S+1 13 ClA ARS 18 ADD T4 STA X62 STA T9 DEF INES TABLE 0449 0450 0451 0452 0453 0454 0455 0456 0457 0458 0459 0460 0461 0462 0463 0464 0465 0466 0467 0468 0469 0470 0471 0472 0473 0474 0475 0476 0477 0478 0479 0460 0482 0483 0484 0485 0486 0487 0488 0489 0490 0491 0492 0493 0494 0495 0496 0497 0498 0499 0500 0501 0502 0503 0504 0505 0'506 0507 0508 0509 0510 0511 0512 0513 0514 0515 0516 0517 0518 0519 0520 0521 0522 0523 7) • ••• _•••••••••••••••••• * PROCOR •••••••••••• _••• ** ••••••* - (PAGE PROGRAM LISTINGS •••••••••••••• *** ••••••• • PROCOR * •••••••••••••••• * •••• ** • 8) ADO Kl STA T12 .SET AOORESSES:TABLE,TABLE+l,TABLE-S CLA T9 TABLE STA X25A STA X25 STA X21 STA X22 STA X24A STA X26 STA X29 STA X30 STA X31 STA X42 STA X43 STA X47 ADO Kl TABLE+l STA X28 STA X32 CLS T3 ARS 18 ADO r9 TABlE-S STA X37 - FORM ADDRESSES OF TABLI.TABL2,TABL3,TABL4 CLA T3 SET S+l ADO K7 ARS 18 STA T18 ALS 2 4(S+1I ADO TI8 5(S+1I ADO T18 6(S+11 ADO T12 PROGl+S+1+6{S+11 ADO TIl PROGl+S+I+N+6(S+11=TA8Ll STA T13 ADO T18 TABL2 STA T14 AOD T18 TABL3 STA TI5 ADO T18 TABL4 STA f16 CLA T13 SET TABll ACORESSES STA X22A STA X2BA STA XZ6A STA X33B SUB KI STA X37A .SCAN X VALUES TO MAKE FREQUENCY COUNT OF MAGNITUDES IN .DECREMENTS OF TABLE AND TABLI, CHECKING FOR EXCESSIVE X MAGNITUDES -(THIS LOOP TAKES ION HI SPEED INSTRUCTIONS) X19 AXT 1,2 CLA K6 K6= 3.0 STO TZ7 XZO eLA •• ,z (.-=X+ll GET MAGNITUDE OF NEXT X VALUE SSP ANO INCREMENT CAS T18 T18= S+1 NOP TRA X65 PAX 0,4 THE X21 CLA **,4 (*.:fABLEI PROPER ADO K7 (K7=PIEO,O,11 COUNTER X22 STO **.4 (.*=TABLEI BY ONE XZ2A STO **,4 (*.=TABLl1 X23 TXI .+l,Z,l X24 TXL X20,Z,.. (**=NI STZ T27 ALL OK -CHECK IF ALL XII) : 0 IF SO SET FASCOR BYPASS SWITCH AND EXIT CLA KI STO T29 X24A CLA *. .*=TABLE NIOI CAS TZ TZ= N HPR IMPOSSIBLE TRA X65 BYPASS srz TZ9 OK -NOW SET UP ADDRESS TABLE FOR BLOCKS IN OBJECT PROG. AND INSERT 5-GROUPS (PAGE 0524 0525 0526 0527 052B 0529 0530 0531 0532 0533 0534 0535 0536 0537 0538 0539 0540 0541 0542 0543 0544 0545 0546 0547 054B 0549 0550 0551 0552 0553 0554 0555 0556 0557 0558 0559 0560 0561 056Z 0563 0564 0565 0566 0567 056B 0569 0570 0571 057Z 0573 0574 0575 0576 0577 0578 0579 0580 0581 0582 0583 0584 0585 05B6 05B7 0588 0589 0590 0591 0592 0593 0594 0595 0596 0597 0598 81 •••••••••••••••••••••••• ....,...................... • PROCOR IPAGE • 9) PROGRAM LISTINGS ........................... .. PROCOR .SEE FORMAT OF THIS TABLE IN NOTES BELOW IF NIO) NON ZERO • INOTE XCACO) = LOCIO) + NIO) • LOCIOl - 5 IF NIO) - 0 LOC WI = PROGI + S + 1 ) ... I,,":TABLE) X25 CLA GET NIO) ARS 18 TZE X26B X25B ADD T12 NIO)+PROGl+S+l X25A ADD ( •• =TABLE) SSM MZE XCAIO).O,NIO) STO .... X26 I."=TABLE) CLA T12 SET LOCIO) X26A STA ... ( .... =TABLl) IN TABU TRA X26C X26B CLS K9 -5 IF NIO)=O TRA X253 X26C AXT 1,4 SET 1=1 .NOW FORM XCAIII AND tOCIl) RECURSIVELY BY • LOCel) = XCAII-ll + 5 IF Nil) NOT =0 • XCAII) " XCAII-il + 5 + NIl) .. = XCA ( 1-1) IFNIIl=O "(LOOP TAKES ABOUT 255 HI SPEED INSTRUCTIONS) SET LOCfl) .. ••• 4 X28 CLS ."=TABLE+l PZE XCAlI-l).O,NlI-l) ADD K9 K9=5 PZE LOC ( I ) ,0. N ( 1- 1) X28A STA .... ,4 ."=TABLI SET LOCII)=XCA(I-l)+'i "NOW CHECK NI II •• ,4 X29 CLA PZE """TABLE X30A TNZ -SET XCAIII FOR NUl = 0 .... 4 .... =TABLE+l X32 CAL MZE XCAII-l),O,NlI-l) KMSK2 ANA MZE XCA( 1-11,0,0 •• ,4 X30 SLW "'Lt: TRA X35 .SET XCAIII FOR NU) NOT " 0 X30A ARS 18 PLE N(I)'O,O X33B ADD PZE LOCIIl+NCIl,O,NIIl "·"TABLI MZE XCAII),O,NII) SSM •• -TABLE X31 STO "".4 .SET STORAGE ADDRESS IN XR2 FOR XCA,MPY,XCA,ADD,STO GROUP PAC 0,2 -XCAIIl IN XR2 .. SET ADDRESS OF THE MPY INSTRUCTION IN THIS GROUP SXA T5,4 CLA X62 SUB T5 STA K14 PROGl+S-1 IN ADDR. OF K14 -NOW MOVE THE GROUP INTO POSITION IN OBJECT PROGRAM .INOTE THAT NO GROUP IS INSERTED FOR 1=0 BLOCK) CLA Kll Kl1=XCA STO 0,2 STO 2,2 CLA K14 K14=MPY PROGl+S-I STO 1,2 CLA K12 K12:ADD SUM STO 3,2 CLA K13 K13= STO SUM S,TO 4,2 .. CHECK COMPLETION X35 TXI "+1,4,1 INCREASE I BY TXL X28,4,iI .. X36 ·"-S .WHEN DONE FILL IN TRA 1,4 INSTRUCTION AND SET ENTRY ADDRESS •• ,4 X37 LAC I ".=TABLE-S) CLA K15 K15=TRA 1,4 STO 5.4 X37A CLA ... .. .. =TABLl-1 STA T6 ENTRY = LOCll) .MAIN LOOP, SCANS XII) AGAIN AND FILLS IN REMAINOER OF OBJECT PROGRAM .ITHIS LOOP TAKES 19N HI SPEED INSTRUCTIONS) "SET X INDEX I =1 X40 AXT 1,1 .GET NEXT XCI) VALUE X41 CLA .... ,1 ( .... =X+l) .SET MAGNIX) IN XR4 AND GET TABLE ENTRY (MAGNIX» PAX 0,4 CLA ... ,4 .... -TABLE X42 ..• ... • •••••••••••••••••••••••• IPAGE 9) 0599 0600 0601 0602 0603 0604 0605 0606 0601 060B 0609 0610 0611 0612 0613 0614 0615 0616 0617 0618 0619 0620 0621 0622 0623 0624 0625 0626 0627 0628 0629 0630 va:; i 0632 0633 0634 0635 0636 0631 0638 0639 0640 0641 0642 0643 0644 0645 0646 0641 0648 0649 0650 0651 0652 0653 0654 065'5 0656 0657 0658 0659 0660 0661 0662 0663 0664 0665 0666 0667 066B 0669 0610 0611 0612 0673 •••••••• 4.* ••••••••••••• ... PROCOR • , ..................•. • PROGRAM LISTINGS •••••••••••••••••••••••• • PROCOR • ••••••••••••• f •••••••••• (PAGE 101 .SET FOR STORAGE OF NEXT INSTRUCTION OF OBJECT PROGRAM STA X51 POX 0,2 .IF TABLE ENTRY NEG, THIS IS FIRST X OF THIS MAGNITUDE TMI X46 .IF POSITIVE WE WANT ADO OR SUB INSTRUCTION • FIRST REDUCE DECR OF TABLE, THEN CHECK SIGN OF XII) SUB K1 K1=PZEO,O.1 X43 STO .*.4 (.*=TABLE) X44 CLA •• ,1 (**=X+11 TMI X45 .ADD INSTRUCTION NEEDED CLA K17 TRA X50 .SUB INSTRUCTION NEEDED X45 CLA K19 TRA X50 *FOR FIRST X OF THIS MAGN WE WANT CLA OR ClS INSTRUCTION .FIRST CHANGE SWITCH. REDUCE DECR OF TABLE, THEN CHECK SIGN Of XCII X46 SSP SUB K7 K7=PZEO, 0, 1 (.*=TABl E J X47 STO **.4 ( •• =X+l) X48 ClA .*,1 TMI X49 *CLA INSTRUCTION NEE OED ClA K16 TRA X50 .CLS INSTRUCTION NEEDED X49 CLA KIB TRA X50 .SUPPLY ADDRESS TO INSTRUCTION AND STORE IT .NOTE CLA,AOD,CLS.SUB. ARE ALL POSITIVE NUMBERS X50 ADD T7 T7=N+I-I X51 STO •• ,2 .*=XCAIMAGNIXIII)1 .INCREMENT I~N+I-I, AND CHECK FOR FINISH X52 CLA T7 SUB Kl STO T7 TXI *+1,1,1 X53 TXl X41,l,.* (.*=NJ *ENO OF MAIN lOOP *NOW FILL IN INTEGER TABLE IN PROGI TO PROGl+S .(lOOP TAKES 4(S+11 HI SPEEO INSTRUCTIONS) X60 AXT 0,4 X61 PXA 0,4 X62 STO •• ;4 (*.=PROG1+SJ TXI *+1,4,1 X63 TXL X61,4,.. ( ••·51 .RESTORE INDEX REGISTERS, SET ERR, AND EXIT X65 LXD PROCOR-4,l LXD PROCOR-3,2 LXD PROCOR-2,4 CLA T27 STD* 6,4 TRA 7,4 * *CONSTANTS FOR PROCOR' FASCOR KI PZE 1 K2 PZE 10000 K3 PZE 500 K4 DEC 1.0 K5 DEC 2.0 K6 DEC 3.0 0,0,1 K7 PZE K8 PZE 0,0,10000 K9 PZE 5 KIO PIE 0,0,2 Kll XCA K12 ADO SUM K13 STO SUM K14 MPY •• (.*=PROG1+S-II K15 TRA K16 CLA K17 ADD KI8 CLS (PAGE 10) 0674 0675 0676 0617 0678 0679 0680 06B1 0682 0683 0684 0685 0686 0687 068B 0689 0690 0691 0692 0693 0694 0695 0696 0697 0698 0699 0700 0701 0102 0703 0704 0705 0106 0707 0108 0709 0110 0711 0712 0713 0114 0115 0116 0117 0118 0719 0720 0721 0122 0723 0724 0125 0126 0727 0128 0129 0730 0731 0732 0133 0734 0735 0736 0737 0738 0739 0740 0741 0742 0743 0144 0745 0746 0747 0748 •••••••••••••••••••••••• • •••••••••••••••••• ** ••• PROGRAM LISTINGS PROCOR • " •••• •••••••• ** •• * ••• *.* .. PROCOR IPAGE 11) I PAGE K19 SUB K20 OCT K21 TRA K22 TRA K23 OCT K24 OCT 1(25 ADD K26 SUB K21 CLA K2B CLS 1(29 DEC K30 PZE K31 PIE KMSK OCT KMSK2 OCT "TEMPORARIES 11 PZE T2 PZE 13 PZE T4 PZE T5 PZE T6 MZE 11 PZE TB PZE T9 PZE flO PZE 111 PZE 112 PZE 113 PZE 114 PZE Tl5 PZE Tl6 PIE 111 P'Lt: 118 Tl9 T20 T21 T22 T23 T24 T25 T26 T21 T28 T29 PZE PZE PZE PZE PZE PIE PZE PZE PZE PZE PZE PZE no PZE SUM PZE NXTXI PZE "PNEWBT NEWINS LOCNWB NNEWB LOCOLX LAG PZE NOP PZE PZE PZE PZE 0,1 11111 o "" +050100000000 +040100000000 0,1 0,1 0,1 0,1 4.0 0,0,1000 10 17111 400000011117 PZE * PZE " ETC " +S+l CLA OR .. ADD OR • ETC " ADD OR • PZE 0 " PIE 0 " PZE " PZE 0 PZE 0 • "LOCl1ICLA OR " ADD OR " ETC " ADO OR 1**=LOCIBI+NIBII SEPARATES CLA FROM CLS SEPARATES ADD FROM SUB :040000100000 :040200100000 =050000100000 =050200100000 .. " 0,0,." 0,0,.* ." ".. ".=PROG1 ."=1 DURING TABLE FORMING LOOP .... =XCAlI-l1 OURING DITTO **=N+I-I FOR MAIN LOOP IINITIAL=N} *"=ENTRY TO OBJECT PROGRAM FOR FASCOR .*= TABLE = PROGI + S SPARE "*=N FOR FASCOR •• =PROG1+S+1 ""=TABL1 ."=TABL2 ,,* ,,* .....".""" "" "" ." ." ." "" ...""." LOce l } ".=TABL~ **=TABL4 0,0, •• 0,0,." "".. ".... .... ". *. ." "" "" "" *" "" ". 0749 0750 0151 0152 0153 0154 0755 0756 0757 0758 0159 0760 0161 0762 0163 0164 0765 0766 0761 0168 0769 0770 0111 0772 0113 0774 0115 0716 0171 0118 0119 0780 .·;;;; .... ~u"'c::-t"t(Ubl UIOl **=S+l "":POSMAX *,,=MAGN OF NEGMAX ""=CORZER 0782 0183 0184 0785 0786 0787 0188 0789 0190 0791 0792 0193 0194 0195 0796 0791 0798 0199 0800 0801 0802 0803 0804 0805 0806 0807 0808 0809 0810 0811 0812 0813 0814 0815 0816 0817 0818 0819 0820 0821 0822 0823 ,,*=Y-N .":LOCII) DURING RESTORATION AFTER NEG LAGS "":NII) DURING RESTORATION AFTER NEG LAGS ."=MAGN OF NEGMAX .... = PROCOR ERR SETTING .. ,,= N+IOI S+1I+l **: 0 10K), = 1 IBYPASS) .. *= FASCOR ERROR SETTING * .. =CROSS PRODUCTS SUM ".=N+1-I WHERE I-INDEX OF NEXT X TO DELETE IINIT =1 IPOS LAGS), : N INEG LAGS') ""-INSTR INDEX IN BLOCK NEWB FOR LA' T HOLDS INSTRUCTION TO BE SET ASIDE "":ADDRESS OF NEW BLOCK - LOCINEWB) ,,*N VALUE OF NEW BLOCK = NINEWB) .. ,,- -ITABL2-LASTBI IINIT = -ITABL2-S/21 •• :LAG T ." .""FORMAT OF FINAL ""PROGI " • •••••••••••••• ** ••• * ••• ~ OBJECT PROGRAM IS S S-l CLS SUB N*l- •• ,l N+1-.",1 SUB N+1-**.1 ZEROTH BLOCK INOT ACTUALLY OPERATED. BUT NEEDED FOR SUBST ITUT ION LOGIC OF FASCOR) CLS SUB N*l-"",l N+1-**,1 fIRST BLOCK IENTER HERE) SUB N+1-.",1 THE •• ARE FORTRAN CONV~NTION INDICES OF THE XII) SERIES. THE FIRST BLOCK CONTAINS ALL INDICES FOR WHICH THE MAGNITUDE OF XII).l THE SECOND BLOCK ALL INDICES FOR WHICH THE MAGNITUDE Of XIIlk2 ETC. THE SI5N OF XI I) DETERM INES WHETHER ADD ICLA) OR 11) ••••••••••••••••••••••••• • PROCOR PROGRAM LISTINGS • •••••••••••••••••••••••• ........................ • •••••••••••••••••••••••• PROCOR (PAGE 121 SUB ICLS' IS USEO. • XCA PROGl+S-l BLOCKS WILL Ie MISSING • MPY IF THERE ARE NO XII) XCA • OF CORRESPONBING SUM • ADD MAGNITUDE SUM • STO NOTE THAT THE • ETC TOTAL NUMBER OF • ETC LAST AOD, CLA, SUI, CLS -LOCIS)CLA OR CLS N+l-**,1 111+1-•• ,1 BLOCK INSTRNS OPERA TEO WILL • ADD OR SUB BE LESS THAN N BY • ETC AN AMOUNT EQUAL TO • ADD OR SUB THE NUMBER OF ZEROES " XCA PROG1 IN THE X SEUES. • MPY • XCA • ADD SUM FASCOR SETS XRl z -(Y-N). • STO SUM Y IS SECOND SERIES. • TRA 1,~ EXIT BEFORE ENTRY, AND • INCREMENTS XRl FOR LAGS • HOWEVER EACH TIME FASCOR INCREMENTS FOR LAGS IT MUST DELETE AN • INSTRUCTION IN THE DBJFCT PROGRAM (BY INSERTING A TRA) TO • PRODUCE THE TRANSIENT EFFECT. WHEN IT FINISHES IT MUST RESTORE • THE OBJECT PROGRAM FOR REUSE ON ANOTHER CALL OF FASCOR. •.PROCOR • • TABLE-I = MZE XCAII),O,NII) I=O,l, ••• ,S " AND TABl1-1 PZE LDCII),O,NII) I=O,l, ••• ,S • WHERE NIII = NO. OF X VALUES HAVING MAGNITUDE I • XCA(I) = AODRESS OF FIRST XCA INSTRUCTION IN 8LOCK NO. I • LOCtI) s ADDRESS OF FIRST INSTRUCTION IN BLOCK NO~ I • RELATIONS 8ETWEEN LOCtI), XCAII), ANO NIl) NEFDED BY PROCOR lOGIC ARE • LOCtO) s PROGl+S+1 " XCACO) LOCIO)+NIO) IF NIOI NOT = 0 • • LOCIOI - 5 IF NIO) = 0 • RECURSION FORMULA FOR LOCII) 1=1,2, ••• ,S " LOCIII LOCII-1)+NII-11+5 IF NIl-II NOT • 0 • = LOCII-il IF NIl-II = 0 RECURSION FORMULA FOR XCAIII 1=1,2, ••• ,S " • XCACII = XCAll-ll+N(II+5 IF NIl) NOT = 0 • = XCAll-ll IF NIl) 0 • IT CAN BE SHOWN BY INDUCTION THAT THE ABOVE LEADS TO • LOCIII XCAll-11+5 IN ALL CASES • SO THAT • XCACII = LOCIII+NII) IF NI[) NOT = 0 • = LOCII)-5 IF NIII =0 = = = = • • • • FASCOR USES TA8Ll WITHOUT MODIFYING IT IN ANY WAY. FASCOR ALSO SETS UP THREE OTHER TABLES- TABL2, TABL3 ANO'TABL4. THESE TABLES, ARE DESIGNED TO SPEED UP THE SU8STITUTION LOGIC INVOLVED IN THE SUCCESSIVE REPLACEMENT OF IIIISTRUCTIONS BY TRANSFERS. • • • • • • • • DEFINITIONS INVOLVED IN TABLE DESCRIPTIONS B = AN ARBITRARY BLOCK NO. [N OBJECT PROGRAM AOIY) ADDRESS PORTION OF INSTRUCTION AT LOCATION Y PI8,Y) INOEX OF THE INSTRUCTION AT LOCATION Y RELATIVE TO BLOCK 8 WHERE PIB.LOC(8)1 1 PiB,LOC(8)+I) ~ 2 ETC OPIY) = CONTENTS OF LOCATION Y NXTI8,T) = LOCATION, JUST BEFORE COMPUTATION AT LAG T, OF THE NEXT INSTRUCTION IN BLOCK B WHICH IS TO BE CONSIDERED FOR POSSIBLE SU8STITUTION •• • = = = • TA8l2 - ADDRESS PORTIONS OF NEXT POSSIBLE INSTRUCTION TO SET ASIDE • FROM 8LOCK B • THE FOLLOWING FACTS ARE NEEDED TO UNDERSTAND HOW TA8t2 WORKS • 1. AOlYI IS MCNOTONE DECREASING FOR Y=lOC(8), ••• ,LOC(8J+NC8)-1 2. OPIYI CORRESPONDS TO MONOTONE INCREASING XII) INOICES • • FOR Y s LOCI8), ••• ,LOCI8)+NI8)-1 • 3. THE VALUE OF AOIY) MUST LIE 8ETWEEN 1 AND N INCLUSIVE • FOR Y : LOCI81, ••• ,LOC(8)+NI8)-1 • TA8l2 MEANING JUST PRIOR TO SU8STITUTION ANALYSIS FOR LAG T • TA8l2-8 = PZE AOINXT(8,T)1 IF 8 STILL HAS UNOELETEO E~EMENTS OCT 000000077771 IF 8 HAS NO MORE DITTO (POS LAGS) • = OCT 000000000000 IF 8 HAS NO MORE DITTO (NEG LAGS. • 082~ 0825 0826 0827 082B 0829 0830 0831 0832 0833 0834 0835 0836 0837 0838 0839 0840 0841 08~2 0843 0844 0845 08~6 SETS UP TWO TABLES, TABLEIII AND TABllIl1 AS BELOW • tiT USES TABLEII) ITSELF. TABL1 IS A SERVICE TO FASCOR) • • ' IPAGE 12) = 0847 0848 0849 0850 0851 0852 0853 0854 0855 0856 0857 0858 0859 0860 0861 0862 0863 0864 0865 0866 0867 OB68 0869 0870 0871 0872 0873 0874 0875 0876 0877 0878 0879 0880 0881 0882 0883 0884 0885 0886 0887 0888 0889 OB90 0891 0892 0893 0894 0895 0896 0897 0898 •••••••••••••••••••••••• - PROGRAM LISTINGS • PROCOR • (PAGE 131 - PROCOR TABL2 FOR POSITIVE LAGS ADILOCIBI+NIBI-1) IF NIB) NOT = 0 0·00000077177 IF N( BI = 0 ITHI SIS BYPASS SIiiCI'I) fABL2 FOR NEGATIVE LAGS JDILOC(B») IF NIB) NOT = 0 0 IF NIB) = 0 I BYPASS SWITCH) - TABL3 - INOICES OF NEXT POSSIBLE INSTRUCTION TO SET ASIDE FROM BLOCK B • MEANING JUST PRIOR TO SUBSTITUTION ANALYSIS FOR LAG T IS • TABL3-B = PZE PIB,NXTIB,T» • INITIAL SETTING OF TABL3 FOR POSITIVE LAGS • TABL3-B = PZE NIB) INITIAL SETTING OF TABL3 FOR NEGATIVE LAGS • TABL3-B = 1 • • TABL4 - STORAGE FOR INSTRUCTION SET ASIDE FROM BLOCK B MEANING JUST PRIOR TO SUBSTITUTION ANALYSIS FOR LAG T IS • TABL4-B = 0 IF NO INSTRUCTIONS HAVE BEEN TAKEN FROM BLOCK B YET • = OPINXTIB.T)+1) FOR POSITIVE LAGS OPILOCIB)) NEGATIVE LAGS INITIAL STTING OF TABL4 FOR POSITIVE OR NEGATIVE LAGS • TABL4-B = PZE 0 - • •••••••••••••••••••••••• IPAGE 131 •••••••••••••••••••••••• - INITIAL SETTING OF TABL2-B = PZE = OCT - INITIAL SETTING OF TABL2-B = PZE = PZE ••••••••••••••• ** ••••••• = - HTR 0 HTR 0 HTR 0 BCI 1,FASCOR FASCOR SXD FASCOR-4,1 SXD FASCOR-3,2 SXD FASCOR-2,4 -CHECK FOR EXISTENCE OF OBECT PROGRAM. INO IF N FROM PROCOR = 0 OR IF ERR FROM PROCOR IS NOT ZERO) ",._ , .......n STO 130 CLA T2 N CHECK TMI Y96 Y96 TZE CLA T27 ERR CHECK Y96 TNZ -NOW CHECK LEGAL IT I ES OF POSMAX. NEGMAX CLA K5 K5= 2.0 ERROR SET STO 130 POSMAX CHECK CLA3.4 TZE *+2 TMl Y96 CAS T2 NOP -(NEXT INSTRUCTION NOP FOR FASEPC OR FASEP1) Y2 TRA Y96 CANT = N STD Tl9 NEGMAX CHECK CLS2.4 TIE *+2 TMI Y96 CAS T2 NOP -(NEXT INSTRUCTION = NOP FOR FASEPC OR FASEPl) Y3 TRA Y96 STO T20 -SET OUTPUT CLEAR ROUTINE AND CHECK FOR BYPASS ON XIII ALL ZERO ADD Tl9 POSMAX+MAGN(NEGMAX)+1 ADD K7 STD Y958 CLA T20 ARS 18 ADD K1 ACL 4.4 CORZER+MAGN(NEGMAX)+l STA Y95A CLA T29 BYPASS SWITCH .(NEXT INSTRUCTION = TNZ Y95C FOR FASCR1, FASEP1) Y4 TNZ Y95 -TURN OFF OVERFLOW AND SET ERRORS FOR POSSIBLE OVERFLOW • (OBJECT PROGRAM IS NOT RESTORED IN T~IS CASE) TOV -+1 CLA K6 K6= 3.0 (SO THAT PROCOR MUST BE USED AGAIN IF OVERFLOW) STO T27 .,. - OB9<) 0900 0901 0902 0903 0904 0905 0906 0907 0908 0909 0910 0911 0912 0913 0914 0915 0916 0917 CJ91C 0919 0920 0921 0922 0923 0924 0925 0926 0927 0928 0929 0930 OQ'II 0932 0933 0934 0935 0936 0937 0938 0939 0940 0941 0942 0943 0944 0945 0946 0947 0948 0949 0950 0951 0952 0953 0954 0955 0956 0957 095B 0959 0960 0961 0962 0963 0964 0965 0966 0'167 0968 0969 0970 0971 0972 0973 •••••••••• ** ••••• *.* •• *. • PROCOR • PROGRAM LI STINGS •••••••••••••••••••••••• (PAGE 14) STO no ·SET ENTRIES TO OBJECT PROGRAM, CORlER ADDRESSES, Y, Y-N CLA T8 STA Y6 STA Y25 STA Y81 CLA 4.4 STA Y7 STA Y26 STA Y82 STA Tll 1,4 CLA STA T22 SSP SUB Til STA T23 .NOW COMPUTE ZERO LAG CORRELATION AND STORE IT 0,1 PAC -IY-Nl TO IRI SUM STl •• ,4 Y6 TSX ··=ENTRY TO OBJECT PROGRAM CLA SUM ·(NEXT INSTRUCTION ADD CORlER FOR FASCRI OR FASEPl) NOP •• =CORZER Y7 STO •• TOV Y96 ·SET DECREMENTS = S CLA T3 Y8G STO Y33 STD STD Y43 Y94 STO .SET TA8U ADDRESSES BeleW CLA T13 Y8A STA STA Y20 Y29 STA STA Y38 STA Y60 Y86 STA .SET TABL2 ADDRESSES BELOW CLA Tl4 YIlD STA STA Y211l STA Y23A Y40 STA STA Y72 STA Y78 ADO Kl TABL2+l ALS 18 IN DEeR PDC 0,2 YlO ,2 -CTABL2+l1 STORED SXD Y50,2 SXD TABL2+ l-S SUB T3 SUIl K7 0,2 PDC Yll ,2 SXD -CTABL2-S1 STORED Y51,2 SXD .SET TABU ADDRESSES BELOW CLA Tl5 Y8E STA STA Y2IJA STA Y21C STA Y21D STA Y30 STA Y42 STA Y61 STA YB STA Y74 .SET TABL4 ADDRESSES BELOW CLA 116 STA YBF STA Y20B STA Y21A STA Y28 STA Y31 •••••••••••••••••••••••• PROCOR •••• ,.** •••••••••••.•••••• IPAGE 141 0974 0975 0976 0977 0918 0919 0980 0981 0982 09B3 0984 0985 0986 0981 0988 09119 0990 0991 0992 0993 0994 0995 0996 0991 0998 0999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1011 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1031 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 .......................... . , PROCOR •.................. IPAGE 151 -.....- PROGRAM LISTINGS •••••••••••••••••••••••• •.•...•....•. -••..•.•...• "PROCOR sa Y41 STA Y16 sa YB5 STA Y81 "SET DECREMENTS DEPENDING ON POSMAX,NEGMAX BELOW CLA T19 POSMAX IN DECR STD Y21 CLA T20 MAGN OF NEGMAX IN DECR ARS 18 STA T26 "ARE POSITIVE LAGS WANTED ClA T19 GET POSMAX CAS K1 TRA Y8 YES TRA Y8 YES TRA Y35 NO -MAKE INITIAL SETTINGS FOR POS IT I VE LAGS YB ClA Kl STO NXTXI NXTXI=1 STO LAG T=1 ClA T3 S ARS 19 5/2 IN ADDRESS SSM -SI2 ADO T14 PLUS TABL2 PAC 0,1 SXA lOCOlX'l "SET UP TABl2,TABl3~ AND TABL4 FOR POSITIVE LAGS -ILOOP TAKES 15IS*1) HI SPEED INSTRUCTIONS) AXT 0,1 1=0 ClA ... ,1 I •• =TABL11 YBA PDC 0,2 -NIl) TO XR2 TXH Y8B,2,0 "-'U-U\...I I r, t f l.AL ""u TRA Y8D SET THIS CONSTANT FOR NII)=O YBB SUB Kl STA HI CAL •• ,2 Y8C ""=LOC( IJ-l ANA K20 EXTRACT ADILDCII)+NIII-11 Y8D SLW ".,1 **=TABL2 PXA 0,2 PAC 0,2 PXA 0,2 STORE Nil) Y8E STO **.1 « •• =TABL41 Y8F CLEAR STZ .".1 TXI .. +1,1,1 Y8G TXl Y8A,1,." I."=SI -NOW LOOP THRU ALL POSITIVE LAGS "THIS LOOP SCANS THE INDICES IN TABL2 TO FIND NEWB, I.E., *TO FINO FROM WHICH BLOCK THE NEXT INSTRUCTION IS TO BE DELETED~ .IT STARTS SCANNING FROM INSIDE TABL2 AT THE SAME BLOCK AS THAT .. OF THE PREVIOUS DELETION AND PROCEEDS OUTWARDS IN BOTH D1RECTIONS .TO MINIMIZE NUMBER OF TRIAL COMPARISONS "(LOOP Y9 TO Y22 TAKES ABOUT POSMAX*(53+(3 TO 3,,(S+1))) HI speED INSTRUCTIONS EXCLUSIVE OF OBJECT PROGRAM) • .(NEXT INSTRUCTION = TRA Y24 FOR FASEPC OR FASEP11 Y9 LXA LOCOLX,1 SET TO EXAMINE NEXT INDEX LXA LOCOLX,2 IN OLD ALOCK FIRST CLA NXTXI GET INDEX TO COMPARE "SCAN DOWNWARDS AVOID OVERSHomr VIO TXL 1*-=- (TABL2+ 11) Y11,l,"· 0,1 CAS HPR IMPOSSIBLE • GOT IT TRA Yl3 TXI dND UPWARDS Y11 TXH Y10,2,,," AVOID UNDERSHOOT *"=-ITABL2-S) CAS 0,2 IMPOSSIBLE HPR * TRA YIZ TXI YlO,2,1 "WHEN INDEX fOUND REPLACE THE OLC BLOCK ADDRESS BY NEW ONE "FINO NEWB AND SET XRl TO NEWB Y12 SXA LOCOLX.2 TRA Y14 SXA LOCOLX,l Y13 IPAGE 15) 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1012 1013 1074 1075 1016 1077 1018 1019 1080 1082 1083 1084 1085 1086 10B1 1088 1089 1090 1091 1092 1093 1094 1095 1096 1091 1098 1099 1100 1101 1102 1103 1104 1105 1106 1101 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 • •••••••••••••••• *- ••••• - - PROCOR •••••••••••••••••••• * ••• IPAGE 16) Y14 PROGRAM LISTINGS •••••••••••••••••••••••• • PROCOR • ••• 4 •••••••••••••••••••• LAC LOCOLX,l PXA 0,1 TABL2-NEWB IN AC NOW SUB T14 TI4=PZE TABL2 SSP NEWB IN AC PAX 0,1 SET XRl FOR FUTURE LOOK-UPS -GET LOCINEWBI AND NINEWB) Y20 CLA --,I (--=TABLl) STA LOCNWB ARS 18 STA NNEWB -GET PINEWB,NXTINEkB,T)) AND THE NEW INSTRUCTION TO BE REPLACED Y20A CLA --,I ( •• =TABL3) STA PNEWBT ADD LOCNWB SUB K1 PAC 0,2 -(ADDRESS OF INSTR TO DELETE) CLA 0,2 STO NEW INS *CHECK,IS THIS FIRST REPLACEMENT IN THIS BLOCK CLA PNEWBT CAS NNEWB HPR IMPOSSIBLE TRA Y22 YES -IF NOT, MOVE TRA INSTRUCTION UP ONE NOTCH, AND RESTORE OLO I~STRUCTION CLA 1,2 MOVE UP STO 0,2 TRA Y20B CLA *.,1 (.*=TABL4) RESTORE OLD Sf 0 1,2 INSTRUCTION -THEN SAVE NEW INSTRUCTION AND CHECK IF TRA IS NOW AT TOP OF SLOCK Y21 CLA NEWINS Y21A STO *.,1 (--=TABL41 CLA Kl (Kl=ll CAS PNEWBT HPR IMPOSSIBLE TRA Y23 YES, SINCE PINEWB,NXTINEWB,TJ) = 1 -IF NOT AT TOP SET NEW X INDEX TO BE CHECKEDIFROM BLOCK NEWB) INTO TABL2 CLA -1,2 Y21B STA *.,1 1-*=TABL21 -REDUCE INSTRUCTION INDEX FOR BLOCK NEWB IN TABL3 Y21C CLA -.,1 (**=TABL31 SUB Kl Y21D STO -.,1 (*-=TABL3) TRA Y24 ON TO COMPUTE CORRELATION -FOR FIRST REPLACEMENT FORM TRA LOCCNEWBI+NINEWB) AND -INSERT IN LOCINEWB)+NINEWB)-1 Y22 CLA LOCNWB ADO NNEWB STA K22 K22=TRA -CLA K22 STO 0,2 TRA Y21 BACK TO SAVE INSTRUCTION -IF TRA AT TOP OF BLOCK AOD 5 TO ITS ADDRESS AND SET -TABL2 SO THIS BLOCK IS INVISIBLE TO FUTURE SCANS Y23 CLA 0,2 ADO K9 K9=5 STA 0,2 CLA K20 K20=77777 Y23A SID -*,1 (.*=TABL21 TRA Y21C BACK TO UPOATE TABL3 FOR LAST TIME .NOW COMPUTE CORRELATION Y24 CLS LAG -T SET FOR PAX 0,2 T IN IR2 STORAGE ADO T23 Y-N-T PAC 0,1 -(Y-N-T) TO IRI TPL .+2 PAX 0,1 (FOR CASE Y-N-T NEGATIVE) STZ SUM Y25 TSX **,4 (*-=ENTRY POINT TO OBJECT PROGRAM) CLA SUM *(NEXT INSTRUCTION AOD CORIER,2 FOR FASCR1, FASEPll NOP Y26 STO **,2 (**=CORZERI TOV Y96 ERROR EXIT CLA NXTXI ADD Kl (PAGE 161 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 113B 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 115B 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 117B 1179 1180 1181 I1B2 11B3 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 119B .•....•..•......• • PROCOR ~ ...... PROGRAM LISTlNGS • IPAGE •••••••••••••••••••••••• ........................... • •••••••••••••••••••••••• PROCOR (PAGE 171 17) STO NXTXI TXI .+1,2.1 SXA LAG.2 Y27 TXL Y9.2... I ••=POSMAX) .WHEN DONE, RESTORE INSTRUCTIONS WHICH HAVE BEEN REPLACED BY TRA .ILOOP TAKES ABOUT 21o.IS+11 HI SPEED INSTRUCTIONS) .(NEXT INSTRUCTION TRA Y35 FOR FASEPC OR FASEP1) AXT 0.1 1=0 Y28 CLA •• ,1 ' •• =TA8LIoI TZE Y32 ZERO MEANS NO REPLACEMENT IN 8LOtK Y29 CLA •• ,1 ' •• =TABLll Y30 ADO ••• 1 ( •• =TABL3) PAC 0.2 -ILOCII)+PII,LAST SUBSl-ll CLA •• ,1 ( •• =TABLlol Y31 STO 0,2 RESTORE INSTRUCTION Y32 Txt .+1,1,1 Y33 TXL Y28,1, •• 1.·=51 .ARE NEGATIVE LAGS WANTED Y35 CLA T20 CAS K7 TRA Y36 YES TRA Y36 YES TRA Y95C NO-GO EXIT .MAKE INITIAL SETTINGS FOR NEGATIVE LAGS Y36 ClA TIl STO NXTXI CLA K1 STO LAG ClA T3 S ARS 19 S/2 SSM -5/2 ADD TlIt PLUS TA8L2 rM~ • v,:L 1199 1200 1201 1202 1303 12010 1205 1206 1201 1208 1209 ta10 1211 1212 1213 1211t 1215 1216 lZl1 1318 1319 1220 1221 1222 1223 12210 1225 1226 1227 1228 1229 1230 1 ,~~ SXA LOCOLX~1 .SEt UP TABL2. TABL3, TABLIo FOR NEG LAGS .(LOOP TAKES 12.IS+l) HI SPEED INSTRUCTIONS) Y37 AXT 0.1 I • 0 Y38 CLA ••• 1 I •• TABLl) POX 0.2 -NIII TO XR2 TXH Y39.2,O CLM TRA YIoO Y39 PAC 0,2 CAL 0.2 ANA K20 K20 77777 YIoO SLW •• ,1 •• =TABL2 Y41 srz •• ,1 ,.. TABLIo) CLA Kl Y42 STO ••• 1 I.. TABL]) TXI .+1.1,1 YIo3 TXL Y38,l... I •• = 5) .NOW LOOP THROUGH CORRELATIONS .THIS LOOP SCANS TABl2 AS DOES LOOP AT Y9. BUT .OOES IT FOR NEGATIVE LAGS IINEQUALITIES WORK OPPOSITELY) .ILOOP Y49 TO Y84-1 TAKES ABOUT NEGMAX.(61+1] TO 3.15+1))) HI SPEED • INSTRUCTIONS EXCLUSIVE OF OBJECT PROGRAM) .INEXT INSTRUCTION TRA Y80 FOR FASEPC OR FASEP1) YIo9 lXA LOCOLX;l LXA lOCOLX.2 CLA NXTXI Y50 TXL Y5!,1... 1•• =-ITABL2+11) CAS 0,1 TXI Y51.1,-1 NO GOOD TRA Y53 GOT IT HPR. IMPOSSIBLE Y51 TXH Y50,2,.. -ITABL2-S) CAS 0,2 TXI Y50.2,l NO GOOD TRA Y52 GOT IT HPR. IMPOSSIBLE Y52 SXA LOCOlX'2 TRA Y54 Y53 SXA lOCOlX.1 Y510 LAC LOCOLX_l PXA 0,1 = ..= 1232 1233 12310 1235 1236 1231 1238 1239 12100 12101 UIo2 1ilo3 12104 1245 12106 12107 12108 1249 1250 1251 1252 1i53 12510 1255 1256 1257 1258 1259 1260 1261 1262 1263 12610 1265 1266 1267 1268 1269 1270 1271 1272 1273 ••••••••••••••• *•••••••• • PROCOR * ••• * •••••* •••••••••••••• IPAGE 18) PROGRAM LISTINGS •••••••••••••••••••••••• • PROCOR • •••••••••••••••••••••••• IPAGE 181 T14 = PZE TABL2 SUB SSP PAX 0,1 NEWB IN XRl .GET lOCINEWBI AND NINEWBI Y60 CLA .*,1 1*. = TABLll STA LOCNWB PAC 0,4 -LOCINEWBJ TO XR4 ARS 18 STA NNEWB *GET PINEWB,NXTCNEWB,TII I •• TABL3) Y61 CLA *.,1 STA PNEWBT AOD LOCNWB SUR K1 PAC 0,2 -CLOCINEWBI + PINEWBITI - II TO ~R2 .IS THIS THE FIRST REPLACEMENT OF BLOCK CLA K1 CAS PNEWBT HPR * IMPOSSIBLE TRA Y75 YES *IF NOT, ADO 1 TO ADDRESS OF TRA INSTRUCTION Y62 CLA 0,4 ADD KI STO 0,4 .WAS OLD MODIFIED INSTRUCTION CLA (0500) OR CLS 105021 Y63 CLA 0,2 CAS K23 K23 = 0501 TRA Y65 IT IS CLS HPR * *IF IT WAS CLA RECONVERT TO ADD Y64 ANA K20 ADO 0,1 ADD K25 K25 TRA Y66 *IF IT WAS CLS RECONVERT TO SUB Y65 ANA K20 K26 SUB 0,1 ADO K26 Y66 STO 0,2 *IS THIS LAST INSTRUCTION IN BLOCK TO BE DELETED Y67 CLA PNEWBT CAS NNEWB HPR • IMPOSS IBLE TRA Y77 YES *IF NOT, CONVERT THE ADO (0400) OR SUB (0402) TO CLA OR CLS Y68 CLA 1,2 CAS K24 K24 = 0401 IT WAS SUB TRA Y70 HPR • IMPOSSIBLE *IF IT WAS ADO, CONVERT TO CUI Y69 ANA K20 AOD K27 K27 = CLA 0,1 GO ADJUST TABL2 TRA Y71 .IF IT WAS SUB, CONVERT TO CLS Y70 ANA K20 ADD K28 K28 " CLS 0,1 Y71 STO 1,2 *SET NEW X INDEX I •• = TABL21 Y72 STA .*.1 .INCREASE TRIAL INSTRUCTION INDEX BY I IN TABL3 Y73 CLA ••• 1 1*. TABL3l ADO Kl I •• = TABL3l Y74 STO -.,1 TRA Y80 .IF FIRST REPLACEMENT, SAVE INSTRUCTION, FORM AND INSERT .TRA LOCINEWBI + 1 INTO LOCINEWBI Y75 CLA 0,4 TABL4l Y76 STO *.,1 1*· CLA LOCNWB ADO Kl ADO K21 STO 0,4 TRA Y67 BACK TO CHECK IF IT IS LAST INSTRUCTImN ALSO -IF LAST REPLACEMENT, ADD 5 TO TRA INSTR ADOR AND SET -TABL2 TO MAKE THIS 8LOCK INVISIBLE TO FURTHER SCANNING Y77 CLA 0,4 ADO K9 K9 = 5 Tl4 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 IHO !'i31 1332 1333 1334 1335 1336 1337 1338 1139 1340 1341 1342 1343 1344 1345 1346 1347 1348 • ••••••••••••••••••••••• - PROCOR .. •••••••••••••••••••••••• IPAGE 19) PROGRAM LISTINGS •••••••••••••••••••••••• • PROCOR • •••••••••••••••••••••••• IPAGE 19) STO 0,4 I •• ,. TABL2) SXZ •• ,1 TRA Y73 BACK FOR AOJUSTMENT OF TABL3 .NOW COMPUTE CORRELATICN Y80 CLA LAG T SET FOR PAC 0,2 -T IN IR2 STORAGE ADO T23 Y-N+T PAC 0,1 -IY-N+TI TO XRl lV-N+T IS ALWAVS PSS1T{VE) STl SUM Y81 TSX •• ,4 I •• ,. ENTRY POINT TO OBJECT PROGRAM) CLA SUM -INEXT INSTRUCTION = ADO CDRZER,2 FOR FASCRl, FASEPl) NOP ( •• ,. CORZER) Y82 STO •• ,2 TOV Y96 CLA NXTXI SUB Kl STO NXTXI CLA LAG ADO Kl STO LAG CAS T26 TRA YB4 GO WINDUP TRA Y49 GO BACK TRA Y49 GO BACK .WHEN DONE, RESTORE INSTRUCTIONS WHICH HAVE BEEN REPLACED .BY TRA AND RECONVERT TO ADO OR SUB ANY OTHER .INSTRUCT! ONS WHICH HAVE BEEN CHANGED AND NOT RECHANGEO .llOOP TAKES ABOUT 24.(S+11 HI SPEED INSTRUCTIONS} .(NEXT INS~RUCTION" TRA Y95C FOR FASEPC OR FASEPl) Y84 AXT 0,1 Y85 CLA •• ,1 c•• = TABL41 Y78 I La: 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1174 1375 1376 1377 1378 1379 1380 '':1.;) I •• ,. TABU) CLA •• ,1 PAC 0,2 -ILOCII) TO IR2 STA T24 SAVE LOCII) ARS 18 AND Nt I) STA T25 CLA 0,2 GET TRA INSTRUCTION FROM BLOOK I ( •• ,. TABL4) Y87 LOQ •• ,1 REPLACE BY STQ 0,2 OLD INSTRUCTION ANA K20 EXTRACT ADDRESS OF TRA SUB T24 ADDRESS MINUS LOCIII COMPARE WITH NIl} CAS T25 TRA Y93 BIGGER, SO MUST BE TRA Locel.l) HPR • IMPOSSIBLE -GET INSTRUCTION TO BE RECONVERTED. IS IT CLA OR CLS ADO T24 Y89 STA Y90 STA Y92 SET FOR RESTORAGE CLA •• I •• "ADDRESS OF INSTR BEING RECONVERTED) Y90 CAS K23 TRA Y91 IT IS CLS HPR -IF CLA, CHANGE TO ADI!I ANA K20 ADO K25 TRA Y92 .IF CLS, CHANGE TO SUB Y91 ANA K20 ADO K26 -RESTORE c •• ,. AOORESS OF INSTR BEING RECINVIRTEO) Y92 STO •• -CHECK END OF LOOP Y93 TXI *+1,1,1 Y85,I,.. C•• ,. 5) Y94 TXL TRA Y95C GO EXIT -CLEAR OUTPUT WHEN PROCOR SIGNALS ALL XII) = 0, ANO EXIT -(NOT USEO BY FASCRl, FASEPll Y95 AXT 1,4 •• ,4 •• ,.CORZER+MAGNITUDEeNEGMAX}+1 Y95A STl ·+1,4,1 TXI Y95A,4 ••• Y95B TXL ••"POSMAX+MAGNITUOECNEGMAX)+l .GENERAL EXIT FOR All OK Y95C STl T30 Y86 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1382 1383 1384 1385 1386 13B7 1388 1389 1390 1391 1392 1393 U94 1395 1396 1397 n98 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 • *.*.* •••• * •• * ••••• ~ •••• PROCOR •••••••••••••••••••••• **-" PROGRAM LI STINGS • PRoeOR • _••••••••••• ** •••••••••• (PAGE 20] (PAGE 20) HZ T21 .RESTORE XRS AND SET ERROR Y96 LXD FASCOR-4,l FASCOR-3,2 LXD LXD FASCOR-2,4 CLA no 5,4 STD. .NOW RESTORE FASCOR PROGRAM AND EXIT CLA K50A Y2 STO STO Y3 K51A CLA Y9 STO Y49 STO CLA K52A STO Y28-1 Y84 STO CLA K64A Y4 STO CLA K62A Y7-1 STO Y26-1 STO Y82-1 STO 6,4 TRA • •.FASEPC, FASCRl, FASEP1 SUBSTITUTION CONSTA~TS -(SERIES A FOR FASCORj SERIES B FOR FASEPC) K50A TRA Y96 FOR Y2 AND Y3 K50B NOP FOR Y2 AND Y3 K51A LXA LOCOLX,I FOR Y9 AND Y49 K51B TRA Y24 FOR Y9 K52A AXT 0,1 FOR Y28-1 AND YB4 K52B TRA Y35 FOR Y28-1 K53B TRA Y80 FOR Y49 K54B TRA Y95C FOR YB4 K60 ADD.. **=CORZER K61 PZE 0,2,0 K62A NO!' FOR Y7-1.Y26-1.Y82-1 K63 TNZ Y95C FOR Y4 Y95 K64A TNl FOR Y4 •.MOOIFY FASCOR TO BYPASS SU8STITUTION LOGIC AND TO ELIMINATE • MAXIMUM LAG LIMIT CHECK FASEPC CLA K50B STO Y2 STO Y3 CLA K51il STO Y9 CLA K52B STO Y28-1 CLA K53B STO Y49 CLA K54B STO Y84 TRA FASCOR - -MODIFY FASCOR FASCRI LOQ CLA STA CLA sro - •••••••••••••••••••••••• ADO STO STO CLA STO TQP TRA SO CORRELATIONS AOD TO eORZER(I) Kl Kl IS POSITIVE 4,4 K60 K60= AOD K60 Y7-1 K61 K61= PZE 0.2,0 Y26-1 Y82-1 K63 Y4 FASCOR FASEPC *. .SAME AS FAseRI BUT FOR FASEPC FASEPI LDQ KMSK2 KMSK2 IS NEGATIVE TRA FASCRl+l ENO 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 145S 1456 1451 1458 1459 1't60 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1412 1473 1414 1475 1476 1477 1478 }tt79 1',80 1481 1482 1483 1484 1485 1486 1481 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 •••••••••••••••••••••••• • PROGRAM LISTINGS • PSQRT • PSQRT ISUBROUTINE) • LABEL CPSQRT SUBROUTINE PSQRT IN,C,M,A} 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 •••••••••••••••••••••••• • PSQRT • ••••••••••• ** ••• ** •••• ** •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0090 0001 0002 0003 0004 ----ABSTRACT---0005 0006 TI TlE - PSQRT 0007 FINO THE POWER SERIES SQUARE ROOT OF A POLYNOMIAL 0008 0009 GIVEN THE POLYNOMIAL 0010 0011 2 3 IN-I) 0012 PIX)= Ct1)+CIZ).X+CI11.X +CI4).X + ••• +CIN1.X 0013 0014 WHERE C(1) IS GREATER THAN ZERO 0015 0016 FINO THE FIRST M COEFFICIENTS OF THE SQUARE ROOT POWER 0017 SERIES. 0018 0019 0020 LANGUAGE - FORTRAN II SUBROUTINE EQUIPMENT - IBM 709 OR 7090 CMAIN FRAME ONLY) 0021 STORAGE - 155 REGISTERS 0022 SPEED - 3 + 14 + .06.14.14 MILLISEC ON IBM 709 0023 AUTHOR - J. CLAERBOUT 0024 0025 0026 ----USAGE---0027 TRANSFER VECTOR CONTAINS ROUTINES - NONE 0028 ANO FORTRAN SYSTEM ROUTINES - SQRT 0029 0030 FORTRAN USAGE 0031 10/5/64 \. C C INPUTS C N C C C THE NUMBER OF COEFFICIENTS IN THE POLYNOMIAL Tm BE ROOTED MUST BE GREATER THAN OR =4ITHIS IS NO SEVERE RESTRICTION HOWEVER SINCE ANY OF CI21,C(3),AND/OR Clio' MAY s ZERO.) C C C CII) I=l,N IS THE VECTOR Of COEFFICIENTS Of THE POLYNOMIAL WHICH IS TO BE ROOTED. C(1) MUST EXCEEO ZERO. C C 14 THE NUMBER OF COEFFICIENTS DESIRED IN THE SQUARE ROOT POWER SERIES. C C C C C C C OUTPUTS All) 1=1,14 THE VECTOR OF THE FIRST 14 COEFFICIENTS IN THE SQUARE ROOT POWER SERIES. C EXAMPLES C C 1. INPUTS C C C C C C C C C C C C C C - N=4 M=6 Cl1 ••• 4) =1.,-4.,4.,0. INOTICE C(4) MUST BE OIFINED EVEN THOUGH IT IS ZERB.I OUTPUTS - AIl ••• 6)=1.,-2.,0 •• 0.,0.,0. ITHE POWER SERIES DEGENERATES TO POLYNO"IAl) 2. INPUTS - N=4 14=15 CI1 ••• 4)=1 •• 2.,0 •• 0. OUTPUTS - AIl ••• 15)=1 •• I •• -.5,.5.-.625,.875.-1.31,2.06,-1.35,5.58~ -9.49,16.4,-28.7.50.7.-90. liN THIS EXAMPLE THE RADIUS OF CONVERGENCE OF THE POWER SERIES IS .5. THEREFORE THE DOEFS. TEND TO INCREASE. OVERFLOW WOULD OC«UR SOMEWHERE AROUND THE 120 TH COEfFICIENT~1 DIMENSION AII00),CII00) An I=SQRTFICI 11) TA=2.·AIll A12 I =C (2) ITA AI3)=CC(31-AI21'AI2)I/TA 00 100 1=4.14 IfII-Nl 20,20,10 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0041 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0061 0068 0069 0010 0071 0012 0073 0074 ******.*.***.*********.* PSQRT * ***** •• *.* •• *.** ••• ***** IPAGE 2) * 10 20 30 40 50 60 100 PA=O. GO TO 30 PA=C II ) CONTINUE PS=O. IH=I/2 00 40 J=2,IH K=I-J PS=PS+AIJ)*AIK+ll PA=PA-2.*PS IFI2*IH-II 50,60,50 PA=PA-At IH+I hA IIH+l I AIII=PA/TA CONTI NUE RE TURN END PROGRAM LISTINGS ••••• ** ••••••••••••••••• * PSQRT * ••••••••••••••••••• ** ••• (PAGE 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 2) •••••••••••••••••••• **** PWMLIV ••••••••••• ~.*** PROGRAM liSTINGS • ••••••••• ••••••••• *•••••••••••••• • • PWMLIV (SUBROUTINE) 9/29/64 LAST CARD IN DECK IS NO. • LABEL CPWMLIV SUBROUTINE PWMLIV(JOB,ITAPE,MLIV,LMLIViIANSI C C ----ABSTRACT---C C TITLE - PWMLIV C PRINT OR WRITE OUTPUT TAPE A MACHINE LANGUAGE INTEGER VECTOR C C PWMLIV IS AN ELEMENTARY OUTPUT PROGRAM fOR NL! VECTORS. C PRINTING 1 TO 10 WORDS PER LINE AND ALWAYS 12 CHARACTERS C PER WORD. OUTPUT IS EITHER ON-LINE OR ON LOGICAL TAPE C AS SPEC If lEO BY AN ARGUMENT. C C LANGUAGE - fORTRAN II SUBROUTINE C EQUIPMENT - 709 OR 7090, MAIN fRAME PLUS 1 TAPE AND/OR ON-LINE PRINTER C STORAGE - 300 REGISTERS C SPEED C AUTHOR - S.M. SIMPSON JR, JULY 1961 C C ----USAGE---C C TRANSFER VECTOR CONTAINS ROUTINES - MLI2A6 C AND fORTRAN SYSTEM ROUTINES - (FIL), ISPH), ISTH) C C FORTRAN USAGE C CALL PWMLIV'JOB~ITAPE,MLIV,LMlIV,IANSI C C INPUTS C C JOB = *N OR -N WHERE N = DESIRED NO. OF WORDS/LINE ~ AND + MEANS OFF-LINE OUTPUT, - MEANS ON-LINE O~TPUT. C AND 1 lSTHN= N LSTHN= 10 C C ITAPE IS NOT USED FOR JOB NEGATIVE C IS LOGICAL NO. OF DESIRED OUTPUT TAPE FOR JOB ROSiTIVE C IN THIS CASE ITAPE MUST HAVE VALUE 1 ••• 20 INtLtlU'IE C MLIVII) I=l ••• lMLIV IS THE MLI VECTOR. C C C LMLIV C C OUTPUTS C C C ClANS 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 * PWMLIV f ••••••••••••••••••••••• 0141 0001 0002 0003 0004 0005 0006 0007 OOOB 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 003B 0039 O~O GRTHN= 1 PRINCIPAL OUTPUT IS PRINTED COpy = 0 =-1 =-2 =-4 JOB DONE ILLEGAL JOB NO. ILLEGAL ITAPE ILLEGAL LMLIV 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 ........................ , PWMlIV ••••••••••••••••••••••••• • (PAGE PROGRAM LISTINGS 2) C C C 7. C C C 8. C C C 9. C C C10. C C C11. C C OUTPUTS - SAME AS EXAMPLE 1. EXCEPT FORMATl10A6) INPUTS - ~AME AS EXAMPLE 1. EXCEPT JOB,z7 OUTPUTS - SAME AS EXAMPLE 1. EXCEPT FORMAT( 14A6) INPUTS SAME AS EXAMPLE 1. EXCEPT JOB=O OUTPUTS - IANS"-1 INPUTS - SAME AS EXAMPLE 1. EXCEPT JOB=l1 OUTPU1S - IANS=-1 III\PUTS SAME AS EXAMPLE 1. EXCEPT lMLIV"O OUTPUTS - IANS=-4 INPUTS - SAME AS EXAMPLE 1. EXCEPT ITAPE " 0 OUTPUTS - IANS.. -2 OIMENSION MlIV(2) • BUF(201 C CHECK INPUTS JOB, ITAPE AND LMllV lANS=-l IF (JOB) 10.9999.20 10 IF (10+J08) 9999,30,30 20 IF (JOB-101 30;30.9999 30 IANS.-2 IF (ITAPE-l) 9999,40.40 40 IF (ITAPE-20) 50,50,9999 50 IANS = -4 IF (lMlIV) 9999,9999,100 C SET UP NRGlNS.NWREG.NWlST.NXMll 100 NWREG=JOB IF (JOB) 110,120.120 110 NWREG=-JOB 120 NRGlNS=LMlIV/NWREG NWlST=lMlIV-NRGtNS·NWREG NXMLI=l NRREG=2.NWREG IANS=O GO TO 200 C TREAT REGULAR LINES IF THERE ARE ANY 200 IF (NRGlNS) 300.300.220 220 DO 280 I=l.NRGlNS DO 240 J=l,NWREG K=2·J-l CAll MlI2A6CMlIV(NXMlII.BUF(~).NCRS) 240 NXMll=NXMlI+l IF (JOB) 270.270,260 260 WRITE OUTPUT TAPE ITAPE,700,(BUFCJ).J e l,NRREG) GO TO 280 270 PRINT 700.(BUF(8),J=l,NRREGI 280 CONTINUE GO TO 300 C WORK ON lAST lINE OF OUTPUT IF ANY 300 IF (NWlST) 9999,9999.320 320 00 330 I=l,NWlST J=2·I-l CAll MlI2A6tMlIV(NXMlII.BUFeJ).NCRS) 330 NXMlI-NXMll+l NRlSr e 2.NWlST IF (JOB) 350,350.340 340 WRITE OUTPUT TAPE ITAPE.700,(BUF(Jl p J=1.NRlSTI GO TO 9999 350 PRINT 700,(BUF(J),J=l,NRlSTI GO TO 9999 C ONLY FORMAT STATEMENT 700 FORMAT(lH .20A6) C EXIT 9999 RETURN END ••••••••••••••••••••••••• • PNMlIV • •••••••••••••••••••••••• (PAGE 21 0074 0075 0076 0077 0078 0079 OOBO 0081 0082 0083 00B4 00B5 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119. 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 •••••••••••••••••••••••• QACORR * •••••••••••••••••••••• *. •••••••••••••••••••••••• • QACORR • •••••••••••••••••••••••• PROGRAM LJ STINGS • • QACORR ISUBROUTINE) 9/29/64 LAST CARD IN DECK IS NO. 01B3 • LABEL 0001 CQACORR 0002 SUBROUTINE QACORR IX,LX.MXACC.MXLAG,SPACE,ACOR.IANS, 0003 C 0004 C ----ABSTRACT---0005 C 0006 C TITLE - QACORR 0007 C FAST AUTOCORRELATIONS FOR LONG, LIMITED ACCURACY SERIES 0008 C OOM C C C C C C C C C C C C C C C C C C C C C C QACORR COMPUTES THE UNNORMALIZEO AUTOCORRELATION FUNCTION. ACIL). OF A LIMITED ACCURACY SERifS. XIIJ OF LENGTH LX. ACCORDING TO THE TRANSIENT FORMULA FOR L = O.I ••••• MXLAG WHERE MXLAG AND LX ARE INPUT PARAMETERS SPEED DEPENDS ON LX AND ACCURACY OF X. FOR VERY LONG SERIES A COMPLETE AUTOCORRELATION (MXLAG = lX-I' CAN BE COMPUTED IN SLIGHTLY MORE THAN CLX)SQUARED MACHINE ¢YCLES. QACORR OBTAINS THIS SPEED PRIMARILY BY CONVERTING XII' -TO AN INTEGER SEQUENCE IXIl) WHOSE MAGNITUDES MAVE UPPER LIMIT AS SPECIFIED BY AN INPUT PARAMETER MXACC. ANO THEN REGROUPS THE ABOVE EQUATION IFOR EACH LAG) SO AS TO PERFORM LX-L ADDITIONS PLUS MXACC (OR FEWER. MUL TlPl'ICATIONS IRATHER THAN LX-L ADDITIONS PLUS LX-L M~LTIPLICATIONS). THE RESULTS ARE THEN RECONVERTED TO FLOATING ",,"'''.,T • 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 1 LX-L --- * SUM I XII)*XII+LJ LX la1 ACIL) .......... rnnu • ..... '1 •• T" .... n ..... ,.."'ftn ... ,.. ... 'WLorf'l."'....... ~"''''''' ... .... ,.."'..... ,ro ...... I rol."n"" ............ v.., .... ............ ....... _n. ...,,,.4o ........._"'"""'-'_,'" < FASCOR FOR LOGIC DETAILS.) IXC[) IS ALSO REfLOATEO. USER MUST PROVIDE QACORR WITH A BLOCK OF TEMPORARY REGISTERS OF LENGTH LX + 10*IMXACC+1) + 1 • XII) [S LEFT SLIGHTLY MOD[F[ED BY THE FIX[NG, REFLOATING PROCESS. LANGUAGE EQUIPMENT STORAGE SPEED AUTHOR - FORTRAN II SUBROUTINE 709. 7090 (MAIN FRAME ONLY) 207 REGISTERS FOR LONG SER[ES QACORR TAKES ABOUT (MXlAG+l)*(2*LX-MXLAG+20*MXACC) MACHINE CYCLES - S. M. SIMPSON JR, 10/5/62 ----USAGE---- TRANSFER VECTOR CONTAINS ROUTINES AND FORTRAN SYSTEM ROUTINES - FXDATA. PROCOR, FASCOR. FLOATA NONE FORTRAN USAGE CALL QACORRtX,LX.MXACC.MXLAG,SPACE,ACOR,tANS) INPUTS XCI) t=t,2, ••• LX LX MUST EXCEED ZERO AND BE LSTHN= 10000 MXACC DEFINES ACCURACY OF XII). XIII WILL BE FIXED Te HAVE VALUES LYING BETWEEN -MXACC AND +MXACC INCLUS«VE. MUST LIE BETWEEN 1 AND 1000 INCLUSIVE. (SMALLER VALUES YIELD HIGHER SPEEDS. AND REQUIRE FEWER TEMPORARIES.) MXLAG IS HIGHEST LAG NO. DESIRED IN AUTOCORRELATION MUST BE NON-NEGATIVE SPACEIll l=l, ••• ,LSPACE MUST BE AVAILABLE AS TEMPORARIES, WHERE LSPACE = LX + 10.IMXACC+l) +1 C OUTPUTS C 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 002a 002) 0024 0025 0026 0027 0028 0029 0030 0031 IS A FLOATING POtNT VECTOR 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 •••••••••••••••••••••••• • QACORR •••••••••••••••••••••••• PROGRAM 1I STINGS • • IPAGE 2) C C C C C C C C C C C C C C C C QACOftR XIII 1=1.2 ••••• LX CONTAINS THE ROUNDED SERIES XXCIE XXII) FLOATFIIXIIII/SCALE WHERE IXII) = XFIXFCX(I)*SCALE) WITH SCALE = FLOATF(MXACC)/XMAX XMAX = LARGEST X MAGNITUDE INOTE- XFIXF IN ABOVE EXPRESSION IMPLIES ROUNDING TO NEAREST INTEGER. NOT TRUNCATION I XIII WILL BE LEFT = 0.0 IF XMAX = 0.0 ACORII) I=1.2 ••••• (MXLAG+l) WILL CONTAIN ACIL), COMPUTED ON THE ROUNCED SERIES XXIII 1 LX-L A C I L ) . SUM LX 1=1 C C C C C 0.0 L~O,lJ~~.,MXLAG XX(I).XXII+Ll FOR ALL L GRTHN LX-l IF ANY 0015 0016 0011 0078 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 ACORCI} WILL BE IDENTICALLY 0.0 WHENEVER XII) )SJ 0095 = 0 -2 -3 -4 -98 -99 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 C 00% ClANS C C C C C C C EXAMPLES C C C C C C 1. COMPLETE C INPUTS C OUTPUTS C IF IF IF IF IF IF NO TROUBLE ARISES LX IS ILLEGAL MXACC IS ILLEGAL MXLAG IS ILLEGAL UNEXPLAINED ERROR RETURN FROM PROCOR OCCURS UNEXPLAINED ERROR RETURN FROM FASCOR OCCURS THE FIRST 3 EXAMPLES ARE CHOSEN SO THAT THE ROUNDOFF EFFECT IS NOT PRESENT CALL QACORR IX,LX,MXACC,MXLAG,SPACE,ACOR,IANS) IS THE ASSUMED USAGE IN ALL EXAMPLES AUTOCORRELATION Xl1 ••• 5) = 10.,20 •• 10 •• 10 •• 5 • • LX=5. Xll ••• 5) = SAME AS INPUTS IANS=O ACORI1 ••• 5) = 145 •• 110.,70.,40 •• 10. MXACC=20~ MXlAG=4 C C 2. PARTIAL AUTOCORRELATION C INPUTS - SAME AS EXAMPLE 1. EXCEPT MXLAG = 2 C OUTPUTS - SAME AS EXAMPLE 1. EXCEPT ACORI4 •• 51 NOT DEFINED C C C C C C C C C C C C C C C C C C C C C • •••••••••••••••••••••••• IPAGE 2) •••••••••••••••••••••••• 3. AUTOCORRELATION BEYONO END OF SERIES INPUTS - SAME AS EXAMPLE 1. EXCEPT MXLAG=7 OUTPUTS - SAME AS EXAMPLE 1. EXCEPT ACORI1 ••• 8) = 145.,110.,70.,40.,10.,0.,0.,0. fl.E. TERMINAL ZEROES SUPPLIED) 4. PARTIAL AUTOCORRELATION SHOWING ROUNDOFF INPUTS - Xll ••• 3) = 23.8,148.0,20.3 LX=3 MXACC=100 OUTPUTS - Xl1 ••• 3) = 23.68,148.0,20.12 IANS=O ACORll) = 7631.354 MXLAG=O 5. THE NEXT 3 EXAMPLES SHOW ERROR CONDITIONS INPUTS - SAME AS EXAMPLE 1. EXCEPT LX=O OUTPUTS - IANS =-2 (ILLEGAL LXI 6. INPUTS - SAME AS EXAMPLE 1. EXCEPT MXACC=5000 OUTPUTS - IANS =-3 (ILLEGAL MXACC) 1. INPUTS SAME AS EXAMPLE 1. EXCEPT MXLAG=-2 OUTPUTS - IANS =-4 (ILLEGAL MXLAGI C C 8. ISPECIAL TEST FOR 8YPASS IN CASE ALL XII)=O.1 C INPUTS - SAME AS EXAMPLE 1. EXCEPT XI1 ••• 5)=0 •• 0..... C OUTPUTS - SAME AS EXAMPLE 1. EXCEPT ACORll ••• 5)=0.,0.,... C C PROGRAM FOLLOWS BELOW C DIMENSION X(2),SPACEI21,ACORI21 C CHECK INPUTS IANS=-2 IF ILX) 9999,9999,5 •••••••••••• *.* •• * •••••• PROGRAM LISTINGS QACORR * *••••••• * ••••• * ••• ******* (PAGE 3) IF ILX-10000) 10,10,9999 IANS=-3 IF IMXACC) 9999,9999,20 IF IMXACC-1000) 30,30,9999 20 30 IANS=-4 IF (MXLAG) 9999.40,40 C CLEAR OUTPUT AREA 40 NNLAGS=MXLAG+1 DO 50 I=l,NNLAGS 50 ACORII)=O.O C SET NO. LAGS = MINIMXLAG,LX-11 NLAGS=MXLAG IF (MXLAG-LX+1) 70,70,60 60 NLAGS=LX-1 C SET SPACE CONSTANT FOR PROCOR AND FIX X. EXIT IF X=ZERO LSPACE=LX+I0*(MXACC+l)+1 70 CALL FXDATA(LX,X,MXACC,SCALE) IANS=O IF ISCALE) 9999,9999,80 C THEN COMPUTE AUTOCORRELATIONS 80 I ANS=-98 CALL PROCORIX,LX,MXACC,SPACEILSPACE),SPACEIIJ,ANSRJ IF (ANSR) 900,100,900 100 I ANS=-99 CALL FASCORIX,O,~LAGS,ACOR,ANSR) IF IANSRI 900,120,900 C FLOAT AND SCALE ACOR 120 I ANS=O SCSQ=SCALE*SCALE*FLOATFILX) CALL FLDATAINNLAGS,ACOR,SCSQ) C REFLOAT X SERIES 900 CALL FLDATAILX,X,SCALE) '1'1'1'1 Kt:IUKN ENO •• * ••••••••••••••••••••• * QACORR * ~ •••••••••••• '* ••• ** •••• (PAGE 3) 5 10 VECfOR~ 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 \J.LO£ 0183 ••••••••• , ••• * ••••• * •••• •••• _•••••••••••• _••••••••• * PROGRAM LISTINGS • •• ••• * •• * ••• * ••• * QCNVlV ~** • QCNVlV • QCNVlV (SUBROUTINE) 9/29/64 lAST CARO IN DECK IS NO. • lABEL CQCNVlV SUBROUTINE QCNVlV IXX,lXX,VV,LVV,MXACC.LCC.SPACE.CC.IANS) C C ----ABSTRACT---C C TITLE - QCNVLV C C FAST CONVOLUTIONS FOR LONG, LIMITEO ACCURACV SERIES C C QCNVLV COMPUTES THE CONVOLUTION. CIJ). OF TWO LJMITED C ACCURACY SERIES. XIII I=O ••• lX ANO YII) I=O ••• tV. C ACCOROING TO THE FORMULA C C LX C CIJI SUM XI II*VIJ-II I C 1=0 C C FOR J= O.l ••••• LC C C WHERE YIKI IS ASSUMEO 0.0 WHENEVER K IS C OUTSIOE OF THE RANGE 0 TO LY C LX,LY,ANO lC ARE INPUT PARAMITERS C C TO OBTAIN HIGH SPEEO THE X ANO Y SERIES ARE CONYERTEO TO C INTEGER SEQUENCES WHOSE MAGNITUOES HAVE UPPER lIMIT AS C SPECIFIED BY AN INPUT PARAMETER MXACC ANO THEN REGROUPS C THE ABOVE EQUATION SO AS TO SUBSTITUTE ADDITIONS FOR C MULTIPLICATIONS ISEE PROCOR-FASCOR-FASEPC FOR lOGIC'. C THE RESULTS ARE THEN RECONVERTED TO FLOATING POINT FORM C WITH COFRECT SCALE. THE INTEGER SEQUENCES FOR X AND Y C ARE ALSO REFLOATED. C C USER MUST PROVIDE QCNVlV WITH A BLOCK OF TEMPORARY C REGISTEPS OF LENGTH LMIN + 10*IMXACC+1) + 1 C WHERE LMIN = MINIMUMIlX,LY) + 1 C C XII} AND VIII ARE LEFT SOMEWHAT MOOIFIED BV THE FIXING. C REFLOATING PROCESS. C C LANGUAGE - FORTRAN II SUBROUTINE C EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) C STORAGE - 569 REGISTERS C SPEED - COMPLETE CONVOLUTIONS ILC=LX+LYI CAN BE COMPUTED IN ABOUT C 2*ILX+1)*ILC+11 MACHINE CYCLES IF LX MUCH LSTHN LY C 1.2*ILX+l)*ILC+ll MACHINE CYCLES IF LX ABOUT = LY C FOR LONG SERIES. - S.M. SIMPSON, 10/18/62 C AUTHOR C C ----USAGE---C C TRANSFER VECTOR CONTAINS ROUTINES FXOATA, PROCOR. FASCOR. FASEPC, C FLOATA C AND FORTRAN SYSTEM ROUTINES XLOC C C FORTRAN USAGE C CALL QCNVLVIXX,LXX,YV,LYY,MXACC.lCC.SPACE,CC,IANSI = C C INPUTS C C XXII) C C LXX C C YY(II C C C C LVV C C MXACC C C I=1,2, ••• ,LXX • • •••••••••••• _••••• ** ••• ~ CONTAINS XII) I=O,l, ••• ,LX • lX~LXX-1 MUST EXCEED ZERO I=1.2, ••• ,LYY CONTAINS YII) I=O,l, ••• ,lY • LY~LYY-1 EQUIVAlENCEIXX,YYI IS PERMITTED. HOWEVER NO PARTIAL CVERLAP OF XX ANO YV IS ALLOWED. MUST EXCEED ZERO SPECIFIES ACCURACY OF X AND Y. THESE WILL 8E FIXED SO AS TO HAVE INTEGER VALUES FROM -MXACC TO +MXACC DURING THE COMPUTATIONS. 0293 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 D047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 ........................... , • QCNVLV • PROGRAM LISTINGS 21 C C C C C C C C QCNVLV IPAGE MUST EXCEED ZERO AND BE LSTHN= 1000 LCC IS NUMBER OF TERMS DESIRED IN OUTPUT CONVOLUTION MUST EXCEED ZERO SPACEIII 1=1.2, ••• ,LSPACE MUST BE AVAILABLE FOR TEMPORARY USE WHERE LSPACE = LMIN + 10.(MXACC+11 + 1 LMIN = LXX OR LYY WHICHEVER IS SMALLER LMIN MUST NOT EXCEED 10000 C C C OUTPUTS C C XXIII C C YYIII C C C I-l ••• LXX WILL CONTAIN THE REFLOATED X SERIES I=l ••• LYY WILL CONTAIN THE REFLOATED Y SERIES tIN THE FIXING PROCESS ROUNDING IS USED RATHER THAN TRUNCATION SO THE REFLOATED SERIES SHOULD NOT SHOW SYSTEMATIC DISCREPANCIES FROM THE ORIGINALS) C C CCIII C C C C ClANS C C C C C C C 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 n092 I=I ••• LCC IS THE CONVOLUTION CIJ) J=O,l ••••• LC ,lC-LCC-l AS DEFINED IN THE ABSTRACT. AND AS COMPUTED eN THE FIXED VERSION OF THE X AND Y SERIES FOLLOWED BY FLOATING AND PROPER SCALING. 0 -2 = -3 -4 -5 = -6 =-99 NORMALLY IF LXX IS ILLEGAL IF YY PARTIALLY OVERLAPS XX IF LYY IS ILLEGAL OR IF LMIN EXCEEDS 10000 IF MXACC IS ILLEGAL IF LCC IS ILLEGAL IF UNEXPLAINED ERROR RETURN OCCURS FROM PROCOR FASCOR OR FASEPC C C EXAMPLES C C C C • •••••••••••••••••••••••• •••••••••••••••••••••••• IPAGE •••••••••••••••••••••••• • THE FIRST 5 EXAMPLES ARE CHOSEN TO ELIMINATE THE ROUNOOFF EFFECT. C INPUTS TO All EXAMPLES ARE ASSUMED THOSE OF EXAMPLE 1. C EXCEPT AS NOTED. C THE OUTPUT IANS IS EQUAL TO ZERO EXCEPT AS NOTIO. C C 1. COMPLETE CONVDLUTION OF XXll ••• 3) WITH YYI1 ••• 71 C INPUTS - XXC1 ••• 31=10.,20.,20. YY(1 ••• 7)=1 •• 10.,1.'1.,1 •• 1.,1. C USAGE CALL QCNVLV (XX,3,YY,7 p l0,9,SPACE.CC.IANSI CUTPUTS - XXC1 ••• 31 AND YYll ••• 71 SAME AS INPUT INO ROUNDOFF C C BECAUSE OF CHOICE OF XX YYJ CCt>1 •• ~91=10 •• 120.,230 •• 230 •• 50 •• 50 •• 50.,40.,20. C C (IN THIS CASE LMIN=3, MXACC=10, SO SPACEll} THRU SPACE C 11141 IS USED AS TEMPORARY) C C 2. REVERSED ORDER CONVOLUTION USAGE CALL QCNVLV IYY,7,XX.3.10.9,SPACE,CC.IANSI C C CUTPUTS - SAME AS EXAMPLE 1. II.E. ORDER OF INPUTS XX ANe YY C IMMATERIAL) C C 3. CONVOLUTION BEYOND END OF SERIES USAGE CALL QCNVLV IXX.3,YY,7.10.12,SPACE,CC,IANSI C C OUTPUTS - SAME A5 EXAMPLE 1. EXCEPT TERMINAL ZEROES ARE ADDEO TO CC, I.E. C C CC'1 •• 121=10.,120.,230.,230.,50.,50.,50.,40.,20 •• 0.,o.,0. C C 4. PARTIAL CONVOLUTION USAGE CAll QCNVLV (XX,3.YY,7.·10,3.SPACE,CC,lANSI C OUTPUTS - CCll ••• 31=10.,120.,230. C C C 5. COMPLETE AUTOCONVOLUTION USAGE CALL QCNVLV (XX,3,XX.3.10,5,SPACE,CC,IANSI C OUTPUTS - CCI1 ••• 51=100.,400.,800.,800.,400. C C C 6. PARTIAL AUTOCONVOLUTION SHOWING ROUNDOFF EFFECT WITH MXAaC~lOO INPUTS - xxtl •• ~31=14.75,9.41,-20.0 C USAGE CALL QCNVLV IXX,3,XX,3,100,2,SPACE,CC,IANS) C CUTPUTS - XXC1 ••• 31=14.80.9.40,-20.00 C 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 vivo 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 21 ......................... QCNVLV ••••••••••••••••••• * * ••• *- PROGRAM LISTINGS •••••••••••••••••••••••• • ~.* IPAGE3) QCNVLV CCl1 ••• 2'=219.04,278.24 C C C 1. THE NEXT 5 EXAMPLES SHOW ERROR CONDITIONS USAGE CALL QCNVLV IXX,0,YY,2,10,4,SPACE,CC.IANS) C C OUTPUTS - IANS=-2 IILLEGAL LXX) C C 8. USAGE C CALL QCNVLV IXX,10,XX(3),3.10.9.SPACE.CC.IANS) OR CALL QCNVLV (YYI2).3,YY,5,10,4.SPACE,CC,IANSl OUTPUTS - IANS=-3 IXX AND YY PARTIALLY OVERLAP) C C C 9. USAGE C OUTPUTS C C C10. C C C C11. C C C12. C C C C C C13. C C • •••••••• **.**IPAGE ••• * •• ** 3) CALL QCNVLV IXX,10,YY,-3,10,4.SPACE,CC,IANS) OR CALL QCNVLV (XX,10100,YY,15COO,10,SPACE) IANS=-4 IILLEGAL LYY OR LMIN) USAGE CALL QCNVLV IXX,10,YY,3,1500,4,SPACE,CC,IANSI OR tALL QCNVLV IXX,10,YY,3,0,4,SPACE,CC,IANS) OUTPUTS - IANS=-5 IILLEGAL MXACC) USAGE CALL QCNVLV IXX,10,YY,3,10,0,SPACE,CC,IANS) OUTPUTS - IANS=-6 SPECIAL CASE TEST - XX OR YY ALL ZERO INPUTS - SAME AS EXAMPLE 1. EXCEPT XXll ••• 3)=0.,0.,0. USAGE CALL QCNVLV IXX,3,YY,7,10,9,SPACE,CC.IANS) OR CALL QCNVLV IYY,7,XX,3,10,9,SPACE,CC,IANS) OUTPUTS - CCl1 ••• 91=0.,0., ••• SPECIAL CASE TEST - UNIT LENGTH XX USAGE CALL QCNVLV'{XX,1,yy,7,10,1,SPACE,CC.IANS) OUTPUTS - CCll ••• 7)=10.,100.,10.,10.,10.,10.,10. C C14. SPECIAL CASE TEST - LYY=LXX-1 (NO MIDDLE TERMS IN CONVOLUTlONt C USAGE CALL QCNVLV IXX,3,YY,2,10,4,SPACE,CC,IANSI C OUTPUTS - CCll ••• 4)=10.,120.,220.,200. C DIMENSION XX{21.YY(2),CCI2),CMI2),SPACEI21 COMMON CM C BRING IN LENGTHS, MXACC AND CHECK LX:LXX LY=LYY LC=LCC MAX=MXACC IANS=-2 IFILXI 9999,9999,30 30 IANS=-4 IFILY) 9999,9999,40 40 IANS=-5 IFIMAX) 9999,9999,50 50 IFIMAX-1000) 60,60,9999 60 IANS=-6 IFILCI 9999,9999,80 C FIND LONGEST, SHORTEST SERIES AND INDICES W.R.T. COMMON 80 LSHORT=XMINCFILX,LY) LLONG=XMAXOFILX.LY) LOCCM=XLOCF 1CM) IX=LOCCM-XLOCFIXX)+l IY=LOCCM-XLOCFIYY)+1 ISHORT=IX ILONG=IY IFILX-LY) 100,100,90 90 ISHORT=IY ILONG=IX C CHECK FOR OVERLAP 10NLY PERMIT IDENTITY, BUT PERMIT UNEQUAL LENGTMS IF C IDENTICAll 100 IANS=-3 IDIFF=IX-IY IFIIDIFFI 120,130,110 110 IFIIDIFF-LY) 9999,130,130 120 IFI-IDIFF-LX~ 9999,130,130 C CLEAR OUTPUT AREA~ FIX LONGEST AND IIF NOT IDENTICAL) SHORTeST~ C REVERSE SHORT~ST 130 I ANS=O 00 140 l=l,LC 140 CCII)=O.O CALL FXDATAILLONG,CMIILONG),MAX,SLONG) 0148 0149 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0112 0173 0174 0175 0176 0177 0178 0119 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 ...................... *••"...... QCNVlV •................ * .............. .* (PAGE PROGRAM LISTINGS •••••••••••••••••••••••• • • QCNV~V ••••••••••••••••••••• ** • 4) SSHORT:SlONG IFISlONG) 9999;9999,150 150 IFIIDIFFI 160,170,160 160 CAll FXDATA IlSHORT,CMIISHORT),MAX,SSHORTI IF ISSHORT) 910,910,170 170 ASSIGN 300 TO IREV GO TO 200 C INTERNAL SUBROUTINE TO REVERSE SHORTEST 200 lHAF:lSHORT/2 IFIlHAF) 230,230,210 210 DO 220 l=l,lHAF J=ISHORT+I-l K=ISHORT+lSHORT-1 TEMP:CM( J) CMIJl=CMIK) 220 CMIK)=TEMP 230 GO TO IREV,~300.704,910) C FIND NO. TERMS TO BE COMPUTED BY EACH OF THE THREE FASCOR,FASEPC,CAllS C NCl=lEFT TERMS 'FAStOR), NCM-MID TERMS IFASEPC), NCR-RIGHT TERMS C SET FIRST llC:ACTUAl NO. TERMS WHICH ~EED TO BE COMPUTED. 300 llC=XMINOFllC,lX+lY-l1 NCl:XMINOFlllC,lSHORT) NCM=O IFlllC-NCl) 320,320,310 310 NCM=XMINOFIllC-NCl,LlONG-NCl-l1 320 NCR:O IF INCl+NCM-llCl 330,700,700 330 NCR:lLC-llONG+l C SET UP PROGRAM FOR SHORTEST 700 IANS=-99 lSPACE=NCl+I0.IMAX+l)+1 INCl=ISHORT+LSHORT-NCL CALL PRnCnRICM' INr:I I.NrI .MAX.<;PArFII <;PAr:FI,<;PArF/ll!"""~1 C REREVERSE SHORTEST IF AUTOCONVOlUTION IF IIOIFF) 704,102,704 702 ASSIGN 704 TO IREV GO TO 200 704 IF IERRl) 900,110,900 C CONVOLVE UP TO DISTANCE OF SHORTEST 710 MINlAG=-NCl+l CALL FASCORICMlllONG),MINLAG,0,CCINCL1,ERR2) IFIERR2l 900,120,900 C CONVOLVE MIDDLE TERMS IF ANY 720 IFINCMI 140.740,130 130 ICCM=NCl+NCM MINLAG=-NCM+l IlONGM: ILONG+NCM CALL FASEPC~CMIllONGM),MINlAG.0,CCIICCM),ERR3) IFIERR3) 900,740,900 C CONVOLVE TAIL TERMS IF ANY 140 IFINCRl 760,760,150 750 ICCR=NCL+NCM+l MAXlAG=NCR-l IlONGR = IlONG+NCM+l CALL FASCORfCMIIlONGR),0,MAXLAG.CCIICCRI,ERR41 IFIERR4) 900,160,900 C FLOAT CONVOLUTION 760 I A"IS=O SCONV=SSHORT*SlONG CALL FlOATA'llC,CC,SCONV) C RE-REVERSE SHORTEST. REFLOAT LONGEST AND IMAYBE) SHORTEST C IBUT AVOID REREVERSE FOR AUTO-CONVOLUTIONl 900 IF IIDIFF) 902,910,902 902 ASSIGN 910 TO IREV GO TO 200 910 CAll FLDATAfllONG,CMIILONG),SlONG) IFIIDIFF) 920,9999,920 920 CAll FlDATAflSHORT,CMIISHORT),SSHORT) C EXIT 9999 RETURN END (PAGE 0223 0224 0225 0226 0221 022B 0229 0230 0231 0232 0233 0234 0235 0236 0237 023B 0239 0140 0~41 0242 0243 0244 0245 0246 0241 0248 0249 0250 0251 0252 0253 0254 l)~(~~ 0256 0251 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 026B 0269 0210 0211 0212 0273 0214 0215 0216 0217 027B 0279 0280 0281 02B2 02B3 0284 02B5 0286 0287 02B8 0289 0290 0291 0292 0293 41 •••••••••••••••• **** •••• QFURRY ••••••••••••••••••••••• *.* PROGRAM LISTINGS • •••••••••••••• *** •••••• • QFURRY * •••••••••••••• *** •••• *** • QFURRY (SUBROUTINE) 9/29/64 LAST CARD IN DECK IS NO. 0180 • LABEL 0001 CQFURRY 0002 SUBROUTINE QFURRYIX,LX,IXZER,M.JMIN,JMAX.SPACE.CSP.SSP,tANSl 0003 0004 C 0005 ----ABSTRACT---C 0006 C 0007 C TITLE - QFURRY 0008 C FAS. FOURIER TRANSFORM OF TRANSIENT WITH ARBITRARY TIME ORIGIN 0009 C QFURRY USES SUBROUTINE XSPECT TO OBTAIN A HIGH SPEED 0010 C FOURIER TRANSFORM OF THE TIME SERIES X(II, I=l~ •• lX, 0011 C 0012 BASED ON THE ASSUMPTION THAT THE INDEX I"IXlER IS TO C CORRESPOND TO THE lERO TIME ORIGIN, WHERE IXlER IS 0013 C 0014 ARBITRARILY SPECIFIED (IT MAY BE NEGATIVE). THE OUTPUTS C 0015 ARE THE REAL AND IMAGINARY PARTS OF THE FOURIER TRANSFORM C 0016 AND ARE EVALUATEO OVER AN ARBITRARILY SPECIFIED FREQUENCY C RANGE WITH AN ARBITRARY FREQUENCY INCREMENT. 0017 C 0018 C THE COMPUTATION IS AS FOLLOWS. THE ORIGINAL SIRlES 0019 C X(l) l"l ••• LX 0020 C 0021 UNDERGOES A TRANSLATION OF ORIGIN TO BECOME C 0022 C XT( I I 1= L,L+l, ••• ,N 0023 C 0024 WHERE C INOTE L AND POSSIBLY N 0025 C L" 1 - IXlER MAY BE NEGATIVE) 0026 C N " LX - IXlER 0027 C 0028 THE REAL AND IMAGINARY PARTS ARE THEN COMPUTED ON THE C 0029 TRANSLATED SERIES XTIII AS FOLLOWS C 0030 C 0031 N C SUM I XTI[)*COS(I*J*PI/MI 0032 CSI J) C 0033 I=L C 0034 C 0035 N C 0036 SseJI SUM' XTII)*SIN(I*J*PI/MI C 0037 I=L C 0038 C 0039 FOR J = JMIN,JMIN+l, ••• ,JMAX C 0040 WHERE C 0041 PI 3.14159265 C M, JMIN ANO JMAX ARE INPUT PARAMETERS 0042 C 0043 WITH THE RESTRAINT THAT C 0044 o LSTHN= JMIN LSTHN JMAX LSTHN= M C 0045 C 0046 A BLOCK OF TEMPORARY REGISTERS IS REQUIRED C 0047 OF LENGTH = LSPACE = 2*IM+KJ + 6 C 0048 WHERE C 0049 M IS DEFINED ABOVE C 0050 K = GREATEST DISTANCE FROM THE ZERO INDEX C TO THE TWO ENDS OF THE X SERIfSj 0051 C (J052 I.E. K = MAGNITUOE OF L OR N, AS C 0053 DEFINED ABOVE, WHICHEVER IS GREATER C 0054 C 0055 - FORTRAN II SUBROUTINE C LANGUAGE 0056 C EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0057 - 244 REGISTERS C STORAGE 005B - (CCNTRIDLLEO PRIMARILY BV SUBROUTINE XSPECTI C SPEED 0059 FOR M LSTHN= K - 36*IJMAX-JMIN+l)*M MACHINE CVCLES C 0060 FOR M GRTHN K - 72*'JMAX-JMIN+l)*M MACHINE CVClES C 0061 - S.M. SIMPSON JR., JUNE 1963 C AUTHOR 0062 C 0063 ----USAGE---C 0064 C 0065 C TRANSFER VECTOR CONTAINS ROUTINES - STl,MOVE,COSTBL,SINTBL,~SPECT 0066 AND FORTRAN SYSTEM ROUTINES - (NONE) C 0067 C 0068 C FORTRAN USAGE 0069 CALL QFURRV(X,lX,IXZER,M,JMIN.JMAX,SPACE,CSP,SSP,IANS) C 0070 C 0071 C INPUTS 0072 C 0073 I:I ••• lX LS THE INPUT TIME SERIES X I Il C 0074 C •••••••••••••••••••••••• • PROGRAM LISTINGS • QFURRY •••••••••••••••••••••••• IPAGE 2) C C C C C C C C C C C C C C C C C C C _.. _•..•..••............ -•.•..•..••.......•..... • QFURRY • IPAGE LX MUST EXCEED 1 [XZER [S THE ZERO TIME INDEX. AND MAY EXCEED LX. M CONTROLS THE FUNDAMENTAL FREQUENCY INCREMENT DESIRED AS SHOWN IN A8STRACT. MUST EXCEED ZERO. JM[N CONTROLS THE LOWEST MULTIPLE OF THE FUNDAMENTAL FREQUENCY INCREMENT DESIRED. AS SHOWN IN ABSTRACT. MUST BE NeN-NEGATIVE JMAX CONTROLS THE GREATEST MULTIPLE OF THE FUNDAMENTAL FREQUENCY INCREMENT DESIRED. AS SHOWN IN A8STRACT. MUST EXCEED JMIN AND 8E LESS THAN OR EQUAL TO M SPACEIIl I:l ••• lSPACE MUST 8E AVAILABLE FOR SCRATCH. WHERE LSP~CE IS DEFINED IN ARSTRACT. MAY BE POSITIVE OR NEGATIYE 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 C OOM C OUTPUTS C C CSPIIl l:t.2 ••••• JMAX-JMIN+1 CONTAINS CSIJI. J.JMIN ••••• JMAX. C AS DEFINED IN ABSTRACT. C C SSPIII I-l.2.~ •• JMAX-JMIN+1 CONTAINS SS(J). J=JMIN ••••• JMAX • C AS DEFINED IN ABSTRACT. C ClANS 0 NDRMALLY C s -1 IF LX IS ILLEGAL (NO OTHER OUTPUT IN THIS CASE) C -2 IF M IS ILLEGAL DITTO C a -3 IF JMIN OR JMAX IS ILLEGAL DITTO C C EXAMPLES C C 1. SIMPLE TIME SERIES WITH VARIOUS IXZER VALUES C INPUTS - Xll ••• 31 : 1.,1 •• 1. LX.3. M-10. JMN=O. JMX:2 C USAGE CALL QFURRYIX.LX.l.M.JMN.JMX.SPA,CSP1.SSPl,IANSl1 C CALL OFURRYIX,LX.2,M,JMN.JMX,SPA.CSP2,SS'2'IANS21 C tALL QFURRYIX.LX.3,M,JMN,JMX.SPA,CSP3,SSR3.IANS31 C CALL QFURRYIX.LX.0,M,JMN.JMX.SPA.CSP4.SSP4.IANS4) C CALL QFURRYIX,LX.4.M,JMN.JMX,SPA,CSP5.SSP5.IANS51 C OUTPUTS - IANSl=JANS2=IANS3:IANS4~IANS5=0 AND C CSP111 ••• 3)· 3.00000, 2.76008. 2.11804 C SSPlI1 ••• 3) 0.00000, 0.89681. 1.53885 C CSP211 ••• 3) = 3.00000. 2.90212. 2.61804 C SSP211 ••• 3) 0.00000, 0.00000. 0.00000 C CSP311 ••• 31 3.00000, 2.76008. 2.11804 C SSP311 ••• 3) 0.00000.-0.89681.-1.53885 C CSP411 ••• 3) = 3.00000, 2.34787, 0.80902 C SSP411 ••• 31 0.00000, 1.70583, 2.48991 C CSP511 ••• 31 = 3.00000, 2.34787, 0.80902 C SSP511 ••• 3) 0.00000.-1.70583.-2.48991 C C 2. ILLEGAL CONDITIONS C USAGE CALL QFURRYIX,l,1.2.0.2.SPACE,CSP.SSP.IANS11 C CALL QFURRYIX,3.1.0.0,2.SPACE,CSP.SSP.IANSZl C CALL QFURRYIX,3,l,2.-1,2.SPACE,CSP,SSP,IANS3) C CALL OFURRYIX,3,l,2,0.3.SPACE.CSP.SSP,IANS41 C OUTPUTS - IANS1 • -1 IILLEGAL LX) C IANS2 a -2 IILLEGAL M) C IANS3 '"' -3 (ILLEGAL JMINI C IANS4 a -3 (ILLEGAL JMAXI 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 = = C C PROGRAM FOLLOWS 8ELOW C C DUMMY DIMENSIONS DIMENSION X121. SPACEI21 C CHECK lX AND M IANS -1 IF ILX-11 9999,9999,10 10 IANS = -2 IF 1M) 9999.9999, 20 C MAKE SETTINGS FOR SINE AND COSINE TABLE AND START OF CORR. BLOCK 20 IXCSTB s 1 = 21 •••••••••••• ** •••••• ** •• • *••• ** QFURRY ••••••••••••••••••• (PAGE PROGRAM LISTINGS _•.•.•.•................ • QFURRY * •••••••••••••••••••• ** •• 31 IXSNTB = 1'1+2 IXCRNG = 2*1'1+3 C FORM MAGNITUDES OF LAND N, AND CHECK LARGEST MAGL = XABSF (' 1 - IXlER 1 MAGN = XABSF (LX-IXlERI IF (MAGN-MAGLI 120,100,100 C SET UP CONSTANTS FOR POSe BRANCH OF XTIII LONGEST 100 K = MAGN IXXMOV = IXCRNG + 2*K+l - LX GO TO 130 C SET UP CONSTANTS FOR NEG. BRANCH OF XTII) LONGEST 120 K = MAGL IXXMOV = IXCRNG C MAKE OTHER SETTINGS DEPENDENT ON K ALONE 130 IXXCOR. IXCRNG + K LCR = 2*K+l C CLEAR THE CORRELATION AREA, THEN MOVE IN THE X SERIES CALL STllLCR, SPACE (IXCRNG) CALL MOVE ILX,X,SPACE(IXXMOVII C NOW SET UP THE COSINE AND SINE TABLES CALL COSTBL I~, SPACEIIXCSTB) I CALL SINTBL 1M, SPACE IIXSNTBI ) C FINALLY USE XSPECT, CHECKING FOR ILLEGAL JMIN, JMAX IANS '" -3 CALL XSPECT (SPACE IIXXCORI, K, SPACE (IXCSTBI, SPACE (JXSNTBJ, 1 1'1, JMIN, JMAX, CSP, SSP, SPACE {IXXCOR}, ERR) IF (ERR) 9999,711,9999 111 IANS '" 0 C EXIT 9999 RETURN END (PAGE 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0180 31 •• ** •••••••••••••••••••• •••••••••••••••••••• ** •• PROGRAM LISTINGS Q[FURY •••••••••••••••••••• • ** ••• • QIFURY • •••••••••••••••••••••••• * Q[FURY (SUBROUTINE) 9/29/64 LAST CARD IN mECK IS NO. 0205 • LABEL 0001 CQIFURY 0002 SUBROUTINE QIFURYIFTREAL,FTIMAJ,MFREQ,LX,IXlER,SPACE,X,tANSI 0003 C 0004 C ----ABSTRACT---0005 C 0006 C TITLE - QIFURY 0007 QUICK INVERSE FOURIER TRANSFORM WITH ARBITRARY TIME QRIGIN OOOB C C 0009 C QIFURY USES SUBROUTINE COSISP TO OBTAIN A TIME SERIES 0010 C XII), l=l ••• LX , HAVING [TS T[ME ORIG[N AT ARB)TRARY 0011 INDEX IXlER, FROM THE REAL ANO [MAGINARY PARTS OF HIE 0012 C C FOURIER TRANSFORM OF X. THE INPUT FOURIER TRANSFORM 0013 C IS GIVEN BY 0014 C FTREALIl ••• MFREQ+11 : FTRIO ••• MFREQJ 0015 C ANO FT[MAJll ••• MFREQ+1) = FT[IO ••• MFREQ) 0016 C WHERE 0017 C FTRIJI REAL PART OF FOURIER TRANSFORM EVILUATED 0018 C AT ANGULAR FREQUENCY W = J*PI/MFREQ 0019 C FTIIJI [MAGINARY PART OF FOURIER TRANSFORM 0020 C EVALUATED AT THE SAME FREQUENCY. 0021 C 0022 C THE COMPUTATION [S 0023 C 002~ C Xll ••• lXI XTIL,L+l, ••• NI 0025 C WHERE L 1 - IXlER 0026 C N : LX - IXlER 0027 C 0028 C WHERE 0029 C W=+PI 0030 C XTII) [NTEGRAL FTRIWI.COSII*WI + 0031 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 FTIIW)*SINII-Wl } OW WHERE THE [NTEGRAL [S PERFORMED BY TRAPEZOIDAL APPROXIMATION AND ASSUMES FTR AND FTI ARE EWEN AND ODD FUNCTIONS. A BLOCK OF 4-IMFREQ+l1 TEMPORARY REGISTERS IS REQUiRED. QIFURY IS AN APPROXIMATE [NVERSE OPERATOR TO QFURRY~ THE INVERSE IS EXACT IF QFURRY ANO QIFURY WERE CALLED WITH THE SAME MFREQ AND IXlER PROV[DED THE COMPLETE SPECTRUM IJMIN=O JMAX=MFREQ) WAS COMP~TED BY QFURRY ANO THAT LX WAS LSTHN= 2*MFREQ-l. EXG:EPT THAT THE OUTPUT FROM QIFURY IS PERIODIC WITH PERIOD 2*MFREQ LANGUAGE EQUIPMENT STORAGE SPEED AUTHOR - FORTRAN-II SURROUTINE - 709 OR 7090 (MA[N FRAME ONLY) - 280 REGISTERS 7090 709 ABOUT 165 OR 72).IMFREQ+l}-IMFREQ+11 FOR LARGE MFREQ - S.M. SIMPSON. AUGUST 1963 MACHINE CYCLES ----USAGE---TRANSFER VECTOR CONTAINS ROUTINES - COSTBL. SINTBL,Cosisp AND FORTRAN SYSTEM ROUTINES - XLOC FORTRAN USAGE CALL QIFURYtFTRfAL,FTIMAJ,MFREQ.LX,IXlER,SPACE.X.JANSI INPUTS FTREAL(I) 1=1 ••• MFREQ+1 IS THE REAL PART OF THE FOURIER TRANSFROM FTIMAJIII I=l ••• MFREQ+l TRANSFORM IS THE IMAGINARY PART OF THE FOURIER MFREQ SHOULD EXCEED 0 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 004~ 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0061 0068 0069 0070 0071 0072 0073 • ** ••••••••••••••••••••• •••••••••••••••••••••••• PROGRAM LISTINGS QIFURY • • ••• * ••••• * ••• ••• * •••••• • (PAGE 2) C C C ° LX SHOULD EXCEED IXZER SPECIFJES THE ZERO TIME INDEX OF XII). MAt BE ANY VALUE, POSITIVE OR NEGATIVE IMAY EXlEED LX1 SPACE (I I l=l ••• LSPACE MUST BE AVAILABLE FOR SCRATCH, WHERE LSPACE 4*M + 4 C C C C QIFURY = C C OUTPUTS C X( I ) C C C C C C C C C STRAIGHT RETURN WITH NO OUTPUTS IF LX OR MFRE~ tSTHN 1 I"l ••• LX IS THE INVERSE TRANSFORM DETERMINED AS FOLLOWS. LET PI=3.14159265 M"HFREQ stJ) FTREALIJ+1) FOR J " 0, 1, ••• ,M-l SIMI FTREALIM+11/2 -1.-2, _•• ,-M StJI SI-JI FOR J A(JI FTIMAJIJ+1) FOR J 0., l,.l. •• M -1,-2, ••• ,-M AIJI -AI-Jl FOR J THE TRAPEZOIDAL APPROXIMATION USED FOR COMPUTING XII) IS THEN GIVEN BY C C C M C SUM I S(JI J"-M X(I) C C C * PI COS(J.II-IXZER)--~-l + M PI C C AIJI • SIN(J.(I-IXZER).-~-) M C C FOR C I " 1,2 •••• ,LX C EQUIVAlENCEIX,FTREAL OR FTIMAJI IS PERMITTED C C C IANS C C C C EXAMPLES C C 1. INPUTS C USAGE C C C C C C C C C C C C ° -2 -1 " NORMAllY MEANS ILLEGAL MFREQ MEANS ILLEGAL LX - FTRl1 ••• 51 B., 0., -4., 0.,-16. FTIIl.4.51 0., 0., 4., 0., 0. M=4 CALL QIFURYIFTR,FTI,M, 8, l'SPACE,X1' IANSII CALL QIFURYIFTR,FTI,M,16, 1,SPACE,X2. IANS2) CALL QIFURYIFTR,FTI,M, B, 2,SPACE,X3. IANS3t CALL QIFURYIFTR,FTI,M, 8,-5,SPACE,X4. IANS4) CALL QIFURYIFTR,FTI,M, 4,27.SPACE,FTR,IANS51 CALL QIFURYIFTR,FTI,O, B, 1,SPACE, X6,IANS61 CALL QIFURYIFTR,FTI,M,-l, 1,SPACE,X7. IANS71 OUTPUTS - IANS1"IANS2= ••• =IANS5 ,,0, IANS6" -1 IANSI = -2 X111 •• J8) = -2., 4., 0., 2., -2., 4., 0., 2. X211 ••• BI XIIl ••• B) AND X219 ••• 16'=X111 ••• 8' X3f1 •• ~BI " 2., -2., 4., 0., 2., -2., 4., O. X4tl ••• B) " 0., 2., -2., 4., 0., 2., -2., 4. FTRl1.J.41 " 0., 2., -2., 4. = C C C 2. FOURIER TRANSFORM BY INPUTS -XII ••• SI" C USAGE CAll C CAll C QFURRY WITH INVERSION BY QIFURY -2.,4.,0.,2.,-2.,4.,0.,2. QFURRYIX,B,1,4,O,4,SPACE,FTRl,FTll,)ANS81 QIFURY(FTRl,FTll,4,B,1,SPACE,X5.IANS9) C CALL QFURRYIX,8,1,6,O,6,SPACE,FTR2,FTI2,)ANSI01 CALL QIFURYIFTR2,FTI2,6,11,l,SPACE,X6,IANSlll C C C C C C C C C OUTPUTS - • •••••••••••••••••••••••• IPAGE 21 ~ IANS8 " IANS9 " IANS10 =,IANSll " 0 X5(1 ••• 6) = -2.,4.,0.,2.,-2.,4.,0.,2. X611 ••• 111 = -2.,4.,0.,2.,-2.,4.,0.,2.,0.,0.,0. (NOTE WE NEED TO DIMENSION FTR1(5),FTI115),FTR2t1J. FTJ2(7) I C PROGRAM FOLLOWS BELOW C C DUMMY DIMENSIONS DIMENSION SPACE(2),XI21,FTREALI2),FTIHAJI21 C BRING IN AND TEST MFREQ , LX 0074 0075 0076 0071 0078 0079 0060 OOBI 0082 0083 00B4 0085 0086 0081 0088, 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 010B 0109 0110 0111 0112 0113 0114 0115 0116 0117 OUB 0119 0120 0121 0122 0123 0124 0125 0126 0127 012B 0129 0130 0131 0132 0133 0134 0135 0136 0137 013B 0139 0140 0141 0142 0143 0144 0145 0146 0147 014B .....-..........•...•.•. • QIFURY ••••••••••••••••••••••••* IPAGE 3l PROGRAM LI STINGS •••••••••••••••••••••••• QIFURY • • •••••••••••••••••••••••• M=MFREQ NX=LX IANS=-l IF 1M) 9999,9999,10 10 IANS=-2 IF INXI 9999,9999,20 C OK, END ADJUST FTREAL. I THE ENOS OF FTIMAJ SHOULD 8E ZERO! 20 IANS=O FTREALll)=FTREALll) 12.0 FTREAlIM+1)=FTREALIM+1) 12.0 C NOW COMPUTE THE TWO PARTS OF THE INVERSE TRANSFORM C INTO SPACE II) AND SPACE (M+2) WITH TA8LES IN SPACE (2M*3) AND C SPACE (3M+41 ISANT=M+2 ISCTA8=ISANT+M+l ISSTA8=ISCTAB+M+L CALL COST8LtM,SPACE IISCTAB)I CALL SINTBL(M, SPACE IISSTAB) CALL COSISP IFTREAL,FTREAL,FTIMAJ,FTIMAJ.M,SPACEIISCTA8). 1 SPACEI ISSTA8),M.0,M,I.0,SPACEI1l,SPACEI ISANTll C THE STARTING INDEX FOR XT IS XTIlI=XTII-IXZER). C WE HAVE TO FINO l AND PUT IT • INCREMENTING 8Y 2M • IN THE ~ INCLUSIVE RANGE -M*1.-M+2, ••• ,0 •••• M. THIS MOOIFIEO C VALUE OF l WILL BE CALLED INEXT. START 8Y MUDUlO 2.M MOUBl=M+M L=l-IXZER INEXT = XMODF Il,MDU8L) C THE MOO FUNCTION PUTS INEXT IN -2M+l, ••• ,2M-1 IF (INEXT-MI 50.50,40 40 INEXT=INEXT-MOU8L GO TO 10 50 IF IINEXT+M) 60,60,70 60 INEXI=lNtXI+MUUHL FM:FLOATFIM) 70 C LOOP TO FORM Xlt ••• lX) DO 120 IX s 1,NX C REOUCE INEXT BY 2*M WHENEVER IT INCREMENTS BEYOND M IF IINEXT-MI 90,90.80 80 INEXT=INEXT-MDU8L C INEXT IS NOW IN LEGAL RANGE 90 MAGI=XABSFIINEXTI IANT=MAGI+ISANT TEMP= SPACELIANTI C REVERSE SIGN OF TEMP FOR NEGATIVE INEXT IF IINEXT) 100,L10.11Q LOO TEMP= -TEMP C Sf ORE X AND INCREMENT INEXT 110 XIIX)= ISPACEIMAGI+1)+TEMP)/FM INEXT = INEXT+l 120 CONTINUE C RESCALE FTREAL UNLESS IT IS EQUIVALENT TO X 130,9999.130 IF IXlOCFIFTREAL) - XLOCFIX) 130 FTREALlll= FTREAl(1)*2.0 FTREALIM+11=FTREALIM+11*2.0 C EXIT 9999 RETURN END IPAGE 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0170 0111 0112 0113 0174 0115 0116 0111 0118 0119 0180 0182 0183 0184 0185 0186 0181 0188 0189 0190 0191 0192 0193 0194 0195 0196 0191 0198 0199 0200 0201 0202 0203 0204 0205 31 •••••••••••••••••••••••• ... QINTRI • _..... ................ .• , PROGRAM LISTINGS ........................ •••••••••••••••• ** •••••• • QINTRI • QINTRI ISUBROUTlNE) 9/4/64 LAST CARD IN DECK IS NO. • LABEL CQINTRI SUBROUTINE QINTRI IX,XLO,DELX,TABLE,NTABLE,YOFX) C C C ----ABSTRACT---C C TITLE - QINTRI C QUADRATIC INTERPOLATION IN A TABLE C C QINTRl USES QUFITI TO INTERPOLATE FOR A VALUE, WHICH LiES C AMONG THREE SUCCESSIVE TABULATED VALUES, BY FITTING A C PARABOLA. LINEAR INTERPOLATION OCCURS IF THERE ARE ONLY C TWO TABLE VALUES. XLO IS THE ARGUMENT CORRESPONDING TO C THE LOWEST TABLE VALUE. DELX IS THE ARGUMENT DIFFERENCE C BETWEEN TABLE VALUES. THE FORMULA C C YOFX = COEFSll)+COEFSI2)*XREL+COEFSI3)*XREL.*Z C C IS USED TO FIND THE INTERPOLATED VALUE, WHERE C YOFX IS THE INTERPOLATED VALUE, C (OEFSI1 ••• 3) ARE COEFFICIENTS COMPUTED BY QUFITl, C 8ASED ON THREE TABLE VALUES CHOSEN BY QINTRl, C XREL IS A FRACTIONAL ARGUMENT VALUE RELATIVE TO C THE MIDDLE CHOSEN TABLE VALUE. C C C LANGUAGE - FORTRAN II SUBROUTINE C EQUIPMENT - 709/7090/7094 IMAIN FRAME ONLY) C STORAGE - 229 REGISTERS C SPEED - ABOUT .6 TO .7 MILLISECONDS ON THE 7094. C AUTHOR - J. PROCITO, MAY 1964 C C C ----USAGE---C C TRANSFER VECTOR CONTAINS ROUTINES - RNDUP. QUFITl C AND FORTRAN SYSTEM ROUTINES - (NOT ANY) C C FORTRAN USAGE C CALL QINTRl(X,XLD,DELX,TABLE,NTABLE,YOFX) C C C INPUTS C C X IS THE ARGUMENT FOR WHICH INTERPOLATION IS DES.RED C SHOULD BE GRTHN= XLO AND LSTHN= XLO+(NTABLE-1).DELX C C XLO IS THE ARGUMENT CORRESPONOING TO THE FIRST TAB~E ENTRY C C DELX IS THE ARGUMENT DIFFERENCE BETWEEN TABLE ENTRIES C MUST EXCEED ZERO C C TABLEII) I=l ••• NTABLE IS THE TABLE OF VALUES TO BE USED FOR C INTERPOLATING C C NTABLE IS LENGTH OF TABLE C MUST BE GRTHN= 2 C C C OUTPUTS STRAIGHT RETURN If DELX OR NT ABLE ILLEGAL. C C YOFX THE INTERPOLATED VALUE DESIRED CORRESPONDING TO X. C EXCEPT = 0.0 IF X IS ILLEGAL. C C C EXAMPLES C C 1. INPUTS - TABLEll) = 1. ~TABLE=l X=2. XLO=O. DELX=l. YOFX=-99. C OUTPUTS - YOFX=-99. C C 2. INPUTS - TABLEI1 ••• 21 0.,12. NTABLE=2 X=I.5 XLO=l. DELX=l. C OUTPUTS - YOFX=6.0 C • 0191 0001 0002 0003 0004 0005 0006 0001 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 ()034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 005B 0059 0060 0061 0062 0063 0064 0065 0066 0067 006B 0069 0010 0071 0072 0073 0074 •••••••••••••••••••••• ** -• ..•...•.•.•............ QINTRl • PROGRAM LI STINGS ••••••••••••••••••••••••- • QINTR1 (PAGE •••••••••••••••••••••••• (PAGE 21 2) C 3. INPUTS C C - TABLEII ••• 3) DELX=l. OUTPUTS - YOFX=8. C C 4. INPUTS - TABLEll ••• 4) C OELX=I. C OUTPUTS - YOFX=1.8 NTA8LE=3 0.,6.,12.,18, X=2.333 NTA8LE=4 X=2.3 XLo .. r. C C 5. INPUTS - SAME AS EXAMPLE 4. EXCEPT X=2.8 C OUTPUTS - YOFX=10.8 C C 6. INPUTS - TABLEl1 ••• 41 = 0.,3.333,6.661,10. REST .. El(. 4. C OUTPUTS - YOFX=I.3333 C C 1. INPUTS - TABLEll ••• 81= 0.,3.333.6.6661,10.,13.333.16.661,20.,23.33 C NTABLE=8 X.. 6.1 XLO=I. DELX=2. C OUTPUTS - YOFX=9.5 C C 8. INPUTS - SAME AS EXAMPLE 1. EXCEPT X=4. C OUTPUTS - YOFX=5.0 C C 9. INPUTS - SAME AS EXAMPLE 1. EXCEPT x=o. C OUTPUTS - YOFX=O. C C10. INPUTS - SAME AS EXAMPLE 1. EXCEPT X=1. C OUTPUTS - YOFX=10.0 C Cl1. INPUTS - SAME AS EXAMPLE 1. EXCEPT DELX=l. C OUTPUTS - YOFX=10.0 X=4. C C12. INPUTS - SAME AS EXAMPLE 11. EXCEPT XLO=2. C OUTPUTS - YOFX=6.6661 C13. INPUTS - SAME AS EXAMPLE 12. EXCEPT X=2.3 C OUTPUTS - YOFX=I.0 C C14. INPUTS - SAME AS EXAMPLE 12. EXCEPT X=2.8 C OUTPUTS - YOFX=2.666 C CIS. INPUTS - SAME AS EXAMPLE 12. EXCEPT X=I.4 C OUTPUTS - YOFX=O. C C PROGRAM FOLLOWS BELOW C DIMENSION TABLE(3),COEFSI3) C C CHECK FOR ILLEGAL NTABLE, DELX. C IF (NTABLE-11 9991,999~,1 1 IF IDELX) 9991.9991,2 2 IF IX-XLOJ 999,5,5 C C COMPUTE ILO,IHI.XREL IXREL= X VALUE RELATIVE TO ILO, IHII C 5 XREL=(X-XLOI/DELX+l. ILO=XREl IHI= RNDUPFIXRELJ IF IIHI-NTABLE) 1,1,999 C C BEGIN CHECKS FOR UPPER AND LOWER LIMITS. C 1 IF IIHI-ILOI 9991,200,10 10 IF IIlO-l1 999,20,40 C C ILO = 1 . NOW BRANCH ON TABLE LENGTH. C 20 IF INTABLE-21 9991,30,50 C C NTABLE = 2. SINCE THERE ARE ONLY 2 POINTS, INTERPOLATE LINEARLY, EXIT. C 30 YOFX=TABLElll+I{X-XLO)-(TABLEI2J-TABLEll})I/DELX GO TO 9991 C C ILO GRTHN 1, NOW CHECK IHI. C 0015 0016 0011 0018 0019 0080 0081 00B2 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 .................. _* .... • PROGRAM LISTINGS QINTRI * •••••••••••••••••••••••• (PAGE 3) IPAGE 40 IF IIH1-NTA8lEI 10.60,999 C C NTA8lE IS GRTHN 2 AND IlO = I, SO SET IMID C 50 IMIO=2 GO TO 90 c C IHI = NTABlE. IlO GRTHN I, SO IMID C 60 IMID=NTABLE-l GO TO 90 •••••••••••••••••••••••• • QINTRI • •••••••••••••••••••••••• 2 AND FIT PARABOLA NTABlE-l C C TEST FRACTIONAL PART OF X VALUE AND FINO our WHETHER IT IS 4l05ER TO C ILO OR IHI. SET IMID = TO THE INOEX THE VALUE IS CLOSESt TO. C 10 15 XFRAC=XREl-FLOATFIIlO) IF (XFRAC-.5J 75,80,80 IMID=IlO GO TO 90 IMID=IHI 80 C C FINO COEFFICIENTS FOR EQUATION C 90 CAll QUFITltTABlEIIMID-1),-1.,l.,COEFSI C C COMPUTE YOFX WITH COEFS AND XREl C XREl=XREL-FLOATFIIMID) YOFX=COEFS(11+CDEFS(2J*XREL+COEFS(3J*XREL*XREl GO TO 9991 c C IF IlO=IHI YOFX~TA8LEIILO) C 200 300 IF IIlD-NTA8LEI 300.300,999 YOFX=TABlElllOI GO TO 9991 C C All X VALUES OUT OF TABLE RANGE =0.0 C 999 YOFX=O.O 9991 RETURN END 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0114 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 01<)0 0191 31 •••••••••••••••••••••••• ••••••••• ••••• *** •••• **- • PROGRAM LISTINGS QUFITI ~ 9/4/64 • QUFITl ISUBROUTINEI • FAP -QUF I 11 COUNT 200 QUf ITl LBL ENTRY QUfITl IfOfX,XLO,DELX,COEFS) • • • • • • -... • • • .. .. .. • ..... • • .. .. • .. .. •. .. • - • • • • ---• . . • • • • ..• • ..• • • • • • • .. .• .. •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0199 0001 0002 0003 0004 0005 0006 0001 ----ABSTRACT---0008 0009 0010 TITLE - QUFIT1 FINO QUADRATIC WHICH EXACTLY FITS 3 EQUALLY SPACEO POINTS 0011 0012 QUFITl FINDS CO,CI, AND C2 SUCH THAT THE QUADRAT IE 0013 POLYNOMIAL 0014 0015 2 FIX) 0016 CO+C1-X+C2.X 0017 TAKES ON SPECIFIED VALUES AT X=XLO,XLO+DELX, AND OOlB XLO+2*DELX, WHERE XLO AND DELX ARE PARAMETERS. 0019 0020 QUFITI HAS A HIGH SPEED AUTOMATIC BYPASS FOR THE CASE 0021 0022 THAT XLO=-l.O AND DELX=l.O 0023 - FAP SUBROUTINE IFORTRAN-II COMPATIBLE) 0024 LANGUAGE EQUI PMENT 109 OR 1090 (MAIN FRAME ONLY) 0025 STORAGE - 19 REGISTERS 0026 SPEED - ABOUT 250 MACHINE CYCLES IN GENERAL (ON THE 70901 0021 19 MACHINE CYCLES IF XLO=-1.0, AND DELX#I~O 0028 AUTHOR - S.M.SIMPSON, MARCH 1964 0029 0030 0031 ---USAGE---0032 0033 TRANSFER VECTOR CONTAINS ROUTINES - INOT ANY) 0034 AND FORTRAN SYSTEM ROUTINES - INOT ANY) 0035 0036 FORTRAN USAGE 0037 CALL QUFlTlCFOFX,XLO,DELX,COEFS) 0038 0039 0040 INPUTS 0041 0042 FOFXIIJ 1=1,2,3 ARE THE VALUES WHICH THE POLYNOMIAL MUST ASSUME. 0043 0044 XLO IS STARTING VALUE OF ARGUMENT X. 0045 0046 DELX 0041 IS ARGUMENT INCREMENT. IF DELX=O.O QUFITI COMPUTES AND EXITS AS T~OUGH 004B 0049 USER HAD SPECIFIED XLO=-l.O ITHE ACTUAL ~LO IS NOT USED) AND DELX=l.O. THIS CASE TAKES 79 MACHINE 0050 CYCLES. IF DElX AND XLO ARE ACTUALLY SPHCIFIEO TO 0051 BE 1.0 AND -1.0 RESPECTIVELY, ABOUT 91 MACHINE 0052 CYCLES ARE TAKEN. 0053 0054 0055 0056 OUTPUTS 0051 COEFSI Il 1=1,2,3 WILL CONTAIN CO,Cl, AND C2, RESPECTIVILY' SUCH 0058 THAT THE POLYNOMIAL FIX) GIVEN IN THE ABSTFACT WILL 0059 SATISFY 0060 FIXLO) FOFXIl) 0061 FOFX(2) FIXLO+DElX) 0062 FIXLO+2.0ELX) FOFX(3) 0063 0064 0065 0066 EXAMPLES 0067 1. INPUTS - FOFXIl ••• 31 = 2.0,3.0,6.0 XLO=-l.O, DELX=l.O 006B 0069 USAGE CALL QUFITIIFOFX,XLO,DELX,COEFSl) 0070 CALL QUFITIIFOFX,3.0, 0.0,COEFS2) OUTPUTS - COEFS111 ••• 3) = COEFS211 ••• 3) = 3.0,2.0,1.0 0071 0012 0073 2. INPUTS - FOFX(1 ••• 3) = 3.0,3.0,11.0 XLO=-2.0, DELX=2.0 0014 USAGE CALL QUFITIIFOFX,XLO,DELX,COEFS3) -•• • • • • •••••••••••••••••••••••• QUFITl • • •••••••••• -* •••••••••••• • PROGRAM LISTINGS • QUFITl • 2) * * • * • • •• • • * • OUTPUTS - COEFS3Ll ••• 3) - 3.0,2.0,1.0 3. INPUTS - FOFXIl ••• 3) - 1.0,2.0,3.0 XLO-l.O, DELX-l.O USAGE CALL QUFIT1IFOFX,XLO,DELX,COEFS41 OUTPUTS - COEFS4(1 ••• 3) - 0.0,1.0,0.0 PROGRAM FOLLOWS BELOW NO TRANSFER VECTOR HTR BCI • 0 1,QUf ITl XR4 • ONLY ENTRY. QUfITl{FOFX,XLO,DELX,COEFS) QUf 1T1 SXD CLA SUB STA SU8 STA CLA SUB STA SUS STA QUFITl-2,4 1,4 AIFOfX) Kl CLAf2 K1 CLAF3 4,4 A(COEFSI K1 STOC1 K1 STOC2 • •* •• TRIAL SETTINGS COEfSel) - CO "FOFXI21. •CLAF2 • * COEfS(21 •CLAF3 • CLA fSS· TMI SUB TRA ADD STOCI STO * COEFS(3) • *. CLA STO. TMI ADD TRA SUS STO CLA. FSB FAD· TMI SUB TRA ADD STOC2 STO AND FORM 2CO • .*"AlfOFX)-l 4,4 .+3 KDUBL ·+2 KDUBL TWOCZ = Cl " •• -AIFOFXI-2 1,4 *+3 KDUBL ·+2 KDUBL ••-AICOEfS)-1 ** C2 - (fOfX(31-Z.FOFXI2)+FOFXll)1/2.0 CLAF3 TWOCZ l,4 *+3 KDUBL 'H2 KDUBL ** • CLA. TZE 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0111 0112 0113 0114 Oll5 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 **=A ICOEFS )-2 * • QUIT If DElX-O • • OUO IFOFX(31-FOfXI111/2.0 •• QUFITI •••••••••••• * ••••••••••• (PAGE 2) •••••••••••••••••••••••• (PAGE •••••••••••••••••••••••• 3,4 5,4 • ALL DONE IF DELX-l.O ANO XLD--I.O * CAS K1L FAIL TRA REVISE MAYBE TRA *+2 FAIL TRA REVISE 2,4 XLO CHECK CLS* K1L CAS 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 •••••••••••••••••••••••• • PROGRAM LI S rINGS • QUFITI •••••••••••••••••••••••• (PAGE (PAGE 3) TRA TRA • REVISE 5,4 0150 01-51 EXIT 0152 • FOR REVISION SET G = -(XLO/DELX + II AND CO (G**21*C2+G*Cl+CO • C1 (2*G*C2 +C11/DELX • C2 C2/(DELX**2) • • REVISE CLASTO FOP* XCA FOP. STO* CLA* STO CLS* FOP* XCA fSB SID FAD XCA FMP FAD FDP* SIO* LDO FMP FAD XCA STOC2 C2 3,4 3,4 STOC2 STOCI Cl 0151 0154 0155 0156 0157 0158 0159 0160 0161 C2 (PUT ASIDE) C2IOELX 0162 IDELX AGAIN = C2 2,4 3,4 -XLO -XLO/OELX K1L - (XLO/DELX+l.O I G G 2G C2 Cl 3,4 STOCI C2 0178 0179 0180 0181 G Cl 0183 0184 0185 0186 0187 0188 0189 0190 0191 * EXIT • TRA 5,4 • CONSTANTS, TEMPORARIES * K1 KIL KDUBL IWOCZ G C2 C1 PIE DEC OCT PZE PIE PIE PIE END 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 * * •••••••••••••••••••••••• QUFITI * •••••••••••••••••••••••• • 1 0192 1.0 001000000000 0193 0194 0195 0196 0197 0198 0199 --, .. , ... ··t··t.· ··t··,.· ..... ,'. 2*CO -(XLO/OELX + TRIAL C2 TRIAL Cl 1) 3) ....•...•-............•. PROGRAM LISTINGS QXCORR ••••••••• _ •••••••••••••• ** •••••••••••••••••••••••• QXCORR • • • ••••••••••••••••••• ** •• • QXCORR ISUBROUTINE) 9/29/64 LAST CARD IN DECK IS NO. 0248 • LABEL 0001 0002 CQXCORR SUBROUTINE QXCORR (X.Y,LXY,MXACC,MXLAG,SPACE,XCOR,IANS) 0003 0004 C -~--ABSTRACT---C 0005 0006 C C TI TLE - QXCORR 0001 C FAST CROSS-CORRELATIONS FOR LONG, LIMITED ACCURACY SERIES 0008 D009 C QXCORR COMPUTES THE UNNORMALIZED CROSS-CORRELATION 0010 C fUNCTION, XCILI, OF TWO LIMIT~D A~CUKACY SERIES. Xli~ 0011 C ANO YIII BOTH OF LENGTH LXY, ACCORDING TO THE TRANS~ENT 0012 C oon C FORMULA 0014 C 0015 LXY C XCI Ll SUM , XIII·YI!,+Ll ) 0016 C LXY 1= 1 0017 C 001B C FOR L = -MXLAG,-MXLAG+l •••• ,-l,O,l, ••• ,MXLAG 0019 C 0020 C WHERE YIK) IS ASSUMED" 0.0 WHENEVER K IS 0021 C OUTSIDE OF THE RANGE 1 TO LXY 0022 C MXLAG AND LXY ARE INPUT PARAMETERS 0023 C 0024 C SPEED IS CONTROLLED BY THt SERIES LENGTH AND TH~ 0025 C SERIES ACCURACY. FOR VERY LONG SERIES A COMPLETE CROSS0026 C 0021 CORRELATION IMXLAG = LXY-l1 CAN 8E COMPUTED IN SLIGHTLY C MORE THAN 2*ILXYISQUAREDII MACHINE CYCLES. QXCORR OBTAINS 0028 C THIS SPEED PRIMARILY BY CDNVERTING XIII AND YI11 TO 0029 C 0030 INTEGER SEQUENCES IXIII AND IYIII WHOSE MAGNITUDES HAVE C UPPER LIMIT AS SPECIFIED BY AN INPUT PARAMETER ~XACC, ANO 0031 C 0032 THEN REGROUPS THE A80VE EQUATION IFOR EACH LAGI SO AS TO C 0033 PERFORM 2*ILXY-LI-l ADDITIONS PLUS MXACC lOR FEWER) MULTIC 0034 PLICATIONS (RATHER THAN 2*ILXY-L)-1 ADDITIONS PLUS C 0035 2*(LXY-LI-l MULTIPLICATIONSJ.ISEE SUBROUTINE PROCOR-FASCOR C FOR LOGIC DETAILS.) THE RESULTS ARE THEN RECONVERTED TO 0036 C FLOATING POINT FORM WITH CORRECT SCALE. IXII) AND IYII) 0037 C 0038 ARE ALSO REFLOATED. C 0039 C 0040 USER MUST PRDVIDE QXCORR WITH A BLOCK Of TEMPORARY C 0041 REGISTERS OF LENGTH LXY + 10*(MXACC+1I + 1 C 0042 C XCI} AND YII) ARE LEFT SLIGHTLY MODIFIED BY THE FIXfNG. 0043 C 0044 REFlOATING PROCESS C 0045 C D046 IF QXCORR DETECTS THAT THE X AND Y SERIES ARE THE SAME C 0041 IT COMPUTES AND STORES XCILI DNLY FOR POSITIVE LAGS SO C OD48 THAT CXCORR CAN BE USED FOR EFFICIENT AUTOCDRRELATIONS C 0049 AS WELL AS CROSS-CORRELATIONS. C 0050 C 0051 C LANGUAGE - fORTRAN II SUBROUTINE 0052 C EQUIPMENT - IBM 109, 1090 IMAIN FRAME ONLYI 0053 C STORAGE - 283 REGISTERS 0054 - FOR LONG SERIES QXCORR TAKES ABOUT C SPEED 0055 12*MXLAG+1I*12*LX-MXLAG+20*MXACCI MACHINE CYCLES C 0056 IDIVIOE THIS BY 2 IF X AND Y ARE EQUIVALENT} C 0051 - S. M. SIMPSON JR. 10/10/62 C AUTHOR 0058 C 0059 C ----USAGE---D060 C FXDATA, PROCOR, FASCOR, FLDATA 0061 C TRANSFER VECTOR CONTAINS ROUTINES 0062 AND FORTRAN SYSTEM ROUTINES XLOC C 0063 C 0064 C fORTRAN USAGE CALL QXCORRIX,Y,LXY,MXACC,MXLAG,SPACE,XCOR,IANSI 006S C 0066 C 0067 C INPUTS 0068 C 0069 XIII I=l ••• LXY IS THE FIRST SERIES C 0010 C 0011 l=l ••• LXY IS THE SECOND SERIES C YI II 0012 EQUIVALENCE IX,YI IS PERMITTED IGIVING AUTO COREL.) C 0013 NO OTHER OVERLAP OF X ANU Y IS PERMITTED C 0014 C --- . •••••••••••••••••••••••• QXCORR • •••••••••••••••••••••••• IPAGE ............."....•.•.. . •••••••••••••••••••••••• "QXCORR • PROGRAM LISTINGS • 2) C C C LXV MUST EXCEED ZERO AND BE LSTHN= 10000 MXACC DEFINES ACCURACY OF THE TWO SERIES. XII) AND YtI) WILL BE FIxeD SO AS TO HAVE VALUES LYING BeTWEEN -MXACC AND +MXACC INCLUSIVE. MUST LIE BETWEEN 1 ANO 1000 INCLUSIVE. ISMALLER VALUES YIELD HIGHER SPEEDS AND REQUIRE FEWER TEMPORARIES •• C C C C C C I PAGE MXLAG IS THE HIGHEST LAG NO. DESIRED IN THE SPACE (I I I=t._.tSPACE MUST BE AVAILABLE AS TEMPORARIES. WHERE LSPACE = LX + 10.CMXACC+1) + 1 CROSS-CO~ELATION C C C C C OUTPUTS C C XII) I-l ••• LXY CONTAINS THE ROUNDED SERIES XXfI) XXII) = FLOATFIIXII))/SCALEX WHERE IXII) = XFIXFIXII).SCALEXI SCALEX - FLOATFIMXACCI/XMAX XMAX - LARGEST X MAGNITUDE XII) IS LEFT = 0.0 IF XMAX = 0.0 YII) I=l ••• LXY CONTAINS THE ROUNDED SERIES YYIIJ YYII) = FLOATFIIYCI»)/SCALEY WHERE IYIII = XFIXF(Ytll*SCALEY) SCALEY = FLOATFCMXACCI/YMAX YMAX = LARGEST Y MAGNITUDE YII) IS LEFT = 0.0 IF YMAX = 0.0 INOTE- XFIXF IN ABOVE EXPRESSIONS IMPLIES ROUNDING TO NEAREST INTEGER. NOT TRUNCATIONI XCOR( U 1=1 •••• CONTAINS THE CORRELATION FUNCTION IF X AND Y ARE DIFFERENT SERIES XCORl1.2 ••••• 2.MXLAG+11 CONTAINS THE CROSSCORRELATION FUNCTION FROM NEGATIVE TO POSITIVE LAGS AS COMPUTED ON THE ROUNDED SERIES I.E. XCORIII XCII-1-MXLAG) 1.1 ••••• 2.MXlAG.1 WHERE LXY 1 XCIL) --- * SUM I XXCI1.YYfl+L) LXY 1=1 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 FOR L = -MXLAG.-MXLAG+1 ••••• MXLAG AND YYIK) ASSUMED = 0.0 WHENEVER K IS OUTSIDE THE RANGE 1 TO LXY IF X AND Y ARE EQUIVALENT eXLOcFtX)-XLOCFIYI) XCORIl.2,.••• ,MXLAG+1) CONTAINS THE AUToeORRIlAHBN FUNCTION FROM LAG ZERO TO LAG MXLAG I.E. XCORIII = XCII-I) I = 1••••• MXLAG.1 XCORCII WILL BE IDENTICALLY ZERO (F XIII OR YI)I ISJ C C C C C C C C C C C C C C IANS C C C C EXAMPLES C o IF NO TROUBLE ARISES -2 -3 -4 -5 • -98 = -99 IF IF IF IF IF IF Y PARTIALLY OVERLAPS X LXY IS ILLEGAL MXACC IS ILLEGAL MXLAG IS ILLEGAL UNEXPLA INEO ERROR RETURN FROM PROCOR OCt'URS UNEXPLAINED ERROR RETURN FROM FASCOR OCCURS THE FIRST 4 EXAMPLES ARE CHOSEN SO THAT THE EFFECT IS NOT PRESENT C RO~NDOFF C CALL QXCORRIX,Y,LXY,MXACC.MXLAG.SPACE.XCOR.IANSI IS THE ASSUMED USAGE IN ALL EXAMPLES UNLESS OfHERIISi STATED C C C 1. COMPLETE CROSS CORRELATION INPUTS - Xl1 ••• 5) 10 •• 20 •• 10 •• 10.,5. C LXY=5 MXACC=20 MXLAG=4 C C OUTPUTS - Xl1 ••• 51 AND Yl1 ••• 5) INPUT VALUES IANS-O C C C 2. PARTIAL CROSS-CORRELATION C INPUTS - SAME AS EXAMPLE 1 EXCEPT MXLAG=2 = = 0015 0016 0011 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0108 0109 0110 0111 0112 01U 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 "' 2) •••••••••••••••••••••••• • QXCORR PROGRAM LI STINGS • •••••••••••••••••••••••• 3) IPAGE •••••••••••••••••••••••• QXCORR • ..f•......••............ • OUTPUTS -,SAME AS EXAMPLE 1 EXCEPT XCOR(1 ••• 5'=5.,9.i11.i10.,8. C C C 3. CORRELATION BEYOND END OF SERIES C INPUTS - SAME AS EXAMPLE 1 EXCEPT MXLAG=6 OUTPUTS - SAME AS EXAMPLE 1 EXCEPT TERMINAL ZEROES ADDED TO XCOR C IE XCORl1 ••• 131=0.,0.,1.,3.,5.,9.,11.,10 •• 8 •• 6 •• 2.,O.,O. C C Cit. COMPLETE AUTOCORRELATION INPUTS SAME AS EXAMPLE 1 C CALL QXCORRIX,X,lXY,MXACC,MXLAG,SPACe,XC5R,iANSI USAGE C OUTPUTS - SAME AS EXAMPLE 1 EXCEPT C C XCORl1 ••• 5) = 145.,110 •• 70.,40.,10. C C 5. COMPLETE CROSS-CORRELATION SHOWING ROUNDOFF C INPUTS - XI1 ••• 3)=23.8,148.0,20.3 Yel ••• 3)=1.,1.,l. LXY=3 MXACC=lOO MXLAG=2 C C OUTPUTS - Xll ••• 3)=23.68,148.0,20.72 YI1 ••• 3)=1.,1.,1. IANS-O XCORt1 ••• 5J=6.90667,56.2400,64.1333,57.2267,7.8933 C C C 6. THE NEXT FOUR EXAMPLES SHOW ERROR CONDITIONS INPUTS - SAME AS EXAMPLE 1 C USAGE CALL QXCORRIX.X(2),LXY.MXACC.MXLAG,SPACEJXCOR"ANS) C OR CALL QXCORRIX(2),X,LXY,MXACC,MXLAG,SPACE.XCOR,IANSJ C OUTPUTS - IANS = -2 IX ANO Y PARTIALLY OVERLAP) C C C 7. INPUTS - SAME AS EXAMPLE 1 EXCEPT LXY:O C OUTPUTS - IANS=-3 ( ILLEGAL LXY) C C 8. INPUTS - SAME AS EXAMPLE 1 EXCEPT MXACC:1500 C OUTPUTS - IANS=-4 I ILLEGAL MXACC) C C 9. INPUTS - SAME AS EXAMPLE 1 EXCEPT MXL~.G=-2 C OUTPUTS - IANS=-5 ( ILLEGAL MXLAG) C C10. (SPECIAL TEST FOR 8YPASS ON XII) ALL ZERO) SAME AS EXAMPLE 1 EXCEPT X(1 ••• 5)=0.,0., •• ~ INPUTS C OUTPUTS - XCOR(1 ••• 91=0.,O., ••• C C C11. INPUTS - SAME AS EXAMPLE 1 EXCEPT Y(1 ••• 5J=0.,0., •• J C OUTPUTS - XCORl1 ••• 9)=0.,O., ••• C C PROGRAM FOLLOWS 8ElOW C DIMENSION X(2),YI21~SPACE(2),XCORI2) C CHECK INPUTS IANS=-3 IF ILXY) 9999,9999,5 IF (lXY-lOOOO) 10,10,9999 5 IANS=-4 10 IF IMXACCI 9999,9999,20 IF IMXACC-1000) 30,30,9999 20 30 IANS=-5 IF IMXLAG) 9999,40,40 C SET ACTUAL~NO. OF LAGS TO 8E COMPUTED NlAGS = XMINOFIMXlAG,LXY-l) 40 C SET SWITCH = 0 FOR CASE X EQUIV Y AND CHECK PARTIAL OVERLAP IANS=-2 IOIFF • XA8SF(XlOCFIX)-XLOCFIY)1 IF IIDIFF) 55.§5,52 IF (IDIFF-LXY) 9999,60,60 52 C SET FOR X AND Y EQUIVALENT NCORS = MXLAG+1 55 KSTORE = 1 LMIN = 0 GO TO 65 C SET FOR X AND Y DIFFERENT 60 NCORS = 2.MXLAG~1 KS.TORE = MXLAG+l LMIN .. -NLAGS C CLEAR OUTPUT AREA 65 DO 66 l=l,NCORS 66 XCORll) = 0.0 C SET SPACE CONSTANT FOR PROCOR AND FIX X A~O Y. EXI1 FOR ZERm VECTORS. 70 LSPACE=LXY+10'IMXACC+11+1 IANS=O (PAGE 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0111 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 31 •••••••••••••••••••••••• • QXCORR • PROGRAM LI STINGS •••••••••••••••••••••••• CPAGE 41 CAll FXDATAflXY.X,MXACC,SCAlEXI IF CSCAlEXI 9999,9999,80 80 SCAlEY=SCAlEX IF CIDIFFI 85,90.85 85 CAll FXDATAtLXY,Y,MXACC,SCALEYI IF ISCAlEY) 900,900,90 C COMPUTE CROSS CORRELATION 90 IANS=-98 CAll PROCORtX,lXY,MXACC,SPACEllSPACEl,SPACEC1I,ANSR) IF IANSRI 900,100,900 100 IANS=-99 CAll FASCORIV,l"IN,NLAGS.XCORCKSTORE),ANSRI IF IANSRI 900,120,900 C NOW FLOAT AND StALE XCOR 120 I ANS=O SCXC=SCALEX.SCAlEY.FLOATFILXYJ CAll FLDATACNCORS,XCOR,SCXCI C REFLOAT X AND Y 900 CALL FLDATAILXY,X,SCAlEXI IF CIDIFF) 905,9999,905 905 CALL FLDATACLXV,Y,SCALEY) C EXIT 9999 RETURN END ......................... • QXCORR • • •• - •••••••••••• ** •••••• (PAGE 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 4) •••••••••••••••••••••••• exCORl *...•............ * -....... PROGRAM LISTINGS ....-................... *• ••• e_OXCORI * •••••••••••••••••• * QXCORl (SUBROUTINE) 3/15/65 lAST CARD IN DECK IS NO. 0197 • lABEL 0001 CQXCOR 1 0002 SUBROUTINE QXCORl IlXX,XX,lYY,YY,MXACC,IlAG,NlAGS,CORR,IAD, 0003 1 LSPACE,SPACE,IANS) 0004 0005 C ----ABSTRACT---0006 C 0007 C C TITLE - QXCORl OOOB C QUICK CROSSCORRElATION OF MlI TRANSIENTS 0009 0010 C QXCORl FINDS THE CROSSCORRELATION OF TWO MlI IMACHINE C 0011 0012 LANGUAGE INTEGER) TRANSIENTS XII) I=l, ••• ,LX C YIJI 0013 J=I, ••• ,lY ACCORDING TO THE FORMULA C M 0014 C SUM «XII+ll. YIII 0015 C CILI 0016 I=-M C 0017 C FOR l " ILAG, ••• ,llAG+NLAGS-l 0018 C WHERE 0019 C 0020 M IS GRTHN LX + LY IXIII AND YII) ARE ASSUMED TO C BE ZERO OUTSIDE THE LIMITS OF THEIR DEFINITIONI 0021 C C LX,lY,IlAG, AND NlAGS ARE INPUT PARAMETERS 0022 ADDITION INTO THE OUTPUT AREA IS MADE AT THE 0023 C OPERATORS DISCRETION. 0024 C 0025 C QXCORI OBTAINS ITS SPEED BY OPERATING SUBROUTINES PROCOR, 0026 C 0027 FASCRl, AND FASEPI ON THE INPUT SERIES. C 0028 C - FORTRAN II SUBROUTINE 0029 C lANGUAGE 0030 C EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0031 C STORAGE - 502 REGISTERS - CASE 1. WHEN ONE SERIES IS VERY lONG AND ALSO CON0032 C SPEED C SIDERABLY LONGER THAN THE OTHER THE 7090 TIME 0033 0034 APPROACHES 2*NlAGS*L MACHINE CYCLES, WHERE C 0035 C NLAGS = DESIRED NO. OF OUTPUT CORRELATIONS AND 0036 L = lENGTH OF SHORTER SERIES. C 0037 CASE 2. WHEN CROSS-CORRELATING TWO LONG, EQUAL-LENGTH C SERIES FOR lAGS OF -MXLAG TO +MXLAG THE 7090 0038 C 0039 TIME APPROACHES 2*MXLAG*12*L-MXLAGI MACHINE CYCLES C WHERE L IS THE COMMON lENGTH. AUTOCORRElATIONS TAKE 0040 C 0041 HALF AS lONG. C 0042 JUNE,1963 - R.A. WIGGINS C AUTHOR 0043 C 0044 ----USAGE---C 0045 C 0046 C TRANSFER VECTOR CONTAINS ROUTINES - FASCRl,FASEPl,IXCARG,LIMITS. 0047 PROCOR,REVERS,SETKS,STZ C 0048 AND FORTRAN SYSTEM ROUTINES - NONE C 0049 C 0050 C FORTRAN USAGE 0051 CALL QXCORIILXX,XX,LYY,YY,MXACC,IlAG,NLAGS,CORR,IAD, C 0052 1 LSPACE,SPACE,IANS) C 0053 C 0054 C INPUTS 0055 C 0056 =LX IS THE LENGTH OF XII). C LXX 0057 MUST BE GRTHN" 1 C 0058 C 0059 I=l, ••• ,LXX CONTAINS THE MLI VECTOR XIII. XXI I I C 0060 C 0061 =lY IS THE lENGTH OF Y(I). LYY C 0062 MUST BE GRTHN= 1 C 0063 C 0064 I=l, ••• ,LYY CONTAINS THE MLI VECTOR YIII. C YYIIl 0065 C 0066 MXACC DEFINES THE ACCURACY OF THE VECTORS XXIII AND YYIII. C 0067 ALL VALUES OF XXIII AND YYIII MUST lIE BETWEEN -MXACC C 0068 AND +MCACC INCLUSIVELY. C 0069 MUST BE GRTHN=l, LSTHN= 1000 C 0070 C 0071 IS THE INITIAL LAG AT WHICH THE CORRELATION IS BEGUN. C ILAG 0072 C 0073 IS THE NUMBER OF LAGS FOR WHICH THE CORRELATION IS FOUND. C NlAGS ........................ IPAGE • ••••••••••••••••••••••• QXCORI • •••••••••••••••••••••••* PROGRAM LISTINGS • QXCORI • •••••••••••••••••••••••• * 2) IPAGE C C C lAO C C C LSPACE C C C C SPACEII) C C C OUTPUTS C C CORRII) C C C C IANS C C C C C C C C MUST BE GRTHN= 1 =0 IMPLIES CORRELATION REPLACES OUTPUT VECTOR. NOT= 0 IMPLIES CORRELATION IS ADDEO TO THE OUTPUT VECTOR. IS THE LENGTH OF TEMPORARY COMPUTATION SPACE AVAILABLE TO QXCORI. MUST BE GRTHN= MINILXX,LYY) + 1 + 10*IMXACC+l) I=l ••••• LSPACE IS TEMPORARY COMPUTATION SPACE NEEDED BY QXCOR1. l=l, •••• NLAGS CONTAINS THE CROSSCORRELATION CIJ) J=ILAG ••••• ILAG+NLAGS-1 AS DEFINED IN THE ABSTRACT. ~o NORMALLY IF ILLEGAL LXX ILSTHN= 0) IF ILLEGAL LYY ILSTHN= 0) IF ILLEGAL MXACC (LSTHN=O. GRTHN 1000) IF ILLEGAL NLAGS ILSTHN= 0) IF ILLEGAL LSPACE ISEE ABOVE) IF ILLEGAL VALUE OF XX OR YY FOUND BY PROCOR IABSIXXtl)) GRTHN MXACC). =33 IF OVERFLOW OCCURS - SEE PROCOR WRITEUP. =1 =2 =3 =4 =5 =24 C C C C C C C C C C C C C C EXAMPLES - LXX = 2 LYY = 3 NLAGS=5 ILAG 0 OUTPUTS - IANS = 0 1. INPUTS = XXIl ••• Z) = MLI 1,2 YYl1 ••• 3) = MLI 5.4,3 CORRl1 ••• 51 = MLI 1,1.1,1.1 MXACC = 100 lAO = 0 LSPACE CORRI1 ••• 51 MLI 13.10.0,0.0 = 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT ILAG = -4 lAO OUTPUTS - lANS = 0 CORRI1 ••• 5) = MLI 1,1.4.11.14 0014 0015 0016 0077 0018 0019 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 U1UO 1050 =1 PROGRAM FOLLOWS BELOW C DIMENSION CM(2).CORRI2),SPACEI21 COMMON CM C C BRING IN SOME OF THE ARGUMENTS C CALL SETKS ILXX.LX, LYY.LY. ILAG,ILG. NLAGS.LZI CALL IXCARG IXX,IXI CALL IXCARG IYY,IY) C C CHECK ERROR CONDITIONS C CALL LIMITS 11.IAN, LX,1,32561, LY,I,32561, MXACC.l.1000, 1 LZ,1,32561, LSPACE,I+XMINOFILX,LYI+I0*IMXACC+11,325611 IF IIAN) 5,5,900 5 CONT INUE C C CLEAR THE OUTPUT AREA IF IAD=O C IF IIAO) 20,10,20 10 CALL STZ ILZ,CORRI 20 CONTINUE C C CHOP OFF UNUSED PORTIONS FROM LEFT OF XX AND YY. C KMAX=ILG+LZ-l IF (ILG) 30,60,50 30 CONTINUE IF IKMAX) 40,60,60 40 CALL SETKS (LY+KMAX,LY, IY-KMAX,IY, ILG-KMAX,ILG, O,KMAX) IF ILY) 900,900,60 50 CALL SETKS (LX-ILG,LX, IX+ILG,IX, O,ILG, LZ-1,KMAX) IF ILX) 900,900,60 C SET UP PARAMETERS 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 2) ...........•....-....... • • QXCORI PROGRAM LISTINGS •••••••••••••••••••••••• IPAGE 3) 60 C 220 230 C 240 310 320 330 340 350 390 500 510 520 550 600 610 900 910 920 • CAll FASEPI ICMIIXI.1),O,NF23-1,CORRlll),ERRI IF IERRI 920,530,920 IF IIF3) 550,550,540 IXI-IXI.NF23.1 1l =- IlG.NF23.2 CAll FASCR1 (CMIIXI),O,NF33,CORR(Ill,ERRI IF IERRI 920.550,920 CONTINUE IF IlXMlY) 600.610,610 CAll REVERS Ill,CORRI CONTINUE IANS-=IAN RETURN JANS=ERR.20. GO TO 550 IANS=ERR.30. GO TO 550 ENO • QXCORI • ••••••••••••••••••••••• CONTINUE lXMl Y=LX-l Y SET SWITCHES WHICH DEPEND ON LX-lY IF IlXMlYI 230,220,220 CAll SETKS IlY,lYT, IY,IYI, IX,IXII GO TO 240 CAll SETKS IlX,lYT, IX,IYI, IY,IXI, -KMAX,ILG, -llG,KMAXI CAll REVERS Ill,CORRI SET ARGUMENTS WHICH DEPEND ON IlG,ll CAll SETKS l-l,IF3, -l,IF2, XMAXOFlllG,-lYT.11,NF12, 0,NF131 IF IlX~lYI 320,310,320 NFI3=XMINOFllYT-1,KMAXI GO TO 390 IF (KMAXI390,390,330 NF23=XMINOFIXA8SFllXMlY)-1,KMAX-11 KMAX1=KMAX-NF23-1 IF INF231 350,350,340 IF 2=1 IF IKMAXtl 390,350,350 IF3=l NF33=XMINOFllYT-1,KMAX11 CONTINUE CAll PROCOR ICMIIYI1,lYT,MXACC,SPACEILSPACE1,SPACE,ERR) IF IERR) 910,500,910 CONTINUE Il=-llt;H CAll FASCRI ICMIIXI),NF12,NF13,CORRlllI,ERRI IF IERRI 920,510,920 IF IIF21 530.530,520 CONTINUE IZ=ll+l 530 540 -* •••••••••••••••••••••• IPAGE 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 31 •••••••••••••••••••••••• RDATA • •••••••••••••••••••••••• • PROGRAM LISTINGS • RDATA ISUBROUTINE. 3/15/65 • LABEL CRDATA SUBROUTINE RDATAIITAPE,ITPCPY,lANS,SPACEl •••••••••••••••••••••••• RDATA ••••••••••••••••••••••••• • LAST CARD IN DECK IS NO. 0395 0001 0002 0003 0004 C 0005 C 0006 C ----A8STRACT---0007 C C TITLE - RDATA 0008 C READ DATA IN GENERALIZED FORMAT 0009 0010 C SUBROUTINE RDATA PROVIDES A SIMPLIFIED TECHNIQUE FOR 0011 C C INPUTING SMALL AMOUNTS OF DATA. RDATA COMPARES A 0012 HOLLERITH NAME FOUND ON THE DATA CARD WITH NAMES IN ITS 0013 C CALLING SEQUENCE~ WHEN IT FINDS MATCHING NAMES IT THEN 0014 C 0015 INTERPRETS THE DATA THAT FOLLOWS AS FIXED, FLOATING. OR C OCTAL NUMBERS OR AS HOLLERITH INFORMATION AND STORES IN 0016 C 0017 C LOCATIONS CORRESPONDING TO THE HOLLERITH ARGUMENT. THE POSITION OF STORAGE IN VECTORS IS CONTROLLED BY 0018 C GIVING INDEX VALUES ON THE CARD. IF NONE IS GIVEN, RDATA 0019 C· 0020 PUTS THE FIRST VALUE IN THE FIRST LOCATION OF THE VECTOR. C RDATA SCANS CARDS 180 COLUMNS PER CAROl UNTIL IT 0021 C ENCOUNTERS THE WORD 'RETURN', THEN IT RETURNS CONTROL 0022 C TO THE MAIN PROGRAM. IF RDATA ENCOUNTERS UNINTERPRETABLE C 0023 INFORMATION ON THE CARDS, AN ERROR FLAG IS SET. 0024 C 0025 C IF THE USER DESIRES, RDATA WILL COpy, VERBATIM, EACH 0026 C C CARD THAT IT INTERPRETS ON OUTPUT TAPE 2 • 0027 0028 C RDATA REQUIRES A SPECIAL IIOH) ROUTINE THAT CAN INTERPRET 0029 C INPUT 'G' FORMATS. SUCH A ROUTINE IS DISTRIBUTED BY 0030 C SHARE AS 19 SI GIOH NUMBER 1402. 0031 C 0032 C C LANGUAGE - FORTRAN II SU8ROUTINE 0033 0034 C EQUIPMENT - 709 OR 7090 IMAIN FRAME AND TAPE UNIT) 0035 C STORAGE - 645 REGISTERS 0036 C SPEED 4/64 0037 C AUTHOR - R.A. WIGGINS 0038 C 0039 C 0040 C ----USAGE---0041 C 0042 C TRANSFER VECTOR CONTAINS ROUTINES - ARG,CMPRA,HVTOIV,INTHOL,IVTOHV, 0043 IXCARG,RETURN,SETUP.STORE C 0044 AND FORTRAN SYSTEM ROUTINES - IFIL),IRTN),ISTHI,ITSHI C 0045 C 0046 C FORTRAN USAGE C CALL RDATAIITAPE,ITPCPY,IANS,SPACE, XINAME,Xl, ••• , XNNAME,XNI 0047 0048 C 0049 C C INPUTS 0050 0051 C 0052 ITAPE LOGICAL INPUT TAPE NUMBER. C 0053 IS NOT CHECKED FOR VALIDITY. C· 0054 C LOGICAL TAPE NUMBER THAT RDATA WILL COpy EACH DATA CARD 0055 lTPCPY C 0056 ONTO AND 'ON WHICH IT WILL INDICATE CARD COLUMNS C 0057 IN WHICH ERRORS OCCUR. C 0058 C = 0 INDICATES NOTHING WILL BE PRINTED. 0059 C 0060 SPACEII) 1=1 ••• 110 IS TEMPORARY STORAGE SPACE NEEDED BY RDATA. C 0061 C 0062 X1NAME LEFT ADJUSTED HOLLERITH WORD GIVING THE NAME OF A C VARIABLE, OR VECTOR. THAT DATA MAY BE STORED IN. 0063 C 0064 C 0065 C 0066 XNNAME N-TH HOLLERITH NAME. C 0067 C 0068 DATA CARDS ON TAPE ITAPE. RDATA SEARCHES FOR A NAME THAT C 0069 CORRESPONDS TO X1NAME ••• XNNAME. THEN IT STORES SUBSEQUENT C 0070 INFORMATION UNTIL IT FINDS ANOTHER NAME. THE INFORMATION MAY C BE OF THE FOLLOWING TYPES lEACH FIELD MUST BE SEPARATED BY AT 0071 C 0072 LEAST ONE SPACE. COMMA, OR EQUALS SIGNI. C 0073 C 0074 INDEX OF VECTOR - INDICATED BY PLACING PARENTHESES AROUND A C . •••••••••••••••••••••••• PROGRAM LISTINGS RDATA • ••••••••••••••••••••••••• (PAGE • ••••••••••••••••••••••• • • ROATA • ••••••••••••••••••••••• (PAGE 2) C FIXED POINT NUMBER. MULTIPLE PERIODS INSIDE THE C PARENTHESES (SEPARATEO FROM tHE INDEX BY AT lEAST ONE C SPACE) AND SUCCEEDING EQUALS SIGNS ARE IGNORED. C C FIXED POINT NUMBERS - INDICATED BY THE ABSENCE OF A DECIMAL C POINT IN THE NUMBER. C C fLOATING POINT NUM8ERS - INDICATED BY THE PRESENCE OF A C DECIMAL POINT, OR BY E fORMAT. C C OCTAL NUMBERS - INDICATED BY A FINAL '0' (OH) FOLLOWING C 12 OCTAL DIGITS. C C HOLLERITH CHARACTERS - INDICATED BY 'NH' WHERE N"IS THE C COUNT OF THE NUMBER OF CHARACTERS FOLLOWING 'H' TO 8E C INTERPRETED. IF THIS FIELD EXTENDS BEYOND THE END OF C THE CARD, IT IS TRUNCATED TO THE END. C C 'RETURN' - CAUSES RDATA TO RETURN CONTROL TO THE CALLING C PROGRAM. C C C OUTPUTS C C Xl •• XN HAVE DATA STORED IN THEM ACCORDING TO DATA CARDS C ClANS 0 IF ALL OK C • -1 IF THE NUMBER OF ARGUMENTS IS LSTHN 6 OR 000 C A POSITIVE COUNT OF THE NUMBER OF FIELDS THAT RDATA C FOUND UNINTERPRETABLE, IF THESE OCCUR. C C C EXAMPLES (DATA INDICATES A CARD ON TAPE ITAPE) C C 1. INPUTS - ITAPE 2 ITPCPY: 0 C USAGE CALL RDATAlITAPE.ITPCPY.IANS,SPACE,lHX,X,lHJ,J) C DATA XII. 0000100000000 6HABCDEF J 5 RETURN C OUTPUTS - IANS = 0 X(1 ••• 4) = l,l.,8,6HABCDEF Jz 5 C C 2. INPUTS - SAME AS EXAMPLE 1. C USAGE - SAME AS EXAMPLE 1. C DATA X 0 0 0 0 0 0 (2) 2 (4 ••• )- 4 (6) • 6H...... RETURN C OUTPUTS - IANS 0 X(I ••• 6) 0.2,0.4,0,6H...... C C 3. INPUTS - SAME AS EXAMPLE ,. C USAGE - SAME AS EXAMPLE 1. C DATA K=13 J=6 RETURN C OUTPUTS - IANS = 1 J = 6 C C C PROGRAM FOLLOWS BELOW C DIMENSION CM(21.ICM(2) COMMON CM,ICM EQUIVAlENCE(CM.ICM),lNUM,XNUM) C C SETUP LOCATE TO HANDLE VARIABLE ARGUMENT COUNT C CALL SETUP (lOCALl,NARGS,XR1,XR2) C C CHECK IF ARGUMENT COUNT IS LEGAL C IF lNARGS-41 20,20,10 10 CONTINUE IF IXMODFINARGS,2)) 40,40,20 20 CONTINUE IANS=-1 30 CONTINUE CALL RETURN (LOCAlL,XR1,XR2) 40 CONTINUE C C SET UP THE INDICES W.R.T. COMMON OF VARIOUS VECTORS. C CALL IXCARG (SPACE,IHOL) IHOLE=IHOl+13 = = = 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 008B 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 2) •••••••••••••••••••••••• PROGRAM LI STI NGS • •••••••••••••••••••••••• • RDATA (PAGE .......... -_ ............ RDATA •*•••••••••••••••••••••••* 3' (PAGE IVIB:1110LE+1 IV1E=IV18+5 IV2B=IV1E+3 IV2E=IV2B+80 IANS:O C C GET NEXT CARD C 100 CONTINUE READ INPUT TAPE ITAPE,110,(CMII),I=IHOL,IHOLEI FORMATI14A61 ICARD=ICARD+l HLN-O. IV=IV2B-1 110 C C COPY CARD VERBATIM IF ITPCPY EXCEEOS ZERO C IF IITPCPY) 130,130,120 CONTINUE WRITE OUTPUT TAPE ITPCPY, 125, ICARD,(CM(II,I=IHOL,IHOLEI FORMATI3X6HCARD 115,1H 1 = '13A6,A2,lH'I CONTINUE 120 125 130 C C SCAN CARD. FIRST, SPREAD HOLLERITH - ONE LETTER PER WORD C CALL HVTOIV ICMIIHOL),14,CM(IV2B)1 C C INITIALIZE SwiTCHES - SCAN TO FIRST CHARACTER C 135 CONTINUE ASSIGN 550 TO KINDEX 136 CONTINUE 'I'~"'I 'nn Tn ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN 160 500 400 300 480 220 220 220 135 136 TO TO TO TO TO TO TO TO a .... ~~!~!~ nlA' KBLK KNUM KALPH KPER KLPRN KE KH KO TO KSTO TO KALPI C C RESET COpy REGION TO BLKS C 140 CONTINUE IIVl=IV1B-l DO 150 1:IV1B,IV ICM( II :48 150 C C GET NEXT CHARACTER, CHECK IF CARD IS COMPLETED C 160 CONTINUE IV=IV+1 IF IIV-IV2E) 180,180,100 180 CONTINUE IVT: ICM 11 V) ICMt IVI=48 GO TO KNND ,1190,510) C C BRANCH ON CHARACTER TYPE C 190 CONTINUE IVI:IVTH COO 1 234 561 GO TO 1210,210,210,210,210,210,210,210, C 1 8 9 ILL - ILL ILL III 1 210,210,800,200,210,800,800,800, C 2 + ABC 0 E F G 210,220,220,220,220,250,220,220, 2 C 3 H I ILL ) ILL ILL ILL 260,220,800,230,200,800,800,800, 3 C 4 4 J K 0150 0151 0152 0153 0154 0155 0156 0151 0158 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0110 0171 0112 0113 0114 0115 0116 0111 0118 0119 0180 0181 L M N 0 P 210,220,220,220,220,220,210,220, 0183 0184 0185 0186 0181 0188 0189 0190 0191 0192 0193 0194 0195 0196 0191 0198 0199 0200 0201 0202 0203 0204 0205 0206 0201 0208 0209 0210 0211 0212 0213 0214 0215 0216 0211 0218 0219 0220 0221 0222 0223 0224 3) •••••••••••••••••••••••• • PROGRAM LISTINGS RDATA ••••••••••••••••••••••••* IPAGE 4) IPAGE C 5 Q RILL S * ILL ILL ILL 220,220,800,220,220,800,800,800, 5 C 6 BLK / STU V W X 200,220,220,220,220,220,220,220. 6 C 7 Y Z ILL • (ILL ILL ILL 220,220.800.200.240,800,800,800), IVI 7 C BLANK CHARACTER' ,1=' 200 GO TO KBLK, (160,320,420,5201 C NUMERICAL CHARACTER '+-0123456789' 210 GO TOKNUM, 1500,220,5101 C GENERAL ALPHABETIC 'ABCDFGIJKLMNPQRSTUVWXYZS*/' 220 GO TO KAlPH,I400,410,8001 C PERIOD ' . ' 230 GO TO KPER ,1300,160,200,2101 C LEFT PARENTHESIS 'I' 240 GO TO KLPRN,t480,8001 C EEE 'E' 250 GO TO KE ,1220,2101 C AITCH 'H' 260 GO TO KH ,1220,750) C OH '0' 270 GO TO KO , 1220.7001 C C SPEC lAL ENTRY TO SKIP MULTIPLE PERIODS C 300 310 320 CONTINUE IF IICMIIV+I'-271 210,310,210 CONTINUE ASSIGN 320 TO KBLK ASSIGN 160 TO KPER GO TO 160 CONTINUE ASSIGN 160 TO KBLK ASSIGN 300 TO KPER GO TO 160 C C FIRST CHARACTER IS ALPHABETIC, SCAN TO END C 400 410 CONTINUE ASSIGN 420 TO ASSIGN 410 TO ASSIGN 220 TO ASSIGN 200 TO ASS IGN 420 TO CONTINUE IIV1=IIVl+1 ICMIIIVlI=IVT GO TO 160 KBLK KALPH KNUM KPER KALP1 C C END FOUND, CONVERT FIRST SIX CHARACTERS TO HOLLERITH C 420 CONTINUE CALL IVTOHV (CMIIV1BI,I,HLNI C C IF HLN = 6HRETURN, LEAVE C IF (CMPRAFIHLN,6HRETURNI1430,30,430 C C OTHERWISE, LOOK FOR HLN IN CALLING SEQUENCE C 430 CONTINlJE DO 440 IARG=5,NARGS,2 IF ICMPRAFIHLN,ARGFILOCALL,IARG,III) 440,450,440 440 CONTINUE C C HLN CANNOT BE IDENTIFIED, GO TO ERROR PROCEOURE C HLN=O. GO TO 800 C C HLN IS NOW DEFINED BY (ARG, GO SCAN FOR VALUES C 450 • ••••••••••••••••••••••• RDATA • • ••••••••••••••••••••••• • CONTINUE IARG=IARG+l IX=O 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0273 0274 0275 0276 0277 0278 0279 0280 0281 0282 02B3 0284 0285 0286 0287 0288 0289 0290 0291 0292 0293 0294 0295 0296 0297 0298 0299 41 .....................-.. • PROGRAM LISTINGS • RDATA • ••••••••••••••••••••••• 5) (PAGE GO TO 136 C C FIRST CHARACTER IS LEFT PAREN C 4BO CONTINUE ASSIGN 540 TO KINDEX GO TO KALP1, (136,420) C C FIRST CHARACTER IS NUMERICAL, SCAN ACROSS C 500 510 CONTINUE ASSIGN 520 TO ASSIGN 510 TO ASSIGN 800 TO ASSIGN 210 TO AS SIGN 800 TO ASSIGN 210 TO ASS IGN 150 TO ASSIGN 100 TO CONTINUE IlVl=IlVl+1 ICM( llVlI =lVT GO TO 160 KBLK KNUM KALPH KPER KLPRN KE KH KO C C END OF NUMBER FOUND, CONVERT IT C 520 530 CONTINUE FMT=3HIGI CONTINUE NHOL=IIIVI-IV18+61/6 CALL IVTOHV IICMIIVIB},NHOL,CMIIHOLII CALL INTHDL (NHOL,CMIIHOLI,FMT,I,IDUM,NUMI ~u IU ~i~UtA,i3~v,55v,5ovi C C IF THIS IS AN INDEX, RESET IX C 540 CONTINUE IX=NUM-1 GO TO 135 C C IF THIS IS OCTAL, OR NUMBER, STORE IT C 550 555 556 CONTINUE IF (HLNI 555,556,555 CONTINUE IX=IX+l CALL STORE (NUM,LOCAlL,IARG,IXI CONTINUE GO TO KSTO, 1135,1401 C C IF THIS IS HOLLERITH, STORE NEXT NUM CHARACTERS C 560 570 580 590 600 CONTINUE NUMH=NUM NUMl=XMINOF(NUM,IV2E-IV-ll FMT=4H(A61 IV 2E T= I V+NUM 1 ASSIGN 570 TO KNND ASSIGN 550 TO KINDEX ASSIGN 140 TO KSTO GO TO 140 CONTINUE IIVl=IIV1+l ICM( IIVlI=IVT IF (IV-IV2ETI 580,590,590 IF (IIVI-IVIE) 160,530,530 CONTINUE IF (lIVl-IVIBI 135,600,600 CONTINUE ASSIGN 135 TO KSTO GO TO 530 C C THIS IS AN OCTAL NUMBER C 700 CONTINUE • RDATA •••••••••••••••••••••••• (PAGE .•...............-....... 0300 0301 0302 0303 0304 0305 0306 0301 030B 0309 0310 0311 0312 0313 0314 0315 0316 0311 0318 0319 0320 0321 0322 0323 0324 0325 0326 0321 0328 0329 0330 0331 0333 0334 0335 0336 0331 0338 0339 0340 0341 0342 0343 0344 0345 0346 0341 0348 0349 0350 0351 0352 0353 0354 0355 0356 0351 0358 0359 0360 0361 0362 0363 0364 0365 0366 0367 0368 0369 0310 0311 0372 0373 0314 51 . . ******.*** ••••••••••• *** RDATA •••••••• * •••• **** ••• ** •• (PAGE 61 PROGRAM LISTINGS FMT=5H (0121 GO TO 530 C C THIS IS HOLLERITH C 750 CONTINUE ASSIGN 560 TO KINDEX GO TO 520 C C ERROR FOUND, SCREAM, BUMP IANS, AND CONTINUE C BOO 810 820 830 CONTINUE IANS=IANS+l IF (ITPCPYI 830,830,810 CONTINUE INDEX=IV-IV2B+l WRITE OUTPUT TAPE ITPCPY, 820, INDEX FORMAT(42H ILLEGAL CARD FORMAT BEGINNING IN COLUMN 141 CONTINUE GO TO 135 END .•• ****.*.*.*********.*** . RDATA ************.*********.* (PAGE 6) 0375 0376 0377 0378 0379 0380 0381 0382 0383 0384 0385 0386 0387 0388 0389 0390 0391 0392 0~93 0394 0395 ***** ••••••• **.** ••••• *. ...... REFIT •................. _ REFER TO SPLIT * PROGRAM LISTINGS •••••••••••••••• **** •••• REFIT * •••• ** •••••••••••••••• ** • REFER TO SPLIT •••••••• ~ •••• * ••••• * •••• • • REFLEC PROGRAM LISTINGS •••••••••••••••••••••••• 9/29/64 • REfLEC (SUBROUTINE) " FAP -REFLEC COUNT 100 LBL REFlEC REFLEC I X, LX,XMIROR,XIMAGE) ENTRY ENTRY XRFLEC (IX,LIx,IXMIRR,IXIMGE) " " "• " • • • • • •" • • " • " •" • • • • • • • • " • • • " " " " " "" " •" " •" •" •" • • " -• • •" " " "• • "• • • • • .•..,•..•.••..•........•. * ••••••••••••••••••••••• RE~LEC LAST CARD IN DECK IS NO. 0107 0001 0002 0003 0004 0005 0006 0007 ----ABSTRACT---0008 0009 0010 TITLE - REFLEC WITH SECONDARY ENTRY XRFLEC REFLECT A FIXEO OR FLOATING VECTOR THROUGH A CONSTANf 0011 0012 REFLEC SETS A FLOATING VECTOR EQUAL TO A CONSTANT MINUS 0013 A GIVEN FLOATING VECTOR. OUTPUT CAN REPLACE IN~UTJ 0014 0015 XRFLEC DOES THE SAME TH1NG FOR FIXEO VECTORS. 0016 0017 0018 - FAP SUBROUTINES IFORTRAN-II COMPATIBLE) LANGUAGE 0019 EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) - 28 REGISTERS ' 0020 STORAGE - REFLEC 34 + 12.4"L MACHINES CYCLES, 0021 SPEED XRFLEC 36 + 8.0.L L= VECTOR LENGTH 0022 - S.M. SIMPSON, SEPTEMBER 1963 0023 AUTHOR 0024 0025 ----USAGE--'-0026 0027 TRANSFER VECTOR CONTAINS ROUTINES - (NONE) 0028 AND FORTRAN SYSTEM ROUTINES - (NONE) 0029 0030 FORTRAN USAGE 0031 CALL REFLECt X, LX,XMIROR,XIMAGEI CALL XRFLECtIX,LIX,IXMIRR,IXIMGE) 0032 0033 0034 INPUTS 0035 XI J) l=l ••• LX IS A FLOATING VECTOR 0036 LX 0037 SHOULD EXCEED 0 XMIROR IS A FLOATING CONSTANT 0038 0039 I XII) 0040 I=l ••• LIX IS A FIXED VECTOR lIX 0041 SHOULD EXCEED 0 IS A FIXED CONSTANT IXMIRR 0042 0043 0044 STRAIGHT RETURN WITH NO OUTPUTS IF LX OR LlX L5THN 1 OUTPUTS 0045 0046 XIMAGEI I) l=l ••• LX IS XIMAGE(I) = XM - XII) 0047 WHERE XM = INPUT VALUE OF XMIROR IXMIROR WIL~ 8E 0048 AN OUTPUT IF BOTH PERMISSI8LE EQUIVALENCES BELOW ARE 0049 USED) 0050 0051 I XI MGECI I I=t ••• LIX IS IXIMGEIIl = IXM - IXII) WHERE IXM = INPUT VALUE OF IXMIRR 0052 0053 EQUIVAlENCEIXMIROR,SOME XII»),IXIMAGE,X) ARE 0054 PERMITTED. SIMILARLY FOR THE FIXED POINT QUANT)TIES~ 0055 0056 0057 EXAMPLES 0058 0059 XI1 ••• 4) = 1., 2., 3., 4. IXI1.~.41 = 1,2,3,4 1. INPUTS XR2 = -999. 0060 USAGE CAll REFlECI X, 4, 5., XRll 0061 IX, 4, 0, 0062 CAll XRFlEC{ IXRU X) CALL REFLECI X, 4, 5., 0063 0064 CAll XRFLEC I IX, 4, IX(3),IX I 0065 tAll REFlECI X, 0, 5., XR21 0066 4., 3., 2., 1. IXRl( 1••• 4) OUTPUTS - XRlll .... 4 I -1,-2.-3.-4 0067 4., 3., 2., 1. IXll ••• 41 XIl.J.41 2. 10 0,-1 0068 XR2 = -999. INO OUTPUT CASEI 0069 0070 PROGRAM FOllOWS BELOW 0071 0072 0073 NO TRANSFER VECTOR HTR 0 0074 XR4 - • •••••••••••••••••••••••• • REFLEC ••••• ** ••••••••••••••••• PROGRAM LISTINGS • It •••••••••••••••••••••••• (PAGE 2) 1,REFLEC 8Cl PRINCIPAl ENTRY. REFLEC (X,LX,XMIROR,XIMAGEI REFLEC CLA FSB SETUP STO SUBTR SXO REFLEC-2,4 Kl CLA 1.4 ADD K1 A(Xl+l STA SUBTR CLA 4,4 ADD K1 A(XIMAGEI+1 STA STORE 3,4 XMIROR CLA" STO MIROR CLA .. 2,4 LX TMI LEAVE POX 0,4 TXL LEAVE,4,0 .. REFLEC TI NG LOOP GET CLA MIROR FSB .... ,4 OR SUB .... ,4 SUBTR NOP •• ,4 STORE STO "*=A(XIMA('EI+1 TIX GET ,4, 1 .. EXIT LEAVE LXO REFLEC-2,4 TRA 5,4 .. SECOND ENTRY. XRFLEC(IX~LIX,IXMIRR,IXIMGE) XRFLEC CLA SUB TRA SETUP .. CONSTANTS, TE~PCRARIES FSB FSB "",4 SUB SUB ".,4 MIROR PTe "*,*".*. =XMIROR END REFlEC • ••• f •••••••••••••••••••• (PAGE It ""=A(X)+l 0075 0016 0071 0078 0019 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 21 * •••••••• *** ••••• ***.**. • • REIM •• **.***.** •• *********** REFER TO AMPHl PROGRAM LISTINGS ***.****.**.* ••••• ****** I{EIM • ****.*~*.****.**.***.* REFER TO AMPHZ * •• •••••••••••••••••••••••• REMAV • , ..•....••....•. PROGRAM LI STINGS ........ • • •. ..• • • •.. .. .. .. .. .. • • • •. " • "" ...• ... . • • (SUBROUTINE) XI Il l-l ••• LX IS A FLOATING VECTOR • LX SHOULD EXCEED ZERO. XAVG IS XNULDIII I=l ••• ~X ..." EXAMPLES II/LXI .. (SUM (FROM 1=1 TO LXI OF XCII). IS XNUlD(ll = XII) - XAVG. EQUIVAlENCE(X,XNUlD) IS PERMITTED. .. 1. INPUTS • • .. .. • • .. .. • - XIl ••• Jl • 1 •• 2 •• 3., 4., 5. XAVG4 I -999. CALL REMAVI X, 5, XAVGI, XNULDI CALL REMAV( X, 2, XAVG2. Xl CAll REMAVI X. 1. XAVG3, YI CAll REMAVC X. 0. XAVG4, ZI OUTPUTS - XAVGl ~ 3. XNULDll ••• 51· -2 •• -1 •• O~. I •• 2. XAVG2 ~ 1.5 X(1 ••• 2) • -.5, .5 XAVG3 ~ -.5 Y = O. XAVG4 ~ Z -999. INO OUTPUT CASEI USAGE = . " PROGRAM FOLLOWS BELOW •.. • OU3l INPUTS • .. REMAV 9129/64 STRAIGHT RETURN WITH NO OUTPUT IF LX LSTHN 1. ... .........•.......•.. •••••••••••••••••••••••• • OUTPUTS • ..- LAST CARD 1111 DECK IS NO'. 0105 0001 0002 0003 COUNT 100 REMAV LBL 0004 ENTRY REMAV lX,LX,XAVG,XNULD) 0005 0006 0007 ----ABSTRACT---0008 TITLE - REMAV 0009 REMOVE THE MEAN FROM A FLOATING VECTOR 0010 0011 0012 REMAV COMPUTES THE AVERAGE VALUE OF A FLOATING VECTOR. THEN SETS AN OUTPUT VECTOR WITH ELEMENTS EQUAL TO TWOSE 0013 OF THE INPUT VECTOR MINUS THE AVERAGE. THE OUlPUT 0014 VECTOR MAY REPLACE THE INPUT VECTOR. THE AVERAGE IS 0015 ALSO AN OUTPUT QUANTITY • 0016 0017 LANGUAGE - FAP SUBROUTINE IFORTRAN-II COMPATIBLE) 0018 EQUIPMENT - 709 OR 7090 IMAIN fRAME ONLY) 0019 STORAGE - 36 REGISTERS 0020 SPEED - 67~4 + ZO.8*L MACHINE CYCLES ON 7090. L ~ VE¢TOR LENGTH 0021 77.4 + lO.S"L MACHINE CYCLES ON 709 0022 0023 - S.M. SIMPSON. SEPTEMBER 1963 AUTHOR 0024 .,.--USAGE--0025 0026 0027 TRANSFER VECTOR CONTAINS ROUTINES - INONE) AND FORTRAN SYSTEM ROUTINES - INONE) 0028 0029 0030 FORTRAN USAGE 0031 CALL REMAV tX.LX,XAVG,XNULDI •.REMAV • • REMAV FAP ~ • NO TRANSFER VECTOR HTR o XR4 1,REMAV BCI .. ONLY ENTRY • REMAV (X,lX,XAVG,XNUlD) REMAV-2,4 REMAV SXD 1,4 lU CLA AOO Kl AIXI+1 STA ADDI STA GET 4,4 ClA AOD K1 AIXNUlDI+l SU STORE 3,4 AIXAVGl CLA 0033 0034 0035 0036 0031 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0051 0058 0059 0060 0061 0062 0063 0064 0065 0066 0061 0068 0069 ' 0010 0071 0072 0073 0074 •••••••••••••••••••••••• * REMAV •....•........... IPAGE 2) -....... PROGRAM LISTINGS STA FSB • CHECK LS AND FLOAT ]T. CLA2,4 LX TMI LEAVE POX 0,4 TXL LEAVE,4,0 LRS 18 ORA OCTK FAD OCTK FLOATED LX STO FLX • SUM XC1 ••• LX), DIVIDE, STORE. PXO 0,0 **=AIX)+l AD01 FAD **,4 TIX A001,4.1 FOP FLX LXO REMAV-2,4 3,4 XAVG STQ* • MEAN REMOVAL LOOP CLA* 2,4 LX POX 0,4 CLA .*,4 GET **=AIX)+1 FSB **=AIXAVGI FSB ** STORE STO .*=AIXNULD)+l **,4 TIX GET ,4,1 * EXIT REMIIV-2,4 LEAVE LXO TRA 5,4 * CONSTANTS. VARIABLES OCTK OCT 233000000000 FLX PZE LX FLOATED ** END •••••••••••••••••••••••• • REMAV * • •••••••••••• 4 •••••••••• IPAGE 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 2) •••••••••••••••••••••••• REREAD • ••••••• * •••••• ~ ••••••••• • PROGRAM LISTINGS ••••••••••••••••••••• ** • * REREAD • • ••••••••••••••••••• ** •• 9/9/64 LAST CARD IN DECK IS NO. 02B2 • REREAD (SUBROUTINE) 0001 • fAP ·REREAD 0002 COUNT 150 0003 LBL REREAD 0004 ENTRY REREAD 0005 ENTRY EOfSET (ZIFTRN.EOF.ITAPEI 0006 ENTRY ENDFIL (ITAPEI 0007 ENTRY ITSH) I TAPE TO STORAGE HOLLER ITH) OOOB (TSHMI ENTRY IT APE TO STORAGE HOLLERITH-MONITORI 0009 0010 • 0011 • ----ABSTRACT---0012 • 0013 •• TIlLE - REREAD. WITH SECONDARY ENTRIES EOFSET. ENDfIL. tTSH). tTSHM) 0014 • REREAD DATA RECORD AND END fILE MONITOR 0015 0016 • REREAD IS A MODifICATION Of THE FORTRAN-II BCD TAPE 0011 • READING ROUTINE ITSH) THAT ALLOWS THE USER GREATER 0018 • FLEXIBILITY IN REINTERPRETATION OF CARDS AND IN THE 0019 • SELECTION OF PROGRAMMED REACTION TO READING END-OF-fiLE 0020 • MARKS. 0021 • 0022 • THE REREAD ENTRY ALLOWS THE REINTERPRETATION OF AGARD 0023 • AS MANY TIMES AS THE USER DESIRES WIT+iOUT ACTUALLY 0024 • REREAOING THE INPUT TAPE. 0025 • 0026 • THE EOfSET ENTRY ALLOWS THE SELECTION Of A REACTION TO 0021 • THE ENCOUNTER Of AN END-Of-fiLE ON THE TAPE. THE OPTIONS 0028 • AVAILABLE ARE 11 EXIT TO MONITOR CONTROL. 21 TRANSfER TO 0029 • A SPECifIED POSITION IN THE MAIN PROGRAM. OR 3J GETTING 0030 • 0031 Of A fLAG WHICH THE USER MAY CHECK IF HE WISHES. • 0032 • 0033 IF NEITHER Of THE SPECIAL OPTIONS ARE USED. THE PROGRAM • SIMPLY DUPLICATES THE FUNCTIONS Of (TSH) ANO ITSH"). 0034 • 0035 • - fAP SUBROUTINES AND fUNCTION IFORTRAN II COMPATIBLE) 0036 • LANGUAGE 0031 • EQUIPMENT - 709 OR 1090 (MAIN FRAME AND TAPE UNITI 003B - 114 REG I SYERS • STORAGE 0039 • SPEED 0040 - R.A. WIGGINS 4/64 • AUTHOR 0041 • 0042 ----USAGE---• 0043 • 0044 • TRANSfER VECTOR CONTAINS ROUTINES - INOT ANY) • AND fORTRAN SYSTEM ROUTINES - IIOH).(ROS).(ROCI.(RCH)~(TCO). 0045 0046 • (TEf).EXIT,(RERl •.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY REREAD 0047 0048 0049 • 0050 • fORTRAN USAGE Of REREAD 0051 • CALL REREAD 0052 • 0053 CAUSES THE NEXT 'READ INPUT TAPE' STATEMENT TO REINTER• 0054 PRET THE LAST CARD READ. WHEN USED. THESE READING STATE• 0055 MENTS SHOULD READ ONLY ONE CARD. REREAD MAY BE CAtlED • 0056 AS MANY TIMES AS DESIRED FOR VARIED INTERPRETATIONS Of • THE CARD. 0051 • •.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ENTRY EOFSET 0058 0059 0060 • 0061 • fORTRAN USAGE OF EOFSET 0062 • CALL EOFSETIZIFTRN.EOF.ITAPEI 0063 • 0064 EOFSET INITIALIZES THE ITSH) SUBPROGRAM TO ESTABLISH THE • MODE OF REACTION TO AN END OF fILE ENCOUNTER. MAY BE 0065 • 0066 RESET AS OFTEN AS DESIRED. • 0067 • 0068 • INPUTS TO EOfSET 0069 • LSTHN 0 CAUSES (TSHI TO EXIT ON END-Of-fILE (STANDARO 0010 ZlFTRN • OPERATING MODE IF EOFSET IS NEVER CALLED). 0071 • : 0 CAUSES (TSH) TO TRANSFER TO THE FIRST STATEMENT 0072 • 0073 fOLLOWING THIS 'CALL EOFSET' STATEMENT WITH AN ERROR • FLAG IEOf:l.) WHEN AN END-Of-fiLE IS ENCOUNTERED. 0074 • •••••• ~.~* •• ~ •••• *** ••• * . REREAD ••••••••••• * ••••••••••••• IPAGE •••••••••••••••••••••••• PROGRAM LISTINGS .. REREAD 21 IPAGE ... GRrHN 0 CAUSES ITSHI TO INTERPRET THE END-Of-fILE AS A BLANK RECORD AND SETS AN END-Of-fILE FLAG WHICH USER MAY CHECK AT WILL (USING ENDFIL). • • " OUTPUTS FROM EOFSET • EOF =0. AFTER EOFSET IS CAllED. =1. IF ZIFTRN=O. IN THE LAST CALL Of EOFSET AND If AN • END-OF-FILE IS ENCOUNTERED WHILE READING. • • I TAPE IS THE LOGICAL TAPE NUMBER THAT THE END-Of-fILE WAS • fOUND ON. liS OUTPUT ED ONLY WHEN EOf=l.)J • •-xxxxxxxxxxxxxxxxxxxxuxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxXXXX ENTRY ENOFIL . • fORTRAN USAGE Of ENDflL FUNCTION • EOF1 = ENDflLllTAPEI " •" • • • • ENDflL IS USED TO CHECK IF AN END-Of-fILE WAS INCDUNTEREO WHILE IN THE ZIfTRN GRTHN O. MODE (SEE EOF3ETt. OUTPUTS FROM ENDFIL EOF! =0. IF NO END-OF-FILE WAS ENCOUNTERED, OR If EOfSETIS NOT IN THE ZIFTRN=I. MODE. =1. IF AN END-Of-FILE WAS ENCOUNTERED, AND IF 10fSET IS IN THE ZIFTRN=I. MODE, AND If THIS IS THE flRSl CALL Of ENDFIL AFTER THE END-OF-FILE WAS ENCOUNTERED. ITAPE IS THE LAST LOGICAL TAPE NUMBER READ. " •" " " •" .xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx COMPUTATIONAL EXAMPLES "" 1. INPUTS " • " " " " •" • ." • • • • •" • ". •.. • • • • • • •" • " •" -".. . •. • _•••••••••••••• * •••••••• - ITPEX = 5 RCHK = o. KXl1 ••• 41 = 5,5,5,5 MXll ••• 4) = 5,5,5,5 LXll ••• 41 = 5j5,5,5 0015 0016 0011 001B 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 USAGE - C SET UP EXAMPLE TAPE REW IND ITPEX WRITE OUTPUT TAPE ITPEX, 10 FORMATIBH 1 2 3 41 10 END FILE ITPEX lEND FILE ITPEX END fILE ITPEX REWIND ITPEX C OPERATE ALL MODES C 1. READ LINE IN 12 fORMAT READ INPUT TAPE ITPEX, 20, IIX(I),I=I,41 20 fORMATl4I21 C 2. REINTERPRET IN 14 fORMAT CALL REREAD READ INPUT TAPE ITPEX, 30, IJXII),1=1,21 30 FORMATl214) C 3. REINTERPRET IN f fORMAT CALL REREAD READ INPUT TAPE ITPEX, 40. IXIII,I=l,4) 40 fORMATI4f2.0) C 4. SETUP EOfSET IN ZIFTRN=I. MODE AND ENCOUNTER ENO OF C FILE CALL EOFSETt1.,EOfl,ITAPE1) READ INPUT TAPE ITPEX, 20, tKX(I),I=1,41 EOf2 = ENOFIL (ITAPE2) EOf3 = ENDflL (ITAPE3) C 5. SET UP EOfSET IN lIfTRN = O. MODE AND ENCOUNTER NEXT C END OF FILE tALL EOfSETI0.,EOf4,ITAPE41 IF IEOF41 50,50,60 50 READ INPUT TAPE ITPEX, 20. (LXIII,I=1,41 C PROGRAM NEVER REACHES HERE RCHK=l. C PROGRAM COMES HERE AFTER END OF FILE 60 CONTINUE C 6. SET UP EOFSET IN llfTRN = -1. MODE ANO ENCOUNTER C LAST END OF fILE • CALL EOFSETI-l.,EOF5,ITAPE51 READ INPUT TAPE ITPEX, 20, (MX(II,I=I,41 0111 0112 0113 0114 Oll5 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 21 •••••••••••••••••••••••• REREAD * •••••••••••••••••••••••• PROGRAM LISTINGS • IPAGE •••••••••••••••••••••••• IPAGE 3) 3) C * • • * • • * • * • •• OUTPUTS - •• ••••••••••••••••••••••• REREAD • PROGR~M IX(1.~.4) EXITS = 1,2,3,4 JXf1 ••• 2' = 102,304 Xf1 •• J4) = 1.,2.,3.,4. EOFl=O. ITAPE1=0 KXI1 ••• 4)=-0,-0,-0,-0 EOF2.1~ EOF3=0. ITAPE3=5 ITAPE2=5 EOF4=1~ ITAPE4=5 LXI1 ••• 41=5.5.5,5 RCHK = O. EOF5=0. ITAPE5=0 MXll.~.41=5,5,5,5 PROGRAM FOLLOWS BELOW • XR4 PZE BCI BUFSlZ EOU •• o 1,REREAD 22 BCD RECORD BUFFER SIZE READ INPUT TAPE lTARE ENTRY IF NOT UNOER MONITOR CONTROL. • LOGICAL TAPE NUMBER IS IN THE ACCUMULATOR. * CTSH) STO ITAPE SAVE LOGICAL TAPE NUMBER. LOO NOP PICKUP SWITCH SETTING. AND SIIOHI .GO INITIALIZE IIOH). TRA* NOP NOP TSH INPUT I TAPE TO STORAGE HOLLERITH~ •* READ INPUT TAPE ITAPE ENTRY IF UNDER MONITOR CONTROL. •(TSHMI *- • •• S:rO LDO SLO TRA* ~~~~ii¥ ii~~ SXA NOP XEC* AXC PXA STA* XEC. TSHSW TRA LOO* SLO LDOSLO TCOA TCO TEF TEFA TSX RER AXT CLA $f0 TIX TSHX AXT TRA TRA TSH SWIl ITAPE NOP TSHSW SIIOH) SAVE LOGICAL TAPE NUMBER~ PICKUP SWITCH SETTING, AND SET MONITOR SWITCH, THEN -GO INITIALIZE IIOHI. ii~~i. TSHX.4 REREl SIRDS) TSHC.4 ,4 SIRDC) SIRCHI RER SITCOI TCO SITEF) TEF • SEXIT URER)_4 BUFSIZl4 -1.4 RECl+t;4 *-2.4,1 ••• 4 1,4 SAVE RETURN INDEX TRA RERE1 IF REREAD ENTRY SELECT CURRENT UNIT INIT IAlIZE FOR READ CHECKING. READ ONE TAPE RECORD. *EXIT TO CHECK READING. UNLESS IN MONITOR MODE. THEN GET TCO AND TEF INSTRUCTIONS FROM IIOS). WAIT TO COMPLETE READING. .EXIT ITO EXIT OR MAIN) IF END OF FILE. *GO CHECK READING ERROR. SAVE INPUT BUFFER IN REC1. RESET IR4. AND .REENTER IJOHI. THAT IS ALL OF THE READING OPERATION. • REREAO ENTRY. • REREAD SXD CLA STD TRA •• SAVE IR4. SET SWITCH SWIl, AND *RETURN TO MAIN. REENTRY FROM SWll •REREl * XR4,4 TRA SWIl 1,4 AXT CLA S10 TlX CLA STD TRA 8UFSIZ.4 REC1+l~4 -1,4 .-2.4.1 NOP SWIl TSHX RESTORE IIOH) BUFFER. RESET SWITCH SWIl. AND .RETURN TO IIOHI. 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 UiOL 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 .•••••••••••••••••••••••• . REREAD •••••••••••••••••••••••• (PAGE PROGRAM LISTINGS _............................. .. .. REREAD 4) (PAGE ENTRY TO DEfINE NEEDED ACTION IN CASE Of END-Of-fILE. ... XR4E PlE o CONTAINS XR4 FOR RETURN ON EOf EOfSET SXD STZ* CLA .. TZE TPL CLA TRA EOFl CLA TRA EOFP CLA STOE STA TRA XR4E.4 2.4 1.4 EOfZ EOFP EXAD STOE TRAD STOE COAD TEF 4.4 . SAVE IR4. SET EOF TO lERO. AND CHECK DESIRED ACTION ON EOf ENCOUNTER, EOf=-X - EXIT ON EOf. EDf=O. - RETURN TO XR4E POSITION IN MAIN ON EDF. EOf=+X - SET EOF fLAG. "RETURN TO MA IN. • CONTROL COMES HERE ON END Of fILE IN NON-MONITOR MODES. • TRAN LXD CLA STO .. CLA STD. TRA CONTI AXT CLA STO TIX CLA STO TRA XR4E.4 PREPARE TO RETURN TO XR4E. :1. SET EOf flAG. 2.4 !TAPE SET TAPE NUM8ER THAT EOf WAS ENCOUNTERED ON. 3.4 4.4 "RETURN TO XR4E. BUFSIZf4 SET =0606060606060 BUFFER TO RECl+1.4 BLANKS. "-2.4.1 =1. SET EOF flAG. EOF REREl *RETURN TO (IOH) INDIRECTLY. .* END OF FILE FUNCTION ENTRY • ENDflL CLA STO* CLA STO STZ CLA TRA .... CONSTANTS .. EXAD PZE TRAD COAD EOfl EOf !TAPE • .. • RECI !TAPE l.4 EOF EOFl EOF EOFl 2.4 GET TAPE NO. .. RETURN TO MAIN. AND STORAGE NEEDED BY REREAD ET AL. PlE PlE PlE PlE PlE BES PZE $EXIT TRAN CONT I 0 0 0 BUfSIl-l 0 RECORD READING AND BUFfER DEfINITIONS TSHC REC IORT COMMON COMMON END .. •••••••••••••••••••••••• RECttBUfSIl -206+BUfSIl READ 1 20-WDRD BCD RECORD. 1 INPUT BUFFER 0224 0225 0226 0221 0228 0229 0230 0231 0232 0233 0234 0235 0236 0231 0238 0239 0240 0241 0242 0243 0244 0245 0246 0241 0248 0249 0250 0251 0252 0253 0254 0255 0256 0251 0258 0259 0260 0261 0262 0263 0264 0265 0266 0261 0268 0269 0210 0211 0212 0213 0214 0275 0216 0217 0278 0219 0280 0281 0282 41 •••••••••••• * ••• * ••••••• RETURN •••••••••••••••••••••• * ••* REFER TO LOCATE PROGRAM LISTINGS •••••••••••••••• *** •••• * RETURN * .** ••• **.* •••••••••••••• • REFER TO LOCATE •••••• ••••••• * ••••••••• ~ • REVER PROGRAM LISTINGS • •••••••••••••••••••••••• •••••••••••••••••••••••• • •.REVER •••••••••••••••••••••••• • REVER • LAST CARD IN DECK IS NO. 0097 0001 0002 0003 COUNT 106 0004 REVER LBL 0005 ENTRY REVER tX,LX.XREVDI 0006 • 0007 ----ABSTRACT--~• 0008 • 0009 • TITLE - REVER 0010 • REVERSE A VECTOR ELSEWHERE OR IN PLACE 0011 • REVER REVERSES THE STORAGE ORDER OF A VECTOR. 0012 • 0013 OUTPUT MAY REPLACE INPUT. • 0014 • 0015 - FAP SUBROUTINE IFORTRAN-II COMPATIBLE) • LANGUAGE 709 OR 7090 (MAIN FRAME ONLY) 0016 • EQUIPMENT 0017 - 30 REGISTERS • STORAGE 41 + 6.l MACHINE CYCLES; IF l IS EVEN. l~ VECTOR LENGTH 0018 • SPEED 0019 47 + 6-l MACHINE CYCLES, IF l IS 000 S.M. SIMPSON, SEPT 1963 0020 - AUTHOR 0021 • 0022 ---USAGE--• 0023 • 0024 - TRANSFER VECTOR CONTAINS ROUTINES - INONE) 0025 • AND FORTRAN SYSTEM ROUTINES - (NONE) 0026 • 0027 • FORTRAN USAGE 0028 " CALL REVER IX,LX,XREVD) 0029 • 0030 - INPUTS 0031 • XU) 0032 1=1 ••• LX IS A VECTOR IN ANY MODE • 0033 • lX 0034 SHOULD EXCeeD 0 • 0035 • 0036 STRAIGHT RETURN WITH NO OUTPUT IF lX lSTHN 1 " OUTPUTS 0037 "" 0038 XREVOCil l=l ••• tX IS XREVOll)= XllXl. XREVD(21= XltX-lJ, ETC 0039 " 0040 EQUIVALENCE IXREVD,X) IS PERMITTED " 0041 "• EXAMPLES" 0042 0043 "" 1. INPUTS - IXU ••• 4} = 102,3,4 0044 0045 USAGE tALL REVERt IX, 1. IXRll • 0046 CALL REVER I IX, 2, IXR2) • 0047 CALL REVER I IX, 3, IXR3) " 0048 CALL REVERI IX, 4, IXR4) "• 0049 IXR3tl ••• 3) ~ 3,2.1 IXRl = 1 IXR2 11 ••• 2)= 2.1 OUTPUTS 0050 IXR41l' •• 4) = 4,3,2.1 " 0051 "" 2. INPUTS - XU ••• l) ,. 1., 2 •• 3. 0052 Y= -999. 0053 USAGE CALL REVERCX,O,YI • 0054 tAll REVERIX,3,X) • 0055 Xll ••• 3) ,. 3.,2.~IJ OUTPUTS - Y ,. -999. (NO OUTPUT CASE) " 0056 "" PROGRAM FOLLOWS BELOW 0057 0058 • 00'59 • 0060 • NO TRANSFER VECTOR 0061 HTR XRl 0 0062 XR4 HTR 0 0063 1,REVER BCI 0064 " ONLY ENTRY. REVER (X,lX,XREVD) 0065 REVER-2,4 REVER SXD 0066 REVER-3,1 SXD 0067 1,4 AIX) etA Kl 0068 GETXH STA 0069 AlXl+l ADO Kl 0070 STA GETXl 0071 3,4 AlXREVO) ClA 0072 STOXl STA 0073 AIXREVD)+1 ADO Kl 0074 STA STOXH - REVER FAP ISUBROUTINE) 9/29/64 .•••••••••••••••••••••••• . REVER •••••••••••••••••••••••• IPAGE PROGRAM 1I STINGS 2) 2,4 lX ClA" TMI lEAVE ARS LX/2 1 POX 0,1 TRUIIICATED. ADD KDHAF ILX+lI12 0,4 POX TRUNCATED TXl lEAVE.4,0 • EXCHANGE LOOP • XRl STARTS AT lX/2 TRUNCATED. MOVES UP. .. XR4 STARTS AT IlX+1)/2 TRUNCATED, MOVES DOWN. ... ,1 ...... AIX) GETXH ClA .... ,4 ••:AIXI+l GETXl lDQ •• ,4 .... =AIXREVOI+1 STOXH STO "."AIXREVDl STOXl STQ ·",1 ,,+1.1,1 TXI GETXH,4,1 TIX .. EXIT LEAVE lXD REVER-2,4 lXD REVfR-3,1 TRA 4.4 • CONSTANTS KDHAF OCT 000000400000 END ......., •.••..•.•.....•.. • REVER • •••••••••••••••••••••••• IPAGE 2) 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 ........................ , • REVERS ' PROGRAM LI STINGS •••••••••••••••••••••••• • REVERS (SUBROUTINE) • FAP .REVERS COUNT 60 REVERS LBL ENTRY REVERS (LX,X) • ............ .............. ., * ••••••••••••••••••••••• REVERS • ~ 9/29/64 LAST CARD IN DECK IS NO. 0016 0001 0002 0003 0004 0005 0006 ----ABSTRACT---0001 * 0008 .. TI TLE - REVERS 0009 * FAST REVERSE STORAGE ORDER OF A VECTOR 0010 0011 ** LANGUAGE ~ FAP' SUBROUTINE (FORTRAN II COMPATIBLE) 0012 • EQUIPMENT - 709 OR 1090 (MAIN FRAME ONLY) 0013 0014 • STORAGE - 29 REGISTERS 0015 .. SPEED - ABOUT 6"LX + 32 MACHINE CYCLES ON THE 1090 0016 • WHERE lX IS THE lENGTH OF THE VECTOR • .. AUTHOR - R.A. WIGGINS, 19/B/62 0011 0018 -~--USAGE--0019 0020 *.. TRANSFER VECTOR CONTAINS ROUTINES NONE 0021 .. AND FORTRAN SYSTEM ROUTINES NONE 0022 0023 0024 • FORTRAN USAGE 0025 • CALL REVERSfLX,X) 0026 ** INPUTS 0021 0028 x([) l:l ••• LX [S A VECTOR OF NUMBERS (ANY MODE) 0029 0030 IS FORTRAN II INTEGER 0031 LX MUST BE GRTHN=l 0032 0033 0034 • OUTPUTS 0035 X(I) I:l ••• LX SAME AS ABOVE ONLY REVERSED 0036 * 0031 .. EXAMPLES 0038 0039 0040 .. 1. INPUTS X(1 ••• 4)=1,2,3.4 LX=4 .. OUTPUTS - X(1 ••• 4):4,3,2,1 0041 0042 0043 .. 2. INPUTS - X(t ••• 5)=1.,2.,3.,4.,5. LX=5 0044 * OUTPUTS - X(1 ••• 51=5.,4 •• 3.,2.,1. 0045 0046 • 3. INPUTS - X=1 LX=l 0041 .. OUTPUTS - X=l 0048 0()49 PZE 1,REVERS 0050 BCI 0051 REVERS SXD ·-2,4 0052 SXA ADR,l 2,4 0053 ClA 0054 ADO =1B35 0055 STA X X+l 0056 STA 0057 X+2 STA X+3 0058 STA 0059 CLA. 1,4 ,4 0060 POX 0061 ARS 1 ,1 0062 POX 0063 =lB17 SUB 0064 ADR-l TM! 0065 STD *+1 0066 TIX *+1,4,*. 0067 X CLA • .. ,1 0068 LDQ .*,4 0069 $TO ··t4 STQ 0070 ··,1 .+1,4,1 0011 TXI X,l,l 0012 TIX 0013 LXD REVERS-2,4 •• ,1 0014 ADR AXT • • . • • . • •. • • . • . • .. • ••••••••••••• ***** •••••• REVERS *• * ••••••• '* ******.****._** (PAGE PROGRAP-I LISTINGS ~ * ••••••• * ••••• *.** ••••• * * REVERS ••••••• *** •••••• **** •••• (PAGE 2) TRA ENO 0015 0076 21 .........'••••••• *** •• ** •• RLSPR •........... ............... .• PROGRAM LISTINGS ' • RLSPR ISUBROUTINE) LABEL • CRLSPR SUBROUTINE RLSPR ILL,AA,RR,ALP) 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 C C C C C C C C C •••••••••••••••• ** ••••• * .*....................... • RlSP'R • LAST CARD IN DICK IS N0. 0120 0001 0002 0003 0004 ---ABSTRACT---0005 0006 0007 TITLE - RLSPR REALIZABLE LEAST SQUARE 'PREDICTOR BY RECURSION, 1-DIMiNSION 0008 0009 0010 RLSPR INCREASES THE LENGTH OF A REALIZABLE, LEAST SQUARE PREDICTION ERROR OPERATOR A1K,L) 8Y ONE. TflAT IS, GIVEN 0011 0012 THE VECTOR AIK,L) IK REFERS TO THE K-TH ELEMENT IN A VECTOR OF L+l ELEMENTS) THAT SATISFIES THE EQUATIONS 0013 0014 0015 + + All,ll*RIL-11 + ACO'L)*RIL} .. 0 0016 0017 + + Al1,Ll*RIL-21 + ACO'Ll*RIL-1'* 0 0018 0019 0020 0021 AtL.LI*RIL-ll + ••• + All.L)*RIO) + 4IO,U"RIlI * 0 0022 0023 WHERE AtO,Ll IS CONSTRAINED TO BE 1, THEN RlSPR INCREASES THE LENGTH OF AIK,L) SO THAT IT SATISFIES THE EQUATIONS 0024 0025 AfL+l.L+ll*RIO)+ ••• + Al1,L+l,*RCL) + A(0~L+1J*RIL*11-0 0026 ETC. 0021 0028 0029 IF RIK) REPRESENTS THE AUTOCORRELATION OF A TIM& SERIES XU) 0030 0031 RIKI • EXPECTED VALUE (XIT+KI.X(T)1 0032 0033 THEN THE SET OF EQUATIONS A80VE ARE THE NORMAL IHlUATlONS 0034 FOR THE PREDICTION ERROR OPERATOR 0035 0036 AtL,L)*XIT-LI +••• + Al1,L)*XIT-l)+AI0.L)*XITI~ EPStT'L) 0037 0038 0039 WHERE EPSIT,LI IS THE ERROR SERIES. 0040 AS A MATTER OF TER~INOLOGY, WE DEFINE 0041 AfL,Ll*Rlll + ••• + AIl,L)*RILI+AIO,L)*RIL+ll- ALPfL*l,L) 0042 All,L)*RI-L)+ ••• + AIl,LI*RI-1)+A10,L).RtO) • ALPIO.L) 0043 0044 WHERE ALPIO,L) IS THE COVARIANCE OF EPSIT,LJ. fHAf IS 0045 0046 0041 ALPIO,LI • EXPECTED VALUE IEPSIT,LJ*EPSIT,L)). 0048 0049 RLSPR RETURNS THE VALUE OF ALPIO.L+11. 0050 LANGUAGE ~ FORTRAN II SUBROUTINE 0051 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0052 0053 STORAGE - 142 REGISTERS 0054 SPEED - ABOUT .000071.L + .00040 SECONDS ON THE 1094 MOD 1 • 0055 AU1HOR - R.AJ WIGGINS 3/63 0056 0057 ---USAGE---0058 0059 TRANSFER VECTOR CONTAINS ROUTINES - FDOTR 0060 AND FORTRAN SYSTEM ROUTINES - NONE 0061 0062 FORTRAN USAGE 0063 CALL RLSPR ILL,AA,RR,ALP) 0064 0065 INPUTS 0066 0067 IS THE LENGTH OF THE INPUT SERIES A. (EQUALS L~l) LL 006B MUST BI GRTHN=O 0069 0010 I=l, •••• LL CONTAINS THE OPERATOR AIO.L) THROUGH AIL,L). AAIII 10/5/64 0071 RRII) I-l •••• ,LL+1 CONTAINS THE AUTOCORRELATION VECTOR RIO) THROUGH R(L+ll. 0012 0013 0074 .•••••••••••••••••••••••• . RLSPR •••••••••••••••••••••••• (PAGE PROGRAM LISTINGS Z) c c ALP •••••••••••••••••••••••• .. RLSPR CONTAINS ALPIO,ll AS DEFINED IN THE ABSTRACT. C OUTPUTS C C II IS INCREASED ONE FROM THE INPUT VALUE. AA(II 1=1, •••• ll INEW Lli CONTAINS THE OPERATOR AIO.l+l) THROUGH AIL+l,l+ll C C C C ALP C C C EXAMPLES CONTAINS ALPIO.l+ll, C C 1. INPUTS - LL~O RR(I ••• ~1 = I.Z5,.5,O.,O.,0. OUTPUTS - AACl)=l. AlP=l.Z5 C C C C SAME AS EXAMPLE 1. 00 10 1=1,5 CAll RlSPR tlL.AA.RR,CI 10 CONTI NUE OUTPUTS - AAtl ••• 51 = 1.,-0.4985,0.2463,-0.1173,0.0469 Z. INPUTS USAGE C C C C C PROGRAM FOLLOWS BELOW C 10 30 DIMENSION AAII0),RRII01 ll=ll LZ=Ll+l IFill) BO,10,30 AA(1)=I. ALP=RR(11 GO TO 70 CALL FDOTR {ll.AA,RR(ZI.ALPll .. •••••••••••••••••••••••• (PAGE ZI AlP';1.0007 0075 0076 0077 007B 0079 0080 0081 008Z 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 AAL=-ALI'"L/ALt- 35 38 40 60 70 BO AAllZ'=O. J=LZ lH=(lZ+ll/Z DO 40 I=l.lH AAT=AAIJI AA(JI=AA(JI+AAl-AAIIJ IF I J-Il 60,60,38 AAIII:AAIII+AAl*AAT J=J-l AlP=AlP+AAl*AlPL ll=lZ RETURN END 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 •••••••••••••••••••••••• PROGRAM LI STINGS ........................... • RLSPR2 • ..,•.....•.•.•.......... • RlSPR2 • ••••••••••••••••••••••••• • Rl.SPR2 I SUBROUTINE) 9/9/64 lAST CARD IN DICK .JS NO. 0280 • LABEL 0001 CRlSPR2 0002 SUBROUTINE RLSPR2 (NRA,NCAT,NCAN,AA,NRR,NCR,RR,C.IANS) 0003 C 0004 C ----A8STRACT---0005 C 0006 C TITLE - RlSPR2 0007 C REALIlA8tE LEAST-SQUARE PREOICTOR BY RECURSION - 2 DIMENSIONS 0008 C OOM C C C C C C C C C C RLSPR2 INCREASES THE LENGTH OF ONE DIMENSION OF NRA 2DIMENSIONAL LEAST SQUARE PREDICTION OPERATORS ONE. WHERE ARA (NUM8ER ROWS 1N A) IS THE WIDTH OF THE OPERATOR IN THE OTHER DIMENSION. THAT IS. GIVEN THE PREDICTION OPERATORS AII,J,KI· 1 .... ,NRA, J z O.l, ••• ,NCAN,! K.. NRA WHICH SOLVE THE EQUATIONS .Y 1. 1O.... NRA NCAN SUM t SUM C ACI.J.KI'RCI-M.J+N-1' , ) .. 0 1=1 J=O C C C C C C C 0~5 C C C C C C C C C C C C THEN RlSPR2 INCREASES THE J/TH DIMENSION BY ONI SO THAT THE EQUATIONS ARE SATISFIED FOR J .. 0.1 ••••• NCANjNCAN+l. IF RCI.JI I=-NRA ••••• -1.0.1, ••• NRA. J=0.1.J •• N4AN REPRESENTS ONE-HALF OF A TWO DIMENSIONAL AWTOCIIRRflATHIN RCK.lI " EXPECl'ED VALUE CXll+K.J+U.XlItJII THEN THE FIRST SET OF EQUATIONS ABOVE ARE THE NORMAL EQUATIONS FOR THE PREDICTION ERROR OPERATOR C C C C 0040 0041 0042 OO~ C C C C C C C C C C C AS A SECONDARY OUTPUT, RlSPR2 RETURNS AN NRA X NRA MATRIX CIL.KI THAT IS DEFINED BY NRA NCAN Cll.KI .. SUM I SUM C AII.J.KI.RCI-l,JI I I. 1=1 J=O THE MATRIX CONTAINS THE COVARIANCE OF THE EXPECTED SQUARED ER~ORS Cll,KI .. EXPECTED VALUE I EPSCM,N+l.KI •• a C C 0026 0027 0028 0029 0030 0031 003a 0033 00310 0035 0036 0037 0038 00" NRA NCAN SUM I SUM I ACI.J.KI.XCM-I.N-J) I I = EPS(M,N.Kl 1=1 J=O C C C C C C C C C C C C C C C C C C 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 FOR l .. l ••••• NRA LANGUAGE EQUIPMENT STORAGE SPEED AUTHOR K=I ••••• NRA. FORTRAN II SUBROUTINE ·709 OR 7090 IMAIN FRAME ONLY) 700 REGISTERS A80UT .00010.M.N •• 3 SECONDS ON THE 7094 MOD 1 FOR N GRTHN 7 AND M GRTHN 25 • - R.A. WIGGINS MAY. 1963 GEOSCIENCE. INC. - ----USAGE---TRANSFER VECTOR CONTAINS ROUTINES - DOTJ.DOTP.IXCARG.MATMl3~MOVREV' SIMEQ,STl AND FORTRAN SYSTEM ROUTINES - NONE FORTRAN USAGE CALL RLSPR2INRA.NCAT.NCAN.AA.NRR,NCR.RR.C.IANSI 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 00" 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 •••••••••••••••••• ** •••• PROGRAM LISTINGS RLSPR2 * ...........•.•.... _.....* •••••••• * •••••• ***-*-*** _ RLSPR2 * •••••••••••••••••••••••• 2) IPAGE IPAGE C INPUTS C NRA C C C NCAT C C C C NCAN C C C C AA(ll C NUMBER ROWS OF A. MUST Bf GRTHN= 1 NUMBER COLUMNS OF A TOTAL, I.E. THIS IS THE ON THE NUMBER OF COLUMNS OF A. MUST BE GRTHN=l NUMBER COLUMNS OF A NOW, I.E. OF THE A PREDICTORS. MUST BE GRTHN=O, LSTHN=NCAT LIMIT THIS IS THE PRESENT lENGTH L=l, •••• NRA*NCAT*NRA CONTAINS AII,J.K) STORED AS FOllOWS l=l.J.NRA CONTAINS I=l ••• NRAj~.O.K~l =NRA+l ••• 2*NRA CONTAINS I=l ••• URA'~*l,K*1 C C C C C C C C C C C C C C C C C C UP~ER =(NCAN-ll*NRA+l ••• NCAN*NRA CONTAINS =NCAT*NRA+l ••• NCAT*NRA+NRA CONTAINS =NCAT+INCAN-IJ*NRA+l ••• NCAN*NRA CONTAINS K=l I-l ••• URA.J*NCAN 1=1 ••• NRAJJ*0,K~2 1=1 •• JNRA~J*NCAN.K~2 ETC. NRR NUMBER ROWS OF R. MUST BE GRTHN=l AND 000. NCR NUMBER COLUMNS OF R. MUST BE GRTHN=l ::: .. Y._" ••• ., .•l.,n,,_I.'''-''' ,,,.,-,.v,, ......... ,,, .. .... .•• ~ t'a.I~ r. ....... K=O, ••• ,NCR-1 STORED CLOSELY SPACED. I=1, •• _.3*NRA*NRA+NRA IS COMPUTATION SPACE NEEDED BY RLSPR2. IS INCREASED BY ONE L=l ••••• NRA*NCAT*NRA CONTAINS AII.J.K). l=l, ••• ,NRA, J=O, •••• NCAN-l, K=I •••• ,NRA STORED WITH CIMENSION (NRA.NCAT,NRA). I-l ••••• NRA*NRA CONTAINS THE ERROR MATRIX OEFI~E0 IN THE ABSTRACT STORED CLOSELY SPACED BY COLUMNS. =0 =1 =2 =3 =4 C C C C C C EXAMPLES C C 1. EXAMPLE C INPUTS C USAGE C C OUTPUTS C C C C 2. EXAMPLE C INPUTS C C C C USAGE C OUTPUTS C C ~&., NRR/2 C C CIII C C C C OUTPUTS C NCAN C C AAIll C C C C CI Il C C C IANS C C IF IF IF IF IF NO TROUBLE NCAN GRTHN=NCAT ON ENTRANCE NCAN LSTHN 0 OVERFLOW OCCURS DURING INVERSION OF MATRIX C~ MATRIX C IS SINGULAR (THEORETICALLY IMPOSSiBLE). OF A ONE-DIMENSIONAL AUTOCORRELATION NRA 1 NCAT = 5 NCAN = 0 NRR 1 NCR = 2 RRIl ••• 21 = 1.25,.50 00 10 l=l,NCAT 10 CALL ~LSPR2INRA.NCAT.NCAN,AA.NRR,NCR'RR.E,IANSt - IANS = 0 AAll ••• 51 = 1.000,-0.499.0.246,-0.117,(.047 C (1) = 1.001 = OF FIRST CALL OF RlSPR2 - NRA "1 NCAT = 5 NCAN = 0 NRR = 3 NCR = 3 RRll ••• 91 = 0.302 0.105 0.010 (STORED 1.340 0.~21 0.202 BY 0.302 0.105 0.010 COLUMNS) CALL RLSPR2INRA.NCAT.NCAN,AA,NRR,NCR~RR.E.1ANS' - IANS = 0 AAll ••• 451 lEACH 3 ROW BY 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 1.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0101 0108 0109 0110 0111 OU2 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 21 •••••••••••••••••••••••• • RlSPR2 •••••••••••••••••••••••• PROGRAM LISTINGS • * RlSPR2 • •.. ,...•...•.•.......... (PAGE 3) •••••••••••••••••••••••• (PAGE 3' c c c c c c c c c c c c 5 COLUMN ARRAY IS STORED CLOSELY SPAtED BY COLUMNS. THE ARRAYS ARE ALSO CLOSelY SPACED.) Cll ••• 9) c c 1.340 0.302 0.000 0.302 1.340 0.302 0.000 0.000 0.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0:.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 O.ClOO 0.000 0.000 0.000 0.000 0.302 1.340 C 3. GENERAL EXAMPLE. C C C C C C C C C INPUTS - SAME AS EXAMPLE 2. - SAME AS EXAMPLE 1. USAGE OUTPUTS - IANS = 0 AAll ••• 45) 1.000 -0.507 0.051 0.079 -0.046 0.000 0.032 0.015 -0.037 0~019 0.000 -O.OOB -0.004 0.011 -0.006 0.000 0.032 1.000 -0.515 0.000 0.032 0.015 -0.037 0.019 0.048 0.090 -0.052 0.015 -0.037 0.019 C 0.000 -O.OOB -0.004 0.011 -0.006 0.000 0.032 0.015 -0.037 0.019 1.000 -0.507 0.051 0.079 -0.046 C C C C C C C C Cll ••• 91 = 1.039 0.271 -0.002 0.271 -0.002 1.0.37 0.271 0.271 1.039 C C PROGRAM FOllOWS BELOW C OIMENSION AA(2).RRI21,C(2),CM(21 COMMON eM l=NRA M=NCAN MT:NCAT ll=l*L llMT=lL.MT lMT=l*MT lM=l*M CAll IXCARG IC,IC1) IC2=ICl+ll IC3=IC2+XMAXOFltl,l+ll IC4=!C3+ll CAll IXCARG IAA,IAI lH=ll+1l/2 lHl=lH·l ll=l+l Ml:INRR+1l/2 IAN=O IF IMT-M) 10,10,20 10 IAN:l GO TO 1000 20 CONTINUE IF 1M) 30,40,100 30 IAN:2 GO TO 1000 C SPECIAL CASE - M=O 40 CONTINUE CAll STZ (llMT,AAI CAll MOVREVtl,Oil.,lMT+l,AA,I) JCl=ICI JC2=ICI IR=Ml CAll STZ (LltC I DO 60 Il=ltl IF (IR) 70,70,50 50 CONTINUE LMO=L-Jl+l CALL MOVREV (lMO,O,RR(IRI, ll,CMIJC11,1) 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 015.9 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 C175 0176 0177 017B 0179 0180 0181 0182 01B3 01B4 01B5 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0206 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 ••••••••••••• * ••• *.* •••• • RlSPR2 • PROGRAM LISTINGS ••• * ••••••••••••• * ••••• * IPAGE 4) CAll MOVREV IlMO,O.RRIIR), l1,CMIJC21,1) IR=IR-1 JC1=JCl+1 JC2=JC2+l 60 70 CONTINUE GO TO 170 C GENERAL CASE 100 CONTINUE C FIND ZETA MATRIX JC1=IC3 DO 120 11=1,LlMT,LMT DO 110 12=1,L CALL OOTP (l,M,AAlI11,NRR,NCR,RR,M1-12,l,CMIJC1I,-2J) 110 JCl=JC1+1 120 CONTI NUE C FINO K MATRIX CALL MATML3 IL,l,L,CMII(2),CM(IC3),O,CMIIC4),Ol 1001 1=1. C FORM THE lENGTHENED PREDICTORS. LMH= I lM+L+1) 12 KC1=IC2 KC2=IC2+L IA1=1 lA2=LM+l DO 160 13=1,LMH CALL MOVREV IL,LMT,AA(IA1I,l,CMIKCll,l) CALL MOVREV IL,lMT,AAflA2),I,CMIKC2),lJ JC1=KCl JC2=KC2 KKl=IC4 00 150 I4=1,L CALL DOTJ IL,1,CMIKK1),LMT,AAIIA2),CMCJC1),1,l) CALL DOTJ IL,1,CMIKK1l,LMT,AA(IA1J,CM(JC2),1,lJ KK1=KK1+L JC 1=JC1+1 150 JC2=JC2+1 CALL MOVREV IL,1,CM(KClI,LMT,AAIIAl),11 CALL MOVREV IL,1,CMIKC21,LMT,AAIIA2l,1) IA1=IA1+1 160 IA2=IA2-1 C FORM NEW ALPHA MATRIX CALL MATML3 IL,t:,L,CMI IC31,CMI IC41,0,CMI ICll, 11 C FIND INVERSE OF ALPHA 170 CONTI NUE CALL MOVREV ILL.1,CMIICIJ,1,CMIIC21,-I) CALL STI ILl,CMIIC3') CALL MOVREV IL,O,!., Li,CMIIC31,11 0=1. CALL SIMEQ tL,L~l~CMIIC21,CMIIC3),D,CMIIC41,ERR) IF IERR) 190,190,180 180 IAN=ERR+2. GO TO 1000 190 CONTINUE NCAN=M+l 1000 IANS=IAN RETURN END •••••••••••••••••••••••• • • •••••••••••••••••••••••• RlSP~2 (PAGE 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 Ul~b 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0212 0213 0214 0275 07.76 0211 0218 0219 0280 4) •••••••••••••••••••••••• RLSSR • ••••••••••••••••••••••••• PROGRAM 1I STINGS • RLSSR ISUBROUTINE) 9/29/64 • LABEL CRLSSR SUBROUTINE RLSSR (LL,AA,RR,GG,FF,ALPI 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 C C C C C C C C C •••••••••••••••••••••••• RLSSR • •••••••••••••••••••••••• • LAST CARD IN OECK IS NO. 0114 0001 0002 0003 0004 ~--ABSTRACT---0005 0006 0007 TITLE - RLSSR 0008 REALIZABLE LEAST SQUARE SHAPER BY RECURSION 0009 0010 RLSSR INCREASES THE LENGTH OF A REALIZABLE LEAST SQUARE 0011 SHAPER FILTER FIK,LI BY ONE. THAT IS, GIVEN THf VECTOR 0012 F(K~LI ~K REFERS TO THE K-TH ELEMENT IN A VECTOR OF 0013 LENGTH Ll THAT SATISFIES THE EQUATION 0014 0015 GCl-U 0016 + 0017 0018 + 0019 0020 Gt.O) 0021 0022 AND A{K.LI ANO ALP(O.LI AS GIVEN BY RLSPR 0023 THEN RLSSR INCREASES THE LENGTH OF FIK.LJ SO THAT 0024 IT SATISFIES THE EQUATIONS 0025 0026 FIL+1.L+11*RIOI + ••• + Fl1.L+11*RILI • GILl 0027 ETC. 0028 0029 IF RIKI REPRESENTS THE AUTOCORRELATION OF A WAVELET XCTI 0030 0031 RtKI ~ SUM IX(T+KI*XITJI 0032 0033 ANO GIK) REPRESENTS THE CROSSCORRELATION OF A OISIREO 0034 OUTPUT DITI WITH THE WAVELET XITI 0035 0036 0037 GtKI ~ SUM IDITI*XIT-Kll 0038 THEN THE FIRST SET OF EQUATIONS ABOVE ARE THE NGR~AL 0039 EQUATIONS FOR A SHAPER FILTER 0040 0041 OfT) - IFIL,LI*XIT-Ll + ••• + FI1,LI-XIT-11 • ZETIT,L) 0042 0043 WHERE ZETIT.LI IS THE ERROR SERIES. 0044 0045 LANGUAGE - FORTRAN II SUBROUTINE 0046 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLYI 0047 0048 STORAGE - 82 REGISTERS 0049 SPEEO - ABOUT .000I62*L + .00011 SECONDS ON THE 7094 MOO 1 • 0050 AUTHOR - R.AJ WIGGINS 3/63 0051 0052 ----USAGE---0053 0054 TRANSFER VECTOR CONTAINS ROUTINES - FOOTR 0055 ANO FORTRAN SYSTEM ROUTINES - NONE 0056 0057 FORTRAN USAGE 0058 CALL RLSSR tLL,AA,RR,GG,FF,ALP) 0059 INPUTS 0060 0061 0062 .L+1 THE OUTPUT LENGTH OF THE SERIES F. LL 0063 MUST BE GRTHN-1 0064 AAIII I.I, •••• LL CONTAINS THE PREOICTION ERROR OPERATOR AtO,L' 0065 0066 THROUGH AI L. LI. 0067 0068 I.1, •••• LL CONTAINS THE AUTOCORRELATION VECTOR RIO) RRIII THROUGH RILl. 0069 0070 GGII) 1.1, •••• LL CONTAINS THE CROSSCORRELATION VECTOR GIO) 0071 THROUGH GIll. 0072 0073 0074 FF( I I l~l, •••• LL-I CONTAINS THE SHAPER FILTER Flt.LI THROUGH •••••••••••••••••••••••• * RlSSR PROGRAM LI STINGS IPAGE •••••••••••••••••••••••• • * •••••••••••••••••••* •••• 2) ALP CONTAINS THE ERROR COVARUNCE AlP(O,l I. C OUTPUTS C C FFlI I C C C EXAMPLES C C 1. INPUTS C USAGE C C C I:t, ••• ,ll CONTAINS THE NEW SHAPER FILTER FI1,l.IJ THROUGH FIl.l,l+l). - UaO OUTPUTS - U"l RRIl ••• ~)=1.25,.5,O.,O.,O. 'Gl1 ••• S) = 1.,0.,0.,0.,0. CALL RlSPR Ill,AA,RR,AlP) CAll RLSSR ILL,AA,RR,GG,FF,AlP) AACl):l. AlP:l.25 FFll)=.8 C C 2. INPUTS USAGE C C C SAME AS EXAMPLE 1. DO 10 1=1,5 CAll RlSPR Ill,AA,RR,AlP) CAll RlSSR ILl,AA,RR,GG,FF,AlPJ 10 CONTINUE OUTPUTS - AAt1 ••• 5) : 1.000, -0.498, 0.246, -0.117, 0.041 FF(I •• ~S)" .999, -0.498, 0.246, -0.111, 0.041 Ll=5 ALP=1.00013 C C C C C C PROGRAM FOLLOWS 8ELOW C 10 • IPAGE FIl,tl. C C C C RlSSR •••••••••••••••••••••••• DIMENSION AAI101,RRlI0I,GG(10),FFI10) l2=U llaL2-l CALL FDOTR (:1l,fF,RRI2),Cll -'" .,.. .................. ... • L.-'U'~'''''.-''"''''''''L.r FFIl2)=0. J=l2 DO 10 I=1,l2 FFIII = FFIJ)+Fl*AAIJI J-J-1 RETURN END 0075 0076 0017 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0108 0109 0110 0111 0112 0113 0114 21 ••••••••••••• *.* •• * ••••• "••••• RMSDAV ** ••••••••••••••• *." REFER TO RMSOEV PROGRAM LI STINGS ••••••••••••• **.* •• *** •• *••••••••••••••••••• RMSDAV " * •• ** REFER TO RMSDEV ........_...•........... • RMSDEV • PROGRAM LISTINGS •••••••••••••••••••••••• .. RMSDEV ISUBROUTINE) 9/4/64 FAP -RMSDEV COUNT 150 LBL RMSDEV ENTRY RMSDEV IX,LX,XBASE,RMSXMB) ENTRY RMSDAV IX,LX.XAVG.RMSXMA) • • • • • • .... • .... ---• • • • • • - - •• • • - • • • • .• -..• • ..• -• • • •• • .• • •• • • • • • • .• • • •••••••••••••••••••••••• • RMSDEV .. •••••••••••••••••••••••• LAST CARD IN DICK IS NO. 0159 0001 0002 0003 0004 0005 0006 0007 0008 ..---ABSTRACT---0009 0010 TITLE - RMSDEV WITH SECONDARY ENTRY RMSDAV 0011 R.M.S. DEVIATION FROM GIVEN BASE OR FROM TRUE AVERAG& 0012 0013 RMSDEV COMPUTES THE ROOT MEAN SQUARE VALUE OF T~E 0014 DEVIATIONS, FROM A GIVEN BASE, OF THE ELEMENTS Of 0015 A VECTOR. 0016 0017 RMSOAV COMPUTES THE AVERAGE OF A VECTOR AND THIN 001S 0019 THE RMS VALUE OF THE DEVIATIONS OF ITS ELEMENTS AROUND THE AVERAGE. THE AVERAGE IS AN ADDITIONAL 0020 OUTPUT. 0021 0022 LANGUAGE - FAP SUBROUTINES CFORTRAN.II COMPATIBLE) 0023 0024 EQUIPMENT - 709,7090,7094 IMAIN FRAME ONLY) - 50 REGISTERS 0025 STORAGE - ON THE 1090 0026 SPEED RMSOEV TAKES A80UT 70 + 33.S.L + K MAC"INE CYCLES 0027 RMsnAV TAKES ASOUT 100 + 43.2-L + K MACNINE CYCLES 0028 WHERE L = VECTOR LENGTH 0029 K = CYCLES FOR ONE SQUARE ROOT 0030 - S.M.SIMPSON, FEBRUARY 1964 0031 AUTHOR 0032 0033 ---USAGE--0034 0035 0036 TRANSFER VECTOR CONTAINS ROUTINES - INOT ANY) 0037 ANO FORTRAN SYSTEM ROUTINES - SQRT 003B 0039 FORTRAN USAGE OF RMSDEV 0040 CALL RMSDEVrX,LX,XBASE,RMSXMB) 0041 0042 INPUTS TO RMSDEV 0043 0044 XIIl I=I ••• LX IS A ,FLOATING POINT VECTOR 0045 LX SHOULD EXCEEO ZERO 0046 0047 0048 XBASE IS A FLOATING POINT CONSTANT 0049 OUTPUTS FROM RMSOEV ISTRAIGHT RETURN WITH NO OUTPUTS IF lX ~STHN 1) 0050 0051 RMSXMB =SQUARE ROOT«(SUMIFROM 1=1 •• lX10F(XII1-XBASE1SIUAREDJ/lXI 0052 0053 0054 0055 FORTRAN USAGE OF RMSOAV CAll RMSOAV~X.LX,XAVG,RMSXMA) 0056 0057 0058 INPUTS TO RMSOAV 0059 X III I=l ••• lX IS A FLOATING POINT VECTOR 0060 0061 lX SHOULD EXCEED ZERO 0062 0063 0064 OUTPUTS FROM RMSDAV ISTRAIGHT RETURN WITH NO OUTPUTS IF lX tSTHN 1t 0065 XAVG = CI/LX1.ISUMIFROM I=I ••• lX) OF XII) 0066 0067 RMSXMA =SQUARE ROOTICSUMlfROM l=l •• lXI OF(XIII-XAVG1SGUARED1/LX) 0068 0069 0070 0071 EXAMPLES 0072 1. INPUTS - Xll ••• 9) = 1.,2.,3.,4 •• 5.,6.,7.,S.,9. LX-q 0073 0074 USAGES CALL RMSDEVIX,LX,O •• RMSl) •••••••••••••••••••••••• • RMSDEV PROGRAM LISTINGS * •••••••••••••••••••••••• IPAGE 2) •* • • OUTPUTS - RMSI RMS2 RMS3 • • •••••••••••••••••••••••• • RMSDEV • •••••••••••••••••••••••• I PAGE 21 CALL RMSDEVIX,LX,l.,RMS21 CALL RMSDAVIX,LX,XAVG.RMS31 11/31.SQUARE ROOTIZ85) 5.62731 11/31.SQUARE ROOT(204) 4.76095 11/31*SQUARE ROOT(601 = 2.58199 •* PROGRAM FOLLOWS BELOW ** TRANSFER VECTOR CONTAINS SQRT * HTR 8CI •• o PRINCIPAL ENTRY. *RMSDEV STZ TRA •• Kl SXA SET ENTRY INDICATOR RMSDAVIX,LX,XAVG,RMSXMA) ZFDEV,4 SET ENTRY INDICATOR XR4, SET ADDRESSES SXD CLA ADD STA CLA SfA • • • RMSDEVIX,LX.X8ASE,RMSXMBI ZFDEV SETUP SECONDARY ENTRY. •RMSDAV •* SAVE • SETUP XR4 l,RMSDEV RMSDEV-2,4 1,4 Kl GET 3,4 SUBTR AIXI AIXI+1 AIXBASE OR XAVG) CHECK OUT LX, SET IT IN XR4, FLOAT IT, CLEAR SUM, BRANCH ON ENTRY CLA. TMI POX TXL LRS ORA FAD SiTO STZ NlT TRA • 2,4 LEAVE 0,4 LEAVE,4,O 18 OCTK OCTK FLX SUM ZFDEV GET LX, TO XR4, AND FLOATED. SUM CLEAREO. ALL SET IF RMSOEV • IF RMSDAV. COMPUTE AND STORE XAVG AND THEN RESTORE XR4 TO ll( PXO 0,0 FAD. GET *-1,4,1 TIX FLX FOP RMSDEV-2,4 LXD STQ. 3,4 STORE XAVG 2,4 CLAPOX 0,4 LX BACK TO XR4 • -• - COMPUTE THE SUM OF SQUARE DEVIAT IONS • GET CLA SU8TR FSB STO XCA FMP FAD STO TIX •• ,4 ** TEMP -*=AIX)+l **=AIXBASEI OR AIXAVG) TEMP SUM SUM GET,4,1 - COMPUTE RMS VALUE, STORE IT, EXIT. • FOP XCA TSX LXD STO* FLX $SQRT,4 RMSDEV-2,4 4,4 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 00B9 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 010B 0109 OllO 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124. 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 • ••••••• *** •••• ** •• * •••• RMSDEV •••••••••••••••••••••• * ••* (PAGE PROGRAM LISTINGS .......................... .•••••••••••• RMSDEV ** ..... ** .... ** (PAGE 3) . LEAVE TRA 5,4 .. CONSTANTS, TEMPORARIES . OCTK SUM TEMP FLX ZFDEV OCT PZE PZE PZE PZE END 233000000000 .*, •• ,.* **.**,*. ··f·-'** **,0,0 SUM REGISTER INDIVIDUAL DEVIATIONS LX FLOATING •• =0 IF RMSOEV, NON-ZERO IF RMSOAV 01">0 0151 0152 0153 0154 0155 0156 0157 0158 0159 3) *** ••••••• **.******.** •• PROGRAM LISTINGS RNO "* •• ******** " •• **.*.*****. RND (FUNC TI ON) FAP •.••.....•...... "....•. " • RNO LAST CARD IN DECK IS NO. 001B 0001 0002 COUNT 0003 60 0004 RNO LBl FlY) 0005 ENTRY RND 0006 ENTRY RNDUP FlY) 0001 RNODN FlY) ENTRY OOOB 0009 ----ABSTRACT---•" 0010 "" TITLE - RND ,WITH SECONDARY ENTRY POINTS RNDUP, RNDDN 0011 0012 • ROUNDS FlYG. PT. NO. UP, DOWN, OR TO NEAREST FlTG. PT. INTEGER 0013 " 0014 RND ROUNDS A FLOATING POINT NUMBER TO THE NEAREST FLOATING " POINT INTEGER. 0015 "• 0016 RNDUP ROUNDS A POSITIVE (NEGATIVE) FLOATING POINT NUMBER 0011 • TO THE NEXT HIGHER (LOWER) FLOATING POINT INTIG~R~ 0018 " 0019 "• 0020 RNDDN ROUNDS A POSITIVE INEGATIVE) FLOATING POINT NUMBER 0021 TO TH[ NEXT LOWER IHIGHER) FLOATING POINT INTEGER. " 0022 ""LANGUAGE - FAPj FORTRAN II FUNCTION 0023 0024 " EQUIPMENT - 109 OR 7090 IMAIN FRAME ONLY) 0025 "STORAGE - 15 REGISTERS 0026 " SPEED - 26 MACHINE CYCLES FOR RND 0021 "AUTHOR - R.A. WIGGINS, 15/9/62 0028 0029 ----USAGE---•" 0030 "• TRANSFER VECTOR CONTAINS ROUTINES - NONE 0031 0032 " AND FORTRAN SYSTEM ROUTINES NONE 0033 • USAGE 0034 • FORTRAN 0035 Xl RNDFIYI " 0036 X2 " RNDUPFIYI "• 0031 X3 " RNDDNFIYI 0038 • INPUTS 0039 • 0040 • 0041 Y IS A FLOATING POINT NUMBER " 0042 MUST BE lSTHN= 10.**9 "• 0043 0044 • OUTPUTS 0045 " 0046 Xl IS A flOATING POINT INTEGER " 0041 " 0048 X2 IS A flOATING POINT INTEGER 0049 •" 0050 X3 IS A flOATING POINT INTEGER • 0051 "• EXAMPLES 0052 0053 • 0054 • 1. INPUT - Y=104.2 0055 OUTPUTS - Xl=104. X2=105. X3=104. • 0056 "" 2. INPUT - Y=.5 0051 0058 OUTPUTS - XI=I. X2"1. X3=0. • 0059 "• 3. INPUT - Y=-49.1 0060 0061 " OUTPUTS - Xl=-50. X2=-50. X3=-49. 0062 "" 4. INPUT - Y=1015. 0063 0064 OUTPUTS - Xl=1016. X2=1015. X3=1015. " 0065 " 0066 I, RND BCI 0061 A RNDUP TMI 0068 =0171771711117 FAD 0069 FAD =.5 0010 RNODN UFA "0233000000000 0011 FAD =fl233000000000 1,4 0012 TRA 0073 =0117711771171 A FSll 0014 F SB ".5 " ""RNO " ••••••••••••••• "•• *,,* ••• 9/29/64 ••••••••••• *.********.*. RNO •••••••••••••• • *** ••• * •••• (PAGE •••••••••••••••••••••••• RND • • • ................ ** ••••••• (PAGE 2) RND PROGRAM LISTINGS TRA TMI TRA END RNDDN A+l RNDUP+2 0075 0076 0077 0078 2) • **.*.*.*** •• ** •••••• *.* RNOON *.* •••.••• * **.**.*.* •••• *. REFER TO RND *.***.**.********* ••• *.* * RNOUP * ****.** •• *.**.**.******* REFER TO RNO PROGRAM LISTINGS •••••••••••••• ** •••••••• • RNDON • •••••••••••••• * ••• * •••• * REFER TO RND ••••••••••••••• ** •• *** •• • RNDUP * ••••••••••••••••• * •• **** RfFER TO RND •••••••••••••••••••••••• RNDV • *•••••••••••••••••••••••• • • RNDV PROGRAM. LISTINGS •••••••••••••••••••••••• • RNDV * • •••••• *** •••••••• ** •• ** I SUBROUTINE) LAST CARD IN DECK IS NO. 0117 0001 0002 COUNT 100 0003 LBL RNDV 0004 (X,LX,XR) ENTRY RNDV 0005 ENTRY RNDVUP (X,LX,XR) 0006 ENTRY RNDVDN (X,LX,XR) 0007 0008 ----ABSTRACT---0009 0010 TITLE - RNDV WITH SECONDARY ENTRIES RNDVUP AND RNDVDN 0011 ROUND, ROUND UP, OR ROUND DOWN A FLOATING VECTOR 0012 0013 RNDV ROUNDS A FLTG VECTOR TO NEAREST FLTG INTEGERS. 0014 RNDVUP ROUNDS ELEMENTS OF A FLTG VECTOR TO LoweST C015 FLTG INTEGERS GRTHN= GIVEN ELEMENTS FOR POSPTIVE 0016 ELEMENTS, OR TO GREATEST fLTG INTEGERS LSTHN= GIVEN 0017 ELEMENTS FOR NEGATIVE ELEMENTS. 0018 RNDVDN ROUNDS ELEMENTS OF A FLTG VECTOR TO GREATEST 0019 FLTG INTEGERS LSTHN= GIVEN ELEMENTS FOR POSJTIVE 0020 ELEMENTS, OR TO LOWEST FLrG INTEGERS GRTHN= GIVEN 0021 ELEMENTS FOR NEGATIVE ELEMENTS. 0022 0023 OUTPUTS MAY REPLACE INPUTS 0024 0025 LANGUAGE - FAP sueROUTINES IFORTRAN-II COMPATIBLE) 0026 EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0027 STORAGE - 34 REG I STERS 0028 - ABOUT 36 + 32.LX MACHINE CYCLES, LX=VECTOR ~ENGTH 0029 SPEED AUTHOR - S.M. SIMPSON, AUGUST 1963 0030 0031 9/29/64 F4P *RNDV * * • • • it .• •.. •. • • • • • •.. it it • it • • ----v3~uc---- • TRANSFER VECTOR CONTAINS ROUTINES - RND, RNOUP, RNDDN AND FORTRAN SYSTEM ROUTINES - INONEI uu-'£ tFUNtTIONS) it • • FORTRAN USAGE • CALL RNDV IX,LX.XR) • CALL RNDVUPIX,LX,XRI • CALL RNDVDNIX,LX,XRI • • • • • • • ..• INPUTS XI II I=l ••• LX IS ANY FLOATING VECTOR LX SHOULD EXCEED 0 STRAIGHT RETURN WITH NO ACTION IF LX LSTHN OUTPUTS XRIII • • • l=l ••• lX IS XRIII = ROUNDED FORM OF XIII lET X= S*(XI+XFI WHERE S=+I. OR -1., XI IS POSITIVE WHOLE NUMBER, ANO O. LSTHN= XF lSTHN 1 • THEN XR(II WIll ALWAYS S.XIIII IF XF=O. OTHERWISE XR III S*I x III I I FOR RNOVON XRII) S.IXIIII+I.0) FOR RNDVUP lIR( II S.IXII II) IF XFIIJ lSTHN .5 FOR RNDV XRIIJ S*(XIIII+1.01 IF XF(IJ GRTHN~.5 FOR RNOV it EQUIVAlENCEIXR,Xl IS PERMITTED •. • ..• it • • EXAMPLES it •. .. • • * •. ... 1. INPUTS USAGE - XI1 ••• 51 CALL CAll CAll CALL CAll OUTPUTS - XRlIl ••• 5) XR211 ••• 51 XR311 ••• 51 XllI = 1• 1.1, 2.2, -3.5, 4.7, 5.0 RNDV IX,5,XRll RNDVUPIX,5,XR21 RNDVDNIX,5,XR31 RNDV I X,l, X ) RNDV IX,Q,XR41 = 1., 2., -4., 5., 5. = 2., 3., -4. , 5., 5. = 1., 2., -3. , 4., 5. XR4 = 0.0 (NO OUTPUT CASEI XR"=O~O 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 C044 C045 0046 0041 C048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0013 0074 * ••••• ~.*.* •• * •• * •••• *.* .. RNDV PROGRAM LISTINGS • •••••••••••••••••••••••• IPAGE 2) . • PROGRAM FOLLOWS 8ELOW •.. . TRANSFER VECTOR CONTAINS RNO,RNDUP AND RNOON FUNCTIONS HTR XRl o o XR4 HTR 1,RNDV 8CI .. PRINCIPAL ENTRY. RNDVIX,LX,XRl R RNDV CLA ROUND SETUP STO RNDV-2.4 SXD RNDV-3.1 SXO Kl CLA 1,4 Kl AIX)+l AOO STA GET 3,4 CLA AOO Kl AIXR)+l STA STORE 2,4 LX CLATMI LEAVE 0,1 POX LEAVE,l,O TXL • LOOP •• =AI X) +1 *.,1 GET CtA ROUND TSX **=SRND,SRNDUP, OR SRNDDN **t4 STORE STO *.,1 **=AIXRI+l TIX GET,l,l * EXIT LEAVE LXD RNDV-2.4 LXD RNDV-3 tl TRA 4,4 * SECOND ENTRY. RNDVUPIX,LX,XRl RNDVUP CLA RUP TRA SETUP * THIRD ENTRY. RNDVDNIX,LX,XRI RNDVDN CLA RON TRA SETUP .. CONSTANTS R TSX SRND,4 RUP TSX SRNDUP.4 RON TSX SRNDDN.4 END ••••••••••••••••• *.* •••• .. RNDV * •••••••••••••••••••••••• IPAGE 21 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 ••••••••••••••••••• * •••• • RNDVDN • PROGRAM LISTINGS •••••••••••••••••••••••• REFER TO RNDV •••••••••••••••••••••••• RNOVUP • •••••••••••••••••••••••• • REFER TO RNOV •••••••••••••••••••••••• RNOVON • •••••••••••••••••••••••• • REFER TO RNOV PROGRAM LISTINGS -.••..••.•.•............ • RNOVUP • •••••••••••••••••••••••• REFER TO RNOV ••••••••••• ** ••••••••••• • ROAR2 • PROGRAM LI STINGS • LAST CARD IN DECK IS NO. 0113 0001 0002 0003 0004 0005 ----ABSTRACT---0006 0007 TITLE - ROAR2 OOOB ROTATE CENTRO-SYMMETRIC OR ANTI SYMMETRIC 2-DIMENSIONAL ARRAY 0009 ROAR2 ROTATES HALF OF A CENTRO-SYMMETRIC, OR ANTISYM0010 METRIC 2-0IMENSIONAL ARRAY BY 90 DEGREES. THUS. IF WE 00'11 ARE GIVEN HALF OF AN ARRAY X(I,JI I=-N, •••• N J=O,_4.,M 0012 THAT IS STOREO BY COLUMNS AS 0013 0014 X(N,MI X(N,OI X (N, II XIN,21 0015 0016 0017 X(O,OI X(O,ll XIO,21 X(O,MI 001B 0019 0020 X(-N,M) 0021 X(-N,OI X(-N,ll XC-N,21 0022 0023 THEN ROAR2 ROTATES THE TERMS SO THAT THEY ARE HOREO BY 0024 COLUMNS AS 0025 X(M,OI X(M,ll XCM,21 XCM,NI 0026 0027 0028 X(O,OI XIO,l1 X(0,21 XIO,N) 0029 0030 0031 X(-M,OI X(-M, 1) XI-M,2) XI-M,N) 0032 0033 0034 LANGUAGE - FORTRAN II SUBROUTINE EQUIPMENT - 709, 7090, 7094 IMAIN FRAME ONLYI 0035 0036 STORAGE - 114 REGISTERS 0037 SPEED - ABOUT .000011*M*N*.2 + .000012.N.*2 + .00021*M*N 0038 + .00070*N + .00012*M + .00115 SECONDS 0039 ON THE 7094 MOO 1 • 0040 AUTHOR - R.A. WIGGINS, JUNE, 1963 0041 0042 ----USAGE---0043 0044 TRANSFER VECTOR CONTAINS ROUTINES - MATRA~MOVREV,REVERS 0045 AND FORTRAN SYSTEM ROUTINES - NONE 0046 0047 FORTRAN USAGE 0048 CALL ROAR2 (JOB,XA,N,M.XRAI 0049 0050 INPUTS 0051 0052 =1 INDICATES XA IS CENTRO-SYMMETRIC. JOB 0053 =-1 INDICATES XA IS CENTRO-ANTISYMMETRIC. 0054 0055 1=1, ••• ,(N+N+11*{M+l) CONTAINS XIJ,K} J=-N, ••• ,N, XAI I I 0056 K=O, •••• M AS DEFINED IN THE ABSTRACT. 0057 00')8 MUST BE GRTHN o N 0059 0060 MUST BE GRTHN= 0 M 0061 0062 OUTPUTS 0063 0064 XRA ( II I=1, •••• (M+M+ll*IN+11 CONTAINS X(K,J) K=-M, ••• ,M. 0065 J=O, ••• ,N AS DEFINEO IN THE ABSTRACT. 0066 EQUIVALENCE WITH XA IS PERMITTED. 0067 0068 EXAMPLES 0069 0070 2.(,1.0,5.0, 1.0,2.0, 1. INPUTS - N=2 M'"3 XA(1 ••• 201 2.1,1.1,0.1,-1.1,-2.1, 0011 JOB=1 2.2,1.2,0.2,-1.2,-2.2, 0072 0013 2.3,1.3,0.3,-1.3,-2.3 • ROAR2 CSUBROUTINEI 9/10/64 • LABEL CROAR2 SUBROUTINE ROAR2 IJOB,XA,N,M,XRAI 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 C C C C C C C ROAR2 • •••••••••••••••••••••••• •••••••••••••••••••••••• C •••••••••••••••••••••••• . . ** ••••••••••••• * •••••••• PROGRAM LISTINGS •..... ROAR2 *_ ........ ** •••• * ••• (PAGE • C XRAll ••• 211 C C 0.3,0.2,0.1,5.0, 0.1, 2.3,2.2,2.1,2.0,-2.1,-2.21-2.3 2.1,1.1,0.1,-1.1,-2.1, 2.2,1.2,0.2,-1.2,-2.2, 2.3,1.3,0.3,-1.3,-2.3 0.3,0.2,0.1,0.0,-0.1,-0.2,-0.3, 1.3,1.2,1.1,1.0,1.1,1.241.3, 2.3,2.2,2.1,2.0, 2.1, 2.2, 2.3 C PROGRAM FOLLOWS BELOW C DIMENSION XA(21.XRAI21 NN=N MM=M NRB=NN+NN+l NCB=MM+1 NRA=NCB+MM NCA=NN+l lXB=NRB.NCB lXA=NRA.NCA CAll MATRA rXA,NRB,NCB,XRA) IF=l Il=lXB+1 lRO=lXB 1000 2=0. DO 10 1=I,NCA IFl=IF+MM CALL MOVREV IlRO,l,XRA(IF),I,XRAIIFlr,11 ~G~~~~ 0~1, 2.0,1.0,0.0,-1.0,-2~0, C i~~,i,A~A'lLI~-~tA~A'lr/,~G~j 1001 Z=l. IF=IF+NRA Il=Il-l 10 LRO=lRD-NRA-1 CAll REVERStlXA.XRA) RETURN END 0~2, 1.3,1.2,l.1,1.0,-1.1,-1.2.-1.~1 C ~~~~ • (PAGE C OUTPUTS XRA(1 ••• 211 C C C C 2. INPUTS - N=2 M~3 XAI1 ••• 201 C J08=-1 C OUTPUTS - ROAR2 •••••••••••••••••••••••• 2) C •••••••••••••••••••••••• 0014 0015 0016 0011 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 U~UD 0101 0108 0109 0110 0111 0112 0113 21 - ••••••••• * .••••••••••••• .. •••••••••••••••••••••••• PROGRAM LISTINGS ROTAll .. ROTATl (SUBROUTINE) .. FAP .ROTAll COUNT 100 LBL ROT All ROTATI (X,NX,NU~.ROTX) ENTRY ••••••••••••••••• ** ••••• • ROTATI 9/4/64 LAST CARD IN DECK IS NO. 0109 0001 0002 000) 0004 0005 0006 it 0001 ----ABSTRACT---0008 0009 • TITLE - ROTAll • ROTATE A VECTOR UPWARDS OR OOWNWARDS AN ARBITRARY AMOUNT 0010 0011 ROTATI ROTATES A VECTOR UPWARDS OR DOWNWARDS A PRESCRIBED 0012 • NUMBER OF UNITS SUCH THAT ELEMENTS SHIFTED OUT OF ONE END 0013 0014 ARE ROTATED INTO THE OPPOSITE END. IT IS IMMATERIAL • 0015 WHETHER THE VECTOR IS FIXED POINT OR FLOATING POINT. THE • 0016 ROTATION IS ACCOMPLISHED IN ONE PASS OF THE VECTOR RATHER 0017 THAN BY SUCCESSIVE SHIFT LNG. OUTPUT ON TOP OF INPUT IS it 0018 PERMITTED. 0019 0020 • LANGUAGE - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) 0021 • EQUIPMENT - 109 OR 1090 (MAIN FRAME ONLY) 0022 .. STORAGE - 46 REGISTERS .. SPEED (12 TO 18) • VECTOR LtNGTH MACHINE CYCLES ON 1090 0023 - TAK[S .. AUTHOR - R.A. WIGGINS AND J.CLARK, JUNE 1962 0024 0025 0026 ----USAGE---0027 .. TRANSFER VECTOR CONTAINS ROUTINES - NONE 0028 0029 • ANO FORTRAN SYSTEM ROUTINES - NONE 0030 .. FORTRAN USAGE 0031 .. CALL ROTATl(X,NX,NUP,ROTX) 0032 0033 .. INPUTS 0034 0035 0036 I=l, ••• ,NX IS THE VECTOR TO BE ROTATED. XCII (NOTE - X MAY BE EITHER FIXED OR FLOATING POINT WITHOUT 0037 0038 MCDIFICATION TO THE PROGRAM) • 0039 NX IS THE LENGTH OF THE X VECTOR. 0040 0041 MUST HAVE VALUE 1 OR GREATER (STRAIGHT EXIT OTHERWfSEI 0042 0043 IS THE NUMBER OF REGISTERS X IS TO BE ROTATEO. NUP 0044 (UPWAROS IF NUP POSITIVE) 0045 0046 .. OUTPUTS 0047 0048 ROTX( Il I=l, ••• ,NX IS THE VECTOR ROTATED SUCH THAT 0049 ROTX(I)=X((I-NUP)MOOULO NX) • 0050 (NOTE - THE EQUIVALENCE OF ROTX(1) WITH X(l) IS PERMITTED) • 0051 0052 .. EXAMPLES 0053 0054 0055 .. 1. INPUTS - X(I ••• 5) = 4.,6.,3.,9.,1. NX=5 NUP=8 0056 .. OUTPUTS - ROTX(1 ••• 5J = 3.,9.,1.,4.,6. 0051 0058 .. 2. INPUTS - X(I ••• S) "4.,6.,3.,9.,1. NX=5 NUP=-l .. USAGE CALL ROTATl(X,NX,NUP,X) 0059 0060 .. OUTPUTS - XII ••• 5) 6.,3.,9.,1.,4. 0061 0062 .. PROGRAM FOLLOWS BELOW ('063 0064 XRl HTR 0 HTR 0065 XR4 0 0066 I,ROTATl BCI XR4,4 0067 ROTATl SXO 0068 SXD XRl,l =AOR(X) 0069 1,4 CIIL 0010 ADD =IB35 0011 STA X =ADR(XIU 4,4 0072 CIIL 0073 ADD =11:135 0014 XR STA . • • • •. • •. • • . .. . . ... ... .... ... ... .. . . .. .. •••••••••••••••••••••••• ••••••••• ** ••• * ••••••••• •** ••• ROTAl'! • * •••••••••••• *** ••• (PAGE PROGRAM LISTINGS 2) Tl T2 X XR T4 EXIT T3 lX , ..•.•.•.•••.•.......... ROYAll • ••••••••••••••••••••••••• (PAGE ClA. HE TMI POX TXI S.TO STO lOQ* lAC llS OVP TPl ADD STO AXT SXD ClA' TRA TXI TIX XCA lOQ STD TIX lXD lXD TRA TXH STQ. TXI SXD lOQ* Tld,l XRl,l XR4,4 5,4 T2+1,4.** XR *+1,4,1 T3,4 X ,!,~A. TJ. PZE END 2,4 EXIT EXIT ,1 .+1,1,1 lX T2 3,4 =NUP 0 lX '+2 lX Tl 1,4 13,4 X X .+1,4,** T3.4 •• " .'=MOD(MOD(NUP,lX)+lX,lX) "=lX •• ,4 .*,4 =lX •• =ADRIX)+l *'=ADR(XR)+l 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 oioo **=FIRST VALUE OF lOOP 0101 0102 0103 0104 0105 0106 V&.VI 0108 0109 2) •••••••••••••••••••••••• RPLFMT •............................ • PROGRAM LISTINGS • RPLFMT ( SUBROUTINE) • FAP *RPLFMT COUNT 100 LBL RPHMT ENTRY RPLFMT (FMT,FMTNEW) ...,.•.•.•...•........•. .. ,......................... .. RPLFNT LAST CARD IN OECK IS NO. 0084 0001 0002 0003 0004 0605 0006 • ----ABSTRACT---0007 • OOOB • 0009 • TITLE - RPLFMT • REPLACE THE FORMAT OF A SUCCEEDING INPUT OR OUTPUT STATEMENT 0010 0011 RPLFMT HAS TWO ARGUMENTS FMT AND FMTNEW. RPLF"T ASSUMES 0012 • THAT SHORTLY BELOW THE CALL RPlFMT STATEMENT THERE 0013 • APPEARS AN INPUT OR OUTPUT STATEMENT USING THE FORMAT 0014 • FMT. THIS STATEMENT IS FOUND AND THE FORMAT FMTNEW IS 0015 • SUBSTITUTED FOR FMT. 0016 • 0017 .. LANGUAGE 0018 - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) 0019 * EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) .. STORAGE 0020 - 17 REGISTERS .. SPEED 0021 .. AUTHOR 0022 - S.M. SIMPSON JR., SEPTEMBER 1963 0023 0024 ----USAGE---0025 0026 * TRANSFER VECTOR CONTAINS ROUTINES - (NONE) 0027 .. AND FORTRAN SYSTEM ROUTINES - (NONE) it 0028 .. FORTRAN USAGE IILLUSTRATIVE) 0029 it 0030 CALL RPLFMTIFMT,FMTNEW) 0031 • 0032 •it 0033 ITHEN ANY AMOUNT OF PROGRAM NOT INVOLVING 0034 INPUT OR OUTPUT ACCORDING TO FORMAT FMT) 0035 WRITE OUTPUT TAPE 2,FMT,LIST 0036 0037 •.. LIST WILL BE PRINTED ACCORDING TO FORMAT FMTNEW RATHER THAN FMT~ 0038 0039 • 0040 • CAUTION THE CHANGE INDUCED BY RPLFMT (PlE FMT IS REPLACED BY .. PlE FMTNEW) IS PERMANENT. IF REPEATED USE OF THE SAME 0041 0042 .. SEQUENCE IS DESIRED USING DIFFERENT FMTNEW VALUES, THE 0043 .. ORIGINAL FMT SHOULD BE RESTORED BY A SCHEME SUCH AS .. CALL RPLFMTIFMT,FMTNEW) 0044 .. GO TO 20 0045 0046 • 10 CALL RPLFMTIFMTNEW,FMTI .. GO TO 30 0047 004B .. 20 WRITE OUTPUT TAPE 2,FMT,LIST 0049 .. GO TO 10 0050 it 30 CONTINUE 0051 0052 .. EXAMPLES 0053 0054 .. 1. INPUTS - X : 3.14159 FMT(1)=4HI17) .. FMTNEWll ••• 3) = 14HI5H X = ,F9.5) 0055 0056 .. USAGE DIMENSION FMTll),FMTNEWI31 0057 • CALL RPLFMTIFMT,FMTNEW) 0058 .. WRITE OUTPUT TAPE 2,FMT,X OUTPUTS - X = 3.14159 IS PRINTED OFFLINE FROM LOGICAL TAPE a. 0059 .. 0060 •.. PROGRAM FOLLOWS BELOW 0061 0062 •it 0063 0064 it NO TRANSFER VECTOR 0065 HfR XR4 o 0066 l,RPLFln BCI 0067 • ONLY ENTRY. RPLFMfIFMT,FMTNEW) 006B RPLFMT SXD RPLFMT-2,4 0069 2,4 AIFMTNEWI CLA 0070 STA PlEA 0071 PZEA MO HAS REPLACEMENT SETTING LOO 0072 1,4 AIFMTl CLA 0073 PlEA HAS OLD SETTING STA PlEA 0074 it COMPARE LOOP . . . .. .. . . • 9/29/64 • •••••••••••••••••••••• *- • .. RPLFMT PROGRAM LI STINGS •••••••••••••••••••••••• (PAGE 2) CAL SET PZEA CAL LAS TRA TRA TXI STQ LXD TRA PIE END 4,4 PlEA *+2 SET CAl,4,-1 4,4 RPlFMT-2,4 3,4 .... •••••••••••••••••••••••• RPlFMT • •••••••••••••••••••••••• • (PAGE (FIRST POSSIBILITY) GOT IT TRY AGAIN •• = A(FMTNEWI THEN ACFMT) 0075 0076 0077 0018 0079 0080 00B1 0082 0083 0084 21 * •• *.***.** •• ..••••••••••• RSKIP ••••••• * •••••••• ** •• ** ••- . RSKIP ..*RSKIP FAP (SUBROUTINE) PROGRAM LISTINGS •••••••••••••••• **** •••• .. RSKIP LAST CARD IN DECK IS NO. 0089 0001 0002 COUNT 100 0003 LBL RSKIP 0004 ENTRY RSKIP tNTAPE,NRECS,EOF) 0005 0006 ----ABSTRACT---0007 OOOB * .. TITLE - RSKIP 0009 .. SKIP FORWARD OR BACKWARD OVER RECORDS ON TAPE 0010 0011 RSKIPS SKIPS AN ARBITRARY NUMBER OF RECORDS FORWARD OR 0012 BACKWARD ON ~ TAPE. END FILES ARE CHECKED FOR WHILE 0013 SKIPPING FORWARD BUT NOT WhILE SKIPPING BACKWARDS. 0014 0015 .. LANGUAGE - FAP SUBROUTINE (FORTRAN II COMPATIBLE) 0016 .. EQUIPMENT - 709 OR 7090 (MAIN FRAME PLUS 1 TAPE UNIT) 0017 .. STORAGE - 37 REGISTERS 0018 .. SPEED - .0085 SEC PER 80-CHARACTER, HIGH-DENSITY RECORD 0019 .. FORWARD SKIPPING. 0020 .. - .0378 SEC PER 80-CHARACTER, HIGH-DENSITY RECORD 0021 .. BACK SKIPPING. 0022 .. AUTHOR - R.A~ WIGGINS DEC, 1962 0023 0024 ----USAGE---0025 0026 .. TRANSFER VECTOR CONTAINS ROUTINES - NONE 0027 .. AND FORTRAN SYSTEM ROUTINES - IIOSI.{TRC),{TC01,{TEFI_(RDSI. 0028 .. I BSR) 0029 0030 .. FORTRAN USAGE 0031 * CALL RSKIP INTAPE,NRECS,EOFI 0032 0033 .. INPUTS 0034 00:-15 NTAPE IS lOGICAL TAPE NUMBER OF THE TAPE THAT IS TO BE SPACED. 0036 IS FORTRAN II INTEGER 0037 0038 NRECS IS THE NUMBER OF PHYSICAL RECORDS TO BE SKIPPED. 0039 IF GRTHN 0 THE TAPE IS MOVED AWAY FROM THE BEGINNING 0040 POINT. 0041 IF = 0 THE TAPE IS NOT MOVED. 0042 0043 If lSTHN 0 THE TAPE IS MOVED TOWARD THE BEGINNING POINT. * IS FORTRAN II INTEGER. 0044 0045 0046 OUTPUTS THE TAPE IS MOVED. 0047 * 0048 =1. IF AN END FILE WAS ENCOUNTERED DURING SKIP~ING EOF * 0049 FORWARD • 0050 =0. IF NO END FILE WAS ENCOUNTERED OR NRECS lSTHN O. lEND FIleS ARE NOT DETECTED DURING BACKSPACING) 0051 0052 0053 WHETHER SKIPPING fORWARD OR BACKWARD, EACH END-Of-FILE ENCOUNTERED COUNTS AS ONE RECORD • 0054 0055 0056 .. PROGRAM FOLLOWS BELOW. 0057 0058 HPR 0 0059 BCI 1,RSKIP 0060 RSKIP SXD *-2,4 SAVE INDEX. 0061 1,4 GET LOGICAL TAPE NO. 0062 ClA${ IOSI;4 TSX SET UP (lOS I. 0063 RSKIP-2,4 0064 lXD RESET INDEX 4. 3,4 CLEAR EOF INDICATOR. 0065 STZ2,4 GET NO OF RECORDS. 0066 CLA4,4 EX IT IF ZERO. 0067 TlE ,4 POX SAVE. 0068 S (TRC I 0069 SET UP LOQ* SLQ TRC REDUNDANCY CHECK, 0070 SITCO) LDQ0071 SLQ 0072 TCO CHANNEL IN OPERATION, S (TEF) AND 0073 LDQ* SLQ TEF END FILE TRANSFERS. 0074 .. .. ... . .. .. . . ... ..... . ... ... . .. ... ... .. . .. .* ••••••••••••••• **** ••• 9/29/64 * •••••••• .•••••••••••••• .. RSKIP **.** ••••• ** ••••• ** •••••• (PAGE PROGRAM LISTINGS TCO TRC TEF MI RSKIP - • •••••••••••••• ** ••••• ** (PAGE 2) FORW ••••••••••••••••• *•••••• • TMI XEC* TIX LXD TCOA TRCA TEFA TRA CLA STOTRA XEC* TIX TRA END MI S(RDS) --1,4,1 RSKIP-2,4 * -+1 *+2 4,4 :1. 3,4 4,4 S(BSR) --1,4,1 TCO-l RESET IR 4. DELAY UNTIL TAPE STOPS. TURN OFF REDUNDANCY CHECK LIGHT. CHECK END FILE. 0075 0076 0071 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 2) •••••••••••••••••••••••• • RVPRJS • •••••••••••••••••••••••• REFER TO CHPRTS PROGRAM LISTINGS •••••••••••••••••••••••• • ~~ RVPRTS • .••........•.......... REFER TO CHPRTS .•••••••••••••••••••••••• . SAME ••••••• ** •• * ••••••• __ ••• . •••••••••••••• * •••••••• * SAME IFUNCTION} FAP • •••••••••••••••••••••••• * SAME • PROGRAM 1I STINGS 9/29/64 LAST CARD IN DECK IS NO. 0039 0001 0002 0003 0004 0005 0006 0007 ·SAME • •. .. .... .. .. .. .. .. .. .. .. .. ... .... .. • ... COUNT LBL ENTRY ENTRY 45 SAME SAME XSAME FllXll FI XU ----ABSTRACT---- TITLE OOOB - SA/I!E , WITH SECONDARY ENTRY POINT XSAME ENABLE MIXED EXPRESSIONS IN FORTRAN SAME AND XSAME ARE FUNCTIONS WHICH 00 NOTHING B~T RETURN TO THE CALLING PROGRAM. THIS ALLOWS THE USE OF MIXED EXPRESSIONS IN FORTRAN. FOR EXAMPLE, THE F4XED POINT ADDITION OF TWO WORDS (CALLED X AND YI WITH FLOATING POINT NAMES IS ACCOMPLISHED BY ISUM LANGUAGE EQUIPMENT STORAGE SPEED AUTHOR - = XSAMEF(X) FAP, FUNCTION + XSAMEFIY) (FORTRAN II COMPATIBLE) 104, 109, OR 1090 (MAIN FRAME ONLY) 1 CELL 2 MACHINE CYCLES J.F. CLAERBOUT -~--USAGE---- TRANSFER VECTOR CONTAINS ROUTINES - NONE AND FORTRAN SYSTEM ROUTINES - NONE rut'\. I "~~,, Xl IXI XSAME BSS SAME TRA END 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 uu~" U~~bl: SAMEF (IXll XSAMEF (X 11 0 1,4 0033 0034 0035 0036 0031 0038 0039 .•••••••••••••••••••••••• SEARCH ......... ............... .• PROGRAM LISTINGS , •••••••••••••••••••••••• • SEARCfl • •••••••••••••••••••••••• LAST CARD 1m DECK IS NO. 0094 0001 0002 0003 0004 0005 0006 0001 ----ABSTRACT--• 0008 • 0009 .. TITLE - SEARCH 0010 .. SEARCH A VECTOR FOR A VALUE 0011 SEARCH A VECTOR OF FIXED. FLOATING OR LOGICAL NWMBfR5 0012 0013 FOR A PARTICULAR NUMBER. IF THIS NUMBER IS FOUNOj ITS • 0014 INDEX IN THE VECTOR IS RETURNED, IF IT IS NOT FmUND, A 0015 ZERO IS RETURNED AS THE INDEX • 0016 FAP, SUBROUTINE (FORTRAN II COMPATIBLE) 0017 .. LANGUAGE 0018 • EQUIPMENT - 709 OR 1090 IMAIN FRAME ONLY) 0019 • STORAGE • 25 REGISTERS 0020 • SPEED - LESS THAN 130 + 8-LENGTH OF LIST) MACHINE CYCLES .. AUTHOR R.A. WIGGINS, 1617/62 0021 0022 • 0023 --USAGE--• 0024 •.. TRANSFER VECTOR CONTAINS ROUTINES - NONE 0025 .. ANO FORTRAN SYSTEM ROUTINES NONE 0026 0027 •• FORTRAN USAGE 0028 0029 • CALL SEARCH(LV,VECTOR,XNUM,INDEX) 0030 • 0031 • INPUTS 0032 •.. VECTORII) IsI ••• lV IS A·VECTOR OF FLOATING, FixeD, OR HmllERITM 0033 0034 • NUMBERS 0035 • LV 0036 IS FORTRAN II INTEGER 0037 MUST 8E GRTHN=O 0038 • XNUM IS A NUMBER OF SAME MODE AS VECTOR 0039 • 0040 • 0041 - OUTPUTS 0042 • INDEX OF XNUM IN VECTOR. I.E. VECTORfINOEX) XNUI'I 0043 • INDEX 0044 ".0 IF XNUM IS NOT CONTAINED IN VECTOR • 0045 =0 IF lV=O 0046 • 0047 • EXAMPLES 0048 0049 • I. INPUTS VECTORtl ••• 5)=I.,3.,2.5,4.,4.1 LV=5 XNUM~2.5 0050 • OUTPUTS - INOEX=3 0051 0052 • 2. INPUTS - SAI'IE AS EXAMPLE 1. EXCEPT XNUM=5. 0053 • OUTPUTS - INDEX=O 0054 •• 3. INPUTS - VECTORU ••• 5)=MLIl,4,7,.1l,9 LV=5 XNUM=Mlfll 0055 0056 OUTPUTS - INDEX=4 • 0057 •• 4. INPUTS - VECTOR£1 ••• 3)=6HAl ,A2 ,B LV=3 XNUM=6HA 1 0058 0059 • OUTPUTS - INDEX=l 0060 0061 • 5. INPUTS VECTOR(I ••• 21=1.,2. LV=O XNUM=I. 0062 • OUTPUTS - INDEX=O 0063 •.. 6. INPUTS VECTORtl ••• S)=MLI1,2,S.2,3 LV=5 XNUM-MLI 2 0064 0065 .. OUTPUTS - INOEX=2 0066 0061 .. 7. INPUTS VECTOR(l)=MlI 1 LV=I XNUM=MLI 1 0068 .. OUTPUTS - INDEX:l 0069 • 0070 HTR o 0011 1,SEARCH BCI 0012 SEARCH SXD *-2,4 0073 ADR,l SXA 0014 CLA" 1,4 .. SEARCH {SUBROUTINE) 9129/64 • FAP .SEARCH 75 COUNT SEARCH LBL ENTRY SEARCH ILV,VECTOR,XNUM,INDEX) . .. ... .. .. - .. . . . •••••••••••••••••••••••• .•••••••••••••••••••••••• SEARCH • (PAGE 21 DATA ITEM A ADR TZE STD CAL ADD STA CAL STA AXT CLA SUB TZE TXI TXl STZ. AXT TRA PXD STOTRA END ADR-l A 2,4 "lB35 DATA 3,4 ITEM 1,1 ... ,1 •• ADR+2 A,l,l DATA,I'-4,4 ... ,1 5,4 ,1 4,4 ADR PROGRAM LISTINGS ~.~.* • ........... SEARCH ** ••••• * • •••••••••••••••••••••••• (PAGE 0075 0076 0077 007B 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 2) ........•..........."..... ............................ • SEQSAC • PROGRAM 1I STINGS • SEQ SAC I SUBROUTINE) • FAP .SEQSAC COUNT 300 SEQ SAC LBL ENTRY SEQSAC IARGLO. ARGDELI ENTRY NEXCOS FIDUMMY) NEXSIN FlDUMMY) ENTRY • • • •• • • .• • • • • • • • • • • • • • • .. • • • • • • • • • • • • •• • • • • • .. .. • • • • • • • • • • •• • • • • • • • • • • •••••••••••••••••••••••• SEQSAC • •••••••••••••••••••••••• • LAST CARD IN DECK IS NO. 0277 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 ----ABSTRACT---0011 0012 TITLE - SEQSAC. WITH SECONDARY ENTRIES NEXCOS AND NEXSIN I~UNCTIONS' 0013 FAST FUNCTIONS FOR SEQUENTIAL SINES AND COSINES 0014 0015 SEQSAC. NEXCOS. AND NEXSIN ARE A PROGRAM S!T FOR PROVIOING A SUCCESSION OF SINE ANDIOR COSINE VALUES AT 0016 0017 HIGH SPEED. APPLICABLE IN CASES WHERE THE SUCCESSIVE 0018 ARGUMENT VALUES DIFFER BY A CONSTANT. SPEED IS ATTAINED BY THE USE OF SUM ANGLE FORMULAS. AND ERROR GROWTH IS 0019 0020 LIMITED BY AUTOMATIC RESETTING EVERY HUNDREDTH ARGUMENT. 0021 002l! THE ENTRY SEQSAC IS USED ONCE TO INITIALIZE FOR THE 0023 DESIRED BASE VALUE AND INCREMENTAL VALUE OF THI ARGUMENT. 0024 THEREAFTER NEXCOS ANDIOR NEXSIN ARE USED IN LOOP FASHION AS FUNCTIONS IWITH DUMMY ARGUMENTS) TO PROVIDE 0025 0026 THE SU£CESSIVE VALUES. 0027 0028 FAP SUIIROUTINE AND FUNCTIONS I FORTRANII COMPATIBLE J LANGUAGE 0029 EQUIPMENT - 709.7090,7094 IMAIN FRAME ONLY) 0030 - 94 REGISTERS STORAGE 0031 SPEED - THE INITIALIZING CALL OF SEQSAC TAKES ABOUT 80 MACHINE 0032 CYCLES ION THE 7090) PLUS FOUR USES OF THE fORTRAN 0033 SYSTEM FUNCTIONS COS AND SIN. 0034 THEREAFTER EACH SINE OR COSINE VALUE TAKES.ABOWT 0035 110 MACHINE CYCLES IF THE SUBSEQUENT LOOP USES ONLY 0036 NEXCOS OR NEXSIN, 0037 OR 0038 60 MACHINE CYCLES IF THE SUBSEQUENT LOOP USIS BOTH 0039 NExeDS AND NEXSIN. 0040 - S.M. SIMPSON, JUNE 1964 AUTHOR 0041 0042 0043 ---USAGE-0044 0045 TRANSFER VECTOR CONTAINS ROUTINES - NOT ANY 0046 AND FORTRAN SYSTEM ROUTINES - COS, SIN 0047 0048 ILLUSTRATIVE FORTRAN USAGE 0049 0050 CALL SEQSACfARGLO. ARGDEL) 0051 00 10 I=l,N 0052 CII) = NEXCOSFIDUMMY) 0053 10 SII) NEXSINFIDUMMYI 0054 0055 OR 0056 0051 CALL SEQSACtARGLO, ARGDELI 0058 00 10 l=l,N 0059 SII) = NEXSINFIDUMMYI 0060 10 CII) NEXCOSFIDUMMYI 0061 0062 OR 0063 0064 CALL SEQSACIARGLO, ARGDEL) 0065 00 10 l=l,N 0066 10 CIII -.NEXCOSFIDUMMYI 0067 006B OR 0069 0070 CALL SEQSACtARGLO, ARGDEL) 0011 00 10 I=l.N 0012 10 S(II = NEXSINFIDUMMYI 0073 0074 = = 9/8/64 •••••••••••••••••••••••• PROGRAM LI STINGS SEQSAC ••••••••••••• * *** ••• **** •• IPAGE •••••• * ••••••••••• *** ••• • SEQSAC * • •••••••••••• * •• ** •••••• 21 (PAGE • INPUTS TO SEQSAC • • • • • • • • •• • • • • • • • • • • ARGLO IS THE ARGUMENT VALUE, IN RADIANS, OF THE FIRST COSINE ANDIOR SINE TO BE COMPUTED BY THE SUBSEQUENT USE OF NEXCOS ANDIOR NEXSIN. ARGDEL IS THE INCREMENT, IN RADIANS, BETWEEN SUCCESSI'E ARGUMENT VALUES. OUTPUTS FROM SEQSAC - NONE, ITS FUNCTION IS MERELY TO INITIALIZE NEXCOS AND NEXSIN. INPUTS TO NEXCOS AND NEXSIN DUMMY .. IS THE NAME OF A DUMMY VARIABLE NOT USED BY NIXCOS OR NEXSIN ITS PURPOSE IS TO SATISFY THE FORTRAN REQUIREMENT THAT EVERY FUNCTION MUST HA¥E AT lEAST ONE ARGUMENT. • OUTPUTS FROM NEXSIN AND NEXCOS • • • • • • • • • IF NEXSIN ANDIOR NEXCOS ARE USED WiTHOUT A PRIOR CAll OF SEQSAC, THE VALUES GENERATED WILL BE ZERO. OTHERWISE, ON THE I-TH USE, SUBSEQUENT TO A CA~L SEQSAC STATEMENT, OF NEXCOS AND/OR NEXSIN WE HAVE NEXCOSF HAS VALUE: COSIARGLO+II-l)*ARGDELJ NEXSI NF HAS VALUE ** EXAMPLES * • 1. INPUTS - ARGLD • • * • * • • • • SINIARGLO+II-l)*ARGDELI 0.0 ARGDEL; 3.14159265/6.0 130 DEGREES' CALL SEQSAC IARGLO,ARGDEL) DO 10 1;1,202 CIII NEXCOSFIOUMMY) 10 SIll NEXSINFIDUMMY) OUTPUTS - Cll ••• 202) 1.,.866, .5,0., -.5,-.866,-1.,-.866".~' -.5,0. Sll ••• 2021 0., .5,.866,1.,.866, .5,0.,-.5, •• J. -.866,-1. 2 USAGE • 2. INPUTS - SAME AS EXAMPLE 1. • USAGE - SAME AS EXAMPLE 1. EXCEPT THE LAST TWO STATEMENTS ARE • EXCHANGED. * OUTPUTS - SAME AS EXAMPLE 1. • • 3. INPUTS - SAME AS EXAMPLE 1. • USAGE - SAME AS EXAMPLE 1. BUT DELETING THE • CII) = NEXCOSFIDUMMYI STATEMENT. • OUTPUTS - Sll ••• 2021 = SAME AS EXAMPLE 1. • • 4. INPUTS - SAME AS EXAMPLE 1. • USAGE _. SAME AS EXAMPLE 1. BUT OELETING THE • SIIJ ; NEXSINFIDUMMYI STATEMENT AND RELA8ELtING THE • PREVIOUS STATEMENT AS NUMBER 10 • OUTPUTS - Cll ••• 2021 = SA~E AS EXAMPLE 1. • • • 5. INPUTS - SAME AS EXAMPLE 1. EXCEPT ARGLO = 3.14159265/6.0 • USAGE - SAME AS EXAMPLE 1. • OUTPUTS - CI1 ••• 2021 .866,.5,0.,-.5, ••• ,0.,.5 • SI1 ••• 2021 = .5,.866,1.,.866, ••• ,-1.,-.866 • • • • • • • PROGRAM FOLLOWS BELOW TRANSFER VECTOR CONTAINS HTR BCI °1.SEQSAC COSIFI, XR4 SINIFI. 0015 0016 0017 001B 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 21 ••••••••••••••••• ** ••••• • SCPSCL • ••• ** ................... . PROGRAM LISTINGS •••••••••••••••••••••••• • SCPSCL 9/29/64 LAST CARD IN DECK IS NO. 0110 • SCPSCL (SUBROUtiNE) 0001 • FAP 0002 ·SCPSCL 0003 COUNT 100 0004 LBL SCPSCL 0005 ENTRY SCPSCL (SPACE, NOPTP, YTOP, YBOT. CONVK, CONVL1 0006 • -~--ABSTRACT---0007 • 0008 • 0009 • TJ TLE - SCPSCL 0010 • SCALE VECTOR TO INTEGERS FOR SCOPE, CLIPPING EXCESSIVI VALUES 0011 • SCPSCL SCALES DATA FOR SCOPE PLOT FOR GRAPH SUBROUTINE. 0012 • THE OUTPUT CAN BE EXPRESSED BY THE FORMULAE 0013 • 0014 • X = MAX1F IMIN1F ISPACEII),YTOP), YBOTI 0015 • 0016 • 0017 SPACEII) = XFIXF ICONVK + CONVL*XI • 0018 WHERE SPACE IS A FLOATING POINT VECTOR ON INPUT 0019 IS A FORTRAN II INTEGER VECTOR ON OWTPUT 0020 0021 CONVK, CONVL, YTOP, ANO YBOT ARE FLOATING POINT • PARAMETERS SUPPLIED BY THE CALLING PROGRAM. 0022 • 0023 • 0024 • LANGUAGE - FAP. SUBROUTINE IFORTRAN II COMPATIBLE) 0025 • EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0026 • STORAGE - 33 REGISTERS 0027 • SPEED 0028 • AUTHOR - S.M. SIMPSON 0029 • 0030 ----USAGE--• 0031 • 0032 • TRANSFER VECTOR CONTAINS ROUTINES - NONE 0033 • AND FORTRAN SYSTEM ROUTINES - NONE 0034 • 0035 • FORTRAN USAGE 0036 • CALL SCPSCLlSPACE,NOPTP,YTOP,YBOT,CONVK,CONVLI 0037 • 0038 • INPUTS 0039 *• 0040 SPACE'I) I=l ••• NOPTP IS A VECTOR OF FLOATING POINT NUMBERS 0041 • 0042 NOPTP IS FORTRAN II INTEGER. • 0043 MUST BE GRTHN=l • 0044 • 0045 IS A FtOATING POINT NUMBER WHICH GIVES THE UPPER YTOP • 0046 LIMIT THAT THE NUMBERS IN SPACE MAY ATTAIN BEFORE • 0047 SCALING. IF THE NUMBER EXCEEDS YTOP THEN IT IS • 0048 REPLACED BY YTOP. • 0049 • IS A FLOATING POINT NUMBER WHICH GIVES THE LOWER LIMIT 0050 YBOT • 0051 THAT THE NUMBERS IN SPACE MAY ATTAIN BEFORE SCALING. • 0052 IF THE NUMBER IS LSTHN YBOT THEN IT IS REPLAlED BY • 0053 YBOI. 0054 MUST BE LSTHN YTOP • 0055 • 0056 CONVK IS A FtOATING POINT NUMBER WHICH IS ADDED fO THE NUMBERS 0057 IN SPACE AFTER THESE ARE SCALED. • 0058 • CONVL 0059 IS A FLOATING POINT NUMBER BY WHICH THE NUMBERS IN SPACE • 0060 ARE MULTIPLIED FOR SCALING. • 0061 • 0062 • OUTPUTS 0063 •• 0064 SPACE(I) l=l ••• NOPTS IS A VECTOR OF FIXED POINT NUMBERS. 0065 • 0066 • EXAMPLES 0067 •• 1. INPUTS - SPACEI1 ••• 51 = -10 •• -5.,0 •• 5.,10. NOPTP. 5 0068 0069 • YTOP = 20. YBOT = -20. CONVK = 2. CONVL = 10. 0070 • OUTPUTS - SPACEll ••• 5) = -98,-48,2,52,102 0071 • 0072 8. YBOT • 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT YTOP 0073 • OUTPUTS - SPACEII ••• 51 = -18,-18,2,52,82 0074 • • • • • • • •••••••••••••••••••••••• •••••••••••••••••••••••• • sepseL • PROGRAM LI STINGS •••••••••••••••••••••••• (PAGE 2) l,sepseL Bel sepseL SXA LVfl eLA. 2,4 NOPTP 0,1 PDX eLA SPACE 1.4 ADD Kl STA se3 YTOP *IS SPACEII) GREATER OR •• , 1 SC3 eLA ·*"'SPACE+l CAS. 3,4 YTOP NOP YES TRA SC5 YES .IS IT LESS THAN OR YBOT CAS. 4,4 YBOT TRA se10 NO NOP YES 4,4 eLAYES TRA SCI0 3,4 se5 eLA* TRA SC10 sel0 xeA FMP. 6,4 CONVL 5,4 eONVK FAD· UFA ORF LRS 0 ANA AN LLS 0 18 ALS SC3 STOSC3,1,1 TIX LV AXT **;1 1,4 TRA ;. ".~ ." ORF OCT 233000000000 AN OCT 311111 END •••••••••••••••••••••••• • sepSCL • •••••••••••••••••••••••• IPAGE 21 0015 0016 0011 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 oon 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 Ul.UI 0108 0109 0110 ........................... SEQSAC • • PROGRAM LI STINGS 3) • SXO CLA' STO FS8' STO TSX STO CLA TSX STO LXO CLA' TSX STO LXO CLA'< TSX STO LXO LOQ' FMP STO STZ STZ TRA SEQSAC-2.4 1,4 LAS8AS 2.4 TEMP SCOS.4 LASCOS TEMP SSIN.4 LASSIN SEQSAC-2.4 2.4 SCOS.4 COSOEl SEQSAC-2,4 2,4 SSIN,4 SINOEl SEQSAC-2,4 2,4 FNMAX 8ASOEl NSOFAR lF8USO 3,4 LAS8AS = ARGLO LASCOS COS(ARGLo-ARGDEL) LASS IN SIN(ARGLO-ARGDEL) COS DEL COSIARGDEL} S INOEL S IN( ARGDEL) 8ASDEL FNMAX*ARGDEL • SECOND ENTRY. NEXCOS FIDUMMY) • (AVERAGE - 9 CYCLES IF JUMP TO NEW, 6 OTHERWISE) •NEXCOS •• • • • STl NlT STZ NlT TRA T~IRD •NEXSIN ENTRY. SXD NZT SXD lET •• • lIFCOS lF8USD lFlCOS lFlCOS NEW (LAST ENTRY REQUESTED SINE AND COMPUTED 80TH SINE AND COSINE) CLA STZ TRA TIU LASCOS lF8USD 1,10 NEXSIN F(OUMMY) lIFCOS,4 lF8USO lFLCOS.4 lFlCOS NEW (LAST ENTRY REQUESTED COSINE AND COMPUTED BOTH SINE AND COSINE. CLA STl TRA •• LASSIN lF8USD 1,4 RECOMPUTE THE 101-ST, THE 201-ST, ••• VALUES • (AVERAGE TIME - 30 CYCLES PLUS 1 SINE PLUS 1 COSINE) •RESET ..• CLA S10 CLA FAD STO TSX STO CLA TSX LXO TRA • IPAGE • PRINCIPAL ENTRY. SEQSAC «ARGLO.ARGOELI • (THIS ENTRY TAlES 78 CYCLES PLUS 2 COSINES PLUS 2 SINES) •SEQSAC SEQSAC •••••••••••••••••••••••• •••••••••••••••••••••••• «PAGE .. , ,••.•..•..•.•....••.. • KDl NSOFAR LAS8AS 8ASOEl LAS8AS SSIN,4 LASSIN LAS8AS SCOS,4 lF8USD,4 STO IF NEW VALUES TO 8E COMPUTED, CHECK FOR RESETTING FIRST 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0110 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 3) •••••••••••••••••••••••• SEQSAC • •••••••••••••••••••••••• • (PAGE PROGRAM 1I STINGS ~ Itl • •NEW SEQSAC • .••••••.•••............ (PAGE (AVERAGE TIME - 10 CYCLES) SXO ClA ADD STO CAS TRA NOP ZFBUSO,It NSOFAR KOI NSOFAR NMAX RESET • • • IF NO RESETTING. COMPUTE • • • • NEWSIN lASSIN·COSDEL+lASCOS·SINOEl NEWCOS lASCOS·COSDEl-LASSIN·SINDEl • •••••••••••••••••••••••• • (AVERAGE TIME INCLUDING EXIT - 87 CYClESI • STO • • lDQ FMP STO lOQ FMP FAD lOQ STO FMP STO lOQ FMP FSB sro LASSIN COSOEL TEMP LASCOS SINOEL TEMP LASSIN LASSIN SINOEL TEMP LASCOS COSOEL TEMP LASCOS Lt:1 Ll~\"U~ u.c:l() ClA TRA LASSIN 1.4 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0273 0274 0275 0276 0277 STORE NEWSIN STORE NEWCOS • CONSTANTS. TEMPORARIES KDl NMAX FNMAX LASBAS BASOH NSOFAR ZFBUSO PZE PZE DEC PZE PZE PZE PZE ZIFCOS ZFLCOS COSOEl SINOEL lASCOS lASSIN TEMP PZE PZE PZE PZE PZE PZE PZE END • 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0.0.1 0.0.100 100.0 ..••., ..*.,". , .. ..... , .. ..... , .. ..... , .... ...- ... , .. ,_. ...... ,,,"'..... ..... ..... , .. 0,0, •• ARGlO. ARGlO+BASOEl •••• ARGDEL·FNMAX = 0.1 ••••• NMAX+l.1.2~ •••• N"AX+l.l;2 •••• ZERO IF 80TH PREVIOUSLY COMPUTED SINE AND COSINE VALUES WERE USED to INITIAlt ZERO IF PRESENT REQUEST IS FOR COSINE ZERO If LAST REQUEST WAS FOR cmSINE COS(ARGDELI SIN(ARGOELl INITIAL COS(ARGlO-ARGDEl) INITIAL: SIN(ARGlO-ARGDEl) 41 ............ -.-*-*._ .. *- *•• ** ••SETAPT __ •• **_ •• _-**._*.** PROGRAM LISTINGS REFER TO INDEX • _ •• *--*.*._**.****-*-*- SETEST *••••••••• -_ •• ***_ •••• _** REFER TO INDEX ...... _..... .... -....- _ _ * SET APT * .*._ •••••••• * ••• * ••••••• REFER TO INDEX PRr:JGRAM LISTINGS •••• * •••• * •••••••••••••• *•• ****SETEST ••••••••••• * ••••••* REFER TO INDEX •••••••••••••••••••••••• • SETINO - ................. * ... ** ••• .. SETINO .. PROGRAM LISTINGS .. •••••••••••••••••••••••• •••••••••••••••••••••••• • SETINO ISUBROUTINE) 9/8/64 LAST CARD IN DECK IS NO. 0091 0001 • LABel 0002 CSETINO SUBROUTINE SETINOIITAPE, ZIFNEW, NRECS, ERR) 0003 0004 C 0005 C ----ABSTRACT---0006 C 0007 C 0008 C TITlE - SElINO INITIALIlE FOR ADDING TO AN INDATA-OUDATA TAPE 0009 C 0010 C SETINO POSITIONS A TAPE FOR RECEIVING RECORDS WRITTEN 001l C BY SUBROUTINE OUDATA. IF THE TAPE IS FRESH, SElINO 0012 C MERELY REWINDS IT. IF THE TAPE CONTAINS RECORDS 0013 C PREVIOUSLY WRITTEN BY SU8ROUTINE OUDATA AND TERM1NATED 0014 C BY A RECORD WITH ZERO RECGRD NUMBER, SETINO REWINDS 0015 C THE TAPE AND SEARCHES FOR THE TERMINATING RECORD. 0016 C THE TAPE IS THEN LEFT POSITIONED SO THAT THE NEXT 0017 C RECORD WRITTEN BY OUDATA WILL REPLACE THE TERMINATING 0018 C RECORD. A RECORD COUNT IS ALSO FURNISHED. 0019 C 0020 C C LANGUAGE - FOR TRAN- II SUBROUT I NE 0021 0022 C EQUIPMENT - 709,7090,7094 MAIN FRAME PLUS 1 TAPE DRIVE - 84 REGISTERS 0023 C STORAGE 0024 - DEPENDS ON INITIAL TAPE POSITION AND SEARCH TIME. C SPEED 0075 - S.M. SIMPSON, JUNE 1964 C AUTHOR 0026 C 0027 C 0028 ----USAGE--C 0029 C 0030 C TRANSFER VECTOR CONTAINS ROUTINES - XLIMIT, FSKIP AND FORTRAN SYSTEM ROUTINES - tRWT), ITSB), (RLR) 0031 C I- C FORTRAN USAGE C CALL SETINOtITAPE, ZIFNEW, NRECS, ERR) C C C INPUTS C !TAPE C C C Z IFNEW C C C C C C OUTPUTS C C C C C C C C 20 0.0 IMPLIES NOTHING ON ITAPE IS TO BE SAVED. NOT= 0.0 IMPLIES ITAPE CONTAINS INDATA-OUDATA FORMAT RECORDS, ALL OF WHICH ARE TO BE SAVED. THE TAPE IS POSITIONED AS DESCRIBED IN ABSTRACT. NRECS o ERR 0.0 IF All OK 1.0 IF ITAPE IS ILLEGAL, IN WHICH CASE NO TAPE MOVEMENT IS ATTEMPTED AND NRECS IS NOT DISTURBED. C C C C EXAMPLES C C IS THE LOGICAL TAPE NUMBER MUST EXCEED ZERO AND BE LSTHN= 1. INPUTS C C C C C C C C C IF lIFNEW '" O. OTHERWISE, NUMBER OF RECORDS PASSED OVER IN SEARCH FOR TERMINATING RECORD, NOT COUNTING THE TERMINATING RECORD. - ASSUME A 6 RECORD INDATA-OUDATA TAPE HAS BEEN CREATED ON LOGICAL 9 BY THE FOLLOWING SEQUENCE. REWIND 9 DO 10 1=1,10 10 XII) '" FLOATFIIl CO 20 1=1,5 IRECNO '" I 20 CALL OUDATAI9,IRECNO,10,X,11 IRECNO '" 0 CAll DUDATAI9,IRECNO,1,DUMMY,1) C C C C USAGE CAll SETINOI9,1.0,NRECS,ERRl OUTPUTS - NRECS=5, ERR=O.O, AND TAPE IS POSITIONED TO REWRITE 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0051 0058 0059 0060 0061 0062 0063 0064 0065 0066 0061 0068 0069 0010 0011 0072 0073 0074 •••••••••••••••••••••••• • SElINO • PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 21 C THE 6-TH RECORD. C C P~OGRAM FOLLOWS BELOW C ERR .. XABSF{XLIMITFCITAPE,l,2011 IF (ERR) 9999.10.9999 NRECS" 0 REWIND ITAPE IF (ZIFNEWI 20.9999,20 20 READ TAPE ITAPE. IRECNO CALL FSKIP(ITAPE. 11 IF (IRECNOI 30.60.30 30 NRECS .. NRECS+1 GO TO 20 60 CALL FSKIP(ITAPE. -II 9999 RETURN END 10 •••••••••••••••••••••••• SEllNe * •••••••••••••••••••••••• • (PAGE 0015 0016 0011 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 21 •••••••••••• **** •••• ** •• • PROGRAM LISTINGS SETK SETK FAP ••••••••••••••••• ** ••••• • 'ETK • ••••••••••• ** •• ***** •• ** ••••••••• ***** ••• ***** ••" (SUBROUTINE) LAST CARD IN DECK IS NO. 0169 0001 0002 COUNT 200 0003 LBL SETK 0004 ENTRY SETK I C,X1,X2, ••• ,XN) 0005 ENTRY SETKS (C1'X1,C2.X2, ••• ,CN,XN) 0006 ENTRY SETVEC I X,C1,C2 •••• ,CN) 0007 0006 "• ----ABSTRACT---0009 0010 • TITLE - SETK WITH SECONDARY ENTRIES SETKS AND SETVEC 0011 " SET VARIABLES OR VECTORS TO GIVEN VALUES 0012 0013 " SETK IS A VARIABLE-LENGTH-CALLING-SEQUENCE SUBROUTINE 0014 " WHICH SETS EACH OF ITS ARGUMENTS BEYOND THE FIRST EQUAL 0015 TO THE FIRST ARGUMENT, THE MODE OF WHICH IS ARBITRARY. 0016 " 0017 " SETKS IS A VARIABLE-LENGTH-CALLING-SEQUENCE SUBROUTINE, 0018 "• REQUIRING AN EVEN NO. OF ARGUMENTS WHICH ARE TREATED IN 0019 PAIRS. THE SECOND ARGUMENT Of EACH PAIR IS SET EQUAL 0020 "• TO THE FIRST ARGUMENT OF THE PAIR, THE MOOE OF WHICH IS 0021 ARBITRARY. 0022 " 0023 SETVEC IS A VARIABLE-LENGTH-CALLING-SEQUENOE SUBROUTINE 0024 WHOSE FIRST ARGUMENT IS CONSIDERED A VECTOR OF LENGTH 0025 • EQUAL TO THE NO. OF ADDITIONAL ARGUMENTS PRESENT. THE 0026 " ELEMENTS OF THIS VECTOR ARE SET SEQUENTIALty'EQUAL TO 0027 THE REMAINING ARGUMENTS, ~HOSE MODES ARE ARBITRARY. 0028 " 0029 " THE NUMBER OF ARGUMENTS WHICH MAY BE USED IS NOT 0030 " RESTRICTED. 0031 " ""SETK 9/29/64 .. . ... . " " " " • LANGUAGE EQUIPMENT STORAGE SPEED " "" " " AUTHOR .." " .." • "• • " • - FAP SUBROUTINES, FORTRAN-II COMPATIBLE 709 DR 7090 (MAIN fRAME ONLY) 37 REGISTERS SETK TAKES 14 + 13*Nl MACHINE CYCLES, WHERE N1+1 IS THE ARGUMENT COUNT. SETKS TAKES 11 + 16"N2 MACHINE CYCLES, WHERE 2·N2 IS THE ARGUMENT COUNT. SETVEC TAKES 13 + 21*N3 MACHINE CYCLES, WHERE N3+1 IS THE ARGUMENT COUNT. - S.M. SIMPSON JR. , SEPTEMBER 1963 ----USAGE--- TRANSFER VECTOR CONTAINS ROUTINES - (NONE) AND FORTRAN SYSTEM ROUTINES - (NONE) FORTRAN USAGE OF SETK CALL SETK IC,X1.X2,X3, ••• ,XNJ WHERE N SHOULD EXCEED ZERO, AND THE MODES OF TKE ARGUMENT NAMES ARE ARBITRARY. "" .. INPUTS •.. C IS A QUANTITY IN ANY MODE • OUTPUTS •" • ... Xl X2 PROGRAM RETURNS CONTROL WITH NO OUTPUT IF THE ARGUMENT COUNT IS 1 (N=O). IS SET C I S SET C IS SET C ETC XN •" .. FORTRAN USAGE OF SETKS " CALL SETKS (Cl,X1,C2,X2,C3.X3, ••• ,CN,XN) WHERE N SHOULD EXCEED ZERO, AND WHERE THE MODES Of " .. THE ARGUMENT NAMES ARE ARBITRARY. • • " " INPUTS C1 IS A QUANTITY IN ANY MODE 0033 0034 0035 0036 0037 003B 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 00.5/1 0057 0056 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 .••••••••••••••••••••••••.. • ••••••••••••• ** •••••••• SETK IPAGE PROGRAM LISTINGS . .. ..•.. .. .. SETK IPAGE IS A QUANTITY IN ANY MOOE C2 ETC CN IS A QUANTITY IN ANY MODE OUTPUTS Xl X2 AN IMPROPER RETURN RESULTS IF THE ARGUMENT COUNT IS ZERO OR NOT EVEN. IS SET IS SET Cl C2 IS SET CN ETC XN . EQUIVAlENCEICM.XLI IS PERMITTED. BEHAVIOUR OEP.ENDS ON THE FACT THAT THE SETTING SEQUENCE IS Xl.X2 ••••• XN. ... .. FORTRAN USAGE OF SETVEC .. CALL SETVECtX.Cl.C2.C3 ••••• CNI .. WHERE N SHOULD EXCEED ZERO. ANO WHERE THE MODES OF .. THE ARGUMENT NAMES ARE ARBITRARY . ..... .. .. .. INPUTS .. .. .. .. .. ..... ...... ... . . .. .. . .. . ... .. . ... .. .. It Cl IS VALUE FOR SETTING XII) ETC CN OUTPUTS IS VALUE FOR SETTING XINI PROGRAM RETURNS CONTROL WITH NO OUTPUTS IF THE ARGUMENT COUNT IS 1 • Xll.2, •••• N) IS SET = Cl,C2, •••• CN EQUIVALENCE (ANY TWO ARGUMENTS) IS PERMITTED. BEHAVIOUR DEPENDING ON THE FACT THAT THE SETTING SEQUENCe IS Xlll,XI21 ••••• XIN) EXAMPLES 1. EXAMPLES OF SETK USAGE CALL SETKI4.0.A,B,C.D,E.F,G,H) CALL SETKI3.I.J.K,L,M) CALL SETK I M. N) OUTPUTS - A=B=C=O=E=F=G=H 4.0 I=J=K=L=M 3 N 3 2. EXAMPLES OF SETKS USAGE CALL SETKS( 2 •• A.3.I,4 •• B,5tJ~6.K) CALL SETKS{ 3.1416,X.1963,L.X,Y.X.Z.l.M) CALL SETKSI 5 •• C) OUTPUTS - A=2.0. 1=3. 8=4.0, J=5, K=6 X=Y=Z = 3.1416, L=M = 1963 C = 5• 3. EXAMPLES OF SETVEC CALL USAGE CALL CALL OUTPUTS - XIl ••• 4) 1 I 1 ••• 6) = J .. •••••••••••••••••••••••• 2) .. .. •••••••••••••••••••••••• .. =5 SETVECI X.9.,7.,8 •• l4.) SETVEC( 1.19630.2.1.1,1(2),5) SETVECI J,5) 9 •• 7., 8., 14. 19630, 2. 19630, 19630, 2. 5 PROGRAM FOLLOWS BELOW .. NO TRANSFER VECTOR HTR 0 ORIGINAL XR4 BCI 1.SETK .. PRINCIPAL ENTRY. SETKIC.X1.X2, ••• ,XN) SETK LOQ. 1.4 C IN MQ ISTAYS THERE) CLA lRAK SX04 SXD SETK-2.4 TXI SETUP,4,-1 (SET TO START WITH Xl) .. SECOND ENTRY. SETKSICl.Xl,C2.X2, •••• CN.XNI 0015 0016 0077 0018 0019 0080 0081 0082 0083 00B4 0085 0086 0081 00B8 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 010B 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 0149 21 ••••••••••••••• **** ••••• SETK *••••••••• * ••••••••••••••* (PAGE PROGRAM LISTINGS 3) SETKS SXD SETK-2,4 TRAKS CLA TRA SETUP • THIRD ENTRY. SETVEC(X,Cl,C2, ••• ,CN) 1,4 A(X) SETIIEC CLA STA STO CLA TRASV TRA SXD4 (ADJUST XR4 TO START WITH CI) • MERGE POINT SETUP S TA TRA X,O • LOOP. CHECK IF 1,4 IS A TSX CAL CAL 1,4 ANA MASK KNOCK OUT ADDRESS LAS TSXl TRA LEAVE TRA TRA **=MOREK OR MOREKS OR MORESV • EXIT AT END OF ARGUMENT STRING 1,4 LEAVE TRA * SETK INSERT MOREK STO· 1,4 CTa XJ CAL,4,-1 TXI BACK FOR NEXT X * SETKS INSERT MOREKS CLA* 1,4 CJ STO* 2,4 TO XJ TXI CAL,4,-2 BACK FOR NEXT PAIR • SETVEC INSERT 1,4 MORESV CLA* CJ STO STO **=AIX) TO X(J) CLA STO Kl SUB STO STO TXI CAL,4,-1 __ ""'.,1(' T.flLITt' .. "' ................ ,. . .., TRAK TRA MOREK TRAKS TRA MOREKS TRASV TRA MORESV MASK OCT 177717700000 0,0 TSXl TSX Kl PZE 1 END *. *. •••••••••••••••••••••••• • SETK * •••••••••••••••• ** •••••• (PAGE 3) 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0111 0112 0173 0174 0175 0176 0117 0178 0179 0180 0181 (\10') 0183 OL84 0185 0186 0187 0188 0189 •••••••••••••••••••••••• • SETK -tl PROGRAM LISTINGS * • SETK -II (SUBROUTINE) • LABEL CSETK -I I SUBROUTINE SETK(C) •••••••••••••••••••••••• SETK -II • •••••••••••••••••••••••• • •••••••••••• *-* •••••••• - LAST CARD IN OECK IS NO. 0072 0001 0002 0003 C 0004 ----ABSTRACT---0005 C C 0006 C TITLE - SETK -II 0007 0008 C SET ANY NO. OF VARIABLES EQUAL TO A SINGLE VALUE (FXO OR FLTGt 0009 C C 0010 SETK IS A VARIABLE-LENGTH-CALLING-SEQUENCE SUBROUTiNE WHICH SETS EACH OF ITS ARGUMENTS BEYOND THE FIRST EQUAL C 0011 TO THE FIRST ARGUMENT, THE MODE OF WHICH IS ARBITRARY. C 0012 0013 C THIS VERSION OF SETK (SETK-II) IS THE FORTRAN IQUIVALENT 0014 C OF THE FAP SUBROUTINE OF THE SAME NAME. C 0015 C 0016 - FORTRAN II SUBROUTINE C LANGUAGE 0017 0018 C EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) C STORAGE - 63 REGISTERS 0019 - ABOUT 100+165*N MACHINE CYCLES, WHERE N+l • TOTAL C SPEED 0020 ARGUMENT COUNT. C 0021 C AUTHOR - S.M. SIMPSON, AUGUST 1963 0022 C 0023 0024 ----USAGE---C 0025 C C TRANSFER VECTOR CONTAINS ROUTINES - SETUP, STORE, RETURN 0026 C AND FORTRAN SYSTEM ROUTINES - (NONEI 0027 C 0028 C FORTRAN USAGE 0029 CALL SETK (C,Xl.X2,X3, ••• ,XN) C 0030 C WHERE N SHOULD EXCEED ZERO, AND THE MODES Of THE 0031 ARGUMENT NAMES ARE ARBITRARY. C 0032 0033 C C INPUTS 0034 C 0035 IS A QUANTITY IN ANY MODE C C 0036 C 0037 C OUTPUTS PROGRAM RETURNS CONTROL WITH NO OUTPUT IF THE ARGUMENT 0038 COUNT IS LESS THAN 2. C 0039 C 0040 Xl C 0041 C I S SET 0042 C X2 I S SET C C ETC 0043 XN 0044 IS SET C C 0045 C EQUIVALENCE CANY TWO ARGUMENTS) IS PERMITTED BWT SERVES C 0046 C NO PARTICULAR FUNCTION. 0047 0048 C C EXAMPLES 0049 0050 C C 1. USAGE CALL SETKC4.0,A,B,C,D.E,F,G,H) 0051 0052 C CALL SETK(3,I.J,K,L,M) CALL SETKCM,N) 0053 C CALL SETK(l.) 0054 C 0055 CALL SETK C 0056 C 0057 OUTPUTS - A=B=C=D=E=F=G=H = 4.0 C C I=J=K=L=M = 3 0058 0059 C N =3 AND NO OUTPUT RESULTS FROM LAST TWO CALLS C 0060 0061 C C PROGRAM FOLLOWS BELOW 0062 C 0063 C ACQUIRE ARGUMENT COUNT AND EXIT IF LESS THAN 2 0064 CALL SETUP(LOCAlL,NARGS,XRl.XR2) 0065 IF (NARGS-1) 9999,9999,10 0066 0067 C SET Xl ••• XN 0068 10 DO 20 NUMARG=2,NARGS 0069 20 CALL STORE(C.LOCALL,NUMARG,I) 0070 C EXIT 9999 CALL RETURNtLOCALL,XRl.XR2) 0071 END 0072 9/29/64 •••••••••••••••••••••••• • ... SETKP •• *••• ~.* • • PROGRAM LISTINGS • * •••••••••• * SETKP FAP •••••••••••••••••••••••• • SETKP • •••••••••••••••••••••••• I SUBROUTINE) LAST CARD IN DECK IS NO. 0123 0001 0002 ·SETKP 0003 COUNT 100 LBL SETKP 0004 ENTRY SETKP ICl.Xll,X12, ••• ,XINI,STOP, C2,X21,X22,.J.IX2N2. 0005 STOP, •••••• , CM,XMI,XM2, ••• ,XMNMI 0006 • ENTRY SETVCP {Xl,Cll,CI2, ••• ,ClN1,STOP, X2.C21,C22, ••• ,C2N2. 0007 STOP, •••••• , XM,CMl,CM2, ••• ,CMNMI 0008 0009 • ----ABSTRACT---0010 • 0011 0012 • TITLE - SETKP WITH SECONDARY ENTRY SETVCP 0013 • PLURALIZED FORMS OF SUBROUTINES SETK AND SETVEC 0014 • SETKP IS THE PLURAL FORM OF SUBROUTINE SETK. SETKP HAS 0015 0016 A VARIABLE NUMBER OF ARGUMENTS SEPARATED INTO AN • 0017 ARBITRARY NUMBER OF GROUPS BY A FENCE-TYPE ARGUMENT. • 0018 EACH SUCH GROUP REPRESENTS THE ARGUMENTS OF ONE CALL SETK • 0019 STATEMENT. SUBROUTINE SETK IS CALLED SUCCESSI~ELY, ONCE • FOR EACH GROUP. 0020 • 0021 • SETVCP PERFORMS THE ANALOGOUS FUNCTION FOR SUBROUTINE 0022 • SETVEC. 0023 • 0024 • - FAP SUBROUTINES (FORTRAN-II COMPATIBLE) 0025 • LANGUAGE 0026 • EQUIPMENT - 109 OR 1090 CMAIN FRAME ONLY) - 40 REGISTERS 0027 • STORAGE 0028 • SPEED - S.M. SIMPSON JR., SEPTEMBER 1963 0029 • AUTHOR 0030 • ----USAGE---0031 • 9/29/64 • • • • TRANSFER VECTOR CONTAINS ROUTINES - SETK,SETVEC • AND FORTRAN SYSTEM ROUTINES - INONE) • • •• • • FORTRAN USAGE OF SETKP CALL SETKPIC1,Xl1,X12, ••• ,XINl,STOP,C2,X12.X22, ••• ,X2N2_STDP, •••••• ,CM,XMl,XM2,~ •• ,XMNM) 1 • WHERE STOP = OCT 111111112345, IS EQUIVALENT TO • CALL SETKICl,XI1,XI2, ••• ,XlN11 • CALL SETKIC2,X21,X22, ••• ,X2N21 ETC • • CALL SETKICM,XMl,XM2, ••• ,XMNMI •• •• FORTRAN USAGE OF SETVCP CALL SETVCP(Xl,Cll,C12, ••• ,CIN1,STOP,X2,C21,C22 ••••• C2N2,SrOP, 1 •••••• ,XM,CMl,CM2, ••• ,CMNMI • • IS EQUIVALENT TO • CALL SETVECfXl,Cll,CI2, ••• ,CINI1 • CALL SETVECtX2.C21.C22, •••• C2N21 • ETC • CALL SETVEC(XM,CMI.CM2 •••• ,CMNMI • • SEE WRITEUPS OF SETK AND SETVEC FOR INPUT-OUTPUT DETAILS. • • EXAMPLES • STOP CALL CAll OUTPUTS - X=Y-Z ~ I. AII ••• l) • I. USAGE • • • • • - B = 171717712345 SETKPll.,X,Y.Z.STOP,2.,U,V,W.STOP,1;IX) SETVCPIA.I •• 2 •• 3 •• STOP,B,1.) U-V=W - 2. IX = 1 I., 2., 3. • PROGRAM FOLLOWS BELOW • • TRANSFER VECTOR CONTAINS SETK, SETVEC XRl HTR o HTR XR4 o BCI 1, SETKP BIll = 7. 0033 0034 0035 0036 0031 0038 0039 0040 0041 0042 0043 0044 0045 0046 0041 0048 0049 0050 0051 0052 0053 0054 0055 0056 0051 0058 0059 0060 0061 0062 0063 0064 0065 0066 0061 0068 0069 0070 0011 0072 ...... _...............•. ......................... . * (PAGE SETKP , * PROGRAM LISTINGS •• 4 •••••••••••• ** ••••••• SETKP * ••••••••••••••• ** ••••••• • 2) • PRINCIPAL ENTRY. SETKPIC1,X11,X12, ••• ,XIN,STOP, • C2,X21,X22, ••• ,X2N,STOP, •••••• • CM,XMl,XM2, ••• ,XMN) SETKP CLA TSXSK TRA SETUP • SECOND ENTRY. SETVtPIXl,Cll,C12, ••• ,C1N,STOP, • X2,C21,C22, ••• ,C2N,STOP, •••••• * XM,CMl,CM2, ••• ,CMN) SETVCP CLA TSXSV SETUP STA TRASUB SXD SETKP-2,4 SXD SETKP-3,1 • USE XRl TO SCAN FOR STOP OR END OF SEQUENCE, • HOLDING XR4 FOR FOOLING SETK OR SETVEC. NEXT PXA 0,4 PAX 0,1 CAL I,} TSX ARG,O OR SOMETHING ELSE CAL ANA AMASK LAS TSXZ TRA NOARG NO TRA ISARG YES * IF NOT AN ARGUMENT, ENTER SUBROUTINE WITHOUT REPLACING 1,1 NOARG TRA GOOUT • IT IT IS AN ARGUMENT. CHECK FOR STOP ISARG CAL* 1,1 LAS STOP NO TRA *+2 TRA ISTOP YES TXI CAL,l,-l MORE ARGUMENTS • IF STOP IS FOUND, REPLACE IT AND GO OPERATE ISTOP CLA TRABAK STO 1,1 • GO OPERATE SETK OR SETVEC. IRETURNS ONLY IF 1,1 WAS A STOP) GOOUT SXA BACK, 1 LXD SETKP-3,1 ** : AITTR SETK) OR AITTR SETVEC1 TRASUB TRA ** • IF IT COMES BACK, RESTORE XR4 TO OLD XRl, RESTORE STOP, • INDEX XR4. AND RETURN FOR NEXT CALL. BACK AXT **,4 ** : XR1 BEFORE SUBROUTINE CtA TSXSTP STO 1,4 TXI NEXT.4,-1 • CONSTANTS $SETK,4 TSXSK TSX $SETVEC,4 TSXSV TSX TRABAK TRA BACK STOP,O TSXSTP TSX STOP eCT 777777712345 0,0 TSXI TSX AMASK OCT 777777700000 END IPAGE 0073 0074 0075 0076 0077 007B 0079 0080 0081 0082 0083 0084 0085 00B6 0087 00B8 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 2) ...................... _. .... _SeTKS .................•.* • REFER TO SETK PROGRAM LISTINGS •••••••••••••••••••••••• • SETKS • •REFER ••••••••••••••••••••••• TO SETK •••••••••••••••••••••••• SETKS -II *•••••••••••••••••• *-*-••* 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 C C C C C ...-.•.•...•..........•. • SETKS -II * •••••••••••••••• ** •••••• LAST CARD IN DECK IS NO. 00B5 0001 0002 0003 0004 0005 ----ABSTRACT---0006 0007 TITLE - SETKS -II 0008 SET ANY NO. Of VARIABLES EQUAL TO SEPARATE VALUES IfXD OR fLTGI 0009 0010 SETKS IS A VARIABLE-LENGT~-CALLING-SEQUENCE SUBROUTINE, REQUIRING AN EVEN NO. Of ARGUMENTS WHICH ARE TREATED IN 0011 PAIRS. THE SECOND ARGUMENT OF EACH PAIR IS SET EQUAL 0012 TO THE fIRST ARGUMENT OF THE PAIR, THE MODE OF WHICH IS 0013 0014 ARBITRARY. 0015 THIS VERSION Of SETKS (SETKS-II) IS THE fORTRAN 0016 EQUIVALENT Of THE fAP SUBROUTINE CF THE SAME NAME. 0017 0018 0019 LANGUAGE - FORTRAN II SUBROUTINE (l020 EQUIPMENT - 70<1 OR 7090 (MAIN FRAME ONLY) 0021 STORAGE - 91 REGISTERS 0022 - ABOUT 750+250.N MACHINE CYCLES, WHERE 2*N ~ TOTAL SPEED ARGUMENT COUNT. 0023 AUTHOR - S.M. SIMPSON, AUGUST 1963 0024 0025 ----USAGE--0026 0027 TRANSFER VECTOR CONTAINS ROUTINES - SETUP, ARG. STORE, RETURN 0028 0029 AND FORTRAN SYSTEM ROUTINES - (NONE) 0030 0031 FORTRAN USAGE CALL SETKS (Cl.Xl,C2,X2,C3,X3, ••• ,CN,XN) 0032 0033 WHERE N SHOULD EXCEED ZERO, AND WHERE THE MIlIDES OF THE ARGUMENT NAMES ARE ARBITRARY. 0034 0035 INPUTS 0036 0037 IS A QUANTITY IN ANY MODE 0038 Cl 003<1 IS A QUANTITY IN ANY MODE C2 0040 ETC IS A QUANTITY IN ANY MODE 0041 CN 0042 0043 PROGRAM RETURNS CONTROL WITH NO OUTPUT If THE ARGUMENT OUTPUTS 0044 COUNT IS ZERO OR IS NOT EVEN. 0045 0046 Cl Xl IS SET 0047 X2 I S SET C2 0048 ETC 0049 XN eN I S SET 0050 0051 EQUIVALENCE(CM,XL} IS PERMITTED. BEHAVIOUR DEPINOS ON 0052 FACT THAT SETTING SEQUENCE IS Xl,X2, ••• ,XN. 0053 0054 EXAMPLES 0055 0056 CALL SETKS( 2.,A,3,I,4.,B,5,J,6,K) 1. USAGE 0057 CALL SETKS( 3.1416,X,l 0566 0567 0568 0569 0570 0571 XR2 WilL BE SET AND HELD AT -C FOURTH ENTRY. -. 0524 0525 0526 0527 0528 0529 0530 0531 0532 0533 0534 0535 0536 0537 0538 0539 0540 0541 0542 0543 0544 0545 0546 0547 0548 0549 0550 0551 0552 0553 = 1,2 FIRST ADVANCE XR2 TO -C = -IB+4) = -CA+N+l) • AND RESTORE C+l FROM SAVNXT DO LXA OlEVE,2 -IA+l) = -B TXI *+1,2,-4 -C ClA SAYNXT OClA) STO 1,2 CSAME AS STO* • SET ILO -1,2 ILO CLA* TO I -2.2 STO· • INITIALIZE FOR NEXT lOOP NXLOOP PXO 0.2 0,4 XR4 STARTS AT -C, EACH lOOP POX -3,2 NSUBS ClA* 0,1 POX XRl COUNTS SUBS • INNER lOOP NXSUB SXA OSYl,l TSX OPSUBl;l TROUBLE TZE NOSUS TPl OK OSVI TRA LEAVE END OF STRING OSVI AXT *.=XRl .*.1 NXSUB,l,l TlX * INDEX THE LOOP VARIABLE ClA. -2,2 KOl ADD S,TO* 1=1+1 -2.2 0,2 CAS* EXIT, BACK TO SEVRAl TRA TSXS NOP N)(lOOP TRA •• • U,2 •• •• SEYRAl •••••••••••••••••••••••• IPAGE 81 .......... _•••• * •••••• ** 0572 0573 0574 0575 0576 0577 0578 0579 0580 0581 0582 0583 0584 0585 0586 0587 0588 0589 0590 0591 0592 0593 0594 0595 0596 0597 0598 ** •• ** •••• .•••••••••••••• . SEVRAL ••••••••••••••••• * •••••• (PAGE PROGRAM LISTINGS •••••••••••••••• *** ••••• .. SEVRAl 9) .. .. .. - . A+2 A+3 A+4 A+5 IPAGE TSX TSX TSX TRA NXNEG,O NXlER,O NXPOS,O OBAK .. LEAVES 1,4 POSITIONED FOR PROPER SUBROUTINE .. AND RETURNS TO SEVRAL .. DESTROYS XRl AND XR2 - .. PICK UP PROPER N ACCOROING TO X IF CLA* 1,4 X LDQ.. 4,4 NXPOS TlE INZER TPL IXCA LDQ2,4 NXNEG IXCA XCA TRA IGOrN 3,4 NXlER I NlER CLA* .. SET FORWARD OR BACKWARD AND POS IT ION XR4 IGOTN POX 0,2 IXR2 WILL COUNT JUMPS) TXI *+1,4,1 INITIALIZE XR4 TO -lA-II. LXA XR4 IS BUMPEO BY +1 KIt! TMI ISXO FOR N NEGATIVE. PXA 0,1 OTHERWISE, 0,1 PAC BY -1. TXI *+1,4,-4 AND XR4 STARTS AT -IA+3) ITX 1,1 ISXD SXO .. RESTORE FROM SAVNXT eLA SAVNXT OCLA STO" * LOOP ITXI TXI .. +1,4, .... "-=-1 OR +1 TSX FIND,1 ARGUMENT TlE ITXI TMI LEAVE END OF STRING .. COUNT SUBROUTINES, FOR AC=1 TlX lTXI,2.1 - EXIT TRA TSXS -.. - SUBSCRIPT SETTING ROUTINE - WE HAVE A+l = TSX SUBRU,O * A+2 = TSX ARGl,O ETC A+NARGS+l = TSX ARGN,O *- THE SUBSCRIPT ROUTINE EXAMINES THE FORTRAN PROGRAM PRIOR TO .. .. - .. ••• _•••••••••••••• **.* •• THE TSX $SEVRAl.4 , LOCKING FOR STA Y OPERATIONS WITH Y IN THE RANGE A+2 TO A+NARGS+l. tTHE SCAN fOR STAY-S IS lIMITED TO 3it4-NARGUS REGISTERS.) FOR EACH SUCH STA Y FOUND, IT TRACKS THE PERTINENT INSTRUCTIONS BACK TO THEIR SOURCE, ANO THEN EXECUTES THESE INSTRUCTl ONS. *SCRPTS SXA SCLEVE.l SXA SClEVEH,2 SXA SClEVEit2,4 - FIRST SET II MI TS ON THE STA Y INSTRUCTION, IN STAAlO, SfAAHTI OlEVE,4 lXA -A TXI *+1,4,-1 - I A+ 11 PXA 0,4 0,4 PAC XR4=AITSX SUBRU,Ol STAALO,4 SXA NARGS,2 LXD *+1,2 SXD *+1,4.,*. ..*=NARGS TXI STAAHI.4 AITSX SUBRU,O)+NARGS SXA - INITIALIZE -IBETA+ll TO -AITSX $SEVRAl,41 SEVRAL-2,4 LXD AXfSClt4 SXA .. lOOP TO fINO NEXT STA Y, Y IN ADDRESS LIMITS, If ANY .... =- I BET A+ 11 AXTSCI AXT **,4 TXI *+1,4,1 -BETA 0,4 CALSCI CAL AMASK KNOCK OUT ADDRESS ONLY ANA 0599 0600 0601 0602 0603 0604 0605 0606 0607 060B 0609 0610 0611 0612 0613 0614 0615 0616 0611 061B 0619 0620 0621 0622 0623 0624 0625 0626 0621 0628 0629 0630 0631 0632 0633 0634 0635 0636 0631 0638 0639 0640 0641 0642 0643 0644 0645 0646 0641 0648 0649 0650 0651 0652 0653 0654 0655 0656 0651 0658 0659 0660 0661 0662 0663 0664 0665 0666 0661 0668 0669 0670 0671 0672 0613 91 •••••••••••••••••••••••• • SEVRAL .. PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 10) LAS STAl IS IT STA TRA NOTSTA NO ISSTA YES TRA .+1,4,1 NO NOTSTA TXI TXLSC1 TXL CALSCl.4,.. ..=SCAN LIMIT FOR STA V • SUBSCRIPT SETTING COMPLETED SCLEVE AXT .*,1 AXT ·.,2 •• ,4 AXT TRA OCLA • IF IT IS STA V, CHECK V. 0,4 ISSTA CAL GET STA V STAALO LAS MUST EXCEEO STAALO TRA HICHEK NOP TRA NOTSTA IGNORE IF NOT IN RANGE HICHEK LAS STAAHI AND BE LSTHN= STAAHI TRA NOTSTA IGNORE IF NOT IN RANGE NOP GOT IT • GOT ONE. SAVE BETA AND PROCEED. SXA AXTSC1.4 GOT IT • SET THE STA Y, SUB *-1, PXA X,XRA • INSTRUCTIONS FOR LATER EXECUTION SLW XEC1 STA Y CLA -1;4 SUB .-1 S1'O XEC2 CLA -2,4 GIVES PXA X,XRA STO XEC3 .. LOOK FOR PRECEEDING LXO A,XRA (MUST EXIST) TXI .+1,4,3 (LOOK BEfORE PXAI (AC HAS PXA X,XRAI TSX LXDTSC.l HPR ILLEGAL EXECUTION, THEN CHECK PRECEEDING TSX SCRSUB,4 • STORE IT FOR S"I'O XEC4 TSX CKTSXSj1 TRA CASE2 NO • CASE 1. EXECUTE THE TSX SCRSUB,4 ROUTINE • AND THEN GO TO LXD,PXA,SUB,STA SEQUENCE XEC 7,1 TSX TRA XEC4 XR4 HAS -GAMMA. SAVE -(GAMMA-II • CASE 2. .+1,4,1 CASE2 TXI SXA CAS2X4,4 • LOOK FOR PRECEED I NG STO A CLA XEC4 STA STOADD STA STQADD STA SXDADD CLA STOADO LDQ NOMASK TSX INSCAN,1 NOMASK,4 LXD NO FINO (PRETEND FOUND IN 11 SXD LOCSTO,4 • LOOK FOR PRECEEDING STQ A LXA CAS2X4,4 CLA STQAOD TSX INSCAN.1 LXD NOMASKI4 NO FINO SXD LOCSTQ.4 • LOOK FOR PRECEDING TSX SCRSUB,4 LXD A,XRB COMBO CAS2X4,4 LXA XEC4 CLA LXDASC,1 TSX TRA LXDSCI NO .. POSSIBLY TSX CKTSXS,l NO FIND NOMASK,4 LXDSCI LXD SXD LOCLXD,4 STA CAS2.1 AND SAVE SCRSUB .. LOOK FOR PRECEDING COMBO OF FORM TSX SCRSUB,4 ,LXD B,XRB, ••• ,SXD A,XRB CAS2X4,4 LXA SXDADD CLA LDQTM,1 TSX TRA NO LXDSC2 . •• ••••••••••••••••••••••• SEVRAl. • •••••••••••••••••••••••• (PAGE 10) 0674 0675 0676 0677 067B 0679 0680 0681 0682 0683 06B4 0685 06B6 0687 0688 0689 0690 0691 0692 0693 0694 0695 0696 0697 0698 0699 0700 0701 0702 0703 0704 0705 0706 0707 0108 0709 0710 0111 0712 0713 0714 0715 0116 0111 0718 0719 0720 0721 0122 0123 0124 0725 0726 0727 0728 0729 0730 0731 0732 0733 0734 0135 0736 0731 073B 0739 0740 0741 0742 0743 0144 0745 0746 0747 0741j •• ** ••••• •• * •• * •• * •••• PROGRAM LISTINGS ~* SEVRAL • •••• * •••••• * •• * •••••• **** ••••••••••••••••• * •••••• IPAGE 11) I PAGE 11) • POSSIBLY, CHECK FOR THE LXD B,XRB STO XEC5 TXI "+1,4,1 TSX LXDTSC.l TRA LXDSC2 NO • POSSIBLY, CHECK FOR THE TSX SCRSUB,4 STO XEC6 TSX CKTSXS,l LXOSC2 LXD NOMASK,4 NO ISCRSUB REMAINS IN XEC71 SXD LOCSXO.4 .. NOW FIND WHICH CAME FIRST .. CASE 2.3 IF STO OR STQ CAME FIRST .. CASE 2.1 IF LXD CAME FIRST .. CASE 2.2 IF SXD CAME FIRST • IADDRESS SIZE SENSE IS REVERSED, THEREFORE • LOOKING FOR SMALLEST) • FIND FIRST OF STO AND STQ CLA LOCSTO CAS LOCSTQ CLA LOCSTQ NOP • COMPARE IT AGAINST LXD AND SXD CAS LOCLXD TRA NOT2.3 NOP CAS LOCSXD TRA NOT2.3 HPR STOP ON UNDEFINED SUBSCRIPT • CASE 2.3. GO DIRECTLY TO LXD,PXA,SUB,STA SEQUENCE TRA XEC4 .. IS IT 2.1 OR 2.2 NOT2.3 CLA LOCSXO CAS LDCLXD TRA CAS2.1 HPR SHOULDNT HAPPEN .. CASE 2.2 DPERATE TSX SCRSUB,4 LXD B,XRB SXO A,XRB • AND GO TO LXD.PXA,SUB,STA SEQUENCE TSX XEC7 tl LXO B,XRB XEC6 NOP = SXD A,XRB XEC5 NOP TRA XEC4 • CASE 2.1 OPERATE TSX SCRSUB,4, AND GO TO LXD,PXA,SUB,STA SEQUENCE ."=SCRSUB FOR 2.1 CAS2.1 AXT **.1 SXA XEC7,1 TSX XEC7 tl • OPERATE THE LXD,PXA.SUB,STA SEQUENCE .. AND RETURN TO SCAN FOR NEXT STA Y. XEC4 NOP LXD A,XRA XEC3 NOP PXA X,XRA XEC2 NOP SUB .. -1 XECI NOP STA Y TRA AXTSCI = • • •• • • • • • • • •••••••••••••••••••••••• • SEVRAl • INTERNAL SUB TO CHECK IF -1,4 IS TSX SCRSUB,4 IF NOT RETURNS TO 1,1 IF SO RETURNS TO 2,1 SETTING XEC7 TO SCRSUB AND AC ADDRESS TO SCRSUB XEC7 IS SET IN ANY CASE USES XR2, LEAVES XR4 UNDISTURBED CKTSXS CAL -1,4 STA XEC7 STA CAlSCK PAC 0,2 ANA AMASK LAS TSXZ4 TRA *+2 TRA CKADDS .. FAILURE CTSXSX TRA 1,1 .. FURTHER CHECK ON ADDRESSES CKADDS SXD TXLSC2,4 POTENTIAL TSX SCRSUB,4 SET SCRSUB -ISCRSUBI TO XR2 GOT IT, MAYBE 0749 0750 0751 0752 0753 0754 0755 0756 0757 0758 0759 0760 0761 0762 0763 0764 0765 0766 0767 0768 0769 0770 0771 0772 0773 0774 0775 0776 0777 0778 0779 0780 0781 0782 0783 0784 0785 0786 0787 0788 0789 0790 0791 0792 0793 0794 0795 0796 0797 0798 0799 0800 .0801 0802 0803 0804 0805 0806 0807 0808 0809 0810 0811 0812 0813 0814 0815 0816 0817 0818 0819 0820 0821 0822 0823 ............................ • SEVRAL • .......................... , (PAGE 12) PROGRAM LISTINGS •••••••••••••••••••••••• • SEVRAl •........• -..•......•...• TXlSC2 TXH CTSXSX~2,.... : -THETA • ALMOST CERTAINLY HAVE IT. BUT WE NEED TO VERIFY THAT THE SUBROUTINE • CONTAINS AN STO A WHERE A : ADDRESS PORTION OF 0,4 (THIS VERIFICATION • MAY BE UNNECESSARY BUT IS INSERTED TO GUARO AGAINST CONFUSIUN BETWEEN • SCRIPT SETTING SUBROUTINES AND OTHER TYPES OF INTERNAL FORTRAN • SUBROUTINES). ClA 0.4 (LXD A.XR) STA STOAOD CAlSCK CAL.. ..:SCRSUB INIT LAS STOADD TRA •• 2 NO TRA ISSUB FINAL VERIFICATION • INDEX FOR NEXT CHECK BUT STOP AT ~IRST TRA INSTRUCTION CAL CALSCK ACl K1 SLW CAlSCK CAL. CAlSCK ANA ATMASK lAS TRAZ TRA •• 2 TRA CTSXSX EXIT IF HIT A TRA TRA CAlSCK BACK * SUCCESS ISSUB ClA XECl TRA 2,1 • • INTERNAL SUB, SCANNING BACK FROM 0,4 • LOOKING FOR LXO A,XR • WHERE XR IS AR8ITRARY. A IS IN AC ADDRESS • RETURNS TO 1.1 IF NOT FOUND • TO 2.1 IF FOUND. WITH AC:FUlL lXO A.XR LXDASC s.TA LXDAOO CLA LXOADD lDQTM LDO TMASK TRA INSCAN • • • INTERNAL SUB. SCANNING 8ACK FROM 0,4 • LOOKING FOR LXO A,XR • WHERE A IS AR8ITRARY, XR IS IN AC TAG * RETURNS TO 1.1 IF NOT FOUND * TO 2,1 IF FOUND. WITH AC:FULL lXD A,XR lXDTSC S~T LXDTAG CLA lXDTAG LDO AMASK • • • * INTERNAL ROUTINE SCANNING BACKWARDS FROM 0,4 • * lOOKS FOR AC MASKED 8Y MQ • RETURNS TO 1,1 IF DONT FINO • TO 2,1 IF FINO. WITH FULL INSTRUC IN AC * MQ UNDISTURBED INSCAN STO SDMINS STQ SOMASK CALISC CAL 0,4 ANA SOMASK LAS SOMINS TRA *+2 TRA GOTINS • CHECK LIMIT TXI .+1,4,1 TXLISC TXL CALISCj4,.*.. SCFENS • FAILURE EXIT TRA 1.1 * SUCCESS EXIT GOTINS CLA 0,4 TRA 2,1 • INTERNAL SUBROUTINE (RETURN TO 1,1) • TO EXECUTE THE SUBRSUTINE AT SCRSU8 XECl XEC.. •• STARTS AT SCRSU8 STO XECTMP CAL XECl ACl Kl (PAGE 12) 0824 0825 0826 0821 0828 0829 0830 0831 0832 0833 0834 0835 0836 0831 083B 0839 OB40 0841 0842 0843 0844 0845 OB46 0841 0848 0849 0850 0851 0852 0853 0854 0855 uo~o 0851 0858 0859 OB60 0861 0862 0863 0864 0865 0866 0861 0868 0869 0870 0811 0812 0813 0814 0815 0816 0811 0818 0819 0880 0881 0882 0883 0884 0885 0886 0881 0888 0889 0890 0891 0892 0893 0894 0895 0896 0891 0898 •••••••••••••••••••••••• SEVRAl •••••••••• • ****.* •• * •••••• PROGRAM 1I STINGS (PAGE 13) I PAGE 13) XEC7 SlW XEC7 CAL" lAS TRA14 TRA "+2 TRA Itl ClA XECTMP TRA XEC7 .. CONSTANTS, TEMPORARIES AMASK OCT 777777100000 0,0 TSXZ TSX 1,IF IFNAME BCI OONAME BCI 1,00 00 GOTOOO TTR GOTOIF TTR IF OBAK TRA8AK TRA PZE K2 2 K1 PZE 1 0,0,1 KDl PZE NOMASK OCT 771777777771 771771000000 ATMASK OCT TMASK OCT 771771077771 0,0,3 KD3 PZE -100,0,0 MIN144 PZE STAZ STA 0,4 TSXZ4 TSX 1,4 TRA14 TRA TRAZ TRA 0,0 SXDZ SXD 0,0, •• IANS PZE 0,0, ... PZE lOC 0,0,." NARGS PZE SAVNXT PZE 0,0, •• lOCSAV PZE STAAlO STA STAAHI STA •• lXDTAG lXD 0,". .... 0 lXDADD lXD STOADD STO STQAOD STQ SXDADD SXD .·,0 0,0, •• lOCSTO PZE 0,0, •• lOCSTQ PZE 0,0,." lOClXD PZE 0,0, •• lOCSXD PZE CAS2X4 PZE •• , , SOMASK PZE SOMINS PZE 0,0,.· NARGUS PZE XECTMP PZE END ° ° ··f··f·· ... END CHECK (USED BY DO) FROM WHERE FROM WHERE FROM WHERE AND FROM COUNTING TEMPORARY TEMP FOR lOC .... =A(TSX SUBRU,OI .... =A(TSX SUBRU,O)+NARGS ...... .. .. .. ·*f··'-· ··f··,·· •••••••••••••••••••• * ••• seVRAl • ••••••••••••••••••••••••• XR4 FOR CASE 2 0899 0900 0901 0902 0903 0904 0905 0906 0907 0908 0909 0910 0911 0912 0913 0914 0915 0916 0911 0918 0919 0920 0921 0922 092.3 0924 0925 0926 0927 0928 0929 0930 0931 0932 0933 0934 0935 0936 0937 0938 0939 0940 0941 0942 0943 0944 0945 0946 0947 094B •••••••••••••••• ** •••••• SETSBV *•••••••••••• * •••• * ••••••* REFER TO LOCATE PROGRAM LISTINGS •••••••••••••••••••••••• SETSBIi * •••••••••••••••••••••••• • REFER TO LOCATE •••••••••••••••••••••••• SETUP •••••••••••••• *** •••••• *** * ************************ REFER TO ************************ * .*- SETVEC •_._ ........ **.-.. _.. _.*** REFER TO SETK SETVCP * ************************ REFER TO SETKP SETKP ••••••••••••• * ••••• __ • * ••••• *••• * ••••• REFER TO LOCATE **.**.***-****.*-**** •• - SETVCP SETUP .*.~ REFER TO LOCATE * .... ••• _•••• * ••••••••••••••• • .** ••••••••••••••••••••• • SETVEC • •••••••••••••••••• ** •••• REFER TO SETK ......... ,."............... . • SHFTRI * •••••••••••••••••••••••• SHFTRI • PROGRAM LISTINGS • •••••••••••••••••••••••• •••••••••••••••••••••••• 9/29/64 • SHFTRI (SUBROUTINE) FAP -SHFTRI COUNT 140 LBL SHFTRI ENTRY SHFTRI (NSHFT,IV,LIV,IVSH,IANS) • LAST CARD IN DECK IS Ne. 0157 0001 0002 0003 0004 0005 0006 -~--ABSTRACT---0007 0008 0009 TITLE - SHFTRI SHIFT VECTOR ELEMENTS ARITHMETICALLY LEFT OR RIGHT 0010 0011 SHFTRI SHIFTS A FORTRAN VECTOR ARITHMETICALLY Tm THE 0012 RIGHT OR LEFT A SPECIFIEO NUMBER OF PLACES. 0013 0014 LANGUAGE ~ FAP_ SUBROUTINE (FORTRAN II COMPATIBLE) 0015 EQUIPMENT - 704, 70~, OR 7090 (MAIN FRAME ONLYI 0016 STORAGE - 70 REGISTERS 0017 0018 SPEED - TIME IS LENGTH OF VECTOR TIMES 8 MACHINE CYCLES OR MORE DEPENDING ON NO. OF SHIFTS REQUIRED 0019 AUTHOR - S.M. SI~PSON, JUNE, 1962 0020 0021 ----USAGE--0022 0023 TRANSFER VECTOR CONTAINS ROUTINES NONE 0024 AND FORTRAN SYSTEM ROUTINES NONE 0025 0026 FORTRAN USAGE 0027 CALL SHFTRltNSHFT,IV,LIV,IVSH,IANSI 0028 0029 0030 INPUTS 0031 - it • .. • • • • • • .. • • .. • • • • • • • • • • •. • • • • •. • • • N:'Ht-, • • • • • • NU. ut- I'LAI.t::. IU :'Hit-' \IKt:AICU I V( Il I=I .... LIV IS THE FORTRAN VECTOR. L1V IS IN DECREMENT. LIV MUST EXCEED 0 ...• OUTPUTS IVSHI ... I:' ":>UULU 301, IN tlc\..t\. IF NSHFT GRTHAN 0 SHIFT IS TO RIGHT. IF NSHFT LSTHAN 0 SHIFT IS TO LEFT. IF NSHFT = 0 NO SHIFT IS MADE BEFORE IV IS STORED IN IVSH II 1=1 ••• LIV = IV(I'.2 •• (-(NSHFTIMOD 361 IVSH(l) ANO IVIl) MAY BE EQUIVALENT • o NORMAL. +1 OVERFLOW OCCURRED BUT SHIFTING COMPLETED. -3 IlLEGAL LIV. IANS EXAMPLES - I. INPUTS NSHFT=6 IVIl ••• 2) = OCT 450000000000, 521210080012 • LIV=2 OUTPUTS - IVSH(1 ••• 2} = OCT 400500000000, 401272100000 )ANS~O .. • • 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT NSHFT-O • OUTPUTS - IVSH(1 ••• 2) = OCT 450000000000, 527210000012 IANS=O • 3. INPUTS - SAME AS EXAMPLE 1. EXCEPT NSHFT=-3 OUTPUTS - IVSH(1 ••• 2) = OCT 500000000000, 672100000120 • tANS.1 • • • 4. INPUTS SAME AS EXAMPLE 1. EXCEPT LIV=O • OUTPUTS - IVSH IS UNCHANGED IANS=-3 •.. HTR HTR HTR BCI SHFTRI SXD SXD SXD . o o o 1.SHFTRl SHFTRI-4,1 SHFTRl-3,2 SHFTRl-2,4 UV3L 0033 0034 0035 0036 0037 003d 0039 0040 0041 0042 0043 0044 0045 0046 0041 0048 0049 0050 0051 0052 0053 0054 0055 0056 001)1 0058 0059 0060 0061 0062 0063 0064 0065 0066 0061 0068 0069 0010 0011 0072 0013 0074 .•••••••••••••••••••••••• SHFTRI • •••••••••••••••••••••••• (PAGE PROGRAM LISTINGS 2) .. ADDRESS SETTINGS. 1,4 CLA STA GETl CLA 2.4 ADO Kl STA CLA 3,4 CLA STA GET 3 CLA 4.4 ADO Kl STA STD 5,4 CLA STA PUTS AIAtNSHFT) 1 AIAIIV)) AIACLIVI) AIAIIVSH)1 AIAIIANSII • • GET INPUTS NSHFT, UV. CHECK LIV. AI NSHFT) GEll CLA •• ARS 18 SiTO NSHFT K3 CLS STO IANS GET3 CLA AILIVI •• ARS 18 S·TO LIY TMI LEAVE TlE LEAVE STl IANS • • SET SHIFT INSTRUCTION. CLA NSHFT TMI LEFT KARS RIGHT CLA STO ASHFT TRA MOO KAlS LEFT CLA STO ASHFT ... . SET MAGNITUDE OF SHIFT NSHFT MOO CLA SSP HE SETSH+2 TlE SU8 K36 TMI SETSH TRA HE SETSH ADO K36 STA ASHFT • TURN OFF OVERFLOW BEFORE LOOP. LIY,l LXA TOV CLA ... • LOOP. CLA CLA ASHFT NOP STO STO TIX **.1 •• .".1 CLA,ltl AIIVI+l ARS .... , OR ALS ... AIIVSH)+l • CHECK FOR OVERflOW. TOY OYSEl TRA LEAVE Kl OVSEl CLA STO IANS . • LEAVE. STORING JANS. IANS LEAVE CLA ALS 18 PUTS STO LXO SHFTRl-4.1 SHFTRl-3,2 LXO SHFTRI-2.4 LXO TRA 6.4 ... . • CONSTANTS Kl PZE K3 PZE K36 PZE 1 3 36 ......................... SHFTRI • .••••.......•.......... - .. AI IANS 1 IPAGE 0015 0016 0017 0018 0019 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 U095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 21 •••••••••••••••••••••••• SHFTRl • •••••••••••••••••••••••• • IPAGE PROGRAM LISTINGS • • VARIABLES NSHFT PZE IANS PZE lIV PZE END • (PAGE o o •• •• •• SHFTR1 •••••••••••••••••••••••• 31 KARS ARS KAlS AlS •••••••••••••••••••••••• • Ol50 0151 0152 0153 0154 -3, 0, +1 0155 0156 0157 31 •• *••••••••• *~.* ••• *.* •• SHFTR2 • •.......... ,••••,* •••••••••• PROGRAM LISTINGS .. SHFTR2 I SUBROUTINE) 9129/64 .. FAP "SHFTR2 COUNT 150 SHFTR2 LBL ENTRY SHFTR2 INSHFT,IV,LIV,IVSH,IANSI • • • .. .. •. ... .. • * • • .. .. •.. .. • • ..... .. .... • •. ... .. .. .... .. ...• .... • * • .. • • • •.. .• .. • • .. .. . •• ••••••••••••••••••••••• SMFTR2 .. •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0162 0001 0002 0003 0004 0005 0006 0007 -~--ABSTRACT---OOOB 0009 TITLE - SHFTR2 0010 SHIFT VECTOR ELEMENTS LOGICALLY LEFT OR RIGHT 0011 SHFTR2 SHIFTS A FORTRAN VECTOR LOGiCALLY TO THE RIGHT A 0012 SPECIFIED NUMBER OF PLACES lOR LEFT IF THE NUMBfR Of 0013 0014 PLACES IS NEGATIVE). 0015 LANGUAGE - FAP~ SUBROUTINE (fORTRAN II COMPATIBLE) 0016 0017 EQUIPMENT - 704, 709, OR 7090 IMAIN FRAME ONLY) 0018 STORAGE - 72 REGISTERS 0019 SPEED - TAKES 8*LENGTH OF VECTOR MACHINE CYCLES OR MORE DEPENDING 0020 ON NO. OF SHIFTS REQUIRED 0021 AUTHOR - S.M. SIMPSON AND R.A. WIGGINS 9/28/62 0022 0023 ----USAGE---0024 0025 TRANSFER VECTOR CONTAINS ROUTINES NONE 0026 AND FORTRAN SYSTEM ROUTINES NONE 0027 0028 FORTRAN USAGE 0029 CALL SHFTR2fNSHFT,IV,LIV,IVSH,IANS) 0030 0031 INPUTS 0032 0033 NSHFT IS NO. OF PLACES TO SHIFT (TREATED MODULO 36), IN DECR. 0034 IF NSHFT GRTHAN 0 SHIFT IS TO RIGHT. 0035 IF NSHFT lSTHAN 0 SHIFT IS TO LEFT. 0036 IF NSHFT = 0 NO SHIFT IS MADE BEFORE IV IS STORED IN IVSH 0037 0038 l=l ••• lIV IS THE FORTRAN VECTOR. Ive Il 0039 I'NAME NEED NOT BE FIXED POINT) 0040 0041 lIV IS IN IDECREMENT. 0042 LIV MUST EXCEED 0 0043 0044 OUTPUTS 0045 0046 I VSH (I) I=l ••• LIV = IVII)102101OI-(NSHFT)MOD 361 0047 IVSH(l) AND IV(1) MAY BE EQUIVALENT. 0048 (NAME NEED NOT BE FIXED POINT) 0049 0050 IANS o NORMAL • 0051 +1 OVERFLOW OCCURRED BUT SHIFTING COMPLETED • 0052 -3 ILLEGAL LIV. 0053 0054 EXAMPLES 0055 0056 1. INPUTS - NSHFT=6 IVI1 ••• 21=OCT450COOOOOOOO,527210000012 lIV*2 0057 OUTPUTS - IVSHI1~ •• 2J=OCT004500000000,005272100000 IANS~O 0058 0059 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT NSHFT=O 0060 OUTPUTS - IVSHll ••• 21=OCT 450000000000, 52721000012 IANS-O 0061 0062 3. INPUTS - SAME AS EXAMPLE 1. EXCEPT NSHFT=-3 0063 OUTPUTS - IVSHI1 ••• 21=OCT 500000000000,272100000120 IANS=! 0064 0065 4. INPUTS - NSHFT=-3 IVI1 ••• 21=OCT000714221216,002142606060 LIV*2 0066 OUTPUTS - IVSHll~ •• 21=OCT007142212160,021426060600 IANS~O 0067 0068 5. INPUTS - SAME AS EXAMPLE 4. EXCEPT LIV=O 0069 OUTPUTS - IVSHll ••• 21=O,O IANS=-3 0070 0071 HTR 0 0072 HTR 0 0073 HTR 0 0074 BCI 1,SHFTR2 ........................... SHFTR2 • PROGRAM LISTINGS • •••••••••••••••••••••••• (PAGE 2) SHFTR2 SXD SXD SXD •• •• SHFTR2-4il SHFTR4-3,2 SHFTR2-2,4 ADDRESS SETTINGS. 1,4 eLA sa GETl 2,4 eLA ADD Kl eLA S:rA eLA 3,4 STA GET3 4,4 eLA ADD K1 STA STO 5,4 eLA STA PUT5 0015 0016 0011 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 AI AI NSHFT» AlAI IV)) A(AILlV) 1 AIAIIVSHtl AIAIIANS)) GET I,.PUTS ,.SHFf, LlV, CHECK LIV. GETl CLA AINSHFTI •• 18 ARS STO NSHFT CLS K3 STO IANS GET3 CLA AILlV) ARS 18 $.TO LlV TMI LEAVE LEAVE TZE STZ IANS -- • • SET SHIFT INSTRUCTlClN. \:i...:' • TMI RIGHT CLA STO TRA LEFT CLA STO I'II...JIIII nln7 • LEFT KARS ASHFT MOD KALS ASHFT • SET MAGNITUOE OF SHIFT IEXIT IF ZERO). MOD CLA NSHFT SSP SETSH+2 TZE TZE SUB K36 TMI SETSH TRA TZE SETSH ADD K36 STA ASHFT • • TURN OFF OVERFLOW BEFORE LOOP. LXA LlV,l LDO =0 TOV eLA • - LOOP. eLA CAL ASHFT NOP STO SLW TlX •• ,1 •• •• ~l AIIVl+1 ARS •• , OR ALS AIIVSH)+1 CLA,I,l * • CHECK FOR OVERflOW. TOV OVSEl TRA LEAVE K1 OVSET CLA STO IANS •* LEAVE, STORING IANS. LEAVE CLA IANS ALS 18 PUT5 STO LXD SHFTR2-4.1 LXD SHFTR2-3.2 LXD SHFTR2-2,4 *. ........................ • SHFTR2 • •••••••••••••••••••••••• IPAGE 21 AIIANS) •• 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 ••••••••••••• ** ••••• **** • • SHFTR2 PROGRAM LISTINGS •••••• ~ ••••• ** ••• *****.* 3) (PAGE • .. • it ••••••••••••• 4 •• * ••••••• SHFTR2 • ".-•••••••••••••• _••• ** ••• (PAGE TRA CONSTANTS Kl PZE K3 PZE K36 PZE KARS ARS KAlS AlS VARIABLES NSHFT PZE IANS PZE LIV PZE END 6,4 1 3 36 0 0 •• •• .* -3, 0, +1 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 31 •••••••••••••••••••••••• PROGRAM LISTINGS SHUFFL • ••••••••••••••••••••••••• •••••••••••••••••••••••• • 5HYFFl • •••••••••••••••••••••••• • SHUFFL I SUBROUTINE) 9/B/64 LAST CARD 1111 DiCK IS NO. • LABEL CSHUFFL SUBROUTINE SHUFFLIITPRD,NITEMS,ISPACE,IXSHUF) C C C ----ABSTRACT---C C TITLE - SHUFFL C SHUFFL A LIST OF INTEGERS FROM 1 TO N C C SHUFFL IS GIVEN'A NUMBER N, FROM WHICH IT INFERS THE C SET OF INTEGERS 1,2, ••• ,N. IT THEN PRODUCIS Alii OY,TPUT C VECTOR OF LENGTH N WHOSE ELEMENTS ARE THE INTE5ERS FROM C THIS SET BUT RANDOMLY SCRAMBLEO. REPEATED CAL~S vlELD C INDEPENDENT SHUFFLINGS. C C THE TECHNIQUE UTILIZES THE RAND RANDOM DIGITS tAPE C (ACCESS THRU SUBROUTINE GETRDl) AS FOLLOWS. EACH C ORIGINAL INTEGER IS ASSIGNED A UN1QUE EQUAlLV lIKILV C RANDOM NUMBER IN THE RANGE 0 TO 99,999. AN INDEX BY sIze C OF THESE NUMBERS IS THE DESIRED LIST OF SHUFFLED NUMBERS. C C A SPACE VECTOR OF LENGTH N IS REQUIRED FOR SCRATCH. C C LANGUAGE - FORTRAN-II SUBROUTINE C EQUIPMENT - 109,10'0,7094 CMAIN FRAME PLUS ONE TAPE UNITl C STORAGE - 101 REGISTERS C SPEED - TAKES ON THE ORDER OF .004*N SECONOS ON THE 7094J C AUTHOR - S.M.SIMPSON, FEBRUARY,1964 C C 0124 0001 0002 0003 0004 0005 0006 0007 OOOB 0009 0010 0011 0012 0013 0014 0015 0016 0011 0018 0019 0020 0021 0022 0023 0024 0025 0026 0021 0028 0029 0030 0031 nn"l.? 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 TRANSFER VECTOR CONTAINS ROUTINES - GETRDl,SEARCH,SIZEUP ANO FORTRAM SYSTEM ROUTINES - INOT ANY) FORTRAN USAGE CALL SHUFFU ITPRD, NITEMS, ISPACE,IXSHUF) INPUTS ITPRD IS THE LOGICAL TAPE NO. OF THE RANO RANDOM DIGITS TAPE. SHUFFL ODES NOT POSITION ITPRD 8EFORE OR AFtER aALLfNG SUBROUTINE GETRDI. NITEMS IS THE GIVEN NO. OF ITEMS (CALLED N IN A8STRACT). ISPACElll I=l ••• NITEMS OUTPUTS MUST BE AVAILA8LE FOR SCRATCH. STRAIGHT RETURN WITH NO OUTPUTS IF NITEMS=O OR LESS. IXSHUFlll 1=1 ••• NITEMS IS A SHUFFLED LIST OF THE INTEGERS I ••• NITEMS. EXAMPLES 1. INPUTS - ASSUME THE FIRST TWO RANDOM DIGITS CARDS CONTADN DIGITS AS FOLLOW 10091325331652013586346135481~8095909117392921494S 31542048056469474296248052403120636104020082291665 ANO THAT THESE ARE ON LOGICAL 9, WHICH IS REWOUNO. USAGES CALL SHUFFLI9,1,ISPACE,IXSHFll CALL SHUFFLI9,10,ISPACE,IXSHF21 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0051 6058 0059 0060 0061 0062 0063 0064 0065 0066 0061 0066 0~9 OUTPUTS - IXSHFltl ••• 1} 1,4,2,5.6,3,1 lXSHF2tl ••• 10l = 5.1,10,9,8,4.2,6,1,3 0070 0011 0012 0073 •••••••••••••••••••••••• SHUFFL • •••••••••••••••••••••••• PROGRAM 1I STINGS • IPAGE _.••.•.•.•.•.•.......... SHUFFL • _ • ....................... - 2) IPAGE C PROGRAM FOLLOWS BELOW C C C DUMMY DIMENSIONS C DIMENSION ISPACE(Z),IXSHUFIZ) C C TRUE DIMENSIONS C DIMENSION IRDI5) C C INDIGS COULD BE CUT BACK TO 3 OR 4 TO SAVE DIGITS) C NDIGS=5 C C CHECK OUT C 10 IF INITEMS) CONTINUE OMO 9999,9999,10 C C FIRST SET UP THE ISPACE VECTOR WITH RANDOM NUMBERS C 00 100 IXSP=I,NITEMS C C ACQUIRE THE NEXT GROUP OF DIGITS IIGNORE IANS) INTO IRDtl •• JNDIGS] C 40 CALL GETRDltITPRD,NDIGS,IRO,IANS) C C CONVERT TO INTEGER IN RANG~ 0 TO 10EXPINOIGSI-1 C NUMB=O DO 50 IXD=l,NDJGS 50 NUM8=10.NUMB+IRDIIXDI C C RETURN TO GETRD1 STATEMENT IF THIS NUMBER HAS OCCURRED ALREADY C (SEARCH WORKS FOR LNOW=OI. C LNOW=IXSP-I CALL SEARCHILNOW,ISPACE,NUMB,INDEX) IF IINDEX) 70,70,40 C C STORE THE NEW NUMBER C 70 100 0074 0075 0076 0077 007B 0079 0080 OOBI 0082 00B3 0084 00B5 0086 0087 0088 0089 ISPACEIIXSP)=NUMB CONTINUE C C NOW MAKE A SIZE INDEX OF ISPACE INTO IXSHUF AND EXIT. C CALL SIZEUPIISPACE,NITEMS.IXSHUFI 9999 RETURN END 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 OIOB 0109 0110 0111 011Z 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 2) • ••••••••••••••••••••••• - SIFT •••••••••••••••••••••••• PROGRAM LISTINGS .. .. -- SIFT .. • •••••••••••••• * •••••••• •••••••••••••••••••••••• SIFT ISUBROUTINE) FAP LAST CARO IN DECK IS NO. 0117 1)001 - SIFT 0002 COUNT 150 0003 LBL SIFT 0004 ENTRY IX, MESH, LXSFTD, XSFTD} SIFT 0005 0006 0007 ----ABSTRACT---OOOB 0009 0010 - TITLE - SIFT FORM A VECTOR BY SIFTING ANOTHER AT EVEN INCREMENTS 0011 0012 SIFT FORMS A VECTOR 0013 0014 XSFTDII) = XIl+lI-1)*MESH) I=l ••• LXSFTD 0015 0016 GIVEN THE INPUT VECTOR XII ••• ) AND THE VALUES MESH 0011 AND LXSFTD. OUTPUT VECTOR MAY REPLACE INPUT VECTOR. 0018 0019 .. LANGUAGE - FAP SUBROUTINE IFORTRAN-II COMPATIBLE) 0020 .. EQUIPMENT - 709,7090,7094 IMAIN FRAME ONLY) 0021 .. STORAGE - 30 REGISTERS 0022 .. SPEED - 43 + 10*LXSFTD MACHINE CYCLES ON THE 7090 0023 .. AUTHOR - S.M. SIMPSON, JUNE 1964 0024 0025 0026 ----USAGE---0027 0028 .. TRANSFER VECTOR CONTAINS ROUTINES - NOT ANY 0029 .. AND FORTRAN SYSTEM ROUTINES - NOT ANY 0030 0031 9/4/64 ... -. ... . -.. .. -. -. .. • . .. -.. - .-. .. .. -.. . ..- ;"Ut T50 T51 Tlll Tl12 T1l8 Tl19 Tl33 TlH T205 T228 T229 N,4 Tl95.4 8 SAVE SPILL 8 Tl Tl-2,4 =6 T244+1 =1 T244 =1 T251+1 TRA1 138 TRA2 T77 TRA3 Til2 TRA4 Tlb5 TRA5 T298 T249 T284 T285 T212 T286 3,4 T282 18 A 4,4 T280 T55 ENTRY FOR DETRM THIRD ARGUMENT tAl FOURTH ARGUMENT (0) 0524 0525 0526 0527 0528 0529 0530 0531 0532 0533 0.534 0535 0536 0537 0538 0539 0540 0541 0542 0543 0544 0545 0546 0547 0548 054Q 0550 0551 0552 0553 0554 0555 0556 0557 0558 0559 0560 0561 0562 0563 0564 0565 0566 0567 0568 0569 0570 0571 0572 0573 0574 0575 0576 0577 0578 u579 0580 0581 0582 0583 05B4 0585 0586 0587 0588 058? 0590 0591 0592 0593 0594 0595 0596 0597 0598 81 * •• * ••••• **** •• * ••••• * •• SIMEQ ••••••••••••••• * ••••••• *** (PAGE PROGRAM LISTINGS 9) •••••••••••••••••••••••• SIMEQ * •••••••••••••••••••••••• • (PAGE TRA2 TRA3 TRA4 TRA5 A AKK AKQ TRA TRA TRA TRA PIE PIE PIE PZE B El PIE PIE E2 E3 PlE PIE E4 PIE G PIE I PIE J K PIE KMI PIE KMIN PIE KPI PIE LM PIE PIE LN PIE N REG12 PZE SAVE PIE SPILL TRA TMP PIE TEST STI LDI LFT TRA LFT CLM T85 Tl36 T242 n05 -A -A+IK-l)IN+ll -fj STAGE OF REDUCTION K-l I K-ll N K+l TEST TMP 0 4 OVER 2 CONTENTS OF LOCATION 8 MODIFIED TREATMENT OF UNDERFLOWS CONTENTS OF INDICATORS SKIPPED IF UNDERFLOW SKIPPED IF ONLY MQ UNDERflOW ~~.A. LFT CLM XCA LDI TRA* OVER LDI TRA SIMEQ SYN DETRM SYN END 0599 0600 0601 0602 0603 0604 0605 0606 0607 0608 0609 0610 0611 0612 0613 0614 0615 0616 0617 0618 0619 0620 0621 0622 0623 0624 0625 0626 0627 0628 0629 0630 VO:Jl SKIPPED IF ONLY AC UNDERFLOW TMP 0 TMP T249 T254 T343 0632 0633 0634 0635 0636 0637 0638 0639 0640 0641 9) .• ••••••••••••••••••••••• .. SINTBL O>ROGRAM LISTINGS •••••••••••••••••••••••• REFER TO COSTBL REFER TO COSTBL ................. _..... . . SINTBX .....•••.•...•• ... _... PROGRAM LISTINGS •••••••••••••••••••••••• PRUGRAM LISTINGS REFER TO COSTBL • SISP --- . •••••••••••••••••••••••• REFER TO COSP .••••••••••••••••••••••••. SINTBL ....•........•......... - •••••••••••••••••••••••• .. ..•••.•....-.. _......... SHHBX REFER TO COSTBL .• ••••••••••••••••••••••• . SISP • ••••••••••••••••••••••• REFER TO COSP ........................ • SIZEUP •••••••••••••••••••••••• PROGRAM LISTINGS SIZEUP •• ••••••••••••••••••••••• • • •••••••••••••••••••••••• • SIZEUP I SUBROUTINE) • FAP .SIZEUP COUNT 200 LBL SIZEUP ENTRY SIZEUP (X.LX.INDEX) ENTRY SIZUPL (X,LX,INDEX) 3/15/65 • • • ----ABSTRACT---- •• LAST CARD IN DECK IS NO. 0246 0001 0002 0003 0004 0005 0006 0007 0008 0009 TITLE - SIZEUP WITH SECONDARY ENTRY POINT SIZUPL • FAST MAKE INDEX (BY INCREASING SIZE) OF ELEMENTS IN A VECTOR. • • • • • • SIZEUP MAKES A VECTOR. INDEXII) I-I ••• LX, WHICH GIVES THE OROERING. WITH RESPECT TO INCREASING SIZE. OF ANOTHER VECTOR. XCI) I-I ••• LX, SUCH THAT X( INDEXII)) IS ALGEBRAICALLY GREATER THAN OR EQUAL TO XI INDEXCI-l) ) FOR I-2 ••• LX. EQUAL VALUES OF XIII WILL NOT NECESSARILY OCCUR IN THE ORDER OF THEIR ORIGINAL APPEARANCE IN THE X VECTOR. +0 IS CONSIDERED GREATER THAN - 0 . THE INPUT VECTOR XII) MAY BE ANY MODE. • • • • • • • • •• SIZUPL PERFORMS THE SAME FUNCTION AS SIZEUP EXCEPT THAT THE SORTING IS LOGICAL RATHER THAN ALGEBRAIC. THAT IS. THE SIGN BIT IS CONSIDERED AS THE HIGHEST NUMERICAL BIT. LANGUAGE • EQUIPMENT • STORAGE • SPEED • •• • • • •• • • •• • • • AUTHORS - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) - 709, 7090. OR 7094 CMAIN FRAME ONLY) - 136 REGI STERS - AVERAGES ABOUT .0007.LX SECONDS ON 7094 MOD I FOR RANDOM NUMBERS BUT WITH DEVIATIONS UP TO 50 PERCENT FROM THIS FORMULA. - R.A.WIGGINS AND S.M.SIMPSON AUGUST,1964 • • • • • • • •• TRANSFER VECTOR CONTAINS ROUTINES - INOT ANY) AND fORTRAN SYSTEM ROUTINES - INOT ANY) • 001B 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 FORTRAN USAGE OF SIZEUP CALL SIZEUPCX. LX. INDEX) XI II I-l ••• LX lX LENGTH OF X VECTOR. ROUTINE RETURNS WITH NO COMPUTATIONS IF IS A VECTOR IN ANY MODE. 0051 LSTHN 1. OUTPUTS INDEXII) • • • • • • • • • • • • • 0016 0017 0036 0037 0038 0039 0040 ----USAGE---- • •• 0014 0015 0035 • INPUTS • 0010 0011 0012 0013 I-1 ••• LX IS THE VECTOR OF INDlCES AS DESCRIBED IN THE ABSTRACT. FORTRAN USAGE OF SIZUPL SAME AS SIZEUP. EXAMPLES - XC1 ••• 5) = 3 •• -10 •• -1 •• 2 •• 0. lX • 5 CALL SIZEUPCX. LX, INDEXl) CALL SIZUPlIX. LX. INDEX2) OUTPUTS - INDEX111 ••• 5) = 2.3.5.4.1 INDEX211 ••• S1 z 5.4.1.3.2 1. INPUTS USAGE 2. INPUTS - XII ••• 51 • 1HX.IHA,lHC,lHN.IHA USAGE - SAME AS EXAMPLE 1. OUTPUTS - INDEX1(1 ••• 5) - 1,4.5,2,3 lX • 5 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 ••••••• ••••••••• * •••• *. SIZEUP • ••••••••••••••••••••••• .. SUEUP ••••••••••••••••••••••••• PROGRAM liSTINGS ~ • • •••••••••••••••••••••••• IPAGE IPAGE 2) -.• INDEX211 ••• 5) .. .. PROGRAM FOLLOWS BELOW. XR4 HTR 0 . BCI I,SIZEUP SIlEUP STZ ZIFALG TRA SIZUPL+l SllUPl SXD ZIFAlG.4 SXD XR4.4 SXA XR2.2 SXA XR1.l STI INOIC CLA =IB17 STO3.4 CLA.. 2.4 POX ,1 SXA LX.1 CAS =0 TIX •• 3.1.1 TRA XR1 TRA XRl SXO LX1.1 CAL 3.4 ADD =1 STA IX1 STA OFTl STA OFT2 STA IX2 STA IX3 STA 1X4 STA IX5 STA IX6 STA IX7 STA 1X8 STA IX9 STA IXlO CAL 1.4 PAX .2 TXI -.1,2.1 SXA X1,2 SXA X2.2 SXD X3.2 PXA .2 SUB LX TXI -.1.1.1 STO ..... 1 IX.l ADO =1 TIX IX1.1.1 ClA TMIPL SSM TMIPl STO CHSIGN lET lIFALG TRA CONT LXA LX.1 .... 1 Xl CLS TMIPL TMI COM X2 STO • •• 1 Xl,l,l TIX CONT TMIPL CLS XIT1 TMI TMIPL STO AXT 1.1 IFT8,1 SXA lXA LX.2 SXA ILT8.2 AXT 0.4 LDQ ·-lB17 IX3 SLQ" ·.2 • 5.2.3.~.1 ALGEBRAIC SORTING ENTRY LOGICAL SORTING ENTRY SAVE INDEX REGISTERS. AND INDICATORS. GET LX. CHECK IF LX IS LEGAL. LEGAL ILLEGAL OR LX",l ILLEGAL GET INDEX ADDRESS AND SPREAD IT AROUND. GET SET UP INDEX VECTOR. ..... ADRIINDEX).l IF THIS IS ALGEBRAIC SORT. .... ADRIXI+1 =TMI FIRST PASS. TPL SECOND PASS .... AORIXI+l CONTINUE. SET UP INDEX REGISTERS FOR BEGINNING. FLAG LAST INDEX. IS BEGINNING OF MAIN PROCESSING LOGIC. ...- THIS SET UP THE INDICATORS FROM IBIT=XR4 TO SCAN ON • A PARTICULAR BIT. 0075 0076 0077 007B 0079 0080 0081 0082 0083 0084' 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144, 0145 0146 0147 0148 0149 21 •••••••••••••••••••••••• . •••••••••••••••••••••••• • PROGRAM Ll STINGS S lZEUP (PAGE (PAGE 3) SETIND CAL SXA ARS PAl . • ••••••••••••••••••••••• SIZEUP • •• ••••••••••••••••••••••• :-0 ·+1,4 •• .. SAVE THE CURRENT SCANNING LIMITS. • • - SCAN •SCNDN CFT1 • SXD SXD ALSMC,I SCNDN,2 XRl IS INDEX FOR FORWARD SCANNING. XR2 IS INDEX FOR BACK SCANNING. DOWN THE VECTOR FROM IFTB LOOKING FOR l'S. TXH OFT. TRA TXI ALSM,l,.· •• ,1 SETLM SCNDN,l,1 •• =ILTB TRANSFER IF ALL BITS ARE SAME. "=ADR (INDEX) +1 ONE BIT, GO SCAN UP. ZERO BIT, CONTINUE SCAN. • SCAN UP THE VECTOR FROM ILTB TO IBF=IX1 LOOKING FOR D'S. - SETLM SCNUP CFT2 IX2 IX3 IX4 IX5 - SXD TXL OFT. TIX CLA LDQ STA XCA STA TXI SCNUP,l ALSMC,2,-*.,2 SCNUP,2,1 ··,1 •• ,2 •• ,2 ·.,1 OFT1,1,1 •• =IBF TRANSFER IF IIX2=IBL)=IBF •• =ADR(INDEX)+1 ONE BIT, CONTINUE SCAN. ZERO BlT, EXCHANGE THE INDEX ADDRESSES AND CONTINUE SCANNING. - THE EXIT FROM SCNUP DOESN'T INDICATE WHETHER ALL BITS WERE SAME. • CHECK THIS. 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 017B 0179 0180 0181 Ultl2 ALSMC "" BMPR,2,." •• =IFTB TRANSFER IF MIXED BITS ALL THE BITS WERE ONES OR ZEROS, SCAN ON NEXT BIT. • ALSM ALSM1 IX6 "• TXH LXA LXA PXD SSM XCA SLQ TXI TXL ILTB,2 IFTB,l ,4 •• ,2 -+1,4,1 NWILTD,4,35 RESET IBL, AND RESET IBF. RECORD THE NEW BIT INDICATOR BUMP IBIT AND GO TO SCAN. IF THAT WAS ALL THE BITS, SEEK A NEW RANGE. •RECON CLA ADO PAX LXI TXH SXA LXA CLA IX7 CAS TRA NOP TXI 1X8 CLA POX NWILTD SXA SXD TXL TRA - ILlB =1 ,I EXITd,-IFTB,l IFTB,2 =0 .-,2 IXB IX7,2,1 •• ,2 ,4 IL TB, 2 -+1,1 RECON,2,·· SETIND NEXT RANGE STARTS ONE REGISTER AFTER LAST ILTB. SET NEW IBF. •• =LX-l TRANSFER IF LAST WORD IN LIST. SET NEW IFTB. AND SCAN INDEX VECTOR ·""ADRIINDEXl+1 FOR NEXT NEGATI VE VALUE THAT DEFINES NEW IBlT, AND THAT DEFINES NEW ILTB. IF NEGATIVE IS IN IFTB REGISTER GO BUMP ILTB AGAIN. GO BACK FOR MORE SCANS. - CONTROL COMES HERE WHEN IBF MEETS IBL IN MID VECTOR. • BMPR • TIX ALSM1,2tl • END PROCEDURE. - EXIT IX9 LXD LXA CAL BACK OFF ONE INTERPRET INDEX. XR4,4 LX,l • ... 1 ON IBL. 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 3) •••••••••••••••••••••••• • . SIZEUP PROGRAM LISTINGS IX10 . . PAC TXI PXD STO TIX ,2 ..... 1,2, ... ,2 ••• 1 lX9,1,1 • GO RESTORE X XlT1 XRl XR2 TRA LDI AXT AXT TRA ".. DATA .INDIC LX ZIFALG IFTB ILTB PZE PZE PZE PZE PZE END CHSIGN INDIC ··,1 ··.2 4,4 SIZEUP (PAGE 4) X3 . •••••••••••••••••••••••• •••••••••••••••••••••••• (PAGE . ••• *** •••••••••••••••••• ."=ADRIX)"'1 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 4) ••••••• ***** ••• *** •••• ** S I ZUPL ••••••••••• * * ••••• ******** PROGRAM LISTINGS ••••• ** ••••••• ** ••• *** •• SllUPL • *_.*******.** •• *.*.*._*** REFER TO REFER TO SIIEUP ** •• *** ••• * •• ***.*.***.* SMPRDV •**.*.*.* •• *.***.* ••••••• REFER TO POWER S IZ.EUP -**.*._ •••• *.*****.***** SMPRDV * -.*.** ••••••• _***.*.* ••• REFER TO * POWER •••••••••• *** ••••••• ** •• • SMPSON ••••••••••••••••••••••••* PROGRAM LISTINGS -.••.•...•.•.•........•. • SMPSON • SMPSON (SUBROUTINE) 9/4/64 LAST CARD IN DECK IS NO. * LABEL CSMPSON SUBROUTINE S~PSON(JOB,X,LX.DElX,XINT,IANS) C C C ----ABSTRACT---C C TITLE - SMPSON C UNSCALE OR SCALE VECTOR FOR SIMPSON INTEGRAL ANDIOR JNTEGRATE. C C SMPSON WILL SCALE AN INPUT VECTOR ACCORDING TO THE C SIMPSON'S RULE AND RETURN THE SCALED VECTOR AND THE C INTEGRAL, OR WILL RETURN THE INTEGRAL AND THE ORIGINAL C VECTOR~ OR WILL UN SCALE A VECTDR WHICH HAS BEEN SCALfD C FOR SIMPSON'S RULE. IF THE DATA LENGTH IS EVEN THE LAST C POINT IS INTEGRATED BY THE TRAPEZOIDAL RULE. THE C SIMPSON'S RULE SCALES FOR ODD DATA LENGTH ARE C C DELX*(1/3,4/3,2/3,4/3 •••• ,4/3,1/3) C C AND FOR EVEN DATA LENGTH SMPSON USES C C DELX*11/3,4/3,2/3,4/3, ••• ,4/3,5/6,1/2). C C C LANGUAGE - FORTRAN-II SUBROUTINE C EQUIPMENT - 109,7090,7094 (MAIN FRAME ONLY) C STORAGE - 317 REGISTERS C SPEED - TAKES ABOUT 25*LX MACHINE CYCLES TO OBTAIN THE C INTEGRAL, TO SCALE OR TO UNSCALE. C AUTHOR - J.N.GALBRAITH,JR., FEBRUARY 1964 C C C ----USAGE---C C TRANSFER VECTOR CONTAINS ROUTINES - (NOT ANY) C AND FORTRAN SYSTEM ROUTINES - (NOT ANY) C C FORTRAN USAGE C CALL SMPSON~JOB.X,LX.DELX,XINT,IANS) C C C INPUTS C C JOB FORTRAN II INTEGER INDICATES WHICH JOB IS TO BE DONE. C 0 INTEGRATE BUT LEAVE DATA UNSCALED. (OATA=X{ll.! C GRTHN 0 SCALE DATA AND INTEGRATE. C LSTHN 0 UNSCALE DATA. C C XII) 1=I,LX INPUT FLOATING POINT VECTOR FOR SMPSON OPERATIONS C C LX FORTRAN II INTEGER. LENGTH OF XII) VECTOR. GRTHN 3. C C DELX FLOATING POINT. SPACING BETWEEN X VALUES. C SHOULD BE NON-ZERO. C C C OUTPUTS C C XII) l=l ••• LX IS UNCHANGED FOR JOB = 0 • C IS SCALED, AS DEFINED IN ABSTRACT, C FOR JOB GRTHN O. C IS UNSCAlED ISCALED BY RECIPROCALS) C FOR JOB LSTHN O. C C XINT SIMPSON*S RULE INTEGRAL. INOT CHANGED IF JOB LSTHN 0.. C ClANS FORTRAN II INTEGER ERROR INDICATOR. C 0 NORMAL C = -3 ILLEGAL LX C C C EXAMPLES C • •••••••••••••••••••••••• 0196 0001 0002 0003 0004 0005 0006 0001 0008 OOO? 0010 0011 0012 0013 0014 0015 0016 0011 001B D019 0020 0021 0022 0023 0024 0025 0026 0021 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0039 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0051 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 •••••••••••••••••••••••• (PAGE f . . . . . . . . . . . . . . . . . . . . . . .. PROGRAM LISTINGS SMPSON •••••••••• • * •••••••••••••• • SMPSON .. • •••••••••••••••••••••• * IPAGE 2) 2) 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 - J08 = 0 XIl ••• IO)" LX = 3 OELX .. 0.2 OUTPUTS - IANS .. -3 1. INPUTS 1.,2.,3.,4.,3.,3.,4.~2.,8 •• 7. 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT LX .. 4. OUTPUTS - IANS = 0 XINT - 1.5 Xll ••• 4) = 1.,2.,3.,~. 3. INPUTS - SAME AS EXAMPLE 1. EXCEPT LX - 9. OUTPUTS - IANS - 0 XINT .. 4.7333333 XII ••• 9) .. 1.,2.,3.,4.,3.,3.,4.,2.,6. 4. INPUTS - SAME AS EXAMPLE 1. EXCEPT LX = 10. OUTPUTS - IANS = 0 XIIliT = 6.0333333 XII ••• IO) - 1.,2.,3.,4.,3.,3.,4.,2.,6.,7. 5. INPUTS - JOB .. 1 LX .. 10 OUTPUTS - IANS = 0 Xll ••• 10) Xll ••• 10)" 1.,2.,3.,4 •• 3.,3.,4.,2.,6.47. DELX" 0.2 XINT - 6.0333332 .. 0.0666667, 0.5333333, 0.4, 1.0666667, g.4, 0.8, 0.5333333, 0.5333333, 1.04 0.7 6. INPUTS - JOB" -1 LX - 10 OUTPUTS - IANS = 0 Xll ••• l0) Xll ••• 10) - SAME AS OUTPUTS FROM EXAmPLE 5. OElX = 0.2 XINT - O. .. 1.,2.,3 •• 4 •• 3 •• 3.,4.,2.,6.,7. - JOB = 2 LX = 9 OUTPUTS - IANS = 0 Xll ••• 9) Xll ••• 9) = 1.,2.,3.,4.,3.,3.,4.,2.,6~ OELX = 0.2 XINT = 4.1333332 0.0666667, 0.5333333, 0.4, 1.0686666, 0.4, 0.6, 0.5333333, 0.5333333, 0.4 7. INPUTS o. 11~ru'~ - ~G~ -£ ~ii ••• ~~ = 5~Mt ~~ UUIYUI~ ~KUM ~AAMPLt I. LX = q OELX .. 0.2 OUTPUTS - IANS - 0 XINT = O. Xll ••• 9) = 1.,2.,3.,4.,3.,3.,4.,2.,6. C C 9. INPUTS - JOB = 0 Xll ••• 9) - -1.,2.,3.,4.,-3.,3.,4J,2.i6. C LX - 9 OELX = 0.2 C OUTPUTS - IAIliS = 0 XINT - 3.7999998 C XIl ••• 9) = SAME AS INPUTS C CIa. INPUTS - SA"E AS EXAMPLE 9. EXCEPT JOB = 1. C OUTPUTS - IANS - 0 XINT .. 3.7999996 C XII.i.9) .. -0.0666667, 0.5333333. 0.4. 1.0666666. -0.4. C 0.8, 0.5333333, 0.5333333. 0.4 C Cll. INPUTS - JOB = -1 XII ••• 9) - SAME AS OUTPUTS FROM EXAMPLE 10. C LX - 9 DELX = 0.2 C OUTPUTS - IANS - 0 XIIliT - O. C Xll ••• 9) - -1.,2.,3.,4.,-3.,3.,4.,2.,6. C C C PROGRAM FOLLOWS BELOW C DIMENSION X{lOO) IANS=-3 IF I LX-3) 99199,2 IANS=O 2 XINT=O. SCAlE*OELX/3. IF(llX/2)*2-LX) 10,5,10 C C LX EVEN C 5 JSWTCH-1 GO TO 15 C LX 000 C C 10 JS:!tJCH=O 15 NN-LX-2 IF I JOB) 60,20,40 C 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0067 0066 0089 0090 0091 0092 0093 C094 0095 0096 0091 0096 0099 0100 0101 0102 0103 0104 0105 0106 U1UI 0106 0109 0110 0111 0112 0113 0114 0115 0116 0111 0116 0119 0120 0121 0122 0123 0124 0125 0126 0121 0126 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 .............. _........ . -.......... .* PROGRAM LISTINGS SMPSON "............ IPAGE 31 C C 20 25 30 C C C 35 C C C 40 45 INTEGRATE BUT 00 NOT SCALE. 00 25 I=2,NN,2 XINT=XINT+4.*XII)+2.*XII+1) IFIJSWTCH) 35,30,35 XINT=I XI "JT<+X I 1 I+XI lX 1+4. *X IlX-l» "SCALE GO TO 99 00 lAST POINT 8Y TRAPElOIDAl RULE XINT=(XINT+Xll)+.5*XllX-1)+1.5*XllX)*SCAlE GO TO 99 SCALE VECTOR AND INTEGRATE. FACTl=SCAlE"4. FACT2=SCAlE*2. 00 45 I=2,NN,2 XI I )=XIII*FACTl X(I+l)=XII+11*FACT2 XINT=XINT+XII1+XII+11 XI1J=XIlI*SCAlE IFIJSWTCHI 55,50,55 50 X(lX)~X(lXI*SCAlE 55 XIlX-l)=XllX-11*fACTl XINT=XINT+XLl)+XllX)+XllX-I) GO TO 99 XIlX-I)=XIlX-11*1.25 XIlX)=XllX)*1.5*SCAlE XINT=XINT+Xtl)+XllXJ+XllX-lJ*.2 GO TO qq C C C UNSCAlE VECTOR 60 65 70 75 99 FACTl=.25/SCAlE fACT2=.5/SCALE DO 65 I=2,NN,2 XII) =X I I )"FACTI XII+l)=XII+1)"fACT2 XI1J=Xll)/SCAlE IFIJSWTCH) 75.70,75 XILX)=XILX)/SCAtE XILX-l)=XILX-l)*fACTl ••••••••••••• ** ••••••••• .. SMPSON .. .** ............ *.* ••••••• IPAGE 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0117 0178 0179 01110 0181 0182 0183 0184 0185 01B6 ulB7 0188 lJ189 0190 GO TO q9 0191 01n XILX-ll=.8*XILX-1) XILX)=XILXI/Il.5*SCALE) RETURN END 0193 0194 0195 0196 3) •••••••••••••••••••••••• • SPCOR2 * •••••••••••••••••••••••• PROGRAM LISTINGS -..•.................... .*-.. • SPCOR2 • ** ••••••••• ** •••••• • SPCOR2 ISUBROUTINE. 9/8/64 LAST CARD IN DECK IS NO. 0180 • LABEL 0001 CSPCOR2 0002 SUBROUTINE SPCOR2 INRX,NCX,XX,NRy,NCy.yy,MXACC.ILGR~NRZ. 0003 I ILGC,INC,NCZ,ZZ,SPACE,IANSI 0004 C 0005 C ~~--ABSTRACT---0006 C 0007 C TITLE - SPCOR2 0008 C SPATIAL CROSSCORRELATION OF 2-0IMENSIONAL SPATIAL ARRAYS 0009 C 0010 C SPCOR2 EVALUATES THE SPATIAL CROSSCORRELATtON OF AN 0011 C ARRAY XII,JI l=l •••• ,NRX J=I, •••• NCX WITH ANOTHER 0012 C ARRAY Y1I.JI I=I, •••• NRY J=I, ••• ,NCY 0013 C 0014 C NCX NRX 0015 zn ,JI C SUM ( SUM I XIK+I-1,L+JJ.Y1K,LJ ) J 01>16 C K= 1 L= I 0017 C 0016 C FOR J = ILGR, •••• ILGR+NRZ-I 0019 J = ILGC •••• ,ILGC+NCZ-I C 0020 C Jl= ILGC,ILGC+INC, •••• ILGC+INCZ-11.INC 0021 WHERE C 0022 C NRX. NCX, NRY, NCY. ILGR, NRZ. ILGC. INC. AND NCl 0023 C ARE INPUT PARAMETERS. 0024 C XII.J) AND YII.J) ARE TREATED AS ZERO WHEN I AND J 0025 C ARE OUTSIDE THE RANGE OF DEFINITION. 0026 C 0027 C SPEED IS OBTAINED BY FIXING XII,J) AND YII/JI BETWEEN 0026 THE LIMITS OF -MXACC AND MXACC AND THEN USING THE HIGHC 0029 C SPEED lOGIC OF PROCOR. FASCR1. AND FASEPI VIA QXCORI. 0030 C 0031 C XII.JI AND YII.JI ARE SLIGHTLY MODIFIED BY THE FIXING 0032 C AND REFLOATING PROCESS. 0033 C 0034 C USER MUST PROVIDE SPCOR1 WITH A BLOCK OF TEMPORARY 0035 C REGISTERS OF LENGTH MININRX,NRY) + 10*IMXACC+l1 + 0036 C 0037 C LANGUAGE - FORTRAN II SUBROUTINE 0038 C EQUIPMENT - 709, 7090, 7094 IMAIN FRAME ONLY) 0039 - 291 REGISTERS C STORAGE 0040 C SPEED - HALF OF THE COMPLETE AUTOCORRELATION OF AN ARRAY 0041 C TAKES ABOUT 0042 C 1.0070 + .0000040*INRX SQUAREO))*(NCX SQUARED) 0043 C SECONDS ON THE 7094 MOD 1. 0044 AUTHOR R.A. WIGGINS JULY, 1963 C 0045 C 0046 ----USAGE---C 0047 C 0048 C TRANSFER VECTOR CONTAINS ROUTINES - FLOATA,FXOATA,QXCORI.STZ 0049 C AND FORTRAN SYSTEM ROUTINES - XLOC 0050 C 00.51 C FORTRAN USAGE 0052 CAll SPCOR2(NRX.NCX.XX.NRY,NCY.YY.MXACC.ILGR.NRZ. C 0053 C 1 ILGC.INC,NCZ,ZZ,SPACE.IANS) 0054 C 005S C INPUTS 0056 C 0057 NRX NUMBER ROWS OF X. C 0058 C MUST BE GRTHN= 1 0059 C 0060 NCX NUMBER COLUMNS OF X. C 0061 MUST BE GRTHN= 1 0062 C C 0063 XXHI K=l, ••• ,NRX*NCX CONTAINS THE ARRAY XII.J) i=l •••• ,NRX C 0064 C J=l, •••• NCX STORED CLOSELY PACKED BY COLUMNS~ 0065 C 0066 C NRY NUMBER ROWS OF Y. 01)67 MUST I'jE GRTHN= 1 C 00h8 C 0069 NCY NUMBER COLUMNS OF Y. C 0070 MUST BE GRTHN= 1 0071 C C 0072 'fY1 Ki K=l ••••• NRY*NCY CONTAINS THE ARRAY YII,JI I=I, •• ~,NRY C 0073 •••••••••••••••••••• ** •• (PAGE •• ~ •• *•••• *•• **.* ••••••• PROGRAM LISTINGS * SPCOR2 * •••••••••••••••••••••••• *•••••••• SPCOR2 • * ••••••• * •••••• * 2) C C MXACC DEFINES THE ACCURACY OF THE TWO ARRAYS. XXII) AND YYCI. WILL BE FIXED SO AS TO HAVE VALUES LYING BETWEEN -MXACC AND +MXACC INCLUSIVE. ILGR INITIAL LAG ALONG ROWS FOR CROSSCORRELATION AS DEFINED IN THE ABSTRACT. NRZ NUMBER ROWS IN Z I.E. THE NUMBER OF LAGS ALON' THE ROWS IN THE CROSSCORRELATION. MUS T BE GRTHN= 1 ILGC INITIAL LAG ALONG COLUMNS FOR CROSSCORRELATION AS DEFINED IN THE ABSTRACT. INC INCREMENT IN THE LAG ALONG THE COLUMNS AS DEFINED IN THE ABSTRACT. MUST RE GRTHN= 1 NCZ NUMBER COLUMNS IN Z I.E. THE NUMBER OF LAGS. A~ONG TRE COLUMNS FOR WHICH THE CROSSCORRELATION IS EVALUATED. SPACE(I) I=I, ••• ,LSPACE IS TEMPORARY COMPUTATION SPACE NEEDED BY SPCORl, WHERE LSPACE = MININRX,NRY) + 10*IMXACC+11 + 1 C C C C C C C C C C C C C (PAGE J=l, ••• ,NCY STORED CLOSELY PACKED BY COLUMNSJ C C C C C C C C C C C C C OUTPUTS C C ZZCK 1 C C C C K=l, ••• ,NRZ*NCZ CONTAINS ZII,J} I=ILGR, ••• ,ILGR+NRZ-l J=ILGC, ••• ,ILGC+NCZ-1 AS DEFINED IN THE ABSTRACT. IANS =0 =1 =3 =5 =7 C C C IF IF IF IF IF NO TROUBLE ILLEGAL NRX ILLEGAL NRY ILLEGAL MXACC ILLEGAL NRZ C C C EXAMPLES C C C C C C C C C C C C 1. INPUTS - NRX = 3 NRY = 2 NCX 3 XXIl.~.91 NCY = 3 YY(l ••• 6) MXACC .. 100 ILGR = -2 NRZ NCZ = 4 OUTPUTS - IANS = 0 ZZI1 •.•• 16) = 0.00 0.44 1.32 2.20 0.1 0.4 0.2 0.5 0.3 0.6 4.9 4.7 4.B 4.6 4 ILGC = 0.7 ISTORED BY 0.8 COLUMNS) 0.9 (STORED BY 4.5 COLUMNS 1 4.4 -2 INCI .. 1 0.00 0.00 0.00 2.20 5.40 5.:14 5.39 12.32 11.:35 7.23 15.12 13.28 UTORED BY COLUMNS) C INC = 2 C 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT IANS = 0 ZZll ••• 8) 0.00 0.00 OUTPUTS C 0.44 5.40 C 1.32 12.32 C 2.20 15.12 C C C C C PROGRAM FOLLOWS BELOW DIMENSION XX(2)fYY(2),lZ(2),SPACEt2) C CALCULATE FUNDAMENTAL CONSTANTS LX=NRX*NCX LY=NRY*NCY LZ=NRZ*NCZ LSPACE=XMINOFINRX,NRY}+1+10*IMXACC+l) IAUTO = XLOCFIXX)-XLOCF(YY) C CLEAR THE OUTPUT AREA CALL srz ILZ,ZZ) C FIX THE INPUTS CALL FXDATA (lX,XX,MXACC,SCLX) SCL Y=SCLX IF IIAUTO) LO,15,10 (STORED IY COLUMNS) 0074 0075 0076 0017 0078 0079 0080 OOBI 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 21 **** •••••***.**.** •••••• • SPCOR2 •••••••••••••••••••••••• IPAGE 3) PROGRAM LISTINGS ••••••••••••• * •••••••••• • SPCOR2 • •••••••••••••••••••••••• CALL FXOATA (LY,YY,MXACC,SCLY) 10 CONTINUE 15 C DO CORRElA TI ONS IDX=NRX. I NC IXl=XMAXOFIO,ILGRJ+ILGC*NRX+l NRXl=NRX-XMAXOFtO,ILGR) ILGRl=XMINOF(O,)LGR) C XXXXXXXXXX DO 50 12=I,LZ,NRZ IX2=IXI CXXXXXXXXXXXXXXXXXXXX DO 40 I3=I,LY,NRY IF (IX2) 30,30,19 If (LX-IX2) 30,30,20 19 CAll QXCORI (NRXl,XX(IX2),NRY,YY(I3),MXACC,ILGRl,NRZ,ZZtI2'.1, 20 1 lSPACE,SPACE,IANS) IF (IANS) 30,30,60 30 CONTI NUE 40 IX2=IX2+NRX CXXXXXXXXXXXXXXXXXXXX 50 IXl=IXl+IOX CXXXXXXXXXX C REFLOAT EVERYTHING 60 CONTI NUE CAll fLOATA (lX,XX,SClX) CAll fLOATA ILZ,ZZ,SClX*SClYI IF (IAUTO) 70,80,10 CALL FlOATA (lY,YY,SClY) 10 80 CONTI NUE C THAT'S ALL THERE IS TO IT. RETURN END (PAGE 0149 0150 0151 0152 0153 0154 0155 0156 0151 0158 01.59 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0113 0174 0175 0116 0117 0118 0119 0180 3) •••••••••••••••••••••••• SPLIT • •••••••••••••••••••••••• • • SPLIT (SUBROUTINEI FAP PROGRAM LI STINGS •••••••••••••••••••••••• • SPLIT • .......................... lAST CARD IN DECK IS NO. 0194 0001 ·SPllT 0002 COUNT 400 0003 lBl SPLIT 0004 ENTRY SPLIT tX,lX,TYPE,SYM,ANT) 0005 REFIT tX,lX,TYPE,SYM,ANT) ENTRY 0006 0007 • ----ABSTRACT---0008 0009 • TITLE - SPLIT WITH SECONDARY ENTRY POINT REFIT 0010 • SPLIT A VECTOR INTO ITS EVEN AND ODD PARTS lOR INVERSf) 0011 0012 • SPLIT FINDS THE SYMMETRIC AND ANTISYMMETRIC PARTS OF A 0013 FIXED OR FLOATING POINT VECTOR. THE ORIGIN IS ASSUMED 0014 • TO BE AT THE MIDPOINT OF THE VECTOR. THE VECTOR MAY"BE 0015 OF EVEN OR ODD lENGTH. STORAGE OF THE PARTS ON TOP OF 0016 THE VECTOR IS PERMITTED. 0017 • 0018 REFIT PUTS THE PARTS BACK TOGETHER TO REFORM THI VECTOR. 0019 • 0020 * lANGUAGE - FAP; SUBROUTINE (FORTRAN II COMPATIBLE) 0021 .. EQUI PMENT - 709, DR 7090 (MAIN FRAME ONLY) 0022 .. STORAGE - 224 REGISTERS 0023 * SPEED - SPLIT IFIXED)- ABOUT 180 + 23*lX MACHINE CYCLES 0024 (FLTG) - ABOUT 180 + 34*lX MACHINE CYCUS 0025 * REF"IT IFIXEDI- ABOUT 180 + 23 .. lX MACHINE CYCU:S 0026 * (FLTG) - A80UT 180 + 68·LX MACHINE CYCllS 0027 * WHERE lX = lENGTH OF SERIES 0028 .. AUTHOR - S.M. SIMPSON 0029 0030 * ---USAGE---0031 • 0032 • • TRANSFER VECTOR CONTAINS ROUTINES NONE 0033 .. AND FORTRAN SYSTEM ROUTINES NONE 0034 0035 • • FORTRAN USAGE OF SPLIT C03l> FOR FlTG. PT. DATA • CALL SPlIT~X,LX,TYPE,SYM,ANTI 0037 0038 • IFOR FIXED PT. DATA 0039 X,SYM ANO ANT WOULD BE FIXED POINT NAMES' 0040 •• INPUTS TO SPLIT 0041 0042 • XII} I=l ••• lX IS A FIXED OR FLOATING POINT VECTOR 0043 0044 LX IS FORTRAN II INTEGER = lENGTH OF X SERIES 0045 • SHOULD EXCEED ZERO 0046 * fIF LX IS LSTHN= 0 PROGRAM EXITS WITH NO OUTPUTI 0047 • 0048 • TYPE = 0.0 ~IGNIFIES XIII IS FIXED POINT 0049 = 1.0 ~IGNIFIES XII) IS FLOATING POINT 0050 0051 • 0052 • OUTPUTS 0053 • SYM II) l=l ••• lS HOLDS SYMMETRIC PART, WHERE 0054 • FOR tX ODD, LS = IlX+l)/2 AND 0055 • SYMIlI = XIlSI 0056 SYMI II = XIlS-l+J) + XILS+I-II f=2,J,J~ •• lS 0057 FOR lX EVEN, lS ~ LX/2 AND 0058 • SYMII) = XIlS+ll + XIlS+I-I) I=I,2,.~~,lS 0059 0060 l=l ••• lA HOLDS ANTISYMMETRIC PART, WHERE 0061 • ANT II I FOR tX ODD, lA = ILX-11/2 AND 0062 • ANTII) = XILS+11 - XILS-Il 1= 1~2,.j •• lA 0063 0064 FOR lX EVEN, LA = lX/2 AND • 0065 ANTIll = XIlA+11 - XIlA+I-II 1= li2,.J.tlA (ANTIll IS AN OUTPUT ONLY IF LA IS GRTHN=lJ 0066 0067 • (SYM AND ANT WILL BE FIXED OR FLOATING ACCORDING TO TYPE) 0068 • 0069 STORAGE OF SYM AND ANT ON TOP OF X SERIES IS PERMITTED • ONLY IF SYMI1J IS EQUIVALENT TO XII) 0070 • AND ANTIll IS EQUIVALENT TO XILS+1J 0071 0072 • 0073 • FORTRAN USAGE OF REFIT • .. .. .. .. . . . ... ... ... ... . ... .. 9129/64 ••••••••••••••••••••••• * • SPLIT • PROGRAM 11 STINGS ••• •••••••••••• *•••• * •• •••••••••••••••••••••••• IPAGE 21 ~ (PAGE 2) " "" "" " " " "• " " •" CALL REFIT -.•••••....•.........•.. SPLIT • • IX,LX~TYPE.SYM,ANT) FOR FLTG. PT. DATA IFOR FIXED PT. DATA X, SYM AND ANT WOULD BE FIXED PT. NAMES) INPUTS TO REFIT LX SAME MEANING AS FOR SPLIT TYPE SAME MEANING AS FOR SPLIT SYMI II l=l ••• LS IS SYMMETR IC PART ANTill I=I ••• LA IS ANTISYMMETRIC PART INOT USED IF LA-O) • OUTPUTS FROM RefIT "• • " •" • •" " " " "" "• • " • • " • " " • • • XIII 1=1 ••• LX IS REFITTED SERIES FROM SYM AND ANT. WHERE FOR LX 000 XIII = ISYMILS+1-I) - ANTILS-I))I2. ("1.4~tS-1 XILSI .. SYMlli XII) = ISYMII-LA) + ANTII-LA-l)/2. I.LS+I.~JLX FOR LX EVEN XII) ISYMILS+1-1) - ANTlLS+1-I))/2.1=1.~.LS XIlt = (SYMII-LS) + ANTII-LS»)/2. ("LS~l~J~LX INOTE- FOR FIXED OATA, DIVISION BY 2 INCLUDES ROUNDING INTO BIT 35) EXAMPLES 1. PARTS AWAY, REFIT AWAY, LX 000, FIXED AND FLOATING INPUTS - XI1 ••• l) = 80.,60.,50.,40.,30.,20.,10. IXt1 ••• 7)- 80,60,50,40,30,20,10 LX-7 USAGE CALL SPLIT IX,LX,1.0,SYM,ANTI CALL REFIT IY,LX.1.0.SYM,ANTI CALL SPLIT IIX,LX,O.O,ISYM.IANT) CALL REFIT IIY,LX,O •• ISYM,IANT) OUTPUTS - SYMll.~.4) - 40.,80.,80.,90. ANTll~~.31 - -20~,-40~~-10~ Yll ••• 1) - Xl1 ••• 7) ISYMI1J •• 4i .. 40,80,80,90 IANTI1 ••• 31 .. -20.-40,-10 IYll ••• 7) .. IXl1 ••• 71 • 2. PARTS AWAY. REFIT AWAY. LX EVEN, FIXEO AND FLOATING • INPUTS - SAME AS EXAMPLE 1. EXCEPT LX-6 " USAGE - SAME AS EXAMPLE 1. " OUTPUTS - SYMll.~.31 .. 90.,90.,100. ANTll ••• 31" -10 •• -~0"-60. • Yll.~.61 - Xll ••• 61 • ISYMl1 ••• 31 • 90.90,100 IANTll ••• 31 = -10.-30~-60 • IYl1 ••• 6) .. IXIl ••• 6) •• • • • • • • • " • "" 3. PARTS ON TOP, REFIT ON TOP, LX 000, FIXED AND FLOATING INPUTS SAME AS EXAMPLE 1. USAGE CALL SPLIT IX,LX,1.0~X,X(5» CALL REFIT IX,LX,1.0~X.X(5») CALL SPLIT IIX,LX,0.0,IX,IX(5») CALL REFIT IIX,LX,0.0,IX,IX(5)) OUTPUTS - XII ••• 7) = 80.,60.,50.,40.,30.,20.,10. IXtl •• ~71 • 80,60.50,40.30,20,10 INOTE- FOLLOWING FIRST CALL OF SPLIT X(1 •• ~7) 40.,60.,60.,90.,-20.,-40.,-10.) 4. PARTS ON • INPUTS "USAGE • " • • OUTPUTS • • TOP, REFIT ON TOP, LX EVEN, FIXED AND FLOATING SAME AS EXAMPLE 2. CALL SPLIT IX,LX,1.0,X,X(4)) CALL REFIT IX,LX,l.0.X,XI4', CALL SPLIT IIX,LX,O.0.IX,IX(4») CALL REFIT IIX,LX,O.O,IX,IXI411 XI1 ••• 61 - 80.,60.,50.,40.,30.,20. IXl1 ••• 6) = 60,60,50,40,30,20 • 5. CHECK ON SPECIAL CASES LX=l, LX=2 • INPUTS - SAME AS EXAMPLE 1. CALL SPLIT IX,l,O.O,SYM,ANT) • USAGE CALL REFIT IY,l,O.O,SYM,ANTJ "• CALL SPLIT IIX,2,0.0,ISYM,IANT) d 0074 0075 0016 0071 0078 0079 0080 0081 0082 0083 0084 0085 0086 0081 0086 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 ....•.•... ...........•. ~ • SPLIT •••••••••••••••••••••••• SPLIT • •••••••••••••••••••••••• PROGRAM LISTINGS • • • • • • • • • • \It\.'. . . . . . .Jt . . . . . . . . . . (PAGE 31 (PAGE CALL REFIT IIY,2,0.0,ISYM,IANT) OUTPUTS - SYMlll = 80. ANTill = UNDEFINED Ylll 80. ISYMll) = 140 IANTIl). -20 IYI1 ••• 2) = 80,60 • • • = •• PROGRAM FOllOWS 8ELOW NOTATION EQUIVALENCES USED IN PROGRAM NOTES M ~ lX • N ~ lS • P = lA • • • HTR BCI SPLIT STZ TRA REfIT CLA STA S2 SXO SXA SXA ClA. STO ClAARS SlO CAS TRA TRA TRA lRS STO STO llS LBT TRA TRA S3 SiTZ TRA S4 CLA STA CLA ADO STO S18 CLA ALS S10 CLA ALS STO CLA ADD STA SifA SUB SUB STA STA o 1,SPLIT S65 S2 S55 S65 SPlIT-2,4 S49+1,1 S49+2,2 3,4 S64 2,4 18 S62 S61 ·+3 S260 S49 1 S63 S68 1 SET PROGRAM INDICATOR =0 SET PROG INDIC = 1 SAVE IR4 FOR STD ERROR PROC SET FIXEO-FLOATING INDICATOR GET M IN ADDRESS STORE IT CHECK M M GRTR 1 SPECIAL CASE M=1 ILLEGAL M, GO EXIT FORM P=M/2 DR IM-11/2 STORE P STORE TRIAL N=P CHECK IF M 000 OR EVEN EVEN 000 SET EVEN-ODD INDIC=O (EVEN) (TRIAL N OK) SET EVEN-ODD INDIC =1 (000) S3 S4 S61 S18 S55 S6l S68 INDEX TRIAL N BY 1 S67 S68 S63 SET P IN DECREMENT OF 18 ONE LOOP COUNTER S39 S68 SET 11 N/2 TRUNCATED S80 IN DECREMENT 4,4 SET S67 XS+l ADDR S81 S83 AND S61 XS-N ADDR. S68 S82 IN REVERSE SYM LOOP S84 NZT S65 IS IT SPLIT OR REFIT TRA S6 ISPLIT IF ZERO) .SET UP EXCHANGE AND MIDPOINT ROUTINES FOR REFIT SET XS+1 ADDRESS IN CLA S81 STA S4!> EXCHANGE STA S85 AND MIDPOINT CLA 1,4 SET X+l ADDRESS IN ADD S61 EXCH STA S38 AND MDPT sa S86 SET X-M ADDRESS SUB S61 SUB S62 IN STA S36 EXCH LOOP CLA 5,4 SET XA-P ADDRESS SUB S63 IN EXCH LOOP STA S32 CLA S53 SET S59 STA S34+1 STO AODRESS ClA S36+1 SET S60 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0161 0168 0169 0170 0111 0112 0173 0174 0115 0116 0111 0178 0119 0180 0181 0182 0183 0184 0185 0186 0181 0188 0189 0190 0191 0192 0193 0194 0195 0196 0191 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 OUI 0222 0223 3) • ••••••••••••••• *••••••• - SPLIT - PROGRAM lISTINGS •••••••••••••••••••••••• (PAGE 41 STA S31+1 STO ADDRESS lET S64 FXD OR Fl TG TRA S100 FLTG TRA S101 FXD S100 ClA S50 SET FOP INSTR HO S30 STO S33 ClA S52 SET XCA INSTR S102 STO S31 STO S34 TRA S7 S101 ClA S55 SET lRS INSTR STO S30 STO S33 ClA S56 SET RND INSTR TRA S102 -SET UP EXCHANGE AND MIDPOINT ROUTINES FOR SPLIT S6 ClA S36+1 SET S60 STA S34+1 STO ADDRESS CtA S53 SET S59 STA S31+1 STO ADDRESS CtA S81 SET XS+l ADDRESS STA S86 IN MOPT STA S36 IN EXCH CLA 1,4 SET X+ 1 ADDRESS ADD S67 STA S85 IN MDPT STA S45 IN EXCH SUB S67 set X-M ADDRESS SU8 S62 STA S32 IN EXCH 5,4 ClA SET XA-P AODRESS SUB S63 STA S38 IN EXCH -SET EXCH LOOP FOR EITHER FXO OR FLTG POINT SPLIT S9 CLA S66 SET 4 NOP.S STO S30 STO S31 STO S33 STO S34 TRA S7 .FINISH SETTING FOR EITHER SPlI T OR REF IT S64 S7 lET FIXEO OR FLTG TRA S12 FlTG TRA S13 FIXED S13 CLA S0;7 SET ADO AND SUI\ INSTRUCTIONS STO S35 CLA S58 STO S37 TRA S14 S12 CLA S.53 SET FAD ANO FSB INSTRUCTIONS STO S35 CLA S54 STO S37 S14 lET S65 SPLIT OR REFIT TRA S90 REFIT TRA S91 SPLIT S90 CLA S36+1 REFIT - PATCH UP S60 AOORESS STA S35 IN lOOP CAL S36 GET INSTR WITH WRONG TAG ANA S99 WIPE OUT TAG ORA S97 PUT IN TAG OF 2 SLW S36 CAL S38 REPEAT ANA S99 ORA S98 PUT IN TAG OF 1 SLW S38 TRA S15 ON TO REFIT SEQUENCE CLA S53 S91 SPLIT - PATCH UP S59 AOORESS STA S35 CAL S36 GET INSTR WITH WRONG TAG ANA S99 WIPE OUT TAG ORA S98 PUT IN TAG OF ONE SlW S36 CAL S38 OITTO •••••••••••••••••••••••• • SPLIT • f ••••••••••••••••••••••• (PAGE 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0273 0274 0275 0276 0277 0278 0279 0280 0281 0282 0283 0284 0285 0286 0287 0288 02B9 0290 0291 0292 0293 0294 0295 0296 0297 0298 4) ............................ SPLIT • PROGRAM LI STINGS • (PAGE 5) ANA ORA SLW TRA 599 OCT S98 PZE 597 PZE S15 TSX TSX TSX CLA STA LXA PXA SUB HE S99 S97 S38 S16 -317777077771 0,1.0 0.2.0 S48.4 S47.4 S41t.4 S83 XS+l S61 S38.4 X+l 0.4 S61 ·+2 S4B.4 S49 S44.4 S47.4 S48.4 S49 TSX TRA 516 TSX TSX TSX TRA .EXCHANGE LOOP S44 AXT 1.1 AXC 1.2 • . •••••••••••••••••••••••• SPLIT • • •••••••••••••••••••••••• ........................ PUT IN TAG OF 2 ON TO SPLIT SEQUENCE REF IT SEQUENCE AVOID REREVERSE IF X=XS (PAGE 0299 0300 0301 0302 0303 0304 0305 0306 0307 0308 0309 0310 0311 0312 0313 OUIt SPLIT, SEQUENCE FOR FOR SPLIT SPLIT FIXED FLTG CLA X+l,l CLA X+l.1 NOP NOP NOP NOP STO S59 OR CLA X-M,2 CLA X-M,2 NOP NOP NOP NOP OR STO S60 ADD S59 FAD S59 STO XS+l,l STO XS+l.l FOR FOR REFIT REFIT FIXED FL TG CLA XS+l.1 ClA XS+ljl LRS 1 FOP S51 RND XCA STO S60 CLA XA-P,2 CtA XA-P'2 LRS 1 FOP S51 RNO XCA STO S59 ADD S60 FAD S60 STO X-M.2 STO X-M.2 ••• l S45 CLA S30 NOP -. NOP •• S31 STO ..... 2 532 CLA NOP .. .. S33 NOP •• S34 STO •• S35 NOP •• S36 S10 •• 1\ ClA S60 S37 NOP ... SUB S59 FSB S59 SUB S59 FSB S59 •• ;2 5TO XA-P.2 STO XA-P.2 STO X+l.l STO X~ltl S38 STO TXI "+1.1.1 INCREASE I 8Y 1 TXI -+1.2.-1 DECREASE -I BY 1 S39 TXL S45.1... ..-=P TRA 1.4 ."IDPOINT MOVE ROUTINE (IF M IS ODD) ASSUMES IRI = P+l 547 NZT S61 SPLIT REFIT TRA 1.4 LXA S63, 1 PUT P+1 IN IRI TXI "+1.1.1 S85 CLA ..... 1 CLA X+l,1 CLA XS+l.1 S86 STO ... ,1 STO XS+l.1 STO X+l.l TRA 1.4 .REVERSE SYMMETRIC PART ROUTINE S48 AXT 1,1 AXC 1,2 581 CLA .... 1 CLA XS+l.l LDQ XS-N.2 582 LDQ •• ;2 S83 STQ .... 1 STQ XS+l.1 S84 STO •• ,2 STO XS-N.2 TXI .+1,1,1 TXI .+1,2,-1 SB~ TXL S81,1 .... *-=N/2 TRUNCATED TRA 1.1t • TREAT SPECIAL CASE M=1 IS IT SPLIT OR REFIT 5200 CLA S65 TZE S205 CLA. 4,4 REFIT STO. 1,4 TRA S49 S205 CLA. 1.4 SPLIT STO. 4.4 .EXIT ROUTINE S49 LXD SPLIT-2.4 *.,1 AXT ..... 2 AXT TRA 6.4 0315 0316 0317 0318 0319 0320 0321 0322 0323 0324 0325 0326 0327 0328 0329 0330 0331 0332 0333 0334 0335 0336 0337 0338 0339 0340 0341 0342 0343 0344 0345 0346 0347 0348 0349 0350 0351 0352 0353 0354 0355 0356 0357 0358 0359 0360 0361 0362 0363 0364 0365 0366 0367 0368 0369 0370 0371 0372 0373 5) ....................... - SPLIT •......... _......•.......* (PAGE PROGRAM LISTINGS •••••• * ••••••••••••••••• • SPLIT • •••••••••••••••••••••••• (PAGE 61 .CONSTANTS ETC FOR SPLIT AND REfIT S50 FDP S51 S51 DEC 2.0 S52 XCA S53 FAD S59 S59 S54 FSB S55 LRS 1 S56 RNO S57 ADO S59 S59 S58 SUfi STORAGE FOR XIII/2 OR XSII) S59 PZE STORAGE FOR X(M-(I-111/2 OR XA(P-If-lIJ S60 P ZE .*=0 IF M EVEN, =1 IF MOOD S61 PZE ** S62 PZE *.=p S63 PIE *.=0 IF fIXED PT, =1 IF fLTG S64 PZE ** S65 PZE **=0 IF SPLIT, **=1 IF REfIT ** S66 NOP S67 PZE S68 PIE END .* *. *. *. *. 0374 0375 0376 0377 0378 0379 0380 0381 0382 0383 0384 0385 0386 0387 0388 0389 0390 0391 0392 0393 0394 61 • ••'•••••••• * ............ . SQROEV •••••••• * ••••••••••••••••* REFER TO SQROFR PROGRAM LI STINGS •••••••••••••••• ** •••••• if SQROEV • •••••••••••••••••••••••• TO SQRDFR ~EFER *.*.* •••••••• *•••• ** ••• * ••••• * SQRDFR • ••••••••••••••••••• PROGRAM LISTINGS 9/29/64 • SQRDFR I SUBROUTI NE) • FAP ·SQRDFR COUNT 100 SQRDFR L8L SQRDFR (X,Y,.LXY,SSQXMY) ENTRY ENTRY SQRDEV IX,X8ASE,LX,SSQXMBI -..•.•.•..••.••.......•. SQRDFR • • •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0110 0001 0002 0003 0004 0005 0006 0001 • ----ABSTRACT---0008 • 0009 • • TITLE - SQRDFR WITH SECONDARY ENTRY SQRDEV 0010 • SUM SQUARE DIF. OF FLTG VECTOR FROM ANOTHER OR FROM I CONSTANT 0011 0012 • SQROFR SUMS THE SQUARES OF THE DIFFERENCES BETWEEN TRE 0013 • ELEMENTS OF TWO FLOATING VECTORS. 0014 • 0015 • SQRDEV SUMS THE SQUARES OF THE DIFFERENCES BETWEEN TME 0016 • ELEMENTS OF A FLOATING VECTOR AND A CONSTANT. 0011 • 0018 • - FAP SUBROUTINES IFORTRAN-II COMPATIBLE) 0019 • LANGUAGE • EQUIPMENT - 109 OR 7090 (MAIN FRAME ONLY) 0020 REGISTERS - 36 0021 • STORAGE 1090 109 0022 • SPEED 38 + 133.8 OR 31.0).LX MACHINE CYCLES, LX= VECtOR LENGTH 0023 • SIMPSON, AUGUST 1963 S.M. 0024 • AUTHOR 0025 • ----USAGE--0026 • 0021 • • TRANSFER VECTOR CONTAINS ROUTINES - (NONE) 0028 • AND FORTRAN SYSTEM ROUTINES - (NONE) 0029 0030 • 0031 • FORTRAN USAGE • CALL SQROFRIX,Y,lXY,SSQXMY) 0032 CALL SQRDEVIX,XBASE,lX,SSQXMBI • 0033 0034 * 0035 • INPUTS 0036 • X( lJ I:l ••• lXY IS INPUT TO SQRDFR 0031 Y( II l=l ••• LXY IS INPUT TO SQRDFR 0038 • LXY SHOULD EXCEED 0 0039 • 0040 • XI I) l:l ••• LX 0041 IS INPUT TO SQRDEV • IS INPUT TO SQROEV 0042 • XBASE SHOULD EXCEED 0 0043 • LX 0044 • STRAIGHT RETURN WITH NO ACTION IF LXY OR LX LSTHN 1 0045 • OUTPUTS 0046 • IS SUI'! (FROM 1=1 TO LXY) OF IXII)-Y(J)).O(III-YOlll 0041 • SSQXMY 0048 • IS SUM (FROM 1=1 TO LXI OF IXII)-XBASEI.(XII)-XBASEI 0049 • SSQXMB 0050 • EQUIVALENCEISSQXMY,ANY INPUTI,ISSQXMB,ANY INPUT) IS 0051 • PERMITTEO. 0052 • 0053 • 0054 • EXAMPlES 0055 1. INPUTS XIl ••• 3) = 1., 2., 3. YIl ••• 3): 3 • .,4.,5. SOfF2"0.0 0056 * USAGE tALL SQROFR{X~y,3,SDIFI) 0051 • CALL SQROEVIX,3.0,3,SDEVl1 0058 • 0059 CALL SQROFRIX,Y,I,XI • CALL SQROFRIX,Y,0,SOIF21 0060 OUTPUTS - SOIFt = 12.0 SOEV1= 5.0 X11I= 4.0 0061 • SOIF2 = 0.0 (NO OUTPUT CASEI 0062 • 0063 • 0064 • PROGRAM FOLLOWS BELOW 0065 • 0066 • 0061 • NO TRANSFER VECTOR HTR 0 XR4 0068 BCI I,SQROFR 0069 0010 • PRINCIPAL ENTRY. SQROFRIX,Y,LXY,SSQXMY) SQRDFR CLA 2,4 0071 ADD Kl AIYI+1 0012 STA FSB 0013 CLA FSB 0014 • . . - • ••••• ** •••••••••••••••• PROGRAM LISTINGS "••••••••••• ** •••••••••••" (PAGE •••••••••••••••••••••••• SQRDFR "••• _••••••• * ••• ** •• * •• *** SQRDFR 2) IPAGE SETUP STO SXO KI CLA ADO sa CLA* TMI POX TXL STZ SUBTR SQRDFR-2,4 1,4 KI GET 3,4 LEAVE 0,4 LEAVE,4,0 TEMPI A(Xl+l LXY " LOOP CLA GET **,4 *"=AIXl+l = FSB AIY)+1,4, OR FSB AIXBASEl SUBTR FSB •• ,** TEMP2 STO XCA FMP TEMP2 FAD TEMPI TEMPI STO GET,4,1 TIX " STORE RESULT SQRDFR-2,4 LXO 4,4 STO• EXIT LEAVE LXD SQRDFR-2,4 TRA 5,4 " SECOND ENTRY. SQROEV (X,XBASE,LX,SSQXMBI SQROEV CLA 2,4 AIXBASEI STA FSBXB CLA FS6XB TRA SETUP " CONSTANTS, TEMPORARIES .... =A I Y1+ 1 FSB FSB *",4 **=AIXBASEl FSBXB FSB ** SUM TEMPI PZE .",*",** TEMP FOR DIFFERENCE TEMP2 PIE "*.*",** END 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 010R 0109 0110 21 •••• *••••~.*.*.*.*.*•• ** SCIRMLI ••••••••••••••••••••••• • 4. PROGRAM LISTINGS 9/29/64 LAST CARD • SQRMLI ISUBROUTINE) • FAP .SQRMLI COUNT 100 SQRMLI LBL ENTRY SQRMLI IMLIVEC,ILO,IHI,MLISQR,IANS) •••••••••••••••••••••••• SClRMll • •••••••••••••••••••••••• ., DECK IS NO. 0127 0001 0002 0003 0004 0005 0006 • 0007 - ... --ABSTRACT---• 0008 • 0009 * TITLE - SQRMLI • FAST SQUARE ELEMENTS OF A MACHINE LANGUAGE INTEGER VEaTOR 0010 0011 • SQRMLI TREATS A SPECIFIED RANGE OF A FORTRAN-TY'E VECTOR 0012 • 0013 AS MACHINE INTEGERS, FORMING A SECOND VECTOR WHOSE • 0014 ELEMENTS ARE THE MLI SQUARES OF THOSE OF THE FIRST • VECTOR, CHECKING FOR OVERFLOW. 0015 • 0016 • 0017 • LANGUAGE - FAP SUBROUTINE (FORTRAN II COMPATIBLE) 0018 • EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0019 • STORAGE - ~5 REGISTERS 0020 • SPEED - LENGTH OF RANGE TIMES 20 MACHINE CYCLES IAVG INTEGERS) 0021 • AUTHOR - S.M. SIMPSON JR, JUNE 1962 0022 • 0023 -"'--USAGE--• 0024 • 0025 • TRANSFER VECTOR CONTAINS ROUTINES - NONE 0026 • AND FORTRAN SYSTEM ROUTINES - NONE 0027 • 0028 • FORTRAN USAGE 0029 • CALL SQRMLItMLIVEC,ILO,IHI,MLISQR,IANS) 0030 • 0031 • INPUTS 0032 *• 0033 MLIVECIIl I.1LO, •••• IHI IS THE INPUT VECTOR RANGE. 0034 • 0035 ILO MUST EXCEED O. * 0036 * 0037 IHI MUST EQUAL OR EXCEED ILO. * 0038 •• OUTPUTS 0039 0040 *• 0041 MLISQRII) I.l,2,~ •• ,IIHI-ILO+1) CONTAINS 0042 • SQUARElMLIVECIILO, •••• IHII). 0043 • 0044 IANS = 0 MEANS JOB DONE OK. * 0045 =-1 MEANS ILLEGAL SPECIFICATION OF ILO, IHI. • =-2 MEANS THE SQUARE OF ONE OF THE MLIVEC ELEMINTS 0046 * EXCEEDED 35 BITS IN LENGTH (PROGRAM DOES NOT FINISH 0047 * SQtiARING REST OF ELEMENTS WHEN THIS CONDITION OCCURS) 0048 • 0049 • 0050 • EXAMPLES 0051 • 0052 • 1. INPUTS - MLIVEC(1 ••• 5)-OCT 2,4,6,10.12 ILO-2 IHI=5 0053 OUTPUTS - IANS-O. MlISQRll ••• 41=OCT 20,44.100,144 • 0054 • 0055 • 2. INPUTS SAME AS EXAMPLE 1. EXCEPT MLIVEC(3)=OCT 700000 0056 • OUTPUTS - IANS =-2 MLISQRll ••• 21= OCT 20.210000000000 0057 • I.E., MLISQR(2) • LEAST SIGNIFICANT 35 BITS OF 0058 • OCT 700000 SQUARED = 610000000000 0059 •• 3. INPUTS - SAME AS EXAMPLE 1. EXCEPT IHI=l 0060 0061 • OUTPUTS - IANS=-l 0062 • 0063 .HTR 0 0064 1. SQRMLl BCI 0065 SXA SQRMLI EXITtl SQRMLI-2,4 0066 SXO 2,4 AlAI ILO) 0067 CLA 0068 STA GET2 3,4 AIAIIHIl) 0069 CLA 0070 STA GET3 5,4 0071 CLA AIAIIANS) PUTS 0072 SifA 0073 • SET UP CONSTANTS ILD, IHI, lVECT AND CHECK THEM. 0074 • SET IANS FOR IL~EGAL INPUT. I~ .............-........•. SQRMLI • "••••••••••••••••••• *•••• IPAGE PROGRAM LISTINGS •••••••••••••••••••••••• IPAGE 2) 2) CLS STO GET2 CLA ARS $fa Kl IANS "" IB no AIILO) TMI LEAVE TZE LEAVE GET3 CLA AI IH I) •• ARS IB STO IHI TMI LEAVE LEAVE TZE SUB IlO AOO Kl STO LVECT TMI LEAVE LEAVE TZE " SET LOOP UP CLA AIAIMLlVEC1) 1.4 SUB ILO ADO K2 STA LOQ STA MPY CLA AI AI MLlSQRI I 4.4 ADO Kl STA STQ • SET IANS FOR POSSI BlE OVERFLOW INDICATION DURING LOOP. CLS K2 STO IANS .. LOOP LXA LVECT.1 •• ,1 LO!;) lOQ AIMLIVECI-ILO+2 MPY MPY AIMLIVECI-llO+2 .*.1 STQ ST!;) .·,1 AI MLlSQR I +l TNZ LEAVE LO!;),1 ,1 TIX .. ALL OK IF FALLS THRU LOOP • IANS STZ " STORE IANS AND LEAVE. LEAVE CLA IANS AlS 18 PUT5 STO AIIANSI •• ,1 EXIT AXT TRA 6,4 • CONSTANTS Kl PZE 1 K2 PZE 2 • VARIABLES no PZE IHI PZE IANS PZE o OR -lOR -2 •• LVECT PZE IHI-ILO+l •• END ... ...... .•••••••••••••••••••••••• SQRMLI " 0075 0076 0077 0076 007Q 0060 00B1 00B2 00B3 0064 0085 0086 0087 0066 0069 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 ..•••••••••••• . SQROOT **********_. PROGRAM LISTINGS .. SQROOT (SUBROUTINE) .. FAP "SOROOT COUNT 100 LBL SQROOT ENTRY SOROOT (X,LX,XSQRTDI . ................................. .. SQROOT LAST CARD IN OECK IS NO. 0082 0001 0002 0003 0004 0005 0006 ----ABSTRACT---0007 0008 .. TITLE - SQROOT 0009 • SQUARE ROOT OF A FLOATING VECTOR 0010 0011 SQROOT FORMS A VECTOR WITH ELEMENTS EQUAL TO THE SQUARE DOll ROOTS OF THE ELEMENTS OF ANOTHER (FLOATING) VE¢TOR~ 0013 OUTPUT MAY REPLACE INPUT, 0014 0015 .. lANGUAGE - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) 0016 .. EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0017 .. STORAGE - 24 REGISTERS 0018 .. SPEED - ABOUT 31 + 220*lX MACHINE CYCLES, LX VECTOR LENGTJiiI 0019 .. AUTHOR - S.M. SIMPSON, AUGUST 1963 0020 0021 ----USAGE---0022 0023 .. TRANSFER VECTOR CONTAINS ROUTINES - (NONE) 0024 .. AND FORTRAN SYSTEM ROUTINES - SQRT (FUNCTION) 0025 0026 * FORTRAN USAGE 0027 .. CALL SQROOT(X,lX,XSQRTDI 0028 0029 .. INPUTS 0030 0031 XII) I=l ••• LX IS A NON-NEGATIVE VECTOR 0032 0033 LX SHOUlO EXCEED 0 00.34 0035 .. OUTPUTS STRAIGHT RETURN WITH NO OUTPUTS IF lX LSTHN 1 0036 0037 .. XSQRTDtI) I=I ••• LX IS XSQRTDII) = SQRTF(XIIl). NEGATIYE VALUES 0038 .. OF XIII ARE TREATED AS THOUGH THEY WERE POS'TLVE. 0039 0040 EQUIVALENCE IXSQRTD,XI IS PERMITTED. 0041 0042 .. EXAMPLES 0043 0044 .. 1. INPUTS - Xll ••• 4) = 100., 200., -300., 400. XSQRT2=0.0 0045 * USAGE CALL SQROOTIX,4,XSQRTl) 0046 .. CALL SQROOTIX,0,XSQRT2l 0047 .. CALL SQROOTIX,4,XI 0048 * OUTPUTS - XSQRTlll ••• 41= 10.0, 14.1, 17.3, 20.0 0049 .. XSQRT2 = 0.0 (NO OUTPUT CASEI XI1 ••• 4)= XSQRT1(1 ••• 4) 0050 0051 .. PROGRAM FOLLOWS BELOW 0052 0053 0054 .. TRANSFER VECTOR CONTAINS SQRT FUNCTION 0055 HTR o XRl 0056 HTR o XR4 0057 BCI 1,SQROtllT 0058 .. ONLY ENTRY. SQROOTlX,LX,XSQRTO) 0059 SOROOT SXO SQROOT-2,4 0060 SXD SQROOT-3,I 0061 1,4 Kl CLA 0062 ADD Kl AIXI+l 0063 STA GET 0064 3,4 CLA 0065 ADD KI AIXSQRTD1+1 0066 STA STORE 0067 2,4 LX ClA* 0068 TMl LEAVE 0069 POX 0,1 0070 Txt LEAVE,l,O 0071 .. LOOP 0072 •• ,1 GET CLA **=AIX1+1 0013 SSP 0074 . .. .. ...... ... . . .... .. . .. . . . .. 9/29/64 .. ......................... .. ••••••••••• * ••••••••• *** SOROOT ••••• *.** * ••••• *** •••••• ** (PAGE PROGRAM LISTINGS .*.~ 21 TSX STORE STO T1X • EXIT LEAVE LXO LXO TRA E"IO $SQRT,4 **0 GET,l tl SQROOT-2,4 SQROOT-3.1 4,4 ••••••••••••••• ** •• ** ••• SOROOT • * u=AIXSQRTO)+l ............ ****.*** (PAGE 0075 0076 0077 0078 0079 0080 0081 0082 21 •••••••••••••••••••••••• • SQRSUM • • * •••••••• ~ ••••• * •••••• * PROGRAM LI STINGS • SQRSUM ISUBROUTINEI • FAP .SQRSUM COUNT 150 lBl SQRSUM SQRSUM I X, lX,SUMSQXI ENTRY XSQSUM (IX,LIX,IXMSQX) ENTRY ...•••••••••••••••••••••••• ,.•...•.•.••......•.. • SQRSUM LAST CARD IN DECK IS NO. 0106 0001 0002 0003 0004 0005 0006 0601 ----ABSTRACT---0008 • 0009 • .. TITLE - SQRSUM WITH SECONDARY ENTRY XSQSUM 0010 • SUM THE SQUARED ELEMENTS OF A FlTG OR FXD VECTOR 0011 0012 • SQRSUM ADDS UP THE SQUARED ELEMENTS OF A FLTG P.T YECTOR 0013 • XSQSUM ADOS UP THE SQUARED ELEMENTS OF A FXD PI VECTOR 0014 0015 - FAP SUBROUTINE IFORTRAN-II COMPATIBLE) 0016 • lANGUAGE 0017 • EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) - 36 REGISTERS 001B • STORAGE .. SPEED 7090 709 0019 SQRSUM 42 + (19.6 OR 23.BI.lX MACHINE CYCLES • 0020 XSQSUM 39 + (23.4 OR 26.61*lX lX = VECTOR lENGTH 0021 - S.M. SIMPSON, AUGUST 1963 002? • AUTHOR 0023 • ----USAGE---0024 0025 • TRANSFER VECTOR CONTAINS ROUTINES - CNONE) 0026 0027 • AND FORTRAN SYSTEM ROUTINES - CNONE) 0028 .. FORTRAN USAGE 0029 • CAll SQRSUMC X, lX,SUMSQXI 0030 0031 CALL XSQSUM~IX,lIX,IXMSQXI 0032 .. INPUTS 0033 0034 XI I I l=l ••• LX IS A FlTG VECTOR 0035 0036 SHOULD EXCEED ZERO 0037 • LX 0038 0039 I XCI I 1=1 ••• lIX IS A FXD VECTOR 0040 SHOULD EXCEED ZERO 0041 • L1X 0042 .. OUTPUTS STRAIGHT RETURN WITH NO OUTPUT IF lX OR liX lSTHN 1 • 0;)43 0044 SUMSQX IS SUM OF XCII-XCII 0045 0046 I XMSQX 0047 IS SUM OF IXIII-IXII). CVERr-lOW MAY OCCUR AND IS NCT TESTED FOR BY XSQSUM • 0048 0049 • 0050 • EXAMPLES 0051 • - 1. INPUTS - XI1 ••• 41=1.,2.,3.,4. IXI1 ••• 41=1.2,3,4 U#O.O 0052 0053 • USAGE CAll SQRSUMIX,4,SUMSQXI 0054 CALL XSQSUMIIX,4,ISMSQX) CALL SQRSUMIX,I,Y) .. 0055 0056 CALL SQRSUMIX.O,Ul OUTPUTS - SUMSQX~30. ISMSQX=30 Y=l. U=O.O INO OUTPUT nASE) 0051 .. 0058 • 0059 • PROGRAM fOLLOWS BELOW 0060 • .. NO TRANSFER VECTOR 0061 HTR 0 XR4 0062 0063 BCI l,SQRSUM 0064 • PRINCIPAL ENTRY. S(RSUMIX,LX.SUMSQX) SQRSUM SXD TEMP,4 0065 TRA SETUP 0066 0067 • SECOND ENTRY. XSQSUM(IX,lIX~ISMSQXl XSQSUM STZ TEMP 0068 0069 SETUP SXD SQRSUM-2,4 Kl CLA 1,4 0070 ADD Kl AIX)+l 0071 STA lGET 0072 STA lMUl 0073 S,TA XGET 0074 . .. .. ... . -. .... -. --. 9/29/64 • • •••••••••••••••••• * ••• * .. SQRSUM • PROGRAM LISTINGS •••••••••••••••••••••••• •••••••••••••••••••••••• (PAGE (PAGE 21 STA •••••••••••••••••••••• *. * SQRSUM • XMUl * CHECK FOR IllEGAL LX CLA. 2,4 TMI LEAVE 0,4 POX LEAVE,4,Q TXL .. BRANCH TO PROPER lOl!lP TEMP ClA XGET HE TEMP SH .. FLOATING LOOP LGET lDQ **,4 •• ,4 lMUl FMP FAD TEMP TEMP STO lGET,4,1 TIX TRA STORE .. FIXED lOOP •• ,4 XGET lDQ •• ,4 XMUl MPY ADD TEMP STO TEMP TlX XGET.4tl AlS 17 • STORE SUM OF SQUARES STORE lXD SQRSU"-2,4 3,4 STO. .. EXIT SQRSUM-2,4 LEAVE lXD 4,4 TRA TEMP PIE END .... LX .*=A(X)+l •• =A(Xl+1 •• =A (X)+l •• =A(X)+l .... =0 IF FXD, lATER SUMMATION 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0066 0067 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 21 •••••••••••••••••••••••• • SQUARE PROGRAM LI STINGS • •••••••••••••••••••••••• • SQUARE (SUBROUTINE) FAP -SQUARE COUNT 150 SQUARE LBL EIllTRY SQUARE I X, LX, XSQRO) ENTRY XSQUAR (IX,LIX,IXSQRDI • • •• • • •. .. .. ..• • • • • • •• • • • • • • • • • • • • • • • • • • • • •• • •• • • • .. •.. .• ..• • .•• .•• •.. • •••••••••••••••••••••••• • SQUARE • •••••••••••••••••••••••• tAST CARD IN DECk IS NO. 0110 0001 0002 0003 0004 0005 0006 0007 ----ABSTRACT---0008 0009 TITLE - SQUARE WITH SECONDARY ENTRY XSQUAR 0010 SQUARE ElE~ENTS OF FXD OR FLTG VECTOR 0011 0012 SQUARE FORMS A VECTOR EQUAL TO THE SQUARE OF A GIVEN 0013 FLTG PT VECTOR. OUTPUT MAY REPLACE INPUT • 0014 0015 XSQUAR FORMS A VECTOR EQUAL TO THE SQUARE OF A GIVEN 0016 FXD PT VECTOR. OUTPUT MAY RFPLACE INPUT. NO TEST 0017 MADE FOR OVERFLOW. 0018 0019 FAP SUBROUTINE IFORTRAN-II COMPATIBLE) 0020 LANGUAGE 0021 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLYI 0022 - 32 REG'I SHRS STORAGE 7090 709 0023 SPEEO SQUARE 37 + (19 OR 22.2).LX MACHINE CYCLE S, 0024 XSQUAR 39 + 120.6 OR 24.8).LX XL • VECTSR LENGTH 0025 0026 - S.M. SIMPSON, AUGUST 1963 AUTHOR 0027 0028 ----USAGE--0029 0030 TRANSFER VECTOR CONTAINS ROUTINES - INONEI 0031 ANO FORTRAN SYSTEM ROUTINES - INONEI 0032 0033 FORTRAN USAGE 0034 CALL SQUARE( X, LX, XSQRDI 0035 CALL XSQUARtIX,tIX,IXSQROI 0036 0037 INPUTS 0038 XII) I=I ••• LX IS A FLTG VECTOR 0039 0040 LX SHOULD EXCEED 0 0041 0042 IXfI) 1=1 ••• LIX IS A FIXED VECTOR 0043 0044 '0045 LIX SHOULD EXCEED 0 0046 STRAIG~T RETURN WITH NO OUTPUT IF LX OR LIX LSTHN 1. 0047 OUTPUTS 0048 XSQRD(II l=l ••• LX HAS VALUES XSQRD(I)=X(I).X(I) 0049 0050 EQUIVALENCE IX,XSQRDI IS PERMITTED. 0051 0052 IXSQRD(II I=l.~.LIX HAS VALUES IXSQRD(I)=IXII).IX(IJ 0053 EQUIVALENCE (IX,IXSQRDI IS PERMITTED. OVERFLOW OCCURS 0054 IF ANY IX HAS MAGNITUDE GRTHN SQRTI2 •• 17-1J. 0055 EXAMPLES 0056 0057 0058 1. INPUTS - XI1 ••• il=1.,2., ••• ,5. IXll ••• 51=-1.-2 ••••• -5 0059 YY~O. USAGE CALL SQUAREIX,5,YI 0060 0061 .CALL XSQUARIIX,5,IYI 0062 CALL SQUAREIX,l,ZI CALL SQUAREIX,O,YYI 0063 CALL XSQUARIIX,5,IXI 0064 0065 OUTPUTS - Yll ••• 51=1.4.,9.,16.,25. IY(1 ••• 5)=l,4.9.16,21 0066 Z=l. YY=O. INO OUTPUT CASEI IXll ••• 51=1,4.9w16.25 0067 0068 1>069 PROGRAM FOLLOWS BELOW 6070 NO TRANSFER VECTOR 0071 0072 HTR 0 XR4 BCI 1,SQUARE 0073 PRINCIPAL ENTRY. SQUAREIX.LX,XSQRDI 0074 9/29/64- •••••••••••••••••••••••• • SQUARE PROGRAM LISTINGS • •••••••••••••••••••••••• IPAGE 21 FMP SQUARE CLA LDQ NOP SQR SETUP STO STQ VARY SXD SQUARE-2,4 1,4 Kl CLA A(X)+l ADD Kl STA GET SQR STA 3,4 CLA AIXSQROHI ADD Kl STORE STA • CHECK LX 2,4 LX CLA* TMI LEAVE 0,4 POX LEAVE,4,0 TXL LOOP • SQUARING •• ,4 •• =A(X)+l LDQ GET = FMP •• ,4 OR MPY **,4 SQR NOP VARY NOP = NOP OR ALS 17 .*=AIXSQROl+l STORE STO **,4 GET,4,1 TIX * EXIT LEAVE LXO SQUARE-2,4 TRA 4,4 * SECOND ENTRY. XSQUARCIX,LIX~IXSQRO) XSQUAR CLA MPY LOQ ALS TRA SETUP • CONSTANTS FMP FMP •• ,4 NOP NOP MPY MPY •• ,4 ALS ALS 11 EIIIO •••••••••••••••••••••••• • SQUARE • •••••••••••••••••••••••• IPAGE 2) •• =AIXl+l 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 •···~··'.·····*···· SRCHI •• ·.f*• PROGRAM LISTINGS •••••••••••••••••••••••• •••••••••••••••••••••••• ...,..••...•.•.......... • SRCHI • • SRCHI (SUBROUTINE). 9/8/64 • LABEL CSRCHI SU8ROUTINE SRCHI (JOB,LV,V,VN,INOEX) 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 C C C C C LAST CARD IN DECK IS NO. 0092 COOl 0002 0003 0004 0005 ----ABSTRACT---0006 0007 TITLE - SRCHI 0008 SEARCH VECTOR FOR NUMBER, STARTING FROM FIRST OR LAST TERM 0009 0010 SRCHI SEARCHES A VECTOR OF FIXEO OR flOATING NUMBERS 0011 FOR A PARTICULAR NUMBER. THE INDEX OF THE FIR9T N~MBER 0012 FOUND IS RETURNEO. IF NO SUCH NUMBER IS FOUND THE INDEX 0013 IS SET = O. THE DIRECTION OF SEARCHING (FROM BEGINNING 0014 TO ENO~ OR FROM END TO BEGINNING) IS CONTROLLEB BY A 0015 PARAMETER. PLUS ZERO IS CONSIOERED NOT EQUAL TO MINUS 0016 ZERO DURING THE SEARCH. 0017 0018 LANGUAGE - FORTRAN II SUBROUTINE 0019 EQUIPMENT - 709 OR 7090 (MAtN FRAME ONLY) 0020 STORAGE - 93 REG I STERS 0021 SPEED - TAKES ABOUT 100 + 38.N MACHINE CYCLES ON THE 7090, 0022 WHERE N IS THE NO. OF VECTOR ELEMENTS EXAMINED 0023 (EXAMINATION STOPS IF VALUE FOUND). 0024 AUTHOR - R.A. WIGGINS, AUGUST, 1963 0025 0026 ----USAGE--0027 0028 TRANSFER VECTOR CONTAINS ROUTINES - XACTEQ 0029 AND FORTRAN SYSTEM ROUTINES - (NOT ANY) 0030 0031 FORTRAN USAGE 0032 CALL SRCHI tJOBfLV,V,VN,INOEX) 0033 0034 INPUTS 0035 0036 JOB =1 FOR FORWARO SEARCHING (BEGINNING WITH LOWEST INDEX) C037 =2 FOR REVERSE SEARCHING (BEGINNING WITH HIGHEST INDEX) 0038 0039 LV IS LENGTH OF INPUT VECTOR V. 0040 0041 IF LSTHN 1 SRCHI ONE RETURNS WITH INOEX=O 0042 VII) I=l ••• lV IS THE VECTOR TO BE SEARCHED. 0043 NEED NOT BE FLOATING POINT MODE. 0044 0045 VN IS THE VALUE TO BE SEARCHED FOR. 0046 SHOULD BE SAME MODE AS V. 0047 0048 OUTPUTS 0049 0050 0051 INDEX THE INDEX OF THE FIRST VALUE FOUND FOR WHICH VtINOEXI = VN. WILL = 0 IF NONE FOUND. 0052 0053 EXAMPLES 0054 0055 1. INPUTS - JOB a 1 IVN = -1 0056 VN = 2. LV = 20 V(I ••• 20) : -2 •• -1.,O.tl~,2.t-3., ••• tO.,1 •• 2.t-3~,-2.,-I. 0057 IV! L ••• 20)" -2, -1,0,1,2,-3,-2,-1.0, ••• ,0 .. 1,2,-.3-,-2,-1 0058 USAGE CALL SRCH1 tJOB,LV,V,VN,INDEX11 0059 CALL SRCHI (JOB,LV,IV,IVN,INOEX21 0060 0061 OUTPUTS - INDEX1 "5 INDEX2 = 2 0062 0063 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT JOB = 2 0064 USAGE - SAME AS EXAMPLE 1. 0065 OUTPUTS - INDEX1 "17 INOEX2" 20 0366 3. INPUTS - SAME AS EXAMPLE 1. EXCEPT JOB -0.: IWN " -0 0067 2 VN V(13) 2 -0. IV(91 = -0 0068 USAGE - SAME AS EXAMPLE 1. 0069 0070 OUTPUTS - INDEX1 = 13 INDEX2" 9 C C PROGRAM FOLLOWS BELOW C DIMENSION V(2) 0071 0072 0073 0014 •••••••••••••••••••••••• • SRCHI PROGRAM LISTINGS * •••••••••••••••••••••••• (PAGE 2) 10 20 30 40 50 70 60 INDEX=O IF (LVI 10.10,20 RETURN CONTI NUE GO TO (30,401,JOB J:l IJ=1 GO TO 50 J=lV IJ=-l CONTINUE DO 70 1=I,lV IF (XACTEQFIV(JJ,VNJI 70,60,70 J=J+IJ GO TO 10 INDEX=J GO TO 10 END ••••••••••••••• **.*** ••• SRCHI • ..e ...•......•.......... (PAGE 21 • 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 . .•••••••••••••••••••••••• STEPC •••••••••••••••••••••••• REFER TO DELTA . .•••••••••••••••••••••••• STEPl •••••••••••••••••••••••• REFER TO DELTA .•••••••••••••••••••••••• •••••••••••••••••••••••• STEPR It REFER TO DELTA •••••••••••••••••••••••• ISTH) •••••••••••••••••••••••• . It REFE~ TO CNliNE •••••••••••••••••••••••• .. (STHDI ••••••••••••••••••••• ** •• REFE~ TO CNL INE ........................... . ISTHMI • •••••••••••••••••••••••• TC CNLINE REFE~ .•••••••••••••••••••••••• • •••••••••••••••••••••••• STDRE REFER TO LOCATE PROGRAM LISTINGS . .•••••••••••••••••••••••• STEPC _••••• * ••••••••••••••••• REFER TO DELTA . .•••••••••••••••••••••••• STEPL •••••••••••••••••••••••• REFER TO DELTA ..•••••••••••••••••••••••• STEPR It •••••••••••••••••••••••• REFER TO DelTA .. .................... _... (STH) • ••••••••••••••••••••••• REFER TO ONLINE •••••••••••••••••••• * •• ..• ....................... . I STHD) . REFER TO ONLINE .• ••••••••••••••••••••••• ISTHMI • • ••••••••••••••••••••••• REFER TO ONLINE •••••••••••••••••••••••• S,TORE • •••••••••••••••••••••••• II REFER TO LOCATE •••••••••••••••••••••••• STZ • ••••••• *~.*.** ••••• ** ••• • - S TZ (SUBROUTJ NE I 'FAP PROGRAM 1I S TJ NGS •• ••••••••••••••••••••••• STZ • •••••••••••••••••••••••• lAST CARD IN DECK IS NO. 0059 0001 -STZ 0002 COUNT 50 0003 lBl STl 0004 ENTRY STZ (LX,XI 0005 0006 • ----ABSTRACT---0007 • 0008 • 0009 • TITLE - STZ • FAST SET VECTOR TO ZERO 0010 0011 • STZ SETS A VECTOR TO ZERO. 0012 • 0013 • - LANGUAGE - FAP SUBROUTINE (FORTRAN II COMPATI8LEI 0014 • EQUIPMENT - IBM 709 OR 7090 IMAIN FRAME ONlYI 0015 - 14 REGISTERS 0016 • STORAGE • SPEED - A80UT 4-N + 18 MACHINE CYCLfS WHERE N IS THE tENGTH 0017 0018 • OF THE VECTOR. 0019 • AUTHOR - J.F. ClAERBOUT 0020 • --USAGE---0021 0022 • • TRANSFER VECTOR CONTAINS ROUTINES - NONE 0023 • AND FORTRAN SYSTEM ROUTINES - NONE 0024 0025 0026 • FORTRAN USAGE 0027 CALL STZllX.Xl 0028 0029 - INPUTS 0030 • XU) l=l ••• LX IS THE VECTOR TO BE SET TO ZERO. 0031 NEED NOT HAVE A FLOATING POINT NAME. 0032 • 0033 • lX MUST Bf GRTHN=l. 0034 • 0035 IS FORTRAN II INTEGER. • 0036 0037 • OUTPUTS 0038 • XIII I=l ••• lX IS SET TO ZERO. 0039 • 0040 * 0041 • EXAMPLES 0042 • • 1. INPUTS - LX = 5 Xll ••• 5) = 1.,1.,1.,1.,1. 0043 • OUTPUTS - XfI ••• 5l • 0.,0.,0.,0.,0. 0044 0045 HTR 0 0046 0047 BCI 1,STZ .-2,4 0048 STZ SXD 0049 2,1t ClA ADD =1 0050 STA 0051 Z 1,4 0052 CLA* 3,4 0053 TZE ,4 0054 POX •• ~4 0055 Z STZ 0056 TlX *-1,4,1 LXO STZ-2,4 0057 SV 0058 TRA 3,4 0059 END • - • • • - • 9/29/64 •••••••••••••••••••••••• PROGRAM LI STING S • STIS • •••••••••••••••••••• * ••• • • •••••••••••••••••••••••• • STZS ISU8ROUTINE) IS NO. 0096 0001 0002 ·STZS COUNT 100 0003 LBL STZS 0004 STZS (lX1,X1,LX2,X2, ••• ,LXN,XN) ENTRY 0005 0006 • ----A8STRACT---0007 • 0008 • 0009 • TITLE - STZS SET A LIST OF VECTORS TO ZERO 0010 • 0011 • 001<1 STIS IS A VARIABLE LENGTH CALLING SEQUENCE SUBROUTINE • WHOSE ARGUMENTS ARE CONSIDERED IN PAIRS. THE SECOND 0013 • ARGUMENT OF EACH PAIR IS CONSIDERED TO BE A VEt TOR 0014 WHOSE lENGTH IS GIVEN BY THE FIRST ARGUMENT. mN OU~PUT 0015 ALL SUCH VECTORS WIll BE CLEARED EXCEPT THAT N~ ACTION 0016 IS TAKEN ON VECTORS OF NEGATIVE OR ZERO lENGTH. 0017 • 0018 •.. lANGUAGE - FAP SU8ROUTINE (FORTRAN-II COMPATIBLE) 0019 .. EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0020 .. STORAGE - 24 REGISTERS 0021 .. SPEED - 9 ~ 25.N + 4.L MACHINE CYCLES. 0022 WHERE N = THE NUMBER OF VECTORS TO BE ClEAR&D 0023 L = THE SUM OF THEIR LENGTHS 0024 •.. AUTHOR - S.M. SIMPSON, SEPTEMBER 1963 0025 0026 0027 ----USAGE--0028 •.. TRANSFER VECTOR CONTAINS ROUTINES - INONE) 0029 0030 .. AND FORTRAN SYSTEM ROUTINES - INONEI 0031 .. FORTRAN USAGE 0032 0033 • CAll STZS fLXI,Xl, LX2,X2 •••• , LXN,XN) 0034 • WHERE THE NO. OF PAIRS, N, SHOULD EXCEED 0 0035 • 0036 • INPUTS 0037 • 0038 IS LENGTH OF FIRST VECTOR. SHOULD EXCEED 0 • LXI LX2 0039 IS LENGTH OF SECOND VECTOR. SHOULD EXCEED 0 0040 ETC SHOULD EXCEED 0 0041 LXN IS LEN6TH OF LAST VECTOR. 0042 •.. OUTPUTS 0043 0044 Xl( I) 0, PROVIDED LXI GRTHN= 0045 I=I ••• LXI IS XIII) X2II) I=t ••• LX2 IS X2(1) 0, PROVIDED LX2 GRTHN= 0046 0047 ETC XNII) 0, PROVIOED LXN GRTHN= 0048 I=I ••• tXN IS XNtIJ 0049 0050 IF ANY LX IS 0 OR NEGATIVE, THE CORRESPONDING VECTOR IS NOT DISTURBED. THE MODES OF THE VECTORS ARE 0051 • ARB ITRARY • 0052 0053 • 0054 • EXAMPLES 0055 C056 XIl ••• lO) = 999. Y = Z = W = U = 999. • I. INPUTS IXil ••• 3) 999 0057 IYII ••• 4) = 999 I,Y, 4, IV) 0058 STZSIlO,X, 3,IX, O,Z, USAGE CAll -2,W~ 0059 tAll STZSll,U) 0060 OUTPUTS - XII ••• IO) O. Y = O. IXII ••• 3) = 0 IYtl ••• 4) 0061 0 Z = W 999 • U = O. 0062 0063 .. PROGRAM FOLLOWS BELOW 0064 • 0065 .. NO TRANSFER VECTOR 0066 0067 HTR o XRI HTR 0068 o XR4 0069 I,STZS BCI 0070 .. ONL Y ENTRY. STISILX1,X1,LX2,X2, ••• ,LXN,XN) C071 STZS SXO STlS-2.4 0072 STZS-3.1 SXD 0073 • EXAMINE FOR NEXT L 0074 1,4 CAL CAL STZS FAP 9129/64 ..... .. .. . ... .. .... .... ... . . ... .. .. . - • •••••••••••••••••••••••• .. ... .. LAST CARD IN OEC~ •••••••••••••••••••••••• • STZS PROGRAM LISTINGS • •••••••••••••••••••••••• (PAGE 2) ANA LAS TRA TRA (PAGE AMASK TSXl LEAVE CLEAR • EXIT LEAVE LXO STZS-3,1 1,4 TRA • CLEARING LOOP 2,4 CLEAR CLA ADO Kl STA STZ CLA. 1,4 Kl TMI BACK 0,1 POX TXL BACK,I;O ·.,1 STZ STZ STI,I,1 TIX CAL,4,-2 BACK TXI • CONSTANTS AMASK OCT 777777100000 0,0 TSXZ TSX END •••••••••••••••••••••••• STZS • •••••••••••••••••••••••• • AIX'+l L •• =AIXI+1 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 \l087 0088 0089 0090 0091 0092 0093 0094 0095 0096 21 •••••••••••••••••••••••• • SUBK * •••••••••••••••••••••••• PROGRAM LlSTl~GS _...................... . SUBK •....................... • REFER TO REFER TO AOOK AOOK •••••••••••••••••••••••• SUBKS •••••••••••••••••••••••• ** REFER TO AOOK - •••••••••••••••••••••••• SUBKS * * •••••••••••••••••••••••• REFER TO AOOK •••••••••••••••••••••••• .. SUM ••••••••••••••••••••••••• • • SUM FAP I SUBROUTINE I PROGRAM LISTINGS ................................. . .. SUM LAST CARD IN DECK IS NO. 0091 0001 0002 COUNT 150 0003 SUM 0004 LBL ENTRY SUM I X, LX, SUMXI 0005 XSUM IIX,LIX,ISUMIXI 0006 EIllTRY 0007 ----ABSTRACT-0008 0009 .. TITLE - SUM WITH SECONDARY ENTRY XSUM 0010 .. SUM ELEMENTS OF FLTG OR FIXED VECTOR 0011 0012 SUM ADDS UP ELEMENTS OF A FLTG PT VECTOR. 0013 XSUM ADDS UP ELEMENTS OF A FXO PT VECTOR. 0014 • 0015 - FAP SUBROUTINE, (FORTRAN-II COMPATIBLE) 0016 • LANGUAGE .. EQUIPMENT - 109 OR 1090 IMAIN FRAME ONLY) 0017 0018 - 23 REGISTERS • STORAGE .. SPEED - SUM 32 + 8.4.LX MACH[NE CYCLES, 0019 LX = VECTOR LENGTH XSUM 30 + 4"LX 0020 - S.M. SIMPSON, AUGUST 1963 0021 • AUTHOR 0022 • ----USAGE--0023 • 0024 0025 .. TRANSFER VECTOR CONTAINS ROUT[NES - INONE) 0026 .. AND FORTRAN SYSTEM ROUT[NES - INONE) 0021 0028 • FORTRAN USAGE .. CALL SUM I X, LX, SUMXI 0029 0030 • CALL XSUM([X,LIX,ISUMIXI 0031 .. INPUTS 0032 0033 XII) 0034 1=1 ••• LX [S A FLTG VECTOR "• 0035 0036 SHOULD EXCEED ZERO LX 0037 IXII ) 0038 l=l ••• LIX IS A FXD VECTOR 0039 0040 SHOULD EXCEED ZERO LlX 0041 U042 .. OUTPUTS STRAIGHT RETURN WITH NO OUTPUT IF LX OR LIX LSTHN 1 • 0043 0044 [S SUM OF XII ••• LX) SUMX 0045 [S SUM OF IXll ••• LIX). OVERFLOW MAY OCCUR AND IS 0046 ISUMIX 0047 NOT CHECKED FOR BY XSUM • 0048 0049 .. EXAMPLES 0050 .. 1. INPUTS - Xll ••• 41=1.,2.,3.,4. IXll ••• 4)=1,2,3,4 0051 .. u=o.o 0052 (/053 USAGE CALL SUM IX,4,SUMXl 0054 CAll XSUMIIX,4,ISUMIX) (ALL SUM IX,l,YI 0055 (ALL SUM IX,O,U) 0056 0057 OUTPUTS - SUM X = 10. ISUMIX = 10 Y 1. U ~ o. INO OUtPUT CASEI 0058 0059 .. PROGRAM FOLLOWS BELOW 0060 .. NO TRANSFER VECTOR 0061 HTR 0 XR4 0062 BCI l,SUM 0063 .. PRINCIPAL ENTRY. SUMIX,LX,SUMXI 0064 0065 SUM CLA FAD 0066 TRA SETUP 0067 .. SECOND ENTRY. XSUM([X,LIX,[SUMIX) 0068 XSUM CLA ADO 0069 SETUP STO ADD1 0010 SXO SUI'I-2,4 Kl CLA 1,4 0011 0072 ADO Kl AIXI+l 0073 STA ADDl 0074 .. CHECK FOR ILLEGAL LX .SUM . .. .. .. . . . . . ... .... .. .. .. ... . .. .. ... .. 9/29/64 • ............................... . •••••••••••••••••••••••• SUM • •••••••••••••••••••••••• • (PAGE •••••••••••••••••••••••• SUM • •••••••••••••••••••••••• (PAGE 21 PROGRAM Ll STl NGS • 2) CLA. 2,4 TMI LEAVE 0,4 POX TXL ,LEAVE,4,0 • FORM AND STORE THE SUM 0,0 PXO AOOI NOP TlX ADIH,4.1 SUM-2,4 LXO 3,4 STD· • EXIT SUM-2,4 LEAVE LXO 4,4 TRA • CONSTANTS •• ,4 FAD FAD •• ,4 ADD ADD END LX FAD 0075 0076 OR ADO •• ,4 ."-A(XHl 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 •••••••••••••••••••••••• SUMDEV ••••••••••••••• * •• * ••••••* REFER TO SUMDFR PROGRAM LISTINGS ••••••••••••••• ** ••••••• • SUMDEV * • ••••••••••••••• * ••••••• REFER TO SUMDFR •••••••••••••••••• ** •• *. SUMDFR •....•............ -...... 9/29/64 • SUMDFR ( SUBROUTI NE I • FAP ·SUMDFR COUNT 150 SUMDFR lBl ENTRY SUMDFR ( X, Y,LXY,SUMXMYI ENTRY XSMDFR IIX,IY,LXY,ISMXMYI ENTRY SUMDEV I X, XBASE, lX,SUMXMBI ENTRY XSMDEV (IX,IXBASE,lIX,ISMXMBI .•. • .... .. . • ..• ... .. .. • • .• • .. •." • ...• .. .. • .. .. ..• •. •. " ... • • •. .• • ..• .. .... .... ..... . •..•........... "" ....... PROGRAM LISTINGS • " SUMDFR • ••••••••••••• 4 ••••• ** ••• LAST CARD DEOK IS NO. 0155 0001 0002 0003 0004 0005 0006 0007 0008 0009 ----ABSTRACT--0010 0011 TITLE - SUMDFR WITH SECONDARY ENTRIES XSMDFR, SUMDEV AND XSMDEV 0012 SUM DIFFERENCE OF VECTOR FROM ANOTHER OR FROM A CONSTANT 0013 0014 SUMOFR SUMS THE DIFFERENCES OF TWO FLOATING VECTORS. 0015 XSMDFR SUMS THE DIFFERENCES OF TWO FIXED VECTORSJ 0016 SUMDEV SUMS THE DEVIATIONS OF A FLOATING VECTOR FROM 0011 A CONSTANT. 001B XSMDEV SUMS THE DEVIATIONS OF A FIXED VECTOR FROM 0019 A CONSTANT. 0020 0021 FOR THE FIXED ENTRIES THE BINARY POINT IS ARBITRARY. 0022 0023 lANGUAGE - FAP SUBROUTINES (FORTRAN-II COMPATIBLE) 0024 EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0025 44 REGISTERS 0026 STORAGE SUMDFR 47 + 14.B.LX MACHINE CYCLES, 0027 SPEED XSMDFR 49 + 6.0"LX lX = VECTOR LENGTH 0028 SUMOEV 45 + 14.B.LX 0029 XSMDEV 43 + 6.0.LX 0030 AUTHOR - S.M. SIMPSON, AUGUST 1963 0031 0032 ----USAGE---0033 0034 TRANSFER VECTOR CONTAINS ROUTINES - INONEI 0035 AND FORTRAN SYSTEM ROUTINES - (NONEI 0036 0031 FORTRAN USAGE 0038 CALL SUMDFRr X, Y,lXY,SUMXMYI 0039 CALL XSMDFRtIX,IY,lXY,ISMXMYI 0040 CALL SUMDEV( X, XBASE. LX,SUMXMBI 0041 CALL XSMDEVUIX,IXBASE,LIX,ISMXMBI 0042 0043 INPUTS 0044 0045 XII) I=l ••• LXY IS A FLOATING INPUT TO SUMDFR 0046 YIII l=t ••• LXY IS A FLOATING INPUT TO SUMOFR 0047 LXY 0048 SHOULD EXCEED 0 (FORTRAN-II INTEGER) I XIII l=l ••• LXY IS A FIXED INPUT TO XSMOFR 0049 l=l ••• LXY IS A FIXED INPUT TO XSMDfR WITH THE SAME 0050 IYI Il BINARY POINT AS I X( I) 0051 0052 XIII I=1 ••• LX IS A FLOATING INPUT TO SUMDEV 0053 XBASE IS A FLOATING CONSTANT 0054 LX SHOULD EXCEED 0 (FORTRAN-II INTEGER) 0055 I XU I 0056 I=l ••• LIX IS A FIXED INPUT TO XSMDEV IXBASE IS A FIXED CONSTANT WITH THE SAME BINARY POINT AS IX!f) 0051 LIX SHOULD EXCEED ZERO 0058 0059 0060 STRAIGHT RETURN WITH NO OUTPUTS IF LXY OR LX LSTHN 1 OUTPUTS 0061 SUMXMY 0062 IS SUIHFROM 1=1 TO LXYI OF IXIIl - YII)) 0063 I SMXMY IS SUM(FROM 1=1 TO LXYI OF (lXII) - IYIIl) 006', 0065 SUMXMB IS SUMIFROM 1=1 TO LXI OF (XII) - XBASEI 0066 0067 ISMXMB IS SUMIFROM 1=1 TO LIX) OF (IX(I) - IXBASEJ 0068 0069 BINARY POINT OF FIXED OUTPUTS IS SAME AS THAT OF INPUTS. 0070 DANGER OF FIXED POINT OVERFLOW IS NOT TESTED FOR. 0071 0072 EQUIVALENCEISUMXMY,ANY INPUTI,IISMXMY,ANY INPUT), 0073 I~ •••••••••••••••••••••••• • SUMDFR PROGRAII LISTINGS • •••••••••••••••••••••••• (PAGE Z) • ••• • • • • •• • * • • • • • • .••..••.••...........•. • •••••••••••••••••••••••• IPAGE Z) ~ • SUMD~R (SU"XMB,ANY INPUT),IISMXMB, ANY INPUT) IS PERMITTED. EXAMPLES - XII ••• 31 = 1., Z., 3. YI1 ••• 3) '" Z.,~.,6~ XIASE. 3. IX(,l .. ~31 = I, Z, 3 IYII ••• 3) ., Z, 4, 6 JXBASE" 4 USAGE tALL SUMDFRI X, Y, 3, DIF1) CALL XSMOFRIIX,IY, 3,101F11 CALL SUMOEVI X, XBASE, 3, OEVl) CALL XSMOEVIIX,IXBASE, 3,IDEVll OUTPUTS - OIFl .. -6.0 10lFI = -6 OEV1" -3.0 (OEV}.-3 l. INPUTS Z. INPUTS - USAGE OUTPUTS - IXtI ••• ZI = OCT 000000000001, 000000000002 IYf +1.1,1 SXA START t 1 SXD DSTART,l • SCAN DOWN THE TSX X.4.S UNTIL HIT TSX STIMSUR,4 lUKTSB TSX TSX4SC,l TXI *+1,4,-1 CLA 0,4 STA *+1 CAL •• PICK UP THE TTR LAS TTRTlM 01B8 01B9 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 ...................... ,. ..•. • TIMSU8 PROGRAM LISTINGS • •••••••••••••••••••••••• It, (PAGE •••••••••••••••••••••••• TI"SU8 • •••••••••••••••••••••••• • (PAGE TRA .+2 TRA SETUP TRA LUUSB • MERGE POINT. 0.4 IS NOW = TSX $TIMSUB.4 • SET MNCWI.MNCWO.MNACC, AND FMNACC SET~P CLA* 1,4 MINACC FXD TZ6 3,4 TMI 3,4 STO MNACC ARS 3 ADD MNACC STO MNCWI sro MNACC LET lIFINT ARS 3 STO MNCWO LDO KDl TLO *+2 STO MNCWO CLA. I,ll ARS 18 ORA DCTK FAD OCTK STO FMNACC • SCAN DOWN TO TSX $SUB,4 I IN 1,41 SUBSCN TSX TSX4SC.1 TXI .+1.4,-1 CLA 0,4 TSX $SU8,4 • WE HAVE TO IGNORE INTERNAL FORTRAN SUBROUTINES, FOR WHICH TKE • TSX X,4 HAS X GRTHN THE LOCATION OF THAT INSTRUCTION, I~E. -X tSTHN • P~ESENT VALUE OF XR4. PAC 0,1 -x TO XRl SXD .+1,4 TXL SUBSCN.1,** = XR4 • OK, LEGITIMATE SUBROUTINE FOUND STO SAVTSX PXA 0,4 PAC 0,1 AITSX $SUB,41 SXA TSXSUB_l CLA 0,4 TSX AITTR SUBI,4 STA TTSUB CLA* TrsUB STO SA\HTR CLA TSXSXA STO 0,4 * SCAN DOWN TILL 1,4 • NON TSX X,D ARGSCN TSX TSXZCK~l TXI PXAARG,4,-1 NO MORE TXI ARGSCN~4,-1 KEEP GOING PXAARG PXA 0,4 0,4 IS NOW EQUIV A(TSX ARGN,O)+l PAC 0,1 SXA FINISH,l SXD LoeB,l SXA TTRL08.1 *. • • TIMING LOOP. STEPS ARE • * STEP 1. SET BYPASS IN TTSUB AND GO FINO TMWOUT TlMLUP CLA TTRLOB TTSUB STO· eLA MNewo TSX OPTMAB.1 CLA SECSL STO TMWOUT 2. REPLACE THE TTR SUB ANO GO FIND TMWITH • STEP TMLUPl CLA SAVTTR STO. TTSUB CLA MNeWI TSX OPTMAB.l CLA SECSL STO TMWITH • STEP 3. FINO TMSUB FSB TMWOUT FORM TMSUB, STO TMSUB 4. IF TMSUB*60. GRTHN= MNACC, LEAVE • STEP 02125 04126 0227 02128 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 0264 0265 0266 0267 0268 0269 0270 0271 0272 0273 0274 0275 0276 0277 0278 0279 0280 0281 0282 0283 0284 0285 0286 0287 0288 0289 0290 0291 0292 0293 0294 0295 0296 0297 0298 0299 41 •••••••••••••••••••••••• PROGRAM LISTINGS TlMSUB (PAGE •..•......... _....•..••. "TlHSUB "........., ............. ." • •••••••••••••••••••••••• 5) (PAGE XCA FMP F60 CAS FMNACC NOP TRA LEAVE " STEP 5. IF HNCWO-TMSUB/TMWOUT GRTHN= MNACC, LEAliE HNCWO FORM FLOATING MNCWO CLA ARS 18 ORA OCTK FAO OCTK STO FMNCWO DONE. CLA TMSUB FOP TMWOUT FMP FHNCWO CAS FHNACC NOP TRA LEAVE * STEP 6. PREDICT NEW MNCWO AND MNCWI CAS Fl TRA FMCWO - TMSUB HAS LSTHN= 1 SIGNIFICANT FIGURES * SET NEW MNCWO=MNCWI = MNACC*MNCWI NOP LOQ MNCWI MPY MNACC ALS 17 STO MNCWI STO MNCWO TRA TIMLUP MNCWI HNACC.TMWITH/TMSUB - SET MAX (MNCWO, MNACC.TMWOUT/TMSUBI * SET MNCWO FMCWO CLA FMNACC FOP TMSUB FMP TMWITH UFA OCTK ALS 15 STO MNCWI ALS 3 ADD MNCWI ADD Kl STO MNCWI CLA FMNACC FOP TMSUB FMP TMWOUT UFA OCTK ALS 15 LDQ MNCWO ADD Kl STO MNCWO ALS 3 ADD MNCWD STO MNCWO TLQ TIJIIILUP STQ MNCWD TRA TMLUPI " EXIT SEQUENCE LEAliE LXD TIMSUB-2,4 CLA TMSUB RELATIVE TO TIMSUB STO2,4 CLA SAYTSX STOTSXSUB CLA Kl STO ZIFINT AXTLII AXT .*,1 = XRl ENTERING SUB AXT .*,2 -* = XR2 ENTER ING SUB •• = XR4 ENTERING SUB AXT .".4 CLA SAIIAC AC AFTER SUBROUTINE LOQ SAIIMQ MQ AFTER SUBROUTINE TOV *+1 TRAFINISH - INTERNAL SUBROUTINE TO OPERATE TIMA2B " lINKAGE XRl, RETURNS TO 1,1 OPTMAB SXA OTABlV,1 SXA OTABlV+l,2 STO MNAC *. 0300 0301 0302 0303 0304 0305 0306 0307 0308 0309 0310 0311 0312 0313 0314 0315 0316 0317 0318 0319 0320 0321 0322 0323 0324 0325 0326 0.327 0328 0329 0330 0331 0332 0333 0334 0335 0336 0337 0338 0339 0340 0341 0342 0343 0344 0345 0346 0347 0348 0349 0350 0351 0352 0353 0354 0355 0356 0357 0358 0359 0360 0361 0362 0363 0364 0365 0366 0367 0368 0369 0370 0371 0372 0373 0374 51 •••• '•••••••• ** •• *.** •• _. TIMSUB • • ......... ** •••••• ** ....... .. (PAGE PROGRAM LISTINGS • ••••••••••• * •• *" •• * •••• "TIMSUB • ..... It •• " ................ " .. . bl (PAGE TSX $TIMA28,4 TSX LOCA,O TSX LOCS,O TSX MNAC,O TSX SECSL.O STO SAVAC STQ SAVMQ OTABLV AXT •• ,1 XRl AXT •• ,2 ** = XR2 TRA 1.1 " THE FOLLOWING IS LOGA FOR TIMA2B BEGIN AXT •• ,1 ** = APPROPRIATE XRl AXT •• ,2 *. = APPROPRIATE XR2 TRA. START " (THE FOLLOWING IS A PATCH IN OPERATING LOOP LOCA TO LOCB) LUPSXA SXA AXTLV,l SXA AXTLV+l,2 SXA AXTLV+2,4 TRA. TrsUB • INTERNAL SUBROUTINE TO BUMP XR4 UNTIL 1,4 TSX X,4 " LINKAGE XR1, RETURN TO 1,1 TSX4SC SXA T4SCLV,1 CLATS4 CLA TSXZ4 TSX INSTCK,I TXI CLATS4;4,-1 NO T4SCLV AXT •• ,1 TRA 1,1 " INTERNAL SUBROUTINE TO CHECK IF 1,4 = TSX X,O .. RETURNS TO 1,1 IF NOT, TO 2,1 IF SO TSXZCK CLA TSXZ • INTERNAL SUBROUTINE TO CHECK IF 1,4 , LESS ADDRESS, EQUALS AC " RETURNS TO 1,1 IF NOT, TO 2,1 IF SO INSTCK STO TEMP CAL 1,4 ANA AMASK LAS TEMP TRA *+2 TRA 2,1 YES TRA 1,1 NO " CONSTANTS, TEMPORARIES AMASK OCT 777777700000 TSXZ TSX 0,0 TSXZ4 TSX 0,4 TSXSXA TSX LUPSXA.4 Kl PZE 1 KDl PZE ,,1 Fl DEC 1. F60 DEC bO. TTRTIM TTR TIMSUB OCTK OCT 233000000000 TTRLOB TTR .* LOCB *" TSXINT+l OR TSXTIM+3 START PZE ** ** DSTART PZE 0,0,"" DITTO ** A(TSX ARGN,Ol+l FINISH PZE ** ** TSXSUB PZE •• AITSX $SUBZ4) ** A(TTR SUB) TTSUB PZE ** ** SAVTSX TSX •• ,4 $SU8 ** SAVTTR fTR •• SUB ** lMWOUl PZE *".**,"* TMWITH PZE •• i"*,"" TMSUB PZE **'**,"" FMNACC PZE •• ,.*,.* FLTG. MNACC MNACC PZE 0,0,*. FOR TIMA2B MNAC PIE FMNCWO PZE MNCWO PZE MNCWI PZE SECSL PZf FROM TIMA2B **,_",** FOR TIMA28 (SAME AS FINISH) LOCB PZE 0,0,·· O,O,BEGIN LOCA PZE FOR TIMA28 * .. , ... , •• SAVAC PZE AC AFTER SUBROUTINE **, .... , .... SAVMQ PZE MQ AFTER SUBROUTINE TEMP PZE "", , ZIFINT PZE 1 ZEROED BY INTSSB, RESET TO 1 ON EXIT END .... = .. ... 0375 0376 0377 0378 0379 0380 03Bl 0382 0383 0384 0385 0386 0387 0388 0389 0390 0391 0392 0393 0394 0395 0396 0397 0398 0399 0400 0401 0402 0403 0404 0405 0406 0407 0408 0409 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 0440 0441 0442 0443 0444 0445 0446 0447 0448 0449 b) ******-••• * •• . ..••••••••••• TINGl ••••••••••••••• *** ••••• * .. ••••••••••••••• ** ••••••• .. TINGL . . .. ... . .. .. . •. • •. . . • . • •. .. .. .... •.. • • . . .. .. .. _._ •• ** •••••• ******** ••• LAST CARD IN DECK IS NO. 0146 0001 • TINGL 0002 0003 COUNT 150 0004 LBL TINGL ENTRY 0005 TINGL IYOFX, LY, DELX, TING) ENTRY 0006 TI NGLA I YOFX, LY, DELX, TINGA) 0001 0008 ----ABSTRACT---0009 0010 .. TITLE - TINGL, WITH SECONDARY ENTRY TINGLA 0011 DEFINITE TRAPElOIOAl INTEGRAL OF FUNCTION OR ITS MAGNITUDE 0012 • 0013 TINGL COMPUTES TRAPEZOIDAL INTEGRALS OF FORM 0014 0015 LY-l 0016 DELX .. IYII)/2 + SUM YII) + YILY)/21 0017 1=2 0018 • 0019 WHERE YII ••• LY), lY, AND DELX ARE INPUTS, AND 0020 WHERE THE SUMMATION IS SUPPRESSED FOR LY. 2 • 0021 0022 TINGLA COMPUTES THE SAME EXPRESSION BUT USES AaSOLUTE 0023 VALUES OF Y RATHER THAN Y ITSELF • 0024 0025 .. LANGUAGE - FAP SUBROUTINES ( FORTRAN-II COMPATIBLE) 0026 .. EQUIPMENT - 709,7090,7094 IMAIN FRAME ONLY) 0021 .. STORAGE - 43 REGISTERS 0028 .. SPEED - TAKES ABOUT 70 + 8.4*LY MACHINE CYCLES, ON THE 7090 0029 - S.M. SIMPSON, JUNE 1964 0030 • AUTHOR 0031 • 0032 ----USAGE---0033 0034 .. TRANSFER VECTOR CONTAINS ROUTINES - NOT ANY 0035 0036 • ANO FORTRAN SYSTEM ROUTINES - NOT ANY 0037 0038 • FORTRAN USAGE 0039 .. CALL TINGL IYOFX, LY, DELX, TING) 0040 • CALL TINGLAIYOFX, LY, DElX, TINGAI 0041 0042 • .. INPUTS 0043 0044 YOFXIII I=l ••• LY IS THE FLOATING VECTOR YII) OF THE ABSTRACT. 0045 0046 0047 LY MUST EXCEED 1 . 0048 OElX IS THE INCREMENT. MAY BE POSITIVE OR NEGATIVE. 0049 0050 0051 0052 OUTPUTS STRAIGHT RETURN WITH NO OUTPUT IF LY LSTHN 2 • 0053 IS THE OUTPUT OF TINGL, GIVEN BY THE EXPRESSION IN THE 0054 lING 0055 ABSTRACT • 0056 0051 IS THE OUTPUT OF TINGLA AS OESCRIBED IN ABSTRACT. TINGA 0058 NOTE THAT THE SIGN OF TINGA IS THAT OF DELX. 0059 • 0060 .. EXAMPLES 0061 0062 .. 1. INPUTS - YOFXll ••• 4) = -2.,-1.,1.,3. OELX = 2.0 0063 0064 .. TING(1 ••• 4) = TINGAll ••• 4) = -99.,-99.,-99.,-99. 0065 USAGE DO 10 lY=1,4 .. CALL TINGl IYOFX, LY, DELX, TINGILY» 0066 .. 10 CALL TINGLAIYOFX, LY, DELX, TINGAILYI) 0061 .. OUTPUTS - TING 11 ••• 4) -99.,-3.0,-3.0,1.0 0068 0069 .. TINGAll ••• 4) = -99., 3.0, 5.0, 9.0 0070 0071 0072 .. PROGRAM FOLLOWS BELOW 0073 •. TINGL ISUBROUTINE) FAP PROGRAM LISTINGS 9/8/64 **** ••••••••• *.*.******* TINGL * •••••••• *** •••••••• ** •• * PROGRAM LISTINGS • •. _-*.-..*.*._.*.**.• *.* .. ******.*.************ ••• IPAGE 2) TINGl IPAGE * NO TRANSFER VECTOR . HTR BCI . o TRA XRl TINGLIYOFX, LY, DELX, TING) ZFTNGL SF.TUP * SECONDARY ENTRY. TINGLAIYOFX, ...TlNGLA SXD ZFTNGL,4 LY, DELX, TINGA) .. CHECK YOFX • * • lY SETUP SXD ClATMI POX TXL CLA STA STA 0014 0015 0016 0017 0078 0079 0080 0081 0082 0083 0084 0085 0086 0081 1,TINGL * PRINCIPAL ENTRY. * TINGL STZ - AND SET ADDRESS OF OOBB TI NGL-2, 1 lY 2,4 LEAVE 0.1 LEAVE,l,l 1,4 FAD FAM MUST EXCEED AIYOFX) SET VARIABLE INSTRUCTIONS ACCORDING TO ENTRY ClA LDQ NZT TRA CLA LDQ NOPSET STO STQ STQ • NOP FAD IFTNGL NOPSET SSP FAM NOPl NOP2 NOP3 ANTICIPATE FOR TINGL NO, IT WAS TINGLA * FIRST AND LAST TERMS OVER 2 * TXI *+1,1,-1 1,4 CLANOPI NOP NOP2 NOP XCA FMP KP5 TXI *+1,1,-1 XCA,l,O TXL • - CENTRAL TERMS LOOP. .. NOP3 • NOP TIX XRl tXRl = LY-ll YOFXIl) NOP OR SSP FAD *',1 OR FAM **,1 IXRl = LY-2) (BYPASS FOR LY 2) *fI ,. FAD **,1 OR FAM **,1 •• " AIYOFXl DELX TING * * EXIT * LEAVE LXD TRA DEC NOP SSP FAD FilM PIE END 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 TINGL-2.l 5,4 * .. CONSTANTS, VARIABLES KP5 NOP SSP FAD FAM IFTNGL AIYOFX) LY-2,LY-3, ••• ,1 NOP3,ltl * TI MES DELX AND STORED * XCA XCA 3,4 FMP* 4,4 STD* • • .5 **,1 **,1 0,0,** ** ** ** AIYOFX) AIYOFX) 0 IF TINGL, XR4 IF TINGLA 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 2) ***** •• ***************** TINGlA * **.********************** REFER TO TINGL PROGRAM LISTINGS *.*.* •• -.*.************* TINGlA * **** •• *.*******.****.*.*. REFER TO TINGl •••••••••** ••••••••••••• TRMINO * PROGRAM L I STINGS • ••••••••••••••••••••••••• • TRMINO ISUBROUTINEI • LABEL CTRMINO SUBROUTIN6 TRMINO~ITAPE, NBAKUP) •••••••••••••••••••••••• TRMINO • •••••••••••••••••••••••• • LAST CARO IN OECK IS NO. 0076 0001 0002 0003 0004 C 0005 C 0006 C ---ABSTRACT---0007 C 0008 C TITLE - TRMINO 0009 C TERMINATE AN INOATA-OUDATA TAPE 0010 C 0011 TRMINO USES SUBROUTINE OUOATA TO WRITE A ZERO-RECORD C 0012 NUMBER DUMMY RECORO ON A SPECIFIED UNIT AND THEN BACKS C THE TAPE UP A SPECIFIED NUMBER OF FILES OR REWINOS IT. 0013 C C 0014 - FORTRAN-II SUBROUTINE 0015 C LANGUAGE IMAIN FRAME PLUS ONE TAPE DRIVEr 0016 C EQUIPMENT - 709,7090,7094 0017 C STORAGE - 67 REGISTERS - CONTROLLED BY SUBROUTINES OUDATA AND FSKIP 001B C SPEED - S.M. SIMPSON, JUNE 1964 C AUTHOR 0019 0020 C 0021 C 0022 C ----USAGE--C 0023 0024 C TRANSFER VECTOR CONTAINS ROUTINES - XLIMIT, OUDATA. FSKiP 0025 AND FORTRAN SYSTEM ROUTINES - CRWTJ C 0026 C 0027 C FORTRAN USAGE 0028 CALL TRMINOIITAPE, NBAKUP) C 0029 C 0030 C 0031 C INPUTS 0032 C 0033 !TAPE MUST EXCEED ZERO AND BE LSTHN= 20 C 0034 C 0035 C NBAKUP GRTHN= 0 REQUESTS TRMINO TO LEAVE TAPE POSITIONED NBAKUP FILES CLOSER TO TAPE START THAN ITS INPUT 0036 C POSITION. NBAKUP=O LEAVES TAPE REAOY TO READ 0037 C 0038 THE DUMMY RECORD CREATED. C LSTHN 0 REQUESTS TRMINO TO LEAVE TAPE REWIDUND. 0039 C 0040 C 0041 C 0042 C OUTPUTS NO ACTION IF ITAPE ILLEGAL. OTHERWISE SEE ABSTRACT 0043 AND NBAKUP. C 0044 C 0045 C 0046 C EXAMPLES 0047 C 0048 C 1. INPUTS - SUPPOSE A 5 RECORD SAMPLE INDATA-OUDATA TAPE HAS BEEN 0049 CREATED ON LOGICAL 9 BY THE FOLLOWING SEQUENCE~ C 00 10 1"1,10 0050 C 0051 10 XIII" FLOATFIII C 0052 REWIND 9 C 0053 DO 20 1"1,5 C 0054 C IRECNO " I 0055 20 CALL OUDATAI9. IRECNO, 10, X, 1) C 0056 C CALL TRMINOl9, 2) 0057 USAGE C 0058 C 00 30 1"1,3 0059 C IRECNOI I) " 0 0060 NOPTS .. -1 C 30 CALL INOATAI9. IRECNOII), NOPTS. DUMMY, ERR) 0061 C 0062 C 0063 OUTPUTS - IRECNOtl ••• 31 " 4,5,0 C 0064 C 0065 C 0066 C PROGRAM FOLLOWS BELOW 0067 C IF IXLIMITFIITAPE,1,20» 9999,10,9999 0068 0069 10 IRECNO" 0 0070 CALL OUDATAIITAPE, IRECNO, 1, DUMMY, 11 0071 IF INBAKUP) 30;20,20 0072 20 CALL FSKIPIITAPE, -NBAKUP-l) 0073 GO TO 9999 0074 30 REWIND ITAPE 9/4/64 **.** •• * •• *** ••••• * ••• ** it TRMINO ** •• ** ••• *.*.*.* •• * ••••• (PAGE 21 . 9999 RETURN END PROGRAM L I STINGS .*.*.-... * ****.******* ••• TRMINO .. •••••••••••••••••••••••• (PAGE 0075 0076 21 •••••••••••••• **** •• ** •• . (TSH) "•••••••••• ***.* ••••• ** •• REFER TO REREAD • ** •••••••••••••••••• *** (TSHM) * "**._ ••••••• *.* •• **.***** REFER TO REREAD PROGRAM LI STINGS •••••••••••••••• * •••••• * nSHl * .. •REFER ••••••••••••••••••••••• TO REREAD •••••••••••••••••••••••• .. tTSHMI " ••••••••••••••••••• * •••• REFER TO REREAD ....... -..-.... _. __ ....... ••••••••••• * •••••••••••• UNPAKN PROGRAM LISTINGS .. UNPAKN (SUBROUTINE) .. fAP ·UNPAKN COUNT 140 LBL UNPAKN ENTRY UNPAKN (N,LO,O,SCALE) ••••••••••••••••• * •••••• .. UNPAKN LAST CARD IN DECK IS NO. 0149 0001 0002 0003 0004 0005 0006 ----ABSTRACT---0001 0008 .. TITLE - UNPAKN 0009 .. UNPACK AND RESCALE A PACKED DATA VECTOR 0010 0011 UNPAKN UNPACKS A VECTOR (SUCH AS IS PACKED 8Y PAKN) AND 0012 it fLOATS AND SCALES THE VALUES. 0013 it 0014 .. LANGUAGE - fAP, SUBROUTINE (FORTRAN II COMPATI8LE) 0015 .. EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0016 it STORAGE - 78 REGISTERS 0017 .. SPEED - TIME IS LENGTH OF UNPACKED VECTOR TIMES 52 MACHINE CYCLES. 0018 - J.F. CLAERBOUT, JULY, 1962 • AUTHOR 0019 0020 it --~-USAGE--0021 0022 .. TRANSFER VECTOR CONTAINS ROUTINES NONE 0023 it AND FORTRAN SYSTEM ROUTINES NONE 0024 0025 it FORTRAN USAGE 0026 it CALL UNPAKNIN,LD,O,SCALE) 0027 0028 * INPUTS 0029 0030 N IS THE NUMBER OF POINTS IN A PACKED REGISTER. 0031 MUST BE GRTHN=l LSTHN=lB 0032 IF =1 THE DATA IS UNCHANGED. 0033 it IS FORTRAN II INTEGER 0034 0035 it Oil) I=l ••• (LO+N-l)/N) IS THE PACKED DATA. 0036 it 0037 LD IS THE NUMBER OF UNPACKED DATA POINTS. 0038 IS FORTRAN II INTEGER. 0039 it 0040 SCALE IS A FLOATING POINT SCALING BY WHICH THE UNPACKED 0041 DATA IS DIVIDE~. 0042 0043 .. OUTPUTS 0044 0045 0(1) 1= 1 ••• LD IS THE FLOATING POINT UNPACKED DATA. 0046 0047 .. EXAMPLES 0048 it 0049 .. 1. INPUTS - 011 ••• 6) 1.,4.,8.,-1.,5.,2. LD=6 N=1 SCALE: 1 • 0050 .. OUTPUTS - 011 ••• 6) 1.,4.,8.,-1.,5.,2. 0051 0052 .. 2. INPUTS - 011 ••• 3) OCT 200000040000, 737777377777, 100000237777 0053 .. LO=6 N=2 SCALE=16383.81~ 0054 it OUTPUTS - 011 ••• 6) 1.,4.,8.,-7 •• 5.,2. 0055 0056 .. 3. INPUTS - 011 ••• 2) OCT 237561720020, OC0000000040 0057 .. LD = 6 N = 5 SCALE = 7.875 0058 0059 .. OUTPUTS - 011 ••• 6) 1.02, 4.06. 8.00,-6.98, 4.95, 2.03 0060 .. 4. INPUTS - OIl) = OCT 002117275004 LO=6 N=7 SCALE=1.875 0061 .. OUTPUTS - 011 ••• 6) = 1.07, 4.27, 8.00,-6.93, 4.80, 2.13 0062 0063 .. 5. INPUTS - OIl) = OCT 000000000724 LO=6 N=18 SCALE=0.125 0064 .. OUTPUTS - 011 ••• 6) 0., 8., 8.,-8., 8., O. 0065 0066 * 0067 * .. PROGRAM FOLLOWS 8ELOW 0068 0069 * HTR o 0010 BCI I,UNPAKN 0071 UNPAKN SXA SVl,l 0012 SXA SV2,2 0073 UNPAKN-2,4 SXO 0074 . ... .. . • .. . .... . . ... .... .. . . . . .. .. ••••••• ** •••••• ***** •••• 9/9/64 ** •••••••• * •• *.**~*.**.* PROGRAM LI STINGS UNPAKN "•••••••••••••••••••••••• " (PAGE "UNPAKN • ¥.* •••••••••••• _.*** •••• IPAGE 2) 2) CLA. ARS 1,4 STO N •• ~ ••••••• * ••••• * ••••• *. 18 :1 SUB 5,4 HE CLA. 2,4 ARS III STO L CLA 3,4 ADD =1 STA 010 STA 011 012 STA STA 013 SET UP TO JUMP IN LOOP IN PROPER SPOT • FOR EASIEST PROOFREADING, READ UNPACKING LOOP FIRST. " LXA l,2 CIL):NO. DATA PTS.,XR2 IS SET FOR LOOP CLA =0 :36 LDO DVP N STQ NB CINB)=BITS PER PACKED WORD XCA :1 SUB NUMBER OF BITS PER PACKED WORD EXCLUDING SIGNBIT STA LLS CLA COMPUTE NUMBER OF PACKED REGISTERS L ADD N SUB =1 XCA :0 ClA OVP N STO M C(MI:NUMBER OF PACKED REGISTERS M,4 lXA SETS XR4 PROPERLY FOR LOOP ClA =0 WHAT IS REMAINDER LOQ L OVH N NEXT TlE IF ZERO, LOOP CAN BE ENTERED NOW AT THE BEGINNING. PAX ,1 SET REMAINDER TO XRl = WORDS IN LAST REG. SSM ADD N XCA IN-WORDS LEFT IN LAST PACKED REGISTER) CLA =0 MPY NB (N-WORDS LEFT IN REGISTER)"(BITS PER WORD) XCA STA ROl 00 LDQ INSTR. XEC 010 SHIFT OUT MEANINGLESS INFO. ROL ROl ." TRA RESET BEGIN UNPACKING LOOP • NEXT LXA N,l N=NUMBER PACKED PER REGISTER 010 LOO •• ,4 ".=DATA+l, GET NEW PACKED REGISTER RESET CLA =0 LLS LLS "* ""=NO. BITS PER WORD LESS SIGNBIT ROL GET RID OF OLD SIGN BIT 011 STO **,2 "*=OATA+l, XR2 HAS UNPACKED WORD INDEX TXI "+1,2,-1 INDEX WORD STORAGE COUNT TIX RESET,I,l CONTINUE UNPACKING THIS WORD TIX NEXT,4jl GET NEXT PACKED WORD END UNPACKING LOOP • AND SCALE •SV4 FLOAT lXD UNPAKN-2,4 LXA L,l CIL)=TOTAL NUMBER OF UNPACKED WORDS 012 ClA *",1 "" = DATA+1 ORA =0233000000000 FAD =0233000000000 FOP" 4,4 013 OATA+l STQ *",1 " TIX 012,1,1 SV1 AXT "*,1 SV2 AXT "*,2 TRA 5,4 N PZE NUMBER OF NUMBERS PACKED IN ONE REGISTER PZE TOTAL NUMBER OF UNPACKED REGISTERS L M PZE TOTAL NUMBER OF PACKED REGISTERS NB PZE: NUMBER OF BITS PER PACKED WORD END .. 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 00B5 0086 0087 0088 0089 OOgO 0091 0092 00g3 0094 00g5 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 Ol22 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 ·.....................-. * VARARG * •••••••••••••••••••••••• * VARARG (SUBROUTINE) FAP PROGRAM LI STINGS •••••••••••••••••••••••• VARARG * • •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0131 0001 -VARARG 0002 COUNT 130 0003 VARARG LBL 0004 E'NTRY VARARG CLOCS) 0005 0006 ----ABSTRACT--0007 0008 0009 - TITLE - VARARG * ENABLE FORTRAN VARIABLE LENGTH CALL[NG SEQUENCES 0010 0011 VARARG IS USEO IN CONJUNCTION WITH FORTRAN II SUBROUTINES 0012 TO ENABLE THEM TO HAVE VARIABLE LENGTH CALLING SEQUENCES. 0013 0014 .. LANGUAGE - FAP SUBROUTINE (FORTRAN [I COMPATIBLE) 0015 * EQUIPMENT - 109 OR 1090 (MAIN FRAME ONLY) 0016 .. STORAGE - 44 REGISTERS 0017 .. SPEEO 0018 .. AUTHOR - J.F. CLAERBOUT 0019 0020 ----USAGE--0021 0022 .. TRANSFER VECTOR CONTA[NS ROUTINES NONE 0023 .. AND FORTRAN SYSTEM ROUTINES NONE 0024 0025 .. FORTRAN USAGE 0026 .. CALL VARARGlLOCS) 0021 .. THl5 MUST BE THE FIRST STATEMENT IN THE FORTRAN 0028 0029 .. SUBROUTINE AND SHOULD BE FOLLOWED AS CLOSELY AS .. POSSIBLE BY THE RETURN STATEMENT. 0030 0031 0032 * OUTPUTS 0033 LOCS(II I=1 ••• N+1 N=NUMBER OF ARGUMENTS IN CALLING STATEMENT 0034 * CONTAIN THE ADDRESSES OF THE CONTENTS OF THE ARGUMENTS. 0035 I.E. 0036 LOCS(1) XLOCF(ARG1J 0037 LOCS(2) XLOCFIARG2J 0038 0039 * 0040 0041 0042 LOCSIN) = XLOCFIARGNJ 0043 LOCSIN+ll = 0 * 0044 * ARE FORTRAN II INTEGERS • 0045 0046 * THE CODING FOR THE RETURN TO THE CALL[NG PROGRAM IS 0047 0048 ALTERED SO THAT THE SUBROUTINE RETURNS TO THE PROPER * 0049 POSITION. THIS ALTERATION OCCURS ONLY FOR TME RETURN * STATEMENT IMMEDIATELY FOLLOWING THE CALL VARARG 0050 0051 STATE"ENT • 0052 * EXAMPLES 0053 .. 0054 0055 USAGE ASSUME A SUBROUTINE WITH THE FOLLOWING FORM SUBROUTINE XXXXXX (ARG1, ••• ,ARGKJ 0056 DIMENSION LOCS(N+1) 0057 CALL VARARG ILOCS) 0058 GO TO 20 0059 * RETURN 10 0060 0061 20 CONTINUE 0062 C * 0063 C THE REST OF THE SUBROUTINE IS INSERTED HERE C 0064 * 0065 GO TO 10 " 0066 END 0067 * 1. INPUTS - XLOCFIARG1) 32561 0068 0069 .. XLOCFIARG2J 32560 0010 " 0071 0072 * XLOCFIARG10J = 32552 0013 CALL XXXXXX (ARG1,ARG2, •••• ARGI01 0074 USAGE * .. . .... - .. .. . . .. ... .. .. . . .. .. ... .. . .... .. ... . .. 9129/64 ••••••• *•••••••••••••••• •••• * ••VARARG •••••• *.**** •••••* PROGRAM II STINGS (PAGE (PAGE 2' •" "• " " •• ••••••••••••••••••••••• VARARG * •••••••••••••••••••••••• ~ OUTPUTS - INSIDE THE SUBROUTINE XXXXXX LOCS ( 11.=32561. NORMAL RETURN LOCSII0l=325112 HTR 0 l,VARARG BCI VARARG SXD *-2,4 SXA SVl,l 1,4 ClA ADD =1 STA LOCS1 AXT 1,1 XR1 WILL REFER TO THE VECTOR lOCS NEED TO FIND PROG. WHICH CALLED XXXXXX " LOOK fOR SXD INSTRUCTION IN XXX XXX "A CAL -114 ANA =0777777700000 CHECKS XR4 ALSO LAS SXD4 A,4,1 TXI TRA *+2 A,4,1 TXI HAVE GOT Slm, NOW RESET XR4 TO LOOK AT XX~XXX S CALLINS PROG " -1,. CLA STA *.1 .*,4 LXD NOW LOeK FOR TAGLESS TSX INSTRUCTIONS • 1,4 B CAL ANA =0717177700000 TSX SUB TNZ C SET ADDRESSES IN LOCS VECTOR • 1,4 CLA ALS 18 LOCSI STO **,1 TXI *.1,1,1 TXI B,4,-1 CONTINUE SCAN END OF CALLING SEQUENCE, LOCS ALMOST ALL SET UP * TOV C *.1 LOCSI LOCS All SET UP STZ* SET UP RETURN STATEMENT IN XXXXXX " LXD VARARG-2,4 LOOK fOR 0,4 X,4 CAL TRA 0 ANA =0717171700000 TRA4 SUB TZE *+2 TXI 0,4,-1 PXA tl STA 0,4 RETURN TO XXXXXX " SV4 LXO VARARG-2,4 AXT SVI **,1 TRA 2,4 0,4 SXD4 SXO TSX TSX 0,4 TRA4 TRA END 0075 0076 0077 0078 0079 OOBO 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 21 ........................... . YDOTY . PROGRAM LISTINGS •. . • .. .. • • •. .. ... .. -.. .. .. .. .. . • •. .. .. ... ...... .. .-. . * ..* --.. . .... - .... ... .. . .. .. .. .. .. .. .. . .. .. .. VDOTY .. •••••••••••••••••••••••• ••••••••••••••••••••••••• • • .YOOTY ••••••••••••• ** •••• ** ••• • VDOTY (SUBROUTINE) FAP LAST CARD IN DECK IS NO. 0120 0001 0002 COUNT 150 0003 YDOTV LBL 0004 ENTRV VDOTV CX, v, LXV, DVSR. XDVODVI 0005 0006 0007 ----A8STRACT---0008 0009 TITLE - YDOTV 0010 DOT PRODUCT OF TWO VECTORS WITH DIYISION BV CONSTANT 0011 0012 VOOTY COMPUTES 0013 0014 LXV 0015 XDVflDV SUM X(J I*YI Il (1016 DVSR 0017 1=1 001B WHERE LXV. DVSR,· XIl ••• LXY) AND VII ••• lXV) ARE 0019 INPUTS, EXCEPT THAT IF THE MAGNITUDE OF DVSR IS-ZERO, 0020 IT IS SET EQUAL TO THE SUM. AND XDYODV IS SEt * 1.0 • 0021 0022 LANGUAGE - FAP SUBROUTINE IFORTRAN-II COMPATIBLE) 0023 EQUIPMENT - 709,7090,7094 CMAIN FRAME ONLY) 0024 STORAGE - 25 REGISTERS 0025 - TAKES 47 + 23.4-lXY MACHINE CYCLES ON THE 70.0 0026 SPEED AUTHOR - S.M. SIMPSON, JULY 1964 0027 0028 0029 0030 ---USAGE---0031 TRANSFER VECtOR CONTAINS ROUT[NES - INOT ANV) 0032 AND FORTRAN SYSTEM ROUTINES - INOT ANY) 0033 0034 FORTRAN USAGE 0035 CALL VDOTVIX, Y. LXY, DVSR, XOYODVI 0036 0037 0038 INPUTS 0039 0040 XIII I=l ••• LXY IS FLOAT[NG POINT. 0041 0042 YIII l=l ••• LXY IS FLOATING POINT. EQUIVALENCE (X.YI IS 0043 PERM[TTED AS IS ANY OTHER TYPE OF OVERLAP. 0044 0045 (l046 lXV MUST EXCEED ZERO • 0047 IS FLOATING POINT. OR ZERO. 0048 DVSR 0049 0050 STRAIGHT RETURN WITH NO OUTPUT IF LXY IS ILLEGAL. 0051 OUTPUTS 00')2 EQUALS ITS INPUT VALUE UNLESS THAT WERE ZERO IN WHICH 0053 DVSR CASE IT EQUALS SUM (FROM 1=1 TO LXY) OF XCII.YIII. 0054 0055 XDYODV HAS VALUE GIVEN BY THE EXPRESSION IN THE ABSTRACT, EXCEPt 0056 THAT IT HAS VALUE 1.0 IF THE INPUT VALUE OF DVSR 0057 WERE ZERO • 0058 0059 0060 EXAMPLES 0061 0062 0063 1. INPUTS - XIl ••• 3) = 1.,2 •• 3. VII ••• 3) = -1.,2.,-3. 0064 XDYII ••• 5) = -99 •• -99 ••••• ,-99. OVSR = 2.0 USAGE DO 10 [=1,5 0065 LXY [-2 0066 10 CALL VDOTVIX, Y, LXY, DYSR, XDYIII) 0067 0068 OUTPUTS - XDYI1 ••• 5) = -99.,-99.,-.5,1.5,-3.0 0069 2. INPUTS - Xll ••• 4) = 1.,2.,3.,4. SQRSUM = 0.0 0070 0071 USAGE DO 10 1=1,4 0072 10 CALL VDOTVIX, XCII, 5-1. SQRSUM. ACORIII' 9/4/64 = .......................... , .. PROGRAM LISTINGS - YOOTY - ........................... •••••••••• •••• * •••• *••• ~ !PAGE .,.............................. ... VOOTY 2. .. !PAGE OUTPUTS - SQRSUM •. = 30.0 ACOR! 1 ... 4) 1.0.0.66667.0~36667.0.133a3 • PROGRAM FOLLOWS BELOW • TRANSFER • NO • BCl • • ONLY ENTRY. • YOOTY SXA K1 . . VECTOR CLA AOO STA CLA ADD STA 1.YOOTY YOOTYU, Y, LXY .. OVSR, XOYOOY) LEAYE.l 1.4 K1 LDQ 2,4 Kl FMP AIX) AIX)+l AIY) AIY)+l • CHECK OUT LENGTH • CLA. TMI POX TXL STl 3,4 LEAYE 0,1 LEAVE,l,O TEMP LXY LOQ FMP FAO STO TIX ••• 1 •• ,1 TEMP TEMP LDQ,I,l ... = AIXhl • LOOP •LOQ FMP • • NORMALIZE, IF • . NZTSTO. FOP .. STQLEAVE AXT TRA TEMPORARY ..• TEMP PZE END OVSR 4,4 4,4 4,4 5,4 ..... 1 6,4 ._ •• _,tI. .... AIY)+l NON-ZERO. ANO STORE OYSR XOYODY .... = XRl INITIAL 0013 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 Ol08 0109 0110 Olll 0112 0113 0114 0115 0\16 0117 0118 0119 0120 2) _•••• * •••• ..-_ •••••••••••• VOVBYV - PROGRAM LISTINGS • * •• * •••• * ••• ** •• *.~.*** .. VoVBYV (SUBROUTINE) .. FAP .VoVBYV COUNT 100 LBL VoVBYV ENTRY VDVBYV (X,Y,LXY,XOVBYY) • ••••••••••••• *** •• ** •• * - ~ VoVBYV LAST CARD IN DECK IS NO. 0089 0001 0002 0003 0004 0005 0006 • ----ABSTRACT---0007 • 0008 • 0009 - TITlE - VDVBYV .. DIVIDE EkE~ENTS OF ONE VECTOR BY THOSE OF ANOTHER 0010 0011 • VDVBYV DIVIDES EACH ELEMENT OF A FLOATING VECTOR BY THOSE 0012 OF ANOTHER, MAKING NO TEST FOR ZERO DIVISORS. O~TPUT 0013 MAY RE'LACE EITHER INPUT VECTOR • 0014 0015 • - FAP SUBROUTINE (FORTRAN-II CO~PATIBLE) 0016 • LANGUAGE 0017 - EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) .. STORAGE 0018 - 22 REGISTERS .. SPEED 7090 709 0019 33 + (19 OR 241-LXY MACHINE CYCLES, LXY ~ VEgTOR lENGTH 0020 .. AUTHOR - S.M. SI~PSON, AUGUST 1963 0021 0022 ----USAGE---0023 0024 • TRANSFER VECTOR CONTAINS ROUTINES - INONE) 0025 AND FORTRAN SYSTEM ROUTINES - (NONE) 0026 0027 • 0028 • FORTRAN USAGE .. CAll VDVBYV(X,Y,LXY,XDVBYY) (1029 0030 .. INPUTS 0031 0032 • XII) I=i ••• lXY IS A FLOATING VECTOR 0033 0034 • YII) I=I ••• LXY IS A FLOATING VECTOR, NONE OF WHOSE ELEMENTS 0035 0036 = 0.0 • 0037 lXY SHOULD EXCEED 0 0038 0039 •.. OUTPUTS STRAIGHT RETURN WITH NO OUTPUT IF LXY lSTHN 1 0040 0041 • • XOVBYYII) I=l ••• lXY IS XDVBYYII) = XIII/YIII (USING FOP 0042 .. INSTRUCTION) 0043 0044 0045 EQUIVAlENCEIXDVBYY,X OR Y) IS PERMITTEO. 0046 0047 DIVISION BY ZERO TURNS ON THE DIVIDE CHECK INDDCATOR BUT 0048 VOVBYV OOESN'T TEST THIS OR STOP THE PROGRAM • 0049 .. EXAMPLES 0050 0051 .. 1. INPUTS - Xll ••• 3) = 2.,4.,6. Yl1 ••• 3) 1.,2.,3. Z=O.O 0052 0053 • USAGE tALL VDV BYV I X,. Y, 3, W) 0054 • CALL VOVBYV IX,Y,l,U) .. CALL VDVBYV IX,Y,3,X) 0055 .. CALL VDVBYV IX,Y,O,Z) 0056 .. OUTPUTS - Wll ••• J) 2.,2.,2. Ull) = 2. 0057 .. Xll ••• 3) 2.,2.,2. Z=O.O (NO OUTPUT CASEI 0058 0059 .. PROGRAM FOllOWS BELOW 0060 0061 0062 • 0063 • NO TRANSFER VECTOR HTR o XR4 0064 BCI 1,VOVBYV 0065 .. ONLY ENTRY • VDVBYV{X,Y,lXY,XDVBYY) 0066 VOVBYV SXD VDVBYV-2,4 0067 ClA 1,4 Kl 0068 ADO Kl AIX)+l 0069 0070 STA GET 2,4 ClA 0071 AIY)+l AOD 0072 Kl STA DIV 0073 4,4 CLA 0074 .. . . -. . . . ... ... ... ... . . . 9/29/64 .. •• - •••••••• * ••• * •• ** ••• •••••••••••••••••••••••• * VDVBYV PROGR AM 1I STINGS * (PAGE 2) ADD Kl STA STORE 3,4 CLA* TMI LEAVE 0,4 PDX LEAVE,4,0 TXL * DIVISION LOOP GET CLA .*,4 DIV FDP **,4 STORE STQ **,4 GET,4,1 TIX * EXI T LEAVE LXD VDVBYV-2,4 5,4 TRA END ~* ••• * -*.. *.**.**.*** ••• * VOVBYV * •••••••••••••••••••••••• •••••••••••••••••••••••• (PAGE AIXOVBYY)+l LXY **=AIX)+l '''''AIYI+l **=AIXDV8YY)+1 0015 0016 0011 0018 0079 0080 OOBI 0082 00B3 0084 0085 0086 0081 0088 0089 21 *** •• ..••••••••••••••••••• VECOUT ••••••••••••••••• * •••••• PROGRAM LISTINGS .. VECOUT (SUBROUTINE) 9/29/64 • LABEL CVECOUT SUBROUTINE VECOUTIITAPE.FMT.X.ILO.IHII 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 C C C C C C C C C f ............................... .. .. VECOUT .. f .............................. LAST CARD IN DECK IS NO. 0090 0001 0002 0003 0004 ----ABSTRACT--0005 0006 TITLE - VECOUT 0007 OFFLINE VECHIR OUTPUT WITH NORMAL OR LITERAL FORMAT 0008 0009 VECOUT OUTPUTS A VECTOR RANGE ON A GIVEN TAPE UNIT 0010 ACCORDING TO A GIVEN FORMAT VECTOR. THE HIRMAI ViCTORlS 0011 EITHER OF THE ORDINARY FORM OR MAY APPEAR AS LITERAL 0012 HOLLERITH. STRIPPED OF THE INITIAL AND TERMINAL 0013 0014 PARENTHESES. IN THE CALLING SEQUENCE. 0015 0016 LANGUAGE - FORTRAN-II SUBROUTINE EQUIPMENT - 709 OR 7090 (MAIN FRAME PLUS 1 TAPE UNIT! 0017 STORAGE 0018 - 66 REGISTERS 0019 SPEED AUTHOR - S.M. SIMPSON. SEPTEMBER 1963 0020 0021 ----USAGE--0022 0023 0024 TRANSFER VECTOR CONTAINS ROUTINES - FNOFMT. RPLFMT ANO FORTRAN SYSTEM ROUTINES - (STH). IFIL) 0025 0026 0027 FORTRAN USAGE CALL VECOUTfITAPE.FMT,X.ILO.IHII 0028 0029 0030 INPUTS 0031 ITAPE IS LOGICAL TAPE NUMBER. INOT CHECKED FOR LEGALITY) 0032 0033 FMTI J) 0034 1=1.2 •••• IS AN ORDINARY FORMAT (FIRST CHARACTER IS () OR 0035 IS A FORMAT STRIPPEO OF ITS ENCLOSING 0036 PARENTHESES AND TERMINATED BY AN ALL-ONES 0037 FENCE. ITS FIRST CHARACTER MAY NOT BE A (, 0038 0039 AND ITS SECOND CHARACTER MUST NOT BE A J. IF THIS IS NEEDED. INSERT LEADINIS SPACES. 0040 0041 XfI) 0042 I=IlO ••• IHI IS THE VECTOR TO BE PRINTED 0043 SHOULD EXCEED 0 INOT CHECKED) 0044 ILO 0045 0046 (NOT CHECKED) SHOULD BE GRTHN= ILO IHI 0047 0048 FUNCTION IS EQUIVALENT TO THE FORTRAN PROGRAM BELOW OUTPUTS 0049 0050 WRITE OUTPUT TAPE ITAPE.IO.IXCI),I=ILO.IHIJ 0051 FORMA TI FMTI 10 0052 0053 EXAMPLES OU54 0055 1. WITH LITERAL HOLlERITH IWITH REPETITION TO CHECK REVERSAL SCHEME USED) 0056 0057 INPUTS - Xll ••• 5)=I.,2 •• 3 •• 4 •• 5. 0058 0059 CALL VECOUTI2.21HI2H XI2 ••• 5) = ,4F5.1.X~2.5' USAGE 0060 DC 10 1=1,3 0061 10 CALL VECOUTI2.15H8H XIII = .F5.1.X.1111 0062 0063 OUTPUTS - (PRINTED OFF-LINE FROM LOGICAL 2) 0064 XI2 ••• 51 2.0 3.0 4.0 5.0 0065 1.0 XI1I 0066 1.0 XllI = 0061 1.0 XllI = 0068 0069 2. WITH ORDINARY FORMAT 0070 XI1>=l. INPUTS - FMTll ••• 3) = 17HI8H XII) = .F5.11 0071 0072 CALL VECOUTI2,FMT.X.l,11 USAGE 0073 0074 OUTPUTS - (PRINTED OFF-LINE FROM LOGICAL 21 •••••••••••••••••••••• ** PROGRAM LI STINGS VECOUT • ............................ IPAGE 2) • C XIII IPAGE 1.0 C C C PROGRAM FOllOWS 8ELOW C •••••••••••••••••••••••• VECOUT • •••••••••••••••••••••••• • DIMENSION COMU) COMMON COM CALL FNDFMTCFMT,IXCFMTI CALL RPLFMTlCOM,COMllXCFMTl1 GO TO 20 10 CALL RPLFMTfCOM[IXCFMTI,COMI GO TO 9999 20 WRITE OUTPUT TAPE ITAPE ,COM,CXIII,I=llO,IHII GO TO 10 9999 RETURN END 0075 0076 0077 0078 0079 0080 C081 0082 0083 0084 0085 (1086 0087 0088 0089 0090 21 . .*•••••••••••••••••••••••• VINOEX ••••••••••••••••••••••• REFER TO INDEX •••••••••••••••••••••••• • •••• *••VMNUSV * ••••• ** •••••• ••• ~ REFER TO VPLUSV PROGRAM LISTINGS •••••••••••••••••••••••• .. VINDEX • •••••• ** •••••••••••••••• REFER TO INDEX •••••••••••••••••••••••• .. VMNUSV • •REFER ••••••••••••••••••••••• TO VPlUSV ....••................ ,. ........................ • VOUT • , PROGRAM 1I STINGS •••••••••••••••••••••••• VOUT • f •••••••••••••••••••••••• • VOUT (SUBROUTINE) 9129/64 LAST CARD IN DECK IS NO. OUO • LABEL 0001 Oe02 CVOUT SUBROUTINE VOUT(ITAPE,NSPACE,X,XNAME,XFMT,ILO,IHI' 0003 0004 C 0005 ----ABSTRACT---C 0006 C 0001 C TI TlE - VOUT C OUTPUT NAMED VECTOR BY NORMAL OR LITERAL FORMAT WITH SPACING 0008 0009 C VOUT WRITES OUT A VECTOR RANGE, XtIlO ••• IH{), ON A 0010 C SPECIFIED TAPE UNIT ACCORDING TO A SPECIFIED FORMAT, 0011 C WITH LABELING ANO INITIAL SPACING (OR PAGE RESTORE1. 0012 C THE FORMAT IS SPECIFIED EITHER AS A NORMAL FORMAT VECTOR 0013 C OR AS LITERAL HOLLERITH IN THE CALLING SEQUENCE. 0014 C 0015 C LANGUAGE 0016 - FORTRAN-II SUBROUTINE C EQUIPMENT 109 OR 1090 (MAIN FRAME PLUS ONE TAPE UNIT) 0017 C 0018 - 104 REGISTERS C STORAGE 0019 C SPEED C AUTHOR OCTOBER 1963 0020 - S.". SIMPSON JR, 0021 C 0022 C ----USAGE--0023 C 0024 C TRANSFER VECTOR CONTAINS ROUTINES - CARIGE, HRAOJ, VECOUT 0025 C AND FORTRAN SYSTEM ROUTINES - ISTHI, IFILl 0026 C 0027 C FORTRAN USAGE CALL VOUTIITAPE4NSPACE,X,XNAME,XFMT.ILO,IHII 0028 C 0029 C 0030 DEFINE A NORMLIT FORMAT VECTOR AS EITHER C INPUTS Al A NORMAL FORMAT VECTOR, 0031 C OR BI LITERAL HOLLERITH IN A CALLING SEQUENCE WHOSE 0032 C 0033 CHARACTERS IREAOING CONTINUOUSLY FROM LEFT TO RIGHT1 C 0034 ARE THE OESIRED FORMAT STRIPPED OF THE ENCLOSING C PARENTHESES. THE FIRST AND SECOND CHARACTERS M~S~ 0035 C NOT BE QUOTE t UNQUOTE OR QUOTE I UNQUOTE 0036 C RESPECTIVELY. (TWO BLANKS FOLLOWED BY ( WOULD BE OK4) 0037 C 0038 C 0039 ITAPE IS DESIRED LOGICAL TAPE NO. C 0040 C 0041 IS DESIRED NO. OF SPACES (MAY BE ZERO) BEFORE ANY OUTPUT. NSPACE C 0042 IF NEGATIVE. AN INITIAL PAGE RESTORE OCCURS. C 0043 C 0044 XUI I=ILO ••• IHI IS THE VECTOR RANGE TO BE PRINTED. MAY BE C 0045 ANY MODE. C 0046 C XNAME IS THE NAME OF VECTOR XP IN FORMAT(A61 OR ~A51 OR ••• IAl,. 0047 C 0048 C XFMTI J) 0049 IS A NORMLIT FORMAT VECTOR CONTROLLING THE OUTPUT C 0050 OF XIII. C 0051 C 0052 ILO SHOULD EXCEED ZERO INOT CHECKED). C 0053 C 0054 IHI SHOULD BE GRTHN = ILO INOT CHECKED). C 0055 C 0056 1. NSPACE SPACES OR A PAGE RESTORE OCCURS C OUTPUTS 0051 2. A HEADING LINE OF THE GENERAL .ORM C 0058 XNAME I ILO ,ILO+l • • • •• IHI) C 0059 APPEARS. IF IHI EXCEEDS ILO. IF IHI=lLD THE HEADING C 0060 IS C 0061 XNAME I ILO) C 0062 3. THE VALUES XIILO ••• IHI) ARE THEN PRINTED ACaORDING TO C XFMT. 0063 C 0064 C 0065 C EXAMPLES 0066 C 0061 C 1. WITH NORMAL FORMATS AND NAMES 0068 INPUTS - XIl ••• 14) a 1•• 2 ••••• ,14. XNAME = IHX, C 0069 XFMTll ••• 2) = 11HIIDX.5F8.11 Y = 1. YNAME ~ IHY C YFMT(1 ••• 2) = lOHI20X,F4.l) 0070 C 0011 CALL VOUTI2,3.X~XNAME.XFMT.3,14) USAGE C 0012 CALL VOUTI2,3.Y,YNAME,YFMT,l,11 C •••••••••••••••••••••••• ............................... ........................ . PROGRAM LISTINGS VOUT • ............................. IPAGE 2) * • C OUTPUTS - THE FOLLOWING 12 LINES x I C C C C 3 , 3.0 8.0 13.0 4 , • • 4.0 9.0 14.0 ., 5.0 10.0 14 6.0 11.0 1.0 12.0 C C C C C C .. IPAGE C C C C VOUT Y I 1 ) 1.0 WILL 8E PRINTED OFF LINE FROM LOGICAL TAPE 2 (UNDER PROGRAM CONTROl) C C 2. SAME DATA BUT WITH LITERAL ARGUMENTS C INPUTS Xll ••• 14) AND Y SAME AS EXAMPLE 1 tALL YOUTI2,3,X,lHX,9HIOX.5F8.1,3,14) C USAGE CALL YOUTI2,3,Y,IHY,8H20X,F4.1,l,ll C C OUTPUTS - IDENTltAL TO THOSE OF EXAMPLE 1. C C PROGRAM FOLLOWS BELOW C CALL CARIGEIITAPE,NSPACE) XNMADJ=HRADJFIXNAME) IF (IHI-ILO) .999,10,20 C SINGLE ELEMENT OUTPWT 10 WRITE OUTPUT TARE ITAPE,15,XNMADJ,ILO 15 FORMATIIH ,A6.2H (,I5,5H) =) GO TO 30 C MUlTIPLE ELEMENT OUTPUT 20 ILOPl=ILO+l WRITE OUTPUT TAPE ITAPE,25,XNMADJ,ILO,ILOPl,IHI 25 FORMATIIH ,A6,2N I,I5,2H ,.I5.10H , • • • • • I5,5H 30 CALL VECOUT(ITAPE.XFMT.X,ILO.IHI) 9999 RETURN END =) 0013 0014 0015 0016 0011 0018 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 2) .......-................... • VPLUSV • PROGRAM 1I STINGS •••••••••••••••••••••••• 9/29/64 VPLUSV (SUBROUTINE) FAP ·VPLUSV COUNT 150 LBL VPLUSV ENTRY VPLUSV ( X. Y,LXY.XPLUSYI ENTRY XVPLSV IIX,IY,LXY,IXPLSY) ENTRY VMNUSV « X, Y,LXY,XMNUSY) ENTRY XVMNSV (IX,IY,LXY,IXMNSY) •. --.. -• .. LAST CARD 1111 DECK IS NO. 0126 0001 0002 0003 0004 0005 OG06 0007 0008 0009 ----ABSTRACT---0010 0011 TITLE - VPLUSVWITH SECONDARY ENTRIES XVPLSV, VMNUSV AND XYMNSV 0012 ADD OR SWBTRACT TWO FLOATING OR FIXED VECTORS 001l 0014 VPLUSV ADDS TWO FLOATING VECTOR 0015 XVPLSV ADDS TWO FIXED VECTORS 0016 VMNUSV SUBTRACTS TWO FLOATING VECTORS 0017 XVMNSV SUBTRACTS TWO FIXED VECTORS 0018 0019 OUTPUT MAY REPLACE EIT~ER INPUT VECTOR. 0020 0021 FAP SUBROUTINES I FORTRAN-I I COMPATIBLE) LANGUAGE 0022 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0023 STORAGE - 34 REGISTERS 0024 SPEED - VPLUSV 37 + 12.4-LXY MACHINE CYCLES, 0025 XVPLSV 39 + 8.0-LXY LXY : VECTOR LENGTH 0026 VMNUSV 39 + 12.4*LXY 0027 XVMNSV 39 + 8.0*LXY 0028 - S.M. SIMPSON, AUGUST 1963 0029 AUTHOR 0030 ....---USAGE---0031 0032 TRANSFER VECTOR CONTAINS ROUTINES - INONE) 0033 AND FORTRAN SYSTEM ROUTINES - INONE) 0034 0035 FORTRAN USAGE 0036 CALL VPLUSVC X, Y,LXY,XPLUSYI 0037 XVPLSVtIX,IY,LXY,IXPLSY) 0038 VMNUSVl X, Y,LXY,XMNUSYI 0039 XNMNSV~IX,ly,LXy,IXMNSY) (1040 0041 0042 INPUTS 0043 XII) I:I ••• LXY IS A FLOATING VECTOR 0044 0045 YII) l=l ••• lXY IS A FLOATING VECTOR 0046 0047 LXY SHOULD EXCEED ZERO 0048 0049 IXI Il I:I ••• LXY IS A FIXED VECTOR 0050 0051 I YI II I:I ••• LXY IS A FIXED VECTOR 0052 0053 STRAIGHT RETURN WITH NO OUTPUT IF LXY LSTHN 0054 OUTPUTS 0055 XPLUSYCI } l:l ••• LXY IS XPLUSYI J} XI () + YO) 0056 I XPLSYC I) I=l ••• LXY IS I XPL SYI J) I X( I) + IY tI) 0051 XMNUSYCI) I:l ••• LXY IS XMNUSY I I) 0058 XII l - YI I) IXMNSYIIl I=l ••• LXY IS lXMNSYII) IX III - IY I I ) 0059 0060 EQUIVALENCE IXPLUSY OR XMNUSY, X OR Yh (IXPLSY OR UMNSH 0061 IX OR IY) IS PERM ITTED. 0062 0063 0064 EXAMPLES 0065 INPUTS XIl ••• J) '" 2.,4.,6. YIl ••• 3): 1.,2.,3. 0066 1. IXIl ••• 3) = 2,4,6 IYll ••• 3): 1,2,3 Z:O.O 0061 USAGE CALL VPLUSV I X, Y,3, Xl) 0068 CALL XVPLSV IIX,IY,3,IXll 0069 CALL VMNUSV I X, Y,3, X2) 0010 CALL XVMNSV IIX,IY,3,IX2) 0071 CALL VPLUSV I X, Y,3, X) 0072 CALL XVMNSV IIX,IY,l,IY) 0013 CALL VPLUSV I X, Y,O, Z) 0074 -•• .. .. .. --. - * .. .. .. • .. • • .. -. .-. .... . - • • • ..-. --. --. - . - • • • .• • • •••••••••••••••••••••••• VPLUSV .. •••••••••••••••••••••••• • •••••••••••••••••••••••• • VPLUSV •••••••••••••••••••••••• VPlUSV • PROGRAM LISTINGS • .. •••••••••••••••••••••••• IPAGE • •••••••••••• 11 •••••••••• 2) • • • • • .. • • IPAGE OUTPUTS - Xl(1 ••• 3) : 3.,6.,9. [Xlll ••• 3) X2Il ••• 3) : 1.,2.,3. IX211 ••• 3) X (1 ••• 3) 3.,6.,9. IYlll: 1 Z ~ 0.0 INO OUTPUT CASE) = PROGRAM FOLLOWS BELOW • NO TRANSFER VECTOR HTR XR4 o BCI l,VPLUSV ENTRY. VPLUSVIX,Y~LXY,XPLUSY) • PRINCIPAL VPLUSV CLA FAD SETUP STO MODIFY SXD VPLUSV-2,4 1,4 Kl CLA ADD AIX)+l Kl STA GET CLA 2,4 ADD Kl AIY)+l STA MODIFY 4,4 CLA ADD AIXPLUSY)+l Kl STA STORE 3,4 LXY CLA" TMI LEAVE POX 0,4 LEAVE,4,0 TXL .. lOOP •• ,4 GET CLA ''*:AIX)+l MODIFY NOP :FAD "",4 ADD *":AIY )+1 * STORE STO ••• 4 .uAIXPlUSY)+l GET,4,1 TIX .. EXIT LEAVE lXD VPlUSV-2,4 TRA 5,4 .. SECOND ENTRY. XVPLSVIIX,IY,LXY,IXPLSY) XVPLSV ClA ADD TRA SETUP • THIRD ENTRY. VMNUSYIX,Y,lXy,X~NUSY) VMNUSY ClA FSB TRA SETUP • FOURTH ENTRY. XVMNSV(IX,IY,LXY,IXMNSYI XYMNSV CLA SUB TRA SETUP • CONSTANfS FAD FAD **.4 ADD ADD ··,4 FSB FSB **.4 SUB SUB **.4 END "*,4 FSB •• ,4 SUB 0075 0076 0077 0078 0079 0080 0081 00B2 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0111 0118 0119 0120 0121 0122 0123 0124 0125 0126 2) ••••• * ••• ~ ••*••• ****.*~* • VRSOUT • •••••••••••••••••••••••• PROGRAM 1I STI NGS •••••••••••••••••••••••• VRSOUf • •••••••••••••••••••••••• • 9/29/64 LAST CARD IN DECK IS NO. 0137 • VRSOUT ISUBROUTINE) 0001 • FAP .VRSOUT 0002 COUNT 150 0003 VRSOUT LBL 0004 ENTRY VRSOUT (ITAPE.NSPACE.FMT,SPACE.Xl,X2, •••• XN) 0005 0006 • ----ABSTRACT---0007 • 0008 0009 • TITLE - VRSOUT • OUTPUT VARIABLES BY NORMAL OR LITERAL FORMAT 0010 0011 VRSOUT IS A VARIABLE-LENGTH-CALLING-SEQUENGE PROGRAM 0012 WHICH WRITES OUT. ON A SPECIFIEO TAPE, A LIST BF VARI0013 • 0014 ABLES ACCORDING TO A GIVEN FORMAT, WITH INITIAL SPACING OR PAGE RESTORE. THE FORMAT MAY BE EITHER A NORMAL 0015 FORMAT VECTOR, OR APPEAR AS LITERAL HOLLERITH )N THE 0016 • CALLING SEQUENCE. 0017 • 0018 •.. LANGUAGE - FAP SUBROUTINE IFORTRAN-II COMPATIBLE) 0019 it EQUIPMENT - 709 OR 7090 (MAIN FRAME PLUS ONE TAPE UNITI 0020 .. STORAGE - 47 REGISTERS 0021 it SPEED 0022 OCTOBER 1963 0023 • AUTHOR it 0024 it ----USAGE---0025 0026 • .. TRANSFER VECTOR CONTAINS ROUTINES - CARIGE, VECOUT 0027 (l02B .. ANO FORTRAN SYSTEM ROUTINES - INONEI 0029 • 0030 • FORTRAN USAGE .. CALL VRSOUTIITAPE,NSPACE,FMT,SPACE,Xl.X2 •••• ,XN) 0031 • WHERE THE NO. OF VARIABLES, N, MUST EXCEED O. 0032 0033 •.. INPUTS DEFINE A NORMLIT fORMAT VECTOR AS EITHER 0034 A) A NORMAL FORMAT VECTOR, 0035 OR Hl LITERAL HOLLERITH IN A CALLING SEQUENCE WHOSE 0036 CHARACTERS IREADING CONTINUOUSLY FROM LEfT TO RIGHT) 0037 ARE THE DESIRED fORMAT STRIPPED OF THE ENCLOSING 0038 it PARENTHESES. THE fIRST AND SECOND CHARACTERS MWST 0039 NOT BE QUOTE ( UNQUOTE OR QUOTE ) UNQUOTE 0040 RESPECTIVELY. ITWO BLANKS fOLLOWED BY • WOULD BE OKJl 0041 0042 • 0043 ITAPE IS LOGICAL TAPE NO. Of DESIRED OUTPUT TAPE. 0044 IS DESIRED NO. (MAY BE ZERO) OF SPACES BEFORE ANY OUTPUT. 0045 NSPACE If NEGATIVE AN INITIAL PAGE RESTORE OCCURS. 0046 0047 it 004B FMT I Il IS A NORMLIT fORMAT VECTOR CONTROLLING THE OUTPUT OF Xl ••• XN • 0049 0050 .. SPACEII) I=l ••• N MUST BE AVAILABLE AS SCRATCH. 0051 0052 • If N=l. EQUIVALENCE ISPACE.Xll IS PERMITTED. it 0053 .. Xl,X2, ••• ,XN ARE THE N VARIABLES (MODES ARBITRARY) TO BE PRINTED. 0054 0055 .. OUTPUTS 1. NSPACE SPACES OR A PAGE RESTORE OCCURS • 0056 2. X1,X2, •••• XN ARE PRINTED ACCORDING TO FORMAt FMT. 0057 • 0058 it EXAMPLES 0059 it 0060 0061 • 1. USING NORMAL fORMAT 0062 .. INPUTS - Xl = 1., IX2 = 2, IX3 = 3 0063 • fMTll ••• 6) = 33H(5H Xl =,f4.1,11H. IX2.IX3 =,2t41 0064 • USAGE DIMENSION SPACEI3) it CALL VRSOUT{2,3,fMT,SPACE,X1,lX2.IX3) 0065 it OUTPUTS - THE fOLLOWING 4 LINES 0066 it 0067 it 0068 0069 • Xl = 1.0, IX2,IX3 = 2 4 0070 • WILL PRINT OFF-LINE FROM LOGICAL TAPE 2 UNDER PROGRAM 0071 it CONTROL 0072 it 0073 .. 2. USING LITERAL FORMAT 0074 . .. .. .... .. ... .... .. .. . . . ••••• * ••••,.....*.* •••• ~ .... VRSOUT * ••••••••••••••••••••••••" (PAGE PROGRAM LISTINGS ..._..••...•..........•. .. VRSOUT 2) .* INPUTS USAGE * * OUTPUTS - "" - SAME AS FOR EXAMPLE 1. (ALL VRSOUTI2.3.31H5H Xl =,F4.l.11H. IX2,IX3 "'.2110. SPACE.Xl.IX2,IX3) 1 IDENTI¢AL TO THOSE OF EXAMPLE 1. X1~IX2.IX3 PROGRAM FOLLOWS BELOW * * * TRANSFER VECTOR CONTAINS CARIGE, VECOUT HTR 0 XRl HTR 0 XR4 BCI 1.YRSOIllT * ONLY ENTRY. VR30UTIITAPE,NSPACE.FMT.SPACE.X1.X2 ••••• XNI VRSOUT SXD VRSOUT-2.4 SXD VR90UT-3.1 AI !TAPE) CLA 1.4 STA CAl STA VAl AINSPACE) CLA 2.4 STA CA2 AIFMTJ CLA 3.4 STA VAl AISPACEI CLA 4.4 S'TA STO STA VA3 * LOOP TO PACK UP THE VARIABLES INTO SPACE 11 ••• N) XRl COUNTS N AXT 0.1 IINITIALIZE TO 1.4=Xll TXI ...·1.4.-4 POSSIBLE TSX X,D CAL CAL 1.4 ANA AMASK LAS TSXZ TRA *+2 TRA GET X * WHEN NO MORE. SET NO. VARIABLES AND GO OPERATE CARIGE. SXD N.l TRA OPCAR * STORE EACH X IN THE SPACE VECTOR. COUNT AND CYCLE GETX CLA* 1,4 STO STO **,1 "*=AISPACEI TXI *+1,1 tl TXI CAL,4.-1 * GO OPERATE CARIGE OPCAR SXA LEAVE.4 TSX SCARIGE,4 "*=AI ITAPE) CAl TSX **,0 -*=AI NSPACE I CA2 TSX **.0 * AND THEN VECOUT TSX SVECOUT,4 **=AI !TAPE) VAl TSX **.0 **=A I FMT) VA2 TSX **,0 ,,*·AISPACEI VA3 TSX **,0 TSX K01,0 ILO=l IHI=N TSX N.O * AND THEN EX IT *.,4 ."=XR4 TEMP LEAVE AXT LXD VRSOUT-3.1 1,4 TRA .. CONSTANTS, TEMPORARiES O,(h 1 KOt PZE AMASK OCT 771771700000 TSXl TSX 0.0 N PZE ""=NO. OF VARIABLES = N D.O.". END " _•• , •••••••••••• ** •••••• IPAGE 0015 0076 0011 0078 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 00'l2 0093 0094 0095 0096 00'l7 0098 00'l9 0100 0101 0102 0103 0104 0105 0106 0101 0108 0109 0110 Olll 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 21 ••••• ~ •••••••• *.** ••• *.* '* VSOUT PROGRAM LISTINGS • • •.YSOUT . • .• • .. • ..• • ... it • •.. • • '* • '* • •.'* • • • • • • • • '* • • • • '* •• .'* ... '* .. • '* ... .• • • •. . ..• .•.. .. .. .. • • VSOUT FAP I SUBROUTINE) ,,·· •• • ...• •••• f •• • •• ••• .. • "VSOUT •••••••••••••••••••••• ** • " •• f •••••••••••••••••••• LAST CARD IN DECK IS NO. 0124 0001 0002 COUNT 150 0003 L8L VSOUT 0004 ENTRY VSOUT IITAPE,NSPACE,Xl,XINAME,XIFMT,ILOl,IHII, X2. 0005 X2NAME,X2FMT,IL02,IHI2, •••••• ,XN,XNNAME.XNFMT. 0006 ILON.IHIN) 0007 OOOB ----ABSTRACT--0009 0010 TITLE YSOUT 0011 OUTPUT NAMED VECTORS BY NORMAL OR LITERAL FORMATS MITH SPACING 0012 0013 VSOUT I S A VAR I ABLE-LENGTH-CALlING-SEQUENCE PROGRAM WIIHCH 0014 WRITES OUT, ON A SPECIFIED TAPE UNIT. A LIST OF VECTOR 0015 RANGES. EACH RANGE ACCORDING TO A GIVEN FORMAT, InTH 0016 LA'BELING AND INITIAL SPACING OR PAGE RESTORING BEFORE 0011 EACH VECTOR. THE FORMATS ARE EITHER NORMA~ FORMAT 001B VECTORS OR MAY APPEAR AS LITERAL HOLLERITH IN THE CALL~NG 0019 SEQUENCE. ONE CALL OF VSOUT IS EQUIVALENT TO A 0020 SU£CESSION OF CALLS OF SUBROUTINE VOUT • 0021 0022 - FAP SUBROUTINE IFORTRAN-II COMPATIBLE) 0023 LANGUAGE EQUI PMENT - 709 OR 7090 IMAIN FRAME PLUS ONE TAPE UNTI' 0024 - 37 REGISTERS 0025 STORAGE 0026 SPEED - S.M. SIMPSON JR •• OCTOBER 1963 0027 AUTHOR 0028 ----USAGE---0029 0030 TRANSFER VECTOR CONTAINS ROUTINES - YOUT 0031 0032 AND FORTRAN SYSTEM ROUTINES - INONE) 0033 0034 FORTRAN USAGE CALL VSOUTIITAPE,NSPACE,XI,XlNAME,XlFMT,ILOl.IHII, X2,X2NAME. 0035 1 X2FMT,IL02,IHI2, •••• XN,XNNAME,XNFMT,ILON,IMINJ 0036 0037 WHERE THE NO. OF VECTORS, N, MUST EXCEED ZERO. 0038 0039 0040 THE ABOVE IS EQUIVALENT TO A SEQUENCE OF N CALLS OF VOUT. 0041 CALL YOUTIITAPE.NSPACE.Xl.XINAME,XIFMT,lL01,IHIII 0042 CALL VOUTIITAPE.NSPACE,X2,X2NAME,X2FMT,IL02,lHI2) 0043 ETC CALL VOUTIITAPE.NSPACE,XN,XNNAME.XNFMT.ILON,IHIN) 0044 0045 SEE WRITEUP OF SUBROUTINE VOUT FOR INPUT-OUTPUT DETAIlS~ 0046 0047 0048 EXAMPLES 0049 1. WITH NORMAL FORMATS AND NAMES 0050 INPUTS - XIl ••• 14) • 1.,2 •••••• 14. XNAME. IHX, 0051 XFMT(I ••• 21 = lIHI10X.5F8.11 Y. 7. YNAME d IHY 0052 0053 YFMTI1 ••• 2) • 10HI20X,F4.1) USAGE tALL V50UT(2,3.X,XNAME,XFMT,3,14, Y,YNAME,YFMTj1,tt 0054 0055 OUTPUTS - THE FOLLOWING 12 LINES 0056 0057 0058 x ( 3 , 4 , • • , 14 0059 3.0 1.0 4.0 5.0 6.0 0060 B.O 9.0 10.0 11.0 12.0 0061 13.0 14.0 0062 0063 0064 0065 Y ( 1 I 0066 7.0 0067 WILL BE PRINTED OFF LINE FROM LOGICAL TAPE 2 IUNDER 0068 0069 PROGRAM CONTROL I 0070 2. SAME DATA BUT WITH LITERAL ARGUMENTS 0071 INPUTS - Xll ••• 141 ANO Y SAME AS EXAMPLE 1. 0012 USAGE CALL VSOUT(2,3,X,IHX,9H10X,5F8.1,3,14, Y.IHY. n073 0074 8H20X,F4.1,1,11 9/2.9/64 . ..•••••••••••••••••••••••• .. VSOUT PROGRAM LISTINGS •••••••••••••••••••••••• (PAGE 2) .. ... .. .. ••••••••••••• 4 •••••••••• .. VSOUT OUTPUTS - IDENTICAL TO THOSE OF EXAMPLE 1 PROGRAM FOLLOWS BELOW TRANSFER VECTOR CONTAINS VOUT o XR4 HTR 1,VSOUT BCI .. ONLY ENTRY. VSOUTIITAPE,NSPACE,XI,XNAM1,XFMT1,IL01,IHI1,X2.XNAMZ+ XFMT2,IL02,IHI2, ••• ,XN,XNAMN,XFMTN,ILON.IHINI VSOUT SXD VSOUT-2,4 1,4 AI ITAPE) CLA SJA TSX1 CLA 2,4 AINSPACEI STA TSX2 TXI .. START LOOP A(XK) K=I,2, ••• 1,4 CAL CAL TSX3 STA AMASK ANA TS)(l LAS TRA "+2 TRA CLA .. EXIT AT END OF GROUPS OF 5 TRA 1,4 .. COMPLETE THE CALLING SEQUENCE 2,4 AIXNAMKI CLA CLA TSX4 STA 3,4 A(XFMTK) CLA STA T5X5 A( ILOK) 4,4 CLA T5)(6 STA A( IHIK) 5,4 CLA STA T5X7 .. GO OPERATE VOUT 5VXR4,4 SXA $VOUT,4 TSX ...=AI ITAPE) TSX1 TSX **.0 ..... ,0 .... =A(N5PACE) TSX2 TSX .... =A(XKI K=I,2, ••• TSX3 TSX * • .,0 .... =AIXNAMK) TSX4 TSX **,0 .... =A(XFMTKI TSX5 TSX **,0 ,,"=AI ILOK I TSX6 TSX *"',0 ...=A( IHIKI TSX7 TSX **,0 SVXR4 AXT **,4 CAL,4,-5 TXI .. CONSTANTS 777777700000 AMASK OCT 0,0 TSXZ TSX END . .. •••••••••••••••••••••••• (PAGE 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 2) •••••••••••••••••••••••• .......................... • VTIMSV • PROGRAM 1I STI NGS , ' LAST CARD IN DECK IS NO. 0111 0001 0002 100 0003 VTlMSV 0004 VTIMSV I X. Y,LXY,XTIMSY) 0005 XVTMSV IIX.IY.LXY.IXTMSY) 0006 0007 ~---ABSTRACT---0008 0009 TITLE - VTIMSV WITN SECONDARY ENTRY XVTMSV 0010 MULTIPLY ELEMENTS OF TWO VECTORS FIXED OR FLOATING 0011 0012 VTIMSV MULTIPLIES ELEMENTS OF TWO FLOATING VECTORS 0013 XVTMSV MULTIPLIES ELEMENTS OF TWO FIXED VECTORS 0014 0015 OUTPUT MAY REPLACE EITHER INPUT VECTOR 0016 0017 LANGUAGE - FAP SU8ROUTINES CFORTRAN-II COMPATIBLE) 0018 EQUIPMENT - 709 OR 7090 CMAIN FRAME ONLY) 0019 STORAGE - 34 REGISTERS 0020 7090 709 0021 SPEED VTIMSV 41 + (19.0 OR 22.2).LXY MAClHNE CYCLES~ 0022 XVTMSV 43 + 120.6 OR 24.B).LXY LXY • VE¢TOR LENGTH 0023 S.M. SIMPSON, AUGUST 1963 0024 AUTHOR 0025 0026 ---USAGE-"0021 0028 TRANSFER VECTOR CONTAINS ROUTINES - (NONE) AND FORTRAN SYSTEM ROUTINES - INONE) 0029 0030 0031 FORTRAN USAGE CALL VTIMSV( X, Y,LXY,XTIMSY) 0032 CALL XVTMSV(IX,IY,LXY,IXTMSYI 0033 0034 0035 INPUTS 0036 XII) I-I ••• lXY IS A FLOATING PT VECTOR 0031 YII) I-l ••• LXY IS A FLOATING PT VECTOR 0038 0039 LXY SHOULD EXCEED ZERO 0040 0041 I XII) l-l ••• LXY IS A FIXED VECTOR, FORTRAN-II INTEGERS 0042 IYU) I-l ••• LXY IS A FIXEO VECTOR. FORTRAN-II INTEGIRS 0043 0044 STRAIGHT RETURN WITH NO OUTPUT IF LXY LSTHN 0045 OUTPUTS 0046 XTIMSY I-l ••• LXY IS XTIMSYII) = XII) * YII) 0047 IXTMSY I-l ••• LXY IS IXTMSYII) = IXII) * IYII) 0048 0049 DANGER OF FIXEO POINT OVERFLOW IS NOT TESTED FOR BY 0050 XVTMSV. 0051 0052 EQUIVALENCE (XTIMSY, X OR YI, IIXTMSY, IX OR IVI IS 0053 PERMITfEO. 0054 0055 0056 EXAMPLES 0051 0058 1. INPUTS - XII••• 3) - 1.,2.,3. Yll ••• 3). 2 •• 4.,6. 0059 IX~1~.~3) - 1.2,3 IYll ••• 3) = 2.4.6 Z-O.O 0060 USAGE CALL VTIMSV I X, Y,3,X11 0061 CALL XVTMSV IIX,IY.3,IX1I 0062 CALL VTIMSV I X, Y,3, YI 0063 CALL XVTMSV (IX,IY,l,IX) 0064 CALL VTIMSV I X, Y,O, ZI OUTPUTS - Xl 11 ••• 3) 2.,8.,18. IXlI1 ••• 3) 2,8,18 0065 0066 Y 11 ••• 3) 2.,8.,18. IX(1) = 2 0067 Z * 0.0 INO OUTPUT CASE) 0068 0069 PROGRAM FOLLOWS BELOW 0070 0071 NO TRANSFER VECTOR HTR 0 XR4 0072 BCI 1,VTlMSV 0073 0074 PRINCIPAL ENTRY. VTIMSVIX,Y,LXY,XTIMSYI • VTlMSV • FAP .VTJMSV COUNT LBL ENTRY ENTRY • • • • • • • • • • • • • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • • • • • • • • •• • • • (SUBROUTINE) •••••••••••••••••••••••• • VTIMSV • •••••••••••••••••••••••• 9/29/64 ·* •••••• *******.*.*****. ..•••••••• VTIMSV *** ••••••••• ** ••" IPAGE ••• , ••••••••••• *** •••• ** PROGRAM LISTINGS • 2) VTIMSV ClA FMP NOP lDO SETUP STO MlPlY VARY STO VTIMSV-2,4 SXD Kl CLA 1;4 AIX)+l ADD Kl STA GET 2,4 ClA ADD Kl AIY)+! STA MlPlY 4,4 ClA AIXTIMSy)+l ADD Kl STA STORE 3,4 ClA* LXV TMI lEAVE 0,4 POX TXl lEAIIE,4,0 * MULTIPLICATION lOOP GET "*:AIX)+l lDO *·,4 :FMP ··,4 OR MPY MLPlY NOP :NOP OR AlS 17 VARY NOP STORE STO **,4 "*:AIXTIMSYI+! TIX GET,4,1 * EXIT LEAVE lXO VTIMSV-2,4 TRA 5,4 .. SECOND ENTRY XVTMS,IIX,IY,LXY,IXTMSYJ XVTMSV CLA MPY lOO AlS TRA SETUP " CONSTANTS FMP FMP *.,4 NOP NOP MPY MPY **.4 17 AlS AlS END YTIMSY " •••••••••••••••••••••••• IPAGE 21 •• ,4 ",,:AIYHI 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 00119 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 OlIO 0111 .......... .................. ..... WAC ...................... ' PROGRAM LI STINGS • WAC (SUBROUTINE» LABEL ........................... .. , ' .......,.................... WAC LAST CARO IN DECK IS NO. 0082 0001 CWAC 0002 SUBROUTINE WAC tLV,V,LA,AI 0003 C 0004 C ----ABSTRACT---0005 C 0006 C TITLE - WAC 0007 C WIENER AUTOCORRELATION OOOB C 0009 C WAC FINDS THE AUTOCORRELATION, A, OF AN ARBITRARV NUMBER 0010 C OF LAGS. LA, FOR A SERIES, V, OF LENGTH, LV 0011 C 0012 C LV 0013 C All) SUM YIJI*YIJ+I-1) 1=1,2 ••••• LA 0014 C J=l 0015 C 0016 C WHERE WE ASSUME V TO BE ZERO OUTSIDE THE RANGE fOR 0017 C WHICH IT IS SPECIFIED. 0018 C 0019 C LANGUAGE - FORTRAN SUBROUTINE 0020 C EQUIPMENT - 709 OR 7090 0021 C STORAGE - 107 REGISTERS 0022 C SPEED 0023 C AUTHOR - J.F. CLAERBOUT 0024 C 0025 C ----USAGE---0026 C 0027 C TRANSFER VECTOR CONTAINS ROUTINES - NONE 0028 C ANO FORTRAN SVSTEM ROUTINES - NONE 0029 C 0030 C FORTRAN USAGE 0031 CAll WAC fLV,V,LA.AI C 0032 C 0033 C INPUTS 0034 VII) C I=l ••• LV IS THE SERIES TO BE AUTOCORRELATED. 0035 C MUST BE FLOATING POINT. 0036 C 0037 LV IS FORTRAN INTEGER C 0038 MUST BE GRTHN=l. C 0039 C 0040 LA C IS LENGTH OF THE DESIRED AUTOCORRELATION. 0041 C IS FORTRAN INTEGER 0042 MUST BE GRTHN=l. 004.3 C C MAV BE GRTHN LV. 0044 C 0045 C OUTPUTS 0046 AlII I-l ••• LA IS THE AUTOCORRELATION. 0047 C All) AUTOCORRELATION AT ZERO LAG. C 0048 C AlII - O. FOR I GRTHN LV. 0049 C 0050 C EXAMPLES 0051 C 0052 C 1. INPUTS - LV = 3 Vli ••• 3) 1.,2.,3. LA 0053 C 0054 OUTPUTS - All) C 14. 0055 C 0056 C 2. INPUTS - SAME AS EXAMPLE 1. EXCEPT LA 3 0057 C 0058 C OUTPUTS - AIl ••• 3) - 14., 8., 3. 0059 C 0060 C 3. INPUTS - SAME AS EXAMPLE 1. EXCEPT LA - 5 0061 C 0062 C OUTPUTS - AII ••• S) = 14., 8., 3., 0., O. 0063 C 0064 DIMENSION YII00},AII001 0065 MM=XMINOF IlV,LA) 0066 DO 20 l=l,MM 0067 AII)=O. 0068 L=LV-I+1 0069 DO 10 J=l,L 0070 K=J+I 0071 AIII=AIII+YfJJ*YIK-11 0072 10 CONTINUE 0073 20 CONTI NUE 0074 it 9/29/64 .. ••••••••••• ** ••••• **** •• PROGRAM LISTINGS "••• ** WAC •••• ** •• *** •• **** ••" (PAGE 2) C 30 40 50 If (LA GRTHN LY), WE MUST fILL SOME ZEROS IN A If ILA-LY) 50,50,30 NP = LY+1 DO 40 I=NP,LA ACI)=O. CONTINUE RETURN END ••••••••••••• f •••• ** •••• " WAC " ••• ~ •••• *••• * ••• **.*.*.* (PAGE 0075 0076 0077 0078 0079 0080 0081 0082 21 • •••••••••••• * •••••••••• WHERE * • •••••••••••••••••••••••• REFER TO LOCATE PROGRAM LISTINGS ••••••••••••• , ••• ** ••••• WHERE * * •REFER ••••••••••••••••••••••• TO LOCATE ........,................... • WHICH PROGRAM 1I STINGS • •••• *••••••••••••••••••• •••••••••••••••••••••••• • •.WHICH ••••••••••••••••••••••••* "WHICH WHICH (FUNCTIONS) FAP LAST CARD IN DECK IS NO. 0076 0001 0002 COUNT 100 C003 WHICH 0004 LBL WHICH Fe Xl, X2,ZIFXl) ENTRY 0005 ENTRY XWHICH FIIXl,IX2,lIFIXI) 0006 0007 • 0008 • ----ABSTRACT---0009 • 0010 • • TITLE - WHICH, WITH SECONDARY ENTRY XWHICH 0011 • CHOOSE BETWEIN TWO VARIABLES BY A THIRD ONE BEING ZERO 0012 0013 • 0014 WHICH IS A FUNCTION WITH VALUE EQUAL TO ITS FIRST • ARGUMENT IF ITS THIRO ARGUMENT IS ZERO IN MAGNITUDE. 0015 • 0016 OTHERWISE WHICH HAS VALUE EQUAL TO ITS SECOND ARGUMENT. • 0017 • XWHICH IS THE FIXED POINT NAME FOR WHICH. 0018 • 0019 • FAP FUNCTIONS IFORTRAN II COMPATIBLE) 0020 • LANGUAGE 0021 • EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) - 4 REGISTERS 0022 • STORAGE - 5 TO 7 MACHINE CYCLES 0023 • SPEED - S.M. SIMPSON, APRIL 1964 0024 • AUTHOR 0025 • 0026 • ·--USAGE---0027 • 0028 •• TRANSFER VECTOR CONTAINS ROUTINES - (NOT ANYI 0029 • AND FORTRAN SYSTEM ROUTINES - (NOT ANY) 0030 0031 •• FORTRAN USAGE 0032 0033 • X = WHICHFI Xl, X2,lIFXll • IX=XWHICHFIIXl,lX2,lIFIXII 0034 0035 • 0036 • 0037 • INPUTS 0038 * XI.X2 ARE FLOATING POINT. 0039 • 0040 • IXl.IX2, ARE FIXED POINT. 0041 • 0042 • lIFXl 0043 =0. IF Xl IS TO BE CHOSEN. * NOlaO. IF X2 IS TO BE CHOSEN. 0044 • 0045 • lIFIXl =0 IF IXI IS TO BE CHOSEN. 0046 • 0047 NOt=O IF IX2 IS TO BE CHOSEN. • 0048 • 0049 • 0050 • OUTPUTS 0051 • X OR IX IS SET AS DESCRIBED IN ABSTRACT. 0052 • 0053 • 0054 •• EXAMPLES 0055 0056 • 0057 • 1. USAGES XA WHICHFIl.,2.,O.) 0058 • XB = WHICHFIl.,2 •• l.) 0059 • XC = WHICHFll.,2.,-137) 0060 • IXA '" XWHICHFIl,2,-0) 0061 • IXB = XWHICHFIl,2,-.00011 0062 • IXC = XWHICHFll,2,36) 0063 OUTPUTS - XA = 1.0 XB = 2.0 XC '" 2.0 • 0064 • IXA '" 1 IXB = 2 txC = 2 0065 • 0066 • 0067 • PROGRAM FOLLOWS BELOW 0068 • 0069 • NO TRANSFER VECTOR 0070 • I,WHICH 0071 BCI WHICH BSS 0072 o 77775 OCTAL 0073 XWHICH lET 32765 XCA 0074 9/4/64 = ••••••••••••••••••• **.** WHICH •••••••••••• • * ••••• ***.*** (PAGE 2) PROGRAM LISTINGS •••••••••••••• *** ••••••• WHICH * .* •••••••••••••• * ••••••• • (PAGE TRA END 0075 0076 21 ••• ** •••••••• ***.******* WLLSFP • • PROGRAM LISTINGS •••••••••••••• **** ••• *** • WLLSFP {SUBROUTINEl 10/6/64 • LABEL CWllSFP SUBROUTINE WLLSFP {LR.R.G,LA,A.CI 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 C C C C C C C C •••••••••••••••••••••••• • WLLSFP • •••••••••••••••••••••••• LAST CARD IN DiCK IS NO. 0263 0001 0002 0003 0004 ----ABSTRACT---0005 0006 TITLE - WLLSFP 0001 OOOB' WIENER-LEVINSON LEAST SQUARE ERROR FILTER OR PREDICTOR 0009 WLLSFP FINDS SOLUTIONS FOR A CLASS OF SIMULTANEOUS 0010 EQUATIONS WHICH ARISE IN MANY LEAST SQUARE ERROR FILTERING 0011 AND PREDICTION PROBLEMS. SPECIFICALLY IT SOLVES THE 0012 FOLLOWING EQUATIONS FOR AAIII. I=O.I •••• ,M 0013 0014 M 0015 SU~ {AAINl.RRIK-Nl} = GGIK} 0016 K=O.l ...... M 0011 0018 0019 GIVEN ANY RIGHT HAND SIDE GGIIl. 1=0.1 ••••• " AND GIVEN ANY VECTOR RR{I), I=O,I, ••• ,M.M+l 0020 WHICH IS SYMMETRIC IRRIII = RR{-ll) 0021 AND FOR WHICH THE (M+ll*IM+l) TDEPLITZ MATRIX 0022 0023 RRIK-N) K=O.l •••• ,M N-=O,l, ••• ,M 0024 IS POSItIVE DEFINITE. 0025 0026 IN TIME SERIES PROBLEMS AAIII IS A SET OF OPTIM~M FILTER 0021 COEFFICIENTS. RRII) IS AN AUTOCCRRELATION FUNCTION OR A 002B SUM OF AUTOCORRELATION FUNCTIONS, AND GGII) IS A CROSS0029 0030 CORRELATION (OF INPUT WITH DESIRED OUTPUT). 0031 A SOLUTION IS ACCOMPLISHED BY A RECURSIVE PROCE5S GIVEN 0032 0033 BY N. LEVINSON IN APPENOIX B OF THE BOOK WIENER. N., 1949, EXTRAPOLATION, INTERPOLATION, AND 0034 SMOOTHING OF STATIONARY TIME SERIES, JOHN WILEY AND 0035 SONS. INC., NEW YORK, PP 129-139. 0036 0031 0038 AN ADOITIONAL OUTPUT OF WLLSFP IS AN AUXILIARY SEQUENCE 0039 CCIII, I=O.I, ••• ,M (DEFINED BY LEVINSON PAGE 131. EQUATIONS 17, 181. IT IS IN THE COMPUTATION OF CC THAT 0040 THE EXTRA VALUE OF RR II.E. RR(M+lll IS REQUIRED. 0041 THE SOLUTION FOR AA IS UNAFFECTEO BY THE CHOICE OF RIM+l1. 0042 HOWEVER IF THE IM+2)-IM+21 MATRIX RIK-N) IK,N:O_l, •• ~,M+l' 0043 IS ALSO POSITIVE DEFINITE, THEN CC HAS AN IMPORTANT 0044 0045 INTERPRETATION. IN THIS CASE CC IS THE TIME REVERSE OF 004& THE M+l TERM LEAST SQUARES UNIT-PREDICTION-DISTANCE 0047 OPERATOR FOR ANY TIME SERIES WHOSE AUTOCORRELATION 0048 FUNCTION (THRU LAG M+l) EQUALS RRIO.l,.~.,M~I). 0049 0050 WLLSFP PROVIDES A REENTRY OPTION ALLOWING EFFICIENT 0051 RECURSION TO LARGER EQUATION SETS. 0052 0053 LANGUAGE - FORTRAN II 0054 EQUIPMENT - 109 OR 7090 IMAIN FRAME ONL YI 0055 STORAGE - 216 REGISTERS 0056 SPEED - ABOUT 60(~*.2l MACHINE CYCLES 0051 WHERE M IS THE LENGTH OF THE A-VECTOR. 0058 AUTHOR - R.A. WIGGINS, 9/28/62 0059 0060 ----USAGE---0061 0062 TRANSFER VECTOR CONTAINS ROUTINES FDOTR, FOOT. MOVE 0063 AND FORTRAN SYSTEM ROUTINES NONE 0064 0065 FORTRAN USAGE 0066 CALL WLLSFP ILR,R,G.LA.A.C) 0061 0068 INPUTS 0069 0070 I=l ••• LR.LR+l CONTAINS THE VECTOR RR(O,I, ••• ,LRI RI II 0071 G (I) 0072 I=l ••• lR CONTAINS GG(O,l, ••• ,LR-ll 0013 *** •••••,.......... *.***** ••• PROGRAM LI STINGS WLLSFP • * •••••••••• **** •••• *** •• IPAGE 21 • C •••••••••••••••••••••••• • WLLSFP IPAGE LR IS FORTRAN II INTEGER, GRTHN=2. LA MUST LIE IN THE RANGE 2, ••• ,LR OR -2, ••• ,-LR+I IF LA GRTHN=2, LA STANDS FOR THE DESIRED LENGTH OF THE FILTER, I.E. LA=M+I IF LA LSTHN=-2, WLLSFP ASSUMES THAT THIS 15 A REENTRY CALL AND THAT THE USER WISHES TO EXTEND THE PREVIOUS FILTER WHOSE LENGTH WAS = MAGNITUDE (LAI TO A NEW FILTER OF GREATER LENGTH = LR, I.E. THE NEW M=LR-I. IN THIS CASE AII ••• LLA) AND CII ••• LLA) WHERE LLA ~ MAGNITUDE ILAI MUST NOT HAVE BEEN DISTURBED FOLLOWING THE PREVIOUS CALL. IS FORTRAN II INTEGER CIII I=1 ••• 2*LR IS ERASABLE COMPUTATION SPACE NEEDED BY WlLSFP C C C C C C C C C C C C C C C C OUTPUTS C C IS SET EQUAL TO LENGTH OF A, SEE INPUT. IS FORTRAN INTEGER LA C C C AliI l=l ••• LA CONTAINS THE SOLUTION VECTOR AAIO.1, ••• ,M=LA-11 C C C ClIl i=I ••• LA WILL CONTAIN THE LEVINSON AUXILIARY SEQUENCE CC(O,I, ••• ,LA-l=M) C C EXAMPLES C C C 1. INPUTS - LR = 3 LA = 2 Rll ••• 3) = 1.25,0.5,0. Gll ••• 31 = 1.,0.,0. OUTPUTS - AII ••• 2} = 0.95238, -0.38095 lA=2 C C C 2. INPUTS - SAME AS EXAMPLE 1. IAFTER EXAMPLE 1. IS COMPUTID) EXCEPT LA = -2 C OUTPUTS - AII ••• 31 0.98824, -0.47059, 0.18824 LA = 3 C = C 3. EXAMPLE DF USE OF WLLSFP TO CONSTRUCT A LEAST SQUARE REALIZABLE FILTER WHICH, WHEN CONVOLVED WITH A SPECIFIED SIGNAL, WILL RESULT C IN A DESIRED D~TPUT SIGNAL IUSING SU8ROUTINES QACORR AND QXCORR). C C C C INPUTS C C C - LET 51), I=I,LS BE THE INPUT SIGNAL OIl), I=l,LS BE THE DESIRED OUTPUT USAGE - C C C C C C C C C C C FORM THE AUTOCORRELATION OF THE SIGNAL CALL QACORR IS,LS,MXACC,LA,SPACE,R,IANSIJ C C C C C C C C C C C C C FORM THE CROSSCORRELATION OF THE DESIRED OUTPUT WITH THE SIGNAL. NOTE THAT ONL Y HAL F OF THE CROSSCORRELATION FORMED BY QXCORR IS NEEDED BY WLLSFP. CALL QXCORR IS,D,LS,MXACC,LA,SPACE,G;IANS2J FORM THE OESIREO FILTER CALL WLLSFP IlA,R,G(LA+l),LA,A~SPACE) C C OUTPUTS - All), l=l,LA IS THE DESIRED FILTER. C C C 4. EXAMPLE OF USE OF WlLSFP TO CONSTRUCT A LEAST SQUARE REALIZABLE C C C C C FILTER WHICH, WHEN CONVOLVED WITH A SIGNAL PLUS NOISE, WILL RESULT IN THE NOISE BEING SUPRESSED AND THE SIGNAL SHAPE BEING CHANGED TO A DESIRED OUTPUT. INPUTS - LET USAGE - C C C C C C C C C • • ••••••••••••••• ** •• * ••• SII), I=l,LS BE THE INPUT SIGNAL XNII), l=l,lN BE A SAMPLE OF THE NOISE DIll, I=l,LS BE THE DESIRED OUTPUT FORM THE AUTDCORRELATION VECTOR R. C CALL QACORR IS,LS,MXACC,LA,SPACE,AUTOS,IANSIJ CALL QACORR (XN,LN,MXACC,LA,SPACE,AUTON,lANS2' DO 10 I=l,LA DD74 0075 0076 D077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 D089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 010B 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 2) •••••••••••••••••••••••• WLLSFP * ••••••••••••••••••••••••* IPAGE PROGRAM LI STINGS 10 C C C C C C I PAGE RII) = AUTOSII)+AUTONCI) FORM THE CROSSCORRELATION VECTOR G. (SEE CO"MENT IN EXAMPLE 3.1 C CALL QXCORR IS,D.LS,MXACC,LA,SPACE,G.IANS3) C~ C C C C C C C C FORM THE DESIRED FILTER CALL WLlSFP IlA,R,GILA+1),LA,A,SPACEJ OUTPUTS - All), l=l,LA IS THE DESIRED FILTER. C C C 5. EXAMPLE OF USE OF WLLSFP TO FORM A LEAST-SQUARE PREDICTION FILTER. C C C C C INPUTS - LET SII), I=l,LS BE A SIGNAL WAVELET NP BE THE PREDICTION DISTANCE USAGE - C C FORM THE AUTOCORRELATION VECTOR R. C MXLAG=LA+NP-1 CALL QACORR IS,lS,MXACC,MXlAG,SPACE,R.IANS1) C C C C C C C C C C C FORM THE PREDICTION ERROR FILTER WITH PREDICTION DISTANCE NP=l. IG=NP+1 CALL WLLSFP ILA,R,RIIG),LA,A,SPACE) C C C C C OUTPUTS - All), I=l,LA IS THE DESIRED FILTER. C C 6. EXAMPLE OF USE OF WLLSFP TO FACTOR A TIME SERIES, T~AT IS, TO FIN[ THE LEAST SQUARE MINIMUM PHASE WAVELET ASSOCIATED WITH C A SERIES. C C C C C C C C C INPUTS - lET USAGE - C C XU) , I=l,LX BE THE SERIES TO BE FACTORED. FORM THE AUTOCORRELATION VECTOR R. CALL QACORR IX,LX,MXACC,LA,SPACE,R,IANS1J C C C C C C 10 C C C C C C C C C C C C C C C C C FORM THE CROSSCORRELATION VECTOR G. Gill = 1. DC 10 I=2.LA Gill = o. FORM THE PREDICTION ERROR FILTER LA. CALL WLLSFP ILA,R,G,LA,A,SPACEI FORI' THE MINIMUM PHASE WAVELET XMW. CALL POLYDV ILA,A,l,l.,LXMW,XMWI OUTPUTS - XMWIII. I=l,LXMW IS THE MINIMUM PHASE WAVELET. All), l=l,lA IS THE PREDICTION ERROR FILTER WITH PREDICTION D1STANCE 1. C C C C C PROGRAM FOLLOWS BELOW. C C DIMENSION Rrl01~G(10I,AII0I,C(20) C C REDEFINE INPUT CCNSTANTS WHICH ARE USED A LOT LRl=LR N=2 lAl=LA Rl=Rlll C C 10 * WLLSFP •••••••••••••••••••••••• 31 C C •••••••••••••••••••••••• • SET UP THE MCCE OF OPERATION DEFINED BY lA IFllAll "10,220,30 N=XA8SF(lA1)+1 0149 0150 0151 0152 0153 0154 0155 0156 0157 015B 01.59 0160 0161 0162 0163 0164 0165 0166 0167 016B 0169 0170 0171 0172 0173 0174 0175 0176 0177 017B 0179 0180 01Bl 01B2 01B3 01B4 0185 01B6 0187 0188 01B9 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 OllO 0221 0222 0223 3) ••••••••••••••• * ••• *.-.. .• -._ ...... _.... _... __ .•.• WLLSFP (PAGE PROGRAM LISTINGS 4) GO TO 15 LRl=LAl C C 40 SET UP INITIAL VALUES OF C, A, AND E. A(l)=G(l)/Rl C(1l=RIZ1/Rl LR2=LRl+l 15 C C DO THE RECURSIONS C····· 00 Ml c C 1 • 100 C C C 2 C 150 C 200 M=N,LRI M-l FORM THE NEXT A(iKl VECTOR CALL FDOTR (Ml,A,RI2),C2) CALL FDOTR 1"1,C,RIZI,C31 A(M)=(GIMI-C2)/IRI-C31 DO 100 K=l,Ml AIKI=A(K)-CIK)*A(M) * FORM THE NEXT C VECTOR CALL FOOT IMl,C,RI21,C2) CILR21 = IRfM+IJ-C2)/IRI-C3) * 00 150 K=2,M Kl=M-K K2=K+LRl CIK21=CIK-II-CILR21*C(KI+1) * CALL MOVE IM,CILR21,CI C 200 CONTINUE C··_·. C C 210 220 WLLSFP • • ••••••••••••• *** •• ** ••• (PAGE 30 C •• _••••••••••••• ** •••• * • • SET OUTPUT PARAMETERS LA=Ml+1 RETURN END 0224 0225 0226 0221 0228 0229 0230 0231 0232 0233 0234 0235 0236 0231 0238 0239 0240 0241 0242 0243 0244 0245 0246 0241 0248 0249 0250 0251 0252 0253 0254 0255 0256 OZ51 0258 0259 0260 0261 0262 0263 4) •••••••••••••••••••••••• .. WRTDAT PROGRAM LI STINGS .. •••••••••••••••••••••••• • ••••••••••••••• * ••••••• .. WRTDAT LAST CARD IN DeCK IS NO. 0125 0001 0002 0003 0004 0005 0006 0007 ----ABSTRACT---• OOOB 0009 .. TITLE - WRTDAT .. WRITE BINARY DATA ON TAPE 0010 0011 0012 WRTDAT WRITES A BINARY RECORD FROM A FORTRAN VECTOR ON A 0013 SPECIFIEO OUTPUT TAPE. ERROR RETURNS INDICATE IF A 0014 REDUNDANCY OR ENO-TAPE CONDITION WAS FOUNO. NO SUM-CHECK 0015 I S PROVIDED. 0016 0017 .. LANGUAGE - FAP SUBROUTINE (FORTRAN II COMPATIBLE) 0018 • EQUIPMENT - 709, 7590, 7094 (MAIN FRAME AND TAPE UNIT) 0019 .. STORAGE - 77 REGISTERS (PRIMARILY CONTROLLED BY DATA-CHANNEL TIMING) 0020 • SPEEO .. AUTHOR 0021 - R.A. WIGGINS JULY. 1964 0022 0023 ----USAGE-0024 0025 .. TRANSFER VECTOR CONTAINS ROUTINES - INOT ANY) 0026 .. AND FORTRAN SYSTEM ROUTINES - (lOS). (TCOI. (WRS). (RCHl. ITRCJ. 0027 .. (ETTI 0028 0029 .. FORTRAN USAGE 0030 .. CALL WRTDAT (ITAPE.DATA.LDATA.IANS) 0031 0032 .. INPUTS .. !TAPE 0033 LOGICAL OUTPUT TAPE NUMBER. 0034 MUST BE bRTHN= 1. LSTHN: 20 0035 0036 DATA( J) I:l •••• ,LDATA IS A DATA VECTOR lIN ANY MODE) TO BE • 0037 WRITTEN. 0038 • 0039 LDATA LENGTH OF DATA VECTOR. 0040 MUST BE GRTHN: 1 • 0041 0042 .. OUTPUTS 0043 0044 :0 IF All OK • IANS 0045 :2 IF A REDUNDANCY IS ENCOUNTERED • 0046 :3 IF AN END-TAPE MARK IS ENCOUNTERED. 0041 =-1 IF ITAPE LSTHN 1 OR GRTHN 20 0048 =-2 IF LoATA LSTHN 1 0049 •.. EXAMPLE 0050 0051 0052 • 1. CONSTRUCTION OF A FORTRAN STYLE BINARY RECORD 0053 .. INPUTS - ITAPE : 5 OATA(I ••• 31 = OCT 000002000001. 123.56113456. 0054 .. 654321654321 lDATA = 3 0055 USAGE CAll WRTDAT IITAPE.DATA.loATA.IANSl .. 0056 • BACKSPACE ITAPE 0057 .. READ TAPE ITAPE. (DATINII).1=1.2) 0058 .. OUTPUTS - IANS = 0 OATINll ••• 2) = OCT 123456123456. 654321654321 0059 0060 .. PROGRAM FOLLOWS BELOW 0061 0062 XR4 HTR 0 0063 BCI 1.WRTDAT 0064 XR4,4 WRTDAT SXo 0065 SXA XRl.l 0066 SXA XR2.2 0061 CLA. 3.4 0068 IANM2 HE 0069 TMI IANM2 0070 POX ,1 0071 CAL 2.4 0072 STA UT 0073 lDQ =20B17 0074 ClA. 1.4 .. WRTDAT (SUBROUTINE) 9/8/64 .. FAP .WRTDAT COUNT 100 WRTOAT LBL WRTOAT (ITAPE,DATA,LDATA,IANSI ENTRY . .. ... .... ... . . .. .. .. • . .... ... . . . .. • •••••••••••••••••••••••• **** ••••• * •••• ** •• *** ••• * WRTDAT * •••••••••••••••••••••••• (PAGE 2) TlE TMI TLQ ADD TSX lXD lDQ* SlQ SlQ lDQ* STQ lDQ* SLQ XCl ADD XCL SLQ LDQ* SlQ lDQ* SlQ TCOA TCOA WRSA WTDA RCHA RCHA TRA LCHA lCHA INC CAL SU8 SLW TIX TCOAI TCOA TRCA TRCA ETTA ETTA TRA lOT NOP CLA RETURN STOAXT XRl AXT XR2 TRA IANM1 CLS TRA IANM2 ClS TRA IAN2 CLA TRA IAN3 CLA TRA UT IOC T END PROGRAM LISTINGS f** ••••••••••••••••••••• * \lRTDAT ••.•.•....••..•... -...... (PAGE IANMl IANMl IANMI =020 $(IOSI.4 XR4.4 $ITCO) TCOA TCOAI $(WRS) WRSA $(1l.CH) RCHA =0000400000000 lCHA $ITRC) TRCA $( ETT) ETTA * ** UT INC UT UT =1835 UT LCHA,l.l *IAN2 IAN3 =0 4.4 **;L **,2 5,4 =1817 RETURN =2B17 RETURN =2817 RETURN =3B17 RETURN **ttl 0075 0076 0071 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 21 ..•• ** ••••• XACTEQ ** ••••••••• ** •• . PROGRAM LISTINGS .. XACTEQ I FUNCTION) .. FAP .XACTEQ COUNT 50 LBL XACTEQ XACTEQ FIX,YI ENTRY -• ....................... .. XACTEQ • • ••• *••• * •••• -~ ••• * ••••• ••••••••• ***.****.** •••• LAST CARD IN DECK IS NO. 0015 0001 0002 0003 0004 0005 0006 It 0007 ----ABSTRACT---0008 It 0009 .. TITlE - XACTEQ 0010 .. SIGN OF DIFFERENCE OF 2 VARIABLES OR 0 IF SAME INCLUDING SIGN 0011 0012 XACTEQ TAKES THE DIFFERENCE BETWEEN TWO VARIABLES OF ANY 0013 MODE AND RETURNS -lOR +1 AS THE SIGN OF THE DIFFERENCE, 0014 OR +0 IF THE TWO VARIABLES ARE EXACTLY EQUAL, INCLUDING 0015 SIGNS. (+0 [S CONSIDERED GREATER THAN -0) 0016 0011 .. LANGUAGE - FAP FUNCTION (FDRTRAN-[I COMPATIBLE) 0018 .. EQUIPMENT - 109 OR 1090 IMAIN FRAME ONLY) 0019 .. STORAGE - 11 REGISTERS 0020 .. SPEED - 6 OR 10 MACHINE CYCLES 0021 .. AUTHOR - S.M.SIMPSON,JR. APRIL 1964 0022 0023 0024 ----USAGE---0025 0026 .. TRANSFER VECTOR CONTAINS ROUTINES - (NOT ANY) 0021 .. AND FORTRAN SYSTEM ROUTINES - (NOT ANY) 0028 It 0029 .. FORTRAN USAGE 0030 .. IXMY=XACTEQF(X,Y) 0031 It 0032 0033 .. INPUTS 0034 0035 X IS ANY MODE. 0036 0031 It Y IS ANY MODE. 0038 0039 It 0040 OUTPUTS 0041 0042 It IXMY o IF B[TS 5,1 ••• 35 OF X ARE EXACTLY IDENTICAL TO 0043 B[TS S,I ••• 35 OF Y• 0044 +1 IF X IS GREATER THAN Y• 0045 -1 [F X [5 LESS THAN Y• 0046 0041 0048 .. EXAMPLES 0049 0050 .. 1. [NPUTS - XII ••• 5) = 1.,0.,-0.,0.,0. IX{I ••• 5) 110,-0,0,0 0051 It Y(I ••• 5) = 0.,-0.,0.,0.,1. [Yll ••• 5) 0,-0,0,0,1 0052 It USAGE DO 10 1=1,5 0053 .. IXMY1(I)=XACTEQF(XIII,V([)} 0054 It 10 IXMV2( [)=XACTEQF{[X( [),IVlI» 0055 .. OUTPUTS - IXMYl(1 ••• 5) +1, +1, -1, 0, -1 0056 .. IXMY211 ••• 5) = +1, +1, -1, 0, -1 0051 It 0058 0059 0060 .. PROGRAM FOLLOWS BELOW. 0061 0062 0063 I,XACTEQ BCI 0064 XACTEQ TLQ ABIGRQ 0065 XCA 0066 TLQ QBIGRA 0061 PXD 0,0 0068 TRA 1,4 0069 ABIGRQ CLA KDl 0070 TRA 1,4 0011 QBIGRA CLS KDl 0012 1,4 TRA 0013 0,0,1 KDl PZE 0074 END 0015 . . • • •.. .. • .... ... . .... . ... .... .. .. . .... ... 9/4/64 *.**** •••••• *.* . ..•• ** ••••• XAODK * ••• *****.************** REFER TO ADDK PROGRAM LISTINGS . .. ***.***************** •• * XADDK .*********************** REFER TO ADDK ..* •• ********************* XAODKS •• .*****************.*.** . XADDKS * •• ****.**************** ********.*************** REFER TO AODK ..•• *••••• XARG .. • ** ••••••••••••••• * ••••• *.*.*****.****** REFER TO LOCATE REFER TO ADOK _._.**** ••• XARG .. *.*._.*.* •• * • • ••••••••••••••••• **.** • REFER TO LOCATE ••••••, ••••• *••••••••• * XAVRGE ~. PROGRAM LI STINGS • •••••••••••••••••••••••• •••••••••••••••••••••••• • XAVRGE (SUBROUTINE) * FAP *XAVRGE COUNT 150 XAVRGE LBL ENTRY XAVRGE (IX,LIX,IXAVG) XAVRGR CIX,LIX,IXAVG) ENTRY •••••••••••••••••••••••• XAVRGE - • 9/29/64 LAST CARD IN BECK IS NO. 0103 0001 0002 0003 0004 0005 0006 0007 • 0008 ----ABSTRACT---• 0009 • 0010 • TITLE - XAVRGE WITH SECONDARY ENTRY XAVRGR 0011 FIND AVERAGE OF FIXED PT VECTOR 0012 * 0013 XAVRGE FINDS THE MEAN, TRUNCATED TO A FORTRAN-II INTEGER, • 0014 OF A GIVEN FXD VECTOR. OVERFLOW CAN NOT OCCUR. • XAVRGR FINDS THE ROUNDED ~EAN. 0015 * 0016 • 0017 - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) • LANGUAGE * EQUIPMENT - 709 OR 7090 CMAIN FRAME ONLY) 0018 0019 - 34 REGISTERS • STORAGE 7090 709 0020 * SPEED XAVRGE BO OR 87 + II-LX MACHINE CYCLES. 0021 • XAVRGR 84 OR 91 + 11-lX LX = VECTOR lENGTH 0022 ** AUTHOR 0023 - S.M. SIMPSON, AUGUST 1963 0024 • 0025 ----USAGE---0026 •** TRANSFER VECTOR CONTAINS ROUTINES - XDIV,XDIVR 0027 0028 AND FORTRAN SYSTEM ROUTINES (NONEI 0029 0030 - FORTRAN USAGE 0031 * CAll XAVRGEeIX,LIX,IXAVG) 0032 CALL XAVRGRlIX,lIX,IXAVG) 0033 0034 ** INPUTS 0035 0036 1=1 ••• LIX IS A FXD VECTOR IXII I • 0037 • 0038 LIX SHOULD EXCEEO ZERO * 0039 ** OUTPUTS 0040 STRAIGHT RETURN WITH NO OUTPUT IF llX lSTHN 1 0041 * 0042 IXAVG Will = 11/lIXl * SUM (FROM 1=1 TO LIX) OF IX'I', • TRUNCATED TO INTEGER (XAVRGE) OR ROUNDER IXAVRGR, 0043 • 0044 * 0045 THE SUMMATION IS CARRIED OUT IN A MANNER WHICH AVOIDS • 0046 OVERflOW * 0047 • 0048 - EXAMPLES 0049 0050 * 1. INPUTS - IXIl ••• 4)=1,2,3,4 0051 IYl1 ••• 4)=90000,91000,92000,93000 0052 • IU*O 0053 • USAGE CALL XAVRGEIIX,4,IXAVl) 0054 • CAll XAVRGRIIX,4,IXAV2) 0055 • CALL XAVRGRIIX(2),3,IXAV3) 0056 * CAll XAVRGEIIY,4,IXAV4) 0057 • CALL XAVRGEIIX,1,IXAV51 0058 • CALL XAVRGEIIX,O,lUI 0059 OUTPUTS - lXAVl=2 IXAV2=3 IXAV3=3 lXAV4=91500 • 0060 lXAV5=1 IU=O INO OUTPUT CASEI 0061 • 0062 • PROGRAM FOLLOWS BELOW 0063 • 0064 • TRANSFER VECTOR HAS XoIV.XDIVR (FUNCTIONS) HTR XRl 006> o 0066 HTR o XR4 0067 1,XAVRGE BCI 0068 * PRINCIPAL ENTRY. XAVRGEIIX,LIX,IXAVGI 0069 XAVRGE CLA OIV C070 SETUP STO VARY 0071 XAVRGE-3,1 SXo 0072 XAVRGE-2,4 SXD 1,4 0073 Kl CLA 0014 AIIX}+l ADD Kl - - - ..................._....... PROGRAM LISTINGS XAVRGE (PAGE 21 STA GET 2.4 LIX CLAARS 18 LEAVE TMI PAX 0,1 TXL lEAVE,l,O XCA SAVE LIX IN MQ it SUM IXIl •••. LIX) IN ADDRESS Of AC S TZ SUM CLA .... ,1 GET ."=A(IX)+l ARS 18 ADD SUM STO SUM TIX GET,h1 it fIND THE AVERAGE ILIX STILL IN MQ ADDRESS) VARY TSX ..... 4 •• =$XDIV OR $XDIVR - STORE AND LEAVE LXD XAVRGE-2,4 STO" 3,4 LEAVE LXD XAVRGE-3,1 TRA 4,4 IXAVG .. SECOND ENTRY. XAVRGR(IX,LIX.IXAVG) XAVRGR CLA DIVR TRA SETUP - CONSTANTS. VARIA8LES DIV TSX $XOIV,4 DIVR TSX $XDIVR,4 SUM PZE *it SUMMATION END ••••••••••••••••• _* ••••• it XAVRGE .. .** ••••••••• *.* ••• ~ •• * •• {PAGE 0015 0076 0011 0078 0019 0080 0081 0082 0083 0084 0085 0086 0081 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 21 ••• ~ •••••* ••••• ** ••••••• • XAVRGR * -_ ....................•. PROGRAM LISTINGS •••••••••••••••••••••••• • XAVRGR •• *••••••••••••••••••• REfeR TO XAVRGE •••••••••••••••••••••••• XBOOST •........................ * REFER TO BOOST ... -..•••...•..••••••... XCMPRA * * •••••••••••••••••••••••• REFER TO CMPRA •••••••••••••••••••••••• XOANl *••••••••••••••••••••••• * REFER TO XAVRGE • ••••••••••••••••••••••• XBOOST .RefER .. _.....•...... _.......* TO * BOOST • ••••••••••••••••••••••• XCMPRA * • •••••••••••••••••••••••* REFER TO CMPRA •••••••••••••••••••••••• ..* -.......... -....... _..* XDANl REFER TO ADANL REFER TO ADANl •••••••••••••••••••••••• XDANX •• * •••••••••••••••••••••• REFER TO ADANl *.***** ••••••• **.*.* •••• •• ***.*XDElTA * ••• * •••• **.*.***.* REFER TO DELTA * ~. • ••••••••••••••••••••••• XDANX • •* •••••••••••••••• * •••• * • REFER TO ADANl ** ••••• *.* •••••• *.* ••••• XDEl TA * ...REFER _....... _...... _.... . TO • DELTA • **.** ••••••••••• ***.*** •••••••••••••••••• ** •••• ***** ••XDFPRS * **** ••• *** •••••••• •••• *** •••••••••••••••• * REFER TO DIFPRS * XDFPRS REFER TO DIFPRS * .•••••••••••••••••••••••• XDIV • . • .. .. ....• •.. •.. .. .. • . •.. •. ... .... • .. .. . .• .. • . •.. •. ... ...• . • ..... . .. •.. . ... ..... .. . .. .. • .... . (FUNCTION) f ••••••• • •• •• •• • XDIV ***··.·..• •••••••••••••••••••••••• LAST CARD IN DECK IS NO. 0108 0001 0002 COUNT 100 0003 LBL XDIV 0004 ENTRY XDIV F(NUMERA,IDENOMl 0005 ENTRY XDIVR FINUMERA,IDENOM) 0006 0007 ----ABSTRACT-0008 0009 TITLE - XDIV WITH SECONDARY ENTRY XDIVR 0010 FXD PT DIVIDE WITH TRUNCATION OR ROUNDING TO FORTRAN-II INTEGER 0011 0012 XDIV IS A FUNCTION WHOSE VALUE IS THE RATIO OF I~S T~O 0013 FIXED feiNT ARGUMENTS, TRUNCATED AS A FORTRAN-II INTEGER • 0014 0015 XDIVR IS IDENTICAL EXCEPT THAT THE RESULT IS ROUNDED4 0016 0017 LANGUAGE - FAP FUNCTIONS (FORTRAN-II COMPATIBLE) 0018 EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0019 STORAGE - 27 REGI STERS 0020 XDIV TAKES 35(7090) OR 42(709) MACHINE CYCLES 0021 SPEED XDIVR TAKES 52(7090) OR 59(109) MACHINE CYCLES 0022 0023 AUTHOR - S.M. SIMPSON, AUGUST 1963 0024 0025 ----USAGE---0026 0027 TRANSFER VECTOR CONTAINS ROUTINES - (NONE) 0028 AND FORTRAN SYSTEM ROUTINES - INONE) 0029 0030 0031 FORTRAN USAGE IQUOT XOIVF (NUMERA,IDENOM) 0032 IQUOT = XDIVRF(NUMERA,IOENOM) 0033 0034 0035 INPUTS 0036 NUMERA IS ANY FXD.PT. NO. 0037 0038 IDENOM 0039 IS ANY NON-ZERO FXD.PT. NO. WITH THE SAME BINARY POINT AS NUMERA • 0040 0041 OUTPUTS - IF IDENOM • 0 PROGRAMS RETURN WITH NO ACTiON (AC AND 0042 MO ARE LEFT AS IS) SO THAT THE EFFECTIVE VALUE OF THE 0043 FUNCTION WILL BE = NUMERA. THE MQ IS ALWAYS RESTORED 0044 TO = lDENOM. 0045 0046 IQUOT wiLL EQUAL NUMERA/IDENOM, TRUNCATED (XDIV) OR ROUNDED 0041 (XDIVR) TO A FORTRAN II INTEGER. 0048 WILL = NUMERA IF IDENOM = 0 0049 0050 OVERFLOW CAN NOT OCCUR IF THE INPUTS ARE FORTRAN-Ii 0051 INTEGERS. NO OVERFLOW TEST IS MADE. 0052 0053 EXAMPLES 0054 0055 1. USAGE IQ1 1, 4) XDIVF 0056 IQ2 XDIVF 0051 2. 4 ) 103 ,. XDIVF 4, 4) 0058 IQ4 9, 4) XDIVF 0059 1, 4) XDIVRF 0060 105 2, 41 0061 106 = XDIVRF 0062 XDIVF 107 I 1,-11 1) I Q8 XDIVRF (-1, 0063 ( IQ9 3, 0) 0064 XDIVF OUTPUTS 101=0 102=0 103=1 104=2 0065 105=0 106=1 101=-1 108=-1 0066 109=3 (DIVISION BY ZERO) 0067 0068 2. INPUTS - X ,. OCT 000000000011 y,. OCT 000000000004 0069 USAGE IQ10 = XDIVF (X,Y) 0070 0071 OUTPUTS - 1010 = OCT 000002000000 0072 PROGRAM FOLLOWS BELOW 0073 0074 •.XDIV .. XDIV FAP PROGRAM LISTINGS 9129/64 .•••••••••••••••••••••••• . XDIV •••••••••••••••••••••••• CPAGE 23 PROGRAM LI STINGS •••••••••••••••••••••••• .. .. NO TRANSFER VECTOR it PRINCIPAL ENTRY, XDIVFCNUMERA,IDENOM) XDIV STQ TEMP SAVE IOENOH LOQ XCA SET FOR TRUNCATION SETUP STQ VARY TEMP ZERO DENOMINATOR CHECK NZT TRA LEAVE LRS 35 o IN AC. NUMERA IN MQ DVP TEMP VARY NOP XCA OR TRA ROUND ALS ALS 18 LEAVE LDQ TEMP RES TORE IOENOM TRA 1,4 it ROUNDING INSERT. COMPARES TWICE THE REMAINDER AGAINST IDENOM. ROUND SSP ALS (OVERFLOW IMPOSSIBLE) 1 SBM TEMP CLM PREPARE FOR ROUNDING DOWN TMI RXCA (SIGN BIT UNDISTURBED) CLA KRND PREPARE FOR ROUNDING UP RXCA XCA RND TRA ALS .. SECOND ENTRY, XDIVRFCNUMERA.IDENOM1 XDIVR STg TEMP SAVE IDENOM LDQ RND SET FOR ROUNDING TRA SETUP .. CONSTANTS, VARIABLES XCA XCA RND TRA ROUND KRND eeT 200000000000 , TEMP PZE :IDENOM END it .. .. ,_. XOIV .. •••••••••••••••••••••••• (PAGE 21 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 ....................... - • XOIVK • •••••••••••••••••••••••• REFER TO AODK •••••••••••••••••••••••• XOIVKS • * •••••••••••••• _ •••• ee ••• REFER TO AODK •••••••••••••••••••••••• XOIVR * • •••••••••••••••••••••••• REFER TO XDIV .................... _... • XOPRSS • •••••••••••••••••••••••• REF,f:R TO BOOST PROGIlAM LISTINGS •••••••••••••••••••••••• • XOIVK • •••••••••••••••••••••••• REFER TO ADDK ..e_ ••••••••••••••• _ •••• XOIVKS *_* REFER TO AODK •e. __ .*.* .... _.. ___ ._ .. •••••••••••••••••••••••• ~ XOIVR * •••••••••••••••••••••••• REFER TO XOIV •••••••••••••••••••••••• XOPRSS ••••••••••••••••••••••••* • REFER TO BOOST • •••••••••••••• * •• *.* ••• it XDVIDE . ••••••••••••• ***.* •• ***. PROGRAM LI STINGS .. XDVIDE (SUBROUTINE) 9129/64 .. FAP -XDVIDE COUNT 150 LBL XDVIDE ENTRY XDVIDE IIX,LIX,IXDVSR,IXDVDDI ENTRY XDVIDR IIX.LIX.IXDVSR,IXDVDD) •••••••••••••••••• ** •••• • XeVIDE LAST CARD IN DECK IS NO. 0104 0001 0002 0003 0004 0005 0006 0007 ----ABSTRACT---0008 0009 0010 - TITLE - XDVIDE DIVIDE A FXD VECTOR BY A CONSTANT 0011 0012 XDVIDE FORMS A VECTOR EQUAL TO A GIVEN VECTOR mIVIDED 0013 BY A FXD CONSTANT, TRUNCATING THE DIVISIONS. OUTPUT 0014 MAY REPLACE INPUT. 0015 It 0016 It XDVSR IS IDENTICAL EXCEPT IT ROUNDS THE DIVISIONS. 0017 0018 It LANGUAGE - FAP SUBROUTINES (FORTRAN-II COMPATIBLE) 0019 .. EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0020 - 33 REGISTERS 0021 - STORAGE .. SPEED 7090 109 0022 XDVIDE 42 + 147 OR 54)*LX MACHINES CYCLES, 0023 XDVIDR 44 + 149 OR 56)itLX LX : VECTOR LENGTH 0024 .. AUTHOR - S.M. SIMPSON, AUGUST 1963 0025 0026 0027 ----USAGE--0028 .. TRANSFER VECTOR CONTAINS ROUTINES - XDIV, XDIVR 0029 .. AND FORTRAN SYSTEM ROUTINES - INONE) 0030 0031 .. FORTRAN USAGE 0032 .. CALL XDVIDEIIX,LIX,IXDVSR,IXDVDDI 0033 .. CALL XDVIDRUIX,LIX,IXDVSR,IXDVODI 0034 0035 .. INPUTS 0036 0037 I XI I ) I:l ••• LIX IS A FXD VECTOR 0038 00i9 LlX SHOULD EXCEED ZERO 0040 0041 IXDVSR IS A NON-ZERO FXD QUANTITY. EQUIVALENCEIIXDVSR, 0042 SOME IXII1) IS PERMITTED. 0043 0044 .. OUTPUTS STRAIGHT RETURN WITH NO OUTPUT If LXX LSTHN 1 OR IXDVSR-O 0045 0046 .. IXDVDDIIl I=I ••• LIX HAS VALUES IXDVDDlIl:IXII1/IXDVSR TRUNCATED 0047 0048 .. TO INTEGERS IXDVIDEI OR ROUNDED TO INTEGERS (XDVIDR). .. EQUIVALENCE IIXDVOD,IXI IS PERMITTED. 0049 0050 THE INITIAL VALUE OF IXDVSR IS ALWAYS USED AS THE DIVISOR 0051 0052 .. EXAMPLES 0053 0054 .. 1. INPUTS - IXll ••• 41:1,2,3,4 IU:O IV:O 0055 .. USAGE CALL XDVIDEIIX,4,2,IYI 0056 .. ~ALl XDVIDR{IX,4,2,IZI 0057 .. CALL XDVIDRIIX,I,2,IW) 0058 .. CALL XDVIDRIIX,O,2,IUI 00')9 .. CALL XDVIORI IX,l,O, IV) 0060 .. CALL XDVIDRIIX,4,IXI31,IXl 0061 .. OUTPUTS - IYI1 ••• 41:0,1,1,2 IZI1 ••• 41=1,1,2,2 0062 .. IW=1 IU:IV:D INO OUTPUT CASES) IXI1 ••• 4)=0,1,I,1 0063 0064 * PROGRAM FOLLOWS BELOW 0065 0066 it TRANSFER VECTOR HAS XDIV,XDIVR FUNCTIONS 0067 HTR 0 XRl 0068 HTR 0 XR4 0069 BCI I,XDVIDE 0070 * PRINCIPAL ENTRY, XDVIDEIIX,LIX,IXDVSR,IXDVDDI 0011 XeVIDE CLA DIV 0072 SETUP STO VARY 0073 SXD XDVIDE-3,1 0074 -.... ... ... . .. .. . .. .. .... ..... ... . ..... . .. . .. •••••••••••••••• *** ••••• •••••••••••••••••••••••• • ......... ...............• PROGRAM LISTINGS XDVIDE , IPAGE 2) SXD XDVIOE-2,4 CLA Kl 1.4 ADD Kl AIIX)+l STA GET CLA 4,4 ADD KI AIIXDVODl+I STA STORE CLA. 2,4 L1X TMI LEAVE POX 0,1 LEAVE,I,O TXL CLA. 3,4 ZERO TEST FOR IXDVSR TlE LEAVE • DIVISION LOOP xeA IXDVSR (REMAINS IN MQ) •• ,1 CLA GET **=AIIX)+1 VARY NOP =TSX $XDIV,4 OR TSX STORE STO .·,1 "=AIIXDVDD)+1 TIX GET,l,l • EXIT LEAVE LXD XDVIDE-3,1 LXD XDVIDE-2,4 5,4 TRA ENTRY, XDVIDR(IX,LIX,IXDVSR,IXDVDDl • SECONDARY XDVIDR eLA DIVR TRA SETUP • CONSTANTS DIV TSX $XDIV,4 DIVR TSX $XDIVR.4 END •••••••••••••••••••••••• XOVIDE • •••••••••••••••••••••••• • IPAGE $XDIVR,to 0075 0016 0017 0018 0019 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 2) •••••••••••••••••••••••• XDVIDR * ••••••••••••••••••••••••* RefER TO XDVIDE •••••••••••••••••••••••• XDVRK •* * ••••••••••••••••••••••• REFER TO ADDK * •• _.**.** ••• *e.*** •• _e* XDVRKS * .e.*._e.* ___ *_. __ e*.*_*_* REFER TO ADDK PROGRAM LISTINGS •••••••••••••••••• * ••••• • XDVIDR * • ••••••••••• * •• * •••••••• REFER TO XDVIDE •••••••••••••••••••••••• XDVRK ** ••• * ••••••• _ •••••••••••* REFER TO ADDK e*e_***_*_.*_.* __ .e** ••• *** ••• XDVRKS *******-*-**_._ •• ** REFER TO ADDK •••••••••••••••••••• **.* . PROGRAM LISTINGS XFIXM *••••••••••••••••• *** •••• XFIXM (FUNCTION) FAP .**4 ••••••••••• *"" •••••• • XFIXM LAST CARD IN DECK IS NO. 0097 0001 .. XF I XM 0002 COUNT 100 0003 LBL XFIXM 0004 XFIXM FIJOB,FLTG) ENTRY 0005 0006 * --~-ABSTRACT---0007 " 0008 .. TITLE - XFIXM 0009 .. TRUNCATE OR ROUND FLOATING PT. NUMBER TO MACHINE INTEGER. 0010 0011 XFIXM TRUNCATES OR ROUNDS A FLOATING POINT NUMBER TO A 0012 FIXED POINT INTEGER WHOSE BINARY POINT IS TO THE RIGHT OF 0013 BIT 35. FLOATING POINT NUMBERS WITH MAGNITUDES 0014 EXCEEDING 2.**27-1. ARE TREATED AS THOUGH THEIR 0015 MAGNITUDES EQUALLED 2.**27-1. 0016 0017 .. LANGUAGE - FAP SUBROUTINE (fORTRAN II FUNCTION) 0018 .. EQUIPMENT - 709, 7090 (MAIN FRAME ONLY) 0019 .. STORAGE - 31 REGISTERS 0020 .. SPEED - ABOUT 35 MACHINE CYCLES 0021 .. AUTHOR - S.M. SIMPSON JR. , NOV/1962 0022 0023 * --r--USAGE---0024 * 0025 - TRANSFER VECTOR CONTAINS ROUTINES NONE 0026 .. AND FORTRAN SYSTEM ROUTINES NONE 0027 0028 ** FORTRAN USAGE 0029 INTEGR = XFIXMF IJOB,FLTGI 0030 0031 * * INPUTS 0032 0033 * JOB =0 MEANS TRUNCATE 0034 NOT=O MEANS ROUND TO NEAREST INTEGER 0035 0036 • FlTG IS A FLOATING POINT NUMBER. 0037 * 0038 .. OUTPUTS 0039 0040 * I NTEGR IS THE MACHINE LANGUAGE INTEGER EQUIVALENT TO FLTG. 0041 * PLUS OR MINUS OCT 000777777777 IF MAGNITUDE OF 0042 * FLTG EXCEEDS 2.**27-1. 0043 * 0044 *.. EXAMPLES 0045 0046 1. INPUTS JOB = 0 FlTG = 3.52 0047 0048 • OUTPUTS - INTEGR = OCT 000000000003 0049 0050 FlTG = 3.52 • 2. INPUTS - JOB = 1 0051 • OUTPUTS - INTEGR = OCT 000000000004 0052 * 3. INPUTS JOB = 1 FlTG = -3.52 0053 OUTPUTS INTEGR = OCT 400000000004 0054 0055 * 0056 FlTG = -1234567B90. ( EXCEEDS * 4. INPUTS - JOB = 0 OUTPUTS - INTEGR = OCT 400777777777 0057 0058 5. INPUTS - JOB = 1 0059 FLTG " 1234567890. OUTPUTS - INTEGR = OCT 000777777777 0060 0061 HTR 0 0062 BCI 1,XfIXM 0063 XFIXM SXD XFIXM-2,4 0064 .. CHECK MAGNITUDE OF FLTG 0065 STO JOB 0066 STQ FLTG 0067 XCA 0068 SSP 0069 CAS LIMIT 0070 NOP TOO BIG 0071 TRA TOOBIG TOO BIG 0072 .. OK, F I X IT 0073 CUI fL TG 0074 * - . .. .... .. . .. . ... - .. - .. . .-.. . " ."._" ••••••• - ••• *.** ••• 9/29/64 • •••••••• **** •••••••• * •• * XFIXI' PROGRAM LISTINGS * •••••••••••••••••••••••• (PAGE (PAGE 2) UFA K1 LRS 0 ANA K2 LLS 0 .. CHECK FOR ROUNDING JOB NZT TRA LEAVE RQL 8 RNO 1,4 LEAVE TRA .. CLIP BIG NUMBERS FLTG 100BIG CLA TMI *+3 CLA K2 TRA LEAVE K2 CLS TRA LEAVE LIMn OCT 234400000000 K1 OCT 233000000000 000777177777 K2 OCT JOB PIE ** FlTG PIE ** END •••••••••••••• *** ••••••• XFIXM •• •••••••••••••••• *** ••••" (=2. *"2·11 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 21 ••••••••••••••••••••• * •• XINOEX • • •••••••••••••••••••••• ** REFER TO LOCATE PROGRAM LISTINGS •••••••••••••••••••••••• • XINOEX • •••••••••••••••• ** •••••• REfeR TO LOCATE .•••••••••••••••••••••••• . XlCOMN •••••••••••••••••••••••• .. •••••••••••••• ***.** •••• .. XlCOMN .. ••••••••••••••••• *-* •••• LAST CARD IN DECK IS NO. 0075 0001 0002 -XLCOMN 0003 100 COUNT 0004 LBL XLCOMN 0005 ENTRY XLCOMN F(ZIFACT) 0006 0007 0008 ----ABSTRACT---0009 0010 • TITLE - XLCOMN 0011 .. FIND LENGTH OF COMMON STORAGE 0012 * 0013 XLCOMN EXAMINES OCTAL LOCATION 143 TO FINO EITHER THE * 0014 LENGTH OF COMMON SPACE BEYOND THE LAST STORED ROUTINE. OR THE TOTAL LENGTH OF COMMON DIMENSIONED IN THE ROUTINES. 0015 0016 • 0017 UNDER THE FORTRAN MONITOR SYSTEM, OCTAL LOCATION 143 • 001B CONTAINS THE ADDRESS OF THE FIRST UNUSED SPACE IN THE • 0019 DECREMENT, AND THE ACORESS OF THE LAST COMMON SPACE USED IN THE ADDRESS. 0020 0021 • 0022 - FAP FUNCTION (FORTRAN II COMPATIBLE) - LANGUAGE 0023 .. EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0024 - 14 REGISTERS - STORAGE 0025 .. SPEED - ABOUT 16 MACHINE CYCLES. 0026 .. AUTHOR - R.A. WIGGINS 4/64 0027 0028 0029 ----USAGE---0030 0031 .. TRANSFER VECTOR CONTAINS ROUTINES - (NOT ANY) 0032 AND FORTRAN SYSTEM ROUTINES - (NOT ANY) 0033 0034 - FORTRAN USAGE 0035 .. LCOMON = XLCOMNF(ZIFACT) 0036 0037 0038 - INPUTS * XLCOMN (FUNCTION) FAP PROGRAM LISTINGS 9/4/64 .. -- ... -- ..-.. .. . .-. OO.H ZI FAC T .-. ..• - OUTPUTS . LCOMON •. .. -D. IF ACTUAL LENGTH OF AVAILABLE COMMON FROM THE END OF THE STORED PROGRAMS THROUGH LOCATION 32561 IS DESIRED. NOT- O. IF DIMENSIONED LENGTH OF COMMON IS DESIRED. IS LENGTH OF COMMON ACCORDING TO lIFACT - EXAMPLES - .. 1. INPUTS - SUPPOSE A MAIN PROGRA~ AND A SET OF SUBROUTINES ARE .. LOADED INTO LOCATIONS 144 THROUGH 4114 (OCTAL) • (2124 DECIMAL), AND THAT THE MAIN IS DIMENSIONID WITH .. COMMON STORAGE OF LENGTH 2000 (DECIMAL). USAGE LCOMNI = XLCOMN (0.1 .. • lCOMN2 = XLCOMN II.) .. OUTPUTS - LCOMNI = 30436 LCOMN2 2000 . - .. PROGRAM FOLLOWS BELOW • BCI XLCOMN TZE CLA ANA ALS TRA Al CLA ANA SSM ADD TRA ENO 1,XLCOMN Al 99 -0000000777777 18 Al+1 99 -0777777000000 =32561B17 1,4 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 00,}9 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 0075 ••••••••• ~ •• **** ••••• * •• XLIMIT • •• _••••••••••• _•• * •• _._- • PROGRAM LI STINGS • XLI MIT HUNCTlONl • FAP .XLlMIT COUNT 100 LBl XLI MIT ENTRY XllMIT FIX, XA, XBl • • • • • • • • • • • • • * •• * * • • • • • • • * • • • • • • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • •••••••••••••••••••••••• • XLIMIT • .** ••••••••• * •• * •••••••• lAST CARO IN DECK IS NO. 0100 0001 0002 0003 0004 0005 0006 0007 -~--ABSTRACT---0008 0009 TITlE - XLIMIT 0010 FIND IF ARGUMENT FALLS INSIDE TWO LIMITING VALUES 0011 0012 XLIMIT HAS VALUE +0 IF ITS FIRST ARGUMENT LIES IN THE 0013 INCLUSIVE RANGE DEFINED BY ITS SECOND AND THIRD 0014 ARGUMENTS, HAS VALUE -1 IF ITS FIRST ARGUMENT IS LESS 0015 THAN THE SMAllER OF ITS OTHER TWO ARGUMENTS, OR *1 IF 0016 GREATER THAN THE LARGER OF THE OTHER TWO. THE MODE OF 0017 THE ARGUMENTS IS IMMATERIAL, AND +0 IS CONSIDERED EQUAL 001B TO -0 IN THE COMPARISONS. 0019 0020 - FAP FUNCTION IFORTRAN-II COMPATIBLE) 0021 LANGUAGE EQUIPMENT - 709,7090~7094 (MAIN FRAME ONLYl 0022 - 25 REGISTERS STORAGE 0023 - 21 TO 33 MACHINE CYCLES 0024 SPEED - S.M. SIMPSON, JUNE 1964 0025 AUTHOR 0026 0027 ----USAGE---0028 0029 TRANSFER VECTOR CONTAINS ROUTINES - NOT ANY 0030 AND FORTRAN SYSTEM ROUTINES - NOT ANY 0031 0032 FORTRAN USAGE 0033 IZIFIN = XLIMITFIX,XA,XBI 0034 0035 0036 0037 INPUTS 0038 X IS ANY MODE. 0039 0040 XA IS SAME MOOE AS X. 0041 0042 XB IS SAME MODE AS X. 0043 0044 0045 0046 OUTPUTS 0047 I ZIF IN HAS VALUE 0,-1,+1 AS DESCRIBED IN ABSTRACT. 0048 0049 0050 0051 EXAMPLES 0052 lZFINI XLIMITF(3,2,4) 0053 1. USAGE IZFIN2 XLIMITFI2,2,4) 0054 IZFIN3 XLIMITFI4,2,4l 0055 IIFIN4 XLIMITFI-0,+0,41 0056 IZFIN5 XLIMITFI+0,-0,4l 0057 lZFIN6 XLIMITF(+0,-2,-01 0058 IZFIN7 XLIMITFI-0,-2,+Ol C059 IIFINB XLIMITF(I,2,41 0060 IIFIN9 XLIMITF(5,2,4) 0061 0062 OUTPUTS - IIFIN1 ••• IZFIN9 = 0,0,0,0,0,0,0,-1,+1 0063 2. USAGE - SAME AS EXAMPLE 1. BUT WITH THE THREE FUNCTION ARGUMENTS 0064 0065 FLOATING POINT. OUTPUTS - SAME AS EXAMPLE 1. 0066 0067 006B 3. USAGE - SAME AS EXAMPLE 1. BUT WITH REVERSED ORDER OF THE SECOND 0069 AND THIRD ARGUMENTS. 0070 OUTPUTS - SAME AS EXAMPLE 1. 0011 0072 PROGRAM FOLLOWS BELOW. 0073 0074 9/4/64 •••••••••••• ** •••• ** •••• • •••••••••••••••••••••••• • (PAGE •••••••••••••••••••••••• PROGRAM LISTINGS XlIMlT • •f ••••••••••••••••••••••• XlIMlT (PAGE 21 BCI XLI MIT STO CLA TlQ XCA STO CLA TNZ SSP XCA XCA TLQ XCA TNZ SSM LDQ LDQ TLQ PXO TRA CLSI CLS TRA CLAI CLA TRA KOI PZE XHI PZE TEMP PZE END 1.XlIlillT TEMP 32165 ·+2 FORCE XLO INTO MQ, XHI INTO XHI XHI TEMP XCA AND RESTORE X (ADJUST FOR ZERO AMB IGUlTYI CLSI BAD IF X LSTHN XLO (+0 IS GRTHN'" .. OR -OJ LDQ (READJUST) XHI CLAI 0,0 1,4 KOI 1,4 KOI 1,4 0,0,1 ..... , .. •• , •••• * BAD IF XHI LSTHN X (+ OR -0 IS SRTMN* -0) 0015 0016 0071 001B 0019 OOBO 0081 0082 0083 00B4 0085 0086 OOBl 00B8 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 21 ..••.....-.........•.... • XLOCV • PROGRAM LI STINGS XLOCV FAP (SUBROUTINE) XLOCV LAST CARD IN DECK IS NO. 0099 0001 0002 COUNT 100 0003 LBL XLOCV 0004 ENTRY XLOCV tLOCV,Xl,X2, ••• ,XN) 0005 0006 • 0007 • ----ABSTRACT---0008 • 0009 • XLOCV 0010 • TITLE CREATE VECTOR OF MACHINE AODRESSES OF VARIABLES IN A LIST 0011 0012 • XLOCV IS A VARIA8LE LENGTH-CALLING-SEQUENCE SijBROUTINE 0013 WHOSE FIRST ARGUMENT IS ITS OUTPUT ·AND IS A YEnOR OF 0014 FORTRAN-II INTEGERS GIVING THE MACHINE ADDRESSIS OF ITS 0015 • REMAINING ARGUMENTS. 0016 • 0017 - FAP SU8ROUTINE (FORTRAN-II COMPATI8LE) 0018 • LANGUAGE .. EQUIPMENT - 709, 7090, 7094 CMAIN FRAME ONLY) 0019 .. STORAGE - 24 REGISTERS 0020 .. SPEED - A80UT 15 + 20*N MACHINE CYCLES ON THE 7090 0021 WHERE N+l IS THE ARGUMENT COUNT. 0022 • - S.M.SIMPSON, FEBRUARY 1964 002'3 • AUTHOR 0024 • 0025 • ----USAGE---0026 0027 •• TRANSFER VECTOR CONTAINS ROUTINES - INOT ANY) 0028 .. AND FORTRAN SYSTEM ROUTINES - INOT ANY) 0029 0030 •• FORTRAN USAGE 0031 • CALL XLOCVILOCV;X1,X2, •••• XNI 0032 0033 • 0034 • 0035 • INPUTS 0036 • Xl ARGUMENT WHOSE MACHINE AOORESS IS TO BECOME LOCVtU 0037 X2 ARGUMENT WHOSE MACHINE ADDRESS IS TO BECOME LOtV(2) 003B 0039 • ETC XN ARGUMENT WHOSE MACHINE ADDRESS IS TO 8ECOME LOtVCNt 0040 N SHOULD EXCEEO ZERO 0041 • 0042 • 0043 0044 • OUTPUTS 0045 • LOCV\I) I=l ••• N CONTAINS THE MACHINE ADDRESSES OF Xl._~XN 0046 0047 0048 .. EXAMPLES 0049 0050 .. 1. INPUTS - SUPPOSE X IS A VECTOR EQUIVALENT TO THE COMMON BLOCK 0051 0052 • (AT 32561 8ASE 101 .. USAGE CALL XLOCV(LOCV1,XI1),XI10).X(7» 0053 CALL XLOCV(LOCV2,X) .. 0054 .. OUTPUTS - LOCVlll ••• 31 = 32561, 32552, 32555 LOCV2CIJ=32561 0055 0056 • 0057 0058 • PROGRAM FOLLOWS BELOW 0059 HTR a XRl 0060 HTR a XR4 0061 l,XLOCV BCI 0062 0063 .. ONLY ENTRY, XLOCVILOCV,X1,X2, ••• ,XN) 0064 0065 XLOCV SXD XLOCV-3,1 0066 SXO XLOCV-2,4 0067 1,4 CLA AILOCVI 0068 STA STO 0069 AXT 0,1 0070 0071 .. GET NEXT ARGUMENT AND TEST FOR A TSX X,O 0072 0073 CAL PICKS UP TSX Xl,O FIRST 0074 CAL 2.4 •.XLOCV . ... . . .. . . ... . . . . . .. . • •••••••••••••••••••••••• •••••••••••••••••••••••• • ........................ • 9/4/64 • •••••••••••••• *** ••• * •• .•••••••••••••••• XLOCV * ****** •• IPAGE PROGRAM L (STINGS 2) .... . . IPAGE STA ANA LAS TRA TRA TEMP AMASK TSXZ *+2 STORE LXD TRA XLDCV-3.1 2.4 NO YES EXIT NO .. STORE AN ADDRESS AND GO BACK FOR ANOTHER • STORE CLA ALS STO STO TXI TXI TEMP 18 .·,1 ... AILOCV) ** POSSIBLE ADDRESS *+1.1.1 CAL.4.-1 * CONSTANTS. TEMPORARIES .... .** •• * ••••••••••••••••• * * XLOCV .. ••• _•••••••••••••••• ** •• AMASK OCT TSXZ TSX TEMP PZE END 777777700000 0.0 .* 0075 0076 0077 007B 0079 0080 0061 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 2) ............ ..............• XLSHFT ' • •••••••••••••••••••••••• PROGRAM LISTINGS •••••••••••••••••••••••• f XLSHFT • f ••••••••••••••••••••••• REFER TO LSHFT ......................... . ' • ' XMlPlY ....•••.•. .. ~ REFER TO MULPLY ~ ......•.•.• REFER TO LSHFT •••••••••••••••••••••••• XMLPlY • •REFER ••••••••••••••••••••••• TO f MULPLY .-.............. -...... . XMUlK • •• *.* ••••• ••••••••• * •• * ~ REFER TO ADDK ..• ••••••••••••••••••••••• .. XMULK •••••••••••••••••••••••• REFER TO ADDK ... -...XMULKS _.... __ ... _-.- ... ..•••••....•.... .. _...-... -. REFER TO ._** •••• _._-_ •• _•••••• -. .. .• ••••••••• XMULKS - •• _._ •• _* ••• * REFER TO ADDK ADDK ......... ................. XNAME ' •••••••••• * •••••••••••••• REFER TO LOCATE XNAME •..••....•••........... -• REFER TO LOCATE ••• * ••••••• *.~ ••• ** •••• ~ • •••••••••••••••••••••••• • • XNARGS •••••••••••••••••••••••• REFER TO LOCATE .., ...... _..•.......... _ •••••••••••••••••••••••• XNARGS • •••••••••••••••••••••••• • REFER TO LOCATE •••••••••••••••••••••••• ......................... . *• •• , ••••••••••••• XNTHA * ** ••••• ................. _-_ .... •..•......••.... _....... ._.... XNTSUM _._ ..... -._ ..• • XNTHA • - REFER TO NTHA XNTSUM *......................• REFER TO INTSUM -. REFER TO NTHA ..... REFER TO INTSUM ·".........•....... .." *.~ * PROGRAM LISTINGS XOOlE XOOlE LAST CARD IN DECK IS NO. 0060 0001 0002 0003 COUNT 50 0004 XOOZE lBl ENTRY XOOIE FlINT) 0005 0006 " 0007 00011 ----ABSTRACT---0009 ".. TITLE - XOOIE 0010 .. DETERMINE WHETHER FORTRAN-II INTEGER IS EVEN OR ODD 0011 0012 XOOIE FUNCTION RETURNS 1 IF ITS ARGUMENT IS ODD, ZERO IF 0013 EVEN • 0014 0015 " 0016 0011 - FAP FUNCTION (FORTRAN-II COMPATIBlEl " lANGUAGE 0018 " EQUIPMENT - 109,7090,1094 IMAIN FRAME ONLY) 0019 - 4 REGISTERS " STORAGE 0020 - 4 MACHINE CYCLES " SPEED 0021 - S.M.SIMPSON~JR. APRIL 1964 " AUTHOR 0022 " 0023 0024 ---USAGE--0025 " TRANSFER VECTOR CONTAINS ROUTINES - (NOT ANY) 0026 002-( .. AND FORTRAN SYSTEM ROUTINES - (NOT ANY) 0028 "" FORTRAN USAGE 0029 0030 " IIIFEV=XOOIEFIINT) 0031 * 0032 *.. INPUT 0033 0034 0035 INT IS A FORTRAN-II INTEGER " 0036 " 0031 .. OUTPUT 0038 0039 0040 o IF INT IS EVEN IlIFEV " 0041 1 IF INT IS 000 0042 0043 0044 * EXAMPLES 0045 "" 1. USAGE 0046 DIMENSION IIIFEV(9) 0047 DO 10 1=1,9 0048 10 IZIFEVII)=XOOIEFII-5) "" 0049 OUTPUTS - IZIFEVll ••• 9) = 0,1,0,1,0,1,0,1.0 0050 0051 " 0052 "" PROGRAM FOllOWS BELOW 0053 0054 0055 " 0056 I,XOOlE BCI 0051 XOOZE ANA MASK 005B fRA 1.4 0059 MASK OCT 000001000000 0060 END " " *XOOZE .. ... . . .. . . . . ... .. . . . XOOlE FAP " •••••••••••••••• *** ••••• •••••••••••••••••••• ** •• IFUNCTION) -*****************"***** • 9/4/64 ••• ***** ••••• * •• _. .****** .. XREMAV •••••••••••••••••••••••• • ............................. 9/29/64 • XREMAV (.SUBROUT INE) .. FAP ·XREMAV COUNT 100 LBL XREMAV ENTRY XREMAV CIX,LIX,IXAVG,IXNULD) . • ----ABSTRACT---- • • TITLE - XREMAV REMOVE THE MEAN FROM A FIXED VECTOR ..... -............................. . XREMAV • PROGRAM LISTINGS LAST CARD IN DECK IS NO. 0111 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 XREMAV COMPUTES THE AVERAGE VALUE OF A FIXED POINT VECTOR CROUNDING THE AVERAGE TO NEAREST INTEGER). AND THEN SETS AN OUTPUT VECTOR WITH ELEMENTS EQUAL TO THOSE OF THE INPUT VECTOR MINUS THE AVERAGE. THE OUtPUT VECTOR MAY REPLACE THE INPUT VECTOR. THE AVERAGE (S ALSO AN OUTPUT QUANTITY. • •. ..• ... ... I.ANGUAGE .. EQUIPMENT .. STORAGE .. SPEED .. • AUTHOR • .. THERE IS NO DANGER OF FIXED POINT OVERFLOW. - FAP SUBROUTINE IFORTRAN-II COMPATIBLE) 709 OR 7090 CMAIN FRAME ONLY) 31 REGI STERS 125 + 19*L MACHINE CYCLES ON 7090, L 132 + 19.L MACHINE CYCLES ON 709 - S.M. SIMPSON, SEPTEMBER 1963 VECTOR LENGTH ----USAGE---- .. TRANSFER VECTOR CONTAINS ROUTINES - XAVRGR INONE) FORTRAN SYSTEM ROUTINES ..... FORTRANANDUSAGE • • .. • .... • CALL XREMAVtIX,lIX,IXAVG,IXNULO) INPUTS I XII) l : l ••• LIX IS A FIXEO VECTOR (MUST BE FORTRAN-It INTEGERSI lIX SHOULD EXCEED ZERO ..•.. OUTPUTS . I XAVG .. • .. .. .•. ... . • •. ..... ... IS IXNULDlI) EQ~IVAlENCE(IXNULD,IX) EXAMPLES .. 1. INPUTS .. .. • • IS = I1/LIX) • I SUMIFROM 1=1 TO LIX) OF XCII) ROUNDED TO NEAREST INTEGER. IT IS COMPUT~D IN A MANNER WHICH ELIMINATES THE POSSIBILITY OF FIXED POINT OVERFLOW • IXNULDII) l=l ••• LIX • .. ... STRAIGHT RETURN WITH NO OUTPUTS IF LIX LSTHN IJ = IXII) - IXA~G IS PERMITTED. - IXlll ••• 5) = 90000, 91000, 92000, 93000, 94000 IX21l ••• 5) = 1, 2, 3, 4, 5 IXAVG6 = IXNLD6 = -999 USAGE CALL CALL CALL CAll CALL CALL OUTPUTS- IXAVGl IXAVG2 IXAVG3 IXAVG4 IXAVG5 IXAVG6 XREMAVIIXI, XREMAVIIX2, XREMAVIIX2, XREMAV I IX2, XREMAVIIXI, XREMAVIIXI, 5, 5, 4, 5, 1, 0, IXAVGl, IXAVG2, IXAVG3, IXAVG4, IXAVG5, IXAVG6, IXNLDl1 IXNLD2) IXNLD3) IX2) IXNLD5) IXNLD6) 92000 IXNlDlC 1 ••• 5) = -2000,-1000,0,1000,2000 -2, -1, 0, 1, 2 .3 IXNLD211 ••• 51 3 IXNLD311 ••• 41 -2, -1, 0, 1 -2, -1, 0, I, 2 IX2C 1 ••• 51 3 90000 0 IXNLD5(11 IXNLD6 INO OUTPUT CASE) -999 0012 0013 0014 0015 0016 0017 0016 0019 0020 01121 0022 0023 0024 0025 0026 0021 0026 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0041 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 005B 0059 0060 0061 0062 0063 0064 0065 0066 0061 006B 0069 0070 0011 PROGRAM FOLLOWS BELOW 0072 0013 0074 .........~-* •••• * •• * ••• * •• XREMAV • ••••••••••••••••••••••••• (PAGE PROGRAM LISTINGS 2) • TRANSFER VECTOR CONTAINS XAVRGRCIX,LIX,IXAVGJ HTR 0 XR4 1, XREMAV BCI • ONLY ENTRY. XREMAVtIX,LIX,IXAVG,IXNULOI XREMAV SXD XREMAV-2,4 1,4 AIIX) Kl CLA STA TSX1 AIIX)+1 ADD Kl STA GET 3,4 A(IXAVGI CLA TSX3 STA STA SUB 4,4 CLA ADD Kl AIIXNULD'+l STORE STA CLA. 2,4 LIX TMI LEAVE STO LIX LIX NlT TRA LEAVE .. COMPUTE IXAVG $XAVRGR,4 TSX •• =AIIXI TSXl TSX .·,0 TSX LI X,D •• ,0 TSX3 TSX .-=A CIXAVGJ • MEAN REMOVAL LOOP LI X,4 LXD •• =AIIX)+l GET CLA * •• 4 ... =A(IXAVGI SUB SU8 ** *.,4 STORE STO **=AIIXNULDI+l GET,4,1 TIX .. EXIT LEAVE LXD XREMAV-2,4 5,4 TRA • TEMPORARY 0,0, •• LIX PZE ··=LIX END •••••••••••••• **** •••••• XREMAV • ••••••••••••••••••••••••• (PAGE 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 2) ........................ , ......•.•......... _.....• • XRFLEC REFER TO REFlEC PROGRAM LISTINGS •••••••••••••••••••••••• XRfiLEC • •••••••••••••••••••••••• REFER TO • REFLEC . .................•... __ XSAME •••••••••••• • 4* •••••••••• * REFER TO SAME •••••••••••••••••••••••• XSAME • •••••••••••••••••••••••• • REFER TO SAME ......... ...............• • ' XSMDEV ••••••••• * •••••••••••••• REFER TO SUMDFR •••••••••• * •• ** •••••• * •• XSMDFR • •••• * ••••••••••• * •••••••• REfeR TO SUMDFR •••••••••••••••••••••••• • XSMDEN • •••••••••••••••••••••••• REFER TO SUMDFR •••••••••••••••••••••••• XSMOFR • •••••••••••••••••••••••• • REFER TO SUHOfR ••••••••••••••••••• ** ••• • XSPECT • •••••••••••••••••••••••• PROGRAM LI STI NGS ••••••• *•••••••••••••••• • XSPECT • •••••••••••••••••••••••• • XSPECT (SUBROUTINE) 9/29/64 LAST CARD IN DICK IS NO. 0238 • LABEL 0001 CXSPECT 0002 SUBROUTINE XSPEtT(XCOR.N.COSTAB.SINTAB.M.JMIN.JMAX.CSP.SSPj 0003 1 SPACE. ERR) 0004 C 0005 o - ...--ABSTRACT---0006 o 0007 0008 C TITLE - XSPECT C FAST COSINE. SINE TRANSFORMS OF CROSS-CORRELATION FUNCTIONS 0009 C 0010 o XSPECT PRODUCES A HI-SPEED CROSS-POWER (OR ENER&Y! DENSITY 0011 C SPECTRUM lOR PORTION THEREOF) FROM AN N-LAG CROSS0012 C CORRELATION FUNCTION. XO(I) I=-N.-N+l ••••• N • IN TERMS 0013 OF THE REAL AND IMAGINARY PARTS C 0014 C 0015 C 0016 N C CSIJ) SUM 0017 0018 C I=-N C 0019 o N 0020 C SSIJ) SUM 0021 C I=-N 0022 0023 C FOR J = JMIN.JMIN+l ••••• JMAX 0024 C WHERE C 0025 PI = 3.14159265 0026 C N,M,JMIN AND JMAX ARE INPUT PARAMETERS 0027 C C COSIJ-PI/M) AND SINeJ-PI/M) J=O.l •••• ~M ARE 0028 C REQUIRED AS INPUT TABLES 0029 o LSTHN= JMIN LSTHN JMAX LSTHN= M 0030 C 0031 C SPEED IS ATTAINED BY C 0032 1. IFOR M LSTHN= N) 0033 o -COLLAPSING XCIII INTO THE RANGE -M TO ~M 0034 C C -SPLITTING THE COLLAPSED CORRELATION INTO 000 AND 0035 EVEN PARTS AND RESpLITTING THESE INTB THEIR C 0036 ODD AND EVEN SUBPARTS. 0037 C 0038 C 2. USING THE HI-SPEED LOOPING LOGIC OF SUBROUTINE 0039 C C COSISP TO PERFORM THE TRANSFORMS OF THE SHORTENED 0040 SUBPARTS (LENGTH = M/2) C 0041 0042 C 0043 2-M+4 TEMPORARY REGISTERS ARE NEEDED UNLESS USER IS C C WILLING TO SACRIFICE THE CROSS-CORRELATION FOR SCRATCH 0044 0045 C ITEMPORARIES NOT REQUIRED IF M GRTHN N) 0046 o 0047 C LANGUAGE - FORTRAN II SUBROUTINE C EQUIPMENT - 709 OR 7090 IMAIN FRAME ONLY) 0048 0049 - 523 REGISTERS C STORAGE MACHINI CYCLES C SPEED - FOR M LSTHN= N 36*IJMAX-JMIN+ll*M 0050 FOR M GRTHN N 12*IJMAX-JMIN+l).N MACH INI CYOLES 0051 C 0052 o AUTHOR - S.M. SIMPSON JR., NOV 1961 0053 C 0054 C ---USAGE---0055 C 0056 C TRANSFER VECTOR CONTAINS ROUTINES SPLIT. COS!SP, REFIT. KOLAPS. CHPRTS 0057 C XlOC 0058 o AND FORTRAN SYSTEM ROUTINES 0059 C 0060 C FORTRAN USAGE CALL XSPECTIXCOR,N,COSTAB.SINTAB,M,JMIN,JMAX,CSP,SSP,SPACE.ERR) 0061 C 0062 C 0063 C INPUTS 0064 C XCOR (Il I=-N+l, ••• ,N+l CONTAINS XCIJ) J= -N ••••• N RESPECTIVELY 0065 o (THIS FORMAT PLACES THE ZERO LAG CORRELATION, 0066 C XC(O), IN XCORll) 0067 C 0068 C 0069 N MUST EXCEEO ZERO C 0070 C COSTABII) I=I ••• M+l CONTAINS OOSIJ*PI/MI J=O.l •••• ,M 0071 C 0012 C 0073 C SINTABIII I=I ••• M+l CONTAINS SINIJ*PI/MI J=O.l, ••• ,M 0074 C *****.* ••• ******* ••••• *. • XSPECT ••••••••••••••••• * •••••• PROGRAM LISTINGS • • (PAGE XSPECT 2) C M C C JMIN C C JMAX C C SPACEIII C C C C C C C C C OUTPUTS C C CSP!II C C C SSPIII C C C ERR C C C C EXAMPLES C C 1. COMPLETE C INPUTS C C C USAGE C C OUTPUTS C • , •••••••••••••• ** •• * ••• * ••••••••••••• *** •••••••• (PAGE MUST EXCEED ZERO C 5. ERROR EXITS WITH NO COMPUTATION C USAGE CALL XSPECTIXCOR,-I,COSTAB.SINTAB,3,0.3, C CSP,SSP,SPACE,ERR11 C CALL XSPECTIXCOR,2.COSTAB,SINTAB,0.0.3, C CSP,SSP,SPACE.ERR2) C CALL XSPECTIXCOR,2,COSTAB,SINTAB,3,-1,3. C CSP,SSP,SPACE.ERR3) C CALL XSPECTIXCOR.2.COSTAB.SINTAB.3,0.4. C CSP,SSP,SPACE.ERR4) C CALL XSPECTIXCOR.2,COSTAB,SINTAB.3.2,2, C CSP,SSP,SPACE,ERR5) C OUTPUTS - ERRl=l. IILLEGAL Nl ERR2=1. I ILLEGAL M) C ERR3=1. (ILLEGAL JMINI [RR4=1. (ILLFGAL JMAXI C ERR5=1. (ILLEGAL JMAX) 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 0099 0100 0101 0102 0103 Ol04 Ol05 0106 0101 010S 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0121 0128 0129 0130 0131 0132 0133 0134 0135 0136 0131 0138 0139 0140 0141 0142 0143 0144 0145 0146 0141 0148 C 014'1 MUST BE NON-NEGATIVE MUST EXCEED JMIN AND BE LSTHN= M IS NOT USED IF M EXCEEDS N IS A BLOCK OF 2*M+4 TEMPORARIES IF M LSTHN= N ORDINARILY (SPACE NOT EQUIVALENT TO XCOR) THIS BLOCK CONSISTS OF SPACE(I) 1=1,2, ••• ,2*M+4 HOWEVER, IF SPACE AND XCOR ARE EQUIVALENT. THIS BLOCK CONSISTS OF SPACEII) = XCORIII I=-M+1 •••• ,M+4 INOTE THAT IF M=N. 3 REGISTERS BEYOND XCOR!N+l' ARE USED) I=1.2 •••• JMAX-JMIN+l CONTAINS CSIJI J=JMIN ••• IMAX AS DEFINED IN ABSTRACT. I=1.2 •••• JMAX-JMIN+1 CONTAINS SSIJ) J=JMIN ••• JMAX AS DEFINED IN ABSTRACT 0.0 NORMALLY 1.0 IF N.M,JMIN OR JMAX IS ILLEGAL IPROGRAM EXITS WITHOUT COMPUTING SPECTRUM IN THIS CASE) SPECTRUM. NOT TRYING TO SAVE SPACE. M LSTHN N XCR!1 ••• 71 = -36 •• -27 •• -18 •• 2 •• 22 •• 33 •• 44. N*3 COSTABl1 ••• 31 = 1 •• 0.,-1. SINTABll ••• 3) = 0 •• 1 •• 0. M=2 JMIN=O JMAX=M CALL XSPECTIXCR(41.N.COSTAB.SINTAB.M.JMIN.JMAX. CSP.SSP,SPACE,ERRI ERR=O. CSPl1.J.31 20 •• -4.,-4. SSPll ••• 31 0.,-40.,0~ C C 2. COMPLETE SPECTRUM SAVING SPACE C INPUTS - SAME AS EXAMPLE 1. C USAGE CALL XSPECT(XCR(41.N.COSTAS.SINTAB,M_JMIN,JMAX.CSPi C SSP,XCRI41.ERRJ C OUTPUTS - SAME AS EXAMPLE 1. (SUT XCR(2 ••• 91 WILL HAVE BEEN C DEST~OYEDI C C 3. PARTIAL SPECTRUM C INPUTS - SAME AS EXAMPLE 1. EXCEPT JMIN=l C USAGE - SAME AS EXAMPLE 1. C OUTPUTS - ERR=O. C CSPll ••• 21 = -4 •• -4. SSPll ••• 2J = -40 •• 0. C C 4. FINER GRAINED SPECTRUM, M GRTHN N C INPUTS - SAME AS EXAMPLE 1. EXCEPT M=JMAX=4 C CDSTABLl ••• 51 = 1 ••• 70711.0 •• -.70111.-1. C SINTABll ••• 5) = 0 ••• 70711,1 ••• 70111.0. C USAGE - SAME AS EXAMPLE 1. C OUTPUTS - ERR=O. AND C CSPl1 ••• 5) = 20.,-.82844.-4 •• 4.82844.-4. C SSPll ••• 51 = 0.,144.85320,-40.,24.85320.0. AND C 21 ·*** ••• * ••• * •••••• *.**_. XSPECT * *•• * ••••••••• *** •••• **.** (PAGE PROGRAM LISTINGS 3) •••••••••••••••••••••••• • XSPECT • ••••••••••••••••••• * •••• (PAGE 31 C PROGRAM FOLLOWS BELOW C C C ARGUMENT DIMENSIONS DIMENSION XCOR(15000),COSTAB(150001,SINTAB(150001 DIMENSION CSP(15000),SSPI15000),SPACEI15000) C CHECK CONOITIONS ON N,JMIN,JMAX,M MM=M IF IN) 15,10,10 10 IF IJMIN) 15,12,12 12 IF IJMAX-JMIN) 15,15,14 14 IF IJMAX-MM} 17,17,15 C BAD 15 ERR=I.0 GO TO 99 C OK 17 ERR=O.O C CHECK IF FOLDING ETC IS VALID (NOT IF M GREATER THAN Nl IF IMM-N) 30,3C,20 C NOTE, IN WHAT FOLLOWS WE OBTAIN EFFECTIVE NEGATIVE INDICES SINCE C X(2) X(2) C XIII = XII) C XIO) = X1327681 C XI-I) = XI32768-1) C ETC C XI-J) = X{32768-JI C FOLDING IS NOT POSSIBLE, COMPUTE SPECTRUM DIRECTLY AND EXIT C C FIRST SPLIT THE CORRELATION ON TOP OF ITSELF 20 JJ=32768-IN-l) NN=2*N+l CALL SPLITIXCORIJJ),NN,I.0,XCOR{JJ),XCORI2)1 C THEN FEED THE PARTS TO COSISP. INOTE SHIFT OF ORIGIN FOR ANTISYM PART C WHICH MAKES ITS FIRST ELEMENT NON-ZERO - BUT IT IS MULTIPLIED C BY SINIO).) CALL COSISP{XCORIJJ),XCOR{JJ),XCOR,XCOR~N,COSTAB,SINTAB~M~, IJMIN,JMAX,I.O,CSP,SSP) C THEN PUT THE CORRELATION BACK TOGETHER AND EXIT. CALL REFITIXCORIJJ),NN,I.0,XCOR(JJ),XCOR(2)1 GO TO 99 C FOLDING IS POSSIBLE. SETUP 30 LCOL=2.MM+l LSYM=MM+l LSMSM=IMM+2l12 C IS fOLDING TO TAKE PLACE ON TOP OF CORRELATION BLOCK IF IXLOCFISPACE)-XLOCfIXCOR)) 32,34,32 C NO, SET UP fOR THIS CASE 32 I SS=1 IAS=I+LSMSM IMID=MM+l ISA=MM+3 IAA=MM+3+LSMSM IZER3=2.MM+4 GO TO 40 C YES, SET UP 34 ISS=32768-{MM-l) IAS=32768-IMM-l)+LSMSM IMID=l ISA=3 IAA=3+lSMSM IZER3=MM+4 GO TO 40 C THEN COLLAPSE THE CORRELATION INTO THE RANGE -M TO +M C IIGNORE ERROR RETURN) 40 CALL KOLAPSIXCOR,N,I.O,M,SPACEIIMID),DUMMY) C THEN SPLIT THE COLLAPSED CORRELATION ON TOP OF ITSELf CALL SPLITISPACE(ISS),LCOl,1.0,SPACElrSS),SPACEIIMIO+1)~ C THEN SHIfT THE ANTI SYMMETRIC PART UP TWO NOTCHES C AND FILL IN THREE ZEROES DO 45 I=l,MM J=IMID+l+MM-I 45 SPACEIJ+2)=SPACEIJ) SPACEIIMID+I)=O.O SPACE{IMID+2)=0.0 SPACE' IZER3) =0.0 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 ...._....•......•....... • XSPECT • •••••••••••••••••••••••• (PAGE 4) PROGRAM LISTINGS •• ••••••••••••••••• * ••• ~ • KSPECT • •••••••••••••••••••••••• {PAGE 41 C NOW SPLIT THE SY~METRIC PART ON TOP OF ITSELF CAll SPlIT{SPAC~IISS),lSYM,l.O,SPACEIISS),SPACE{IASJ) C THEN REVERSE SYMSYM.REVERSE AND CHANGE SIGNS OF ANTSYM CAll CHPRTS{SPACEIISS),SPACEIIAS),lSYM) C NOW SPLIT THE ANTI SYMMETRIC PART IEXTENDED) ON TOP OF ITSElf CAll SPlITISPACE{ISA),lSYM,l.O,SPACEIISA),SPACE{IAA») C THEN REVERSE SYMANT. REVERSE AND CHANGE SIGNS OF ANTANT CALL CHPRTS{SPACE{ISA),SPACE{IAA),lSYM) C FINAllY FEED THE FOUR PARTS TO COSISP AND THEN EXIT lMONE=LSMSM-l CALL COSISP(SPACE{ISS),SPACEIIASI,SPACEIISA),SPACE{IAA)~ IlMONE,COSTAB,SINTAB,MM,JMIN,JMAX,l.O,CSP,SSP) 99 RETURN END 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0231 0238 •••••••••••••••• * ••••••• XSQOEV * •••••••••••••••••••••••• • REFER TO XSQOFR PROGRAM LISTINGS •••••••••••••••••••••••• XSQOEV • •••••••••••••••••••••••• • REFER TO XSQOFR ••••••••••••••••• * •• ** •• . XSQDfR •••••••••• ** •• * •••••••••• PROGRAM LISTINGS 9/29/64 • XSQDfR (SUBROUTINE) • fAP .XSQDfR CDUNT 100 LBL XSQDfR ENTRY XSQDFR (IX,IY,LXY,ISSXMY) ENTRY XSQDEV IIX,IXBASE,LIX,ISSXMBl •••••••••••••••••• *** ••• .. XSQDfR LAST CARD IN DECK IS NO. 0112 0001 0002 0003 0004 0005 0006 0007 • ----ABSTRACT---0008 • 0009 *.. TITLE - XSQDFR WITH SECONDARY ENTRY XSQDEV 0010 .. SUM SQUARE DIF. OF FXD. VECTDR fROM ANDTHER OR FROM. CONSTANT 0011 0012 * XSQDFR SUMS THE SQUARES OF THE DIFFERENCES BETWEEN THE 0013 ELEMENTS OF TwO FIXED (FORTRAN-Ill VECTORS 0014 0015 XSQOEV SUMS THE SQUARES OF THE DiffERENCES BETWEEN THE 0016 • ELEMENTS CF A FIXED VECTOR AND A CONSTANT. 0017 0018 - FAP SUBROUTINES (FORTRAN-II COMPATIBLE) 0019 • LANGUAGE .. EQUIPMENT - 709 OR 7090 (MAIN FRAME ONLY) 0020 .. STORAGE REGISTERS - 31 0021 7090 709 0022 • SPEED 38 + (28.6 OR 32.8).LX MACHINE CYCLES,LX=VECTOR LENGTH 0023 • .. AUTHOR - S.M. SIMPSON, AUGUST 1963 0024 0025 ----USAGE--0026 0027 .. TRANSfER VECTOR CONTAINS RDUTINES - (NONE) 0028 .. ANO FORTRAN SYSTEM ROUTINES - INONE) 0029 0030 .. FORTRAN USAGE 0031 .. CALL XSQDFRIIX,IY,LXY,ISSXMY) 0032 .. CALL XSQDEV(IX,IXBASE,LIX,ISSXMB) 0033 0034 • INPUTS 0035 • 0036 • I X( I ) 0037 l=l ••• LXY ARE FORTRAN-II INTEGERS, INPUT TO XSQDFR • I YII) l=l ••• LXY ARE FORTRAN-II INTEGERS, INPUT TO XSQDFR 0038 • LXY SHOULD EXCEED 0 0039 • 0040 • I X( Il l=l ••• LIX ARE FORTRAN-II INTEGERS INPUT TO XSQDEV 0041 • I XBASE IS A FORTRAN-II INTEGER INPUT TO XSQDE~ 0042 • llX SHOULD EXCEED a 0043 • 0044 .. DUTPUTS 004':) STRAIGHT RETURN WITH NO ACTION IF LXY OR LIX LSTHN 1 0046 ISSXMY IS SUMtFROM 1=1 TO LXY) OF {IX! ll-IYtI>l.IIX( IlI-IYIIJ) 0047 • 0048 • IS SUMfFROM 1=1 TO LIX) OF IIX(I)-IXBASEI.CIXII)-lXBASEl ISSXMB 0049 • 0050 • DANGER OF OVERFLOW, NOT TESTED FOR BY EITHER ENTRY. 0051 • 0052 • EQUIVAlENCEIISSXMY,ANY INPUT),IISSXMB, ANY INPUT) 0053 • 0054 IS PERMITTED •. • 0055 • 0056 • EXAMPLES 0057 • 1. INPUTS - IXI·1 ••• 3) = 1.2,3 IYII ••• 3!: 3,4,5 0058 • USAGE CALL XSQDFRI'IX,IY,3,ISDIFl! 0059 0060 • CALL XSQDEVIIX, 3,3,ISDEVl) 0061 • CALL XSQDFRIIX,IY,l,IX) 0062 • CALL XSQDFRI IX, IY,O, ISDIF21 0063 .. OUTPUTS - ISDIFl = 12, ISDEVI = 5, IXll)= 4,ISDIF2 o (NO DUTPUT) 0064 • 0065 • PROGRAM FOllOWS BELOw 0066 • 0067 0068 • ND TRANSFER VECTDR 0069 HTR 0 XR4 0070 BCI 1,XSQDFR 0071 • PRINCIPAL ENTRY. XSQDFR(IX,IY,LXY,ISSXMYl XSQOFR ClA 2,4 0072 ADD Kl A(IY)+l 0073 0074 STA 'SUB .. .. ... ... . .. .. .. . .. .** •••••••••• **** ••••••• ••••••••• ** •••••••••••• * XSQOFR • ••••••••• *** ••••••••••••• (PAGE PROGRAM LISTINGS ••••••••••••• * •• *** ••••• • XSQDFR (PAGE 21 CLA SUB SUBTR SETUP S;fO XSQDFR-2,4 SXO 1,4 Kl CLA ADD AIIXI+l Kl STA GET CLA. 3,4 LXY TMI LEAVE PDX 0,4 TXL LEAVE.4,0 STl TEMPI • LOOP •• :AIIX)+l CLA GET **.,4 :SUB AlIy)+1,4 SUBTR SUB **, •• TEMP2 STO XCA MPY TEMP2 ALS 17 ADO TEMPI STO TEMPt GET,4,l TIX • STORE RESULT LXO XSQDFR-2,4 4.4 STO• EXIT LEAVE LXD XSQDFR-2,4 TRA 5.4 • SECOND ENTRY. XSQOEVIIX,IXBASE,LIX,ISSXMB) XSQDEV CLA 2.4 AIIXBASE) STA SUBXB CLA SUBXB TRA SETUP • CONSTANTS. TEMPORARIES •• :AIIY)+l SUB SUB •• ,4 SUBXB SUB •• ·.:AIIXBASEI TEMPI PZE •• , ••••• SUM TEMP2 PIE •• , •• , •• DIFFERENCES END • • •••••••••• ** ••••••••••• OR SUB AC IXBASE) 0075 0076 0077 007B 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 00B9 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 2) ••• * •• *.* ••• ******* ••• _. XSQRUT • ** •••••••••••• * ••• *.****. PROGRAM LISTINGS * XSQRUT I SUBROUT.I NE) • FAP .XSQRUT COUNT 100 LBL XSQRUT XSQRUT (IX,LIX,IXSQRTI ENTRY • • • • • • •* • • • • • • • * * * • • • • * • • • * * • • * • • * * * * • * • • * * • • • • • • • • • • • • •••••••••••••••••••••••• XSQRUT • •••••••••••••••••••••••• • LAST CARD II!! DECK IS NO. 0102 0001 0002 0003 0004 0005 0006 ----ABSTRACT---0001 0008 0009 TITLE - XSQRUT SQUARE ROOT OF A FIXED VECTOR WITH ROUNDING 0010 0011 XSQRUT FORMS A FIXED VECTOR WHOSE ELEMENTS ARE THE 0012 SQUARE ROOTS (ROUNOED TO FORTRAN-II INTEGERS) OF ANOTHER 0013 FIXED VECTOR IALSO FORTRAN-II INTEGERS). OUTP~T MAY 0014 RE PLACE INPUT. 0015 0016 - FAP SUBROUTINE (FORTRAN-II COMPATIBLE) 0011 LANGUAGE 0018 EQUIPMENT - 109 OR 1090 IMAIN FRAME ONLY) - 37 REGISTERS 0019 STORAGE ABOUT 18 + 250.LX MACHINE CYCLES, LX VECTOR LENGTH 0020 SPEED - S.M. SIMPSON, AUGUST 1963 AUTHOR 0021 0022 ----USAGE---0023 0024 TRANSFER VECTOR CONTAINS ROUTINES - FIXVR 0025 AND FORTRAN SYSTEM ROUTINES - SQRT (FUNCTION) 0026 0027 FORTRAN USAGE 0028 CALL XSQRUTfIX,LIX,IXSQRTI 0029 0030 0031 INPUTS 0032 IXlI ) 1=1 ••• LIX IS A NON-NEGATIVE FORTRAN-II INTEGER VECTOR 0033 0034 lIX SHOULD EXCEED 0 0035 0036 STRAIGHT RETURN WITH NO OUTPUT IF LIX LSTHN 1 0031 OUTPUTS 0038 IXSQRTIII I=1 ••• LIX IS IXSQRTII) =XFIXRFISQRTFIFLOATFIIXIIJ1" 0039 WHERE XFIXRF IMPLIES FIXING WITH ROUNDING. NEGATIVE 0040 VALUES OF IXII) ARE TREATED AS THOUGH THEY WERE 0041 POSITIVE. 0042 0043 EQUIVALENCE IIXSQRT,IX) IS PERMITTED. 0044 0045 0046 EXAMPLES 0041 1. INPUTS - IXll ••• 5) = 1,2,3,4,5 IYll ••• 5) 100,-200,300,-400,500 0048 0049 ISQRT3 = 0 USAGE CALL XSQRUTIIX,5,ISQRT11 0050 CALL XSQRUTIIY,5,ISQRT21 0051 CALL XSQRUTIIY,l,IYI 0052 0053 CALL XSQRUTIIX,0,ISQRT31 OUTPUTS - ISQRTlI1 ••• 5) 1,1,2,2,2 0054 ISQRT211 ••• 51 10,14,11,20,22 0055 IYll) = 10 ISQRT3 = 0 INO OUTPUT CASEI 0056 0051 0058 PROGRAM FOLLOWS BELOW • TRANSFER VECTOR CONTAINS SQRT, FIXVR HTR XRl o o HTR XR4 1,XSQRUT BCI XS,RUT IIX,LIX,IXSQRTI • ONLY ENTRY. XSQRUT-3,l XSQRUT SXD SXO XSQRUT-2,4 1,4 Kl CLA AOD K1 AIIX)+1 STA GO CLA 3,4 AIIXSQRTI STA TSX1 STA TSX3 ADD Kl AI IXSQRT 1+1 9/29/64 0059 0060 0061 0062 0063 0064 006S 0066 0061 0066 0069 0070 0071 0072 0073 0074 •••••••••••••••• ****** •• XSQRUT * * ** •••••••••••••••••• ** •• (PAGE 2) STA CLA S'rA CLh TMI POX TXL STORE 2,4 TSX2 2,4 LEAVE 0,1 LEAVE.l,O * LOOP GET CLA **,1 LRS 18 ORA OCTK OCTK FAD SSP $SQRT,4 TSX STORE STO * •• 1 GfT,I,1 TlX * THEN FIX WITH ROUNDING $FIXVR,4 TSX TSXl TSX ** ,0 TSX2 TSX **.0 TSX3 TSX .*.0 " EXIT LEAVE lXD XSQRUT-2,4 lXO XSQRUT-3,l 4,4 TRA .. CONSTANTS OCTK OCT 233000000000 END PROGRAM LISTINGS ..•••••••••••••••••••••••• XSQRUT * **** •••••••••• •••••• 6 ••• IPAGE AILIX 1 LlX *"=AIIXl+l "*=AIIXSQRTI+1 ,,-=A I IXSQRT 1 ""=AILIXI **=AIIXSQRTI 0075 0016 0017 0078 ()019 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 21 .......-................. it XSQSUM •••••••••••••••• * ••••••• PROGRAM LI STINGS •••••••••••••••••••••••• • •••••••••••••••••••••••• XSQUAR .. REFER TO SQRSUM REfeR TO SQRSUM it XSQSUM •• 4 ••••••••••••••••••••• . •••••••••••••••••••••••• REFER TO SQUARE ••••••••• * •••• * •••• * ••• * #** ••••••••••••••••••••• .. XSQUAR .. •••••••••••••••••••••••• REFER TO SQUARE ••• _ •• _ ••••••••• _ ••• _* •• . XSTEPC _.*_.-....... ..••..••••••. . .-. ••........ __ .. -_.- ...... _-*--.----_.-*--. .-_ ...... XSTEPL REFER TO OELTA XSTEPL • * •••••••••••••• **_ •• REFER TO DELTA _*- .... _•••....... _. __ .••. . • •• ** •••••••••• **** •••••• XS TEPR REFER TO DelTA XSTEPC . ............ *.. _.. **-*.* REFER TO DEL fA •• - ••• -* •••••••• _-**_ ... REFER TO DELTA * •••• ** ••• _•• _•••• **_ •• * XSTEPR *• •••••••••••••• - •••••• *** REFER TO OELTA ••••••••••••• *** •••••••• XSTLIN * * .......•.............. _. PROGRAM LISTINGS •••••••••••••••••••••••• • •••••••••••••••••••••••• XSUBK * •••••••••••••••••••••••• SElLIN • ••• * ••••••••••••••••••• XSUBK * * ........................ REfER TO ADDK ..••.•...••...• *._ .•.... XSUBKS • * •••••••••••••••••••••••• REfER TO ADDK * REfER TO SelLIN • XSTllN ••• 4 •••••••••••••• *** ••• REfER TO REFER TO ADDK XSUllKS * * • ••••••••••••••••••••••• REFER TO ADDK ••••••••••••• * ••••••• *4. ••• _••••••••••••• ** ••••• XSUM *•••••••••••••••••••• * •••* * REfeR TO SUM ••••••••••••••••••••••• * XVDRBV * * •••••• * •••••••• *** •••••• REFER TO XVDVBV XSUM * •••••••••••••••••••••••• REfER TO SUM •••••••••••••••••••••••• • XVDR8V * •••••••••••••••••••••••• RefER TO XVDVBV •••••••••••••••••• * ••••• .. XVDVBV .. ••••••••••••••••• * •••••• .••••••••••••••••••••••••• ......................... PROGRAM 1I STINGS • 9/29/64 • XVDVBV (SUBROUTINE) • FAP .XVDVBV COUNT 100 LBL XVOVBV XVDVBV fIX, IY,LXY, IXDVBY) ENTRY XVDRBV CIX,IY,LXY,IXDVBY) ENTRY • • •.. .. •. •. .. .." .. • • •. " • • ".. .. • • .. • .... .. • • ". .. • •.. • .. • •.. ... ... . .. .. .. .. .. .. .. . .. .. .. .. XVDVBV LAST CARD IN DECK IS NO. 0108 0001 0002 0003 0004 0005 0006 0007 +---ABSTRACT---0008 0009 TITLE - XVDVBV WITH SECONDARY ENTRY XVDRBV 0010 DIVIDE EtEMENTS OF TWO FIXED VECTORS WITH OR WITHOUT ROUNDING 0011 0012 XVDV8V DIVIDES THE ELEMENTS OF ONE FIXED VECTOR BY T~OSE 0013 OF ANOTHER. TRUNCATING FRACTIONAL PARTS. 0014 XVDRBV ROUNDS FRACTIONAL PARTS. 0015 0016 OUTPUT MAY REPLACE EITHER INPUT VECTOR. 0017 0018 LANGUAGE - FAP SUBROUTINES (FORTRAN-II COMPATIBLE) 0019 EQUIPMENT - 109 OR 7090 CMAIN FRAME ONLY) 0020 - 34 REGISTERS 0021 STORAGE 7090 709 0022 SPEED XVDVBV 41 + 149 OR 56).LXY MACHINE CYCLES. 0023 XVDRBV 43 + 151 OR 58)"LXY LXY = VECTOR LENGTH 0024 SIMPSON, AUGUST 1963 S.M. 0025 AUTHOR 0026 ---USAGE---0027 0028 0029 TRANSFER VECTOR CONTAINS ROUTINES - XDIV, XDIVR AND FORTRAN SYSTEM ROUTINES - INONE) 0030 0031 0032 F'ORTRAN USAGE CALL XVDVBVIIX,IY,LXY,IXDV8YI 0033 0034 CALL XVDRBVCIX,lY,LXY,IXDVHYI 0035 INPUTS 0036 0031 IXU) I=I ••• LXY IS A FORTRAN-II INTEGER VECTOR 0038 0039 I YI Il I=l ••• LXY IS A FORTRAN-II INTEGER VECTOR, NONI OF WHICH 0040 = 0 0041 0042 0043 LXY SHOULD EXCEED 0 0044 0045 STRAIGHT RETURN WITH NO OUTPUTS IF LXY LSTHN 1 OUTPUTS 0046 IXDVBY(II I=l ••• LXY IS IXDVBYIII = IXIII/IYIII , 0047 0048 TRUNCATED IF XVDVBV IS USED, ROUNDED IF XVDRBV IS USEO. 0049 0050 DIVISIONS ARE PERFORMED BY XDIV AND XDIVR FUNCTIONS IN 0051 WHICH DIVISION BY ZERO GIVES RESULT EQUAL TO NUMERATOR 0052 0053 AND THE DIVIDE CHECK INDICATOR IS NOT TURNED ON • 0054 EOUIVALENCE (IXDVBY, IX OR IYI IS PERMITTED • 0055 0056 0057 EXAMPLES 0058 1. INPUTS - IXII ••• 5) = 1,2,3,4,5 IYl1 ••• 5) 4.4.4,4,4 fZ~O 0059 USAGE CALL XVDVBVIIX,IY.5,1011 0060 CALL XVDRBVIIX,IY,5,I021 0061 0062· CALL XVDVBVIIX,lY,l,IYI CALL XVDVBVIIX.IY.-1,IZI 0063 OUTPUTS - 10111 ••• 5) • 0,0,0,1,1 10211 ••• 5) 0,1,1.1,1 0064 IYl11 ~ 0 IZ = 0 INO OUTPUT CASE I 0065 0066 0067 PROGRAM FOLLOWS BELOW 0068 0069 TRANSFER VECTOR CONU INS XOIV AND XDIVR FUNCTIONS 0070 HTR o XRl 0071 HTR XR4 0072 o 1,XVDVBV BCI 0073 PRINCIPAL ENTRY. XVOVBVtIX,IY,LXY,IXDVBY) 0074 = • .......................... • • XVDVBV • • • • • • • • •4 • • • • • CPAGE PROGRAM LISTINGS ** ••••••• 2) XVDVBV CLA DIV VARY SETUP STO SXD XVDVBV-3,1 SXD XVDVBV-2,4 1,4 Kl CLA Kl A( IXHI ADD STA GETN 2,4 CLA A( IYHI ADD Kl GETD STA 4,4 CLA Kl ... =A( IXDVSYHI ADD STO~E STA 3,4 LXY CLA· TMI LEAVE POX 0,1 LEAVE,l,O TXL • DIVISION LOOP •• ,1 GETN CLA ""=A(IXI+l ".=A( IYI+l .·,1 GETD LDQ •• ,4 ".=$XDIV OR $XDIVR VARY TSX •• t 1 •• =A( IXDVBYI+l STORE STO GETN,l,l TIX • EIXT LEAVE LXD XVDVBV-3,1 LXO XVDVBV-2,4 TRA 5,4 .. SECOND ENTRY. XVDRBVCIX,IY.LXY,IXDVBYI XVDRSV eLA DIVR TRA SETUP • CONSTANTS $XDIV,4 DIV TSX DIVR TSX $XDIVR.4 END •••••••••••••••••••••••• * XVDVSV • ••••••••••••••••••••••• * (PAGE 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 009't 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 2) .. *. * •••• _*j*.'. ** •••••• * *. .• _...................... .* XVMNSV REFER TO VPLUSV •••••••••••••••••••••••• XVPLSV •••••••••••• • *** •••• ** •••• •••••••••••••••••••••••• XVTMSV *••••••••••••••••••• **-*-* • XVMNSV • •••••••••••••• ** •••••••• REFER TO VPU:JSV ••••••••• * •••••••••••• ** • XVPLSV • •••••••••••••••••••••••• •••••••••• ** •••••• *.* ••• * XVTMSV * *••••• a* ••••• _••• _•••••• REFER TO VTIMSV REFER TO VTIMSV •••••••••••••••••••••••• ..... _.• XWHICH • _.......•..... _ REFER TO WHICH •••••••••••••••••••••••• REFER TO VPLUSV REFER TO VPLUSV .. PROGRAM LISTINGS •••••••••••• ******.* ••• * • XWHICH * • ••• * •••••••••• __ ••••••• REFER TO WHICH •••••••••••••••••••••••• .......................... .. ZEFBCD .. ZEFBCD 'FUNCTION I • FAP .ZEFBCD COUNT 100 LBL lEFBCD lEFBCD FI ITAPEI ENTRY lEFBIN F(lTAPEI ENTRY • • • • • .. • •. .... • •.. .. • .. .. .. •. .. .. .. ... • .. .• .•. .. .. . •. .• .. • ..... .. . ..• .. .... ... .. ... . • • • PROGRAM LISTINGS • ••••••••••••••••••••••• • ZEFBCD • • ••••••••••••••••••••••• LAST CARD IN DECK IS NO. 012B 0001 0002 0003 0004 0005 0006 0007 OOOB 0009 ----ABSTRACT---0010 0011 TITLE - IEFBCD WITH SECONDARY ENTRY IEFBIN 0012 TEST IF NEXT TAPE RECORD IS END OF FILE AND REPOSITION TAPE 0013 0014 ZEFBCD READS ONE BCD RECORD AND CHECKS TO SEE IF THAT 0015 RECORD WAS AN END OF FILE. IT BACKSPACES OVER THE RECORD 0016 BEFORE RETURNING. A REDUNDANCY INDICATION IS PROVIDED • 0017 001B ZEFBIN DOES THE SAME THING FOR A BINARY TAPE. 0019 0020 0021 LANGUAGE - FAP SUBROUTINE 0022 EQUIPMENT - 709 OR 7090 (MAIN FRAME AND TAPE DRIVEl 0023 - 54 REGISTERS STORAGE 0024 SPEED 0025 AUTHOR - J.N. GALBRAITH. JR. 0026 0027 0028 ----USAGE---0029 0030 TRANSFER VECTOR CONTAINS ROUTINES - NONE 0031 AND FORTRAN SYSTEM ROUTINES - IIOS).IRDSI.IRCHI.ITCOI,(TRCI. 0032 ITEFI.IBSRI 0033 0034 FORTRAN USAGE 0035 ENDFIL=ZEFBCDFIITAPEI 0036 ENDFIL=ZEFBINFIITAPE) 0037 003B 0039 INPUTS 0040 0041 I TAPE LOGICAL TAPE NUMBER TO BE CHECKED • 0042 0043 0044 OUTPUTS 0045 0046 FLOATING POINT INDICATOR. ENDFIL 0047 O. IF END OF FILE 0048 = 1. IF NO END OF FILE 0049 =-1. IF REDUNDANCY FOUND (READ TEN TIMES). 0050 A REDUNDANCY WILL NOT BE SIGNALLED IF BOTH THE 0051 REDUNDANCY INDICATOR AND END OF FILE INDICATOR ARE 0052 TURNED ON, BUT THE END OF FILE WILL BE SIGNALLED • 0053 0054 0055 EXAMPLE 0056 0057 lTP = 9 1. USAGE 0058 REWIND ITP 0059 A = 6HCARD 1 0060 WRITE OUTPUT TAPE ITP. 10. A 0061 10 FORMATlA61 0062 END FILE ITP 0063 REWIND ITP 0064 ENDFLI = ZEFBCDFIITPI 0065 ENDFL2 = IEFBINFIITP) 0066 READ INPUT TAPE ITP, 10. A 0067 ENDFL3 = ZEFBCDFIITPI 0068 ENDFL4 = ZEFBINFIITP) 0069 REWIND lTP 0070 WRITE TAPE ITP. A 0071 END FILE ITP 0072 REWIND ITP 0073 ENDFL5 ZEFBINFIITP) 0074 ENDFL6 = ZEFBCDFIITP) = 9/8/64 •••••••••••••••••••••••• ZEFBCO ••••••••••••••••••••••••• • (PAGE PROGRAM LI STI NGS 2) • OUTPUTS • OUTPUTS - ENDFL1 ••• 6 * * • PROGRAM FOLLOWS BELOW * PZE BCI 1,IEFBCO ZEFBIN SSP ADO BINARY ZEFBCD SSP STO TAPE SXA RETURN,1 SXA RETURN+1,2 SXD ZEFBIN-2,4 TAPE CAL St IDS) ,4 TSX AXT 1,1 READ XEe* t.I RDS 1 S(ReH) LDQ* SLQ H-1 RCHA 10 S(Teo) LDQ* SLQ Teo S(TEF) LOQ* SLQ TEF $(TRe) LOQ* SLQ TRe SLQ SETOFF reo TeOA * TFF TEFA ENOFIL TRe TReA REDUNO $(BSR) XEe* eLA ONE RETURN AXT ·.,1 •• ,2 AXT LXD lEF8IN-2,4 SETOFF TReA *+1 TRA 1,4 $(BSR) ENDFIL XEe* eLA ZERO TRA RETURN $(BSR) REDUND XEe* TXI *+1,1,1 TXL READ,l,10 ONE eLS TRA RETURN ZERO PZE 0 ONE DEC 1. TAPE PZE BINARY PZE 16 DUMMY,0,1 10 lOCO CUMMY PZE END • ••••••••••••••••••••••• ZEFBCO • • ••••••••••••••••••••••• • (PAGE 1., -1., 0., 0., 1., -1. SET FOR BINARY MODE 0075 0076 0077 0018 0079 OOBO 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095 0096 0091 0098 009\} 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 21 •••••••••••••••••••••••• ZEFBIN • •••••••••••••••••••••••• • REFER TO ZEFBCO PROGRAM LISTINGS •••••••••••••••••••••••• • ZEFBIN • • ••••••••••••••••••••••• REFER TO ZEFBCO
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.3 Linearized : No XMP Toolkit : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:56:37 Create Date : 2014:04:16 10:53:49-08:00 Modify Date : 2014:04:16 10:45:03-07:00 Metadata Date : 2014:04:16 10:45:03-07:00 Producer : Adobe Acrobat 9.55 Paper Capture Plug-in Format : application/pdf Document ID : uuid:6d3576e3-bf6f-044f-b712-b1447c73e265 Instance ID : uuid:b9b5cd60-3d82-0748-9d70-843b61a6a4a8 Page Layout : SinglePage Page Mode : UseOutlines Page Count : 1118EXIF Metadata provided by EXIF.tools