September 15, 1984

Work Performed Under Contract No. AM04-80AL13137

Jv: "" .. vr~ 1985

liBRARY ~OPY

LANGLEY RESEo'IRCH CENTER

LIBRo'IRY, No'ISA

HAMPTOl'j, VIRGINIA

fuffi~c:.?1~ n\.\ \~

DOE/J PL-1 060-78

(DE85004584)

SOFTWARE USED WITH THE FLUX MAPPER AT THE SOLAR PARABOLIC

DISH TEST SITE

By

C. Miyazono

Jet Propulsion Laboratory

Pasadena, California

Technical Information Center

Office of Scientific and Technical Information

United States Department of
DISCLAIMER

This report was prepared as an account of work sponsored by an agency of the

United States Government. Neither the United States Government nor any agency

thereof, nor any of their employees, makes any warranty, express or implied, or

assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents

that its use would not infringe privately owned rights. Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or any agency thereof.

The views and opinions of authors expressed herein do not necessarily state or

rencct those of the United States Government or any agency thereof.

This report has been reproduced directly from the best available copy.

Available from the National Technical Information Service, U. S. Department of

Commerce, Springfield, Virginia 22161.

Price: Printed Copy A04

Microfiche AOl

Codes are used for pricing all puhlications. The code is determined by the number

of pages in the publication. Information pertaining to the pricing codes can be

found in the current issues of the following publications, which are generally available in most libraries: Energy Research Abstracts (ERA); Government Reports

Announcements and Index (GRA and I); Scientific and Technical Abstract

Reports (STAR); and publication NTIS-PR-360 available from NTIS at the above

address.
"-"'_~__""' - '-- .J.--~ ~~_,-' _

5105-141

Solar Thermal Power Systems Project

Parabolic Dish Systems Development

Software Used with the

Flux Mapper at the Solar

Parabolic Dish Test Site

C. Miyazono

September 15, 1984

• Prepared for

U.S. Department of Energy

Through an Agreement with

National Aeronautics and Space Administration

by

Jet Propulsion laboratory

California Institute of Technology

Pasadena, California

JPL Publication 84-76

DOE/JPl-l06Q-78

(jPL-PUB-84-76)

(DE85004584)

Distribution Category UC-62

ABSTRACT

Software for data archiving and data display was developed for use on a

Digital Equipment Corporation (DEC) PDP-II/34A minicomputer for use with the

JPL-designed flux mapper. The flux mapper is a two-dimensional, high radiant

energy scanning device designed to measure radiant flux energies expected at

the focal point of solar parabolic dish concentrators. Interfacing to the DEC

equipment was accomplished by standard RS-232C serial lines. The design of

the software was dictated by design constraints of the flux-mapper controller.

Early attempts at data acquisition from the flux-mapper controller were not

without difficulty. Time and personnel limitations resulted in an alternative

method of data recording at the test site with subsequent analysis accomplished

at a data evaluation location at some later time. Software for plotting was

also written to better visualize the flux patterns. Recommendations for

future or alternative development are discussed. A listing of the programs

used in the analysis is included in an appendix.

iii
ACKNOWLEDGMENT

The work described herein was conducted by the Jet Propulsion

Laboratory, California Institute of Technology, for the U.S. Department of

Energy through an agreement with the National Aeronautics and Space

Administration (NASA Task RE-152, Amendment 327; DOE/ALO/NASA Interagency

Agr8ement No. DE-AM04-80AL13137).

iv
II.

III.

IV.

CONTENTS

INTRODUCTION . • • • • • • • • •

A. OVERALL DESIGN PHILOSOPHY

B. DATA-ACQUISITION HARDWARE

C. GENERAL PRACTICAL RESTRICTIONS

INITIAL DATA-LOGGING ATTEMPTS

A. DESIGN PHILOSOPHY

B. AVAILABLE HARDWARE

C. SOFTWARE WRITTEN •

D. PROBLEMS ENCOUNTERED

LOGGING METHOD USED

A. DESIGN PHILOSOPHY

B. AVAILABLE HARDWARE

C. SOFTWARE WRITTEN •

D. PROBLEMS ENCOUNTERED

E. SOFTWARE UPDATES • .

DISPLAY SOFTWARE • • • •

A. DESIGN PHILOSOPHY

B. AVAILABLE HARDWARE

C. SOFTWARE WRITTEN.

v

1-1

1-1

1-2

1-2

2-1

2-1

2-1

2-1

2-4

3-1

3-1

3-1

3-1

3-2

3-2

4-1

4-1

4-1

4-1
v. RECOMMENDATIONS AND CONCLUSIONS

A. SOFTWARE RECOMMENDATIONS

B. HARDWARE RECOMMENDATIONS

C. CONCLUSIONS ••••••

5-1

5-1

5-1

5-2

APPENDIXES

A.

B.

LIST OF COMPUTER PROGRAMS •• • •

TYPICAL PLOTS OF FLUX-MAPPER DATA.

A-I

B-1

Table

I. Data File Structure . . . . . . . . . . . . . . . . . . . .

V1

2-2
A. OVERALL DESIGN PHILOSOPHY

SECTION I

INTRODUCTION \

The flux mapper is a three-dimensional scanning system to measure the

high radiant flux levels expected at the focal point of a solar parabolic dish

system. The scanning, measurement, and initial storage of the data are

handled by the flux-mapper~ controller. Software was written to enable a

Digital Equipment Corporation (DEC) PDP-11/34A minicomputer to archive the

data for long-term storage and to display the data collected from the

flux-mapper controller in different formats.

The overriding system requirement for the software was compatibility

with the output of the flux-mapper controller. The design, fabrication, and

software control of the flux mapper were carried out by JPL personnel. The

flux-mapper controller is a microprocessor-based system using read-only memory

(ROM) to store the acquisition and output routines. Consequently, changes in

the software routines from the flux-mapper controller are more difficult to

achieve. It was decided that the requirement for compatibility'would rest

with the PDP-11/34A because the programming was to be done using standard

Fortran IV language and compiler. Therefore, changes in gathering of the data

from the controller could be made quickly.

Another important design requirement was ease of use in the field. The

flux mapper was to be used at the Parabolic Dish Test Site (PDTS) located at

the JPL Edwards Test Station (ETS) in the high desert, 120 km northeast of JPL

(in Pasadena). The personnel at the PDTS were not extensively trained in

minicomputer programming. Also, the small size of the staff precluded the

availability of an individual dedicated to the minicomputer system.

Therefore, the staff at the PDTS did not have the time nor the expertise

to perform significant minicomputer tasks.

Finally, it was felt that error checking of the incoming data from the

flux-mapper controller should be included. Incorrect characters would

obviously be detrimental to output displays and listings as well as to the

archived data. Because the PDP-l1/34A minicomputer would receive data from

the flux-mapper controller, error checking could only be done as the data were

received. This precludes the use of standard methods such as checksums;

therefore, a different approach had to be used.

The three above-mentioned overall design requirements were the basis by

which all software was designed. These initial decisions were made during the

end of 1979 when discussions were first taking place regarding the flux mapper

and its interface with the data-acquisition minicomputer system at the PDTS.

1-1
B. DATA-ACQUISITION HARDWARE

The data-acquisition hardware available at the PDTS consisted of a

Digital Equipment Corporation PDP-ll/34A minicomputer with two removable RKOS

disk drives and 256 kilobytes of internal memory. The system also had as

supporting peripherals a Kennedy Model 9100 magnetic tape drive, a Versatec

Model 1100 printer/plotter, and a Control Data Corporation Model 9766

removable disk drive. In addition, there were interfaces for the various

terminals used as well as additional serial ports for access by other devices

such as the data loggers. The entire minicomputer system was housed in a

mobile trailer located adjacent to the PDTS control room at the test site.

All connections between the minicomputer, the terminals, and data loggers

(with the exception of the console terminal) were by RS-232C standard serial

interfaces. The console terminal communicated by the standard 20-milliamp

current loop.

C. GENERAL PRACTICAL RESTRICTIONS

A significant restriction that was not expected occurred as a result of

the operating system used. The multi-user system supplied by Digital

Equipment Corporation (DEC) called RSX-IIM was used during the entire period

of development. Unlike the DEC single-user system, the RT-ll, their

multi-user system would not permit the use of a ring buffer to store input

data. During each cycle, the operating system polls all input devices to

determine if a task has been initiated. During this polling procedure, inputs

to other ports are not placed into ring buffers for temporary storage until

they are polled in turn. This resulted in the possibility of losing input

characters from a device while the operating system was polling other devices.

With this problem in mind, it became clear that during transfer of data

from the flux-mapper controller to the PDP-ll/34A the possibility of data loss

would be great if this polling mechanism were left intact. This could cause a

significant restriction of implementation of the data-acquisition and

archiving software.

1-2
SECTION II

INITIAL DATA-LOGGING ATTEMPTS

A. DESIGN PHILOSOPHY

During the initial phases of the development of the necessary software,

the same general design criteria stated previously were used. Compatibility,

ease of use, and error checking were of foremost importance in the design of

the software.

During software development, accessibility of the flux mapper for

testing was limited. Therefore, much of the development of the software had

to be done without access to the actual hardware. This necessitated the

inclusion of ease of hardware interfacing as a design criterion. And finally,

because the equipment was to be used at the PDTS, where the personnel did not

have minicomputer or microprocessor expertise, minimal interfacing in terms of

training and operator instructions was a desirable criterion.

B. AVAILABLE HARDWARE

The available hardware was discussed previously. The flux-mapper

controller output, basically an RS-232C serial interface line, was connected

to one of the serial inputs of the minicomputer.

C. SOFTWARE WRITTEN

The initial software written consisted of a data-acquisition program and

a data-output program. Both were written in Fortran IV for the DEC PDP-ll/34A

minicomputer using the RSX-llM operating system.

The data-acquisition software was written to read the seven-bit ASCII

characters that are transmitted from the flux-mapper controller. The format

for the data from the flux-mapper controller consists of three types of

records: a header record, a set of data records, and an end record.

Each record was identified by a one-character ASCII identifier, followed

by the data in a fixed structure. The structures of each type of record are

given in Table 1. Note that there was only one header record and only one end

record, but there could be many data records.

Each data record represented one traverse of the radiometer probe across

the flux mapper. At the end of the traverse, the probe incremented in the

perpendicular direction by a preset amount and continued its traverse in the

opposite direction. This boustrophedonic motion is evident in the data

records as alternating signs on the X spacing entry.

2-1
Table 1. Data File Structure

Header Record, Once/Scan

Header Record Code tlH"

Metric/English "M" or "E"

Probe Calibration

Module ID

Test Number

Run ID

Scan ID Number

Software Update Number

Hour

Minute

Second

Month

Day

Year

Probe Type

Scan Type til" = Rectilinear

Channel o Amp Ratio Code

Channel 1 Amp Ratio Code

Channel 2 Amp Ratio Code

Channel 3 Amp Ratio Code

Scale Factor Code

Number of Raster Repeats

Spacing X

Raster X Delta

Raster Y Delta

Initial X Position

Initial Y Position

Initiill Z Position

Zero X position

Zero Y position

Zero Z position

2-2

Al

Al

A6

A2

14

12

13

14

12

12

12

12

12

12

11

11

11

11

11

11

11

12

F6.2

F6.2

F6.2

F6.2

F6.2

F6.2

F6.2

F6.2

F6.2
Table 1. Data File Structure (Cont'd)

Header Record, Once/Scan

Zero Data Value

Reference Intensity Value

Local Intensity Value

Data Record, Once/Line of Scan

Data Record Code IIn"

Number of Data Points

Hour

Minute

Second

Spacing X and Direction (sign)

Reference Intensity at Time HH:MM:SS

X Position of Data Point 1

Y Position of Data Point 1

Data Point 1

Data Point 2, etc.

End Record, Once/Scan

End 0 f Scan Code "E"

Reference Intensity

Check Sum of Absolute Value of

All Data Points

Summation Value (Negative = Overflow)

Points Summed

Number of Lines

End Hour

End Minute

End Second

End of Scan Character "! It

2-3

F6.2

F6.2

F7.2

Al

13

12

12

12

F6.2

F6.2

F6.2

F6.2

F6.2

F6.2

Al

F6.2

F12.2

19

14

13

12

12

12

Al
All entries in all the types of records were separated by a comma. All

numerical entries were ASCII characters, with or without a leading positive or

negative sign. All floating point numbers required a decimal point in the

entry while integers did not. The only character that was not from the above

list was the last character of the scan. This character was an 11!", ASCII

code octal number 41.

The acquisition software accessed the data port and verified the

character type and structure of each record. If both were correct, then the

information was decoded from ASCII to binary numbers when appropriate and

stored on magnetic tape in a binary data file. This procedure was to be

accomplished at the end of each complete raster of the flux mapper. At that

time, the flux-mapper memory would be initialized and the next raster would be

taken.

The initial version of the data-output program was designed to read the

binary data file on magnetic tape and print out the numbers as they were

gathered from the flux mapper. No initial processing other than formatting of

the data was to take place.

D. PROBLEMS ENCOUNTERED

Several immediate problems were encountered using these initial versions

of the software, including polling with the operating system and transmission.

The latter problem was never solved.

As mentioned previously, the polling problem with the operating system

placed a severe restriction on data acquisition. During the polling of all

serial inputs, the operating system stores characters in a buffer for only the

serial input being polled. The other inputs are ignored. The flux-mapper

controller transmitted data to the serial port at a regular pattern regardless

of the status lines in the RS-232C cable. This regular transmission pattern

occasio~ally overlapped with the operating system's polling of the other

ports •. The result was that the character transmitted at that time was lost.

To overcome this problem, the priority of the data acquisition task was

altered.

The RSX-llM operating system features a series of priority levels at

which tasks can be assigned. All tasks with the same priority are polled in a

round-robin fashion, and all of the users with the same priority level are

given an equal opportunity to use the resources of the central processor unit

(CPU). Normally, tasks are given a priority level of 50 out of a maximum of

250. Some tasks that require more of the CPU's resources are assigned higher

priorities. An example of this is the text editor. It is normally

installed at a priority of 65 because its interactive nature requires more of

the CPU's resources.

The data-acquisition program required all of the CPU's resources for

recording transmitted data from the flux-mapper controller. The acquisition

program was installed at a high priority, 249, prior to execution. At

execution, this task occupied virtually all of the CPU's resources and,

2-4
therefore, gathered all the data without difficulty. However, monopolizing

all of the resources essentially rendered the multi-user system a single-user

system.

During initial use of the acquisition software, it was found that decode

errors were occurring in the data string. These errors occurred randomly in

the string, but in each occurrence the program would abnormally exit and

abnormally close the binary data file on magnetic tape as a file of zero

length. This was particularly annoying when the program would fail and all

but the last few scans had been transmitted. In addition, this zero-length

file on magnetic tape presented problems of playback of subsequently recorded

data and also used a file name for null data.

It was suggested that perhaps the flux-mapper controller had transmitted

the incorrect character, causing the program to fail. This was checked by

recording the output of the flux-mapper controller onto a digital data

cassette tape unit. When several runs of the same set of data were recorded

onto the cassette, a direct playback showed that these errors did not occur in

every run nor at the sa~e location of the run in which they occurred.

It was decided that, to minimize the procedure for the personnel at the

PDTS, the option of the analysis and printout immediately after a test was

abandoned. Instead, the acquisition of the data was ensured in a simple way.

The method used was the digital data cassette recorder mentioned above. At

the end of each raster scan, the PDTS personnel transmitted the data from the

flux-mapper controller to the digital data cassette three times. The cassette

was then sent to JPL for archiving and printout. The three runs ensured that

at least one complete and correct run had been stored.

The digital data cassette recorder presented its own set of problems.

In the record mode, the cassette fills a buffer and then transfers the data to

tape in a single block. If the recorder was switched from the record mode,

the data in a partially filled buffer was not transferred to tape; it was

lost. Therefore, the recorder, once set to record mode, was left in record

mode until all rasters of all the tests had been recorded for that particular

day. The recorder presented a problem when tapes were recorded on

one side and then reversed. Data on the first side appeared to be erased.

The staff at the PDTS was instructed not to reverse the tapes. With these

instructions, the data was archived and printed at JPL at a later time.

Finally, the use of the digital data cassette recorder allowed the

PDP-ll/34A to be used to acquire data from the Acurex Autodata-Nine data

logger during the f1ux-mapper runs. The data-acquisition program monitored

the data for various warnings, such as low cooling water flow, and displayed

this information on a monitor. The data-acquisition program for the data

loggers and for the flux-mapper controller are mutually exclusive tasks

because of the nature of the operating system. It was felt that the warning

alarms were an additional bonus.

2-5

SECTION III

LOGGING METHOD USED

A. DESIGN PHILOSOPHY

The software was designed with three general design criteria in mind:

compatibility with the f1ux-mapper controller, ease of use in the field, and

error-checking capability. A large trade-off resulted for the criterion of

ease-of-fie1d use; thus, processing the data was made much more difficult.

B. AVAILABLE HARDWARE

The digital data cassette recorders, originally purchased as a backup

unit for the data loggers, proved to be the important link between the

flux-mapper controller and the PDP-11/34A. Two recorders, one at the test

site for the recording of data and one at JPL for playback of data, were

available. The one at the test site was set to the output characteristics of

the flux mapper. The unit at JPL for data replay was set to an available

port. The tapes used were cassette tapes of digital computer quality that

contained archived as well as processed data.

C. SOFTWARE WRITTEN

The use of the digital data cassette recorders altered the original

software tasks. The software tasks were subsequently divided into three

parts: (1) software to read the data from cassette tape and write onto a disk

storage medium, (2) software to read from the disk storage medium and transfer

to a nine-track magnetic tape for archiving, and (3) software to print out the

results from magnetic tape.

The program to read the data from cassette tape and place it onto disk

storage media was called CASTAP.FTN. This program had to be an installed tasK

with logical unit number 3 reassigned to the input port. This task also

required a high priority to bypass the polling option. (See the RSX-IIM V.3.1

operator's manual for details.)

The program CASTAP transferred a given raster scan from the data

cassette to a file on disk. The actual ASCII characters were transferred

no conversion of any type was made on the data elements. The program allowed

the entry of the disk file name and allowed the selection of the scan to be

stored on disk. The scan numbering system started with the present scan and

incremented each time that the end of scan character, the "!", was found. At

the conclusion of the data transfer to disk, the cassette recorder was turned

off by the program.

3-1
The next step was to visually check the data file for incorrect

characters. This was a rather poor method of error checking, but considering

the limits of time and personnel available, it was the only one possible. The

most common extraneous characters found in a record were lower-case characters

and carriage returns embedded in data records. On finding errors, one of two

options was available. The entire scan could be rerecorded, using one of the

other three scans recorded; or a visual inspection of the data cassette

rasters, using the data cassette recorder playing back directly into a

terminal, would display the data from one of the other scans. The data in the

disk file could then be changed to the correct value by using the text

editor. To ensure that the file was examined, a comma, II,", had to be added

to the end of the disk data file following the end of raster character, the

"!ll. If this comma were not added, then the file was deemed incomplete, and

the archiving program would abort abnormally.

The program to transfer the data from disk to a binary file on

nine-track magnetic tape was called FMPCAS.FTN. This program read the ASCII

file on disk, checked the record structure, decoded the ASCII to binary, and

stored the binary in a nine-track magnetic 'tape to be initialized, if new, and

be software-mounted. The magnetic tape file was opened as a Fortran logical

unit and interfaced with the operating system.

Once the program had been transferred to magnetic tape, the data could

be printed out onto the line printer using the program FMPRINT.FTN. This

program required the input of the data file name as well as requiring that the

magnetic tape be mounted. Each file had to be called separately for printing;

however, several copies could be produced with each call of this program.

D. PROBLEMS ENCOUNTERED

The problems with the software were quite evident. The delay between

acquisition at the PDTS and the final printout, the slowness of the

acquisition itself, and the tedious data scanning using the editor were all

problems that would have been attacked, had there been time and personnel

available. Twice a year, perhaps, rasters were taken over the course of a

two-week period. This operation, therefore, was relatively infrequent and not

commanding priority of time and personnel.

E. SOFTWARE UPDATES

From this version of the acquisition software, a major alteration to the

data format was executed by the flux-mapper-controller programming group.

Engineers analyzing the flux-mapper data requested time information for each

scan. Because a typical complete raster would normally take from one-half

hour to one-and-one-half hours, it was felt that these data would be very

important in correlating the flux-mapper intensities to weather data such as

insolation. The programmers added time information at the beginning of each

data record. In addition, the output order was changed to its present

boustrophedonic form. Both these changes occurred in June 1981. The software

used for data acquisition included these changes. The plotting software (see

below) included both formats.

3-2
SECTION IV

DISPLAY SOFTWARE

A. DESIGN PHILOSOPHY

It was decided that a three-dimensional plot of the flux-mapper

information would be the best way to represent the data for quick review.

(See Appendix B.) It was felt that the plots should be easily understandable.

Flexibility in plotting was also considered an important criterion. Viewing

the flux map from various angles would greatly aid in understanding the resulting patterns. The plots were designed to provide the data in a uniform manner

to allow easy comparison between rasters of different distances from the focal

plane.

B. AVAILABLE HARDWARE

The same basic minicomputer hardware was available. For printing and

plotting, a Versatec Model 1100 electrostatic printer/plotter was used. The

associated software to interact with the plotter portion of the device was

purchased also from Versatec specifically for RSX-llM version 3.1.

C. SOFTWARE WRITTEN

The display software was a set of programs to input, reformat,

calculate, and plot the flux-mapper raster data into a three-dimensional plot

viewed from any location. The software was modeled after a plotting package

in use on the Univac 1100 computer at the time-of-tllis development. Because

of the size of the task involved, th~_ee---s-e-parate major programs were written,

along with several other min~~_programs.

The first-minot: program, TPDK. FTN, read the data from the nine-track

magnetic-tape and transferred it to a general file on disk in the appropriate

format. The same general file name on disk was used each time the program was

called. Because the program accessed the tape file as a Fortran logical unit,

the magnetic tape had to be software-mounted.

The first major program, GPLOTlD.FTN, read the data from the disk file

and reformatted it for use by the other plotting routines. This routine also

determined the type of plot desired, such as which view and the presence of

contour lines.

The second major program, GPLOT2D.FTN, performed the actual

three-dimensional calculations, including the hidden line algorithm. The

results were then placed in a file for final plotting in the last phase.

4-1
The third major program, PLOTERD.FTN, took the output from the previous

file and created the Versatec plotter file. In this program, all of the

interfacing to the Versatec software was included. A short, 30-character

title was also requested as well as changes in scale factor. The resulting

files, VECTRI.BIN and FARM.BIN, contain the.plotting instructions for the

Versatec plotter.

The last step

program, RASM. TSK.

the actual plots.

was to invoke the plotter, using

This program accessed VECTRI.BIN

the

and

Versatec-supplied

PARM.BIN to produce

A set of modified versions of the major plotting programs was created

for use at the PDTS. The number of optional features, such as viewing

location, were fixed. These were denoted as FPLOTI.FTN, FPLOT2.FTN, and

PLOTER.FTN.

A second set of modified versions was created to view the plot from

directly overhead, namely, a contour plot showing isointensity lines of solar

radiation. The same general steps were followed in this set of programs,

named CPLOT.FTN, CDRIVE.FTN, and SUMRAD.FTN.

These plots, combined with the data printouts, provided a complete

picture of the solar irradiation.

4-2
SECTION V

RECOMMENDATIONS AND CONCLUSIONS

A. SOFTWARE RECOMMENDATIONS

The software recommendations discussed here would have been implemented,

given sufficient time and personnel. Because of the software's infrequent

use, most of the changes and modifications were made either just prior to or

immediately after its use, when its priority was high.

The plots and data printouts were analyzed and used by JPL personnel.

The filing system that was used did not match the one used by the dataacquisition software. Much of the correlation of older data has been from

descriptive information included on the plots and printouts. It would have

been very useful to provide more space for descriptive information on both the

plots and printouts.

The operating system and the problem with the system polling may have

required some system programming modification. At the time, no available

personnel had the expertise to examine the problem. Also, the operating

system was an older, unsupported version. The newer versions may, in fact,

alleviate or mitigate this buffer/polling problem.

The tedius work of going through the disk file after transfer from the

digital data cassette using the text editor might have been alleviated by a

program that would scan the ASCII data for inappropriate characters. Time did

not permit the writing of this program.

Finally, with the correct type of hardware, it should be possible to

reproduce the three-dimensional flux-mapper plots on a video terminal equipped

for graphics output. With interactive features, this would allow for easier

interpretation of data plots.

B. HARDWARE RECOMMENDATIONS

During the initial checkout of the software, the unavailability of the

flux-mapper hardware made correction and modification difficult. It would

have been helpful if a hardware simulator had been available. An alternative

would have been to perform all of the development work, both hardware and

software, in one location.

The Versatec printer/plotter was an older model, no longer in production.

It normally required several minutes to produce a plot. A faster plotter

would have been useful.

5-1
C. CONCLUSIONS

The flux-mapper software, as the flux mapper itself, was a lahoratory

tool. Although the use of the software was cumhersome at times, it

consistently provided useful plots and printouts to evaluate the performance

of point-focusing paraholic dishes.

5-2
APPENDIX A

LIST OF COMPUTER PROGRAMS

This Appendix contains one of the representative sets of programs used

to analyze and plot the flux-mapper data. The set included herein is the

standard set used for analysis of most flux-mapper runs. This software was

available to the PDTS staff; analysis of data contained on digital cassettes

was usually performed at the main JPL facility.

The programs included in this representative set of software are

FMTPDK.FTN

FPLOTI.FTN

SET32.FTN

CLSET.FTN

FPLOT2.FTN

SEG.FTN

CTCELL.FTN

DRAW.FTN

PLOTER.FTN

Flux-mapper mag tape to disk program

First stage of the field three-dimensional plot system

Subroutine for three-space to two-space transformation

Subroutine to calculate contour values

Second stage of the field three-dimensional plot system

Subroutine to write plotting data into a file

Subroutine to compute contour lines

Subroutine to draw visible part of a line between two

points

Third stage of the field three-dimensional plot system

All of the software generated for the flux-mapper task is not included

here due to space constraints. Copies of this software were transferred to

Sandia National Laboratories-Albuquerque (SNLA) and are available through that

organization.

Major software packages developed for the flux mapper but not listed in

this Appendix include the following:

CPLOT.CMD

CPLOT.FTN

CPLOTO.FTN

CDRIVE.FTN

GPLOT.CMD

GPLOTlD.FTN

GPLOT2D.FTN

PLOTERD.FTN

SUMEVN.FTN

SUMPRT.FTN

SUMRAD.FTN

SUMRADO.FTN

SUMUP.FTN

Command file to run contour plot software system

First stage of contour plot system

First stage of contour plot system for old flux-mapper

files

Second stage of contour plot system

Command file to run generalized plot software system

First stage of generalized three-dimensional plot system

Second stage of generalized three-dimensional plot

system

Third stage of generalized three-dimensional plot system

Superimposes two flux-mapper files of unequal size

Prints flux-mapper data to printer

Integrates flux over a user-defined area

Integrates flux over a user-defined area for old

flux-mapper files

Adds the contents of two flux-maper files together

All of the above software was available for use by the PDTS staff. However,

only the standard field packages included in this Appendix were consistently

used.

~l

c

C FMTPDK.OOI

C

C Flux mapper tape to disk program.

C This progrwn is designed to

C dunp the contents of the flux mapper

C tape onto disk for plot.ting

C and other uses.

C

C JPL PFDRr. ~Jritten by Stephen !litchie

C

C .001 15-SEP-80 INITIAL VERSICN

C

C LINK: Uses standard libraries

C

c***********************************************

LOGICAL*l IY,YY,ICD,FILE(14),BK(14),IN,

*NE

DIMENSICN DTA(64), I5C(l.I( 41) ,RDrA(n4)

INTEGER ~1(3),Z,Y,HDR(9),STYPE,~y,YEAR,PJD,TPR08E,PCAL(3),SID,

*~TD,SUNO,CSF(4),SFC,TNO

REAL LIV

~TA YY/'Y'1

DATI\. FILEI I M I , I T I , 10 1 , I : I , I F I , I MI , '0 I , 10 1 , to I I 10 f , I • t , I D I ,

*'A',ITII

DATA lIml 'Ff!'I, !DRI 'PD' I, ITRI 'FE'I

ITAPE = 4

TYPE *,' Enter Flux rnarper file name in XXXX.YYY fonnat'

ACCEP1' 902,(FILE(I),I=5,14)

C TYPE Q03,FILE

CALL ASSIGN (ITAPE, FILE, 14)

OOiIND ITAPE

NO = 1

OPEN (UNIT=l,NAME='ID1P.DAP' ,TYPE='NElv' ,FCRM='UNFOR1A1TED' ,

*ACCESS='DIRECT',ASSOCIATEVAR~LE=NO,RECORDSIZE=lOO,DISP='SAVE')

READ (ITAPE)

READ (ITAPE)

READ (ITAPE)

READ (ITAPE)

READ (ITAPE)(ISCCM(I),I=l,lO)

~ITE (l'NO) (ISCG1(I),I=l,lO)

READ (ITAPE)IH

IF (!H.EQ. nm) GO TO 20

TYPE 905, III

GO TO 50

20 READ (ITl\PE)MErRIC, PCAL,~IODID,TNO, RID, SID, SUNO, 'IM,MCNI'H, ~Y,

*YEl\F,TPROBE,STYPE,CSF,SFC,NRR,SX,DX,DY,XI,YI,ZI,ZX,ZY,ZZ,ZOV,RIV,

*LIV

WRITE (1 'NO) IH,MP.rRIC, PCAL,MODID, TNO, RID, SID,SUNO, 'IM,MCNIlI,DAY,

*YEAR,TPROBE,STYPE,CSF,SFC,NRR,SX, DX,DY,XI,YI,ZI,ZX,ZY,ZZ,ZOV, RIV,

*LIV

23 READ (ITAPE)ID

IF (ID.EQ.IDR) GO TO 25

IF (ID.EQ.ITR) GO TO 29

TYPE 91O,!D

A-3
GO 'ID 50

25 REFill (ITAPE) Cl,Il,I7,I3,(DTI,(I),I=I,N)

C IF (DTA(I).GE.0.0) GO'ID 27

GO 'ID 27

C RE-QRDERING INPUT' Dl\TA

ro 26 I=5,N

JJ = [,5 - I

RDTA(JJ) = IJrA(I)

2(, CaITINUE

WRITE(1 'NO) ID,N,nta (1) ,dta (2) ,nta (3) ,nta( 4), (RDTA( I), I=0J, 60)

GO'ID 28

27 ~mITE(l'NO) ID,N,(IITA(I),I=I,N)

28 CCNrINUE

GO TO 73

29 Ca-ITINUE

Rr:AD(ITAPE)RIN, fCS, 5\', NPS,t'LINES, JER, Ifl'l, IES

HFITE (l'NO) ID,RIN,SCS,sv,m'S,~'LINES,IER,IER,IER

CLOSE (UNIT=I)

CML ClOSE (ITAPE)

50 S'IDP

901 FORlwr (AI)

902 FORMAT (201\1)

903 FORMAT (lH 10010)

904 FORMAT (111 F7. 2 )

905 FOR!'1l\T (. HEADER RECORD roES Nor ['"weB' ,A7)

910 FORlII\T (' DATA RECORD roES Nar ~1ATCH' ,".2)

DID

A-4
2)

PROGRN1 FPLOI'1

LOGICAL*l YY,DIIE(lO) ,CVILE(8) ,IY,DEIL

DIMENSICN X(33) ,Y(33) ,Z(1089) ,M(2178),

* S(6) ,DrA(40) ,Yl(33)

DIMENSICN MXS(2) ,MXF(2) ,MXJ(2) ,MYS(2) ,MYF(2) ,MYJ(

,NVAL

,NCL ,

*

*

*

C<M1CN /SRFBU</ LIMU(1024),LIML(1024) ,CL(41)

* IL,FACI' , IRaI' I NDRZ

NUFPER ,NRSWT ,BIGD , LMIN

UMAX , \'MIN , \'MAX , RZERO

NQFFP ,NSPVAL ,SPV ,BIGEsr

C<MICN /fWP2l/ XXMIN ,X»1!\X ,YYMIN ,YYMAX

* ZZMrn, ZZMAX , IELCRT I EYEX

EYEY ,EYEZ

CCMlCN /SET/CIIAL(10) ,OCHAR ,IHEAD(10),XDIsr,NCN

CCM1CN / SE'IN/ NN

DlI.TA BEIL/"7/

DATA SPVAL, IOFFP/O.O, 0/,YY/'Y' /

DATA STEREO /0.0/

DATh IFR, ISTP, IRars, IDRX, IDRY, IDRZ, lUPPER, ISKIRr,OCUV

1, 0, 0, 1, 1, 0, 0, 0, 6/

DlI.TA THE:rA, HSKIRJ', C1U,CLO,CINe/

.02, 0., 0., 0., 0./

DATA S/40.,lO.,10.,0.,0.,0./~~,NX,NY,NCi~/33,33,33,10/

NRSWT = 0

lEND = -9999

ISPVAL = -999

BIGEST = l.E37

END = -9999.

N:) = 1

TYPE *,' THIS PROGRN1 PERFOR-IS A 3-D PIm OF Fl1JX MAPPER Dl\TA'

OPEN(UNIT=4,NI\ME='TEMP.DI\P' ,TYPE='OW' ,FOR-I='UNFOR-IATTED',

lACCESS=' DIRECT' ,ASSCCIATEVARIAIlI.F.=NO, PECORffiIZE=lOO)

FORMAT (lOAl)

FORMAT (Ml)

CCNTINUE

TYPE *,' Enter mrnber of X points in scan, INTEGER'

ACCEPr 911,NX

TYPE *,' Enter mrnber of Y lines in scan, INTEGER'

ACCEPr 911,NY

FO~1I\T (IS)

FO~!AT (10A2)

TYPE *,' Do you '!ant Front!l) or Side(2) view? Enter 1 or

* 2 INTEGER'

ACCEPT 911,NV

IF (NV.EQ.l) GO TO 304

S(l) = 10.

S(2) = 40.

CCNTINUE

FORMAT (F7.2)

TYPE *, ' Do you want contours? Y(es) or N(O)'

ACCEPT 905, IY

IF (IY.Gr.8288) IY = IY - 32

IF (IY.EQ.YY) IDRZ = 1

READ (4'NO)

READ (4'NQ)IH,MM,Ml,M2,M3,M4,M5,M6,M7,M8,M9,N,Nl,N2,N3,N4,N5,N6,

*

*

*

911

907

304

908

305

905

906

30

A-5
* ,'J?, N8, N9,II, 12, 13, roX,Xl,X2,X(l) ,X3,X4 ,X5, Xo,X7, X8,X9,XI0

IF (I2.EO.0) AIJ = .0125

IF (I2.EO.I) AIJ = .5

IF (I2.EQ.2) AIJ = 1.

IF (I2.FC.3) AIJ = 2.

IF (I2.FO.4) AIJ = 5.

IF (I2.EQ.5) AIJ = 10.

IF (I2.EO.6) AIJ = ~O.

IF (I2.FQ.7) AIJ = 50.

IF (I2.EQ.r) AIJ = 100.

IF (I2.EQ.9) AIJ = 200.

m 31 I=2.NX

X(I) = X(I-l) + DCX

31 CCNl'INUE

XIG = X(l)

X2G = X(NX)

KSI'rI' = 0

KFLG = 0

TYPE *,' IS ]}'I.TA FRE-0UNE }9817 (yIN)'

Acx:EFT 905, IY

IF (IY.GT.98) IY = IY -32

IF (IY.NE.Y'l) KFLG = 1

CO 38 K=l, I\'Y

READ (4'NO)IC,N,(DTA(I).I=I,N)

YI(K) = ffi'A(4)

IF (N.EO.NX+4) GO TO 32

KCK = N

N=NX+4

TYPE *.' ***** \'l1\RNING, Nor ENOUGH x VAI1JES *****.

JKX=KCK-4

TYPE 917,JKX

917 FORl'1J'.T (. alLY', 13,' VAllJES FOR X')

TYPE 918.BEIL

TYPE 91B,BEIL

918 FORl"AT (III AI)

32 CCNl'INUE

IF (KFLG.EQ.I) GO TO 34

CO 33 J=5,N

Z(J-4+NX*(K-l» = DTA(J)

ZOIAX = N1AXl (ZOll\X,IJrA(J»

33 CCNI'INUE

GO TO 38

34 IF (KSWl'.NE.O) GO TO 36

00 35 J=5.N

Z(J-4+NX*(K-l» = DTA(J)

ZOIAX = Nll\Xl (ZOlllX, DTA(J»

35 CCNI'INUE

KSI'IT = I

GO TO 38

36 CO 37 J=5,N

Z(J-4+NX*(K-I» = DTA(N+5-J)

ZQll\X = A'1/IXl (ZCMAX, DrA(N+5-J»

37 CCNI'INUE

KSI'IT = 0

38 CCNl'INUE

A-6
39

40

41

4;>

C

901

101

102

*

*

IF (KFIJ3.EQ.l) GO TO 40

r.e 39 J=I, NY

Y(J) = Yl(NY-J+l)

CCNTHRJr:

GO 'I'O 42

CO 41 J=I, NY

Y(J) = Yl(J)

cctITINUE

CWTWUE

CIDSE (UNIT=4)

PRINT ,)(\1, X, Y, Z

YIG = Y(l)

Y2G = Y(NY)

"Q.1TIX = ZG1TIX*AIJ

FOR!!I'.T (IB 9EI4.7)

NeN = 1

M-IXX = ~1DZ

t."JXX = NX

~'NYY =

STCR = STI:P],U

NXPI = NNXX + 1

NYPI = NNYY + 1

NlA = NCIl\

NSPVI\L = IoPVl\L

NOFFI' = roFPP

SPV = SPVAL

NDRZ = IDRZ

IF (IDRZ.NE.C)

Cl\Lf, CL';L"I'(Z,M-IXX ,tlNXX, tNYY,a!I ,crD, CINC,mA, 40,CL, NCL,

ICNST,NOFFP,SPV,DIGEST)

IF (IDPZ.NE.0) NDRZ = 1 - ICNST

STIIETA = SIN(STER*'JllE'l'JI.)

C'JlIETA = COS (:;:TER*THETI\ )

RX = 5(1) - S(4)

RY = S(2) - S(5)

RZ = S(3) - S(6)

Dl = SORT(RX*RX+RY*RY+RZ*RZ)

D2 = S('RT(RX*RX+RY*RY)

DX = O.

DY = O.

IF (STEREO.m.O.) GO 1'0102

01 = 01*~h'£PEO*'lHETI\

IF (D2.GT.O.) GO TO 101

OX = Dl

GO '1'0 102

I\GL = l,TAN(RX/-ICY)

OX = Dl*CDS (JI.GL)

DY = 01*SIN(AGL)

IROT = IROTS

NPIC = 1

IF (S?ER.~~.O.) NPIC = 2

FACT = 1.

IF (NRSW'I'.NE.O) FACT = RZERO/D1

IF (ISTP.F~.O.AND.STER.~~.O.)IROT = 1

XDIST = .5*«1024./102.)-.lP*FtOAT(NCfJI\R))

A-7
IPIC I

NUPPER lUPPER

SIC1Jl IPIC*? - 3

EYE)( 5 (1) + SIGNI*DX

POIX 5(4) + SIGNI*DX

EYEY 5 (2) + SIGNI*DX

POLY 5(5) + 5TGNI*DX

EYEZ 5(3)

POIZ 5(G)

LL 0

Q\LL SET32(POIX,roIY,POIZ,EYEX,EYEY,~YEZ,])

LL IPIC + 2*ISTP + 3

IF (STER.FQ.O.) 1.1, ; 1

IF (NRS'tIT.t-.'E.O) GC TO 107

XXMIN = X(l)

m1AX = X(NNXX)

YY11IN = Y( I)

YYW\X = Y (NNYY)

U!'1IN = BIGEST

V'lIN = I3IGEST

ZZMTIl = RIGEST

U11\X = - U1IN

V!'t'\X ; -V!1lN

ZZ/1lI.X = -ZZMIN

C PRINT 901, lliIN, lJMl\X, v.lm, VM1IX, Z7.J-UN, ZZMlIX

DC 104 J;l, N'JYY

00 103 I=I,t-.NXX

ZZ ; Z(I#lX*(J-I»

IF (NOFFP.F.Q.J.F..tlD.ZZ.F0.5PV) GO TO 103

ZZt-1AX ; NWI1 (Zzr.1AX, ZZ)

ZZl·UN ; AMINI (ZZl-UN, ZZ)

CALL SET32(X(I) ,Y(J) ,Z(I+NX*(J-I»,ur,VT,DU,2)

W"I)( = rJ.ll\XI (UMlJ<, ur)

UMIN ; mINI (UMIN,ur)

WJ\X ; N·lc'\XI (VM}\X, VT)

V!'lTIJ = N1INI (V1'lIN, vr)

103 CCNrlNUE

104 CCNI'INUE

C PRTIJ'T 901, UI1.'<, U·VIX, V!'1IN, v..V\X, ZZt1IN, ZZt-1AX

ViIIJTII = UV-.x-illlTIJ

HIGIIT = V1'lAX-\!MTIJ

DIF ; • 5* (WIDTH-HIGIIT)

C PRTIJ'T 901, VlIIJTII, mGHT, DIF

IF (DIF) 105,107,106

105 Uf1TIJ = U!'1TIl + DIF

a-lllX ; Uf-lAX - DIF

CO TO 107

106 \I11TIJ ; \!MIN - DIF

V!'1!'X = V.l1\X + DIF

107 D\LL 5ET32(POIX,POLY, POIZ,EYEX,EYEY,EYEZ,I)

C TYPE 900,~NXX, NNYY

900 FCR!'IlIT (HI 13010)

DC 109 J;I,N'NY

DC lOR I;l,t.NXX

CALL SET32(X(I),Y(J) ,Z(I#1NXX*(J-I»,ur,VT,DU,2)

A-8
~1(2*I-l+?*NNXX*(J-l» = ur M(2*I+2~~*(J-l» = VT

C PRINT 910, I,J,H(l, I.,I). I,J,~1(;>, I,J)

910 FOR/\,\T (UI 2(2I3,;>X,I5,'7X»

C PRTI-IT o,oO,t1(l,I,J),M(2,I,J)

C PRINT 'XlI, ur,VI'

lOS CCNTINUE

10') CrnTINUE

ro 110 K=l,1024

LI~lU(K) = 0

LIML(K) = 1024

110 CCfITINUE

NXPN3S = 1

IF (S(I).GE.X(NNXX» GO TO 113

IF (S(l).LE.X(I» GO TO 114

ro III I=2,tNXX

LX = I

IF (S(l).iE.X(I» GO TO 112

III CrnTINUE

112 MXS(l) = LX-I

~1XJ(l) = -1

~1XF(1) = 1

~IXS(2) = LX

~lXJ(2) = 1

~1XF(2) = NNXX

NXPbSS = 2

GO TO 115

113 MXS(l) = NNXX

~1XJ(1) = -1

~1XF(1) = 1

GO TO 115

114 MXS(I) = 1

MXJ(l) = 1

MXF(l) = NNXX

115 ~ASS = 1

IF (S(2).GE.Y(~~» GO TO 118

IF (5(;» .LE.Y(l)) GO TO 11"

ro 11( J=2.N'JYY

LY = J

IF (S(2) .IE. (Y(J)+.02» GO TO 117

116 CrnTINUE

117 MYS(l) = LY - 1

MYJ(l) = -1

MYF(I) = 1

tlYS(2) = LY

MYJ(2) = 1

MYF( 2) = Nt\'YY

NYPASS = 2

GO TO 120

118 ~lYS (l) = NNYY

~lYJ(l) = -1

MYF(l) = 1

GO TO 120

11 ') ~lYS(l) = 1

~lYJ(I) = 1

A-9
*

120

·C

C

C

C

C

C

C

C

c

C

C

MYF(I) = NNW

NN = 1

PRIm' 901, x, Y

PRINT 901,Z

PRIllT 901, XXMm, XX!-1AX, YYMm, YYM/IX, ZZ~lIN, Z~, I'ELCRr

PRIr·rr 901,EYEX,EYEY,EYEZ,FACT,EIGD,DIGEST,RZEAO

PRllrr 901,lJ>IIN,lH'\X, V!1IN, V!~\X

PRINT 900,n~,~~L,LL,IRar,~TIRZ,t~PPER,NRSWT,NOFFP,~SPVAL

OPEN (UNIT=3, NN-IE=' SCRT. OAT' ,TYPE='N!'W' ,FOR"1='UNFOH1ATrED' ,

* 1'.CCESS=' DIRECT , ,ASSOCIATEVARIMLE=NN,RECORDSIZE=1090)

,,'RITE (3 'NN)IHElID,X, Y,XXMIN,~,~llll,~,ZZ~1m,ZZi"lI\X,

*DELCRT,EYEX,EYEY,~~Z,NCL,LL,FACT,IRar,!.aRz,tlliPPER,NRSWT,

*DIGD, U·1ID,ll'II\X, VI'1ID, V:-VlX, RZEPD, ~nFFP, NSPVAL, SPV,DIGEST,CL

* ,NX, tY,MDZ, XIG,X2G, Y1G, Y?G, ZCMAX,I\IJ

PR1~ 900, LI~lU

WRITE (3'NN)(LH1U(I),I=l,1024)

PRllrr 900, LI~1L

I/RITE (3 'tJ!'T)(LIrlL(I) ,1=1,102"-)

I-!RITE (3 'NN)(~1(I).I=1,2178)

I~ITE (3'NN)(Z(I),1=I,l089)

PRlNT 901, PX, RY, HSKIRT,XDIST, CVi'.L, S, CL

PRIm' 900, tlXPASS, NYPASS, MXS,MXF ,~lXJ ,MYS,~IYF ,~lYJ, IDAY,NC!i\R

PRll<T 900, tDN, ~'Vl\I.

WRITE (3 'NN)NXPASS, NYPASS, MXS, MXF,MXJ,MYS,MYF,llYJ, PX,RY, IDAY,

HSKIRT, NDRZ,XDH,T, CVi'.L,NCHAR,NON, tNAL, S,NNXX, NNYY,lll:':XX, I5KI

CALL SET32 (X(1),Y(I),Z(1),UT,VT,CL~~,3)

CLOSE (UN!'!'=3)

SIDP

END

A-I0
SUBRourINF. ~ET32 (x, Y, Z,XT, Yr, ZT, KFU\G)

If IL(in CXl'1MCN)=O, XT and Yr are in the same scale and X,Y Z.

TIlis routine implE'l1lents the 3-space to 2-space transformation

by KUber, Szabo, and Giulieri, TIIC Perspective Representation

of FUnctions of TWo VAriables, J. l~ IS, 2 193-204,1968

variable KFU\G has t~o FOssible variables

I-compute intersection of line of sight

2-transfonn fran 3-space to 2-spa( c'

Are the 3-5p<,ce coordinates of the intersection of the

line of sight and the image plane. This FOint can be

thought of as the [Oint looked at.

!>re the 3-space coordinates of the eye [Osition.

transfonnation.

[Oint to be

debugging flags and are not

Are the 3-space coordinated of a

transfonned •

The results of the 3-space to 2-space

Not used.

2 argltTlents

The

NarE! 11 ! ! 11 ! 111 !

The KFLAG=3,4 are special

part of the plot package.

C

C

C

C

C

C X,Y,Z

C

C

C XT, Yr, ZT

C

C KFlAG = C

C X,Y,Z

C

C XT, Yf

C ZT

C

C

C

C

C

C

C

C

C

C

C

C

cwr·1CN /f'I'lPZI/ XXMIN ,XXM!IX ,~IIN , YYMr'\X

* ZZIUN , ZZl-1I\X ,DELCRT ,EYE)(

* EYEY ,EYEZ

C01t'lCN /SRFBLK/ LIMU(I024) , LlML(l024 ) ,CL(41) ,NCL I

* IL ,FACT ,IRm' ,NDRZ

* NUPPER , NRSI'I'T ,BlGD , U·1IN

* lJl>lAX ,\!MIN , ~1lI.,{ ,P2EFD

* NOFFP , NSPlTl\L ,SPIT ,BIGEST

CO>l!~ /SFJIN/ NN

DlMENSICN NLU(7) ,NRU(7 ) ,Nl3V(7) ,NTV(7 )

c

C picture corner coordinates for IL=1

C

DATh tllJJ(1),~nU(1),Nl3V(1),NTV(1)/IO,1014,IO,1014/

C

C picture corner coordinates for 1L=2

C

~TA ~1JJ(2),NRU(2),NBV(2),NTV(2)/IO, 924,50, 964/

C

C picture corner coordinates for IL=3

C

DATA NLU(3),NRU(3),~~V(3),NTV(3)/100,1014,50,964/

C

C picture corner coordinates for LL=4

C

DATA NLU(4),NRU(4),NBV(4),NTV(4)/IO,IOI4,IO, 1014/

A-ll
C

C picture corner coordinates for LL=5

C

I:'ATA NUl(5) ,NRU(5) ,NBV(5) ,NIV(5 )/10,1014,10,1014/

C

C picture corner coordinates for LL=6

C

~TA NUl(6),~~U(6),NBV(6),NTV(6)/10, 512,256,758/

C

C picture corner coordinates for LL=7

C

I:'ATA NLU(7),NRU(7),~~V(7),~~(7)/512,1014,256,75G/

GO TO (1,2,3,4) KFLAG

1 JUMP3 = 104

IF (NOFFP.EQ.1) JUMP3 = ]03

AX = X

AY = Y

NZ. = Z

EX=XT

EY=YT

EZ = ZT

C

C As much canputation as rossib]e is done during execution of

C SET32 since the transformation is called m;:my times [or each

C call to SFT32.

C

DX=AX-EX

DY = AY - EY

DZ=l\Z-EZ

C

C A more careful canputation of direction Cosines.

C

D = O.

T = AM.\X1 (l,BS(DX) ,ABS(DY) ,ABS(DZ))

C PRINT 901,AX,AY,J'.Z,EX,EY,EZ,DX,DY,DZ,T

C PRINT 900, WFFP

~O FeR!'L'\T (1lI 120010)

901 FeRMAT (HI 9E14.7)

IF (T.EQ.O.O) GO TO 30

Rl = DX/T

R2 = DY/T

R3 = DZ/T

D = SQRI'(Rl*Rl + R2*R2 + R3*R3)

C

C If D isn't ZERO ••••••

C

COSiIL = R1/D

COSI3E = R2/D

CQ3GA = R3/D

D = D*T

GO TO 40

C

C If D is ZERO, ray has no direction: assign direction down

eX-axis.

A-12
C

30

40

C

C

51

52

53

54

55

55

C

C

c

C

C

C

C

C

C

101

c

102

CWTINUE

CasAL = l.

COSIJE = O.

COSGA = O.

c:aITIt.'UE

AI.. = ACOS (COfJlL)

BE = ACes (msm:)

Gl, = JI.COS (CDSGA)

SING" = SIN{GA)

PRINT 901,Rl,R2,R3,D,COfAL,COSBE,COSGA,AL,BE,GA,SINC'/\

PRINT 900, IL

JUt.lP2 = 110

IF (LL.EQ.O) GO 1D 101

JUt.!P2= 108

DELCRT = NRU(LL)-NLU{LL)

UO = UMIN

W = Vt-lIN

Ul = NW(LL)

Vl = NBV{LL)

U2 = NRU(LL) - NW(LL)

V2 = N'IV{LL) - NBV{LL)

IF{~~X-lJMIN) 52,51,52

U3 = O.

CD m 53

V3 = U2!{UI-1lIX-lJMIN)

c:aITINUF.

IF (V1-1lIX-\I[I~L."') 55,54,55

V3 = O.

CD m 55

V3 = V2!(V1-1lIX-VMIN)

c:aITlNUE

U4 = NRV{LL)

V4 = N'IV(LL)

PRINT 'Xll, 00, va, VI, VI, V2, V2, V3, V3, U4, V4, lI'l1lX, V!-1AX

PRINT 900,NRStIT

IF (NR.'Wr.EQ.O) GO m 101

va = -BIGD

W = -BIGD

V3 = U2!(2.*BIGD)

V3 = V2!{2.*BIGD)

'I11e 3-spuce roint looked at is transformed i not (0, () of the

2-space. The 3-spuce Z "xis is transformed into the 2-space Y

axis. If the line of sight is close to parallel to the 3-spuce

z axis, the 3-space Y axis is chosen (instead of the 3-sp.1.ce

Z axis) to be transformBi into the 2-spuce Yaxix.

IF (SINGA.LT.C.OOOl) GO m 102

R = l.!SING~.

JUI-1P = 105

PRI~rr 900, JUI-1P, JUt.1P2, JUI-1P3

RETURN

SINBE = SIN{EE)

R = l.!SnIDE

A-13
JU1P lOC,

e PRINT ~O,JUI~P,JUMP3,JUIP2

RETUPN

e

e Transfonnation entry point

e

;> XX X

YY Y

ZZ = Z

e PRIl?T SOl,XX,YY,ZZ

e PRThl'J' "OO,JUI-IP3

IF (JUMP3.EQ.104) GO TO 104

103 IF (ZZ.FO.SPV) GO TO 109

104 DENC11 (XX-EX)*COSAL + (YY-F.Y)*COSBE + (ZZ-EZ)*COSGA

IF (DENa1.tJE.O.O) GO TO 1111

Q~l.

m TO 50

1111 Q D/DEt,~l

50 eCNTINUE

e PRINT 901,a':Na-l,O

e PRUIT ?OO,JUIP

IF (JU1P.BQ.10G) GO TO 106

105 XX «EX-tQ*(XX-EX)-AX)*COSIlE-(EY+Q*(YY-EY)-AY)*COSZ\L)*R

YY (EZ+Q*(ZZ-EZ)-AZ)*R

CD TO 107

106 XX «EZ+Q*(ZZ-EZ)-/\Z)*O)SM,-{EX+Q*{XX-EX)-AX)*COSGA)*R

YY (EY-tQ*(YY-EY)-AY)*R

107 IF (JUMP2.EQ.I10) GO TO 110

108 XX AMINl(U4,h~l{U1,Ul+U3*(FACT*XX-UO»)

YY N1INl{V4,N1t1X1 (VI, Vl+V3*(FIICr*YY-Vo»)

GO 'TO 110

109 XX NSPVlIL

YY ;: NSfNAL

GO TO 110

110 XT = XX

YT=YY

C PRIt?T 90I, )IT , YT

C PRIt?T 900,JU1P2

RETUI'J'l

3 C~I"'UE

~ffiITE {3 'NN)JUMP,JUl·1P2 ,JUMP3, EX, EY, EZ,COSAL, COSllE, COSGA, D,

* AX,IIY,AZ,R,UO,Ul,U2,U3,U4,VO,Vl,V2,V3,V4

C PRINT 900,JUMP,JUMP2,JU1'lP3

C PRINT 901, EX, EY, EZ, COSllL,COSllF., COSGA, D,AX,AY,lIZ, R

C PRUr.r 901,UO,Ul,U2,U3,U4,VO,Vl,V2,V3,V4

RETURN

4 car.rlNUE

READ (4 'NN)JU1P,JUMP2,JU1P3, EX, EY, EZ,COSAL,COSllE, COSGA, D,

* AX,AY,lIZ,R,UO,U1,U2,U3,U4,VO,V1,V2,V3,V4

C PRINT 900,JUMP,JU1P2,JU1P3

C FRUIT 901, EX, EY, EZ, COSAL,COSBE,COSGA, D,AX,AY,lIZ, R

C PRUIT 901,UO,Ul,U2,U3,U4,VO,Vl,V2,V3,V4

RETURN

END

A-14
I

\

•

(

Fwcrlrn l\COS(X)

ACCS 1.!mRT(l. +ATA."l(X)*!\TN:(X) )

END

A-IS
C

C

C

C

C

110

C

C

C

C

120

130

140

146

145

150

C

C

C

c

SUDRourINE eISEI'(Z,~!DZ,~:x,NY,CHI, eID, eUIC,NIA,NIM, CL, NCL,

*ICNST,NOFFP,SPV,DIGEST)

CC11MCN /SE::r/CVi\L( 10) ,FCP1IR, IHFJ\D(10) ,XDISO;:, NO',,~:vAL

D~lENSI~1 Z(10G9),CL(41)

IJXICl\L*l GC'ODZ

CLSEI' CCMPlrrES 'TI IE VAI1JCS OF 1HE enrrOUR LF:VI:LS

MTI purs 'TIm-I IN

CL

COJDZ = .Flu.sE.

ICNST = 0

GID =CID

[l!I = cm

FAl\'C = CIl'1C

CRo,T = FIDl,T(NLl\)

NCL = °

IF (1ll'-G1O) 110,120,130

GID = H'"

HII = Cill

GO TO 130

If 11]\ an'" GLD are not set, set them to the values of PIGF.ST

and -BIG&ST respectively

GID = -BIGEST

f'J\ = -Gill

GO TO 140

IF (FNJC.EQ.O.) Fl\NC = (fV\-GLD)/(CPAT-l)

CGNTINUE

DO 150 J=l,NY

DO 145 I=I,NX

IF (NOFFP.EQ.l.MTD.Z(I+NX*(J-l)).EQ.SPV) GO TO 145

IF (GCODZ) GO TO 146

zr.1rn = Z(I+NX*(J-1))

zr.lI\X = Z(I+NX*(J-l))

GCQDZ = .TRUE.

CD TO 145

ZIollN = Nlll'll (Z( I +NX* (J-1) ) ,zr.llN)

zr.lI\X = l\Mt0:l ( Z( I +NX* (J-1 ) ) ,zr.lI\X)

CCNI'INUF

CCNTINUE

Check 11]\ Lind GIJ) to make sure they fall within the range of Z

values being plotted; if not, set Il!I=ZWVI: and/or GID=Z~lIN.

•

IF (HA. GT •ZMJIX) Ill'. = Z/-lI\X

IF (GLO.LT.ZMIN) GLO = ZMrn

C PRUIT '?Ol,llA,GID,FA]\JC,ZMm,Z~lI'J<

901 FORM!\T (111 9E14. 7)

C

C If contour incrcr.1ent has not been set, canpute a. 'NICE I vdIue

C for it.

C

IF (FFNC) 160,170,190

A-16
]60 CRAT = -Fr~

170 FANe = (Hl\-GLD) / (CRJ\T-l)

IF (FANC) 220,220,180

lrO P = 10.**(IFIX(~lO(FPNC)+500.)-500)

FANC = AINT(FANC/P)*P

C

C Recanpute 'NICE' values of Hl\ and GIO.

C

GLD = hINT(GLD/FANC)*Fl,NC

HI\. = AINT(WJFANC)*FN1C

C

C Ccmpute contour levels array.

C

]90 DO 200 K=l,NLM

CC = GLD + FIJ:)l\':.'(K-l)*FI'NC

KK = K

IF (C:C.CT.HA) GO TO no

CL(K) = CC

200 CCNTINUE

210 NCL = KK - 1

C

C ~11ave away contour values not strictly between ~lIN and ~lI\X.

C

230 CWTlNUE

IF (NCL.LE.O) GO TO 240

IF (C'L(l).GI'.ZMIN) GO TO 270

IF (NCL.LE.l) GO TO 260

00 250 I=2,NCL

250 CL(I-l) = CL(I)

260 NCL = NCL - 1

GO TO 230

270 CCNTIl'.LJE

IF (CL (NCL) •GE. Z!'1l'X) GO TO 260

240 CCNTINUE

NVAL = 10

IF (NCL.L'l'.1O) NVAL = NCL

DO 241 I=I,INAL

J = NCL - I + 1

CVAL(I) = CL(J)

241 CCNTINUE

RETURN

no ICNS'!' = 1

NVAL = 10

IF (NCL. LT. 10) NVI\.L = NCL

DO 2?l 1=1,rNAL

J=NCL-I+l

CVAL(I) = CL(J)

221 CCNrINUE

RETURN

C

END

A-I?
*

PROGRl'}l FPLOT2

DIMDlSICN X(33) ,Y(33) ,Z(108Q) ,M(2178),

S(6) ,r:rrA(40)

DIr1ENSICN ~1XS(:;» ,MXF(2) ,~1X.T(?) ,~1YS(2) ,MYJ(

,NC!. ,

*

*

*

*

*

*

*

*

CCt1!lCN /SRFTJLK/ LI~1U(l024l.LTML(l024) ,CL(41)

LL ,FACT ,IROT ,~TIRZ

NUPPER ,NRS'tIT ,BIGD ,UMJN

UMl\X , \'MIN , Vt1J\X , RZERO

NOFFP ,NSIVAI. ,SIV ,BIGEST

Cct·lMCN /P.i[RZl/ XXMJN ,xxmx ,YYMJN , YYMl\X

ZZMW , Z~lAX , DELCRT , r:rEX

EYEY ,EYEZ

CCloIMCN /SET/CV.l\L(IO) ,N::HAR ,IHEAD(lO) ,XDIST,NCN

*, XIG, X2G, YIG, Y2G, ZQ·lAX, S, NY,AIJ,NX

CCJolMCN / SEm/ NN

DATA SIVAL,IOFFP/O.O,O/

DATi'. STEREO /0.0/

D.I\T1\ IFR, ISTP, IROTS, lORX, lORY, lORZ, IUPPER, ISKIRT,NCIA/

I, 0, 0, L I, L C\ C, f/

DATr, THETA, HSKIRT, CHI, Cli), CINC/

.02, 0., C., 0., a./

DATA S/-3a.,o.,3.,o.,a.,o./~~,NX,NY,NC1V~/33,33,33,la/

NN = 1

OPEN(UNIT=4,NAME='SCRT.DAT' ,'l'YPE=' Oill, ,FCRt~='llNFO~TTED',

* 1\CCESS=' DIRErI" ,ASSOCIATEVARIABLE=NN, RECORDS IZEFI09a)

REl\D (4 'NN )IllF.l'D,X, Y, XXMlN, ~t\X, YY!'lIN, YYMl\X, Z7.M IN, ZZ~1JI.x,

* DELCR'l', EYF~, EYEY, EYEZ, NCL, LL, FN::,r, IROT, NDRZ, NUPPER, NR'WJT,

* BIGD, U1JN, Ul'lAX, VtUN, V!'lAX, RZERO,N:JFFD, NSPlTl\L, SPIT, BlGEST, CL

* ,NX,~!Y,~~,XIG,X2G,YIG,Y2G,za·~.x,AIJ

REl\D (4'~<)(LIMU(I),I=l,lO?4)

REJV) (4'NN)(LI~1L(I),I=l,la?4)

REI'.D (4'NtJ)(M(I),I=l,7178)

REl\D (4'NN)(Z(I),I=l,l089)

REJV) (4 'NN)NXPASS , NYPASS , MXS,MXF ,~1X.I ,tws,~ ,~1YJ, RX, RY, lDAY,

* HSKIRT, NDRZ,XDIST, CVAL, NCI-~, NCN', NW\L, s,t\"'NXX, M\ryy,~'k'1XX, ISKJRT

CALL SET3? (X(1),Y(1),Z(1),Ur,VT,DU,4)

CIDSE (UNIT=4)

FCRMl,T (1II ~E14. 7)

FCRI'JlT (HI BIlO)

PRINT 901,X, Y

PRINT 901,Z

PRINT 901, XXMIN, ~\X, YY!'IIN, YYMl\X, ZZMIN, ZZMAX, DELCRT

PRINT 901,EYF.X,EYEY,EYEZ,FACT,BIGD,BlGEST,RZERO

PRINT 901, U~IN, UolAX, vr-UN, W.AX

PRINT 900, IHE.lill, N::L, LL, IROT, NDRZ, NUPPER, NF:SWT, N:JFFP, NSIVAL

PRINT 900,LIMU

PRllJT 900, IJ.ML

PRINT 901, RX, RY, IISKIRT,XDIST, CVAL, S, CL

PRINT 900, NXPASS,1!YPASS,~1XS,I·1XF,MXJ,MYS,IN!' ,!1YJ, lOAY, NCHl\R

PRlllT 900, N:N, NVI\L, NNXX, NNYY, MMXX

GO TO 102

DO 51 1=1, tNXX

DO 50 J=l,8

K=fl-hJ

L=Hj-hJ

901

900

C

C

C

C

C

C

C

C

C

C

C

2)

A-IS
A-19

121

"I=24-nJ

PRTh'T 903,I,J,X(I) ,Y(J) ,Z(I,J) ,I,K,X(I) ,Y(K) ,Z(I,K),

* 1, L,X(I),Y(L) ,Z( I, L) ,I,N,X( I),Y(N), Z( I,N)

FORMAT (lH 4(2I3,3(2X,F5.2),5X»

canII\'UE

PRrnT 905

CONTINUE

FO~llIT (1Il )

DO 76 I=l,t-NXX

DO 75 ,T=l,8

K=>3-nJ

L=lG-nJ

N=24-nJ

PRrnT 904, I,J,X(I), Y(J) ,~1( I, 1,J) ,I, K,X(I) ,Y(K) ,M(1, I, K) ,

* I, L,X( I) ,Y(L) ,M( I, I, L), I,N,X( I),Y(N) ,M( I, I,N)

FORMl,T (lHC 4(213,2(2X,F5.2),I5,5X»

canL."WE

PRINT 905

e:a-'TlNUE

ro 101 I=l,N\l)(){

DO 100 J=l,8

K=R-hJ

L=16-nJ

~=24-nJ

PRINT 904, I, J ,X( I) ,Y(J) ,~1( 2, I ,J) ,I,K,X( I) ,Y(K) ,M( 2, I ,K) ,

* I, L, X( I),Y(L) ,M(2, r. L), I, N,X(I) ,Y(N) ,~1( 2, I,N)

CCNTII\'UE

PRrnT 90S

canlNUE

CanlNUE

NON = 1

OPEN(UNIT=3,NN<1E='PLOT.Dl>.T' ,TYPE=' NEW , ,FOR-1='UNFO~TTED',

* ACCESS= ,DIRECT , .~SSCCIATEVARIABLE=NON,RECORDSIZE=10)

120 IF (NXPASS.m.2.AND.NYP~SS.EJ.:l.2)GO TO 146

IF (ISKIRT.EJ.:l.O) GO TO 126

IN = ~1X.'., (1 )

IF = t1XF(1)

IN = rws(1)

JF = HYF(1)

IF (NYPA..C;S.NE.l) GO TO 123

CALL SET32 (X(l), Y(~) ,HSKIR':', UXl, VXl, IU1MY, 2)

CALL SET32 (X (NNXX) ,Y(,TN) ,I!SKIRT, UX2, VX2, I:U1MY, 2)

DO 171 I=l,mXX

CALL SET32 (X( I),Y(JN) ,llSKIRT, UX, VX. ItM1Y, 2)

MU=UX

MV=VX

Ci\LL DRAll(tlU,MV,M(2*I-l+2*NNXX* (IN-l)) ,M(2*I+2*NNXX* (IN-l) ) ,1)

CONTINUE

CALL DRAl. (IFIX(UNl),IFIX(VXl),IFIX(UX2),IFIX(VX2),3)

IF (IDRY.I\~.O) GO TO 123

DO 122 I=2.t-NXX

CALL DRAW(~1(2*I-3+2*NNXX*(JN-l) ,M(2*I-2+2*NNXX*(~-1»,

* M(2*I-l+2*NNXX*(JN-l».M(2*I+2*NNXX*(JN-l),3)

122 CONTINUE

123 IF (NXPASS.NE.l) GO TO 126

76

51

905

C

C

903

50

101

102

C

C

100

C

C

9fJ4

75
CALL SEI'32 (X(IN),Y(l) ,IEKIRT,UY1, VY1,IU1MY, 2)

CALL SEI'32 (X(IN), Y(NNYY) ,IEKIRT, UY2, VY2, IU1MY, 2)

00 124 J=l,mYY

CALL SEI'32 (X(IN),Y(J) ,IEKIRT, UY, VY, IU1MY, 2)

MU=UY

MV=VY

CALL DRlIW(MU,MV,H(2*IN-1+2*NNXX*(J-1» ,M(2*IN+2*NNXX*(J-1) ,1)

124 CCNTlNUE

CALL DRlIW( IFIX(UY1) ,IFIX(VY1), IFIX(UY2), IFIX(VY2), 3)

IF (IDRX.NE.O) GO TO 126

00 125 J = 2,NNYY

CALL DRAl'/(H(2*IN-1+2*NNXX*(J-2» ,M(2*IN+2*NNXX*(J-2»,

* M(2*IN-1+2*NNXX*(J-1) ,M(2*IN+2*NNXX*(J-1» ,3)

125 CCNTINUE

126 LI = MXJ(l)

MI = MXS(l) - LI

NI = IABS(~lJ-,'1XF(l»

LJ = MYJ(l)

aJ = MYS(l) - LJ

NJ = lABS (MJ-MYF(l »

IF (ABS(RX) .IE.ABS(RY» GO TO 133

IF (ISKIRT.NE.O.OR.NYPASS.NE.1) GO TO 128

I = MXS(1)

00 127 J=2,NNY

CALL DRlIWU1(?*I-1+2*NNXX*(J-2» ,N(2*I+2*NNXX*(J-2»,

* M(2*I-1+2*NNXX*(J-1»,M(2*I+2*NNXX*(J-1»,2)

127 CCNTINUE

128 00 132 II = l,NNXX

I = MI + II*LI

IPLI = I + LI

IF (NYPASS.E('.l) GO TO 129

K = MYs(l)

L = HYS(2)

C PRINT 900,NDRZ,II,NI

IF (IDRX.m:.O)

* C!'LL DRAlI(~I( ?*I-1+2*:lNXX* (K-1» ,M( 2*I+2*NNXX* (K-1) ) ,

* M(2*I-1+2*NNXX*(L-1»,M(2*I+2*NNXX*(L-1»,3)

IF (NDRZ.NE.O.AND.II.NE.NI)

* CALL CTCELL(Z,MMXX,NNXX,~~,M,MINO(I,L+LI),K)

129 [X) 131 JPASS=l, NYPASS

LJ = MYJ(JPASS)

MJ = MYS(JPASS) - LJ

NJ = lABS (MJ-MYF(JPASS) )

00 130 JJ = l,NJ

J = MJ + JJ*LJ

JPLJ = J + LJ

IF (IDRX.NE.O.AND.JJ.NE.NJ)

* CALL DRlIW(M(2*I-1+2*NNXX*(J-1»),M(2*I+2*NNXX*(J-1»,

* M(2*I-1+2*NNXX*(JPLJ-1»,M(2*I+2*NNXX*(JPLJ-1»,3)

IF (I.NE.MXF(l) .AND.IDRY.NE.0)

* CALL DRlIW(M(2*IPLI-1+2*NNXX*(J-1»,M(2*IPLI+2*NNXX*(J-1),

* M(2*I-1+2*NNXX*(J-1) ,~1(2*I+2*NNXX*(J-1) ,3)

C PRINT 900,NDRZ,JJ,NJ,II,NNXX,I,J,LI,LJ

IF(NDRZ.NE.O.AND.JJ.NE.NJ.AND.II

* .NE.NNXX)

A-20
C/ILL CTCELL( Z, t,'MX)(, NNXX, NNYY, M,

IIlliO (1,1+1.1) ,11INO(,I,J+LJ) )

CWTlNUE

*

*

*

CONTINUE

CONTINUE

GO TO 140

IF (ISKIRT./I.'E.0.OR.NXP1,SS.NE.1) GO TO 135

J = t1YS(l)

CO 134 I=2,NNXX

CALL DRt\l'i(M( 2*I-3+2*NNXX*(J-1) ) ,t'l( 2*1 -2+2*NNXX* (J-1) ) ,

* M(2*I-1+2~~*(J-1»,M(2*I+2*NtDC(*(J-1»,2)

CWTlNUE

CO 13" JJ = 1. NNYY

J = IIJ + JJ*LJ

JPLJ=J+LJ

IF (tTXPASS.1JQ.1) GO TO 136

K = MXS(1)

I. = MXS(2)

IF (IDRY.NE.O)

* GIlL DR/I\'l(t·l(2*K-l+2*NlJXX*(J-1» ,ll(2*K+2*NNXX*(J-1),

* II( 2*L-l+2*NNXX*(J-1» ,t,l( 2*L+2~* (J-1) ,2)

IF (NDPZ./I.~.o.l\/I.~.JJ.tlli.NJ)

Cl'J.L CTCEIL( Z,MI'OO(, /I.'NXX, NNYY,/'1, K, t,IINO(J,J+LJ) )

CO 13C IPl\SS=l,NXPASS

1.1 = 1'1XJ (IPlISS)

tlI = I1XS(IPASS)-LI

Nl = IABS(l1I-I<1XF(IPASS»

IX' 137 II=l, NT

I = tl1 + II*Ll

IPLI = I + 1.1

IF(IDRY.I'.'E.C.PllD.II.I'.'E.NI)

* CALL DRl\l'i(t1( ?*I-l+2*NNXX* (J-1) ) ,ll(2*1+2*NNXX* (J-1)) ,

* Il( 2*IPLI-l+2*r-.1J'JXX*(,I-l) ,t1( 2*IPLI+2*mJXX* (J-1) ,3)

IF (J.NE.MIT(l) .~.IDRX.NE.O)

* CALL DRIIlI(I1(2*I-l+2*NNXX*(JPLJ-1» ,11{?*I+2*NNXX*(JPLJ-1»,

* M( 2*I-l+2*NNXX* (J-1) ,Il( 2*1+2*NNXX*(J-1» ,3)

PRllIT 900, NDR?, II, NI ,JJ, NNW

IF(tlDRZ .tw,. O.IIND.II .NE.NI .MD.JJ.NE.NNYY)

CALL CTCELL(Z,MMXX,I~'iXX,NNYY,M,

11INn (1,1+1.1) ,t,lINO(J, J+LJ) )

CQITINUE

CONTINUE

CWTlNUE

IF (ISKIRT.FQ.O) GO TO 149

IF (IDRX.NF..O) GO TO 143

DO 142 IR\8S=l,/I.~l\SS

IF (NXPASS.EQ.2) IF=1+(IPASS-1)*(tf-JXX-1)

00 141 ,1=2, t"NYY

ClILL DRAl'i(t1(2*IF-l+2*NNXX*(J-2» ,t1{2*IF+2*NIJXX*(J-2»),

* M(2*IF-1+2*/1.~XX*(J-1»,M(2*IF+2*NNXX*(J-1»,1)

CONTINUE

CONTINUE

IF (IDRY.NE.O) GO TO 149

DO 145 JPI,SS=l, NYPASS

IF(NYPII.SS. EQ.?) JF=l+(JPASS-1)* (NNYY-I)

A-21

*

*

141

142

143

137

13P

139

140

136

133

134

135

130

131

132

C
00 144 I=2,NNXX

Cl\LL DRI\H(~!(2*I-3+2*N!':XX*(JF-l» ,Il( 2*I-2+2*NNXX*(JF-l» ,

* M(2*I-l+2*Nl'DC{*(JF-1»,M(2*I+2*NNXX*(JF-1»,1)

144 CUJTJNUE

145 CCtITINUE

GO TO 149

146 IF (mJPPER.GT.(1.P.ND.S(3) .IE.S(6» GO TO 14"

IF (NUPPER.LE.0.l\ND.S(3).GT.S(6» GO TO 149

t-.llJPPER = 1

IF (f,(3).LE.S(6) NUPPER = -1

00 14ft 1=1, lli'XX

00 147 J=l,NNYY

IF (IDRX.t-.'E.C.A.'ID.J.t-.'E.NNYY)

* CI'UL DRAW(~1(2*I -l+2*N!'lXX*(.J-l» ,M( 2*I+2*N!'lXX*(J-l) ,

* ~1(2*I-l+2*Nr-.'XX*.T) ,~1(2*I+2*;:JNXX*J) ,1)

IF (IDRY.J'..'E.C.I\ND.I.NE.NNXX)

* Q'UJ DRA;(M(2*I-l+2*N!'lXX*(J-l»,M(2*I+2*NNXX*(J-1»,

* M( 2*I+l+2*Nl';XX* (J-1) ) ,~l( 2*I+2+2*Nt-.'XX* (J-1) ) ,1 )

IF( IDRZ .NE. O.IIJ'ID. 1. NE. NNXX.lillD ••T.NE .NNYY)

* CALL CTCELL(Z,Mi'-1XX,t;.NXX,NNYY,M, I,J)

147 CCNTINUE

148 CCNTINUE

149 IF(STER.EQ.O.) GO TO 153

IF (ISTP) 151,150,152

150 CGJTlNUE

151 COJTThllJE

GO TO 154

152 IF(IPIC.NE.2) GO TO 154

153 CaJTINUE

154 CCNTINUE

WRITE (3 'NCN) FJID, END, lEND

CIDSE (UNIT=3)

RETUPN

END

A-22
SUBROUI'INE SEG (IYJ. , IYI, IX2, IY2, KFIAG )

C

C This routine W)uld nonnillly he the interface betv.<een the SRFJl.CE

C package and the plot package. I3ecause of sp,ce limitations in

C our machine it is used to 'Nrite a file =ntaining the data to

C be plotted. 'lhe PImER program reads this file and plots the

C data.

C

C

C

LOGICJ\L*l START, TITLE, C'CN'IUR

CG1HCN ISEr/CVi\L(lO) ,NCHAR ,IHEl\D(lO) ,XDIST

* ,Netl ,~nn\L,XIG,X2G,YIG,Y2G,ZCMAX,S,~ry,AIJ,NX

DATA START/.'rRUE.I,TITLE/.TRUE.I,UPERIN/I02.I,XLAST/0.1

DATA <XNrUR1 •TRUE.1

INTEGER CIIEIID(48 )

Dl\TACI1El\D/'uP',' T','O ','TIlI,'E I,'FII,IRS',IT ',1 I,' ,

* I ',' ','10',' C','ON',''fO','UR',' VI,'ALI,tUEI,'S ',IOF',

* ',I ','CO','NS','TA','NT',' Zit' (','HI','GH','ES','T',

* ',' ',''10',1 L','av','ES','T)',' ','WP,','TI','S/','(l1',

* .**' I 12 1/

DIMENSION CVALQ(8),S(6)

A-23

C

C

C

C

C

5

C

999

6

66

C

C

998

77

7

en the first time throUC)'h this routine the program ",rites all

the hearlers and labes for the graph. DJring subsequent calls

UK' hidden line data is written for ploting.

IF (.l\OT.srJI.RT) GO TO 10

TYPE 999,NY,XIG,X2G,YIG,Y2G,ZCMAX

FORMAT (1II I5,5F12.4)

XLAS'l' = O.

IXTO = 0

IYTO = 0

IF (.l\OT.CCNTUR) GO TO 8

lIT = 8.0

[X) 6 1=1,4

1IT=IIT-.5

II = 12*(1-1)+1

IK = II + 12

WRITE (3 'NCN)IIT, (OlEAD(J) ,J=II, IK),NVAL

CCNTINUE

\-/RITE (3 'NCN) XIG,X2G, YIG, Y2G,ZCMAX

WRITE (3'NCN) S(1),S(2),S(3),NY,NX

lIT = 5.5

IX) 7 I=l,NVAL

lIT = lIT - .5

TYPE 999,I,CVi\L(I),AIJ

CVi\L(I) = CVi\L(I)*AIJ

ENCODE(12,77,CVALQ)CVi\L(I)

TYPE 998, CVAW

FORHAT (lH PA2)

FOR!'1AT (F12. 1 )

,,'RITE (3 'NCN)Hr,CVAW

CCNTINUE

CCNI'UR = .FAlSE.

the
8 cmTINUE

IF (.IDT.TITIE) GO TO 10

WRITE (3 'NCN)XDIST, IHEI\])

TITIE = .FlIISE.

10 IF (IXl.FQ.IXTO.J\NI).IYl.EQ.IYTO) GO TO 70

AX = FIDAT(IXl)/UPERIN

AY = FIDAT(IYl)/UPERIN

IP3 = +3

\'IRITE (3 'tlCN) AX,lW, IP3

IF (KFIAG.GT.l) PRINT ClOl,IPC,AX,l\Y

901 FORt1A'l' (lH 110, 2E14. 7)

20 BX = FIDl\T( IX2)/UPERIN

BY = FLOl\T(IY2)/UPERIN

IP2 = +2

WRITE (3'Nm)BX,BY,IP2

IF (KFIAG.GT.l) PRINT 901, IP2,BX,BY

IXro = IX2

IYTO = IY2

START = .FAlSE.

XI.AST = Nli\Xl (XlAc:T, AMAXO (lXI, IX2 ) )

RETURN

END

A-24
SunROUTINE SET32(X,Y,Z,XT,YT,ZT,KFLAG)

If IL(in CCMMCl'l)=O, XTand YT are in the same scale and X, Y Z.

This routine implEmE'.11ts the 3-sp:lce to 7-sp3ce trffi1sformation

by Yuber, Szabo, and Giulieri, The Perspective Pepresentation

of Functions of 'IINo VAriables, J. JlD.l 15, 2 193-704,1968

variable KFLAG has two possible vuriables

I-compute intersection of line of sight

2-transfonn fran 3-sp3ce to 2-space

Are the 3-spuce coordinates of the intersection of the

line of sight ard the image plane. This point can be

thOt")ht of as the point looked at.

Are the 3-space coordinates of the eye position.

transfonnation.

point to be

debugging flags and are not

Are the 3-spuce coordinated of a

trunsfonned •

The results of the 3-space to 2-spuce

Not used.

argunents

NOTEI ! II ! ! ! ! ! ! ! I

The KFLAG=3, 4 are special

p<,rt of the plot packuge.

The

C

C

C

C

C

C X,Y,Z

C

C

C XT,YT,ZT

C

C KFIl\G = 2

C

C X, Y, Z

C

C XT, YT

C ZT

C

C

C

C

C

C

C

C

C

C

C

C

C<M'lCN /n'fi(ll/ JOO.1 IN ,JOO.1AX , YYMIN , YYMI\X

* zzr.ml ,ZZMAX , DELCRI' ,EYEX

* EYEY ,EYEZ

CQ-1MCN /SRFBIl</ ',IMU(1024) ,LHIL(l0:?4) ,CL(41) ,N:L ,

* IL ,FACT ,IRill ,NDRZ

* NUPPER ,NILc:wT ,BIGD ,LMIN

* UMAX ,VI'1IN , VMI\X ,RZERO

* NOFFP ,NSPVAL ,SPV ,BIGEST

CCM11::tl /SF:IN/ NN

Dll1ENSION NLU(7 ) ,NRU(7) ,1<13V(7 ) ,NIV(7 )

c

C picture corner coordinates for LL=1

C

~TA NLU(l),NRU(l) ,NBV(I) ,NIV(I)/lO, 1014,10,1014/

C

C picture corner coordinates for LL=2

C

~TA NLU(2) ,NRU(2),NBV(2) ,NIV(2)/lO, 924,50, 96~/

C

C picture corner coordinates for LL=3

C

~TA NLU(3) ,NRU(3),NBV(3) ,NIV(3)/lOO, 1014,50,964/

C

C picture corner coordinates for IL=4

C

CATA NLU(4),NRU(4),~ffiV(4),NIV(4)/10,lOI4,lO,lOI4/

A-25
C

C picture comer coordinates for li;=5

C

CATA ~~(5),NRU(5),NBV(5),NTV(5)/10,1014,10,1014/

C

C picture comer coordinates for LL=6

C

~TA ~1JJ(~),NRU(6),NBV(6),NTV(G)/10, 512,256,758/

c

c picture comer coordinates for li;=7

C

~TA NLU(7) ,NRU(7) ,NBV(7) ,NTV(7)/512,1014,256,7Sr./

GO TO (1,2,3,4) KFU,G

1 JUr-lP3 = 104

IF (NOFFP.EQ.1) JUMP3 = 103

AX = X

AY = Y

AZ = Z

EX=XT

EY=YT

EZ = ZT

C

C As much computation as possible is done during execution of

C SET32 since the transformation is called many times for each

C call to SF.l'32.

C

DX=AX-EX

DY = AY - EY

DZ = AZ - EZ

C

C A more careful camputation of direction Cbsines.

C

D = O.

T = A.'1lIX1 (l'BS (DX).l\I3S (DY) ,ABS(DZ))

C PRINT 901,IIX,AY,J\Z,EX,EY,EZ,DX,DY,DZ,T

C PRINT 900, NJFFP

900 FOR'lAT (HI 120010)

901 FORMAT (lH 9E14.7)

IF (T.EQ.O.O) GO TO 30

R1 = DX/T

R2 = DY/T

R3 = DZ/T

D = SQRT(R1*R1 + R2*R2 + R3*R3)

C

C If D isn't ZERO••••••

C

COSJ\L = R1/D

COSBE = R2/D

COSGl\ = R3/D

D = D*T

GO TO 40

A-26

C

C

C

If D is ZERO, ray l1as no direction: assign direction dawn

X-axis.
'!he 3-space ['Oint looked at is transfonned inot (0,0) of the

2-space. '!he 3-space Z axis is transfonned into the 2-space Y

axis. If the line of sight is close to parallel to the 3-space

Z axis, the 3-s[8ce Y axis is chosen (instead of the 3-space

Z axis) to be transfonned into the 2-space Yaxix.

CCNTINUE

COSAL = 1.

COSBE = O.

COSGI\ = O.

CWTINUE

AL = ACOS(COSAL)

BE = ACOS(COSBE)

GA = ACOS(COSGA)

SINGA = SIN(GA)

PRll1T 901,Rl,R2,R3,D,COSAL,COSBE,COSGA,AL,BE,GA,SINGA

PRll1T 900, IL

JUMP2 = 110

IF (LL.EQ.O) GO TO 101

JUNP2= 108

DELCRT = NRU(LL)-NW(LL)

UO = UMIN

VO = VMIN

Ul = NW(LL)

VI = NBV(LL)

U2 = NRU(LL) - NLU(LL)

V2 = NTV(LL) - NllV(LL)

IF(UMAX-uMIN) 52,51,52

U3 = O.

CD TO 53

U3 = U2/(UMAX-uMIN)

CCNTINUE

IF ('JrclAX-W1IN) 55,54,55

V3 = O.

CD TO 56

V3 = V2/(VMAX-'Jrc1IN)

CCNTINUE

U4 = NRU(LL)

V4 = NTV(LL)

PRll1T 901,00, VO, Ul, VI, U2, V2, U3, V3, U4, V4,lMAX, 'MAX

PRll1T 900, NRSWT

IF (NRSWr.EQ.O) CD TO 101

UO = -BIGD

VO = -BIGD

U3 =U2/(2.*BIGD)

V3 = V2/(2.*BIGD)

C

30

40

C

C

51

52

53

54

55

56

C

C

C

C

C

C

C

C

C

101

C

102

IF (SINGA.LT.O.OOOl) GO TO 102

R = 1./SINGA

JUMP = 105

PRINT 900,JUMP,JUMP2,JUMP3

RETURN

SINBE = SIN(BE)

R = 1./SINBE A-27
A-28

C

C

C

C

?

c

C

103

104

1111

50

C

C

105

106

107

108

109

110

C

C

3

C

C

C

4

C

C

C

JUMP =106

PRINT 900,JUMP, Jl?-lP3, JUMP2

RETURN

Transfonniltion entry point

xx = X

TI = Y

ZZ = Z

PRINT 901, XX, YY, ZZ

PRUIT 900,JU!-IP3

IF (JUl-lP3.EQ.I04) GO TO 104

IF (ZZ.EQ.SPV) GO TO 109

DENeN = (XX-EX)*CDSAL + (YY-EY)*COSIlE + (ZZ-EZ)*COSGI\

IF (DENG1.NE.0.O) GO TO lUI

Q = l.

m TO 50

Q = D/DENa-I

CGlTINUE

PRINT 90I, lX--:Na-I, Q

PRUIT 900, JUl-lP

IF (JUMP.EQ.I06) GO TO 106

XX = «EX+Q*(XX-EX)-AX)*CCSBE-(EY+Q*(TI-EY)-l\Y)*COSl\L)*R

YY = (EZ+Q*(ZZ-EZ)-AZ)*R

CD TO 107

XX = «EZ+Q*(ZZ-EZ)-AZ)*CUSAL-(EX+Q*(XX-EX)-AX)*COSGA)*R

YY = (EY+Q*(TI-EY)-AY)*R

IF (JUMP2.EQ.IIO) GO TO 110

XX = AMINl(U4,NlI\Xl(Ul,Ul+U3*(Fl,CT*XX-UO)))

YY = NUN1 (V4,N'JlXl (VI, Vl+V3*(FACT*YY-VO»))

00 TO 110

XX = NSPVAL

TI = NSPVAL

GO TO UO

XT=XX

YT=YY

PRUIT 901, XT, IT

PRINT 900,JUMP2

RETURN

CGlTINUE

\~RITE (3 'NN)JUMP, JUMP2, JUMP3, EX, EY, EZ, mSl\L, COSBE, c.'OSGA, D,

* AX,l\Y,l\Z,R,UO,Ul,U2,U3,U4,VO,Vl,\~,V3,V4

PRINT 900,Jill1P,JUMP2,JUMP3

PRINT 901,EX,EY,EZ,COSAL,COSBE,COSGl\,D,l\X,AY,l\Z,R

PRINT 9OI,UO,Ul,U2,U3,U4,VO,Vl,V2,V3,V4

RETURN

CGlTlNUE

READ (4 'NN)JUMP,JUMP2,JUMP3, EX, EY, EZ, COSAL, COSIlE, COSGA, D,

* l\X,AY,AZ,R,UO,Ul,U2,U3,U4,VO,VI,~,V3,V4

PRINT 900,JUMP,JUl-lP2,JUMP3

PRINT 9OI,EX,EY,EZ,COSAL,COSIlE,COSGA,D,AX,l\Y,l\Z,R

PRINT 901,UO,Ul,U2,U3,U4,VO,VI,V2,V3,V4

RETURN

END

FLNCTICN ACOS (X)
ACOS = 1.!SQRT(1.+AT~I(X)*ATAN(X»

END

FLNCTICN R(HO,llU)

c

C This routine interpolotes in the CV array.

C

CG1l'lal !C\fl\J..,!CV

IF (IIC-IIU.EQ.O) GO TO 10

R = (HO-CV)!(lIo-HU)

C PRINT '?OO,CV,ID,tRJ,R

900 FCru1AT (111 4(~X,E14.7»

RETURN

10 CCNTINUE

IF (llO-CV.LT.O.O) R = 0.0

IF (HO-CV.GE.O.O) R = 1.0

RETURN

EHD

A-29
SUI3ROUTlNE C'TCELL (Z, my.~, NX, NY, M, 10,JO)

C

C CTCELL canputes lines for constant Z (coutour lines) in one

C cell of the array Z for the SRFACE p:ick"ge.

C Z, NX, NY are the same as in SRFACF..

C £ly the time ctcell is first called, ~1 contains

C the tw::>-space plotter lociltion of each Z point.

C U(Z(I,J) )='11(1, I,J), V(Z(I,J) )=M(2, I,J)

C IO,JO TIle cell Z(Il,Jl) to Z(Il+l,Jl+l) is the one to

C be contoured.

DIMENSICN Z(1089) ,~1(217f1)

ca"'ICN /SRFBLK/ LIMU(1074) ,LIML(1024) ,CL(41) ,OCL

1 LL,FACT , IRar , NDRZ

2 NUPPER, NR91T ,BIGD ,LMIN

3 UMAX, ~lIN , ~lI\X , RZERO

4 NOFFP , NSPIlAL , SPV , BIGEST

CCM1CN /CVAL/ CV

11=10

HPI = U + I

JI = JO

JIPI = .Jl + 1

HI = Z(Il+NX*(JI-l»

H2 = Z(II+NX*(JIPI-I»

1I3 = Z(IlPl+NX*(JIPl-l»

H4 = Z(IIPI+NX*(JI-I»

C PRINT 901, HI, H?,II3, H4

901 FORMAT (lH 9EI4. 7)

IF (NOFFP.NE.I) GO 'TO 1m

IF (IIl.EQ.SPV.OR.m. EQ.SPV.OR.H3.EQ. SPV.OR.H4.EQ.SPV) RETURN

101 IF (nUNI (HI, m, H3, H4) .GI'.CL(NCL)) RETURN

c

C For each contour level, decicie which of the Hi basic

C siturations exists, then inteq:::olate in tw::>-space to fin'!

C the end points of the contour line segrr'Cnt within this cell.

C

co HI K=l,NCL

CV = CL(K)

C PRINT 901,CV

Kl = (IFIX(SIGN(l. ,Hl-CV»+l)/2

K2 = (IFIX(SIGN(1.,H2-CV»+1)/2

K3 = (IFIX(SIGN(L ,1I3-CV»+1)/2

K4 = (IFIX(SIGN(1.,H4-cV»+1)/2

JUMP = 1+Kl+K2*2+K3*4+K4*R

C PRINT 900,Kl,K?,K3,K4,~lP

IFIJ3 = 4

IF (JUMP.EQ.LOR.JUMP.EQ.16) GO 'TO 10

C PRINT 904,JUMP,Il,IlPl,Jl,JlPl

C PRINT 9OS,Kl,Hl,K2,H2,K3,H3,K4,H4,CV

904 FOR!'lAT (111 5UO )

905 FOR!'1I\T (lH 4(I3,2X,F5.2),2X,FS.2)

10 CCNTINUE

Al = FLOAT(M(2*Il-l+2*NX*(Jl-l»)

A? = FLOAT(M(2*Il+2*NX*(Jl-l»)

."13 = F~\T(M(2*Il-l+2~~(JlPl-l»)

.'\4 = FLOAT(M(2*Il+2*NX*(JlPl-l»)

A-3D
A-31

102

103

104

105

106

107

AS = FLOAT(M(2*IIPl-l+2*NX*(Jl-l)))

A6 = FLOAT(M(2*IIPl+2*NX*(Jl-l)))

A7 = FLOAT(M(2*IIPl-l+2*NX*(JlPl-1)))

81 = FLOAT(M(2*Il-l+2*NX*(JIPl-l) )-~1( 2*Il-l+2*NX*(Jl-l)) )

B2 = FLOAT(M(2*Il+2*NX*(JlPl-l))-M(2*Il+2*NX*(Jl-l)))

AP = FLOAT(M(2*IlPl+2*NX*(JlPl-l)))

B31 = FLOAT(M(2*IIPl-l+2*NX*(JlPl-1))-M(2*Il-1+2*NX*(JlPl-1)))

B41 = FLOAT(M(2*IIPl+2*NX*(JlPl-1))-M(2*Il+2*NX*(JlPl-1)))

Bll = FLOAT(M(2*IIPl-l+2*NX*(Jl-l))-M(2*Il-l+2*NX*(Jl-l)))

D21 = FLOAT(P'(2*IIPl+2*NX*(Jl-l))-M(2*Il+2*NX*(Jl-l)))

B3 = FLOAT(M(2*IIPl-l+2*NX*(Jl-l))-M(2*IlPl-1+2*NX*(JlPl-1)))

84 = FLOAT(M(2*IIPl+2*NX*(Jl-l))-M(2*IlPl+2*NX*(JlPl-1)))

IF (JUMP.EQ.l) GO TO 112

IF (JU]~P.EQ.2) GO TO 103

IF (JUMP.EQ.3) GO TO 105

IF (JUMP.EQ.4) GO TO 106

IF (JUMP.EQ.S) GO TO 107

IF (JUMP.EQ.6) GO TO 102

IF (JUMP.EQ.7) GO TO 108

IF (JUMP.EQ.8) GO TO 109

IF (JUMP.EQ.9) GO'IO 109

IF (JUMP.EQ.IO) GO TO 108

IF (JUMP.EQ.ll) GO TO 104

IF (JUMP.EQ.12) GO TO 107

IF (JUMP.EQ.D) GO TO 106

IF (JUMP.EQ.14) GO TO 105

IF (JUMP.EQ.lS) GO TO 103

IF (JUMP.EQ.16) GO TO Ul

IDUD = 1

RA = R(Hl. H2)

MUA = Al + RA*Bl

MVA = A2 + RA*B2

RB = R(Hl.H4)

MUD = Al + RB*Bll

MVB = A2 + RB*B21

GO TO 110

IDllB = -1

RA = R(H2.Hl)

MUA = A3 - RA*Bl

MVA = A4 - RA*B2

RB = R(H2.H3)

MUD = A3 + RB*B31

MVB = A4 + RB*B41

GO TO 110

RA = R(H2,H3)

MUA = A3 + RA*B31

MVA = A4 + RA*B41

RB = R(Hl.H4)

MUB = Al + RB*BU

MVD = A2 + RB*B21

GO TO 110

RA = R(H3.H2)

MUA = A7 - RA*B31

MVA = A8 - RA*B41

RB = R(1l3,H4)
NlJD =1>7 + RR*B3

MVB = liP + RB*B4

IOOB = 0

GO 'ID 110

W8 RA = R(1I2,Hl)

MUA = A3 - RA*Bl

MVA = A4 - RA*B7

RI3 = R(H3,H4)

MUD = 1\7 + RB*E3

~IVB = .'\8 + RB*B4

GO 'ID llO

109 RA = R(H4,Hl)

~IU'\ = A5 - Rl>*Illl

~IVI\ = 1\6 - W\*B21

RB = R(H4, 113)

MUB = A5 - RB*B3

MVB = 1\6 - RB*B4

IDlJD = 0

110 CCNTINUE

C PRINT 901, Rl'., RB

C PRINT ?OO,MUA,t"M'.,MUD,mIB, I DUB , IFLG

C!\IL DRJ\H(~:UA,MW"MUB,MVB,l)

IFLG = 4

900 FORMl,T (Hl 13Il0 )

IF (IDUE) 109,111,107

III ca.'TINUE

112 RETURN

END

A-32
SUI3ROlJI'ItI.'E DRAW (~1Xl •t1Yl , ~.~ •m2, KFIN:; )

c

C This routine draws the visible p:lrt of tho 1 ine connecting

C (~1Xl,MYl) and U1X~.m2). 'Ihe variable KFlAG is used to

C specify ,>,hicD mcde the subroutine uses:

C I-Draw visible p:1rt of lin"

C ?~\RKs the visibility arrays

C 3-I1oth marks and draws

C

55

c

C

C

1

C

900

*

*

*

*

LCGICi'L*l VIS] •VIS?

CG1t1CN /SRFPIK/ I.IMU(1024) ,LIML(10?4) ,CI.(41) ,NCL ,

LL , FAC..T , IRar ,~!DRZ

NUPPER , NRSliT , BIGD , UHN

IMAX , vrlIN , Vf'1TIX ,RZERO

NOFFP ,NSPVI\L, SPIT ,IlIGEST

DATA STEEP/5./

ITFG = 1

IF (KFLAG.LT.4) GO TO 55

ITFG = KFU.G

KFLAG = KFLAG - 3

GO TO (1,2.3) KFLAG

DRAW

1ORI\H = 1

IMARK = 0

PRINT 900,MXl,ml.~?,~1Y2.KFLAG. 1ORAW, IM.'-RK

FO~lAT( HIe DIlO)

GO TO 101

C

C

C

:;> 1OR1\\'I = 0

IM.'-RK = 1

GO TO 101

C

C

C

3

ORJlloI and l'i\RK

IDRAII = 1

IM.'-RK = 1

A-33

~~IXl = 1-1X]

~~l = MYI

~MX2 = ~1X2

MMY7 = MY?

IF (~MXl. EQ.NSPVAL.OR.~lMX2.EQ.NSPVI\L)

LCGICl\L*l BAD

Bl\D = MXl.GT.IO?4

BAD = MYI.Gr.1024.0R.BAD

I1/ID = MX2.GT.I024.0R.Ili'.D

BAD = t1Y2.GT.I024.0R.BAD

BAD = MXl.LT.l .OR.BAD

BAD = ml.LT.l .OR.BAD

C

C M.'-RK line left to right.

C

101
BAD = 1'\)(2. LT. 1 .OR.R\!)

BAD = MY2.LT.1 .OR.BAD

IF(Bi\D) RETURN

IF (a:Xl.GT.MMX?) GO TO 102

NX1 = r·1M)(1

NY1 = 1'll1Y1

NX? = MMX?

NY2 = 1'1'!Y2

GO TO 103

102 NX1 = MMX2

NY1 = f'1l1Y2

NX2 = f'1MX1

NY2 = ~1l1Y1

H13 IF (NUPPER. LT. 0) GO TO 11 C)

C

C Check upper visibility.

C

VIS1 = NYl.GE. (LmU(NXl )-1)

VIS::> = NY2.GF:. (LIMU(NX2)-l)

C PRINT 900, NX1, NY1, NX2 ,NY2, VISL VIS2, LII1U(NXl ) ,LL'1U(NX2)

C

C VIS1 and VIS? TRUE m"'oDS visible.

C

IF (VIS1.~ID.VIS2) GO TO 113

C

C VIS1 or VIS2 fal se means invisible.

C

IF (.KlT.(VISl.OR.VIS2) GO TO 119

A-34

C

C

C

104

105

106

107

108

109

110

Find chonge point.

IF (NX~.EQ.~:X?) GO TO 112

DY = FIDAT(NY2-NY1 )/FIDAT(NX2-NX1)

NXIP1 = NXl + 1

FNY1 = NYl

IF (VIS1) GO TO 107

DO 104 K=NX1P1,1:x2

MX = K

NY = FNY1 + FWAT(K-NXl )*DY

IF (MY.Gl'.LINU(K» GO TO 105

CCNTINUE

IF (lIBS(DY) .GE.STEEP) GO TO 110

NXl = MX

NY1 = /1Y

GO TO 113

DO lOR K=NX1P1,NX2

MX = K

MY = FNY1 + FLOAT(K-NXl )*DY

IF (MY.LT.LIf'1U(K» GO TO 109

CCNTINUE

IF (l\BS(DY) .GE.STEEP) GO TO 111

NX2 = MX

NY2 = MY

GO TO 113

IF (LIr1U(NX) .£0.0) GO TO 106
NXl = MX

NY1 =LIMU(NXl)

GO TO 113

111 NX2 = MX

NY2 = LIMU(NX2)

GO TO 113

112 IF (VIS1) NY2=MINO(LIMU(NXl).LIMU(NX2»

IF (VIS1) NY1=MINO(Lll1U(NXl).LIMU(NX2»

113 IF (IDRAW.EQ.O) GO TO 116

C

C Draw visible pn.rt of line.

C

IF (IROT) 114,115,114

114 CALL SEG(NY1,1023-NXl,NY2,1023-NX2,rrFG)

GO TO 116

U5 CALL SEG(NXl,NY1,NX2,NY2,rrFG)

U6 IF (IMI\RK.EQ.O) GO TO 119

IF (NXl.EQ.NX2) GO TO 118

DY = FIDAT(NY2-NYl)/FWAT(NX2-NXl)

mY1 = NY1

DO 117 K=NXl, NX2

LIMU(K) = FNY1 + FIDAT(K-NXl )*DY

117 CCNTINUE

GO TO 119

U8 LIMU(NXl) = Ml\XO(NY1,NY2)

119 IF (NUPPER) 120,120,138

c

C Same idea as above, but for l~r side.

C

120 IF (I-MXl.Gr.M1X2) GO TO 121

NXl = MMXl

NY1=M1Yl

NX2 =I-t1X2

NY2=~

GO TO 122

121 NX1 = M1X2

NY1=MMY2

NX2 = MMXl

NY2 = ~MYl

122 VIS1 = NYl.IE.(LIML(NXl)+1)

VIS2 = NY2.lE.(LIML(NX2)+1)

IF (VIS1.~JD. VIS2) GO TO 132

IF (.tm. (VISl.ffi.VIS2» GO TO 138

IF (NXl.EQ.NX2) GO TO 131

DY = FIDAT(NY2-NYl) /FlDAT (NX2-NXl )

NXlP1 '" NXl + 1

FN'f1 '" NY1

IF (VIS1) GO TO 126

DO 123 K=NXIP1,NX2

MX = K

MY = FNY1 + FlDAT(K-NXl )*DY

IF (MY.LT.LIML(K» GO TO 124

123 CCNTINUE

124 IF (ABS(DY) .GE.srEEP) GO TO 129

125 NXl = MX

A-35
NYI = ~W

GO TO 13?

12(, IX) 127 K=NXIPl,NX2

~:x = K

,W = FNYI + FlDi\T{K-NXl )*DY

IF (llY.Gr.U~IL(K» GO TO 128

127 CCNTIt.'UE

12[1 IF (lllS{DY) .GE.crEEP) GO TO 130

NX2 = t1X

NY? = IW

GO TO 132

129 IF (LHlL(MX) .00.107.4) GO TO 1?5

'-'Xl = 11X

NYI = LUlL(NXl )

GO TO 132

130 NX2 = l-lX

NY2 = LI~lL{NX2)

GO TO 132

131 IF (VISl) NY2 = 11J>.x0{LHlL{NXI) ,U~.L(NX?))

IF (VIS?) NYI = ~1J>.xO(LUIL{NXI ),LmL(I:x2»

13? IF (lORAII.EQ.O) GO TO 135

IF (IROT) 133,134,133

133 Cl~ SEG{NYl,1023-NXl,t.~2,1023-NX2,ITFG)

GO TO 135

134 CALL SEG (NXl, NYI ,NX2 ,t.~2, ITFG )

135 IF (IMARK.E0.0) GO TO 138

IF (NXI.OO.NX2) GO TO 137

DY = FIDAT(NY2-NY1 )/FIDAT(NX2-NXl)

FNYI = NYI

IX) 13n K=NXl, NX2

LIML{K) = !'NY1 + FIDAT(K-NXI )*DY

136 CcwrINUE

RETURN

137 LUlL{NXl) = MIKJ(NYl,NY2)

138 RETURN

END

A-36
A-37

7

10

66

6

C

C

PRCX;PJ>M PWTER

LOGICfL*l FIRST,YY,IY

INTEGER XlGl\( 7) ,X7.GA( 7) ,YIGI,( 7) ,Y2C',A( 7) ,)WI.( 17) ,XIlA( 17),

* X~(I7),XDA(17)

INTEGER CHEl\D (48) , mEAD (l(1 ) ,FiliP, 1'.0.1, 1\RP

DI~lENSIOO CVMD(fl) ,S(3) ,JlIF'J'.D(7.0)

DATA YY/'Y'/

DATA I\LP/' ('/,ARP/') '/,/01/' ,'/,FIRST/.TRUE./

NC = (1

NN = °

DLINE = 4.

~llIG = .8

TYPE *,' THE CURRENT PLOT r1f\.GNIFI~TICN IS •["

TYPE *,' DC YOU HANT 'fC Cl1i\NGE PLOT ~llIGnFICATION? (Y/N) ,

JI.CCEPT' <>050, IY

9050 FOR!'llIT (/I,ll

IF (IY.GT.90) IY = IY - 32

IF (IY.NE.YY) GO TO 5

TYPE *,' ENTER ~1!'GNIFICATIOO FF,C'fCR-DECIHAL'

ACCEPT' S06, fl-:AG

906 FORr-lr'\T (F12. 7)

5 CCNTINUE

ClLL PLOTS(O,O,O)

PLOT (0.0,0.75,-3)

HT = fl.O

NO = I

OPEN (UNIT=4, N"NE=' PLOT. [)l,T' ,TYPE=' OW' ,FOR'l=' UNFORMATTED' ,

* !\CCESS=' DIRECT' ,ISSCCIA'l'E\lARI!\BLE=NO, RECORDS IZE=lO )

00 6 K=I,4

READ (4'1'10) HT,(GlEJID(I),I=I,13),NVAL

PRINT 900,NVAL

PRINT 9OI,fIT

CAIL SYMBOL (0.0, fIT, .I,Cfill'\D(I) ,0.0,24)

CCNTINUE

READ (4'NO) XIG,X2G,YIG,Y2G,ZCMAX

READ (4'1'10) S(l),S(2),S(3),NY,NX

NY=NY-1

NX=NX-1

!Xl 7 1=1, NVl\L

REtill (4 'NO) HT, CVALQ

PRINT 900, NVAL

PRINT '?Ol,fIT

CALL SYMBOL (O.O,fIT, .1,CVAL(l,O.O,l?)

COOTINUE

READ (4 'NO) XDIST, IHEl\D

TYPE *,' ENTER 40 CHARJI.CTER PLOT TITLE'

ACCEPT' SlOSS, Jlill'\D

9055 FOR!'llIT (201\2)

C PRINT '?Ol,XDIST

CALL S~ffiOL (XDIST+1.,6.5,.1,J}~~,0.0,40)

CCNTlNUE

AXO = AX

AYO = AY

READ (4 'NO) AX,/I.Y,IPC

AX = AX*H1I\G + 1.

c

c
A-38

11

12

13

131

132

14

1R

900

C

903

901

902

20

21

:?2

C

AY = AY*FW.G - .75

IF (AXO.NE.O.O) GO TO 11

XD=AX

YD = AY

YCl'·!l\X = YMAX

YMAX = .'\MAXI (YCWIX, AY)

IF (YCir-'JAX. EQ. ¥.'ll\X) GO TO 12

XO = .l\X

IF (NN .EQ.O.IIND.FIRST) GO TO 18

IF (ABS(AXO-AX) .GI'.DLlNE) NN = NN + 1

IF (NN.NE.O) GO TO 13

XB=AX

YB = AY

IF (l£S(S(l» .LT.ABS(S(2») GO TO 131

IF (NN.NE.NX) GO TO IP

GO TO 132

IF (NN.NE.NY) GO TO 18

IF (NC.NE.O) GO TO 14

XC = AX

YC = AY

NC=NC+1

CCNTlNUE

XA = AXO

YA = Am

FIRST = .FALSE.

FOR!'ll\T (lH 13010)

PRINT 903,AX,AY,IPC,NO,~~,AXo,Am

FO~\T (lH 2F12.4,317,2F12.4)

FORMAT (lH 9F12.4)

IF (IPC.EQ.O) GO TO 20

IF (AX.EQ.-9999.) GO TO 20

Cl\LI.. PUYr (1'X, AY, IPG)

GO TO 10

FORrll,T (Ff> • 3 )

CCNTlNUE

IF (XA. LT .XC) GO TO 21

XS = xc

xc = XJI.

XA = XS

YS = YC

YC = YA

Yf'.. = YS

CONTINUE

IF (XD.Gr.XB) GO TO 22

XS = XB

XB=XD

XD = XS

YS=YB

YB=YD

YD = YS

CONTINUE

TYPE 901,XA, YA,XB, YB,XC, YC,XD, YD,XlG,X2G, YIG, Y2G

ENCODE(6,902,Xl~~)XIG

ENCODE(6,902.X2GA)X2G

ENCODE(6,902,YlGA)YlG
A-39

c

c

c

C

905

25

30

c

35

40

c

45

50

c

55

60

100

125

130

135

140

ENCODE(6,902,Y2GA)Y2G

TYPE 905,XIGA

TYPE 905,X2GA

TYPE 90S, YlGA

TYPE 905, Y2GA

FORMAT (lH 281\2)

IF (ABS(S(1)).LT.ABS(S(2))) GO TO 200

IF (S(l) .L'I'.O.O) GO'IO 100

XAA( 1) = ALP

!Xl 25 I=l, 3

X~(I+l) = XlGA(I)

XM(5) = A01

!Xl 30 I=1,3

XAA( H5) = YlGA( I)

XAA(9) = ARP

TYPE 905,XAA

XBlI.( 1) = ALP

!Xl 35 I=l, 3

XBA(I+l) = X2GA(I)

XBA(5) = AGI

IX) 40 I=l, 3

XBA(I+5) = YIGA(I)

XBA(9) = ARP

TYPE 905,XBA

XCA(l) = ALP

!Xl 45 I=l,3

XCA(I+l) = XIG\(I)

XCA( 5) = 1\01

IX) 50 I=l,3

XCA(I+5) = Y2GA(I)

XCi\( 9) = ARP

TYPE 905,XCi\

XDA(l) = ALP

!Xl 55 I=l,3

XDI\(Hl) = X2GA(I)

XDA(5) = A01

IX) 60 I=l,3

XDA(I+5) = Y2GA(I)

XDI\( 9) = ARP

GO 'IO 500

XAA(l) = ALP

!Xl 125 I=l,3

XAA(I+1) = X2GA(I)

XAA(5) = A01

IX) 130 I=l,3

XAA(H5) = Y2GA(I)

XAA(9) = ARP

XBl\( 1) = ALP

!Xl 135 I=l,3

XBA(I+l) = X1GA(I)

XBA(5) = A01

lX) 140 I=l,3

XBA(H5) = Y2GA(I)

XBA(9) = ARP

XCA(l) = ALP
DO 145 1=1,3

145 XCA(I+l}= X2GA(I}

XCA(5)= ACM

JX) 150 1=1,3

150 XCA(I~5)= YlGA(I)

XCA(9)= ARP

XDA(I)= ALP

DO 155 1=1,3

155 XDA(I+l}= XlGA(I)

XDr\(5)= ACM

DO 160 1=1,3

160 XDA(I+5)

= YlGA(I)

XDA(9)= ARP

GO TO 500

200 IF (S(2).LT.O.0) GO TO 300

XAA(I}= ALP

DO 225 1=1,3

225 XAA(I+l}= X2GA(I)

XAA(5)= ACM

JX) 230 1=1,3

230 XAA(I+5)= YlGA(I)

XAA(9)= ARP

XBA(I)= ALP

DO 235 1=1,3

235 XBA(I+l)

= X2GA(I)

XBA(5)= AOI

JX) 240 1=1,3

240 XBA( I+5)

= Y2GA( I)

XBA(9)= ARP

XCA(I)= ALP

DO 245 1=1,3

245 XCA(I+l)

= XlGA(I)

XCA(5)= AOI

[D 250 1=1,3

250 XCA(I+5}= YlGA(I)

XCA(9)= ARP

XDA(l}= AlP

DO 255 1=1,3

255 XDA(I+l}= XlGA(I)

XDr\(5}= AOI

JX) 260 1=1,3

260 XDA(I+5}= Y2GA(I}

XDr\(9)= ARP

GO TO 500

300 XAA(I)

= ALP

DO 325 1=1,3

325 XAA(I+l)= XlGA(I)

XAA(5}= AGI

ro 330 1=1,3

330 XAA(I+5)

= Y2GA(I)

XAA(9)= ARP

XBA(l)= AlP

DO 335 1=1,3

335 XBA(I+l)

= XlGA(I)

XBA(5}= AGI A-40
IX) 340 1=1,3

340 XDII( 1+5) = YI G.'. ( I)

XDi'.(g) = ,'RP

XO\(1) = i\LP

IX) 345 1=1,3

345 XC,(1+1) = X?GA(I)

Xo\(5) = N~1

IX) 350 1=1,3

350 XC'(I+5) = Y?GA(I)

Xo\(9) = P£P

XDA(1) = ALP

IX) 355 1=1,3

355 XDA(I+1) = X2GP,(I)

XDA( 5) = i\G1

IX) 3(.0 1=1,3

360 XDil( I+5) = YIGi\(I)

XDA(9) = ARP

C TYPE ~05,XD~

500 OiliL SY!',mOL (Xll-.5,Yll-.75, .075,XlJl',f\.O,17)

CALL SYl-IBOL (X1>-.75,YA+.75,.(l75,XAA,O.(),17)

C,LL SYMBOL (XC-.75,YC+.25,.075,XCA,O.O,17)

CALL SYI'IDOL (XD-.75,YD-.25,.075,XDA,O.O,17)

CALL l.U'lEER (XO,YI';",X+.l,.l,ZCYJlX,O.f\,l)

C'11" PLOT(0.,O.,+99°)

STOP

END

A-41

APPENDIX B

TYPICAL PLOTS OF FLUX-MAPPER DATA

B-1

(8.000, -7. 990)

(-8.000, -7. 990)

2

9710 kW/m

INCHES -.

Figure B-1. A Typical Flux Map Along a Concentrator Focal Plane

B-3
-8.00,7.50 8.00 .7.50

............................; : : , ..: .

·""'"-'"---....;..~·I ..............................::: ; ; : :; . ... .

. .................: ; : : . .. . .... .. .... : : ; . .... .. .. . .. " ; ; -.- : . ..

.. .

. .. . .. : ; : . .. . ..

.. ..

.'.. j ."-1" .. ;..

.... ..

....; ; ; ; ; ; .

.... .

:::t·:::-::::-T·T:····: :::rT..rJ':·;::JJ:,:r:,:::I:j·::··:· ..::·:L:: :.. '''T: ::::::: .....

..":"":"..:---.:".:",.:".. ''''i....:,,'':.':.':...:''.:''.tJ~""'----,--"--,-'-,---'-=--'"-,----'""'--...:"'"----'.'"..~""'----,--'"---'--'--i,--n:"..J

-8.00.-8. I .00.-8.01

Figure B-2. A Typical Contour Map at a Concentrator Focal Plane

(Contour software not listed in this report, but

available from SNLA.)

B-4 vU.S. GOVERNMENT PRINTING OFFICE:1985_544_063110827



DOE/JPL-I060-78 SOFTWARE USED WITH THE FLUX MAPPER AT THE SOLAR PARABOLIC DISH TEST SITE DOE